From e0a37c9e32da767d8644ff4868f63480f45992e5 Mon Sep 17 00:00:00 2001 From: trifonnt Date: Sat, 18 Oct 2008 11:49:12 +0000 Subject: [PATCH] integrated Web POS 1.7.3. --- posterita/.classpath | 36 + posterita/.project | 18 + .../.settings/org.eclipse.jdt.core.prefs | 328 + posterita/.settings/org.eclipse.jdt.ui.prefs | 10 + posterita/.tomcatplugin | 11 + .../BuildPatch/Adempiere/jboss/bin/run.conf | 53 + .../Migration/1.0-1.5 (AD331b)/build.xml | 50 + .../oracle/001_ad_changes.sql | 32 + .../oracle/002_ad_message.sql | 65 + .../oracle/003_m_pricelist.sql | 5 + .../postgresql/001_ad_changes.sql | 32 + .../postgresql/002_ad_message.sql | 65 + .../postgresql/003_m_pricelist.sql | 5 + .../commons/Migration/1.6(AD340)/build.xml | 50 + .../oracle/001_ad_Changes for C_Currency.sql | 14 + .../1.6(AD340)/oracle/002_ad_message.sql | 11 + .../1.6(AD340)/oracle/003_C_Currency.sql | 2 + .../001_ad_Changes for C_Currency.sql | 14 + .../1.6(AD340)/postgresql/002_ad_message.sql | 18 + .../1.6(AD340)/postgresql/003_C_Currency.sql | 2 + posterita/commons/Migration/1.7.0/build.xml | 50 + .../1.7.0/oracle/001_MixedPayment.sql | 24 + .../002_Terminals_newTableStructure.sql | 629 ++ .../003_Terminals_TransferConfiguration.sql | 75 + .../oracle/004_Terminals_newTableDDL.sql | 4 + .../Migration/1.7.0/oracle/005_Messages.sql | 190 + .../1.7.0/postgresql/001_MixedPayment.sql | 24 + .../002_Terminals_newTableStructure.sql | 629 ++ .../003_Terminals_TransferConfiguration.sql | 75 + .../postgresql/004_Terminals_newTableDDL.sql | 4 + .../1.7.0/postgresql/005_Messages.sql | 189 + posterita/commons/Migration/1.7.1/build.xml | 50 + .../1.7.1/oracle/001_M_Inventory.sql | 2 + .../1.7.1/postgresql/001_M_Inventory.sql | 2 + posterita/commons/Migration/1.7.2/build.xml | 50 + .../Migration/1.7.2/oracle/001_ADRole.sql | 3 + .../Migration/1.7.2/postgresql/001_ADRole.sql | 3 + posterita/commons/Migration/oracle.properties | 6 + .../Migration/oracle.properties.template | 6 + posterita/commons/Migration/trunk/build.xml | 50 + .../Migration/trunk/oracle/002_ADMessage.sql | 14 + .../Migration/trunk/oracle/003_AD_OrgInfo.sql | 1 + .../oracle/004_AD_Changes for AD_OrgInfo.sql | 15 + .../Migration/trunk/oracle/005_MissingIDs.sql | 20 + .../trunk/oracle/006_PackSize_MProduct.sql | 10 + .../trunk/oracle/007_CashPayment.sql | 85 + .../trunk/postgresql/002_ADMessage.sql | 18 + .../trunk/postgresql/003_AD_OrgInfo.sql | 1 + .../004_AD_Changes for AD_OrgInfo.sql | 15 + .../trunk/postgresql/005_MissingIDs.sql | 20 + .../postgresql/006_PackSize_MProduct.sql | 10 + .../trunk/postgresql/007_CashPayment.sql | 87 + posterita/commons/build.xml | 75 + posterita/commons/properties.xml | 17 + posterita/posterita/build.properties | 1 + posterita/posterita/build.xml | 151 + posterita/posterita/properties.xml | 17 + .../aspect/org/posterita/aspect/POAspect.aj | 83 + .../aspect/org/posterita/aspect/TrxAspect.aj | 36 + posterita/posterita/src/ear/application.xml | 24 + .../main/ApproveOrderEmailTemplate.properties | 6 + .../CreateCustomerEmailTemplate.properties | 12 + .../main/CreateOrderEmailTemplate.properties | 6 + .../posterita/src/main/Factory.properties | 127 + .../src/main/MessageResources.properties | 1262 ++++ ...ShipmentDispatchedEmailTemplate.properties | 6 + .../posterita/src/main/displaytag.properties | 20 + .../main/org/compiere/model/I_AD_OrgInfo.java | 203 + .../main/org/compiere/model/I_AD_Role.java | 498 ++ .../main/org/compiere/model/I_C_CashLine.java | 265 + .../main/org/compiere/model/I_C_Currency.java | 202 + .../main/org/compiere/model/I_C_Invoice.java | 803 ++ .../main/org/compiere/model/I_C_Order.java | 977 +++ .../main/org/compiere/model/I_C_Payment.java | 1093 +++ .../org/compiere/model/I_M_InventoryLine.java | 266 + .../org/compiere/model/I_M_PriceList.java | 212 + .../main/org/compiere/model/I_M_Product.java | 741 ++ .../org/compiere/model/I_U_POSTerminal.java | 411 + .../src/main/org/compiere/model/MCash.java | 780 ++ .../main/org/compiere/model/MCashBook.java | 170 + .../org/compiere/model/MElementValue.java | 262 + .../src/main/org/compiere/model/MInvoice.java | 2370 ++++++ .../src/main/org/compiere/model/MOrder.java | 2330 ++++++ .../src/main/org/compiere/model/MPOS.java | 134 + .../main/org/compiere/model/MPOSTerminal.java | 137 + .../src/main/org/compiere/model/MPayment.java | 2467 ++++++ .../main/org/compiere/model/MSequence.java | 1621 ++++ .../main/org/compiere/model/MWarehouse.java | 247 + .../main/org/compiere/model/X_AD_OrgInfo.java | 384 + .../main/org/compiere/model/X_AD_Role.java | 1015 +++ .../main/org/compiere/model/X_C_CashLine.java | 537 ++ .../main/org/compiere/model/X_C_Currency.java | 337 + .../main/org/compiere/model/X_C_Invoice.java | 1731 +++++ .../main/org/compiere/model/X_C_Order.java | 2117 ++++++ .../main/org/compiere/model/X_C_Payment.java | 2242 ++++++ .../org/compiere/model/X_M_InventoryLine.java | 477 ++ .../org/compiere/model/X_M_PriceList.java | 388 + .../main/org/compiere/model/X_M_Product.java | 1440 ++++ .../org/compiere/model/X_U_POSTerminal.java | 774 ++ .../org/compiere/report/ReportStarter.java | 1123 +++ .../src/main/org/posterita/Constants.java | 825 ++ .../src/main/org/posterita/TangoColors.java | 37 + .../main/org/posterita/beans/AddressBean.java | 157 + .../main/org/posterita/beans/AgingBean.java | 232 + .../beans/ApplicationParametersBean.java | 54 + .../org/posterita/beans/AttachmentBean.java | 35 + .../org/posterita/beans/AttributeBean.java | 227 + .../beans/AttributeInstanceBean.java | 93 + .../beans/AttributeValueDetailBean.java | 95 + .../posterita/beans/AttributeValuesBean.java | 155 + .../posterita/beans/AttributeValuesPair.java | 139 + .../beans/AvailableProductSizeBean.java | 69 + .../org/posterita/beans/BPartnerBean.java | 256 + .../org/posterita/beans/BPartnerInfoBean.java | 264 + .../org/posterita/beans/BankAccountBean.java | 96 + .../main/org/posterita/beans/BankBean.java | 84 + .../beans/BankStatementLineBean.java | 114 + .../org/posterita/beans/BlackListedBean.java | 53 + .../main/org/posterita/beans/CashBean.java | 141 + .../org/posterita/beans/CashBookBean.java | 155 + .../posterita/beans/CashBookDetailBean.java | 247 + .../org/posterita/beans/CashLineBean.java | 130 + .../org/posterita/beans/CashSummaryBean.java | 148 + .../beans/ChangeDocumentStatusBean.java | 83 + .../posterita/beans/ChangePasswordBean.java | 64 + .../org/posterita/beans/CheckoutBean.java | 375 + .../org/posterita/beans/CloseTillBean.java | 142 + .../main/org/posterita/beans/CommandBean.java | 53 + .../org/posterita/beans/CommissionBean.java | 160 + .../org/posterita/beans/CreditCardBean.java | 108 + .../org/posterita/beans/CreditCheckBean.java | 53 + .../beans/CreditPaymentDetailsBean.java | 160 + .../org/posterita/beans/CurrencyBean.java | 66 + .../beans/CurrentTillAmountBean.java | 88 + .../org/posterita/beans/CustomerBean.java | 584 ++ .../org/posterita/beans/DateFilterBean.java | 151 + .../beans/DisplayMessageLogBean.java | 115 + .../org/posterita/beans/DocumentBean.java | 84 + .../beans/DocumentHistortFilterBean.java | 80 + .../posterita/beans/DocumentHistoryBean.java | 248 + .../main/org/posterita/beans/DunningBean.java | 105 + .../org/posterita/beans/EditPriceBean.java | 62 + .../main/org/posterita/beans/FilterBean.java | 137 + .../posterita/beans/GenericProductBean.java | 167 + .../org/posterita/beans/InOutHistoryBean.java | 113 + .../org/posterita/beans/InventoryBean.java | 166 + .../posterita/beans/InventoryCartBean.java | 177 + .../posterita/beans/InventoryLineBean.java | 475 ++ .../posterita/beans/InvoiceHistoryBean.java | 101 + .../main/org/posterita/beans/ItemBean.java | 531 ++ .../main/org/posterita/beans/LocatorBean.java | 116 + .../main/org/posterita/beans/LoginBean.java | 76 + .../posterita/beans/MMovementCartBean.java | 84 + .../org/posterita/beans/MenuItemBean.java | 102 + .../main/org/posterita/beans/MessageBean.java | 126 + .../posterita/beans/MessageLoggerBean.java | 58 + .../posterita/beans/MinOutHistoryBean.java | 44 + .../org/posterita/beans/OpenItemBean.java | 284 + .../main/org/posterita/beans/OrderBean.java | 172 + .../org/posterita/beans/OrderHistoryBean.java | 339 + .../org/posterita/beans/OrderInfoBean.java | 149 + .../OrderLineAttributeSetInstanceBean.java | 47 + .../org/posterita/beans/OrderLineBean.java | 476 ++ .../beans/OrderLineImporterBean.java | 28 + .../src/main/org/posterita/beans/OrgBean.java | 170 + .../org/posterita/beans/OrgUsersBean.java | 60 + .../src/main/org/posterita/beans/POSBean.java | 234 + .../posterita/beans/POSDescriptionBean.java | 55 + .../main/org/posterita/beans/POSHelpBean.java | 51 + .../org/posterita/beans/POSHistoryBean.java | 214 + .../main/org/posterita/beans/POSInfoBean.java | 107 + .../org/posterita/beans/POSReportBean.java | 163 + .../org/posterita/beans/POSStockBean.java | 154 + .../org/posterita/beans/POSSupplierBean.java | 43 + .../beans/PaymentAllocationBean.java | 156 + .../main/org/posterita/beans/PaymentBean.java | 117 + .../posterita/beans/PaymentDetailsBean.java | 87 + .../posterita/beans/PaymentHistoryBean.java | 101 + .../org/posterita/beans/PaymentTermBean.java | 120 + .../org/posterita/beans/PaymentTypeBean.java | 47 + .../posterita/beans/PopulateHistoryBean.java | 37 + .../org/posterita/beans/PriceListBean.java | 280 + .../org/posterita/beans/PrintBarcodeBean.java | 64 + .../posterita/beans/ProductAttributeBean.java | 141 + .../beans/ProductAttributeValueBean.java | 69 + .../main/org/posterita/beans/ProductBean.java | 935 +++ .../posterita/beans/ProductCategoryBean.java | 42 + .../posterita/beans/ProductDetailsBean.java | 130 + .../org/posterita/beans/ProductImageBean.java | 158 + .../org/posterita/beans/ProductImageInfo.java | 59 + .../main/org/posterita/beans/ProductInfo.java | 131 + .../org/posterita/beans/ProductInfoBean.java | 27 + .../posterita/beans/ProductInstanceBean.java | 81 + .../posterita/beans/ProductKeywordsBean.java | 116 + .../org/posterita/beans/ProductPriceBean.java | 76 + .../org/posterita/beans/ProductQuery.java | 204 + .../beans/ProductRestrictionBean.java | 96 + .../posterita/beans/ProductSalesInfoBean.java | 82 + .../beans/ProductSalesSummaryBean.java | 67 + .../posterita/beans/ProductSearchBean.java | 43 + .../org/posterita/beans/ProductSpecsBean.java | 86 + .../posterita/beans/ProductStatusBean.java | 253 + .../posterita/beans/ProductSupplierBean.java | 52 + .../posterita/beans/RemoveSessionBean.java | 39 + .../main/org/posterita/beans/ReportBean.java | 293 + .../org/posterita/beans/ReportDataBean.java | 102 + .../org/posterita/beans/ReportImageBean.java | 151 + .../main/org/posterita/beans/RoleBean.java | 203 + .../beans/SalesAnalysisReportBean.java | 86 + .../beans/SalesAnalysisReportDataBean.java | 86 + .../org/posterita/beans/SalesDetailsBean.java | 209 + .../main/org/posterita/beans/SearchBean.java | 82 + .../org/posterita/beans/SearchOrderBean.java | 51 + .../main/org/posterita/beans/ShipperBean.java | 45 + .../org/posterita/beans/ShoppingCartBean.java | 71 + .../beans/StatementOfAccountBean.java | 87 + .../main/org/posterita/beans/StockBean.java | 347 + .../posterita/beans/StockMovementBean.java | 459 ++ .../posterita/beans/SynchronizationBean.java | 75 + .../beans/SynchronizeCollectionBean.java | 89 + .../beans/TShirtProductDetailsBean.java | 61 + .../beans/TabularReportRecordBean.java | 68 + .../src/main/org/posterita/beans/TaxBean.java | 81 + .../org/posterita/beans/TerminalBean.java | 398 + .../src/main/org/posterita/beans/TestMod.java | 17 + .../main/org/posterita/beans/TradeInBean.java | 56 + .../main/org/posterita/beans/TrendsBean.java | 121 + .../src/main/org/posterita/beans/UDIBean.java | 816 ++ .../src/main/org/posterita/beans/UDIPair.java | 128 + .../main/org/posterita/beans/UserBean.java | 355 + .../main/org/posterita/beans/VendorBean.java | 122 + .../org/posterita/beans/WarehouseBean.java | 187 + .../org/posterita/beans/WebDocumentBean.java | 609 ++ .../beans/WebDocumentHeaderBean.java | 194 + .../posterita/beans/WebInvoiceLineBean.java | 63 + .../posterita/beans/WebMinOutLineBean.java | 26 + .../org/posterita/beans/WebOrderLineBean.java | 489 ++ .../org/posterita/beans/WebStockBean.java | 49 + .../beans/WebstoreProductImageFileBean.java | 104 + .../org/posterita/beans/WebstoreUserBean.java | 127 + .../AbstractDocumentManager.java | 142 + .../businesslogic/AttributeValuesManager.java | 326 + .../posterita/businesslogic/BankManager.java | 333 + .../posterita/businesslogic/CashManager.java | 1409 ++++ .../businesslogic/CashTransferManager.java | 171 + .../businesslogic/ClientManager.java | 333 + .../businesslogic/CurrencyManager.java | 112 + .../posterita/businesslogic/CustomerCart.java | 161 + .../EditBulkProductFromFileManager.java | 336 + .../businesslogic/FileAttachmentManager.java | 30 + .../businesslogic/GenericStockManager.java | 280 + .../businesslogic/HistoryFilterBean.java | 76 + .../ImportPosProductManager.java | 338 + .../businesslogic/InvoiceManager.java | 1124 +++ .../businesslogic/LocationManager.java | 133 + .../posterita/businesslogic/LoginManager.java | 473 ++ .../posterita/businesslogic/MenuManager.java | 571 ++ .../businesslogic/MinOutManager.java | 777 ++ .../posterita/businesslogic/OrderManager.java | 482 ++ .../businesslogic/OrderReferenceManager.java | 356 + .../businesslogic/OrganisationManager.java | 609 ++ .../businesslogic/POSBpartnerInfoManager.java | 317 + .../businesslogic/POSClientManager.java | 319 + .../businesslogic/POSGoodsManager.java | 616 ++ .../posterita/businesslogic/POSManager.java | 2959 ++++++++ .../businesslogic/POSProductManager.java | 1476 ++++ .../businesslogic/POSStockManager.java | 934 +++ .../businesslogic/POSTerminalManager.java | 1165 +++ .../businesslogic/PartialPOSManager.java | 299 + .../PaymentAllocationManager.java | 372 + .../businesslogic/PaymentManager.java | 827 ++ .../businesslogic/PaymentTermManager.java | 316 + .../businesslogic/PostingManager.java | 78 + .../posterita/businesslogic/PrintManager.java | 398 + .../businesslogic/ProcessManager.java | 122 + .../ProductAttributeSetManager.java | 44 + .../posterita/businesslogic/ProductCart.java | 164 + .../businesslogic/ProductImageUploader.java | 241 + .../businesslogic/RegionManager.java | 112 + .../businesslogic/RoleMenuManager.java | 79 + .../businesslogic/SearchManager.java | 140 + .../businesslogic/ShoppingcartManager.java | 501 ++ .../businesslogic/StockInquiryManager.java | 117 + .../posterita/businesslogic/StoreManager.java | 139 + .../businesslogic/UDIMessageManager.java | 204 + .../administration/BPartnerManager.java | 1127 +++ .../administration/BarcodeManager.java | 477 ++ .../administration/BlackListedManager.java | 263 + .../administration/CheckSequenceManager.java | 51 + .../administration/CommissionManager.java | 349 + .../administration/CustomerManager.java | 1270 ++++ .../administration/DunningManager.java | 251 + .../administration/ImportCustomerManager.java | 402 + .../administration/PriceListManager.java | 1107 +++ .../ProductAttributeManager.java | 193 + .../administration/ProductImageManager.java | 484 ++ .../administration/ProductManager.java | 1056 +++ .../administration/RoleManager.java | 826 ++ .../administration/TaxManager.java | 415 + .../administration/UserManager.java | 641 ++ .../administration/UserRoleManager.java | 58 + .../administration/VendorManager.java | 473 ++ .../administration/WarehouseManager.java | 385 + .../businesslogic/core/AccountingManager.java | 139 + .../core/ApplicationManager.java | 88 + .../businesslogic/core/AttachmentManager.java | 310 + .../businesslogic/core/AttributeManager.java | 47 + .../businesslogic/core/ChargeManager.java | 45 + .../creditsales/CreditOrderManager.java | 909 +++ .../performanceanalysis/CSVReportManager.java | 165 + .../CustomPOSReportManager.java | 553 ++ .../performanceanalysis/POSReportManager.java | 3962 ++++++++++ .../POSSalesReportManager.java | 1049 +++ .../ReportDateManager.java | 260 + .../performanceanalysis/ReportManager.java | 263 + .../SalesAnalysisReportManager.java | 791 ++ .../product/GenericProductImpl.java | 69 + .../businesslogic/product/IProduct.java | 43 + .../stock/InventoryCartManager.java | 684 ++ .../businesslogic/stock/InventoryManager.java | 788 ++ .../businesslogic/stock/MMovementManager.java | 1405 ++++ .../businesslogic/stock/StockList.java | 69 + .../businesslogic/stock/StockManager.java | 1499 ++++ .../org/posterita/cashType/UDICashType.java | 33 + .../org/posterita/cashType/UDICashTypes.java | 78 + .../org/posterita/core/AbstractChart.java | 211 + .../org/posterita/core/AbstractParser.java | 95 + .../src/main/org/posterita/core/BarChart.java | 174 + .../org/posterita/core/BarLabelGenerator.java | 49 + .../core/CheckDuplicateEntities.java | 178 + .../org/posterita/core/Configuration.java | 310 + .../main/org/posterita/core/ContextId.java | 65 + .../core/CrossTabReportGenerator.java | 254 + .../main/org/posterita/core/DocStatusMap.java | 55 + .../org/posterita/core/EmailValidator.java | 171 + .../core/FactoryPropertiesManager.java | 50 + .../main/org/posterita/core/FileManager.java | 274 + .../posterita/core/FilePropertiesManager.java | 125 + .../main/org/posterita/core/I18nAdapter.java | 77 + .../main/org/posterita/core/ImageServer.java | 129 + .../main/org/posterita/core/InitWebEnv.java | 116 + .../main/org/posterita/core/Interpreter.java | 64 + .../main/org/posterita/core/JulianDate.java | 696 ++ .../org/posterita/core/KeyNamePairUtil.java | 97 + .../src/main/org/posterita/core/MenuItem.java | 750 ++ .../org/posterita/core/NameValuePair.java | 88 + .../posterita/core/PDFReportGenerator.java | 181 + .../core/PDFReportPageEventHelper.java | 107 + .../src/main/org/posterita/core/PieChart.java | 108 + .../org/posterita/core/PieLabelGenerator.java | 49 + .../org/posterita/core/PrintOrderApplet.java | 360 + .../posterita/core/RandomStringGenerator.java | 70 + .../src/main/org/posterita/core/Range.java | 81 + .../org/posterita/core/ReadKiaDemoData.java | 444 ++ .../org/posterita/core/SessionStorage.java | 514 ++ .../posterita/core/SimpleCalendarDate.java | 90 + .../posterita/core/SimpleReportGenerator.java | 178 + .../org/posterita/core/SystemObjects.java | 283 + .../org/posterita/core/TabularReport.java | 982 +++ .../org/posterita/core/TabularReport2.java | 472 ++ .../posterita/core/TabularReportMerge.java | 633 ++ .../org/posterita/core/TestStockInquiry.java | 25 + .../posterita/core/ThumbnailGenerator.java | 137 + .../org/posterita/core/TimeSeriesChart.java | 256 + .../posterita/core/TimestampConvertor.java | 294 + .../main/org/posterita/core/TmkJSPEnv.java | 63 + .../main/org/posterita/core/TrxPrefix.java | 38 + .../core/UDIFilePropertiesManager.java | 49 + .../src/main/org/posterita/core/UDIMap.java | 49 + .../src/main/org/posterita/core/UDIPair.java | 65 + .../posterita/core/UDIPropertiesManager.java | 53 + .../main/org/posterita/core/UpdateUsers.java | 60 + .../main/org/posterita/core/WebFacade.java | 26 + .../posterita/core/action/ClientAction.java | 127 + .../core/action/login/GenericLoginAction.java | 45 + .../org/posterita/core/bean/ClientBean.java | 173 + .../org/posterita/core/bean/ElementBean.java | 87 + .../core/businesslogic/ElementManager.java | 217 + .../core/businesslogic/ImportManager.java | 108 + .../core/exception/FileOpException.java | 37 + .../core/exception/IOOperationException.java | 46 + .../org/posterita/core/form/ClientForm.java | 42 + .../posterita/core/install/EnvSettings.java | 151 + .../posterita/core/install/POSInstall.java | 423 ++ .../core/utils/DisplayReportServlet.java | 95 + .../org/posterita/core/utils/Encrypter.java | 61 + .../core/utils/FormatBigDecimal.java | 46 + .../main/org/posterita/core/utils/IOUtil.java | 88 + .../posterita/core/utils/MonthConverter.java | 76 + .../org/posterita/core/utils/NumberUtil.java | 20 + .../core/utils/SimpleEmailLayout.java | 192 + .../decorator/HistoryCsvExportWrapper.java | 33 + .../decorator/HistoryPdfExportWrapper.java | 25 + .../decorator/HistoryRtfExportWrapper.java | 25 + .../posterita/decorator/HistoryWrapper.java | 151 + .../decorator/InventoryHistoryWrapper.java | 88 + .../InventoryMoveHistoryWrapper.java | 88 + .../posterita/decorator/PaymentDecorator.java | 50 + .../posterita/doctype/UDIDocSubTypeSO.java | 26 + .../doctype/UDIDocSubTypeSOValues.java | 123 + .../AllocatedAmtMoreThanOpenAmtException.java | 37 + .../AllocationAlreadyExistsException.java | 34 + .../exceptions/ApplicationException.java | 49 + .../AttachmentInvalidException.java | 39 + .../AttachmentNotFoundException.java | 36 + .../AttributeValueAlreadyExistsException.java | 35 + .../AttributeValuesDifferentException.java | 37 + .../exceptions/BPGroupException.java | 38 + .../BPartnerAlreadyExistException.java | 37 + .../BPartnerAlreadyExistsException.java | 36 + .../exceptions/BPartnerException.java | 39 + .../exceptions/BPartnerInvalidException.java | 38 + .../BPartnerNoLocationException.java | 38 + .../exceptions/BPartnerNotFoundException.java | 38 + .../BPartnerOverCreditLimitException.java | 35 + .../exceptions/BankAlreadyExistException.java | 39 + .../BarcodeAlreadyExistsException.java | 39 + .../exceptions/BirtEngineException.java | 38 + .../exceptions/CSVDataInvalidException.java | 37 + .../exceptions/CSVFileException.java | 41 + .../exceptions/CanNotAjdustTillException.java | 37 + .../exceptions/CanNotCloseTillException.java | 38 + ...anNotCreatePaymentAllocationException.java | 37 + .../CanNotDeleteOrderException.java | 38 + .../exceptions/CanNotMoveStockException.java | 39 + .../CannotCreateInventoryLineException.java | 39 + .../CannotDeactivatePaymentTermException.java | 38 + .../CannotInactivateProductException.java | 38 + .../CannotInactivateTaxException.java | 38 + .../CashBookAlreadyAssignedException.java | 32 + .../ClientAlreadyExistException.java | 39 + .../CloseStatusNotFoundException.java | 41 + .../CreditCardExpiryInvalidException.java | 39 + .../exceptions/CreditCardNumberException.java | 39 + .../CreditCardTypeNotSupportedException.java | 39 + .../CreditCardVVInvalidException.java | 39 + .../CustomerNotImportedException.java | 24 + .../posterita/exceptions/DataException.java | 41 + .../exceptions/DefaultStoreException.java | 38 + .../exceptions/DeleteAttachmentException.java | 31 + .../DescriptionNotFoundException.java | 36 + .../exceptions/DiscountLimitException.java | 39 + .../DocumentDoesNotBelongToYouException.java | 14 + .../exceptions/DuplicatePINException.java | 35 + .../exceptions/DuplicateRoleException.java | 15 + .../exceptions/DuplicateUOMException.java | 16 + .../exceptions/DuplicateUserPinException.java | 37 + .../exceptions/EMailInvalidException.java | 36 + .../exceptions/EMailMessageException.java | 47 + .../EMailMessageParsingException.java | 47 + .../exceptions/EMailNotSentException.java | 36 + .../EMailServerConnectionException.java | 46 + .../exceptions/EMailServerLoginException.java | 46 + .../EMailServerMessageException.java | 47 + .../EmailAlreadyExistsException.java | 34 + .../exceptions/EmailNotFoundException.java | 35 + .../exceptions/EmptyCartException.java | 38 + .../exceptions/EncryptionException.java | 37 + .../exceptions/FormattingException.java | 85 + .../exceptions/ImageAttachmentException.java | 38 + .../ImportFileAlreadyExistException.java | 37 + .../ImportFileNotFoundException.java | 37 + .../exceptions/ImportProductException.java | 16 + .../InputQuantityLessThanZeroException.java | 35 + .../exceptions/InsufficientQtyException.java | 37 + .../exceptions/InvalidAddressException.java | 37 + .../exceptions/InvalidBPartnerException.java | 39 + .../InvalidBankAccountException.java | 36 + .../exceptions/InvalidBankException.java | 35 + .../exceptions/InvalidBarcodeException.java | 37 + .../InvalidConfirmPasswordException.java | 39 + .../InvalidContentTypeException.java | 41 + .../exceptions/InvalidDateTimeException.java | 36 + .../exceptions/InvalidEmailException.java | 30 + .../InvalidInvokeOrderStatusException.java | 53 + .../InvalidMessageStatusException.java | 35 + .../exceptions/InvalidMonthException.java | 35 + .../exceptions/InvalidNetDaysException.java | 36 + .../exceptions/InvalidOrderIDException.java | 38 + .../exceptions/InvalidOrderTypeException.java | 38 + .../InvalidOrganisationTypeException.java | 36 + .../exceptions/InvalidPINException.java | 35 + .../InvalidPasswordLengthException.java | 37 + .../exceptions/InvalidPeriodException.java | 34 + .../InvalidProductQuantityException.java | 34 + .../InvalidRequestUpdateException.java | 46 + .../exceptions/InvalidRoleException.java | 40 + .../InvalidTenderedAmountException.java | 38 + .../InvalidTerminalCashBookException.java | 32 + .../exceptions/InvalidURLException.java | 42 + .../exceptions/InvalidYearException.java | 39 + .../exceptions/KeywordsRequiredException.java | 37 + .../LimitPriceViolatedException.java | 38 + .../posterita/exceptions/LogoException.java | 38 + .../exceptions/MandatoryException.java | 37 + .../exceptions/MandatoryNameException.java | 37 + .../NoAccessToEditObjectException.java | 17 + .../NoAllocateeInvoiceException.java | 37 + .../NoCashJournalPresentException.java | 32 + .../NoCheckBoxSelectedException.java | 39 + .../exceptions/NoClientFoundException.java | 34 + .../exceptions/NoCustomerFoundException.java | 38 + .../exceptions/NoLocationFoundException.java | 35 + .../exceptions/NoOrderLineFoundException.java | 38 + .../NoOrderLineSelectedException.java | 34 + .../exceptions/NoPaymentAmountException.java | 37 + .../exceptions/NoProductImageException.java | 11 + .../NoProductSelectedException.java | 36 + .../exceptions/NoStockAvailableException.java | 56 + .../exceptions/NotLoggedInException.java | 34 + .../NullTransferAmountException.java | 38 + .../exceptions/OperationException.java | 51 + .../OrganisationAlreadyExistsException.java | 34 + .../org/posterita/exceptions/POException.java | 63 + .../exceptions/POSTerminalException.java | 36 + .../PayAmtNotEqualToAllocateAmtException.java | 37 + .../PaymentTermAlreadyExistsException.java | 40 + .../PriceListAlreadyExistsException.java | 11 + .../ProductAlreadyExistException.java | 37 + .../ProductImageInvalidException.java | 42 + .../exceptions/ProductInStockException.java | 37 + .../exceptions/ProductNotFoundException.java | 37 + .../ProductNotImportedException.java | 26 + .../ProductNotOnPriceListException.java | 38 + .../QuantityNotAvailableException.java | 50 + .../exceptions/ReloadFactoryException.java | 38 + .../RequestOwnerNotFoundException.java | 42 + .../RoleAlreadyExistsException.java | 35 + .../exceptions/SequenceUpdateException.java | 38 + .../ShipmentAlreadyExistsException.java | 37 + .../ShipperAlreadyExistsException.java | 35 + .../posterita/exceptions/StoreException.java | 36 + .../SurnameNotPresentException.java | 38 + .../posterita/exceptions/SystemException.java | 40 + .../exceptions/TMKRuntimeException.java | 34 + .../TaxNameAlreadyExistsException.java | 37 + .../TaxRateAlreadyExistsException.java | 37 + .../exceptions/TaxRateNotDefineException.java | 35 + .../TerminalInactivateException.java | 32 + .../exceptions/TerminalLockedException.java | 37 + .../exceptions/TerminalNotFoundException.java | 32 + .../ThumbnailGenerationException.java | 43 + .../TooManyAllocateInvoiceException.java | 37 + .../TotalQuantityLessThanZeroException.java | 35 + .../TrackingNumberNotfoundException.java | 37 + ...sferAmountExceedsTotalAmountException.java | 38 + .../exceptions/UOMNotFoundException.java | 17 + .../UOMValuePrecisionNotValidException.java | 21 + .../UnitNumberAlreadyExistException.java | 36 + .../UnsupportedDatabaseException.java | 39 + .../UserAlreadyExistsException.java | 34 + .../posterita/exceptions/UserException.java | 48 + .../exceptions/UserInactiveException.java | 35 + .../exceptions/UserInvalidException.java | 38 + .../exceptions/UserNotFoundException.java | 35 + .../WarehouseAlreadyExistsException.java | 35 + .../WebstoreOrderProcessingException.java | 36 + .../exceptions/WrongPasswordException.java | 26 + .../posterita/factory/AbstractFactory.java | 242 + .../factory/DBPropertiesManager.java | 88 + .../org/posterita/factory/DunningFactory.java | 86 + .../factory/GenericSystemObjectsFactory.java | 110 + .../org/posterita/factory/MenuGenerator.java | 91 + .../org/posterita/factory/POSMenuFactory.java | 735 ++ .../org/posterita/factory/ProcessFactory.java | 93 + .../factory/SystemObjectsFactory.java | 81 + .../org/posterita/factory/UserFactory.java | 88 + .../factory/WebComponentFactory.java | 290 + .../org/posterita/factory/WebProperties.java | 35 + .../org/posterita/form/AttachmentForm.java | 39 + .../org/posterita/form/AttributeForm.java | 41 + .../posterita/form/AttributeValuesForm.java | 39 + .../main/org/posterita/form/BPartnerForm.java | 49 + .../org/posterita/form/BPartnerInfoForm.java | 42 + .../src/main/org/posterita/form/BankForm.java | 40 + .../org/posterita/form/BlackListForm.java | 40 + .../posterita/form/CashBookDetailForm.java | 55 + .../main/org/posterita/form/CashBookForm.java | 36 + .../src/main/org/posterita/form/CashForm.java | 41 + .../form/ChangeDocumentStatusForm.java | 37 + .../posterita/form/ChangePasswordForm.java | 41 + .../main/org/posterita/form/CheckoutForm.java | 306 + .../org/posterita/form/CommissionForm.java | 37 + .../posterita/form/CreateBPartnerForm.java | 42 + .../posterita/form/CreateBankAccountForm.java | 40 + .../org/posterita/form/CreateLocatorForm.java | 40 + .../form/CreateProductAttributeForm.java | 40 + .../form/CreateProductAttributeValueForm.java | 40 + .../org/posterita/form/CreateUserForm.java | 44 + .../org/posterita/form/CreditCardForm.java | 43 + .../main/org/posterita/form/CurrencyForm.java | 39 + .../posterita/form/CurrenrPOSBalanceForm.java | 41 + .../form/CustomerAndCreditCardForm.java | 46 + .../main/org/posterita/form/CustomerForm.java | 48 + .../org/posterita/form/DateFilterForm.java | 42 + .../main/org/posterita/form/DocumentForm.java | 41 + .../posterita/form/DocumentHistoryForm.java | 41 + .../main/org/posterita/form/DunningForm.java | 42 + .../org/posterita/form/EditAttributeForm.java | 40 + .../org/posterita/form/EditPriceListForm.java | 39 + .../org/posterita/form/EditProductForm.java | 41 + .../main/org/posterita/form/GarmentForm.java | 41 + .../posterita/form/GeneralPaymentForm.java | 16 + .../posterita/form/GenericProductForm.java | 38 + .../org/posterita/form/InOutHistoryForm.java | 38 + .../org/posterita/form/InitCustomerForm.java | 40 + .../org/posterita/form/InventoryForm.java | 42 + .../org/posterita/form/InventoryLineForm.java | 17 + .../posterita/form/InvoiceHistoryForm.java | 38 + .../org/posterita/form/InvokeOrderForm.java | 41 + .../src/main/org/posterita/form/ItemForm.java | 38 + .../main/org/posterita/form/LoginForm.java | 41 + .../main/org/posterita/form/MenuItemForm.java | 40 + .../main/org/posterita/form/OpenItemForm.java | 42 + .../main/org/posterita/form/OrderForm.java | 39 + .../org/posterita/form/OrderHistoryForm.java | 40 + .../org/posterita/form/OrderLineForm.java | 40 + .../src/main/org/posterita/form/OrgForm.java | 51 + .../posterita/form/POSDescriptionForm.java | 42 + .../src/main/org/posterita/form/POSForm.java | 43 + .../main/org/posterita/form/POSHelpForm.java | 60 + .../org/posterita/form/POSHistoryForm.java | 79 + .../main/org/posterita/form/POSInfoForm.java | 41 + .../org/posterita/form/POSOrderLineForm2.java | 42 + .../org/posterita/form/POSProductForm.java | 42 + .../org/posterita/form/POSReportForm.java | 42 + .../main/org/posterita/form/POSStockForm.java | 42 + .../org/posterita/form/POSSupplierForm.java | 42 + .../posterita/form/PaymentAllocationForm.java | 42 + .../main/org/posterita/form/PaymentForm.java | 38 + .../posterita/form/PaymentHistoryForm.java | 38 + .../org/posterita/form/PaymentTermForm.java | 61 + .../org/posterita/form/PaymentTermForm2.java | 42 + .../org/posterita/form/PriceCheckForm.java | 37 + .../org/posterita/form/PriceListForm.java | 54 + .../posterita/form/ProductAttributeForm.java | 39 + .../form/ProductAttributeValueForm.java | 39 + .../posterita/form/ProductDetailInfoForm.java | 40 + .../org/posterita/form/ProductImageForm.java | 39 + .../posterita/form/ProductKeywordsForm.java | 39 + .../form/ProductRestrictionForm.java | 38 + .../org/posterita/form/ProductSearchForm.java | 41 + .../org/posterita/form/ProductStatusForm.java | 38 + .../org/posterita/form/RemoveSessionForm.java | 42 + .../main/org/posterita/form/ReportForm.java | 53 + .../org/posterita/form/ReportImageForm.java | 38 + .../form/ReportSummaryHistoryForm.java | 40 + .../src/main/org/posterita/form/RoleForm.java | 56 + .../form/SalesAnalysisReportForm.java | 39 + .../org/posterita/form/SalesDetailsForm.java | 39 + .../org/posterita/form/SalesReportForm.java | 39 + .../org/posterita/form/SearchProductForm.java | 39 + .../org/posterita/form/SellingItemForm.java | 35 + .../form/SetApplicationParametersForm.java | 37 + .../posterita/form/SingleDateFilterForm.java | 44 + .../org/posterita/form/StockEnquiryForm.java | 36 + .../main/org/posterita/form/StockForm.java | 38 + .../org/posterita/form/StockMovementForm.java | 15 + .../form/SynchronizeCollectionsForm.java | 38 + .../src/main/org/posterita/form/TaxForm.java | 41 + .../main/org/posterita/form/TerminalForm.java | 50 + .../src/main/org/posterita/form/UOMForm.java | 8 + .../src/main/org/posterita/form/UserForm.java | 60 + .../posterita/form/UserRegistrationForm.java | 52 + .../main/org/posterita/form/VendorForm.java | 19 + .../org/posterita/form/ViewBPartnerForm.java | 38 + .../org/posterita/form/ViewProductForm.java | 40 + .../main/org/posterita/form/ViewTaxForm.java | 40 + .../formatter/ArrayListFormatter.java | 51 + .../formatter/BigDecimalArrayFormatter.java | 49 + .../formatter/BigDecimalFormatter.java | 57 + .../formatter/BooleanArrayFormatter.java | 49 + .../posterita/formatter/BooleanFormatter.java | 50 + .../posterita/formatter/DefaultFormatter.java | 42 + .../posterita/formatter/DoubleFormatter.java | 48 + .../org/posterita/formatter/Formatter.java | 76 + .../posterita/formatter/IntegerFormatter.java | 56 + .../formatter/JulianDateFormatter.java | 82 + .../posterita/formatter/LongFormatter.java | 48 + .../posterita/formatter/PriceFormatter.java | 42 + .../posterita/formatter/PrintFormatter.java | 70 + .../formatter/ReflectionFormatter.java | 45 + .../SimpleCalendarDateFormatter.java | 84 + .../formatter/StringArrayFormatter.java | 48 + .../posterita/formatter/StringFormatter.java | 45 + .../posterita/formatter/TimeFormatter.java | 39 + .../keyname/AttributeValueKeyNamePair.java | 91 + .../keyname/BPartnerKeyNamePair.java | 52 + .../posterita/keyname/BankKeyNamePair.java | 48 + .../keyname/CBPartnerKeyNamePair.java | 108 + .../posterita/keyname/LocatorKeyNamePair.java | 102 + .../posterita/keyname/MenuKeyNamePair.java | 53 + .../org/posterita/keyname/OrgKeyNamePair.java | 62 + .../keyname/PriceListVersionKeyNamePair.java | 47 + .../keyname/ProductAttributeKeyNamePair.java | 50 + .../ProductAttributeSetKeyNamePair.java | 50 + .../ProductAttributeValueKeyNamePair.java | 51 + .../posterita/keyname/RegionKeyNamePair.java | 48 + .../posterita/keyname/RoleKeyNamePair.java | 50 + .../keyname/SalesRepKeyNamePair.java | 104 + .../keyname/WarehouseKeyNamePair.java | 71 + .../org/posterita/lib/PropertiesConstant.java | 131 + .../main/org/posterita/lib/UdiConstants.java | 97 + .../org/posterita/model/MBPartnerProduct.java | 52 + .../src/main/org/posterita/model/MBank.java | 51 + .../org/posterita/model/MBlackListCheque.java | 47 + .../org/posterita/model/MMAttachment.java | 81 + .../posterita/model/MRevenueRecognition.java | 50 + .../main/org/posterita/model/MRoleMenu.java | 41 + .../main/org/posterita/model/MWebMenu.java | 41 + .../org/posterita/model/MWebProperties.java | 52 + .../org/posterita/order/UDIOrderType.java | 26 + .../org/posterita/order/UDIOrderTypes.java | 142 + .../org/posterita/pos/help/POSHelpAction.java | 101 + .../posterita/pos/help/POSHelpManager.java | 61 + .../org/posterita/pos/taglib/AjaxTag.java | 34 + .../pos/taglib/BPartnerSearchTag.java | 423 ++ .../org/posterita/pos/taglib/MessageTag.java | 128 + .../org/posterita/process/SetupWebPOS.java | 341 + .../struts/admin/CheckSequenceAction.java | 67 + .../struts/admin/OrganisationAction.java | 139 + .../posterita/struts/admin/RoleAction.java | 196 + .../struts/attachment/AttachmentAction.java | 126 + .../attachment/ImageAttachmentAction.java | 54 + .../struts/attributes/AttributesAction.java | 134 + .../struts/bPartner/BPartnerAction.java | 301 + .../struts/bPartner/ViewBPartnerAction.java | 138 + .../org/posterita/struts/core/AjaxAction.java | 53 + .../org/posterita/struts/core/BaseAction.java | 151 + .../struts/core/BaseDispatchAction.java | 141 + .../org/posterita/struts/core/BaseForm.java | 983 +++ .../posterita/struts/core/DefaultForm.java | 5794 ++++++++++++++ .../struts/customer/CustomerAction.java | 816 ++ .../struts/customer/SalesAction.java | 94 + .../struts/inOut/ViewMinOutAction.java | 107 + .../struts/invoice/ViewInvoiceAction.java | 190 + .../struts/login/ChangePasswordAction.java | 78 + .../struts/login/GoToHomePageAction.java | 111 + .../posterita/struts/login/LoginAction.java | 472 ++ .../struts/login/POSLoginAction.java | 209 + .../struts/menu/CloseMenuAction.java | 89 + .../org/posterita/struts/menu/MenuAction.java | 275 + .../struts/order/CompletePOSOrderAction.java | 72 + .../struts/order/ViewOrderAction.java | 307 + .../posterita/struts/pos/BarcodeAction.java | 363 + .../struts/pos/BlackListedAction.java | 232 + .../struts/pos/BpartnerInfoAction.java | 98 + .../org/posterita/struts/pos/CashAction.java | 184 + .../posterita/struts/pos/CashBookAction.java | 651 ++ .../struts/pos/CommissionAction.java | 115 + .../struts/pos/CreditOrderAction.java | 792 ++ .../posterita/struts/pos/CurrencyAction.java | 268 + .../struts/pos/CustomPOSReportAction.java | 361 + .../struts/pos/CustomerReturnOrderAction.java | 78 + .../posterita/struts/pos/DocumentAction.java | 292 + .../posterita/struts/pos/DunningAction.java | 80 + .../pos/EditBulkProductFromFileAction.java | 265 + .../pos/FastMovingItemReportAction.java | 126 + .../posterita/struts/pos/GetReportAction.java | 103 + .../struts/pos/GoodsReceiveNoteAction.java | 90 + .../struts/pos/GoodsReturnNoteAction.java | 77 + .../struts/pos/ImportCustomerAction.java | 85 + .../struts/pos/ImportPOSProductAction.java | 118 + .../posterita/struts/pos/InventoryAction.java | 472 ++ .../struts/pos/InventoryCartAction.java | 674 ++ .../org/posterita/struts/pos/POSAction.java | 50 + .../struts/pos/POSAttributesAction.java | 140 + .../struts/pos/POSDispatchAction.java | 46 + .../posterita/struts/pos/POSGoodsAction.java | 1457 ++++ .../posterita/struts/pos/POSInfoAction.java | 208 + .../posterita/struts/pos/POSOrderAction.java | 2213 ++++++ .../struts/pos/POSPriceListAction.java | 152 + .../struts/pos/POSProductAction.java | 1035 +++ .../posterita/struts/pos/POSReportAction.java | 1602 ++++ .../posterita/struts/pos/POSRoleAction.java | 361 + .../struts/pos/POSSalesReportAction.java | 290 + .../posterita/struts/pos/POSStockAction.java | 155 + .../posterita/struts/pos/POSUserAction.java | 293 + .../struts/pos/PartialPOSOrderAction.java | 763 ++ .../posterita/struts/pos/PaymentAction.java | 132 + .../struts/pos/PaymentTermAction.java | 237 + .../posterita/struts/pos/PostingAction.java | 59 + .../posterita/struts/pos/PriceListAction.java | 216 + .../struts/pos/SalesAnalysisReportAction.java | 150 + .../struts/pos/SearchCustomerAction.java | 164 + .../struts/pos/SearchPOSProductAction.java | 57 + .../struts/pos/SearchProductAction.java | 152 + .../pos/SearchProductsInStockAction.java | 80 + .../struts/pos/SearchVendorAction.java | 123 + .../pos/SlowMovingItemReportAction.java | 121 + .../struts/pos/StockMovementReportAction.java | 200 + .../org/posterita/struts/pos/TaxAction.java | 287 + .../posterita/struts/pos/TerminalAction.java | 477 ++ .../org/posterita/struts/pos/UOMAction.java | 44 + .../posterita/struts/pos/VendorAction.java | 288 + .../posterita/struts/stock/StockAction.java | 237 + .../struts/stock/StockMovementAction.java | 912 +++ .../struts/user/CreateUserAction.java | 116 + .../org/posterita/struts/user/UserAction.java | 262 + .../struts/user/UserRegistrationAction.java | 118 + .../main/org/posterita/taglib/BankName.java | 92 + .../main/org/posterita/taglib/LinkAccess.java | 40 + .../org/posterita/taglib/OrderStatus.java | 128 + .../org/posterita/taglib/ProductName.java | 94 + .../main/org/posterita/user/WebUserInfo.java | 303 + .../util/AbstractPrintFormatter.java | 176 + .../org/posterita/util/BarcodeFormatter.java | 154 + .../main/org/posterita/util/EmailUtil.java | 102 + .../util/HtmlOrderPrintFormatter.java | 735 ++ .../org/posterita/util/IPrintFormatter.java | 33 + .../org/posterita/util/InvoiceFormatter.java | 308 + .../src/main/org/posterita/util/ListUtil.java | 44 + .../org/posterita/util/MinOutFormatter.java | 44 + .../util/OSBroOrderPrintFormatter1.java | 655 ++ .../org/posterita/util/OrderFormatter.java | 524 ++ .../src/main/org/posterita/util/PathInfo.java | 50 + .../org/posterita/util/PaymentFormatter.java | 43 + .../main/org/posterita/util/PoManager.java | 118 + .../org/posterita/util/RegenerateModels.java | 119 + .../util/TMKInvoicePrintFormatter.java | 439 ++ .../util/TMKOrderPrintFormatter.java | 637 ++ .../main/org/posterita/util/TmkPrintUtil.java | 71 + .../posterita/util/TmkPrinterConstants.java | 87 + .../action/DocumentHistoryAction.java | 136 + .../action/ViewCashPaymentAction.java | 101 + .../webstore/action/ViewPaymentAction.java | 109 + .../businesslogic/DocumentHistoryManager.java | 186 + .../businesslogic/PaymentManager.java | 256 + .../posterita/src/main/posterita.properties | 13 + .../posterita/src/utils/ImportMessages.sh | 1 + posterita/posterita/src/utils/messages.csv | 444 ++ posterita/posterita/web/WEB-INF/c.tld | 416 + posterita/posterita/web/WEB-INF/dcs.tld | 201 + posterita/posterita/web/WEB-INF/fmt.tld | 442 ++ posterita/posterita/web/WEB-INF/pos.tld | 76 + posterita/posterita/web/WEB-INF/posterita.tld | 146 + .../posterita/web/WEB-INF/struts-bean.tld | 382 + .../posterita/web/WEB-INF/struts-config.xml | 6673 +++++++++++++++++ .../web/WEB-INF/struts-config_1_2.dtd | 686 ++ .../posterita/web/WEB-INF/struts-html.tld | 3032 ++++++++ .../posterita/web/WEB-INF/struts-logic.tld | 652 ++ .../posterita/web/WEB-INF/struts-nested.tld | 2886 +++++++ .../posterita/web/WEB-INF/struts-tiles.tld | 344 + .../web/WEB-INF/tiles-config_1_1.dtd | 281 + .../posterita/web/WEB-INF/tiles-defs.xml | 42 + .../posterita/web/WEB-INF/validator-rules.xml | 287 + .../posterita/web/WEB-INF/web-app_2_2.dtd | 565 ++ .../posterita/web/WEB-INF/web-app_2_3.dtd | 1059 +++ posterita/posterita/web/WEB-INF/web.xml | 190 + posterita/posterita/web/WEB-INF/webStore.tld | 213 + posterita/posterita/web/css/alternative.css | 85 + posterita/posterita/web/css/common.jsp | 1688 +++++ posterita/posterita/web/css/displaytag.css | 147 + posterita/posterita/web/css/frame.css | 30 + posterita/posterita/web/css/global.css | 390 + posterita/posterita/web/css/inventory.css | 118 + .../web/css/js-calendar/calendar-win2k-1.css | 296 + posterita/posterita/web/css/logo.css | 23 + posterita/posterita/web/css/mainMenu.css | 841 +++ posterita/posterita/web/css/modalbox.css | 101 + posterita/posterita/web/css/newPOS.css | 723 ++ posterita/posterita/web/css/orderScreen.css | 828 ++ posterita/posterita/web/css/popup.css | 30 + posterita/posterita/web/css/print.css | 76 + posterita/posterita/web/css/screen.css | 118 + posterita/posterita/web/css/style.css | 566 ++ posterita/posterita/web/css/teststyles.css | 50 + posterita/posterita/web/images/back-menu.gif | Bin 0 -> 715 bytes posterita/posterita/web/images/bar.gif | Bin 0 -> 163 bytes posterita/posterita/web/images/barcode.jpg | Bin 0 -> 3993 bytes posterita/posterita/web/images/bg_header.jpg | Bin 0 -> 1792 bytes posterita/posterita/web/images/bg_td.gif | Bin 0 -> 1928 bytes posterita/posterita/web/images/bullet1.gif | Bin 0 -> 55 bytes posterita/posterita/web/images/bullet2.gif | Bin 0 -> 262 bytes .../posterita/web/images/calendar_icon.png | Bin 0 -> 1111 bytes .../posterita/web/images/ico_printer.gif | Bin 0 -> 212 bytes posterita/posterita/web/images/iconCSV.jpg | Bin 0 -> 1752 bytes posterita/posterita/web/images/loader.gif | Bin 0 -> 10819 bytes posterita/posterita/web/images/logo.gif | Bin 0 -> 1543 bytes posterita/posterita/web/images/logo.jpg | Bin 0 -> 3290 bytes posterita/posterita/web/images/logo1.jpg | Bin 0 -> 7468 bytes .../posterita/web/images/newUI/Thumbs.db | Bin 0 -> 41984 bytes .../posterita/web/images/newUI/back-menu.gif | Bin 0 -> 715 bytes .../posterita/web/images/newUI/blankimage.png | Bin 0 -> 2314 bytes .../web/images/newUI/bottom-right.gif | Bin 0 -> 225 bytes .../posterita/web/images/newUI/bottom.gif | Bin 0 -> 869 bytes .../web/images/newUI/btn_changepin.gif | Bin 0 -> 899 bytes .../web/images/newUI/btn_quickdiscount.gif | Bin 0 -> 916 bytes .../web/images/newUI/btn_resetuser.gif | Bin 0 -> 909 bytes .../web/images/newUI/btun_complete.gif | Bin 0 -> 921 bytes .../web/images/newUI/btun_generic.gif | Bin 0 -> 753 bytes .../posterita/web/images/newUI/btun_save.gif | Bin 0 -> 867 bytes .../web/images/newUI/bullet-arrow.gif | Bin 0 -> 343 bytes .../posterita/web/images/newUI/butn-add.gif | Bin 0 -> 426 bytes .../web/images/newUI/butn-addnew.gif | Bin 0 -> 1608 bytes .../web/images/newUI/butn-browse.gif | Bin 0 -> 421 bytes .../posterita/web/images/newUI/butn-card.gif | Bin 0 -> 1561 bytes .../posterita/web/images/newUI/butn-cash.gif | Bin 0 -> 1677 bytes .../web/images/newUI/butn-checkout.gif | Bin 0 -> 985 bytes .../web/images/newUI/butn-cheque.gif | Bin 0 -> 1894 bytes .../web/images/newUI/butn-clearall.gif | Bin 0 -> 1130 bytes .../posterita/web/images/newUI/butn-copy.gif | Bin 0 -> 1562 bytes .../web/images/newUI/butn-createpos.gif | Bin 0 -> 2992 bytes .../web/images/newUI/butn-credit.gif | Bin 0 -> 2341 bytes .../web/images/newUI/butn-delete.gif | Bin 0 -> 860 bytes .../web/images/newUI/butn-delprod.gif | Bin 0 -> 1552 bytes .../web/images/newUI/butn-discount.gif | Bin 0 -> 1130 bytes .../web/images/newUI/butn-donate.gif | Bin 0 -> 1714 bytes .../web/images/newUI/butn-edit-off.gif | Bin 0 -> 1335 bytes .../posterita/web/images/newUI/butn-edit.gif | Bin 0 -> 1584 bytes .../posterita/web/images/newUI/butn-exit.gif | Bin 0 -> 1717 bytes .../web/images/newUI/butn-import.gif | Bin 0 -> 1577 bytes .../posterita/web/images/newUI/butn-login.gif | Bin 0 -> 798 bytes .../posterita/web/images/newUI/butn-mix.gif | Bin 0 -> 1425 bytes .../posterita/web/images/newUI/butn-new.gif | Bin 0 -> 911 bytes .../posterita/web/images/newUI/butn-next.gif | Bin 0 -> 1636 bytes .../web/images/newUI/butn-opendrawer.gif | Bin 0 -> 1160 bytes .../posterita/web/images/newUI/butn-prev.gif | Bin 0 -> 1636 bytes .../posterita/web/images/newUI/butn-save.gif | Bin 0 -> 2061 bytes .../web/images/newUI/butn-subtract.gif | Bin 0 -> 389 bytes .../web/images/newUI/butn-system.gif | Bin 0 -> 1215 bytes .../web/images/newUI/butn-touchscreen.gif | Bin 0 -> 1644 bytes .../posterita/web/images/newUI/donate.gif | Bin 0 -> 1714 bytes .../posterita/web/images/newUI/footerbg.gif | Bin 0 -> 159 bytes .../posterita/web/images/newUI/headblc.gif | Bin 0 -> 201 bytes .../posterita/web/images/newUI/headbody.gif | Bin 0 -> 155 bytes .../posterita/web/images/newUI/headbrc.gif | Bin 0 -> 201 bytes .../posterita/web/images/newUI/headtlc.gif | Bin 0 -> 704 bytes .../posterita/web/images/newUI/headtrc.gif | Bin 0 -> 703 bytes .../web/images/newUI/hicon-cashbook.gif | Bin 0 -> 442 bytes .../web/images/newUI/hicon-donate.gif | Bin 0 -> 1185 bytes .../posterita/web/images/newUI/hicon-help.gif | Bin 0 -> 152 bytes .../posterita/web/images/newUI/hicon-news.gif | Bin 0 -> 316 bytes .../web/images/newUI/hicon-salesorder.gif | Bin 0 -> 692 bytes .../web/images/newUI/hicon-tillmgt.gif | Bin 0 -> 779 bytes .../posterita/web/images/newUI/icon-err.gif | Bin 0 -> 910 bytes .../posterita/web/images/newUI/icon-help.gif | Bin 0 -> 1017 bytes .../web/images/newUI/icon-newwindow.gif | Bin 0 -> 207 bytes posterita/posterita/web/images/newUI/left.gif | Bin 0 -> 45 bytes .../posterita/web/images/newUI/leftside.gif | Bin 0 -> 80 bytes posterita/posterita/web/images/newUI/logo.gif | Bin 0 -> 2397 bytes .../posterita/web/images/newUI/navbg.gif | Bin 0 -> 392 bytes .../posterita/web/images/newUI/palebluebg.gif | Bin 0 -> 277 bytes .../posterita/web/images/newUI/pricedetbg.gif | Bin 0 -> 867 bytes .../web/images/newUI/pricedetbgtile.gif | Bin 0 -> 209 bytes .../web/images/newUI/productpreview.gif | Bin 0 -> 2940 bytes .../posterita/web/images/newUI/rightside.gif | Bin 0 -> 90 bytes .../posterita/web/images/newUI/singlekey.gif | Bin 0 -> 981 bytes .../posterita/web/images/newUI/spacer.gif | Bin 0 -> 43 bytes .../posterita/web/images/newUI/top-right.gif | Bin 0 -> 743 bytes posterita/posterita/web/images/newUI/top.gif | Bin 0 -> 5463 bytes .../posterita/web/images/newUI/topmenubg.gif | Bin 0 -> 902 bytes posterita/posterita/web/images/nok.gif | Bin 0 -> 1333 bytes posterita/posterita/web/images/ok.gif | Bin 0 -> 1286 bytes posterita/posterita/web/images/pdfIcon.jpg | Bin 0 -> 13673 bytes .../posterita/web/images/pdf_icon_small.gif | Bin 0 -> 2629 bytes posterita/posterita/web/images/pos/-----.gif | Bin 0 -> 402 bytes .../web/images/pos/ADMINISTRATION.gif | Bin 0 -> 728 bytes .../posterita/web/images/pos/BULLET_reddd.gif | Bin 0 -> 1064 bytes .../posterita/web/images/pos/Contacts 1.gif | Bin 0 -> 21727 bytes .../posterita/web/images/pos/Contacts 2.gif | Bin 0 -> 19298 bytes .../posterita/web/images/pos/ImageBack.jpg | Bin 0 -> 1197 bytes posterita/posterita/web/images/pos/LOGOUT.gif | Bin 0 -> 455 bytes posterita/posterita/web/images/pos/ORDER.gif | Bin 0 -> 415 bytes .../posterita/web/images/pos/REPORTS.gif | Bin 0 -> 489 bytes .../posterita/web/images/pos/arrow_down.png | Bin 0 -> 190 bytes .../posterita/web/images/pos/arrow_off.png | Bin 0 -> 180 bytes .../posterita/web/images/pos/arrow_up.png | Bin 0 -> 189 bytes .../posterita/web/images/pos/blankimage.png | Bin 0 -> 2314 bytes .../posterita/web/images/pos/button-login.gif | Bin 0 -> 2366 bytes .../web/images/pos/button_add to cart.gif | Bin 0 -> 2494 bytes .../web/images/pos/button_advanced.gif | Bin 0 -> 2461 bytes .../posterita/web/images/pos/button_card.gif | Bin 0 -> 1883 bytes .../posterita/web/images/pos/button_cash.gif | Bin 0 -> 1908 bytes .../web/images/pos/button_checkout.gif | Bin 0 -> 2457 bytes .../web/images/pos/button_cheque.gif | Bin 0 -> 1990 bytes .../web/images/pos/button_newcustomer.gif | Bin 0 -> 3046 bytes .../web/images/pos/buttons/Thumbs.db | Bin 0 -> 31744 bytes .../web/images/pos/buttons/browser.gif | Bin 0 -> 2009 bytes .../web/images/pos/buttons/bullet_red.gif | Bin 0 -> 1064 bytes .../images/pos/buttons/button_addtocart.gif | Bin 0 -> 2494 bytes .../pos/buttons/button_administration.gif | Bin 0 -> 728 bytes .../images/pos/buttons/button_advanced.gif | Bin 0 -> 2461 bytes .../images/pos/buttons/button_background.gif | Bin 0 -> 2181 bytes .../images/pos/buttons/button_barchart.gif | Bin 0 -> 1953 bytes .../web/images/pos/buttons/button_blank.gif | Bin 0 -> 1671 bytes .../web/images/pos/buttons/button_card.gif | Bin 0 -> 1883 bytes .../web/images/pos/buttons/button_cart.jpeg | Bin 0 -> 524 bytes .../web/images/pos/buttons/button_cash.gif | Bin 0 -> 1908 bytes .../images/pos/buttons/button_checkout.gif | Bin 0 -> 2457 bytes .../web/images/pos/buttons/button_cheque.gif | Bin 0 -> 1990 bytes .../images/pos/buttons/button_complete.gif | Bin 0 -> 2047 bytes .../images/pos/buttons/button_continue.gif | Bin 0 -> 2016 bytes .../web/images/pos/buttons/button_delete.gif | Bin 0 -> 1915 bytes .../web/images/pos/buttons/button_edit.gif | Bin 0 -> 1846 bytes .../web/images/pos/buttons/button_import.gif | Bin 0 -> 1361 bytes .../web/images/pos/buttons/button_login.gif | Bin 0 -> 2366 bytes .../web/images/pos/buttons/button_logout.gif | Bin 0 -> 455 bytes .../web/images/pos/buttons/button_middle.gif | Bin 0 -> 451 bytes .../web/images/pos/buttons/button_minus.gif | Bin 0 -> 402 bytes .../web/images/pos/buttons/button_mixed.gif | Bin 0 -> 1922 bytes .../images/pos/buttons/button_newcustomer.gif | Bin 0 -> 3046 bytes .../web/images/pos/buttons/button_newnote.gif | Bin 0 -> 1836 bytes .../images/pos/buttons/button_neworder.gif | Bin 0 -> 2464 bytes .../web/images/pos/buttons/button_order.gif | Bin 0 -> 415 bytes .../images/pos/buttons/button_piechart.gif | Bin 0 -> 1956 bytes .../web/images/pos/buttons/button_plus.gif | Bin 0 -> 468 bytes .../web/images/pos/buttons/button_refresh.gif | Bin 0 -> 1978 bytes .../web/images/pos/buttons/button_reports.gif | Bin 0 -> 489 bytes .../web/images/pos/buttons/button_save.gif | Bin 0 -> 1896 bytes .../images/pos/buttons/button_saveascsv.gif | Bin 0 -> 1742 bytes .../images/pos/buttons/button_saveaspdf.gif | Bin 0 -> 1651 bytes .../web/images/pos/buttons/button_search.gif | Bin 0 -> 1941 bytes .../images/pos/buttons/button_selectall.gif | Bin 0 -> 2469 bytes .../web/images/pos/buttons/button_submit.gif | Bin 0 -> 1957 bytes .../web/images/pos/buttons/button_tabular.gif | Bin 0 -> 1324 bytes .../images/pos/buttons/button_timeseries.gif | Bin 0 -> 2470 bytes .../posterita/web/images/pos/calendar.gif | Bin 0 -> 1108 bytes .../web/images/pos/charts/barchart_icon.gif | Bin 0 -> 270 bytes .../web/images/pos/charts/piechart_icon.gif | Bin 0 -> 758 bytes .../web/images/pos/charts/tabular_icon.gif | Bin 0 -> 313 bytes .../web/images/pos/charts/timeseries_icon.gif | Bin 0 -> 488 bytes posterita/posterita/web/images/pos/cross.gif | Bin 0 -> 666 bytes .../posterita/web/images/pos/delprod.gif | Bin 0 -> 3762 bytes posterita/posterita/web/images/pos/error.gif | Bin 0 -> 1077 bytes posterita/posterita/web/images/pos/error.jpg | Bin 0 -> 1276 bytes posterita/posterita/web/images/pos/error.png | Bin 0 -> 3030 bytes .../posterita/web/images/pos/helpIcon.gif | Bin 0 -> 463 bytes .../posterita/web/images/pos/helpIcon2.gif | Bin 0 -> 140 bytes .../posterita/web/images/pos/ico_file_csv.png | Bin 0 -> 230 bytes .../web/images/pos/ico_file_excel.png | Bin 0 -> 242 bytes .../posterita/web/images/pos/ico_file_pdf.png | Bin 0 -> 297 bytes .../posterita/web/images/pos/ico_file_rtf.png | Bin 0 -> 1004 bytes .../posterita/web/images/pos/ico_file_xml.png | Bin 0 -> 245 bytes .../posterita/web/images/pos/icon-error.gif | Bin 0 -> 1669 bytes .../posterita/web/images/pos/icon-info.gif | Bin 0 -> 1586 bytes .../web/images/pos/icon-question.gif | Bin 0 -> 1607 bytes .../posterita/web/images/pos/icon-warning.gif | Bin 0 -> 1483 bytes .../posterita/web/images/pos/indicator.gif | Bin 0 -> 878 bytes posterita/posterita/web/images/pos/kbicon.gif | Bin 0 -> 161 bytes posterita/posterita/web/images/pos/logo.jpg | Bin 0 -> 24817 bytes .../web/images/pos/magnifying-glass.gif | Bin 0 -> 565 bytes posterita/posterita/web/images/pos/maskBG.png | Bin 0 -> 137 bytes .../posterita/web/images/pos/paginazione.png | Bin 0 -> 981 bytes .../web/images/pos/paginazione_ahead.png | Bin 0 -> 996 bytes .../web/images/pos/paginazione_back.png | Bin 0 -> 996 bytes posterita/posterita/web/images/pos/plus.gif | Bin 0 -> 468 bytes .../posterita/web/images/pos/success.gif | Bin 0 -> 1169 bytes posterita/posterita/web/images/posterita.jpg | Bin 0 -> 7901 bytes posterita/posterita/web/images/progress.gif | Bin 0 -> 796 bytes posterita/posterita/web/images/spacer.gif | Bin 0 -> 43 bytes posterita/posterita/web/images/spinner.gif | Bin 0 -> 7823 bytes .../images/tango/accessories-calculator.png | Bin 0 -> 1382 bytes .../tango/accessories-character-map.png | Bin 0 -> 1206 bytes .../images/tango/accessories-text-editor.png | Bin 0 -> 1523 bytes .../web/images/tango/address-book-new.png | Bin 0 -> 1897 bytes .../web/images/tango/applications-system.png | Bin 0 -> 2544 bytes .../web/images/tango/appointment-new.png | Bin 0 -> 2399 bytes .../web/images/tango/bookmark-new.png | Bin 0 -> 1532 bytes .../web/images/tango/contact-new.png | Bin 0 -> 1390 bytes .../web/images/tango/document-new.png | Bin 0 -> 1008 bytes .../web/images/tango/document-open.png | Bin 0 -> 1437 bytes .../images/tango/document-print-preview.png | Bin 0 -> 1719 bytes .../web/images/tango/document-print.png | Bin 0 -> 1013 bytes .../web/images/tango/document-properties.png | Bin 0 -> 1115 bytes .../web/images/tango/document-save-as.png | Bin 0 -> 1837 bytes .../web/images/tango/document-save.png | Bin 0 -> 1971 bytes .../posterita/web/images/tango/edit-clear.png | Bin 0 -> 1682 bytes .../posterita/web/images/tango/edit-copy.png | Bin 0 -> 723 bytes .../posterita/web/images/tango/edit-cut.png | Bin 0 -> 2087 bytes .../web/images/tango/edit-delete.png | Bin 0 -> 2049 bytes .../web/images/tango/edit-find-replace.png | Bin 0 -> 2104 bytes .../posterita/web/images/tango/edit-find.png | Bin 0 -> 1636 bytes .../posterita/web/images/tango/edit-paste.png | Bin 0 -> 1027 bytes .../posterita/web/images/tango/edit-redo.png | Bin 0 -> 1502 bytes .../web/images/tango/edit-select-all.png | Bin 0 -> 631 bytes .../posterita/web/images/tango/edit-undo.png | Bin 0 -> 1601 bytes .../posterita/web/images/tango/folder-new.png | Bin 0 -> 1399 bytes .../web/images/tango/format-indent-less.png | Bin 0 -> 767 bytes .../web/images/tango/format-indent-more.png | Bin 0 -> 766 bytes .../images/tango/format-justify-center.png | Bin 0 -> 526 bytes .../web/images/tango/format-justify-fill.png | Bin 0 -> 517 bytes .../web/images/tango/format-justify-left.png | Bin 0 -> 515 bytes .../web/images/tango/format-justify-right.png | Bin 0 -> 541 bytes .../web/images/tango/format-text-bold.png | Bin 0 -> 1624 bytes .../web/images/tango/format-text-italic.png | Bin 0 -> 1338 bytes .../tango/format-text-strikethrough.png | Bin 0 -> 1445 bytes .../images/tango/format-text-underline.png | Bin 0 -> 1550 bytes .../posterita/web/images/tango/go-bottom.png | Bin 0 -> 1263 bytes .../posterita/web/images/tango/go-down.png | Bin 0 -> 1187 bytes .../posterita/web/images/tango/go-first.png | Bin 0 -> 1331 bytes .../posterita/web/images/tango/go-home.png | Bin 0 -> 1774 bytes .../posterita/web/images/tango/go-jump.png | Bin 0 -> 1491 bytes .../posterita/web/images/tango/go-last.png | Bin 0 -> 1342 bytes .../posterita/web/images/tango/go-next.png | Bin 0 -> 1219 bytes .../web/images/tango/go-previous.png | Bin 0 -> 1200 bytes .../posterita/web/images/tango/go-top.png | Bin 0 -> 1293 bytes .../posterita/web/images/tango/go-up.png | Bin 0 -> 1193 bytes .../web/images/tango/help-browser.png | Bin 0 -> 2231 bytes .../web/images/tango/input-keyboard.png | Bin 0 -> 1504 bytes .../web/images/tango/internet-group-chat.png | Bin 0 -> 783 bytes .../web/images/tango/internet-mail.png | Bin 0 -> 1426 bytes .../web/images/tango/internet-news-reader.png | Bin 0 -> 1152 bytes .../web/images/tango/internet-web-browser.png | Bin 0 -> 2251 bytes .../posterita/web/images/tango/list-add.png | Bin 0 -> 601 bytes .../web/images/tango/list-remove.png | Bin 0 -> 317 bytes .../web/images/tango/mail-forward.png | Bin 0 -> 1500 bytes .../web/images/tango/mail-mark-junk.png | Bin 0 -> 2248 bytes .../web/images/tango/mail-mark-not-junk.png | Bin 0 -> 2115 bytes .../web/images/tango/mail-message-new.png | Bin 0 -> 1605 bytes .../web/images/tango/mail-reply-all.png | Bin 0 -> 1946 bytes .../web/images/tango/mail-reply-sender.png | Bin 0 -> 1492 bytes .../web/images/tango/mail-send-receive.png | Bin 0 -> 2013 bytes .../web/images/tango/media-eject.png | Bin 0 -> 987 bytes .../web/images/tango/media-playback-pause.png | Bin 0 -> 481 bytes .../web/images/tango/media-playback-start.png | Bin 0 -> 1028 bytes .../web/images/tango/media-playback-stop.png | Bin 0 -> 571 bytes .../web/images/tango/media-record.png | Bin 0 -> 1266 bytes .../web/images/tango/media-seek-backward.png | Bin 0 -> 1074 bytes .../web/images/tango/media-seek-forward.png | Bin 0 -> 1205 bytes .../web/images/tango/media-skip-backward.png | Bin 0 -> 1236 bytes .../web/images/tango/media-skip-forward.png | Bin 0 -> 1225 bytes .../web/images/tango/office-calendar.png | Bin 0 -> 1298 bytes .../preferences-desktop-accessibility.png | Bin 0 -> 1630 bytes ...eferences-desktop-assistive-technology.png | Bin 0 -> 1835 bytes .../images/tango/preferences-desktop-font.png | Bin 0 -> 1316 bytes ...preferences-desktop-keyboard-shortcuts.png | Bin 0 -> 1476 bytes .../tango/preferences-desktop-locale.png | Bin 0 -> 1769 bytes .../preferences-desktop-remote-desktop.png | Bin 0 -> 2193 bytes .../tango/preferences-desktop-screensaver.png | Bin 0 -> 1878 bytes .../tango/preferences-desktop-sound.png | Bin 0 -> 2350 bytes .../tango/preferences-desktop-theme.png | Bin 0 -> 1530 bytes .../tango/preferences-desktop-wallpaper.png | Bin 0 -> 1788 bytes .../preferences-system-network-proxy.png | Bin 0 -> 2212 bytes .../tango/preferences-system-session.png | Bin 0 -> 1549 bytes .../tango/preferences-system-windows.png | Bin 0 -> 567 bytes .../web/images/tango/preferences-system.png | Bin 0 -> 2129 bytes .../web/images/tango/process-stop.png | Bin 0 -> 1927 bytes .../web/images/tango/system-file-manager.png | Bin 0 -> 667 bytes .../web/images/tango/system-installer.png | Bin 0 -> 1589 bytes .../web/images/tango/system-lock-screen.png | Bin 0 -> 1751 bytes .../web/images/tango/system-log-out.png | Bin 0 -> 1269 bytes .../web/images/tango/system-password.png | Bin 0 -> 2606 bytes .../web/images/tango/system-search.png | Bin 0 -> 2215 bytes .../web/images/tango/system-shutdown.png | Bin 0 -> 1055 bytes .../images/tango/system-software-update.png | Bin 0 -> 2216 bytes .../web/images/tango/system-users.png | Bin 0 -> 1901 bytes .../posterita/web/images/tango/tab-new.png | Bin 0 -> 796 bytes .../posterita/web/images/tango/user-trash.png | Bin 0 -> 1788 bytes .../images/tango/utilities-system-monitor.png | Bin 0 -> 1886 bytes .../web/images/tango/utilities-terminal.png | Bin 0 -> 1488 bytes .../web/images/tango/view-fullscreen.png | Bin 0 -> 1256 bytes .../web/images/tango/view-refresh.png | Bin 0 -> 2024 bytes .../posterita/web/images/tango/window-new.png | Bin 0 -> 671 bytes .../web/images/tango/x-office-calendar.png | Bin 0 -> 1054 bytes posterita/posterita/web/images/tick.png | Bin 0 -> 637 bytes posterita/posterita/web/images/trash.png | Bin 0 -> 2907 bytes posterita/posterita/web/images/wrong.png | Bin 0 -> 605 bytes .../web/import/importGarmentTemplate.csv | 1 + .../posterita/web/import/importTemplate.csv | 1 + posterita/posterita/web/index.jsp | 21 + posterita/posterita/web/javascripts/actb.js | 645 ++ .../posterita/web/javascripts/builder.js | 136 + .../posterita/web/javascripts/controls.js | 965 +++ .../posterita/web/javascripts/dialogbox.js | 81 + .../posterita/web/javascripts/dragdrop.js | 974 +++ .../posterita/web/javascripts/effects.js | 1122 +++ .../javascripts/js-calendar/calendar-en.js | 127 + .../javascripts/js-calendar/calendar-setup.js | 200 + .../web/javascripts/js-calendar/calendar.js | 1806 +++++ .../posterita/web/javascripts/modalbox.js | 573 ++ posterita/posterita/web/javascripts/popup.js | 470 ++ .../posterita/web/javascripts/prototype.js | 4170 ++++++++++ .../web/javascripts/scriptaculous.js | 58 + posterita/posterita/web/javascripts/slider.js | 275 + .../posterita/web/javascripts/sorttable.js | 209 + .../posterita/web/javascripts/sorttable_v2.js | 493 ++ posterita/posterita/web/javascripts/sound.js | 55 + .../posterita/web/javascripts/tablefilter.js | 1217 +++ .../posterita/web/javascripts/unittest.js | 568 ++ .../posterita/web/js/advancedOrderScreen.js | 525 ++ posterita/posterita/web/js/barcode.js | 411 + posterita/posterita/web/js/barcodeCart.js | 535 ++ posterita/posterita/web/js/calculator.js | 258 + posterita/posterita/web/js/calendar-en.js | 128 + posterita/posterita/web/js/calendar-setup.js | 201 + posterita/posterita/web/js/calendar.js | 1807 +++++ posterita/posterita/web/js/cart.js | 236 + posterita/posterita/web/js/createPOSOrder.js | 193 + posterita/posterita/web/js/creditScreen.js | 537 ++ posterita/posterita/web/js/customer.js | 160 + posterita/posterita/web/js/customer2.js | 161 + posterita/posterita/web/js/dom-drag.js | 121 + posterita/posterita/web/js/draftedPOSOrder.js | 174 + posterita/posterita/web/js/enableButton.js | 405 + posterita/posterita/web/js/import.js | 25 + posterita/posterita/web/js/inventory.js | 904 +++ posterita/posterita/web/js/inventoryCart.js | 432 ++ .../posterita/web/js/inventoryHistory.js | 152 + posterita/posterita/web/js/js-calendar.js | 35 + posterita/posterita/web/js/js-date.js | 55 + posterita/posterita/web/js/keyboard.js | 422 ++ posterita/posterita/web/js/orderScreen.js | 2110 ++++++ posterita/posterita/web/js/paymentTerm.js | 62 + posterita/posterita/web/js/pin.js | 175 + posterita/posterita/web/js/pos.js | 644 ++ .../posterita/web/js/posPaymentDetails.js | 554 ++ posterita/posterita/web/js/product.js | 316 + posterita/posterita/web/js/product2.js | 147 + posterita/posterita/web/js/productTax.js | 131 + posterita/posterita/web/js/shoppingCart.js | 505 ++ posterita/posterita/web/js/shortcut.js | 223 + posterita/posterita/web/js/stockCart.js | 518 ++ posterita/posterita/web/js/stockTransfer.js | 537 ++ posterita/posterita/web/js/timer.js | 36 + posterita/posterita/web/js/tooltip.js | 113 + .../posterita/web/jsp/admin/changeEmail.jsp | 80 + .../web/jsp/admin/changePassword.jsp | 79 + .../jsp/admin/checkDataIntegritySuccess.jsp | 48 + .../web/jsp/admin/checkSequenceSuccess.jsp | 55 + .../posterita/web/jsp/admin/createRole.jsp | 179 + .../posterita/web/jsp/admin/emailChanged.jsp | 48 + .../web/jsp/admin/listOrganisations.jsp | 91 + .../posterita/web/jsp/admin/listRoles.jsp | 92 + .../web/jsp/admin/passwordChanged.jsp | 52 + .../jsp/admin/updateOrCreateOrganisation.jsp | 128 + .../posterita/web/jsp/admin/userDeleted.jsp | 49 + .../posterita/web/jsp/admin/viewMyDetails.jsp | 138 + .../web/jsp/admin/viewOrganisation.jsp | 67 + .../posterita/web/jsp/admin/viewRole.jsp | 96 + .../web/jsp/admin/viewUserDetails.jsp | 120 + .../posterita/web/jsp/admin/viewUsers.jsp | 110 + .../web/jsp/attachment/createAttachment.jsp | 87 + .../web/jsp/bPartner/bPartnerCreated.jsp | 180 + .../web/jsp/bPartner/bPartnerDetails.jsp | 184 + .../web/jsp/bPartner/createBPartner.jsp | 218 + .../web/jsp/bPartner/editBPartner.jsp | 220 + .../web/jsp/bPartner/viewBPartner.jsp | 185 + .../posterita/web/jsp/cashBook/cashBook.jsp | 181 + .../posterita/web/jsp/client/createClient.jsp | 206 + .../web/jsp/customer/createPOSCustomer.jsp | 51 + .../web/jsp/customer/existingPOSCustomers.jsp | 138 + .../web/jsp/customer/savePOSCustomer.jsp | 50 + posterita/posterita/web/jsp/error/error.jsp | 78 + .../posterita/web/jsp/help/contactUs.jsp | 87 + .../posterita/web/jsp/help/emailSuccess.jsp | 44 + .../posterita/web/jsp/inOut/minOutDetails.jsp | 153 + .../posterita/web/jsp/inOut/viewMinOut.jsp | 103 + .../web/jsp/inOut/viewReceiptHistory.jsp | 118 + .../web/jsp/inOut/viewShipmentHistory.jsp | 118 + .../posterita/web/jsp/include/backBt.jsp | 28 + .../web/jsp/include/completePOSOrder.jsp | 115 + .../web/jsp/include/completePOSOrderIncl.jsp | 115 + .../include/creditOrderPart1FocusBarCode.jsp | 121 + .../jsp/include/creditOrderWithAdvanced.jsp | 33 + .../web/jsp/include/customerInfoPanel.jsp | 42 + .../web/jsp/include/customerInfoPanel2.jsp | 40 + .../posterita/web/jsp/include/dateFilter.jsp | 34 + .../posterita/web/jsp/include/dayList.jsp | 54 + .../web/jsp/include/documentStatusFilter.jsp | 29 + .../web/jsp/include/draftedCreditOrder.jsp | 82 + .../web/jsp/include/draftedPOSOrder.jsp | 115 + .../posterita/web/jsp/include/endCalendar.jsp | 121 + .../posterita/web/jsp/include/errorMsg.jsp | 65 + .../posterita/web/jsp/include/errors.jsp | 45 + .../posterita/web/jsp/include/filter.jsp | 91 + .../posterita/web/jsp/include/footer.jsp | 50 + .../web/jsp/include/footerTableBottom1.jsp | 77 + .../jsp/include/historyMonthYearFilter.jsp | 41 + .../web/jsp/include/historyfilter.jsp | 62 + .../posterita/web/jsp/include/hourList.jsp | 47 + .../posterita/web/jsp/include/minuteList.jsp | 82 + posterita/posterita/web/jsp/include/month.jsp | 34 + .../posterita/web/jsp/include/monthList.jsp | 23 + posterita/posterita/web/jsp/include/pager.jsp | 142 + .../web/jsp/include/paymentRuleFilter.jsp | 29 + .../web/jsp/include/paymentTermsDetails.jsp | 135 + .../posterita/web/jsp/include/pinPanel.jsp | 49 + .../posterita/web/jsp/include/posFooter.jsp | 66 + .../posterita/web/jsp/include/posHeader.jsp | 255 + .../posterita/web/jsp/include/posHeader2.jsp | 255 + .../jsp/include/posHeaderAdministration.jsp | 278 + .../web/jsp/include/posHistoryFilter.jsp | 92 + .../web/jsp/include/posHistoryFilter2.jsp | 75 + .../posterita/web/jsp/include/posOrder.jsp | 27 + .../web/jsp/include/posOrderBarCode.jsp | 43 + .../web/jsp/include/posOrderFocusBarCode.jsp | 29 + .../web/jsp/include/posOrderFocusSearch.jsp | 29 + .../web/jsp/include/posOrderPart1.jsp | 101 + .../jsp/include/posOrderPart1FocusBarCode.jsp | 70 + .../jsp/include/posOrderPart1FocusSearch.jsp | 61 + .../web/jsp/include/posOrderPart2.jsp | 85 + .../web/jsp/include/posOrderSearch.jsp | 35 + .../web/jsp/include/posOrderWithAdvanced.jsp | 97 + .../posOrderWithAdvancedFocusSearch.jsp | 39 + .../web/jsp/include/posPaymentDetails.jsp | 307 + .../web/jsp/include/posPaymentDetails2.jsp | 307 + .../web/jsp/include/printOrderApplet.jsp | 45 + .../web/jsp/include/printOrderApplet2.jsp | 77 + .../web/jsp/include/searchCustomerPanel.jsp | 25 + .../web/jsp/include/searchCustomerPanel2.jsp | 26 + .../web/jsp/include/searchProductPanel.jsp | 89 + .../web/jsp/include/searchProductPanel2.jsp | 65 + .../web/jsp/include/searchProductPanel3.jsp | 89 + .../web/jsp/include/searchVendorPanel.jsp | 46 + .../web/jsp/include/searchVendorPanel2.jsp | 20 + .../posterita/web/jsp/include/showErrors.jsp | 34 + .../web/jsp/include/startCalendar.jsp | 66 + .../posterita/web/jsp/include/success.jsp | 34 + .../posterita/web/jsp/include/tabBottom.jsp | 24 + .../posterita/web/jsp/include/tabTop.jsp | 25 + .../posterita/web/jsp/include/tabTop_big.jsp | 27 + .../posterita/web/jsp/include/tablebottom.jsp | 37 + .../posterita/web/jsp/include/taxDetails.jsp | 84 + .../posterita/web/jsp/include/tenderPanel.jsp | 126 + .../web/jsp/include/tenderPanel2.jsp | 116 + .../web/jsp/include/vendorInfoPanel.jsp | 47 + posterita/posterita/web/jsp/include/year.jsp | 39 + .../posterita/web/jsp/include/yearList.jsp | 36 + .../web/jsp/invoice/webstoreInvoice.jsp | 126 + .../web/jsp/login/chooseApplication.jsp | 246 + .../posterita/web/jsp/login/chooseRole.jsp | 136 + .../posterita/web/jsp/login/chooseUser.jsp | 119 + posterita/posterita/web/jsp/login/forgot.jsp | 103 + posterita/posterita/web/jsp/login/forgot1.jsp | 87 + posterita/posterita/web/jsp/login/home.jsp | 100 + posterita/posterita/web/jsp/login/index.jsp | 93 + .../posterita/web/jsp/login/loginForm.jsp | 56 + posterita/posterita/web/jsp/login/logout.jsp | 61 + .../posterita/web/jsp/login/maintenance.jsp | 89 + .../posterita/web/jsp/login/password.jsp | 103 + .../posterita/web/jsp/login/posLogin.html | 81 + posterita/posterita/web/jsp/login/success.jsp | 121 + .../jsp/materialmovement/viewMMovement.jsp | 166 + .../materialmovement/viewMMovementHistory.jsp | 127 + .../materialmovement/viewMMovementLines.jsp | 132 + .../jsp/materialmovement/viewMoveConfirm.jsp | 95 + .../materialmovement/viewMoveConfirmLines.jsp | 130 + .../materialmovement/viewMoveLinesHistory.jsp | 120 + .../web/jsp/materialmovement/viewStock.jsp | 394 + .../jsp/materialmovement/viewStockList.jsp | 173 + .../web/jsp/payment/paymentDetails.jsp | 127 + .../posterita/web/jsp/payment/viewPayment.jsp | 96 + .../web/jsp/payment/viewPaymentHistory.jsp | 124 + .../posterita/web/jsp/pos/AllPOSCustomer.jsp | 442 ++ .../web/jsp/pos/ViewAllPosVendors.jsp | 173 + .../posterita/web/jsp/pos/adjustCashBook.jsp | 93 + .../posterita/web/jsp/pos/adjustInventory.jsp | 102 + .../posterita/web/jsp/pos/adjustStock.jsp | 498 ++ .../posterita/web/jsp/pos/adjustedStock.jsp | 97 + .../web/jsp/pos/advancedOrderScreen.jsp | 369 + .../web/jsp/pos/allBlackListCheque.jsp | 114 + .../jsp/pos/cashBookAdjustmentCompleted.jsp | 55 + .../posterita/web/jsp/pos/cashDetails.jsp | 137 + .../posterita/web/jsp/pos/cashLineDetails.jsp | 80 + .../posterita/web/jsp/pos/cashSummary.jsp | 53 + .../posterita/web/jsp/pos/cashSummaryDate.jsp | 91 + .../posterita/web/jsp/pos/cashSummaryInc.jsp | 192 + .../jsp/pos/chooseFastMovingItemReport.jsp | 48 + posterita/posterita/web/jsp/pos/choosePOS.jsp | 103 + .../posterita/web/jsp/pos/choosePOSInfo.jsp | 43 + .../posterita/web/jsp/pos/closeCashBook.jsp | 145 + .../posterita/web/jsp/pos/closePOSTill.jsp | 299 + .../posterita/web/jsp/pos/closedPOSTill.jsp | 184 + .../web/jsp/pos/completePOSOrder.jsp | 36 + .../web/jsp/pos/completePOSOrder2.jsp | 41 + .../web/jsp/pos/completePOSOrder3.jsp | 41 + .../web/jsp/pos/completePOSOrderWA.jsp | 34 + .../web/jsp/pos/completePOSShoppingCart.jsp | 221 + .../web/jsp/pos/completedCreditOrder.jsp | 88 + .../jsp/pos/completedCustomerReturnOrder.jsp | 102 + .../web/jsp/pos/completedGoodsReceiveNote.jsp | 88 + .../web/jsp/pos/completedGoodsReturnNote.jsp | 89 + .../posterita/web/jsp/pos/createAPPayment.jsp | 82 + .../web/jsp/pos/createBlackListCheque.jsp | 81 + .../web/jsp/pos/createCreditOrder.jsp | 114 + .../web/jsp/pos/createCreditOrder2.jsp | 347 + .../pos/createMultipleAPInvoicePayment.jsp | 218 + .../pos/createMultipleIAPnvoicePayment.jsp | 218 + .../jsp/pos/createMultipleInvoicePayment.jsp | 218 + .../web/jsp/pos/createOrUpdatePriceList.jsp | 169 + .../web/jsp/pos/createOrUpdateProduct.jsp | 586 ++ .../web/jsp/pos/createOrUpdateProduct2.jsp | 270 + .../web/jsp/pos/createPOSGarmentProducts.jsp | 551 ++ .../posterita/web/jsp/pos/createPOSOrder.jsp | 122 + .../posterita/web/jsp/pos/createPOSOrder2.jsp | 100 + .../posterita/web/jsp/pos/createPOSOrder3.jsp | 89 + .../jsp/pos/createPOSOrderWithoutAdvance.jsp | 86 + .../web/jsp/pos/createPOSProduct.jsp | 310 + .../posterita/web/jsp/pos/createPOSUser.jsp | 281 + .../web/jsp/pos/createPartialPOSOrder.jsp | 467 ++ .../posterita/web/jsp/pos/createPayment.jsp | 81 + .../web/jsp/pos/createPaymentTerm.jsp | 84 + .../web/jsp/pos/createProductForm.jsp | 272 + .../posterita/web/jsp/pos/createRole.jsp | 228 + posterita/posterita/web/jsp/pos/createTax.jsp | 50 + .../posterita/web/jsp/pos/createVendor.jsp | 119 + .../web/jsp/pos/createdCashPayment.jsp | 105 + .../posterita/web/jsp/pos/createdProducts.jsp | 63 + .../web/jsp/pos/creditOrderPayment.jsp | 277 + .../web/jsp/pos/creditOrderShoppingCart.jsp | 24 + .../posterita/web/jsp/pos/creditScreen.jsp | 246 + .../posterita/web/jsp/pos/creditorHistory.jsp | 89 + .../web/jsp/pos/custRetShoppingCart.jsp | 120 + .../jsp/pos/customFastMovingItemReport.jsp | 51 + .../web/jsp/pos/customPOSInfoReport.jsp | 79 + .../web/jsp/pos/customReportTable.jsp | 173 + .../web/jsp/pos/customSalesByPeriodReport.jsp | 55 + .../web/jsp/pos/customSalesReport.jsp | 29 + .../jsp/pos/customSlowMovingItemReport.jsp | 51 + .../web/jsp/pos/customStockMovementReport.jsp | 50 + .../posterita/web/jsp/pos/customerDetails.jsp | 245 + .../web/jsp/pos/customerReturnOrder.jsp | 376 + .../web/jsp/pos/customerReturnOrder3.jsp | 367 + .../jsp/pos/customerReturnShoppingCart.jsp | 26 + posterita/posterita/web/jsp/pos/debtor.jsp | 78 + .../posterita/web/jsp/pos/debtorHistory.jsp | 89 + .../web/jsp/pos/detailedSalesReport.jsp | 237 + .../web/jsp/pos/downloadUploadCSVfile.jsp | 90 + .../web/jsp/pos/draftedCreditOrder.jsp | 65 + .../jsp/pos/draftedCustomerReturnOrder.jsp | 107 + .../jsp/pos/draftedCustomerReturnOrder2.jsp | 114 + .../jsp/pos/draftedCustomerReturnOrder3.jsp | 114 + .../web/jsp/pos/draftedGoodsReceiveNote.jsp | 116 + .../web/jsp/pos/draftedGoodsReturnNote.jsp | 141 + .../posterita/web/jsp/pos/draftedPOSOrder.jsp | 98 + .../web/jsp/pos/draftedPOSOrder2.jsp | 96 + .../web/jsp/pos/draftedPOSShoppingCart.jsp | 95 + .../web/jsp/pos/draftedPartialPOSOrder.jsp | 198 + .../web/jsp/pos/draftedposOrderWA.jsp | 197 + .../web/jsp/pos/dunningLettersPrinted.jsp | 56 + .../web/jsp/pos/editBlackListCheque.jsp | 79 + .../web/jsp/pos/editBulkProductPrice.jsp | 199 + .../posterita/web/jsp/pos/editPOSCustomer.jsp | 53 + .../posterita/web/jsp/pos/editPOSUser.jsp | 284 + .../posterita/web/jsp/pos/editPaymentTerm.jsp | 68 + posterita/posterita/web/jsp/pos/editRole.jsp | 254 + .../web/jsp/pos/editRoleOrgAccess.jsp | 110 + posterita/posterita/web/jsp/pos/editTax.jsp | 52 + .../posterita/web/jsp/pos/editVendor.jsp | 122 + .../posterita/web/jsp/pos/editattribute.jsp | 71 + .../posterita/web/jsp/pos/editpriceList.jsp | 57 + posterita/posterita/web/jsp/pos/filter.jsp | 109 + .../web/jsp/pos/generateCommission.jsp | 69 + .../posterita/web/jsp/pos/genericReport.jsp | 72 + .../web/jsp/pos/getCreditOrderDiscDetails.jsp | 210 + .../web/jsp/pos/getCurrentTillAmount.jsp | 117 + .../jsp/pos/getCustomerReturnFormPOSOrder.jsp | 96 + .../posterita/web/jsp/pos/getPOSCustomers.jsp | 139 + .../web/jsp/pos/getPOSPaymentDetails.jsp | 66 + .../web/jsp/pos/getPOSPaymentDetails2.jsp | 67 + .../web/jsp/pos/getPOSPaymentDetails_1.jsp | 218 + .../posterita/web/jsp/pos/getPOSStock.jsp | 172 + .../jsp/pos/getPartialPOSPaymentDetails.jsp | 816 ++ .../web/jsp/pos/goodsReceiveNote.jsp | 324 + .../web/jsp/pos/goodsReceiveShoppingCart.jsp | 25 + .../posterita/web/jsp/pos/goodsReturnNote.jsp | 321 + .../web/jsp/pos/goodsReturnShoppingCart.jsp | 25 + .../posterita/web/jsp/pos/grnShoppingCart.jsp | 25 + .../posterita/web/jsp/pos/importBlackList.jsp | 97 + .../posterita/web/jsp/pos/importCustomer.jsp | 248 + .../web/jsp/pos/importPOSProducts.jsp | 155 + .../posterita/web/jsp/pos/importPOSStock.jsp | 62 + posterita/posterita/web/jsp/pos/index.jsp | 45 + .../posterita/web/jsp/pos/initMaxItem.jsp | 37 + .../posterita/web/jsp/pos/initMinItem.jsp | 38 + .../web/jsp/pos/initViewPOSInfo2.jsp | 31 + .../jsp/pos/initViewSalesAnalysisReport.jsp | 35 + .../web/jsp/pos/initViewStockMovement.jsp | 38 + .../web/jsp/pos/inventoryImportErrors.jsp | 56 + .../web/jsp/pos/invokeCreditOrder.jsp | 97 + .../web/jsp/pos/invokePartialPOSOrder.jsp | 97 + .../posterita/web/jsp/pos/listCashBooks.jsp | 98 + .../posterita/web/jsp/pos/listCurrencies.jsp | 93 + .../posterita/web/jsp/pos/listPOSUsers.jsp | 144 + .../posterita/web/jsp/pos/listPriceLists.jsp | 140 + posterita/posterita/web/jsp/pos/listRoles.jsp | 124 + .../posterita/web/jsp/pos/listTerminals.jsp | 120 + .../web/jsp/pos/monthlySalesReport.jsp | 36 + .../web/jsp/pos/orderDetailsPerProduct.jsp | 113 + .../posterita/web/jsp/pos/orderHeader.jsp | 129 + .../posterita/web/jsp/pos/orderScreen.jsp | 727 ++ .../jsp/pos/partialPOSOrderShoppingCart.jsp | 27 + posterita/posterita/web/jsp/pos/posLogin.jsp | 308 + .../posterita/web/jsp/pos/posPINLogin.jsp | 141 + .../posterita/web/jsp/pos/posPassword.jsp | 79 + posterita/posterita/web/jsp/pos/posReport.jsp | 312 + .../posterita/web/jsp/pos/posReport1.jsp | 292 + .../posterita/web/jsp/pos/posShoppingCart.jsp | 101 + .../web/jsp/pos/posShoppingCartFirstPage.jsp | 27 + .../posterita/web/jsp/pos/posSubMenu.jsp | 79 + .../posterita/web/jsp/pos/postingSuccess.jsp | 55 + .../posterita/web/jsp/pos/priceCheck.jsp | 80 + posterita/posterita/web/jsp/pos/priceList.jsp | 109 + .../posterita/web/jsp/pos/printPOSOrder.jsp | 157 + .../web/jsp/pos/productBarcodeCart.jsp | 387 + .../posterita/web/jsp/pos/productDetails.jsp | 74 + .../web/jsp/pos/productDetailsError.jsp | 25 + .../posterita/web/jsp/pos/productsUpdated.jsp | 71 + .../posterita/web/jsp/pos/reportCalendar.jsp | 156 + .../posterita/web/jsp/pos/reportFilter.jsp | 230 + .../posterita/web/jsp/pos/retShoppingCart.jsp | 150 + .../posterita/web/jsp/pos/salesReport.jsp | 76 + .../posterita/web/jsp/pos/saveVendor.jsp | 144 + .../posterita/web/jsp/pos/searchCustomer.jsp | 98 + .../jsp/pos/searchPOSGarmentAttributes.jsp | 56 + .../web/jsp/pos/searchPOSProducts.jsp | 299 + .../posterita/web/jsp/pos/searchVendor.jsp | 97 + .../posterita/web/jsp/pos/settleAPPayment.jsp | 592 ++ .../posterita/web/jsp/pos/settlePayment.jsp | 610 ++ .../posterita/web/jsp/pos/shoppingCart.jsp | 139 + .../web/jsp/pos/stockAdjustments.jsp | 36 + posterita/posterita/web/jsp/pos/terminal.jsp | 421 ++ .../web/jsp/pos/testShoppingCart.jsp | 152 + .../posterita/web/jsp/pos/updateCurrency.jsp | 115 + .../web/jsp/pos/updatePOSProduct.jsp | 285 + .../posterita/web/jsp/pos/updatedProduct.jsp | 136 + .../web/jsp/pos/viewAPPaymentAllocation.jsp | 153 + .../web/jsp/pos/viewAllPOSProducts.jsp | 503 ++ .../jsp/pos/viewAllPOSProductsForUpdate.jsp | 281 + .../web/jsp/pos/viewAllPaymentTerm.jsp | 123 + .../posterita/web/jsp/pos/viewAllTax.jsp | 109 + .../web/jsp/pos/viewBPartnerTrxDetails.jsp | 183 + .../posterita/web/jsp/pos/viewBarcode.jsp | 65 + .../web/jsp/pos/viewBestSellingItems.jsp | 50 + .../web/jsp/pos/viewBlackListCheques.jsp | 59 + .../posterita/web/jsp/pos/viewCommission.jsp | 128 + .../web/jsp/pos/viewCommissionDetails.jsp | 114 + .../web/jsp/pos/viewCompletePOSOrder.jsp | 103 + .../web/jsp/pos/viewCompletedCreditOrder.jsp | 64 + .../pos/viewCompletedCustomerReturnOrder.jsp | 85 + .../jsp/pos/viewCompletedGoodsReceiveNote.jsp | 79 + .../jsp/pos/viewCompletedGoodsReturnNote.jsp | 158 + .../web/jsp/pos/viewCompletedPOSOrder.jsp | 145 + .../posterita/web/jsp/pos/viewCreditors.jsp | 115 + .../posterita/web/jsp/pos/viewCurrency.jsp | 78 + .../posterita/web/jsp/pos/viewDebtors.jsp | 116 + .../web/jsp/pos/viewDocumentHistory.jsp | 155 + .../posterita/web/jsp/pos/viewDocumentPDF.jsp | 46 + .../web/jsp/pos/viewDraftedOrder.jsp | 153 + .../web/jsp/pos/viewInventoryHistory.jsp | 239 + .../web/jsp/pos/viewMaxSoldItems.jsp | 68 + .../posterita/web/jsp/pos/viewMinOut.jsp | 145 + .../web/jsp/pos/viewMinSoldItems.jsp | 70 + posterita/posterita/web/jsp/pos/viewOrder.jsp | 317 + .../web/jsp/pos/viewPOSBPartnerForDunning.jsp | 168 + .../web/jsp/pos/viewPOSBPartnerInfo.jsp | 135 + .../posterita/web/jsp/pos/viewPOSCustomer.jsp | 230 + .../web/jsp/pos/viewPOSCustomerCart.jsp | 193 + .../posterita/web/jsp/pos/viewPOSHistory.jsp | 127 + .../web/jsp/pos/viewPOSHistoryForAll.jsp | 211 + .../web/jsp/pos/viewPOSHistory_displaytag.jsp | 122 + .../posterita/web/jsp/pos/viewPOSInfo.jsp | 82 + .../posterita/web/jsp/pos/viewPOSOrder.jsp | 223 + .../posterita/web/jsp/pos/viewPOSProduct.jsp | 276 + .../posterita/web/jsp/pos/viewPOSProducts.jsp | 71 + .../posterita/web/jsp/pos/viewPOSUser.jsp | 201 + .../jsp/pos/viewPartialPOSOrderHistory.jsp | 108 + .../posterita/web/jsp/pos/viewPayment.jsp | 96 + .../web/jsp/pos/viewPaymentAllocation.jsp | 153 + .../web/jsp/pos/viewPaymentDetails.jsp | 181 + .../posterita/web/jsp/pos/viewPreferences.jsp | 278 + .../posterita/web/jsp/pos/viewProductCart.jsp | 134 + .../web/jsp/pos/viewProductCartForUpdate.jsp | 134 + .../web/jsp/pos/viewProductSalesDetails.jsp | 154 + .../web/jsp/pos/viewProductsSalesInfo.jsp | 127 + posterita/posterita/web/jsp/pos/viewRole.jsp | 92 + .../web/jsp/pos/viewStockEnquiry.jsp | 73 + .../web/jsp/pos/viewStockMovement.jsp | 92 + .../web/jsp/pos/viewStockSalesReport.jsp | 112 + .../web/jsp/pos/viewStockTransfer.jsp | 223 + .../web/jsp/pos/viewVendorDetails.jsp | 106 + .../web/jsp/pos/viewWebstorePayment.jsp | 121 + .../web/jsp/pos/viewattributevalues.jsp | 87 + .../web/jsp/pos/webDocumentHeader.jsp | 81 + .../web/jsp/pos/wstoreeditattribute.jsp | 72 + .../web/jsp/pos/wstoreviewattributevalues.jsp | 81 + .../web/jsp/product/viewProductInfo.jsp | 18 + .../posterita/web/jsp/user/createUser.jsp | 173 + posterita/posterita/web/jsp/user/editUser.jsp | 174 + .../posterita/web/jsp/user/listUsers.jsp | 103 + .../posterita/web/jsp/user/registerUser.jsp | 153 + .../posterita/web/jsp/user/userCreated.jsp | 143 + posterita/posterita/web/jsp/user/viewUser.jsp | 153 + posterita/properties.xml | 17 + utils_dev/build.xml | 4 +- 1586 files changed, 265076 insertions(+), 2 deletions(-) create mode 100644 posterita/.classpath create mode 100644 posterita/.project create mode 100644 posterita/.settings/org.eclipse.jdt.core.prefs create mode 100644 posterita/.settings/org.eclipse.jdt.ui.prefs create mode 100644 posterita/.tomcatplugin create mode 100644 posterita/commons/BuildPatch/Adempiere/jboss/bin/run.conf create mode 100644 posterita/commons/Migration/1.0-1.5 (AD331b)/build.xml create mode 100644 posterita/commons/Migration/1.0-1.5 (AD331b)/oracle/001_ad_changes.sql create mode 100644 posterita/commons/Migration/1.0-1.5 (AD331b)/oracle/002_ad_message.sql create mode 100644 posterita/commons/Migration/1.0-1.5 (AD331b)/oracle/003_m_pricelist.sql create mode 100644 posterita/commons/Migration/1.0-1.5 (AD331b)/postgresql/001_ad_changes.sql create mode 100644 posterita/commons/Migration/1.0-1.5 (AD331b)/postgresql/002_ad_message.sql create mode 100644 posterita/commons/Migration/1.0-1.5 (AD331b)/postgresql/003_m_pricelist.sql create mode 100644 posterita/commons/Migration/1.6(AD340)/build.xml create mode 100644 posterita/commons/Migration/1.6(AD340)/oracle/001_ad_Changes for C_Currency.sql create mode 100644 posterita/commons/Migration/1.6(AD340)/oracle/002_ad_message.sql create mode 100644 posterita/commons/Migration/1.6(AD340)/oracle/003_C_Currency.sql create mode 100644 posterita/commons/Migration/1.6(AD340)/postgresql/001_ad_Changes for C_Currency.sql create mode 100644 posterita/commons/Migration/1.6(AD340)/postgresql/002_ad_message.sql create mode 100644 posterita/commons/Migration/1.6(AD340)/postgresql/003_C_Currency.sql create mode 100644 posterita/commons/Migration/1.7.0/build.xml create mode 100644 posterita/commons/Migration/1.7.0/oracle/001_MixedPayment.sql create mode 100644 posterita/commons/Migration/1.7.0/oracle/002_Terminals_newTableStructure.sql create mode 100644 posterita/commons/Migration/1.7.0/oracle/003_Terminals_TransferConfiguration.sql create mode 100644 posterita/commons/Migration/1.7.0/oracle/004_Terminals_newTableDDL.sql create mode 100644 posterita/commons/Migration/1.7.0/oracle/005_Messages.sql create mode 100644 posterita/commons/Migration/1.7.0/postgresql/001_MixedPayment.sql create mode 100644 posterita/commons/Migration/1.7.0/postgresql/002_Terminals_newTableStructure.sql create mode 100644 posterita/commons/Migration/1.7.0/postgresql/003_Terminals_TransferConfiguration.sql create mode 100644 posterita/commons/Migration/1.7.0/postgresql/004_Terminals_newTableDDL.sql create mode 100644 posterita/commons/Migration/1.7.0/postgresql/005_Messages.sql create mode 100644 posterita/commons/Migration/1.7.1/build.xml create mode 100644 posterita/commons/Migration/1.7.1/oracle/001_M_Inventory.sql create mode 100644 posterita/commons/Migration/1.7.1/postgresql/001_M_Inventory.sql create mode 100644 posterita/commons/Migration/1.7.2/build.xml create mode 100644 posterita/commons/Migration/1.7.2/oracle/001_ADRole.sql create mode 100644 posterita/commons/Migration/1.7.2/postgresql/001_ADRole.sql create mode 100644 posterita/commons/Migration/oracle.properties create mode 100644 posterita/commons/Migration/oracle.properties.template create mode 100644 posterita/commons/Migration/trunk/build.xml create mode 100644 posterita/commons/Migration/trunk/oracle/002_ADMessage.sql create mode 100644 posterita/commons/Migration/trunk/oracle/003_AD_OrgInfo.sql create mode 100644 posterita/commons/Migration/trunk/oracle/004_AD_Changes for AD_OrgInfo.sql create mode 100644 posterita/commons/Migration/trunk/oracle/005_MissingIDs.sql create mode 100644 posterita/commons/Migration/trunk/oracle/006_PackSize_MProduct.sql create mode 100644 posterita/commons/Migration/trunk/oracle/007_CashPayment.sql create mode 100644 posterita/commons/Migration/trunk/postgresql/002_ADMessage.sql create mode 100644 posterita/commons/Migration/trunk/postgresql/003_AD_OrgInfo.sql create mode 100644 posterita/commons/Migration/trunk/postgresql/004_AD_Changes for AD_OrgInfo.sql create mode 100644 posterita/commons/Migration/trunk/postgresql/005_MissingIDs.sql create mode 100644 posterita/commons/Migration/trunk/postgresql/006_PackSize_MProduct.sql create mode 100644 posterita/commons/Migration/trunk/postgresql/007_CashPayment.sql create mode 100644 posterita/commons/build.xml create mode 100644 posterita/commons/properties.xml create mode 100644 posterita/posterita/build.properties create mode 100644 posterita/posterita/build.xml create mode 100644 posterita/posterita/properties.xml create mode 100644 posterita/posterita/src/aspect/org/posterita/aspect/POAspect.aj create mode 100644 posterita/posterita/src/aspect/org/posterita/aspect/TrxAspect.aj create mode 100644 posterita/posterita/src/ear/application.xml create mode 100644 posterita/posterita/src/main/ApproveOrderEmailTemplate.properties create mode 100644 posterita/posterita/src/main/CreateCustomerEmailTemplate.properties create mode 100644 posterita/posterita/src/main/CreateOrderEmailTemplate.properties create mode 100644 posterita/posterita/src/main/Factory.properties create mode 100644 posterita/posterita/src/main/MessageResources.properties create mode 100644 posterita/posterita/src/main/ShipmentDispatchedEmailTemplate.properties create mode 100644 posterita/posterita/src/main/displaytag.properties create mode 100644 posterita/posterita/src/main/org/compiere/model/I_AD_OrgInfo.java create mode 100644 posterita/posterita/src/main/org/compiere/model/I_AD_Role.java create mode 100644 posterita/posterita/src/main/org/compiere/model/I_C_CashLine.java create mode 100644 posterita/posterita/src/main/org/compiere/model/I_C_Currency.java create mode 100644 posterita/posterita/src/main/org/compiere/model/I_C_Invoice.java create mode 100644 posterita/posterita/src/main/org/compiere/model/I_C_Order.java create mode 100644 posterita/posterita/src/main/org/compiere/model/I_C_Payment.java create mode 100644 posterita/posterita/src/main/org/compiere/model/I_M_InventoryLine.java create mode 100644 posterita/posterita/src/main/org/compiere/model/I_M_PriceList.java create mode 100644 posterita/posterita/src/main/org/compiere/model/I_M_Product.java create mode 100644 posterita/posterita/src/main/org/compiere/model/I_U_POSTerminal.java create mode 100644 posterita/posterita/src/main/org/compiere/model/MCash.java create mode 100644 posterita/posterita/src/main/org/compiere/model/MCashBook.java create mode 100644 posterita/posterita/src/main/org/compiere/model/MElementValue.java create mode 100644 posterita/posterita/src/main/org/compiere/model/MInvoice.java create mode 100644 posterita/posterita/src/main/org/compiere/model/MOrder.java create mode 100644 posterita/posterita/src/main/org/compiere/model/MPOS.java create mode 100644 posterita/posterita/src/main/org/compiere/model/MPOSTerminal.java create mode 100644 posterita/posterita/src/main/org/compiere/model/MPayment.java create mode 100644 posterita/posterita/src/main/org/compiere/model/MSequence.java create mode 100644 posterita/posterita/src/main/org/compiere/model/MWarehouse.java create mode 100644 posterita/posterita/src/main/org/compiere/model/X_AD_OrgInfo.java create mode 100644 posterita/posterita/src/main/org/compiere/model/X_AD_Role.java create mode 100644 posterita/posterita/src/main/org/compiere/model/X_C_CashLine.java create mode 100644 posterita/posterita/src/main/org/compiere/model/X_C_Currency.java create mode 100644 posterita/posterita/src/main/org/compiere/model/X_C_Invoice.java create mode 100644 posterita/posterita/src/main/org/compiere/model/X_C_Order.java create mode 100644 posterita/posterita/src/main/org/compiere/model/X_C_Payment.java create mode 100644 posterita/posterita/src/main/org/compiere/model/X_M_InventoryLine.java create mode 100644 posterita/posterita/src/main/org/compiere/model/X_M_PriceList.java create mode 100644 posterita/posterita/src/main/org/compiere/model/X_M_Product.java create mode 100644 posterita/posterita/src/main/org/compiere/model/X_U_POSTerminal.java create mode 100644 posterita/posterita/src/main/org/compiere/report/ReportStarter.java create mode 100644 posterita/posterita/src/main/org/posterita/Constants.java create mode 100644 posterita/posterita/src/main/org/posterita/TangoColors.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/AddressBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/AgingBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/ApplicationParametersBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/AttachmentBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/AttributeBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/AttributeInstanceBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/AttributeValueDetailBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/AttributeValuesBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/AttributeValuesPair.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/AvailableProductSizeBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/BPartnerBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/BPartnerInfoBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/BankAccountBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/BankBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/BankStatementLineBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/BlackListedBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/CashBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/CashBookBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/CashBookDetailBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/CashLineBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/CashSummaryBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/ChangeDocumentStatusBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/ChangePasswordBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/CheckoutBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/CloseTillBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/CommandBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/CommissionBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/CreditCardBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/CreditCheckBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/CreditPaymentDetailsBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/CurrencyBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/CurrentTillAmountBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/CustomerBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/DateFilterBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/DisplayMessageLogBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/DocumentBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/DocumentHistortFilterBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/DocumentHistoryBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/DunningBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/EditPriceBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/FilterBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/GenericProductBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/InOutHistoryBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/InventoryBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/InventoryCartBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/InventoryLineBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/InvoiceHistoryBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/ItemBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/LocatorBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/LoginBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/MMovementCartBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/MenuItemBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/MessageBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/MessageLoggerBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/MinOutHistoryBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/OpenItemBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/OrderBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/OrderHistoryBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/OrderInfoBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/OrderLineAttributeSetInstanceBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/OrderLineBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/OrderLineImporterBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/OrgBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/OrgUsersBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/POSBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/POSDescriptionBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/POSHelpBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/POSHistoryBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/POSInfoBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/POSReportBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/POSStockBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/POSSupplierBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/PaymentAllocationBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/PaymentBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/PaymentDetailsBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/PaymentHistoryBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/PaymentTermBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/PaymentTypeBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/PopulateHistoryBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/PriceListBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/PrintBarcodeBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/ProductAttributeBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/ProductAttributeValueBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/ProductBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/ProductCategoryBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/ProductDetailsBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/ProductImageBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/ProductImageInfo.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/ProductInfo.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/ProductInfoBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/ProductInstanceBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/ProductKeywordsBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/ProductPriceBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/ProductQuery.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/ProductRestrictionBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/ProductSalesInfoBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/ProductSalesSummaryBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/ProductSearchBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/ProductSpecsBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/ProductStatusBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/ProductSupplierBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/RemoveSessionBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/ReportBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/ReportDataBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/ReportImageBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/RoleBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/SalesAnalysisReportBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/SalesAnalysisReportDataBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/SalesDetailsBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/SearchBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/SearchOrderBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/ShipperBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/ShoppingCartBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/StatementOfAccountBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/StockBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/StockMovementBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/SynchronizationBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/SynchronizeCollectionBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/TShirtProductDetailsBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/TabularReportRecordBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/TaxBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/TerminalBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/TestMod.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/TradeInBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/TrendsBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/UDIBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/UDIPair.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/UserBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/VendorBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/WarehouseBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/WebDocumentBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/WebDocumentHeaderBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/WebInvoiceLineBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/WebMinOutLineBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/WebOrderLineBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/WebStockBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/WebstoreProductImageFileBean.java create mode 100644 posterita/posterita/src/main/org/posterita/beans/WebstoreUserBean.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/AbstractDocumentManager.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/AttributeValuesManager.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/BankManager.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/CashManager.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/CashTransferManager.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/ClientManager.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/CurrencyManager.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/CustomerCart.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/EditBulkProductFromFileManager.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/FileAttachmentManager.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/GenericStockManager.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/HistoryFilterBean.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/ImportPosProductManager.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/InvoiceManager.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/LocationManager.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/LoginManager.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/MenuManager.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/MinOutManager.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/OrderManager.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/OrderReferenceManager.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/OrganisationManager.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/POSBpartnerInfoManager.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/POSClientManager.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/POSGoodsManager.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/POSManager.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/POSProductManager.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/POSStockManager.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/POSTerminalManager.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/PartialPOSManager.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/PaymentAllocationManager.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/PaymentManager.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/PaymentTermManager.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/PostingManager.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/PrintManager.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/ProcessManager.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/ProductAttributeSetManager.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/ProductCart.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/ProductImageUploader.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/RegionManager.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/RoleMenuManager.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/SearchManager.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/ShoppingcartManager.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/StockInquiryManager.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/StoreManager.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/UDIMessageManager.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/administration/BPartnerManager.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/administration/BarcodeManager.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/administration/BlackListedManager.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/administration/CheckSequenceManager.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/administration/CommissionManager.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/administration/CustomerManager.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/administration/DunningManager.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/administration/ImportCustomerManager.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/administration/PriceListManager.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/administration/ProductAttributeManager.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/administration/ProductImageManager.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/administration/ProductManager.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/administration/RoleManager.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/administration/TaxManager.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/administration/UserManager.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/administration/UserRoleManager.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/administration/VendorManager.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/administration/WarehouseManager.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/core/AccountingManager.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/core/ApplicationManager.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/core/AttachmentManager.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/core/AttributeManager.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/core/ChargeManager.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/creditsales/CreditOrderManager.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/performanceanalysis/CSVReportManager.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/performanceanalysis/CustomPOSReportManager.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/performanceanalysis/POSReportManager.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/performanceanalysis/POSSalesReportManager.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/performanceanalysis/ReportDateManager.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/performanceanalysis/ReportManager.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/performanceanalysis/SalesAnalysisReportManager.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/product/GenericProductImpl.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/product/IProduct.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/stock/InventoryCartManager.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/stock/InventoryManager.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/stock/MMovementManager.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/stock/StockList.java create mode 100644 posterita/posterita/src/main/org/posterita/businesslogic/stock/StockManager.java create mode 100644 posterita/posterita/src/main/org/posterita/cashType/UDICashType.java create mode 100644 posterita/posterita/src/main/org/posterita/cashType/UDICashTypes.java create mode 100644 posterita/posterita/src/main/org/posterita/core/AbstractChart.java create mode 100644 posterita/posterita/src/main/org/posterita/core/AbstractParser.java create mode 100644 posterita/posterita/src/main/org/posterita/core/BarChart.java create mode 100644 posterita/posterita/src/main/org/posterita/core/BarLabelGenerator.java create mode 100644 posterita/posterita/src/main/org/posterita/core/CheckDuplicateEntities.java create mode 100644 posterita/posterita/src/main/org/posterita/core/Configuration.java create mode 100644 posterita/posterita/src/main/org/posterita/core/ContextId.java create mode 100644 posterita/posterita/src/main/org/posterita/core/CrossTabReportGenerator.java create mode 100644 posterita/posterita/src/main/org/posterita/core/DocStatusMap.java create mode 100644 posterita/posterita/src/main/org/posterita/core/EmailValidator.java create mode 100644 posterita/posterita/src/main/org/posterita/core/FactoryPropertiesManager.java create mode 100644 posterita/posterita/src/main/org/posterita/core/FileManager.java create mode 100644 posterita/posterita/src/main/org/posterita/core/FilePropertiesManager.java create mode 100644 posterita/posterita/src/main/org/posterita/core/I18nAdapter.java create mode 100644 posterita/posterita/src/main/org/posterita/core/ImageServer.java create mode 100644 posterita/posterita/src/main/org/posterita/core/InitWebEnv.java create mode 100644 posterita/posterita/src/main/org/posterita/core/Interpreter.java create mode 100644 posterita/posterita/src/main/org/posterita/core/JulianDate.java create mode 100644 posterita/posterita/src/main/org/posterita/core/KeyNamePairUtil.java create mode 100644 posterita/posterita/src/main/org/posterita/core/MenuItem.java create mode 100644 posterita/posterita/src/main/org/posterita/core/NameValuePair.java create mode 100644 posterita/posterita/src/main/org/posterita/core/PDFReportGenerator.java create mode 100644 posterita/posterita/src/main/org/posterita/core/PDFReportPageEventHelper.java create mode 100644 posterita/posterita/src/main/org/posterita/core/PieChart.java create mode 100644 posterita/posterita/src/main/org/posterita/core/PieLabelGenerator.java create mode 100644 posterita/posterita/src/main/org/posterita/core/PrintOrderApplet.java create mode 100644 posterita/posterita/src/main/org/posterita/core/RandomStringGenerator.java create mode 100644 posterita/posterita/src/main/org/posterita/core/Range.java create mode 100644 posterita/posterita/src/main/org/posterita/core/ReadKiaDemoData.java create mode 100644 posterita/posterita/src/main/org/posterita/core/SessionStorage.java create mode 100644 posterita/posterita/src/main/org/posterita/core/SimpleCalendarDate.java create mode 100644 posterita/posterita/src/main/org/posterita/core/SimpleReportGenerator.java create mode 100644 posterita/posterita/src/main/org/posterita/core/SystemObjects.java create mode 100644 posterita/posterita/src/main/org/posterita/core/TabularReport.java create mode 100644 posterita/posterita/src/main/org/posterita/core/TabularReport2.java create mode 100644 posterita/posterita/src/main/org/posterita/core/TabularReportMerge.java create mode 100644 posterita/posterita/src/main/org/posterita/core/TestStockInquiry.java create mode 100644 posterita/posterita/src/main/org/posterita/core/ThumbnailGenerator.java create mode 100644 posterita/posterita/src/main/org/posterita/core/TimeSeriesChart.java create mode 100644 posterita/posterita/src/main/org/posterita/core/TimestampConvertor.java create mode 100644 posterita/posterita/src/main/org/posterita/core/TmkJSPEnv.java create mode 100644 posterita/posterita/src/main/org/posterita/core/TrxPrefix.java create mode 100644 posterita/posterita/src/main/org/posterita/core/UDIFilePropertiesManager.java create mode 100644 posterita/posterita/src/main/org/posterita/core/UDIMap.java create mode 100644 posterita/posterita/src/main/org/posterita/core/UDIPair.java create mode 100644 posterita/posterita/src/main/org/posterita/core/UDIPropertiesManager.java create mode 100644 posterita/posterita/src/main/org/posterita/core/UpdateUsers.java create mode 100644 posterita/posterita/src/main/org/posterita/core/WebFacade.java create mode 100644 posterita/posterita/src/main/org/posterita/core/action/ClientAction.java create mode 100644 posterita/posterita/src/main/org/posterita/core/action/login/GenericLoginAction.java create mode 100644 posterita/posterita/src/main/org/posterita/core/bean/ClientBean.java create mode 100644 posterita/posterita/src/main/org/posterita/core/bean/ElementBean.java create mode 100644 posterita/posterita/src/main/org/posterita/core/businesslogic/ElementManager.java create mode 100644 posterita/posterita/src/main/org/posterita/core/businesslogic/ImportManager.java create mode 100644 posterita/posterita/src/main/org/posterita/core/exception/FileOpException.java create mode 100644 posterita/posterita/src/main/org/posterita/core/exception/IOOperationException.java create mode 100644 posterita/posterita/src/main/org/posterita/core/form/ClientForm.java create mode 100644 posterita/posterita/src/main/org/posterita/core/install/EnvSettings.java create mode 100644 posterita/posterita/src/main/org/posterita/core/install/POSInstall.java create mode 100644 posterita/posterita/src/main/org/posterita/core/utils/DisplayReportServlet.java create mode 100644 posterita/posterita/src/main/org/posterita/core/utils/Encrypter.java create mode 100644 posterita/posterita/src/main/org/posterita/core/utils/FormatBigDecimal.java create mode 100644 posterita/posterita/src/main/org/posterita/core/utils/IOUtil.java create mode 100644 posterita/posterita/src/main/org/posterita/core/utils/MonthConverter.java create mode 100644 posterita/posterita/src/main/org/posterita/core/utils/NumberUtil.java create mode 100644 posterita/posterita/src/main/org/posterita/core/utils/SimpleEmailLayout.java create mode 100644 posterita/posterita/src/main/org/posterita/decorator/HistoryCsvExportWrapper.java create mode 100644 posterita/posterita/src/main/org/posterita/decorator/HistoryPdfExportWrapper.java create mode 100644 posterita/posterita/src/main/org/posterita/decorator/HistoryRtfExportWrapper.java create mode 100644 posterita/posterita/src/main/org/posterita/decorator/HistoryWrapper.java create mode 100644 posterita/posterita/src/main/org/posterita/decorator/InventoryHistoryWrapper.java create mode 100644 posterita/posterita/src/main/org/posterita/decorator/InventoryMoveHistoryWrapper.java create mode 100644 posterita/posterita/src/main/org/posterita/decorator/PaymentDecorator.java create mode 100644 posterita/posterita/src/main/org/posterita/doctype/UDIDocSubTypeSO.java create mode 100644 posterita/posterita/src/main/org/posterita/doctype/UDIDocSubTypeSOValues.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/AllocatedAmtMoreThanOpenAmtException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/AllocationAlreadyExistsException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/ApplicationException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/AttachmentInvalidException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/AttachmentNotFoundException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/AttributeValueAlreadyExistsException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/AttributeValuesDifferentException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/BPGroupException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/BPartnerAlreadyExistException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/BPartnerAlreadyExistsException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/BPartnerException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/BPartnerInvalidException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/BPartnerNoLocationException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/BPartnerNotFoundException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/BPartnerOverCreditLimitException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/BankAlreadyExistException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/BarcodeAlreadyExistsException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/BirtEngineException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/CSVDataInvalidException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/CSVFileException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/CanNotAjdustTillException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/CanNotCloseTillException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/CanNotCreatePaymentAllocationException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/CanNotDeleteOrderException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/CanNotMoveStockException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/CannotCreateInventoryLineException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/CannotDeactivatePaymentTermException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/CannotInactivateProductException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/CannotInactivateTaxException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/CashBookAlreadyAssignedException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/ClientAlreadyExistException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/CloseStatusNotFoundException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/CreditCardExpiryInvalidException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/CreditCardNumberException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/CreditCardTypeNotSupportedException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/CreditCardVVInvalidException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/CustomerNotImportedException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/DataException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/DefaultStoreException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/DeleteAttachmentException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/DescriptionNotFoundException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/DiscountLimitException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/DocumentDoesNotBelongToYouException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/DuplicatePINException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/DuplicateRoleException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/DuplicateUOMException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/DuplicateUserPinException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/EMailInvalidException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/EMailMessageException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/EMailMessageParsingException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/EMailNotSentException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/EMailServerConnectionException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/EMailServerLoginException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/EMailServerMessageException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/EmailAlreadyExistsException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/EmailNotFoundException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/EmptyCartException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/EncryptionException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/FormattingException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/ImageAttachmentException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/ImportFileAlreadyExistException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/ImportFileNotFoundException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/ImportProductException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/InputQuantityLessThanZeroException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/InsufficientQtyException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/InvalidAddressException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/InvalidBPartnerException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/InvalidBankAccountException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/InvalidBankException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/InvalidBarcodeException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/InvalidConfirmPasswordException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/InvalidContentTypeException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/InvalidDateTimeException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/InvalidEmailException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/InvalidInvokeOrderStatusException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/InvalidMessageStatusException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/InvalidMonthException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/InvalidNetDaysException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/InvalidOrderIDException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/InvalidOrderTypeException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/InvalidOrganisationTypeException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/InvalidPINException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/InvalidPasswordLengthException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/InvalidPeriodException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/InvalidProductQuantityException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/InvalidRequestUpdateException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/InvalidRoleException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/InvalidTenderedAmountException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/InvalidTerminalCashBookException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/InvalidURLException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/InvalidYearException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/KeywordsRequiredException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/LimitPriceViolatedException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/LogoException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/MandatoryException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/MandatoryNameException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/NoAccessToEditObjectException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/NoAllocateeInvoiceException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/NoCashJournalPresentException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/NoCheckBoxSelectedException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/NoClientFoundException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/NoCustomerFoundException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/NoLocationFoundException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/NoOrderLineFoundException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/NoOrderLineSelectedException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/NoPaymentAmountException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/NoProductImageException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/NoProductSelectedException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/NoStockAvailableException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/NotLoggedInException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/NullTransferAmountException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/OperationException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/OrganisationAlreadyExistsException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/POException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/POSTerminalException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/PayAmtNotEqualToAllocateAmtException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/PaymentTermAlreadyExistsException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/PriceListAlreadyExistsException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/ProductAlreadyExistException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/ProductImageInvalidException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/ProductInStockException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/ProductNotFoundException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/ProductNotImportedException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/ProductNotOnPriceListException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/QuantityNotAvailableException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/ReloadFactoryException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/RequestOwnerNotFoundException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/RoleAlreadyExistsException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/SequenceUpdateException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/ShipmentAlreadyExistsException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/ShipperAlreadyExistsException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/StoreException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/SurnameNotPresentException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/SystemException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/TMKRuntimeException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/TaxNameAlreadyExistsException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/TaxRateAlreadyExistsException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/TaxRateNotDefineException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/TerminalInactivateException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/TerminalLockedException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/TerminalNotFoundException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/ThumbnailGenerationException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/TooManyAllocateInvoiceException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/TotalQuantityLessThanZeroException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/TrackingNumberNotfoundException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/TransferAmountExceedsTotalAmountException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/UOMNotFoundException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/UOMValuePrecisionNotValidException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/UnitNumberAlreadyExistException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/UnsupportedDatabaseException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/UserAlreadyExistsException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/UserException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/UserInactiveException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/UserInvalidException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/UserNotFoundException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/WarehouseAlreadyExistsException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/WebstoreOrderProcessingException.java create mode 100644 posterita/posterita/src/main/org/posterita/exceptions/WrongPasswordException.java create mode 100644 posterita/posterita/src/main/org/posterita/factory/AbstractFactory.java create mode 100644 posterita/posterita/src/main/org/posterita/factory/DBPropertiesManager.java create mode 100644 posterita/posterita/src/main/org/posterita/factory/DunningFactory.java create mode 100644 posterita/posterita/src/main/org/posterita/factory/GenericSystemObjectsFactory.java create mode 100644 posterita/posterita/src/main/org/posterita/factory/MenuGenerator.java create mode 100644 posterita/posterita/src/main/org/posterita/factory/POSMenuFactory.java create mode 100644 posterita/posterita/src/main/org/posterita/factory/ProcessFactory.java create mode 100644 posterita/posterita/src/main/org/posterita/factory/SystemObjectsFactory.java create mode 100644 posterita/posterita/src/main/org/posterita/factory/UserFactory.java create mode 100644 posterita/posterita/src/main/org/posterita/factory/WebComponentFactory.java create mode 100644 posterita/posterita/src/main/org/posterita/factory/WebProperties.java create mode 100644 posterita/posterita/src/main/org/posterita/form/AttachmentForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/AttributeForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/AttributeValuesForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/BPartnerForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/BPartnerInfoForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/BankForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/BlackListForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/CashBookDetailForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/CashBookForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/CashForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/ChangeDocumentStatusForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/ChangePasswordForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/CheckoutForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/CommissionForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/CreateBPartnerForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/CreateBankAccountForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/CreateLocatorForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/CreateProductAttributeForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/CreateProductAttributeValueForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/CreateUserForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/CreditCardForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/CurrencyForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/CurrenrPOSBalanceForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/CustomerAndCreditCardForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/CustomerForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/DateFilterForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/DocumentForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/DocumentHistoryForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/DunningForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/EditAttributeForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/EditPriceListForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/EditProductForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/GarmentForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/GeneralPaymentForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/GenericProductForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/InOutHistoryForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/InitCustomerForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/InventoryForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/InventoryLineForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/InvoiceHistoryForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/InvokeOrderForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/ItemForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/LoginForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/MenuItemForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/OpenItemForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/OrderForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/OrderHistoryForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/OrderLineForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/OrgForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/POSDescriptionForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/POSForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/POSHelpForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/POSHistoryForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/POSInfoForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/POSOrderLineForm2.java create mode 100644 posterita/posterita/src/main/org/posterita/form/POSProductForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/POSReportForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/POSStockForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/POSSupplierForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/PaymentAllocationForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/PaymentForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/PaymentHistoryForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/PaymentTermForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/PaymentTermForm2.java create mode 100644 posterita/posterita/src/main/org/posterita/form/PriceCheckForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/PriceListForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/ProductAttributeForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/ProductAttributeValueForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/ProductDetailInfoForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/ProductImageForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/ProductKeywordsForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/ProductRestrictionForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/ProductSearchForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/ProductStatusForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/RemoveSessionForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/ReportForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/ReportImageForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/ReportSummaryHistoryForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/RoleForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/SalesAnalysisReportForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/SalesDetailsForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/SalesReportForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/SearchProductForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/SellingItemForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/SetApplicationParametersForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/SingleDateFilterForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/StockEnquiryForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/StockForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/StockMovementForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/SynchronizeCollectionsForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/TaxForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/TerminalForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/UOMForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/UserForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/UserRegistrationForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/VendorForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/ViewBPartnerForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/ViewProductForm.java create mode 100644 posterita/posterita/src/main/org/posterita/form/ViewTaxForm.java create mode 100644 posterita/posterita/src/main/org/posterita/formatter/ArrayListFormatter.java create mode 100644 posterita/posterita/src/main/org/posterita/formatter/BigDecimalArrayFormatter.java create mode 100644 posterita/posterita/src/main/org/posterita/formatter/BigDecimalFormatter.java create mode 100644 posterita/posterita/src/main/org/posterita/formatter/BooleanArrayFormatter.java create mode 100644 posterita/posterita/src/main/org/posterita/formatter/BooleanFormatter.java create mode 100644 posterita/posterita/src/main/org/posterita/formatter/DefaultFormatter.java create mode 100644 posterita/posterita/src/main/org/posterita/formatter/DoubleFormatter.java create mode 100644 posterita/posterita/src/main/org/posterita/formatter/Formatter.java create mode 100644 posterita/posterita/src/main/org/posterita/formatter/IntegerFormatter.java create mode 100644 posterita/posterita/src/main/org/posterita/formatter/JulianDateFormatter.java create mode 100644 posterita/posterita/src/main/org/posterita/formatter/LongFormatter.java create mode 100644 posterita/posterita/src/main/org/posterita/formatter/PriceFormatter.java create mode 100644 posterita/posterita/src/main/org/posterita/formatter/PrintFormatter.java create mode 100644 posterita/posterita/src/main/org/posterita/formatter/ReflectionFormatter.java create mode 100644 posterita/posterita/src/main/org/posterita/formatter/SimpleCalendarDateFormatter.java create mode 100644 posterita/posterita/src/main/org/posterita/formatter/StringArrayFormatter.java create mode 100644 posterita/posterita/src/main/org/posterita/formatter/StringFormatter.java create mode 100644 posterita/posterita/src/main/org/posterita/formatter/TimeFormatter.java create mode 100644 posterita/posterita/src/main/org/posterita/keyname/AttributeValueKeyNamePair.java create mode 100644 posterita/posterita/src/main/org/posterita/keyname/BPartnerKeyNamePair.java create mode 100644 posterita/posterita/src/main/org/posterita/keyname/BankKeyNamePair.java create mode 100644 posterita/posterita/src/main/org/posterita/keyname/CBPartnerKeyNamePair.java create mode 100644 posterita/posterita/src/main/org/posterita/keyname/LocatorKeyNamePair.java create mode 100644 posterita/posterita/src/main/org/posterita/keyname/MenuKeyNamePair.java create mode 100644 posterita/posterita/src/main/org/posterita/keyname/OrgKeyNamePair.java create mode 100644 posterita/posterita/src/main/org/posterita/keyname/PriceListVersionKeyNamePair.java create mode 100644 posterita/posterita/src/main/org/posterita/keyname/ProductAttributeKeyNamePair.java create mode 100644 posterita/posterita/src/main/org/posterita/keyname/ProductAttributeSetKeyNamePair.java create mode 100644 posterita/posterita/src/main/org/posterita/keyname/ProductAttributeValueKeyNamePair.java create mode 100644 posterita/posterita/src/main/org/posterita/keyname/RegionKeyNamePair.java create mode 100644 posterita/posterita/src/main/org/posterita/keyname/RoleKeyNamePair.java create mode 100644 posterita/posterita/src/main/org/posterita/keyname/SalesRepKeyNamePair.java create mode 100644 posterita/posterita/src/main/org/posterita/keyname/WarehouseKeyNamePair.java create mode 100644 posterita/posterita/src/main/org/posterita/lib/PropertiesConstant.java create mode 100644 posterita/posterita/src/main/org/posterita/lib/UdiConstants.java create mode 100644 posterita/posterita/src/main/org/posterita/model/MBPartnerProduct.java create mode 100644 posterita/posterita/src/main/org/posterita/model/MBank.java create mode 100644 posterita/posterita/src/main/org/posterita/model/MBlackListCheque.java create mode 100644 posterita/posterita/src/main/org/posterita/model/MMAttachment.java create mode 100644 posterita/posterita/src/main/org/posterita/model/MRevenueRecognition.java create mode 100644 posterita/posterita/src/main/org/posterita/model/MRoleMenu.java create mode 100644 posterita/posterita/src/main/org/posterita/model/MWebMenu.java create mode 100644 posterita/posterita/src/main/org/posterita/model/MWebProperties.java create mode 100644 posterita/posterita/src/main/org/posterita/order/UDIOrderType.java create mode 100644 posterita/posterita/src/main/org/posterita/order/UDIOrderTypes.java create mode 100644 posterita/posterita/src/main/org/posterita/pos/help/POSHelpAction.java create mode 100644 posterita/posterita/src/main/org/posterita/pos/help/POSHelpManager.java create mode 100644 posterita/posterita/src/main/org/posterita/pos/taglib/AjaxTag.java create mode 100644 posterita/posterita/src/main/org/posterita/pos/taglib/BPartnerSearchTag.java create mode 100644 posterita/posterita/src/main/org/posterita/pos/taglib/MessageTag.java create mode 100644 posterita/posterita/src/main/org/posterita/process/SetupWebPOS.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/admin/CheckSequenceAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/admin/OrganisationAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/admin/RoleAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/attachment/AttachmentAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/attachment/ImageAttachmentAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/attributes/AttributesAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/bPartner/BPartnerAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/bPartner/ViewBPartnerAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/core/AjaxAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/core/BaseAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/core/BaseDispatchAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/core/BaseForm.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/core/DefaultForm.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/customer/CustomerAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/customer/SalesAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/inOut/ViewMinOutAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/invoice/ViewInvoiceAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/login/ChangePasswordAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/login/GoToHomePageAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/login/LoginAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/login/POSLoginAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/menu/CloseMenuAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/menu/MenuAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/order/CompletePOSOrderAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/order/ViewOrderAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/pos/BarcodeAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/pos/BlackListedAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/pos/BpartnerInfoAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/pos/CashAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/pos/CashBookAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/pos/CommissionAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/pos/CreditOrderAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/pos/CurrencyAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/pos/CustomPOSReportAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/pos/CustomerReturnOrderAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/pos/DocumentAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/pos/DunningAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/pos/EditBulkProductFromFileAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/pos/FastMovingItemReportAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/pos/GetReportAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/pos/GoodsReceiveNoteAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/pos/GoodsReturnNoteAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/pos/ImportCustomerAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/pos/ImportPOSProductAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/pos/InventoryAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/pos/InventoryCartAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/pos/POSAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/pos/POSAttributesAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/pos/POSDispatchAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/pos/POSGoodsAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/pos/POSInfoAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/pos/POSOrderAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/pos/POSPriceListAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/pos/POSProductAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/pos/POSReportAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/pos/POSRoleAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/pos/POSSalesReportAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/pos/POSStockAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/pos/POSUserAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/pos/PartialPOSOrderAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/pos/PaymentAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/pos/PaymentTermAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/pos/PostingAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/pos/PriceListAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/pos/SalesAnalysisReportAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/pos/SearchCustomerAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/pos/SearchPOSProductAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/pos/SearchProductAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/pos/SearchProductsInStockAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/pos/SearchVendorAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/pos/SlowMovingItemReportAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/pos/StockMovementReportAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/pos/TaxAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/pos/TerminalAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/pos/UOMAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/pos/VendorAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/stock/StockAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/stock/StockMovementAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/user/CreateUserAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/user/UserAction.java create mode 100644 posterita/posterita/src/main/org/posterita/struts/user/UserRegistrationAction.java create mode 100644 posterita/posterita/src/main/org/posterita/taglib/BankName.java create mode 100644 posterita/posterita/src/main/org/posterita/taglib/LinkAccess.java create mode 100644 posterita/posterita/src/main/org/posterita/taglib/OrderStatus.java create mode 100644 posterita/posterita/src/main/org/posterita/taglib/ProductName.java create mode 100644 posterita/posterita/src/main/org/posterita/user/WebUserInfo.java create mode 100644 posterita/posterita/src/main/org/posterita/util/AbstractPrintFormatter.java create mode 100644 posterita/posterita/src/main/org/posterita/util/BarcodeFormatter.java create mode 100644 posterita/posterita/src/main/org/posterita/util/EmailUtil.java create mode 100644 posterita/posterita/src/main/org/posterita/util/HtmlOrderPrintFormatter.java create mode 100644 posterita/posterita/src/main/org/posterita/util/IPrintFormatter.java create mode 100644 posterita/posterita/src/main/org/posterita/util/InvoiceFormatter.java create mode 100644 posterita/posterita/src/main/org/posterita/util/ListUtil.java create mode 100644 posterita/posterita/src/main/org/posterita/util/MinOutFormatter.java create mode 100644 posterita/posterita/src/main/org/posterita/util/OSBroOrderPrintFormatter1.java create mode 100644 posterita/posterita/src/main/org/posterita/util/OrderFormatter.java create mode 100644 posterita/posterita/src/main/org/posterita/util/PathInfo.java create mode 100644 posterita/posterita/src/main/org/posterita/util/PaymentFormatter.java create mode 100644 posterita/posterita/src/main/org/posterita/util/PoManager.java create mode 100644 posterita/posterita/src/main/org/posterita/util/RegenerateModels.java create mode 100644 posterita/posterita/src/main/org/posterita/util/TMKInvoicePrintFormatter.java create mode 100644 posterita/posterita/src/main/org/posterita/util/TMKOrderPrintFormatter.java create mode 100644 posterita/posterita/src/main/org/posterita/util/TmkPrintUtil.java create mode 100644 posterita/posterita/src/main/org/posterita/util/TmkPrinterConstants.java create mode 100644 posterita/posterita/src/main/org/posterita/webstore/action/DocumentHistoryAction.java create mode 100644 posterita/posterita/src/main/org/posterita/webstore/action/ViewCashPaymentAction.java create mode 100644 posterita/posterita/src/main/org/posterita/webstore/action/ViewPaymentAction.java create mode 100644 posterita/posterita/src/main/org/posterita/webstore/businesslogic/DocumentHistoryManager.java create mode 100644 posterita/posterita/src/main/org/posterita/webstore/businesslogic/PaymentManager.java create mode 100644 posterita/posterita/src/main/posterita.properties create mode 100644 posterita/posterita/src/utils/ImportMessages.sh create mode 100644 posterita/posterita/src/utils/messages.csv create mode 100644 posterita/posterita/web/WEB-INF/c.tld create mode 100644 posterita/posterita/web/WEB-INF/dcs.tld create mode 100644 posterita/posterita/web/WEB-INF/fmt.tld create mode 100644 posterita/posterita/web/WEB-INF/pos.tld create mode 100644 posterita/posterita/web/WEB-INF/posterita.tld create mode 100644 posterita/posterita/web/WEB-INF/struts-bean.tld create mode 100644 posterita/posterita/web/WEB-INF/struts-config.xml create mode 100644 posterita/posterita/web/WEB-INF/struts-config_1_2.dtd create mode 100644 posterita/posterita/web/WEB-INF/struts-html.tld create mode 100644 posterita/posterita/web/WEB-INF/struts-logic.tld create mode 100644 posterita/posterita/web/WEB-INF/struts-nested.tld create mode 100644 posterita/posterita/web/WEB-INF/struts-tiles.tld create mode 100644 posterita/posterita/web/WEB-INF/tiles-config_1_1.dtd create mode 100644 posterita/posterita/web/WEB-INF/tiles-defs.xml create mode 100644 posterita/posterita/web/WEB-INF/validator-rules.xml create mode 100644 posterita/posterita/web/WEB-INF/web-app_2_2.dtd create mode 100644 posterita/posterita/web/WEB-INF/web-app_2_3.dtd create mode 100644 posterita/posterita/web/WEB-INF/web.xml create mode 100644 posterita/posterita/web/WEB-INF/webStore.tld create mode 100644 posterita/posterita/web/css/alternative.css create mode 100644 posterita/posterita/web/css/common.jsp create mode 100644 posterita/posterita/web/css/displaytag.css create mode 100644 posterita/posterita/web/css/frame.css create mode 100644 posterita/posterita/web/css/global.css create mode 100644 posterita/posterita/web/css/inventory.css create mode 100644 posterita/posterita/web/css/js-calendar/calendar-win2k-1.css create mode 100644 posterita/posterita/web/css/logo.css create mode 100644 posterita/posterita/web/css/mainMenu.css create mode 100644 posterita/posterita/web/css/modalbox.css create mode 100644 posterita/posterita/web/css/newPOS.css create mode 100644 posterita/posterita/web/css/orderScreen.css create mode 100644 posterita/posterita/web/css/popup.css create mode 100644 posterita/posterita/web/css/print.css create mode 100644 posterita/posterita/web/css/screen.css create mode 100644 posterita/posterita/web/css/style.css create mode 100644 posterita/posterita/web/css/teststyles.css create mode 100644 posterita/posterita/web/images/back-menu.gif create mode 100644 posterita/posterita/web/images/bar.gif create mode 100644 posterita/posterita/web/images/barcode.jpg create mode 100644 posterita/posterita/web/images/bg_header.jpg create mode 100644 posterita/posterita/web/images/bg_td.gif create mode 100644 posterita/posterita/web/images/bullet1.gif create mode 100644 posterita/posterita/web/images/bullet2.gif create mode 100644 posterita/posterita/web/images/calendar_icon.png create mode 100644 posterita/posterita/web/images/ico_printer.gif create mode 100644 posterita/posterita/web/images/iconCSV.jpg create mode 100644 posterita/posterita/web/images/loader.gif create mode 100644 posterita/posterita/web/images/logo.gif create mode 100644 posterita/posterita/web/images/logo.jpg create mode 100644 posterita/posterita/web/images/logo1.jpg create mode 100644 posterita/posterita/web/images/newUI/Thumbs.db create mode 100644 posterita/posterita/web/images/newUI/back-menu.gif create mode 100644 posterita/posterita/web/images/newUI/blankimage.png create mode 100644 posterita/posterita/web/images/newUI/bottom-right.gif create mode 100644 posterita/posterita/web/images/newUI/bottom.gif create mode 100644 posterita/posterita/web/images/newUI/btn_changepin.gif create mode 100644 posterita/posterita/web/images/newUI/btn_quickdiscount.gif create mode 100644 posterita/posterita/web/images/newUI/btn_resetuser.gif create mode 100644 posterita/posterita/web/images/newUI/btun_complete.gif create mode 100644 posterita/posterita/web/images/newUI/btun_generic.gif create mode 100644 posterita/posterita/web/images/newUI/btun_save.gif create mode 100644 posterita/posterita/web/images/newUI/bullet-arrow.gif create mode 100644 posterita/posterita/web/images/newUI/butn-add.gif create mode 100644 posterita/posterita/web/images/newUI/butn-addnew.gif create mode 100644 posterita/posterita/web/images/newUI/butn-browse.gif create mode 100644 posterita/posterita/web/images/newUI/butn-card.gif create mode 100644 posterita/posterita/web/images/newUI/butn-cash.gif create mode 100644 posterita/posterita/web/images/newUI/butn-checkout.gif create mode 100644 posterita/posterita/web/images/newUI/butn-cheque.gif create mode 100644 posterita/posterita/web/images/newUI/butn-clearall.gif create mode 100644 posterita/posterita/web/images/newUI/butn-copy.gif create mode 100644 posterita/posterita/web/images/newUI/butn-createpos.gif create mode 100644 posterita/posterita/web/images/newUI/butn-credit.gif create mode 100644 posterita/posterita/web/images/newUI/butn-delete.gif create mode 100644 posterita/posterita/web/images/newUI/butn-delprod.gif create mode 100644 posterita/posterita/web/images/newUI/butn-discount.gif create mode 100644 posterita/posterita/web/images/newUI/butn-donate.gif create mode 100644 posterita/posterita/web/images/newUI/butn-edit-off.gif create mode 100644 posterita/posterita/web/images/newUI/butn-edit.gif create mode 100644 posterita/posterita/web/images/newUI/butn-exit.gif create mode 100644 posterita/posterita/web/images/newUI/butn-import.gif create mode 100644 posterita/posterita/web/images/newUI/butn-login.gif create mode 100644 posterita/posterita/web/images/newUI/butn-mix.gif create mode 100644 posterita/posterita/web/images/newUI/butn-new.gif create mode 100644 posterita/posterita/web/images/newUI/butn-next.gif create mode 100644 posterita/posterita/web/images/newUI/butn-opendrawer.gif create mode 100644 posterita/posterita/web/images/newUI/butn-prev.gif create mode 100644 posterita/posterita/web/images/newUI/butn-save.gif create mode 100644 posterita/posterita/web/images/newUI/butn-subtract.gif create mode 100644 posterita/posterita/web/images/newUI/butn-system.gif create mode 100644 posterita/posterita/web/images/newUI/butn-touchscreen.gif create mode 100644 posterita/posterita/web/images/newUI/donate.gif create mode 100644 posterita/posterita/web/images/newUI/footerbg.gif create mode 100644 posterita/posterita/web/images/newUI/headblc.gif create mode 100644 posterita/posterita/web/images/newUI/headbody.gif create mode 100644 posterita/posterita/web/images/newUI/headbrc.gif create mode 100644 posterita/posterita/web/images/newUI/headtlc.gif create mode 100644 posterita/posterita/web/images/newUI/headtrc.gif create mode 100644 posterita/posterita/web/images/newUI/hicon-cashbook.gif create mode 100644 posterita/posterita/web/images/newUI/hicon-donate.gif create mode 100644 posterita/posterita/web/images/newUI/hicon-help.gif create mode 100644 posterita/posterita/web/images/newUI/hicon-news.gif create mode 100644 posterita/posterita/web/images/newUI/hicon-salesorder.gif create mode 100644 posterita/posterita/web/images/newUI/hicon-tillmgt.gif create mode 100644 posterita/posterita/web/images/newUI/icon-err.gif create mode 100644 posterita/posterita/web/images/newUI/icon-help.gif create mode 100644 posterita/posterita/web/images/newUI/icon-newwindow.gif create mode 100644 posterita/posterita/web/images/newUI/left.gif create mode 100644 posterita/posterita/web/images/newUI/leftside.gif create mode 100644 posterita/posterita/web/images/newUI/logo.gif create mode 100644 posterita/posterita/web/images/newUI/navbg.gif create mode 100644 posterita/posterita/web/images/newUI/palebluebg.gif create mode 100644 posterita/posterita/web/images/newUI/pricedetbg.gif create mode 100644 posterita/posterita/web/images/newUI/pricedetbgtile.gif create mode 100644 posterita/posterita/web/images/newUI/productpreview.gif create mode 100644 posterita/posterita/web/images/newUI/rightside.gif create mode 100644 posterita/posterita/web/images/newUI/singlekey.gif create mode 100644 posterita/posterita/web/images/newUI/spacer.gif create mode 100644 posterita/posterita/web/images/newUI/top-right.gif create mode 100644 posterita/posterita/web/images/newUI/top.gif create mode 100644 posterita/posterita/web/images/newUI/topmenubg.gif create mode 100644 posterita/posterita/web/images/nok.gif create mode 100644 posterita/posterita/web/images/ok.gif create mode 100644 posterita/posterita/web/images/pdfIcon.jpg create mode 100644 posterita/posterita/web/images/pdf_icon_small.gif create mode 100644 posterita/posterita/web/images/pos/-----.gif create mode 100644 posterita/posterita/web/images/pos/ADMINISTRATION.gif create mode 100644 posterita/posterita/web/images/pos/BULLET_reddd.gif create mode 100644 posterita/posterita/web/images/pos/Contacts 1.gif create mode 100644 posterita/posterita/web/images/pos/Contacts 2.gif create mode 100644 posterita/posterita/web/images/pos/ImageBack.jpg create mode 100644 posterita/posterita/web/images/pos/LOGOUT.gif create mode 100644 posterita/posterita/web/images/pos/ORDER.gif create mode 100644 posterita/posterita/web/images/pos/REPORTS.gif create mode 100644 posterita/posterita/web/images/pos/arrow_down.png create mode 100644 posterita/posterita/web/images/pos/arrow_off.png create mode 100644 posterita/posterita/web/images/pos/arrow_up.png create mode 100644 posterita/posterita/web/images/pos/blankimage.png create mode 100644 posterita/posterita/web/images/pos/button-login.gif create mode 100644 posterita/posterita/web/images/pos/button_add to cart.gif create mode 100644 posterita/posterita/web/images/pos/button_advanced.gif create mode 100644 posterita/posterita/web/images/pos/button_card.gif create mode 100644 posterita/posterita/web/images/pos/button_cash.gif create mode 100644 posterita/posterita/web/images/pos/button_checkout.gif create mode 100644 posterita/posterita/web/images/pos/button_cheque.gif create mode 100644 posterita/posterita/web/images/pos/button_newcustomer.gif create mode 100644 posterita/posterita/web/images/pos/buttons/Thumbs.db create mode 100644 posterita/posterita/web/images/pos/buttons/browser.gif create mode 100644 posterita/posterita/web/images/pos/buttons/bullet_red.gif create mode 100644 posterita/posterita/web/images/pos/buttons/button_addtocart.gif create mode 100644 posterita/posterita/web/images/pos/buttons/button_administration.gif create mode 100644 posterita/posterita/web/images/pos/buttons/button_advanced.gif create mode 100644 posterita/posterita/web/images/pos/buttons/button_background.gif create mode 100644 posterita/posterita/web/images/pos/buttons/button_barchart.gif create mode 100644 posterita/posterita/web/images/pos/buttons/button_blank.gif create mode 100644 posterita/posterita/web/images/pos/buttons/button_card.gif create mode 100644 posterita/posterita/web/images/pos/buttons/button_cart.jpeg create mode 100644 posterita/posterita/web/images/pos/buttons/button_cash.gif create mode 100644 posterita/posterita/web/images/pos/buttons/button_checkout.gif create mode 100644 posterita/posterita/web/images/pos/buttons/button_cheque.gif create mode 100644 posterita/posterita/web/images/pos/buttons/button_complete.gif create mode 100644 posterita/posterita/web/images/pos/buttons/button_continue.gif create mode 100644 posterita/posterita/web/images/pos/buttons/button_delete.gif create mode 100644 posterita/posterita/web/images/pos/buttons/button_edit.gif create mode 100644 posterita/posterita/web/images/pos/buttons/button_import.gif create mode 100644 posterita/posterita/web/images/pos/buttons/button_login.gif create mode 100644 posterita/posterita/web/images/pos/buttons/button_logout.gif create mode 100644 posterita/posterita/web/images/pos/buttons/button_middle.gif create mode 100644 posterita/posterita/web/images/pos/buttons/button_minus.gif create mode 100644 posterita/posterita/web/images/pos/buttons/button_mixed.gif create mode 100644 posterita/posterita/web/images/pos/buttons/button_newcustomer.gif create mode 100644 posterita/posterita/web/images/pos/buttons/button_newnote.gif create mode 100644 posterita/posterita/web/images/pos/buttons/button_neworder.gif create mode 100644 posterita/posterita/web/images/pos/buttons/button_order.gif create mode 100644 posterita/posterita/web/images/pos/buttons/button_piechart.gif create mode 100644 posterita/posterita/web/images/pos/buttons/button_plus.gif create mode 100644 posterita/posterita/web/images/pos/buttons/button_refresh.gif create mode 100644 posterita/posterita/web/images/pos/buttons/button_reports.gif create mode 100644 posterita/posterita/web/images/pos/buttons/button_save.gif create mode 100644 posterita/posterita/web/images/pos/buttons/button_saveascsv.gif create mode 100644 posterita/posterita/web/images/pos/buttons/button_saveaspdf.gif create mode 100644 posterita/posterita/web/images/pos/buttons/button_search.gif create mode 100644 posterita/posterita/web/images/pos/buttons/button_selectall.gif create mode 100644 posterita/posterita/web/images/pos/buttons/button_submit.gif create mode 100644 posterita/posterita/web/images/pos/buttons/button_tabular.gif create mode 100644 posterita/posterita/web/images/pos/buttons/button_timeseries.gif create mode 100644 posterita/posterita/web/images/pos/calendar.gif create mode 100644 posterita/posterita/web/images/pos/charts/barchart_icon.gif create mode 100644 posterita/posterita/web/images/pos/charts/piechart_icon.gif create mode 100644 posterita/posterita/web/images/pos/charts/tabular_icon.gif create mode 100644 posterita/posterita/web/images/pos/charts/timeseries_icon.gif create mode 100644 posterita/posterita/web/images/pos/cross.gif create mode 100644 posterita/posterita/web/images/pos/delprod.gif create mode 100644 posterita/posterita/web/images/pos/error.gif create mode 100644 posterita/posterita/web/images/pos/error.jpg create mode 100644 posterita/posterita/web/images/pos/error.png create mode 100644 posterita/posterita/web/images/pos/helpIcon.gif create mode 100644 posterita/posterita/web/images/pos/helpIcon2.gif create mode 100644 posterita/posterita/web/images/pos/ico_file_csv.png create mode 100644 posterita/posterita/web/images/pos/ico_file_excel.png create mode 100644 posterita/posterita/web/images/pos/ico_file_pdf.png create mode 100644 posterita/posterita/web/images/pos/ico_file_rtf.png create mode 100644 posterita/posterita/web/images/pos/ico_file_xml.png create mode 100644 posterita/posterita/web/images/pos/icon-error.gif create mode 100644 posterita/posterita/web/images/pos/icon-info.gif create mode 100644 posterita/posterita/web/images/pos/icon-question.gif create mode 100644 posterita/posterita/web/images/pos/icon-warning.gif create mode 100644 posterita/posterita/web/images/pos/indicator.gif create mode 100644 posterita/posterita/web/images/pos/kbicon.gif create mode 100644 posterita/posterita/web/images/pos/logo.jpg create mode 100644 posterita/posterita/web/images/pos/magnifying-glass.gif create mode 100644 posterita/posterita/web/images/pos/maskBG.png create mode 100644 posterita/posterita/web/images/pos/paginazione.png create mode 100644 posterita/posterita/web/images/pos/paginazione_ahead.png create mode 100644 posterita/posterita/web/images/pos/paginazione_back.png create mode 100644 posterita/posterita/web/images/pos/plus.gif create mode 100644 posterita/posterita/web/images/pos/success.gif create mode 100644 posterita/posterita/web/images/posterita.jpg create mode 100644 posterita/posterita/web/images/progress.gif create mode 100644 posterita/posterita/web/images/spacer.gif create mode 100644 posterita/posterita/web/images/spinner.gif create mode 100644 posterita/posterita/web/images/tango/accessories-calculator.png create mode 100644 posterita/posterita/web/images/tango/accessories-character-map.png create mode 100644 posterita/posterita/web/images/tango/accessories-text-editor.png create mode 100644 posterita/posterita/web/images/tango/address-book-new.png create mode 100644 posterita/posterita/web/images/tango/applications-system.png create mode 100644 posterita/posterita/web/images/tango/appointment-new.png create mode 100644 posterita/posterita/web/images/tango/bookmark-new.png create mode 100644 posterita/posterita/web/images/tango/contact-new.png create mode 100644 posterita/posterita/web/images/tango/document-new.png create mode 100644 posterita/posterita/web/images/tango/document-open.png create mode 100644 posterita/posterita/web/images/tango/document-print-preview.png create mode 100644 posterita/posterita/web/images/tango/document-print.png create mode 100644 posterita/posterita/web/images/tango/document-properties.png create mode 100644 posterita/posterita/web/images/tango/document-save-as.png create mode 100644 posterita/posterita/web/images/tango/document-save.png create mode 100644 posterita/posterita/web/images/tango/edit-clear.png create mode 100644 posterita/posterita/web/images/tango/edit-copy.png create mode 100644 posterita/posterita/web/images/tango/edit-cut.png create mode 100644 posterita/posterita/web/images/tango/edit-delete.png create mode 100644 posterita/posterita/web/images/tango/edit-find-replace.png create mode 100644 posterita/posterita/web/images/tango/edit-find.png create mode 100644 posterita/posterita/web/images/tango/edit-paste.png create mode 100644 posterita/posterita/web/images/tango/edit-redo.png create mode 100644 posterita/posterita/web/images/tango/edit-select-all.png create mode 100644 posterita/posterita/web/images/tango/edit-undo.png create mode 100644 posterita/posterita/web/images/tango/folder-new.png create mode 100644 posterita/posterita/web/images/tango/format-indent-less.png create mode 100644 posterita/posterita/web/images/tango/format-indent-more.png create mode 100644 posterita/posterita/web/images/tango/format-justify-center.png create mode 100644 posterita/posterita/web/images/tango/format-justify-fill.png create mode 100644 posterita/posterita/web/images/tango/format-justify-left.png create mode 100644 posterita/posterita/web/images/tango/format-justify-right.png create mode 100644 posterita/posterita/web/images/tango/format-text-bold.png create mode 100644 posterita/posterita/web/images/tango/format-text-italic.png create mode 100644 posterita/posterita/web/images/tango/format-text-strikethrough.png create mode 100644 posterita/posterita/web/images/tango/format-text-underline.png create mode 100644 posterita/posterita/web/images/tango/go-bottom.png create mode 100644 posterita/posterita/web/images/tango/go-down.png create mode 100644 posterita/posterita/web/images/tango/go-first.png create mode 100644 posterita/posterita/web/images/tango/go-home.png create mode 100644 posterita/posterita/web/images/tango/go-jump.png create mode 100644 posterita/posterita/web/images/tango/go-last.png create mode 100644 posterita/posterita/web/images/tango/go-next.png create mode 100644 posterita/posterita/web/images/tango/go-previous.png create mode 100644 posterita/posterita/web/images/tango/go-top.png create mode 100644 posterita/posterita/web/images/tango/go-up.png create mode 100644 posterita/posterita/web/images/tango/help-browser.png create mode 100644 posterita/posterita/web/images/tango/input-keyboard.png create mode 100644 posterita/posterita/web/images/tango/internet-group-chat.png create mode 100644 posterita/posterita/web/images/tango/internet-mail.png create mode 100644 posterita/posterita/web/images/tango/internet-news-reader.png create mode 100644 posterita/posterita/web/images/tango/internet-web-browser.png create mode 100644 posterita/posterita/web/images/tango/list-add.png create mode 100644 posterita/posterita/web/images/tango/list-remove.png create mode 100644 posterita/posterita/web/images/tango/mail-forward.png create mode 100644 posterita/posterita/web/images/tango/mail-mark-junk.png create mode 100644 posterita/posterita/web/images/tango/mail-mark-not-junk.png create mode 100644 posterita/posterita/web/images/tango/mail-message-new.png create mode 100644 posterita/posterita/web/images/tango/mail-reply-all.png create mode 100644 posterita/posterita/web/images/tango/mail-reply-sender.png create mode 100644 posterita/posterita/web/images/tango/mail-send-receive.png create mode 100644 posterita/posterita/web/images/tango/media-eject.png create mode 100644 posterita/posterita/web/images/tango/media-playback-pause.png create mode 100644 posterita/posterita/web/images/tango/media-playback-start.png create mode 100644 posterita/posterita/web/images/tango/media-playback-stop.png create mode 100644 posterita/posterita/web/images/tango/media-record.png create mode 100644 posterita/posterita/web/images/tango/media-seek-backward.png create mode 100644 posterita/posterita/web/images/tango/media-seek-forward.png create mode 100644 posterita/posterita/web/images/tango/media-skip-backward.png create mode 100644 posterita/posterita/web/images/tango/media-skip-forward.png create mode 100644 posterita/posterita/web/images/tango/office-calendar.png create mode 100644 posterita/posterita/web/images/tango/preferences-desktop-accessibility.png create mode 100644 posterita/posterita/web/images/tango/preferences-desktop-assistive-technology.png create mode 100644 posterita/posterita/web/images/tango/preferences-desktop-font.png create mode 100644 posterita/posterita/web/images/tango/preferences-desktop-keyboard-shortcuts.png create mode 100644 posterita/posterita/web/images/tango/preferences-desktop-locale.png create mode 100644 posterita/posterita/web/images/tango/preferences-desktop-remote-desktop.png create mode 100644 posterita/posterita/web/images/tango/preferences-desktop-screensaver.png create mode 100644 posterita/posterita/web/images/tango/preferences-desktop-sound.png create mode 100644 posterita/posterita/web/images/tango/preferences-desktop-theme.png create mode 100644 posterita/posterita/web/images/tango/preferences-desktop-wallpaper.png create mode 100644 posterita/posterita/web/images/tango/preferences-system-network-proxy.png create mode 100644 posterita/posterita/web/images/tango/preferences-system-session.png create mode 100644 posterita/posterita/web/images/tango/preferences-system-windows.png create mode 100644 posterita/posterita/web/images/tango/preferences-system.png create mode 100644 posterita/posterita/web/images/tango/process-stop.png create mode 100644 posterita/posterita/web/images/tango/system-file-manager.png create mode 100644 posterita/posterita/web/images/tango/system-installer.png create mode 100644 posterita/posterita/web/images/tango/system-lock-screen.png create mode 100644 posterita/posterita/web/images/tango/system-log-out.png create mode 100644 posterita/posterita/web/images/tango/system-password.png create mode 100644 posterita/posterita/web/images/tango/system-search.png create mode 100644 posterita/posterita/web/images/tango/system-shutdown.png create mode 100644 posterita/posterita/web/images/tango/system-software-update.png create mode 100644 posterita/posterita/web/images/tango/system-users.png create mode 100644 posterita/posterita/web/images/tango/tab-new.png create mode 100644 posterita/posterita/web/images/tango/user-trash.png create mode 100644 posterita/posterita/web/images/tango/utilities-system-monitor.png create mode 100644 posterita/posterita/web/images/tango/utilities-terminal.png create mode 100644 posterita/posterita/web/images/tango/view-fullscreen.png create mode 100644 posterita/posterita/web/images/tango/view-refresh.png create mode 100644 posterita/posterita/web/images/tango/window-new.png create mode 100644 posterita/posterita/web/images/tango/x-office-calendar.png create mode 100644 posterita/posterita/web/images/tick.png create mode 100644 posterita/posterita/web/images/trash.png create mode 100644 posterita/posterita/web/images/wrong.png create mode 100644 posterita/posterita/web/import/importGarmentTemplate.csv create mode 100644 posterita/posterita/web/import/importTemplate.csv create mode 100644 posterita/posterita/web/index.jsp create mode 100644 posterita/posterita/web/javascripts/actb.js create mode 100644 posterita/posterita/web/javascripts/builder.js create mode 100644 posterita/posterita/web/javascripts/controls.js create mode 100644 posterita/posterita/web/javascripts/dialogbox.js create mode 100644 posterita/posterita/web/javascripts/dragdrop.js create mode 100644 posterita/posterita/web/javascripts/effects.js create mode 100644 posterita/posterita/web/javascripts/js-calendar/calendar-en.js create mode 100644 posterita/posterita/web/javascripts/js-calendar/calendar-setup.js create mode 100644 posterita/posterita/web/javascripts/js-calendar/calendar.js create mode 100644 posterita/posterita/web/javascripts/modalbox.js create mode 100644 posterita/posterita/web/javascripts/popup.js create mode 100644 posterita/posterita/web/javascripts/prototype.js create mode 100644 posterita/posterita/web/javascripts/scriptaculous.js create mode 100644 posterita/posterita/web/javascripts/slider.js create mode 100644 posterita/posterita/web/javascripts/sorttable.js create mode 100644 posterita/posterita/web/javascripts/sorttable_v2.js create mode 100644 posterita/posterita/web/javascripts/sound.js create mode 100644 posterita/posterita/web/javascripts/tablefilter.js create mode 100644 posterita/posterita/web/javascripts/unittest.js create mode 100644 posterita/posterita/web/js/advancedOrderScreen.js create mode 100644 posterita/posterita/web/js/barcode.js create mode 100644 posterita/posterita/web/js/barcodeCart.js create mode 100644 posterita/posterita/web/js/calculator.js create mode 100644 posterita/posterita/web/js/calendar-en.js create mode 100644 posterita/posterita/web/js/calendar-setup.js create mode 100644 posterita/posterita/web/js/calendar.js create mode 100644 posterita/posterita/web/js/cart.js create mode 100644 posterita/posterita/web/js/createPOSOrder.js create mode 100644 posterita/posterita/web/js/creditScreen.js create mode 100644 posterita/posterita/web/js/customer.js create mode 100644 posterita/posterita/web/js/customer2.js create mode 100644 posterita/posterita/web/js/dom-drag.js create mode 100644 posterita/posterita/web/js/draftedPOSOrder.js create mode 100644 posterita/posterita/web/js/enableButton.js create mode 100644 posterita/posterita/web/js/import.js create mode 100644 posterita/posterita/web/js/inventory.js create mode 100644 posterita/posterita/web/js/inventoryCart.js create mode 100644 posterita/posterita/web/js/inventoryHistory.js create mode 100644 posterita/posterita/web/js/js-calendar.js create mode 100644 posterita/posterita/web/js/js-date.js create mode 100644 posterita/posterita/web/js/keyboard.js create mode 100644 posterita/posterita/web/js/orderScreen.js create mode 100644 posterita/posterita/web/js/paymentTerm.js create mode 100644 posterita/posterita/web/js/pin.js create mode 100644 posterita/posterita/web/js/pos.js create mode 100644 posterita/posterita/web/js/posPaymentDetails.js create mode 100644 posterita/posterita/web/js/product.js create mode 100644 posterita/posterita/web/js/product2.js create mode 100644 posterita/posterita/web/js/productTax.js create mode 100644 posterita/posterita/web/js/shoppingCart.js create mode 100644 posterita/posterita/web/js/shortcut.js create mode 100644 posterita/posterita/web/js/stockCart.js create mode 100644 posterita/posterita/web/js/stockTransfer.js create mode 100644 posterita/posterita/web/js/timer.js create mode 100644 posterita/posterita/web/js/tooltip.js create mode 100644 posterita/posterita/web/jsp/admin/changeEmail.jsp create mode 100644 posterita/posterita/web/jsp/admin/changePassword.jsp create mode 100644 posterita/posterita/web/jsp/admin/checkDataIntegritySuccess.jsp create mode 100644 posterita/posterita/web/jsp/admin/checkSequenceSuccess.jsp create mode 100644 posterita/posterita/web/jsp/admin/createRole.jsp create mode 100644 posterita/posterita/web/jsp/admin/emailChanged.jsp create mode 100644 posterita/posterita/web/jsp/admin/listOrganisations.jsp create mode 100644 posterita/posterita/web/jsp/admin/listRoles.jsp create mode 100644 posterita/posterita/web/jsp/admin/passwordChanged.jsp create mode 100644 posterita/posterita/web/jsp/admin/updateOrCreateOrganisation.jsp create mode 100644 posterita/posterita/web/jsp/admin/userDeleted.jsp create mode 100644 posterita/posterita/web/jsp/admin/viewMyDetails.jsp create mode 100644 posterita/posterita/web/jsp/admin/viewOrganisation.jsp create mode 100644 posterita/posterita/web/jsp/admin/viewRole.jsp create mode 100644 posterita/posterita/web/jsp/admin/viewUserDetails.jsp create mode 100644 posterita/posterita/web/jsp/admin/viewUsers.jsp create mode 100644 posterita/posterita/web/jsp/attachment/createAttachment.jsp create mode 100644 posterita/posterita/web/jsp/bPartner/bPartnerCreated.jsp create mode 100644 posterita/posterita/web/jsp/bPartner/bPartnerDetails.jsp create mode 100644 posterita/posterita/web/jsp/bPartner/createBPartner.jsp create mode 100644 posterita/posterita/web/jsp/bPartner/editBPartner.jsp create mode 100644 posterita/posterita/web/jsp/bPartner/viewBPartner.jsp create mode 100644 posterita/posterita/web/jsp/cashBook/cashBook.jsp create mode 100644 posterita/posterita/web/jsp/client/createClient.jsp create mode 100644 posterita/posterita/web/jsp/customer/createPOSCustomer.jsp create mode 100644 posterita/posterita/web/jsp/customer/existingPOSCustomers.jsp create mode 100644 posterita/posterita/web/jsp/customer/savePOSCustomer.jsp create mode 100644 posterita/posterita/web/jsp/error/error.jsp create mode 100644 posterita/posterita/web/jsp/help/contactUs.jsp create mode 100644 posterita/posterita/web/jsp/help/emailSuccess.jsp create mode 100644 posterita/posterita/web/jsp/inOut/minOutDetails.jsp create mode 100644 posterita/posterita/web/jsp/inOut/viewMinOut.jsp create mode 100644 posterita/posterita/web/jsp/inOut/viewReceiptHistory.jsp create mode 100644 posterita/posterita/web/jsp/inOut/viewShipmentHistory.jsp create mode 100644 posterita/posterita/web/jsp/include/backBt.jsp create mode 100644 posterita/posterita/web/jsp/include/completePOSOrder.jsp create mode 100644 posterita/posterita/web/jsp/include/completePOSOrderIncl.jsp create mode 100644 posterita/posterita/web/jsp/include/creditOrderPart1FocusBarCode.jsp create mode 100644 posterita/posterita/web/jsp/include/creditOrderWithAdvanced.jsp create mode 100644 posterita/posterita/web/jsp/include/customerInfoPanel.jsp create mode 100644 posterita/posterita/web/jsp/include/customerInfoPanel2.jsp create mode 100644 posterita/posterita/web/jsp/include/dateFilter.jsp create mode 100644 posterita/posterita/web/jsp/include/dayList.jsp create mode 100644 posterita/posterita/web/jsp/include/documentStatusFilter.jsp create mode 100644 posterita/posterita/web/jsp/include/draftedCreditOrder.jsp create mode 100644 posterita/posterita/web/jsp/include/draftedPOSOrder.jsp create mode 100644 posterita/posterita/web/jsp/include/endCalendar.jsp create mode 100644 posterita/posterita/web/jsp/include/errorMsg.jsp create mode 100644 posterita/posterita/web/jsp/include/errors.jsp create mode 100644 posterita/posterita/web/jsp/include/filter.jsp create mode 100644 posterita/posterita/web/jsp/include/footer.jsp create mode 100644 posterita/posterita/web/jsp/include/footerTableBottom1.jsp create mode 100644 posterita/posterita/web/jsp/include/historyMonthYearFilter.jsp create mode 100644 posterita/posterita/web/jsp/include/historyfilter.jsp create mode 100644 posterita/posterita/web/jsp/include/hourList.jsp create mode 100644 posterita/posterita/web/jsp/include/minuteList.jsp create mode 100644 posterita/posterita/web/jsp/include/month.jsp create mode 100644 posterita/posterita/web/jsp/include/monthList.jsp create mode 100644 posterita/posterita/web/jsp/include/pager.jsp create mode 100644 posterita/posterita/web/jsp/include/paymentRuleFilter.jsp create mode 100644 posterita/posterita/web/jsp/include/paymentTermsDetails.jsp create mode 100644 posterita/posterita/web/jsp/include/pinPanel.jsp create mode 100644 posterita/posterita/web/jsp/include/posFooter.jsp create mode 100644 posterita/posterita/web/jsp/include/posHeader.jsp create mode 100644 posterita/posterita/web/jsp/include/posHeader2.jsp create mode 100644 posterita/posterita/web/jsp/include/posHeaderAdministration.jsp create mode 100644 posterita/posterita/web/jsp/include/posHistoryFilter.jsp create mode 100644 posterita/posterita/web/jsp/include/posHistoryFilter2.jsp create mode 100644 posterita/posterita/web/jsp/include/posOrder.jsp create mode 100644 posterita/posterita/web/jsp/include/posOrderBarCode.jsp create mode 100644 posterita/posterita/web/jsp/include/posOrderFocusBarCode.jsp create mode 100644 posterita/posterita/web/jsp/include/posOrderFocusSearch.jsp create mode 100644 posterita/posterita/web/jsp/include/posOrderPart1.jsp create mode 100644 posterita/posterita/web/jsp/include/posOrderPart1FocusBarCode.jsp create mode 100644 posterita/posterita/web/jsp/include/posOrderPart1FocusSearch.jsp create mode 100644 posterita/posterita/web/jsp/include/posOrderPart2.jsp create mode 100644 posterita/posterita/web/jsp/include/posOrderSearch.jsp create mode 100644 posterita/posterita/web/jsp/include/posOrderWithAdvanced.jsp create mode 100644 posterita/posterita/web/jsp/include/posOrderWithAdvancedFocusSearch.jsp create mode 100644 posterita/posterita/web/jsp/include/posPaymentDetails.jsp create mode 100644 posterita/posterita/web/jsp/include/posPaymentDetails2.jsp create mode 100644 posterita/posterita/web/jsp/include/printOrderApplet.jsp create mode 100644 posterita/posterita/web/jsp/include/printOrderApplet2.jsp create mode 100644 posterita/posterita/web/jsp/include/searchCustomerPanel.jsp create mode 100644 posterita/posterita/web/jsp/include/searchCustomerPanel2.jsp create mode 100644 posterita/posterita/web/jsp/include/searchProductPanel.jsp create mode 100644 posterita/posterita/web/jsp/include/searchProductPanel2.jsp create mode 100644 posterita/posterita/web/jsp/include/searchProductPanel3.jsp create mode 100644 posterita/posterita/web/jsp/include/searchVendorPanel.jsp create mode 100644 posterita/posterita/web/jsp/include/searchVendorPanel2.jsp create mode 100644 posterita/posterita/web/jsp/include/showErrors.jsp create mode 100644 posterita/posterita/web/jsp/include/startCalendar.jsp create mode 100644 posterita/posterita/web/jsp/include/success.jsp create mode 100644 posterita/posterita/web/jsp/include/tabBottom.jsp create mode 100644 posterita/posterita/web/jsp/include/tabTop.jsp create mode 100644 posterita/posterita/web/jsp/include/tabTop_big.jsp create mode 100644 posterita/posterita/web/jsp/include/tablebottom.jsp create mode 100644 posterita/posterita/web/jsp/include/taxDetails.jsp create mode 100644 posterita/posterita/web/jsp/include/tenderPanel.jsp create mode 100644 posterita/posterita/web/jsp/include/tenderPanel2.jsp create mode 100644 posterita/posterita/web/jsp/include/vendorInfoPanel.jsp create mode 100644 posterita/posterita/web/jsp/include/year.jsp create mode 100644 posterita/posterita/web/jsp/include/yearList.jsp create mode 100644 posterita/posterita/web/jsp/invoice/webstoreInvoice.jsp create mode 100644 posterita/posterita/web/jsp/login/chooseApplication.jsp create mode 100644 posterita/posterita/web/jsp/login/chooseRole.jsp create mode 100644 posterita/posterita/web/jsp/login/chooseUser.jsp create mode 100644 posterita/posterita/web/jsp/login/forgot.jsp create mode 100644 posterita/posterita/web/jsp/login/forgot1.jsp create mode 100644 posterita/posterita/web/jsp/login/home.jsp create mode 100644 posterita/posterita/web/jsp/login/index.jsp create mode 100644 posterita/posterita/web/jsp/login/loginForm.jsp create mode 100644 posterita/posterita/web/jsp/login/logout.jsp create mode 100644 posterita/posterita/web/jsp/login/maintenance.jsp create mode 100644 posterita/posterita/web/jsp/login/password.jsp create mode 100644 posterita/posterita/web/jsp/login/posLogin.html create mode 100644 posterita/posterita/web/jsp/login/success.jsp create mode 100644 posterita/posterita/web/jsp/materialmovement/viewMMovement.jsp create mode 100644 posterita/posterita/web/jsp/materialmovement/viewMMovementHistory.jsp create mode 100644 posterita/posterita/web/jsp/materialmovement/viewMMovementLines.jsp create mode 100644 posterita/posterita/web/jsp/materialmovement/viewMoveConfirm.jsp create mode 100644 posterita/posterita/web/jsp/materialmovement/viewMoveConfirmLines.jsp create mode 100644 posterita/posterita/web/jsp/materialmovement/viewMoveLinesHistory.jsp create mode 100644 posterita/posterita/web/jsp/materialmovement/viewStock.jsp create mode 100644 posterita/posterita/web/jsp/materialmovement/viewStockList.jsp create mode 100644 posterita/posterita/web/jsp/payment/paymentDetails.jsp create mode 100644 posterita/posterita/web/jsp/payment/viewPayment.jsp create mode 100644 posterita/posterita/web/jsp/payment/viewPaymentHistory.jsp create mode 100644 posterita/posterita/web/jsp/pos/AllPOSCustomer.jsp create mode 100644 posterita/posterita/web/jsp/pos/ViewAllPosVendors.jsp create mode 100644 posterita/posterita/web/jsp/pos/adjustCashBook.jsp create mode 100644 posterita/posterita/web/jsp/pos/adjustInventory.jsp create mode 100644 posterita/posterita/web/jsp/pos/adjustStock.jsp create mode 100644 posterita/posterita/web/jsp/pos/adjustedStock.jsp create mode 100644 posterita/posterita/web/jsp/pos/advancedOrderScreen.jsp create mode 100644 posterita/posterita/web/jsp/pos/allBlackListCheque.jsp create mode 100644 posterita/posterita/web/jsp/pos/cashBookAdjustmentCompleted.jsp create mode 100644 posterita/posterita/web/jsp/pos/cashDetails.jsp create mode 100644 posterita/posterita/web/jsp/pos/cashLineDetails.jsp create mode 100644 posterita/posterita/web/jsp/pos/cashSummary.jsp create mode 100644 posterita/posterita/web/jsp/pos/cashSummaryDate.jsp create mode 100644 posterita/posterita/web/jsp/pos/cashSummaryInc.jsp create mode 100644 posterita/posterita/web/jsp/pos/chooseFastMovingItemReport.jsp create mode 100644 posterita/posterita/web/jsp/pos/choosePOS.jsp create mode 100644 posterita/posterita/web/jsp/pos/choosePOSInfo.jsp create mode 100644 posterita/posterita/web/jsp/pos/closeCashBook.jsp create mode 100644 posterita/posterita/web/jsp/pos/closePOSTill.jsp create mode 100644 posterita/posterita/web/jsp/pos/closedPOSTill.jsp create mode 100644 posterita/posterita/web/jsp/pos/completePOSOrder.jsp create mode 100644 posterita/posterita/web/jsp/pos/completePOSOrder2.jsp create mode 100644 posterita/posterita/web/jsp/pos/completePOSOrder3.jsp create mode 100644 posterita/posterita/web/jsp/pos/completePOSOrderWA.jsp create mode 100644 posterita/posterita/web/jsp/pos/completePOSShoppingCart.jsp create mode 100644 posterita/posterita/web/jsp/pos/completedCreditOrder.jsp create mode 100644 posterita/posterita/web/jsp/pos/completedCustomerReturnOrder.jsp create mode 100644 posterita/posterita/web/jsp/pos/completedGoodsReceiveNote.jsp create mode 100644 posterita/posterita/web/jsp/pos/completedGoodsReturnNote.jsp create mode 100644 posterita/posterita/web/jsp/pos/createAPPayment.jsp create mode 100644 posterita/posterita/web/jsp/pos/createBlackListCheque.jsp create mode 100644 posterita/posterita/web/jsp/pos/createCreditOrder.jsp create mode 100644 posterita/posterita/web/jsp/pos/createCreditOrder2.jsp create mode 100644 posterita/posterita/web/jsp/pos/createMultipleAPInvoicePayment.jsp create mode 100644 posterita/posterita/web/jsp/pos/createMultipleIAPnvoicePayment.jsp create mode 100644 posterita/posterita/web/jsp/pos/createMultipleInvoicePayment.jsp create mode 100644 posterita/posterita/web/jsp/pos/createOrUpdatePriceList.jsp create mode 100644 posterita/posterita/web/jsp/pos/createOrUpdateProduct.jsp create mode 100644 posterita/posterita/web/jsp/pos/createOrUpdateProduct2.jsp create mode 100644 posterita/posterita/web/jsp/pos/createPOSGarmentProducts.jsp create mode 100644 posterita/posterita/web/jsp/pos/createPOSOrder.jsp create mode 100644 posterita/posterita/web/jsp/pos/createPOSOrder2.jsp create mode 100644 posterita/posterita/web/jsp/pos/createPOSOrder3.jsp create mode 100644 posterita/posterita/web/jsp/pos/createPOSOrderWithoutAdvance.jsp create mode 100644 posterita/posterita/web/jsp/pos/createPOSProduct.jsp create mode 100644 posterita/posterita/web/jsp/pos/createPOSUser.jsp create mode 100644 posterita/posterita/web/jsp/pos/createPartialPOSOrder.jsp create mode 100644 posterita/posterita/web/jsp/pos/createPayment.jsp create mode 100644 posterita/posterita/web/jsp/pos/createPaymentTerm.jsp create mode 100644 posterita/posterita/web/jsp/pos/createProductForm.jsp create mode 100644 posterita/posterita/web/jsp/pos/createRole.jsp create mode 100644 posterita/posterita/web/jsp/pos/createTax.jsp create mode 100644 posterita/posterita/web/jsp/pos/createVendor.jsp create mode 100644 posterita/posterita/web/jsp/pos/createdCashPayment.jsp create mode 100644 posterita/posterita/web/jsp/pos/createdProducts.jsp create mode 100644 posterita/posterita/web/jsp/pos/creditOrderPayment.jsp create mode 100644 posterita/posterita/web/jsp/pos/creditOrderShoppingCart.jsp create mode 100644 posterita/posterita/web/jsp/pos/creditScreen.jsp create mode 100644 posterita/posterita/web/jsp/pos/creditorHistory.jsp create mode 100644 posterita/posterita/web/jsp/pos/custRetShoppingCart.jsp create mode 100644 posterita/posterita/web/jsp/pos/customFastMovingItemReport.jsp create mode 100644 posterita/posterita/web/jsp/pos/customPOSInfoReport.jsp create mode 100644 posterita/posterita/web/jsp/pos/customReportTable.jsp create mode 100644 posterita/posterita/web/jsp/pos/customSalesByPeriodReport.jsp create mode 100644 posterita/posterita/web/jsp/pos/customSalesReport.jsp create mode 100644 posterita/posterita/web/jsp/pos/customSlowMovingItemReport.jsp create mode 100644 posterita/posterita/web/jsp/pos/customStockMovementReport.jsp create mode 100644 posterita/posterita/web/jsp/pos/customerDetails.jsp create mode 100644 posterita/posterita/web/jsp/pos/customerReturnOrder.jsp create mode 100644 posterita/posterita/web/jsp/pos/customerReturnOrder3.jsp create mode 100644 posterita/posterita/web/jsp/pos/customerReturnShoppingCart.jsp create mode 100644 posterita/posterita/web/jsp/pos/debtor.jsp create mode 100644 posterita/posterita/web/jsp/pos/debtorHistory.jsp create mode 100644 posterita/posterita/web/jsp/pos/detailedSalesReport.jsp create mode 100644 posterita/posterita/web/jsp/pos/downloadUploadCSVfile.jsp create mode 100644 posterita/posterita/web/jsp/pos/draftedCreditOrder.jsp create mode 100644 posterita/posterita/web/jsp/pos/draftedCustomerReturnOrder.jsp create mode 100644 posterita/posterita/web/jsp/pos/draftedCustomerReturnOrder2.jsp create mode 100644 posterita/posterita/web/jsp/pos/draftedCustomerReturnOrder3.jsp create mode 100644 posterita/posterita/web/jsp/pos/draftedGoodsReceiveNote.jsp create mode 100644 posterita/posterita/web/jsp/pos/draftedGoodsReturnNote.jsp create mode 100644 posterita/posterita/web/jsp/pos/draftedPOSOrder.jsp create mode 100644 posterita/posterita/web/jsp/pos/draftedPOSOrder2.jsp create mode 100644 posterita/posterita/web/jsp/pos/draftedPOSShoppingCart.jsp create mode 100644 posterita/posterita/web/jsp/pos/draftedPartialPOSOrder.jsp create mode 100644 posterita/posterita/web/jsp/pos/draftedposOrderWA.jsp create mode 100644 posterita/posterita/web/jsp/pos/dunningLettersPrinted.jsp create mode 100644 posterita/posterita/web/jsp/pos/editBlackListCheque.jsp create mode 100644 posterita/posterita/web/jsp/pos/editBulkProductPrice.jsp create mode 100644 posterita/posterita/web/jsp/pos/editPOSCustomer.jsp create mode 100644 posterita/posterita/web/jsp/pos/editPOSUser.jsp create mode 100644 posterita/posterita/web/jsp/pos/editPaymentTerm.jsp create mode 100644 posterita/posterita/web/jsp/pos/editRole.jsp create mode 100644 posterita/posterita/web/jsp/pos/editRoleOrgAccess.jsp create mode 100644 posterita/posterita/web/jsp/pos/editTax.jsp create mode 100644 posterita/posterita/web/jsp/pos/editVendor.jsp create mode 100644 posterita/posterita/web/jsp/pos/editattribute.jsp create mode 100644 posterita/posterita/web/jsp/pos/editpriceList.jsp create mode 100644 posterita/posterita/web/jsp/pos/filter.jsp create mode 100644 posterita/posterita/web/jsp/pos/generateCommission.jsp create mode 100644 posterita/posterita/web/jsp/pos/genericReport.jsp create mode 100644 posterita/posterita/web/jsp/pos/getCreditOrderDiscDetails.jsp create mode 100644 posterita/posterita/web/jsp/pos/getCurrentTillAmount.jsp create mode 100644 posterita/posterita/web/jsp/pos/getCustomerReturnFormPOSOrder.jsp create mode 100644 posterita/posterita/web/jsp/pos/getPOSCustomers.jsp create mode 100644 posterita/posterita/web/jsp/pos/getPOSPaymentDetails.jsp create mode 100644 posterita/posterita/web/jsp/pos/getPOSPaymentDetails2.jsp create mode 100644 posterita/posterita/web/jsp/pos/getPOSPaymentDetails_1.jsp create mode 100644 posterita/posterita/web/jsp/pos/getPOSStock.jsp create mode 100644 posterita/posterita/web/jsp/pos/getPartialPOSPaymentDetails.jsp create mode 100644 posterita/posterita/web/jsp/pos/goodsReceiveNote.jsp create mode 100644 posterita/posterita/web/jsp/pos/goodsReceiveShoppingCart.jsp create mode 100644 posterita/posterita/web/jsp/pos/goodsReturnNote.jsp create mode 100644 posterita/posterita/web/jsp/pos/goodsReturnShoppingCart.jsp create mode 100644 posterita/posterita/web/jsp/pos/grnShoppingCart.jsp create mode 100644 posterita/posterita/web/jsp/pos/importBlackList.jsp create mode 100644 posterita/posterita/web/jsp/pos/importCustomer.jsp create mode 100644 posterita/posterita/web/jsp/pos/importPOSProducts.jsp create mode 100644 posterita/posterita/web/jsp/pos/importPOSStock.jsp create mode 100644 posterita/posterita/web/jsp/pos/index.jsp create mode 100644 posterita/posterita/web/jsp/pos/initMaxItem.jsp create mode 100644 posterita/posterita/web/jsp/pos/initMinItem.jsp create mode 100644 posterita/posterita/web/jsp/pos/initViewPOSInfo2.jsp create mode 100644 posterita/posterita/web/jsp/pos/initViewSalesAnalysisReport.jsp create mode 100644 posterita/posterita/web/jsp/pos/initViewStockMovement.jsp create mode 100644 posterita/posterita/web/jsp/pos/inventoryImportErrors.jsp create mode 100644 posterita/posterita/web/jsp/pos/invokeCreditOrder.jsp create mode 100644 posterita/posterita/web/jsp/pos/invokePartialPOSOrder.jsp create mode 100644 posterita/posterita/web/jsp/pos/listCashBooks.jsp create mode 100644 posterita/posterita/web/jsp/pos/listCurrencies.jsp create mode 100644 posterita/posterita/web/jsp/pos/listPOSUsers.jsp create mode 100644 posterita/posterita/web/jsp/pos/listPriceLists.jsp create mode 100644 posterita/posterita/web/jsp/pos/listRoles.jsp create mode 100644 posterita/posterita/web/jsp/pos/listTerminals.jsp create mode 100644 posterita/posterita/web/jsp/pos/monthlySalesReport.jsp create mode 100644 posterita/posterita/web/jsp/pos/orderDetailsPerProduct.jsp create mode 100644 posterita/posterita/web/jsp/pos/orderHeader.jsp create mode 100644 posterita/posterita/web/jsp/pos/orderScreen.jsp create mode 100644 posterita/posterita/web/jsp/pos/partialPOSOrderShoppingCart.jsp create mode 100644 posterita/posterita/web/jsp/pos/posLogin.jsp create mode 100644 posterita/posterita/web/jsp/pos/posPINLogin.jsp create mode 100644 posterita/posterita/web/jsp/pos/posPassword.jsp create mode 100644 posterita/posterita/web/jsp/pos/posReport.jsp create mode 100644 posterita/posterita/web/jsp/pos/posReport1.jsp create mode 100644 posterita/posterita/web/jsp/pos/posShoppingCart.jsp create mode 100644 posterita/posterita/web/jsp/pos/posShoppingCartFirstPage.jsp create mode 100644 posterita/posterita/web/jsp/pos/posSubMenu.jsp create mode 100644 posterita/posterita/web/jsp/pos/postingSuccess.jsp create mode 100644 posterita/posterita/web/jsp/pos/priceCheck.jsp create mode 100644 posterita/posterita/web/jsp/pos/priceList.jsp create mode 100644 posterita/posterita/web/jsp/pos/printPOSOrder.jsp create mode 100644 posterita/posterita/web/jsp/pos/productBarcodeCart.jsp create mode 100644 posterita/posterita/web/jsp/pos/productDetails.jsp create mode 100644 posterita/posterita/web/jsp/pos/productDetailsError.jsp create mode 100644 posterita/posterita/web/jsp/pos/productsUpdated.jsp create mode 100644 posterita/posterita/web/jsp/pos/reportCalendar.jsp create mode 100644 posterita/posterita/web/jsp/pos/reportFilter.jsp create mode 100644 posterita/posterita/web/jsp/pos/retShoppingCart.jsp create mode 100644 posterita/posterita/web/jsp/pos/salesReport.jsp create mode 100644 posterita/posterita/web/jsp/pos/saveVendor.jsp create mode 100644 posterita/posterita/web/jsp/pos/searchCustomer.jsp create mode 100644 posterita/posterita/web/jsp/pos/searchPOSGarmentAttributes.jsp create mode 100644 posterita/posterita/web/jsp/pos/searchPOSProducts.jsp create mode 100644 posterita/posterita/web/jsp/pos/searchVendor.jsp create mode 100644 posterita/posterita/web/jsp/pos/settleAPPayment.jsp create mode 100644 posterita/posterita/web/jsp/pos/settlePayment.jsp create mode 100644 posterita/posterita/web/jsp/pos/shoppingCart.jsp create mode 100644 posterita/posterita/web/jsp/pos/stockAdjustments.jsp create mode 100644 posterita/posterita/web/jsp/pos/terminal.jsp create mode 100644 posterita/posterita/web/jsp/pos/testShoppingCart.jsp create mode 100644 posterita/posterita/web/jsp/pos/updateCurrency.jsp create mode 100644 posterita/posterita/web/jsp/pos/updatePOSProduct.jsp create mode 100644 posterita/posterita/web/jsp/pos/updatedProduct.jsp create mode 100644 posterita/posterita/web/jsp/pos/viewAPPaymentAllocation.jsp create mode 100644 posterita/posterita/web/jsp/pos/viewAllPOSProducts.jsp create mode 100644 posterita/posterita/web/jsp/pos/viewAllPOSProductsForUpdate.jsp create mode 100644 posterita/posterita/web/jsp/pos/viewAllPaymentTerm.jsp create mode 100644 posterita/posterita/web/jsp/pos/viewAllTax.jsp create mode 100644 posterita/posterita/web/jsp/pos/viewBPartnerTrxDetails.jsp create mode 100644 posterita/posterita/web/jsp/pos/viewBarcode.jsp create mode 100644 posterita/posterita/web/jsp/pos/viewBestSellingItems.jsp create mode 100644 posterita/posterita/web/jsp/pos/viewBlackListCheques.jsp create mode 100644 posterita/posterita/web/jsp/pos/viewCommission.jsp create mode 100644 posterita/posterita/web/jsp/pos/viewCommissionDetails.jsp create mode 100644 posterita/posterita/web/jsp/pos/viewCompletePOSOrder.jsp create mode 100644 posterita/posterita/web/jsp/pos/viewCompletedCreditOrder.jsp create mode 100644 posterita/posterita/web/jsp/pos/viewCompletedCustomerReturnOrder.jsp create mode 100644 posterita/posterita/web/jsp/pos/viewCompletedGoodsReceiveNote.jsp create mode 100644 posterita/posterita/web/jsp/pos/viewCompletedGoodsReturnNote.jsp create mode 100644 posterita/posterita/web/jsp/pos/viewCompletedPOSOrder.jsp create mode 100644 posterita/posterita/web/jsp/pos/viewCreditors.jsp create mode 100644 posterita/posterita/web/jsp/pos/viewCurrency.jsp create mode 100644 posterita/posterita/web/jsp/pos/viewDebtors.jsp create mode 100644 posterita/posterita/web/jsp/pos/viewDocumentHistory.jsp create mode 100644 posterita/posterita/web/jsp/pos/viewDocumentPDF.jsp create mode 100644 posterita/posterita/web/jsp/pos/viewDraftedOrder.jsp create mode 100644 posterita/posterita/web/jsp/pos/viewInventoryHistory.jsp create mode 100644 posterita/posterita/web/jsp/pos/viewMaxSoldItems.jsp create mode 100644 posterita/posterita/web/jsp/pos/viewMinOut.jsp create mode 100644 posterita/posterita/web/jsp/pos/viewMinSoldItems.jsp create mode 100644 posterita/posterita/web/jsp/pos/viewOrder.jsp create mode 100644 posterita/posterita/web/jsp/pos/viewPOSBPartnerForDunning.jsp create mode 100644 posterita/posterita/web/jsp/pos/viewPOSBPartnerInfo.jsp create mode 100644 posterita/posterita/web/jsp/pos/viewPOSCustomer.jsp create mode 100644 posterita/posterita/web/jsp/pos/viewPOSCustomerCart.jsp create mode 100644 posterita/posterita/web/jsp/pos/viewPOSHistory.jsp create mode 100644 posterita/posterita/web/jsp/pos/viewPOSHistoryForAll.jsp create mode 100644 posterita/posterita/web/jsp/pos/viewPOSHistory_displaytag.jsp create mode 100644 posterita/posterita/web/jsp/pos/viewPOSInfo.jsp create mode 100644 posterita/posterita/web/jsp/pos/viewPOSOrder.jsp create mode 100644 posterita/posterita/web/jsp/pos/viewPOSProduct.jsp create mode 100644 posterita/posterita/web/jsp/pos/viewPOSProducts.jsp create mode 100644 posterita/posterita/web/jsp/pos/viewPOSUser.jsp create mode 100644 posterita/posterita/web/jsp/pos/viewPartialPOSOrderHistory.jsp create mode 100644 posterita/posterita/web/jsp/pos/viewPayment.jsp create mode 100644 posterita/posterita/web/jsp/pos/viewPaymentAllocation.jsp create mode 100644 posterita/posterita/web/jsp/pos/viewPaymentDetails.jsp create mode 100644 posterita/posterita/web/jsp/pos/viewPreferences.jsp create mode 100644 posterita/posterita/web/jsp/pos/viewProductCart.jsp create mode 100644 posterita/posterita/web/jsp/pos/viewProductCartForUpdate.jsp create mode 100644 posterita/posterita/web/jsp/pos/viewProductSalesDetails.jsp create mode 100644 posterita/posterita/web/jsp/pos/viewProductsSalesInfo.jsp create mode 100644 posterita/posterita/web/jsp/pos/viewRole.jsp create mode 100644 posterita/posterita/web/jsp/pos/viewStockEnquiry.jsp create mode 100644 posterita/posterita/web/jsp/pos/viewStockMovement.jsp create mode 100644 posterita/posterita/web/jsp/pos/viewStockSalesReport.jsp create mode 100644 posterita/posterita/web/jsp/pos/viewStockTransfer.jsp create mode 100644 posterita/posterita/web/jsp/pos/viewVendorDetails.jsp create mode 100644 posterita/posterita/web/jsp/pos/viewWebstorePayment.jsp create mode 100644 posterita/posterita/web/jsp/pos/viewattributevalues.jsp create mode 100644 posterita/posterita/web/jsp/pos/webDocumentHeader.jsp create mode 100644 posterita/posterita/web/jsp/pos/wstoreeditattribute.jsp create mode 100644 posterita/posterita/web/jsp/pos/wstoreviewattributevalues.jsp create mode 100644 posterita/posterita/web/jsp/product/viewProductInfo.jsp create mode 100644 posterita/posterita/web/jsp/user/createUser.jsp create mode 100644 posterita/posterita/web/jsp/user/editUser.jsp create mode 100644 posterita/posterita/web/jsp/user/listUsers.jsp create mode 100644 posterita/posterita/web/jsp/user/registerUser.jsp create mode 100644 posterita/posterita/web/jsp/user/userCreated.jsp create mode 100644 posterita/posterita/web/jsp/user/viewUser.jsp create mode 100644 posterita/properties.xml diff --git a/posterita/.classpath b/posterita/.classpath new file mode 100644 index 0000000000..3d9cd643fa --- /dev/null +++ b/posterita/.classpath @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/posterita/.project b/posterita/.project new file mode 100644 index 0000000000..74ab5b9df6 --- /dev/null +++ b/posterita/.project @@ -0,0 +1,18 @@ + + + posterita + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + com.sysdeo.eclipse.tomcat.tomcatnature + + diff --git a/posterita/.settings/org.eclipse.jdt.core.prefs b/posterita/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000000..850ee4c73b --- /dev/null +++ b/posterita/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,328 @@ +#Mon Apr 14 16:31:16 MUT 2008 (Ashley G Ramdass) +eclipse.preferences.version=1 +org.eclipse.jdt.core.codeComplete.argumentPrefixes= +org.eclipse.jdt.core.codeComplete.argumentSuffixes= +org.eclipse.jdt.core.codeComplete.fieldPrefixes= +org.eclipse.jdt.core.codeComplete.fieldSuffixes= +org.eclipse.jdt.core.codeComplete.localPrefixes= +org.eclipse.jdt.core.codeComplete.localSuffixes= +org.eclipse.jdt.core.codeComplete.staticFieldPrefixes= +org.eclipse.jdt.core.codeComplete.staticFieldSuffixes= +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.5 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.autoboxing=ignore +org.eclipse.jdt.core.compiler.problem.deprecation=warning +org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled +org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled +org.eclipse.jdt.core.compiler.problem.discouragedReference=warning +org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore +org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled +org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore +org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning +org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning +org.eclipse.jdt.core.compiler.problem.forbiddenReference=error +org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning +org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning +org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore +org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore +org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore +org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning +org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning +org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning +org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning +org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore +org.eclipse.jdt.core.compiler.problem.nullReference=ignore +org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning +org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore +org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore +org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore +org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning +org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore +org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled +org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning +org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled +org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore +org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning +org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning +org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore +org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning +org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore +org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore +org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled +org.eclipse.jdt.core.compiler.problem.unusedImport=warning +org.eclipse.jdt.core.compiler.problem.unusedLabel=warning +org.eclipse.jdt.core.compiler.problem.unusedLocal=warning +org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled +org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning +org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning +org.eclipse.jdt.core.compiler.source=1.5 +org.eclipse.jdt.core.formatter.align_type_members_on_columns=true +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_assignment=0 +org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 +org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 +org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=0 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 +org.eclipse.jdt.core.formatter.blank_lines_before_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.jdt.core.formatter.blank_lines_before_package=0 +org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 +org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 +org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=next_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=next_line +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=next_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=next_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=next_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=next_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=next_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=next_line +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false +org.eclipse.jdt.core.formatter.comment.format_block_comments=true +org.eclipse.jdt.core.formatter.comment.format_header=false +org.eclipse.jdt.core.formatter.comment.format_html=true +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true +org.eclipse.jdt.core.formatter.comment.format_line_comments=true +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true +org.eclipse.jdt.core.formatter.comment.indent_root_tags=true +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert +org.eclipse.jdt.core.formatter.comment.line_length=80 +org.eclipse.jdt.core.formatter.compact_else_if=true +org.eclipse.jdt.core.formatter.continuation_indentation=2 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 +org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true +org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_empty_lines=false +org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true +org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true +org.eclipse.jdt.core.formatter.indentation.size=4 +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=insert +org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=insert +org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false +org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +org.eclipse.jdt.core.formatter.lineSplit=80 +org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +org.eclipse.jdt.core.formatter.tabulation.char=space +org.eclipse.jdt.core.formatter.tabulation.size=4 +org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=true +org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true diff --git a/posterita/.settings/org.eclipse.jdt.ui.prefs b/posterita/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 0000000000..5a515244bf --- /dev/null +++ b/posterita/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,10 @@ +#Tue May 27 10:52:59 MUT 2008 (Ashley G Ramdass) +eclipse.preferences.version=1 +formatter_profile=_Posterita +formatter_settings_version=11 +org.eclipse.jdt.ui.exception.name=e +org.eclipse.jdt.ui.gettersetter.use.is=true +org.eclipse.jdt.ui.javadoc=false +org.eclipse.jdt.ui.keywordthis=false +org.eclipse.jdt.ui.overrideannotation=true +org.eclipse.jdt.ui.text.custom_code_templates= diff --git a/posterita/.tomcatplugin b/posterita/.tomcatplugin new file mode 100644 index 0000000000..2b55a22921 --- /dev/null +++ b/posterita/.tomcatplugin @@ -0,0 +1,11 @@ + + + / + false + true + true + true + + + /posterita + diff --git a/posterita/commons/BuildPatch/Adempiere/jboss/bin/run.conf b/posterita/commons/BuildPatch/Adempiere/jboss/bin/run.conf new file mode 100644 index 0000000000..518084d856 --- /dev/null +++ b/posterita/commons/BuildPatch/Adempiere/jboss/bin/run.conf @@ -0,0 +1,53 @@ +## -*- shell-script -*- ###################################################### +## ## +## JBoss Bootstrap Script Configuration ## +## ## +############################################################################## + +### $Id: run.conf,v 1.3 2005/09/04 17:52:33 jjanke Exp $ + +# +# This file is optional; it may be removed if not needed. +# + +# +# Specify the maximum file descriptor limit, use "max" or "maximum" to use +# the default, as queried by the system. +# +# Defaults to "maximum" +# +#MAX_FD="maximum" + +# +# Specify the profiler configuration file to load. +# +# Default is to not load profiler configuration file. +# +#PROFILER="" + +# +# Specify the location of the Java home directory. If set then $JAVA will +# be defined to $JAVA_HOME/bin/java, else $JAVA will be "java". +# +#JAVA_HOME="/opt/java/jdk" + +# +# Specify the exact Java VM executable to use. +# +#JAVA="" + +# +# Specify options to pass to the Java VM. +# +if [ "x$JAVA_OPTS" = "x" ]; then + JAVA_OPTS="-server -Xms128m -Xmx128m" +fi + +# Sample JPDA settings for remote socket debuging +#JAVA_OPTS="$JAVA_OPTS -Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y" + +# Sample JPDA settings for shared memory debugging +#JAVA_OPTS="$JAVA_OPTS -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_shmem,server=y,suspend=n,address=jboss" + +# AspectJ integration +JAVA_OPTS="$JAVA_OPTS -javaagent:$ADEMPIERE_HOME/lib/aspectjweaver.jar" diff --git a/posterita/commons/Migration/1.0-1.5 (AD331b)/build.xml b/posterita/commons/Migration/1.0-1.5 (AD331b)/build.xml new file mode 100644 index 0000000000..c0b65f816f --- /dev/null +++ b/posterita/commons/Migration/1.0-1.5 (AD331b)/build.xml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + File ${file.name} status ${sqlplus.result} + + + + + + diff --git a/posterita/commons/Migration/1.0-1.5 (AD331b)/oracle/001_ad_changes.sql b/posterita/commons/Migration/1.0-1.5 (AD331b)/oracle/001_ad_changes.sql new file mode 100644 index 0000000000..6336c6c293 --- /dev/null +++ b/posterita/commons/Migration/1.0-1.5 (AD331b)/oracle/001_ad_changes.sql @@ -0,0 +1,32 @@ +INSERT INTO ad_element +(ad_element_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, +columnname, entitytype, name, printname, description, help, po_name, po_printname, po_description, po_help) +VALUES(52027, 0, 0, 'Y', TO_DATE('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_DATE('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, 'isPresentForProduct', +'U', 'isPresentForProduct', 'Present for Product', NULL, NULL, NULL, NULL, NULL, NULL); + +INSERT INTO ad_column +(ad_column_id, ad_client_id, ad_org_id, isactive, created, updated, createdby, updatedby, name, + description, help, version, entitytype, columnname, ad_table_id, ad_reference_id, ad_reference_value_id, + ad_val_rule_id, fieldlength, defaultvalue, iskey, isparent, ismandatory, isupdateable, readonlylogic, +isidentifier, seqno, istranslated, isencrypted, callout, vformat, valuemin, valuemax, isselectioncolumn, +ad_element_id, ad_process_id, issyncdatabase, isalwaysupdateable, columnsql, mandatorylogic) + VALUES( 52071, 0, 0, 'Y', TO_DATE('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), TO_DATE('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, 100, +'isPresentForProduct', 'Price List appears in Product Screen', '', 0, 'U', 'isPresentForProduct', + 255, 20, NULL, NULL, 1, NULL, 'N', 'N', 'N', 'Y', NULL, +'N', 0, 'N', 'N', NULL, NULL, NULL, NULL, 'N', + 52027, NULL, 'N', 'N', NULL, NULL); + +INSERT INTO ad_column +(ad_column_id, ad_client_id, ad_org_id, isactive, created, updated, createdby, updatedby, + name, description, help, version, entitytype, columnname, ad_table_id, ad_reference_id, +ad_reference_value_id, ad_val_rule_id, fieldlength, defaultvalue, iskey, isparent, ismandatory, +isupdateable, readonlylogic, isidentifier, seqno, istranslated, isencrypted, callout, vformat, +valuemin, valuemax, isselectioncolumn, ad_element_id, ad_process_id, issyncdatabase, +isalwaysupdateable, columnsql, mandatorylogic) + VALUES(52072 , +0, 0, 'Y', TO_DATE('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), TO_DATE('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, 100, 'Mandatory', 'Data entry is required in this column', +'The field must have a value for the record to be saved to the database.', 0, 'U', 'IsMandatory', +255, 20, NULL, NULL, 1, NULL, 'N', 'N', 'N', 'Y', NULL, 'N', 0, 'N', 'N', NULL, NULL, NULL, NULL, 'N', + 392, NULL, 'N', 'N', NULL, NULL); + + diff --git a/posterita/commons/Migration/1.0-1.5 (AD331b)/oracle/002_ad_message.sql b/posterita/commons/Migration/1.0-1.5 (AD331b)/oracle/002_ad_message.sql new file mode 100644 index 0000000000..73d279f394 --- /dev/null +++ b/posterita/commons/Migration/1.0-1.5 (AD331b)/oracle/002_ad_message.sql @@ -0,0 +1,65 @@ +INSERT INTO AD_MESSAGE +(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, +updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) +VALUES(52441 , 0, 0, 'Y', TO_DATE('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_DATE('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, +'smenu.price.list', 'Price List', ' ', 'I', 'D'); + +INSERT INTO AD_MESSAGE +(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, +updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) +VALUES(52442 , 0, 0, 'Y', TO_DATE('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_DATE('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, +'pmenu.help', 'Help', ' ', 'I', 'D'); + +INSERT INTO AD_MESSAGE +(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, +updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) +VALUES(52443 , 0, 0, 'Y', TO_DATE('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_DATE('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, +'list.price', 'List Price', ' ', 'I', 'D'); + +INSERT INTO AD_MESSAGE +(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, +updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) +VALUES(52444 , 0, 0, 'Y', TO_DATE('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_DATE('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, +'standard.price', 'Standard Price', ' ', 'I', 'D'); + +INSERT INTO AD_MESSAGE +(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, +updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) +VALUES(52445 , 0, 0, 'Y', TO_DATE('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_DATE('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, +'limit.price', 'Limit Price', ' ', 'I', 'D'); + +INSERT INTO AD_MESSAGE +(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, +updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) +VALUES(52446 , 0, 0, 'Y', TO_DATE('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_DATE('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, +'tax.incl', 'Tax Incl', ' ', 'I', 'D'); + +INSERT INTO AD_MESSAGE +(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, +updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) +VALUES(52447 , 0, 0, 'Y', TO_DATE('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_DATE('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, +'tax.excl', 'Tax Excl', ' ', 'I', 'D'); + +INSERT INTO AD_MESSAGE +(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, +updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) +VALUES(52448 , 0, 0, 'Y', TO_DATE('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_DATE('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, +'type.of.price.list', 'Type of Price List', ' ', 'I', 'D'); + +INSERT INTO AD_MESSAGE +(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, +updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) +VALUES(52449 , 0, 0, 'Y', TO_DATE('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_DATE('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, +'purchase', 'Purchase', ' ', 'I', 'D'); + +INSERT INTO AD_MESSAGE +(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, +updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) +VALUES(52450 , 0, 0, 'Y', TO_DATE('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_DATE('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, +'sales', 'Sales', ' ', 'I', 'D'); + +INSERT INTO AD_MESSAGE +(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, +updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) +VALUES(52451 , 0, 0, 'Y', TO_DATE('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_DATE('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, +'isPresentForProduct', 'Present for Product', ' ', 'I', 'D'); diff --git a/posterita/commons/Migration/1.0-1.5 (AD331b)/oracle/003_m_pricelist.sql b/posterita/commons/Migration/1.0-1.5 (AD331b)/oracle/003_m_pricelist.sql new file mode 100644 index 0000000000..753cec73ea --- /dev/null +++ b/posterita/commons/Migration/1.0-1.5 (AD331b)/oracle/003_m_pricelist.sql @@ -0,0 +1,5 @@ +ALTER TABLE m_pricelist ADD ismandatory char(1) DEFAULT 'N'; + +ALTER TABLE m_pricelist ADD ispresentforproduct char(1) DEFAULT 'N'; + + diff --git a/posterita/commons/Migration/1.0-1.5 (AD331b)/postgresql/001_ad_changes.sql b/posterita/commons/Migration/1.0-1.5 (AD331b)/postgresql/001_ad_changes.sql new file mode 100644 index 0000000000..ea9358ee4d --- /dev/null +++ b/posterita/commons/Migration/1.0-1.5 (AD331b)/postgresql/001_ad_changes.sql @@ -0,0 +1,32 @@ +INSERT INTO ad_element +(ad_element_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, +columnname, entitytype, name, printname, description, help, po_name, po_printname, po_description, po_help) +VALUES(52027, 0, 0, 'Y', TO_TIMESTAMP('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, 'isPresentForProduct', +'U', 'isPresentForProduct', 'Present for Product', NULL, NULL, NULL, NULL, NULL, NULL); + +INSERT INTO ad_column +(ad_column_id, ad_client_id, ad_org_id, isactive, created, updated, createdby, updatedby, name, + description, help, version, entitytype, columnname, ad_table_id, ad_reference_id, ad_reference_value_id, + ad_val_rule_id, fieldlength, defaultvalue, iskey, isparent, ismandatory, isupdateable, readonlylogic, +isidentifier, seqno, istranslated, isencrypted, callout, vformat, valuemin, valuemax, isselectioncolumn, +ad_element_id, ad_process_id, issyncdatabase, isalwaysupdateable, columnsql, mandatorylogic) + VALUES( 52071, 0, 0, 'Y', TO_TIMESTAMP('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), TO_TIMESTAMP('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, 100, +'isPresentForProduct', 'Price List appears in Product Screen', '', 0, 'U', 'isPresentForProduct', + 255, 20, NULL, NULL, 1, NULL, 'N', 'N', 'N', 'Y', NULL, +'N', 0, 'N', 'N', NULL, NULL, NULL, NULL, 'N', + 52027, NULL, 'N', 'N', NULL, NULL); + +INSERT INTO ad_column +(ad_column_id, ad_client_id, ad_org_id, isactive, created, updated, createdby, updatedby, + name, description, help, version, entitytype, columnname, ad_table_id, ad_reference_id, +ad_reference_value_id, ad_val_rule_id, fieldlength, defaultvalue, iskey, isparent, ismandatory, +isupdateable, readonlylogic, isidentifier, seqno, istranslated, isencrypted, callout, vformat, +valuemin, valuemax, isselectioncolumn, ad_element_id, ad_process_id, issyncdatabase, +isalwaysupdateable, columnsql, mandatorylogic) + VALUES(52072 , +0, 0, 'Y', TO_TIMESTAMP('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), TO_TIMESTAMP('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, 100, 'Mandatory', 'Data entry is required in this column', +'The field must have a value for the record to be saved to the database.', 0, 'U', 'IsMandatory', +255, 20, NULL, NULL, 1, NULL, 'N', 'N', 'N', 'Y', NULL, 'N', 0, 'N', 'N', NULL, NULL, NULL, NULL, 'N', + 392, NULL, 'N', 'N', NULL, NULL); + + diff --git a/posterita/commons/Migration/1.0-1.5 (AD331b)/postgresql/002_ad_message.sql b/posterita/commons/Migration/1.0-1.5 (AD331b)/postgresql/002_ad_message.sql new file mode 100644 index 0000000000..baf54a2aa5 --- /dev/null +++ b/posterita/commons/Migration/1.0-1.5 (AD331b)/postgresql/002_ad_message.sql @@ -0,0 +1,65 @@ +INSERT INTO AD_MESSAGE +(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, +updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) +VALUES(52441 , 0, 0, 'Y', TO_TIMESTAMP('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, +'smenu.price.list', 'Price List', ' ', 'I', 'D'); + +INSERT INTO AD_MESSAGE +(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, +updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) +VALUES(52442 , 0, 0, 'Y', TO_TIMESTAMP('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, +'pmenu.help', 'Help', ' ', 'I', 'D'); + +INSERT INTO AD_MESSAGE +(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, +updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) +VALUES(52443 , 0, 0, 'Y', TO_TIMESTAMP('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, +'list.price', 'List Price', ' ', 'I', 'D'); + +INSERT INTO AD_MESSAGE +(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, +updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) +VALUES(52444 , 0, 0, 'Y', TO_TIMESTAMP('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, +'standard.price', 'Standard Price', ' ', 'I', 'D'); + +INSERT INTO AD_MESSAGE +(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, +updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) +VALUES(52445 , 0, 0, 'Y', TO_TIMESTAMP('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, +'limit.price', 'Limit Price', ' ', 'I', 'D'); + +INSERT INTO AD_MESSAGE +(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, +updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) +VALUES(52446 , 0, 0, 'Y', TO_TIMESTAMP('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, +'tax.incl', 'Tax Incl', ' ', 'I', 'D'); + +INSERT INTO AD_MESSAGE +(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, +updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) +VALUES(52447 , 0, 0, 'Y', TO_TIMESTAMP('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, +'tax.excl', 'Tax Excl', ' ', 'I', 'D'); + +INSERT INTO AD_MESSAGE +(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, +updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) +VALUES(52448 , 0, 0, 'Y', TO_TIMESTAMP('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, +'type.of.price.list', 'Type of Price List', ' ', 'I', 'D'); + +INSERT INTO AD_MESSAGE +(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, +updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) +VALUES(52449 , 0, 0, 'Y', TO_TIMESTAMP('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, +'purchase', 'Purchase', ' ', 'I', 'D'); + +INSERT INTO AD_MESSAGE +(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, +updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) +VALUES(52450 , 0, 0, 'Y', TO_TIMESTAMP('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, +'sales', 'Sales', ' ', 'I', 'D'); + +INSERT INTO AD_MESSAGE +(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, +updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) +VALUES(52451 , 0, 0, 'Y', TO_TIMESTAMP('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, +'isPresentForProduct', 'Present for Product', ' ', 'I', 'D'); diff --git a/posterita/commons/Migration/1.0-1.5 (AD331b)/postgresql/003_m_pricelist.sql b/posterita/commons/Migration/1.0-1.5 (AD331b)/postgresql/003_m_pricelist.sql new file mode 100644 index 0000000000..fe0893a52e --- /dev/null +++ b/posterita/commons/Migration/1.0-1.5 (AD331b)/postgresql/003_m_pricelist.sql @@ -0,0 +1,5 @@ +ALTER TABLE m_pricelist ADD COLUMN ismandatory char(1) DEFAULT 'N'; + +ALTER TABLE m_pricelist ADD COLUMN ispresentforproduct char(1) DEFAULT 'N'; + + diff --git a/posterita/commons/Migration/1.6(AD340)/build.xml b/posterita/commons/Migration/1.6(AD340)/build.xml new file mode 100644 index 0000000000..219ea01d3b --- /dev/null +++ b/posterita/commons/Migration/1.6(AD340)/build.xml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + File ${file.name} status ${sqlplus.result} + + + + + + diff --git a/posterita/commons/Migration/1.6(AD340)/oracle/001_ad_Changes for C_Currency.sql b/posterita/commons/Migration/1.6(AD340)/oracle/001_ad_Changes for C_Currency.sql new file mode 100644 index 0000000000..1d921d56e4 --- /dev/null +++ b/posterita/commons/Migration/1.6(AD340)/oracle/001_ad_Changes for C_Currency.sql @@ -0,0 +1,14 @@ +INSERT INTO AD_Element +(ad_element_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, +columnname, entitytype, name, printname, description, help, po_name, po_printname, po_description, po_help) +VALUES(52073, 0, 0, 'Y', TO_TIMESTAMP('2008-04-17 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-04-17 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, +'RoundOffFactor', 'U', 'Round Off Factor', 'Round Off Factor', 'Used to Round Off Payment Amount', NULL, NULL, NULL, NULL, NULL); + +INSERT INTO ad_column +(ad_column_id, ad_client_id, ad_org_id, isactive, created, updated, createdby, updatedby, name, +description, help, version, entitytype, columnname, ad_table_id, ad_reference_id, ad_reference_value_id, +ad_val_rule_id, fieldlength, defaultvalue, iskey, isparent, ismandatory, isupdateable, readonlylogic, +isidentifier, seqno, istranslated, isencrypted, callout, vformat, valuemin, valuemax, isselectioncolumn, +ad_element_id, ad_process_id, issyncdatabase, isalwaysupdateable, columnsql, mandatorylogic) +VALUES(52074, 0, 0, 'Y', TO_TIMESTAMP('2008-04-17 16:00:00','YYYY-MM-DD HH24:MI:SS'), TO_TIMESTAMP('2008-04-17 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, 100, 'RoundOffFactor' , 'Used to Round Off Payment Amount', NULL, 0, 'U', 'RoundOffFactor', 141, 22, NULL, NULL, 14, 1, 'N', 'N', 'Y', 'Y', NULL, +'N', 0, 'N', 'N', NULL, NULL, NULL, NULL, 'N', 52073, NULL, 'N', 'N', NULL, NULL); diff --git a/posterita/commons/Migration/1.6(AD340)/oracle/002_ad_message.sql b/posterita/commons/Migration/1.6(AD340)/oracle/002_ad_message.sql new file mode 100644 index 0000000000..a0c8df625c --- /dev/null +++ b/posterita/commons/Migration/1.6(AD340)/oracle/002_ad_message.sql @@ -0,0 +1,11 @@ +INSERT INTO AD_MESSAGE +(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, +updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) +VALUES(52467 , 0, 0, 'Y', TO_TIMESTAMP('2008-04-25 14:30:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-04-25 14:30:00','YYYY-MM-DD HH24:MI:SS'), 100, +'smenu.currency', 'Currency', ' ', 'I', 'D'); + +INSERT INTO AD_MESSAGE +(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, +updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) +VALUES(52468 , 0, 0, 'Y', TO_TIMESTAMP('2008-04-25 14:30:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-04-25 14:30:00','YYYY-MM-DD HH24:MI:SS'), 100, +'smenu.delete.price.on.pricelist', 'Delete Price On Price List', ' ', 'I', 'D'); diff --git a/posterita/commons/Migration/1.6(AD340)/oracle/003_C_Currency.sql b/posterita/commons/Migration/1.6(AD340)/oracle/003_C_Currency.sql new file mode 100644 index 0000000000..8ac2e6a7fd --- /dev/null +++ b/posterita/commons/Migration/1.6(AD340)/oracle/003_C_Currency.sql @@ -0,0 +1,2 @@ +ALTER TABLE C_Currency ADD roundOffFactor NUMBER; + diff --git a/posterita/commons/Migration/1.6(AD340)/postgresql/001_ad_Changes for C_Currency.sql b/posterita/commons/Migration/1.6(AD340)/postgresql/001_ad_Changes for C_Currency.sql new file mode 100644 index 0000000000..1d921d56e4 --- /dev/null +++ b/posterita/commons/Migration/1.6(AD340)/postgresql/001_ad_Changes for C_Currency.sql @@ -0,0 +1,14 @@ +INSERT INTO AD_Element +(ad_element_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, +columnname, entitytype, name, printname, description, help, po_name, po_printname, po_description, po_help) +VALUES(52073, 0, 0, 'Y', TO_TIMESTAMP('2008-04-17 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-04-17 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, +'RoundOffFactor', 'U', 'Round Off Factor', 'Round Off Factor', 'Used to Round Off Payment Amount', NULL, NULL, NULL, NULL, NULL); + +INSERT INTO ad_column +(ad_column_id, ad_client_id, ad_org_id, isactive, created, updated, createdby, updatedby, name, +description, help, version, entitytype, columnname, ad_table_id, ad_reference_id, ad_reference_value_id, +ad_val_rule_id, fieldlength, defaultvalue, iskey, isparent, ismandatory, isupdateable, readonlylogic, +isidentifier, seqno, istranslated, isencrypted, callout, vformat, valuemin, valuemax, isselectioncolumn, +ad_element_id, ad_process_id, issyncdatabase, isalwaysupdateable, columnsql, mandatorylogic) +VALUES(52074, 0, 0, 'Y', TO_TIMESTAMP('2008-04-17 16:00:00','YYYY-MM-DD HH24:MI:SS'), TO_TIMESTAMP('2008-04-17 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, 100, 'RoundOffFactor' , 'Used to Round Off Payment Amount', NULL, 0, 'U', 'RoundOffFactor', 141, 22, NULL, NULL, 14, 1, 'N', 'N', 'Y', 'Y', NULL, +'N', 0, 'N', 'N', NULL, NULL, NULL, NULL, 'N', 52073, NULL, 'N', 'N', NULL, NULL); diff --git a/posterita/commons/Migration/1.6(AD340)/postgresql/002_ad_message.sql b/posterita/commons/Migration/1.6(AD340)/postgresql/002_ad_message.sql new file mode 100644 index 0000000000..9ca9c4eee5 --- /dev/null +++ b/posterita/commons/Migration/1.6(AD340)/postgresql/002_ad_message.sql @@ -0,0 +1,18 @@ +INSERT INTO AD_MESSAGE +(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, +updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) +VALUES(52467 , 0, 0, 'Y', TO_TIMESTAMP('2008-04-25 14:30:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-04-25 14:30:00','YYYY-MM-DD HH24:MI:SS'), 100, +'smenu.currency', 'Currency', ' ', 'I', 'D'); + +INSERT INTO AD_MESSAGE +(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, +updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) +VALUES(52468 , 0, 0, 'Y', TO_TIMESTAMP('2008-04-25 14:30:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-04-25 14:30:00','YYYY-MM-DD HH24:MI:SS'), 100, +'smenu.delete.price.on.pricelist', 'Delete Price On Price List', ' ', 'I', 'D'); + +INSERT INTO AD_MESSAGE +(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, +updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) +VALUES(52469 , 0, 0, 'Y', TO_TIMESTAMP('2008-04-25 14:30:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-04-25 14:30:00','YYYY-MM-DD HH24:MI:SS'), 100, +'smenu.organisation', 'Organisation', ' ', 'I', 'D'); + diff --git a/posterita/commons/Migration/1.6(AD340)/postgresql/003_C_Currency.sql b/posterita/commons/Migration/1.6(AD340)/postgresql/003_C_Currency.sql new file mode 100644 index 0000000000..1743c49096 --- /dev/null +++ b/posterita/commons/Migration/1.6(AD340)/postgresql/003_C_Currency.sql @@ -0,0 +1,2 @@ +ALTER TABLE C_Currency ADD COLUMN roundOffFactor NUMERIC; + diff --git a/posterita/commons/Migration/1.7.0/build.xml b/posterita/commons/Migration/1.7.0/build.xml new file mode 100644 index 0000000000..2a97b78db4 --- /dev/null +++ b/posterita/commons/Migration/1.7.0/build.xml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + File ${file.name} status ${sqlplus.result} + + + + + + diff --git a/posterita/commons/Migration/1.7.0/oracle/001_MixedPayment.sql b/posterita/commons/Migration/1.7.0/oracle/001_MixedPayment.sql new file mode 100644 index 0000000000..266516c722 --- /dev/null +++ b/posterita/commons/Migration/1.7.0/oracle/001_MixedPayment.sql @@ -0,0 +1,24 @@ +-- May 22, 2008 10:57:07 AM GMT+04:00 +-- Create Mixed in the payment rules list +INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Reference_ID,AD_Ref_List_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value) VALUES (0,0,195,52000,TO_DATE('2008-05-22 10:55:30','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Mixed',TO_DATE('2008-05-22 10:55:30','YYYY-MM-DD HH24:MI:SS'),100,'M') +; + +-- May 22, 2008 10:57:11 AM GMT+04:00 +-- Update the translation +INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=52000 AND EXISTS (SELECT * FROM AD_Ref_List_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Ref_List_ID!=t.AD_Ref_List_ID) +; + +-- May 22, 2008 11:28:12 AM GMT+04:00 +-- Creates new Validation rule so that rich client does not get Mixed rule +INSERT INTO AD_Val_Rule (AD_Client_ID,AD_Org_ID,AD_Val_Rule_ID,Code,Created,CreatedBy,EntityType,IsActive,Name,Type,Updated,UpdatedBy) VALUES (0,0,52002,'AD_Ref_List.Value <> ''M''',TO_DATE('2008-05-22 11:28:12','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','All_Payment Rule - No mixed','S',TO_DATE('2008-05-22 11:28:12','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- May 22, 2008 11:30:02 AM GMT+04:00 +-- Updates all columns in AD where the payment rule list is used with the validation created earlier +UPDATE AD_Column SET AD_Val_Rule_ID=52002 WHERE AD_Reference_Value_ID=195 AND AD_Val_Rule_ID IS NULL +; + +-- May 22, 2008 11:31:15 AM GMT+04:00 +-- Updates all columns in AD where an existing validation rule exist and set it to ignore the Mixed rule +UPDATE AD_Val_Rule SET Code='AD_Ref_List.Value <> ''B'' AND AD_Ref_List.Value <> ''M''' WHERE AD_Val_Rule_ID=161 +; diff --git a/posterita/commons/Migration/1.7.0/oracle/002_Terminals_newTableStructure.sql b/posterita/commons/Migration/1.7.0/oracle/002_Terminals_newTableStructure.sql new file mode 100644 index 0000000000..0c4aaf8e63 --- /dev/null +++ b/posterita/commons/Migration/1.7.0/oracle/002_Terminals_newTableStructure.sql @@ -0,0 +1,629 @@ +-- Jun 2, 2008 9:19:48 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Table (AccessLevel,AD_Client_ID,AD_Org_ID,AD_Table_ID,CopyColumnsFromTable,Created,CreatedBy,EntityType,ImportTable,IsActive,IsChangeLog,IsDeleteable,IsHighVolume,IsSecurityEnabled,IsView,LoadSeq,Name,ReplicationType,TableName,Updated,UpdatedBy) VALUES ('1',0,0,52004,'N',TO_DATE('2008-06-02 21:19:47','YYYY-MM-DD HH24:MI:SS'),100,'A','N','Y','N','Y','N','N','N',0,'POS Terminal','L','U_POSTerminal',TO_DATE('2008-06-02 21:19:47','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Jun 2, 2008 9:19:48 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Table_Trl (AD_Language,AD_Table_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Table_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Table t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Table_ID=52004 AND EXISTS (SELECT * FROM AD_Table_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Table_ID!=t.AD_Table_ID) +; + +-- Jun 2, 2008 9:21:23 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,AD_Val_Rule_ID,ColumnName,Created,CreatedBy,DefaultValue,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52077,102,0,19,52004,129,'AD_Client_ID',TO_DATE('2008-06-02 21:21:22','YYYY-MM-DD HH24:MI:SS'),100,'@#AD_Client_ID@','Client/Tenant for this installation.','A',22,'A Client is a company or a legal entity. You cannot share data between Clients. Tenant is a synonym for Client.','Y','N','N','N','N','Y','N','N','N','N','Y','Client',0,TO_DATE('2008-06-02 21:21:22','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Jun 2, 2008 9:21:23 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52077 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + +-- Jun 2, 2008 9:22:32 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,AD_Val_Rule_ID,ColumnName,Created,CreatedBy,DefaultValue,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52078,113,0,19,52004,130,'AD_Org_ID',TO_DATE('2008-06-02 21:22:32','YYYY-MM-DD HH24:MI:SS'),100,'@#AD_Org_ID@','Organizational entity within client','A',22,'An organization is a unit of your client or legal entity - examples are store, department. You can share data between organizations.','Y','N','N','N','N','Y','N','N','N','N','Y','Organization',0,TO_DATE('2008-06-02 21:22:32','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Jun 2, 2008 9:22:32 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52078 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + + +-- Jun 2, 2008 9:23:51 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52030,0,'AutoLock',TO_DATE('2008-06-02 21:23:51','YYYY-MM-DD HH24:MI:SS'),100,'Whether to automatically lock the terminal when till is closed','A','Y','Auto Lock','Auto Lock',TO_DATE('2008-06-02 21:23:51','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Jun 2, 2008 9:23:51 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52030 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) +; + +-- Jun 2, 2008 9:24:30 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,DefaultValue,Description,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52079,52030,0,20,52004,'AutoLock',TO_DATE('2008-06-02 21:24:30','YYYY-MM-DD HH24:MI:SS'),100,'N','Whether to automatically lock the terminal when till is closed','A',1,'Y','N','N','N','N','Y','N','N','N','N','Y','Auto Lock',0,TO_DATE('2008-06-02 21:24:30','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Jun 2, 2008 9:24:30 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52079 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + +-- Jun 2, 2008 9:26:51 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52031,0,'CashBookTransferType',TO_DATE('2008-06-02 21:26:51','YYYY-MM-DD HH24:MI:SS'),100,'Where the money in the cash book should be transfered to. Either a Bank Account or another Cash Book','A','Y','Cash Book Transfer Type','Cash Book Transfer Type',TO_DATE('2008-06-02 21:26:51','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Jun 2, 2008 9:26:51 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52031 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) +; + +-- Jun 2, 2008 9:29:14 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Reference (AD_Client_ID,AD_Org_ID,AD_Reference_ID,Created,CreatedBy,Description,EntityType,IsActive,Name,Updated,UpdatedBy,ValidationType) VALUES (0,0,52002,TO_DATE('2008-06-02 21:29:14','YYYY-MM-DD HH24:MI:SS'),100,'Where money should be transfered to','A','Y','_TransferType',TO_DATE('2008-06-02 21:29:14','YYYY-MM-DD HH24:MI:SS'),100,'L') +; + +-- Jun 2, 2008 9:29:14 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Reference_Trl (AD_Language,AD_Reference_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Reference_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Reference t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Reference_ID=52002 AND EXISTS (SELECT * FROM AD_Reference_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Reference_ID!=t.AD_Reference_ID) +; + +-- Jun 2, 2008 9:29:42 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Reference_ID,AD_Ref_List_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value) VALUES (0,0,52002,52001,TO_DATE('2008-06-02 21:29:42','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','Bank Account',TO_DATE('2008-06-02 21:29:42','YYYY-MM-DD HH24:MI:SS'),100,'B') +; + +-- Jun 2, 2008 9:29:42 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=52001 AND EXISTS (SELECT * FROM AD_Ref_List_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Ref_List_ID!=t.AD_Ref_List_ID) +; + +-- Jun 2, 2008 9:29:51 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Reference_ID,AD_Ref_List_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value) VALUES (0,0,52002,52002,TO_DATE('2008-06-02 21:29:51','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','CashBook',TO_DATE('2008-06-02 21:29:51','YYYY-MM-DD HH24:MI:SS'),100,'C') +; + +-- Jun 2, 2008 9:29:51 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=52002 AND EXISTS (SELECT * FROM AD_Ref_List_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Ref_List_ID!=t.AD_Ref_List_ID) +; + +-- Jun 2, 2008 9:30:13 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52080,52031,0,17,52002,52004,'CashBookTransferType',TO_DATE('2008-06-02 21:30:13','YYYY-MM-DD HH24:MI:SS'),100,'Where the money in the cash book should be transfered to. Either a Bank Account or another Cash Book','A',1,'Y','N','N','N','N','Y','N','N','N','N','Y','Cash Book Transfer Type',0,TO_DATE('2008-06-02 21:30:13','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Jun 2, 2008 9:30:13 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52080 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + +-- Jun 2, 2008 9:32:22 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52032,0,'CashTransferBankAccount_ID',TO_DATE('2008-06-02 21:32:22','YYYY-MM-DD HH24:MI:SS'),100,'Bank Account on which to transfer all Cash transactions','A','Y','Transfer Cash trx to','Transfer Cash trx to',TO_DATE('2008-06-02 21:32:22','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Jun 2, 2008 9:32:22 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52032 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) +; + +-- Jun 2, 2008 9:33:15 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Reference (AD_Client_ID,AD_Org_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,ValidationType) VALUES (0,0,52003,TO_DATE('2008-06-02 21:33:15','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','C_BankAccount',TO_DATE('2008-06-02 21:33:15','YYYY-MM-DD HH24:MI:SS'),100,'T') +; + +-- Jun 2, 2008 9:33:15 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Reference_Trl (AD_Language,AD_Reference_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Reference_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Reference t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Reference_ID=52003 AND EXISTS (SELECT * FROM AD_Reference_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Reference_ID!=t.AD_Reference_ID) +; + +-- Jun 2, 2008 9:33:52 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Ref_Table (AD_Client_ID,AD_Display,AD_Key,AD_Org_ID,AD_Reference_ID,AD_Table_ID,Created,CreatedBy,EntityType,IsActive,IsValueDisplayed,Updated,UpdatedBy,WhereClause) VALUES (0,3074,3077,0,52003,297,TO_DATE('2008-06-02 21:33:52','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','N',TO_DATE('2008-06-02 21:33:52','YYYY-MM-DD HH24:MI:SS'),100,'C_BankAccount.IsActive=''Y''') +; + +-- Jun 2, 2008 9:34:10 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52081,52032,0,18,52003,52004,'CashTransferBankAccount_ID',TO_DATE('2008-06-02 21:34:10','YYYY-MM-DD HH24:MI:SS'),100,'Bank Account on which to transfer all Cash transactions','A',22,'Y','N','N','N','N','N','N','N','N','N','Y','Transfer Cash trx to',0,TO_DATE('2008-06-02 21:34:10','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Jun 2, 2008 9:34:10 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52081 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + +-- Jun 2, 2008 9:35:28 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52033,0,'CashTransferCashBook_ID',TO_DATE('2008-06-02 21:35:28','YYYY-MM-DD HH24:MI:SS'),100,'Cash Book on which to transfer all Cash transactions','A','Y','Transfer Cash trx to','Transfer Cash trx to',TO_DATE('2008-06-02 21:35:28','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Jun 2, 2008 9:35:28 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52033 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) +; + +-- Jun 2, 2008 9:36:18 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Reference (AD_Client_ID,AD_Org_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,ValidationType) VALUES (0,0,52004,TO_DATE('2008-06-02 21:36:18','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','C_CashBook',TO_DATE('2008-06-02 21:36:18','YYYY-MM-DD HH24:MI:SS'),100,'T') +; + +-- Jun 2, 2008 9:36:18 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Reference_Trl (AD_Language,AD_Reference_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Reference_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Reference t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Reference_ID=52004 AND EXISTS (SELECT * FROM AD_Reference_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Reference_ID!=t.AD_Reference_ID) +; + +-- Jun 2, 2008 9:36:54 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Ref_Table (AD_Client_ID,AD_Display,AD_Key,AD_Org_ID,AD_Reference_ID,AD_Table_ID,Created,CreatedBy,EntityType,IsActive,IsValueDisplayed,Updated,UpdatedBy,WhereClause) VALUES (0,5268,5260,0,52004,408,TO_DATE('2008-06-02 21:36:54','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','N',TO_DATE('2008-06-02 21:36:54','YYYY-MM-DD HH24:MI:SS'),100,'C_CashBook.IsActive=''Y''') +; + +-- Jun 2, 2008 9:37:11 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52082,52033,0,18,52004,52004,'CashTransferCashBook_ID',TO_DATE('2008-06-02 21:37:11','YYYY-MM-DD HH24:MI:SS'),100,'Cash Book on which to transfer all Cash transactions','A',22,'Y','N','N','N','N','N','N','N','N','N','Y','Transfer Cash trx to',0,TO_DATE('2008-06-02 21:37:11','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Jun 2, 2008 9:37:11 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52082 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + +-- Jun 2, 2008 9:37:53 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52083,1463,0,19,52004,'C_CashBook_ID',TO_DATE('2008-06-02 21:37:53','YYYY-MM-DD HH24:MI:SS'),100,'Cash Book for recording petty cash transactions','A',22,'The Cash Book identifies a unique cash book. The cash book is used to record cash transactions.','Y','N','N','N','N','Y','N','N','N','N','Y','Cash Book',0,TO_DATE('2008-06-02 21:37:53','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Jun 2, 2008 9:37:53 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52083 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + +-- Jun 2, 2008 9:39:00 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52034,0,'C_CashBPartner_ID',TO_DATE('2008-06-02 21:39:00','YYYY-MM-DD HH24:MI:SS'),100,'BPartner to be used for Cash transactions','A','Y','Cash BPartner','Cash BPartner',TO_DATE('2008-06-02 21:39:00','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Jun 2, 2008 9:39:00 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52034 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) +; + +-- Jun 2, 2008 9:39:32 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52084,52034,0,18,173,52004,'C_CashBPartner_ID',TO_DATE('2008-06-02 21:39:32','YYYY-MM-DD HH24:MI:SS'),100,'BPartner to be used for Cash transactions','A',22,'Y','N','N','N','N','Y','N','N','N','N','Y','Cash BPartner',0,TO_DATE('2008-06-02 21:39:32','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Jun 2, 2008 9:39:32 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52084 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + +-- Jun 2, 2008 9:41:11 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52035,0,'Check_BankAccount_ID',TO_DATE('2008-06-02 21:41:11','YYYY-MM-DD HH24:MI:SS'),100,'Bank Account to be used for processing Check transactions','A','Y','Check Bank Account','Check Bank Account',TO_DATE('2008-06-02 21:41:11','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Jun 2, 2008 9:41:11 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52035 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) +; + +-- Jun 2, 2008 9:41:34 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52085,52035,0,18,52003,52004,'Check_BankAccount_ID',TO_DATE('2008-06-02 21:41:34','YYYY-MM-DD HH24:MI:SS'),100,'Bank Account to be used for processing Check transactions','A',22,'Y','N','N','N','N','N','N','N','N','N','Y','Check Bank Account',0,TO_DATE('2008-06-02 21:41:34','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Jun 2, 2008 9:41:34 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52085 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + +-- Jun 2, 2008 9:42:51 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52036,0,'CheckTransferBankAccount_ID',TO_DATE('2008-06-02 21:42:50','YYYY-MM-DD HH24:MI:SS'),100,'Bank account on which to transfer Check transactions','A','Y','Tranfer Check trx to','Transfer Check trx to',TO_DATE('2008-06-02 21:42:50','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Jun 2, 2008 9:42:51 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52036 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) +; + +-- Jun 2, 2008 9:43:16 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52086,52036,0,18,52003,52004,'CheckTransferBankAccount_ID',TO_DATE('2008-06-02 21:43:15','YYYY-MM-DD HH24:MI:SS'),100,'Bank account on which to transfer Check transactions','A',22,'Y','N','N','N','N','N','N','N','N','N','Y','Tranfer Check trx to',0,TO_DATE('2008-06-02 21:43:15','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Jun 2, 2008 9:43:16 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52086 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + +-- Jun 2, 2008 9:44:12 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52037,0,'CheckTransferType',TO_DATE('2008-06-02 21:44:12','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','Check Transfer Type','Check Transfer Type',TO_DATE('2008-06-02 21:44:12','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Jun 2, 2008 9:44:12 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52037 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) +; + +-- Jun 2, 2008 9:44:39 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52087,52037,0,17,52002,52004,'CheckTransferType',TO_DATE('2008-06-02 21:44:39','YYYY-MM-DD HH24:MI:SS'),100,'A',1,'Y','N','N','N','N','N','N','N','N','N','Y','Check Transfer Type',0,TO_DATE('2008-06-02 21:44:39','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Jun 2, 2008 9:44:39 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52087 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + +-- Jun 2, 2008 9:46:05 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52038,0,'Card_BankAccount_ID',TO_DATE('2008-06-02 21:46:05','YYYY-MM-DD HH24:MI:SS'),100,'Bank Account on which card transactions will be processed','A','Y','Card Bank Account','Card Bank Account',TO_DATE('2008-06-02 21:46:05','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Jun 2, 2008 9:46:05 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52038 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) +; + +-- Jun 2, 2008 9:46:28 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52088,52038,0,18,52003,52004,'Card_BankAccount_ID',TO_DATE('2008-06-02 21:46:28','YYYY-MM-DD HH24:MI:SS'),100,'Bank Account on which card transactions will be processed','A',22,'Y','N','N','N','N','N','N','N','N','N','Y','Card Bank Account',0,TO_DATE('2008-06-02 21:46:28','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Jun 2, 2008 9:46:28 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52088 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + +-- Jun 2, 2008 9:47:33 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52039,0,'CardTransferBankAccount_ID',TO_DATE('2008-06-02 21:47:33','YYYY-MM-DD HH24:MI:SS'),100,'Bank account on which to transfer Card transactions','A','Y','Transfer Card trx to','Transfer Card trx to',TO_DATE('2008-06-02 21:47:33','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Jun 2, 2008 9:47:33 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52039 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) +; + +-- Jun 2, 2008 9:47:59 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52089,52039,0,18,52003,52004,'CardTransferBankAccount_ID',TO_DATE('2008-06-02 21:47:59','YYYY-MM-DD HH24:MI:SS'),100,'Bank account on which to transfer Card transactions','A',22,'Y','N','N','N','N','N','N','N','N','N','Y','Transfer Card trx to',0,TO_DATE('2008-06-02 21:47:59','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Jun 2, 2008 9:47:59 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52089 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + +-- Jun 2, 2008 9:48:55 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52040,0,'CardTransferCashBook_ID',TO_DATE('2008-06-02 21:48:55','YYYY-MM-DD HH24:MI:SS'),100,'Cash Book on which to transfer all Card transactions','A','Y','Transfer Card trx to','Transfer Card trx to',TO_DATE('2008-06-02 21:48:55','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Jun 2, 2008 9:48:55 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52040 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) +; + +-- Jun 2, 2008 9:49:35 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52090,52040,0,18,52004,52004,'CardTransferCashBook_ID',TO_DATE('2008-06-02 21:49:35','YYYY-MM-DD HH24:MI:SS'),100,'Cash Book on which to transfer all Card transactions','A',22,'Y','N','N','N','N','N','N','N','N','N','Y','Transfer Card trx to',0,TO_DATE('2008-06-02 21:49:35','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Jun 2, 2008 9:49:35 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52090 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + +-- Jun 2, 2008 9:50:21 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52041,0,'CardTransferType',TO_DATE('2008-06-02 21:50:21','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','Card Transfer Type','Card Transfer Type',TO_DATE('2008-06-02 21:50:21','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Jun 2, 2008 9:50:21 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52041 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) +; + +-- Jun 2, 2008 9:50:40 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52091,52041,0,17,52002,52004,'CardTransferType',TO_DATE('2008-06-02 21:50:40','YYYY-MM-DD HH24:MI:SS'),100,'A',1,'Y','N','N','N','N','N','N','N','N','N','Y','Card Transfer Type',0,TO_DATE('2008-06-02 21:50:40','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Jun 2, 2008 9:50:40 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52091 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + +-- Jun 2, 2008 9:51:10 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52092,245,0,16,52004,'Created',TO_DATE('2008-06-02 21:51:10','YYYY-MM-DD HH24:MI:SS'),100,'Date this record was created','A',7,'The Created field indicates the date that this record was created.','Y','N','N','N','N','Y','N','N','N','N','N','Created',0,TO_DATE('2008-06-02 21:51:10','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Jun 2, 2008 9:51:10 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52092 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + +-- Jun 2, 2008 9:52:01 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52093,246,0,18,110,52004,'CreatedBy',TO_DATE('2008-06-02 21:52:01','YYYY-MM-DD HH24:MI:SS'),100,'User who created this records','A',22,'The Created By field indicates the user who created this record.','Y','N','N','N','N','Y','N','N','N','N','N','Created By',0,TO_DATE('2008-06-02 21:52:01','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Jun 2, 2008 9:52:01 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52093 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + +-- Jun 2, 2008 9:53:40 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52042,0,'C_TemplateBPartner_ID',TO_DATE('2008-06-02 21:53:39','YYYY-MM-DD HH24:MI:SS'),100,'BPartner that is to be used as template when new customers are created','A','Y','Template BPartner','Template BPartner',TO_DATE('2008-06-02 21:53:39','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Jun 2, 2008 9:53:40 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52042 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) +; + +-- Jun 2, 2008 9:54:16 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52094,52042,0,18,173,52004,'C_TemplateBPartner_ID',TO_DATE('2008-06-02 21:54:16','YYYY-MM-DD HH24:MI:SS'),100,'BPartner that is to be used as template when new customers are created','A',22,'Y','N','N','N','N','N','N','N','N','N','Y','Template BPartner',0,TO_DATE('2008-06-02 21:54:16','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Jun 2, 2008 9:54:16 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52094 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + +-- Jun 2, 2008 9:55:01 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52095,275,0,10,52004,'Description',TO_DATE('2008-06-02 21:55:01','YYYY-MM-DD HH24:MI:SS'),100,'Optional short description of the record','A',255,'A description is limited to 255 characters.','Y','N','N','N','N','N','N','N','N','N','Y','Description',0,TO_DATE('2008-06-02 21:55:01','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Jun 2, 2008 9:55:01 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52095 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + +-- Jun 2, 2008 9:55:37 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52096,326,0,14,52004,'Help',TO_DATE('2008-06-02 21:55:37','YYYY-MM-DD HH24:MI:SS'),100,'Comment or Hint','A',2000,'The Help field contains a hint, comment or help about the use of this item.','Y','N','N','N','N','N','N','N','N','N','Y','Comment/Help',0,TO_DATE('2008-06-02 21:55:37','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Jun 2, 2008 9:55:37 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52096 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + +-- Jun 2, 2008 9:56:03 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,DefaultValue,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52097,348,0,20,52004,'IsActive',TO_DATE('2008-06-02 21:56:02','YYYY-MM-DD HH24:MI:SS'),100,'Y','The record is active in the system','A',1,'There are two methods of making records unavailable in the system: One is to delete the record, the other is to de-activate the record. A de-activated record is not available for selection, but available for reports. +There are two reasons for de-activating and not deleting records: +(1) The system requires the record for audit purposes. +(2) The record is referenced by other records. E.g., you cannot delete a Business Partner, if there are invoices for this partner record existing. You de-activate the Business Partner and prevent that this record is used for future entries.','Y','N','N','N','N','N','N','N','N','N','Y','Active',0,TO_DATE('2008-06-02 21:56:02','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Jun 2, 2008 9:56:03 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52097 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + +-- Jun 2, 2008 9:56:55 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52043,0,'LastLockTime',TO_DATE('2008-06-02 21:56:55','YYYY-MM-DD HH24:MI:SS'),100,'Last time at which the terminal was locked','A','Y','Last Lock Time','Last Lock Time',TO_DATE('2008-06-02 21:56:55','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Jun 2, 2008 9:56:55 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52043 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) +; + +-- Jun 2, 2008 9:57:13 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52098,52043,0,16,52004,'LastLockTime',TO_DATE('2008-06-02 21:57:13','YYYY-MM-DD HH24:MI:SS'),100,'Last time at which the terminal was locked','A',7,'Y','N','N','N','N','N','N','N','N','N','Y','Last Lock Time',0,TO_DATE('2008-06-02 21:57:13','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Jun 2, 2008 9:57:13 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52098 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + +-- Jun 2, 2008 9:58:06 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52044,0,'Locked',TO_DATE('2008-06-02 21:58:06','YYYY-MM-DD HH24:MI:SS'),100,'Whether the terminal is locked','A','Y','Locked','Locked',TO_DATE('2008-06-02 21:58:06','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Jun 2, 2008 9:58:06 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52044 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) +; + +-- Jun 2, 2008 9:58:26 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,DefaultValue,Description,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52099,52044,0,20,52004,'Locked',TO_DATE('2008-06-02 21:58:26','YYYY-MM-DD HH24:MI:SS'),100,'N','Whether the terminal is locked','A',1,'Y','N','N','N','N','N','N','N','N','N','Y','Locked',0,TO_DATE('2008-06-02 21:58:26','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Jun 2, 2008 9:58:26 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52099 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + +-- Jun 2, 2008 9:59:13 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52045,0,'LockTime',TO_DATE('2008-06-02 21:59:13','YYYY-MM-DD HH24:MI:SS'),100,'Time in minutes the terminal should be kept in a locked state.','A','Y','Lock Time','Lock Time',TO_DATE('2008-06-02 21:59:13','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Jun 2, 2008 9:59:13 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52045 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) +; + +-- Jun 2, 2008 9:59:40 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,ValueMin,Version) VALUES (0,52100,52045,0,11,52004,'LockTime',TO_DATE('2008-06-02 21:59:40','YYYY-MM-DD HH24:MI:SS'),100,'Time in minutes the terminal should be kept in a locked state.','A',10,'Y','N','N','N','N','N','N','N','N','N','Y','Lock Time',0,TO_DATE('2008-06-02 21:59:40','YYYY-MM-DD HH24:MI:SS'),100,'0',0) +; + +-- Jun 2, 2008 9:59:40 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52100 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + +-- Jun 2, 2008 10:00:25 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52101,459,0,19,52004,'M_Warehouse_ID',TO_DATE('2008-06-02 22:00:24','YYYY-MM-DD HH24:MI:SS'),100,'Storage Warehouse and Service Point','A',22,'The Warehouse identifies a unique Warehouse where products are stored or Services are provided.','Y','N','N','N','N','N','N','N','N','N','Y','Warehouse',0,TO_DATE('2008-06-02 22:00:24','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Jun 2, 2008 10:00:25 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52101 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + +-- Jun 2, 2008 10:00:44 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52102,469,0,10,52004,'Name',TO_DATE('2008-06-02 22:00:44','YYYY-MM-DD HH24:MI:SS'),100,'Alphanumeric identifier of the entity','A',60,'The name of an entity (record) is used as an default search option in addition to the search key. The name is up to 60 characters in length.','Y','N','N','N','N','N','N','N','N','N','Y','Name',0,TO_DATE('2008-06-02 22:00:44','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Jun 2, 2008 10:00:44 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52102 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + +-- Jun 2, 2008 10:02:07 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52103,480,0,18,166,52004,'PO_PriceList_ID',TO_DATE('2008-06-02 22:02:07','YYYY-MM-DD HH24:MI:SS'),100,'Price List used by this Business Partner','A',22,'Identifies the price list used by a Vendor for products purchased by this organization.','Y','N','N','N','N','N','N','N','N','N','Y','Purchase Pricelist',0,TO_DATE('2008-06-02 22:02:07','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Jun 2, 2008 10:02:07 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52103 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + +-- Jun 2, 2008 10:02:37 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52104,2051,0,10,52004,'PrinterName',TO_DATE('2008-06-02 22:02:37','YYYY-MM-DD HH24:MI:SS'),100,'Name of the Printer','A',60,'Internal (Opereating System) Name of the Printer; Please mote that the printer name may be different on different clients. Enter a printer name, which applies to ALL clients (e.g. printer on a server).

+If none is entered, the default printer is used. You specify your default printer when you log in. You can also change the default printer in Preferences.','Y','N','N','N','N','N','N','N','N','N','Y','Printer Name',0,TO_DATE('2008-06-02 22:02:37','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Jun 2, 2008 10:02:37 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52104 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + +-- Jun 2, 2008 10:03:16 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52105,1063,0,18,316,52004,'SalesRep_ID',TO_DATE('2008-06-02 22:03:16','YYYY-MM-DD HH24:MI:SS'),100,'Sales Representative or Company Agent','A',22,'The Sales Representative indicates the Sales Rep for this Region. Any Sales Rep must be a valid internal user.','Y','N','N','N','N','N','N','N','N','N','Y','Sales Representative',0,TO_DATE('2008-06-02 22:03:16','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Jun 2, 2008 10:03:16 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52105 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + +-- Jun 2, 2008 10:04:15 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52046,0,'SO_PriceList_ID',TO_DATE('2008-06-02 22:04:15','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','Sales Pricelist','Sales Pricelist',TO_DATE('2008-06-02 22:04:15','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Jun 2, 2008 10:04:15 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52046 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) +; + +-- Jun 2, 2008 10:04:46 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52106,52046,0,18,166,52004,'SO_PriceList_ID',TO_DATE('2008-06-02 22:04:46','YYYY-MM-DD HH24:MI:SS'),100,'A',22,'Y','N','N','N','N','N','N','N','N','N','Y','Sales Pricelist',0,TO_DATE('2008-06-02 22:04:46','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Jun 2, 2008 10:04:46 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52106 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + +-- Jun 2, 2008 10:05:16 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52047,0,'UnlockingTime',TO_DATE('2008-06-02 22:05:16','YYYY-MM-DD HH24:MI:SS'),100,'Time at which the terminal should be unlocked','A','Y','UnlockingTime','UnlockingTime',TO_DATE('2008-06-02 22:05:16','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Jun 2, 2008 10:05:16 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52047 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) +; + +-- Jun 2, 2008 10:05:34 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52107,52047,0,16,52004,'UnlockingTime',TO_DATE('2008-06-02 22:05:34','YYYY-MM-DD HH24:MI:SS'),100,'Time at which the terminal should be unlocked','A',7,'Y','N','N','N','N','N','N','N','N','N','Y','UnlockingTime',0,TO_DATE('2008-06-02 22:05:34','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Jun 2, 2008 10:05:34 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52107 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + +-- Jun 2, 2008 10:05:58 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52108,607,0,16,52004,'Updated',TO_DATE('2008-06-02 22:05:58','YYYY-MM-DD HH24:MI:SS'),100,'Date this record was updated','A',7,'The Updated field indicates the date that this record was updated.','Y','N','N','N','N','Y','N','N','N','N','N','Updated',0,TO_DATE('2008-06-02 22:05:58','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Jun 2, 2008 10:05:58 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52108 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + +-- Jun 2, 2008 10:06:30 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52109,608,0,18,110,52004,'UpdatedBy',TO_DATE('2008-06-02 22:06:30','YYYY-MM-DD HH24:MI:SS'),100,'User who updated this records','A',22,'The Updated By field indicates the user who updated this record.','Y','N','N','N','N','N','N','N','N','N','Y','Updated By',0,TO_DATE('2008-06-02 22:06:30','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Jun 2, 2008 10:06:30 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52109 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + +-- Jun 2, 2008 10:29:01 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52048,0,'U_POSTerminal_ID',TO_DATE('2008-06-02 22:29:01','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','POS Terminal','POS Terminal',TO_DATE('2008-06-02 22:29:01','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Jun 2, 2008 10:29:01 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52048 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) +; + +-- Jun 2, 2008 10:29:54 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52110,52048,0,13,52004,'U_POSTerminal_ID',TO_DATE('2008-06-02 22:29:54','YYYY-MM-DD HH24:MI:SS'),100,'A',22,'Y','N','N','N','Y','Y','N','N','N','N','N','POS Terminal',0,TO_DATE('2008-06-02 22:29:54','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Jun 2, 2008 10:29:54 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52110 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + +-- Jun 2, 2008 10:48:55 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52049,0,'CheckTransferCashBook_ID',TO_DATE('2008-06-02 22:48:55','YYYY-MM-DD HH24:MI:SS'),100,'Cash Book on which to transfer all Check transactions','A','Y','Transfer Check trx to','Transfer Check trx to',TO_DATE('2008-06-02 22:48:55','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Jun 2, 2008 10:48:55 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52049 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) +; + +-- Jun 2, 2008 10:49:35 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52111,52049,0,18,52004,52004,'CheckTransferCashBook_ID',TO_DATE('2008-06-02 22:49:35','YYYY-MM-DD HH24:MI:SS'),100,'Cash Book on which to transfer all Check transactions','A',22,'Y','N','N','N','N','N','N','N','N','N','Y','Transfer Check trx to',0,TO_DATE('2008-06-02 22:49:35','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Jun 2, 2008 10:49:35 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52111 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + +-- Jun 3, 2008 2:27:59 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Sequence (AD_Client_ID,AD_Org_ID,AD_Sequence_ID,Created,CreatedBy,CurrentNext,CurrentNextSys,Description,IncrementNo,IsActive,IsAudited,IsAutoSequence,IsTableID,Name,StartNewYear,StartNo,Updated,UpdatedBy) VALUES (0,0,52006,TO_DATE('2008-06-03 14:27:59','YYYY-MM-DD HH24:MI:SS'),100,1000000,100,'Table U_POSTerminal',1,'Y','N','Y','Y','U_POSTerminal','N',1000000,TO_DATE('2008-06-03 14:27:59','YYYY-MM-DD HH24:MI:SS'),100) +; \ No newline at end of file diff --git a/posterita/commons/Migration/1.7.0/oracle/003_Terminals_TransferConfiguration.sql b/posterita/commons/Migration/1.7.0/oracle/003_Terminals_TransferConfiguration.sql new file mode 100644 index 0000000000..79f6330932 --- /dev/null +++ b/posterita/commons/Migration/1.7.0/oracle/003_Terminals_TransferConfiguration.sql @@ -0,0 +1,75 @@ +ALTER TABLE AD_OrgInfo ADD TransferBank_ID NUMBER(10); +ALTER TABLE AD_OrgInfo ADD TransferCashBook_ID NUMBER(10); + +ALTER TABLE AD_OrgInfo + ADD CONSTRAINT "cbank_adorginfo" + FOREIGN KEY(TransferBank_ID) + REFERENCES C_Bank(C_Bank_ID); + + +ALTER TABLE AD_OrgInfo + ADD CONSTRAINT "ccashbook_adorginfo" + FOREIGN KEY(TransferCashBook_ID) + REFERENCES C_CashBook(C_CashBook_ID); + + + + +-- May 26, 2008 23:25:51 AM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52028,0,'TransferBank_ID',TO_DATE('2008-05-26 23:25:50','YYYY-MM-DD HH24:MI:SS'),100,'Bank account depending on currency will be used from this bank for doing transfers','D','Y','Bank for transfers','Bank for transfers',TO_DATE('2008-05-26 23:25:50','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- May 26, 2008 23:25:51 AM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52028 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) +; + +-- May 26, 2008 23:26:38 AM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Reference (AD_Client_ID,AD_Org_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,ValidationType) VALUES (0,0,52001,TO_DATE('2008-05-26 23:26:38','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','C_Bank',TO_DATE('2008-05-26 23:26:38','YYYY-MM-DD HH24:MI:SS'),100,'T') +; + +-- May 26, 2008 23:26:38 AM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Reference_Trl (AD_Language,AD_Reference_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Reference_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Reference t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Reference_ID=52001 AND EXISTS (SELECT * FROM AD_Reference_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Reference_ID!=t.AD_Reference_ID) +; + +-- May 26, 2008 23:28:08 AM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Ref_Table (AD_Client_ID,AD_Display,AD_Key,AD_Org_ID,AD_Reference_ID,AD_Table_ID,Created,CreatedBy,EntityType,IsActive,IsValueDisplayed,Updated,UpdatedBy,WhereClause) VALUES (0,3039,3031,0,52001,296,TO_DATE('2008-05-26 23:28:08','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','N',TO_DATE('2008-05-26 23:28:08','YYYY-MM-DD HH24:MI:SS'),100,'C_Bank.IsOwnBank=''Y''') +; + +-- May 26, 2008 23:28:33 AM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52075,52028,0,18,52001,228,'TransferBank_ID',TO_DATE('2008-05-26 23:28:33','YYYY-MM-DD HH24:MI:SS'),100,'Bank account depending on currency will be used from this bank for doing transfers','D',22,'Y','N','N','N','N','N','N','N','N','N','Y','Bank for transfers',0,TO_DATE('2008-05-26 23:28:33','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- May 26, 2008 23:28:33 AM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52075 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + + + +-- Cash Book + +-- May 26, 2008 23:29:40 AM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52029,0,'TransferCashBook_ID',TO_DATE('2008-05-23 23:29:40','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','CashBook for transfers','CashBook for transfers',TO_DATE('2008-05-23 23:29:40','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- May 26, 2008 23:29:40 AM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52029 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) +; + +-- May 26, 2008 23:30:32 AM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52076,52029,0,18,52004,228,'TransferCashBook_ID',TO_DATE('2008-05-23 23:30:31','YYYY-MM-DD HH24:MI:SS'),100,'D',22,'Y','N','N','N','N','N','N','N','N','N','Y','CashBook for transfers',0,TO_DATE('2008-05-23 23:30:31','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- May 26, 2008 23:30:32 AM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52076 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; diff --git a/posterita/commons/Migration/1.7.0/oracle/004_Terminals_newTableDDL.sql b/posterita/commons/Migration/1.7.0/oracle/004_Terminals_newTableDDL.sql new file mode 100644 index 0000000000..61e4efab46 --- /dev/null +++ b/posterita/commons/Migration/1.7.0/oracle/004_Terminals_newTableDDL.sql @@ -0,0 +1,4 @@ +-- Jun 2, 2008 23:58:02 AM GMT+04:00 +-- Default comment for updating dictionary +CREATE TABLE U_POSTerminal (AD_Client_ID NUMBER(10) DEFAULT NULL NOT NULL, AD_Org_ID NUMBER(10) DEFAULT NULL NOT NULL, AutoLock CHAR(1) DEFAULT 'N' CHECK (AutoLock IN ('Y','N')) NOT NULL, Card_BankAccount_ID NUMBER(10), CardTransferBankAccount_ID NUMBER(10), CardTransferCashBook_ID NUMBER(10), CardTransferType CHAR(1), CashBookTransferType CHAR(1) NOT NULL, CashTransferBankAccount_ID NUMBER(10), CashTransferCashBook_ID NUMBER(10), C_CashBook_ID NUMBER(10) NOT NULL, C_CashBPartner_ID NUMBER(10) NOT NULL, Check_BankAccount_ID NUMBER(10), CheckTransferBankAccount_ID NUMBER(10), CheckTransferCashBook_ID NUMBER(10), CheckTransferType CHAR(1), Created DATE NOT NULL, CreatedBy NUMBER(10) NOT NULL, C_TemplateBPartner_ID NUMBER(10), Description NVARCHAR2(255), Help NVARCHAR2(2000), IsActive CHAR(1) DEFAULT 'Y' CHECK (IsActive IN ('Y','N')), LastLockTime DATE, Locked CHAR(1) DEFAULT 'N' CHECK (Locked IN ('Y','N')), LockTime NUMBER(10), M_Warehouse_ID NUMBER(10), Name NVARCHAR2(60), PO_PriceList_ID NUMBER(10), PrinterName NVARCHAR2(60), SalesRep_ID NUMBER(10), SO_PriceList_ID NUMBER(10), UnlockingTime DATE, Updated DATE NOT NULL, UpdatedBy NUMBER(10), U_POSTerminal_ID NUMBER(10) NOT NULL, CONSTRAINT U_POSTerminal_Key PRIMARY KEY (U_POSTerminal_ID)) +; \ No newline at end of file diff --git a/posterita/commons/Migration/1.7.0/oracle/005_Messages.sql b/posterita/commons/Migration/1.7.0/oracle/005_Messages.sql new file mode 100644 index 0000000000..3f4c27d750 --- /dev/null +++ b/posterita/commons/Migration/1.7.0/oracle/005_Messages.sql @@ -0,0 +1,190 @@ +-- Jun 9, 2008 1:24:35 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,52452,0,TO_DATE('2008-06-09 13:24:35','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','Organisation','I',TO_DATE('2008-06-09 13:24:35','YYYY-MM-DD HH24:MI:SS'),100,'smenu.organisation') +; + +-- Jun 9, 2008 1:25:48 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,52453,0,TO_DATE('2008-06-09 13:25:48','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','Terminals','I',TO_DATE('2008-06-09 13:25:48','YYYY-MM-DD HH24:MI:SS'),100,'smenu.terminal') +; + +-- Jun 9, 2008 1:26:06 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,52454,0,TO_DATE('2008-06-09 13:26:06','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','Cash Books','I',TO_DATE('2008-06-09 13:26:06','YYYY-MM-DD HH24:MI:SS'),100,'smenu.cashbook') +; + +-- Jun 9, 2008 1:26:30 PM GMT+04:00 +-- Default comment for updating dictionary +UPDATE AD_Message SET MsgTip='Maintain POS Terminals',Updated=TO_DATE('2008-06-09 13:26:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Message_ID=52453 +; + +-- Jun 9, 2008 1:26:39 PM GMT+04:00 +-- Default comment for updating dictionary +UPDATE AD_Message SET MsgTip='Maintain Cash Books',Updated=TO_DATE('2008-06-09 13:26:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Message_ID=52454 +; + +-- Jun 9, 2008 1:27:15 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,52455,0,TO_DATE('2008-06-09 13:27:15','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','Completed','I',TO_DATE('2008-06-09 13:27:15','YYYY-MM-DD HH24:MI:SS'),100,'document.status.completed') +; + +-- Jun 9, 2008 1:28:05 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,52456,0,TO_DATE('2008-06-09 13:28:04','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','Drafted','I',TO_DATE('2008-06-09 13:28:04','YYYY-MM-DD HH24:MI:SS'),100,'document.status.drafted') +; + +-- Jun 9, 2008 1:28:27 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,52457,0,TO_DATE('2008-06-09 13:28:27','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','In Progress','I',TO_DATE('2008-06-09 13:28:27','YYYY-MM-DD HH24:MI:SS'),100,'document.status.inprogress') +; + +-- Jun 9, 2008 1:28:44 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,52458,0,TO_DATE('2008-06-09 13:28:44','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','Invalid','I',TO_DATE('2008-06-09 13:28:44','YYYY-MM-DD HH24:MI:SS'),100,'document.status.invalid') +; + +-- Jun 9, 2008 1:28:58 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,52459,0,TO_DATE('2008-06-09 13:28:58','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','Closed','I',TO_DATE('2008-06-09 13:28:58','YYYY-MM-DD HH24:MI:SS'),100,'document.status.closed') +; + +-- Jun 9, 2008 1:29:15 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,52460,0,TO_DATE('2008-06-09 13:29:15','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','Cash','I',TO_DATE('2008-06-09 13:29:15','YYYY-MM-DD HH24:MI:SS'),100,'payment.rule.cash') +; + +-- Jun 9, 2008 1:29:27 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,52461,0,TO_DATE('2008-06-09 13:29:27','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','Card','I',TO_DATE('2008-06-09 13:29:27','YYYY-MM-DD HH24:MI:SS'),100,'payment.rule.card') +; + +-- Jun 9, 2008 1:29:42 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,52462,0,TO_DATE('2008-06-09 13:29:41','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','Cheque','I',TO_DATE('2008-06-09 13:29:41','YYYY-MM-DD HH24:MI:SS'),100,'payment.rule.cheque') +; + +-- Jun 9, 2008 1:29:55 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,52463,0,TO_DATE('2008-06-09 13:29:55','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','Mixed','I',TO_DATE('2008-06-09 13:29:55','YYYY-MM-DD HH24:MI:SS'),100,'payment.rule.mixed') +; + +-- Jun 9, 2008 1:30:14 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,52464,0,TO_DATE('2008-06-09 13:30:13','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','Credit','I',TO_DATE('2008-06-09 13:30:13','YYYY-MM-DD HH24:MI:SS'),100,'payment.rule.credit') +; + +-- Jun 9, 2008 1:30:46 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,52465,0,TO_DATE('2008-06-09 13:30:46','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','Amount Paid','I',TO_DATE('2008-06-09 13:30:46','YYYY-MM-DD HH24:MI:SS'),100,'AmountPaid') +; + +--------------------------------------------------------------------------------------------------------------------------------------------------- + +INSERT INTO AD_MESSAGE +(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, +updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) +VALUES(52470 , 0, 0, 'Y', TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, +'html', 'HTML', ' ', 'I', 'D'); + +INSERT INTO AD_MESSAGE +(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, +updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) +VALUES(52471 , 0, 0, 'Y', TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, +'pdf', 'PDF', ' ', 'I', 'D'); + +INSERT INTO AD_MESSAGE +(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, +updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) +VALUES(52472 , 0, 0, 'Y', TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, +'csv', 'CSV', ' ', 'I', 'D'); + +INSERT INTO AD_MESSAGE +(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, +updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) +VALUES(52473 , 0, 0, 'Y', TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, +'smenu.sales.report', 'Sales Report', ' ', 'I', 'D'); + +INSERT INTO AD_MESSAGE +(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, +updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) +VALUES(52474 , 0, 0, 'Y', TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, +'smenu.best.selling.items', 'Best Selling Items', ' ', 'I', 'D'); + +INSERT INTO AD_MESSAGE +(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, +updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) +VALUES(52475 , 0, 0, 'Y', TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, +'smenu.stock.sales.report', 'Stock Sales Report', ' ', 'I', 'D'); + +INSERT INTO AD_MESSAGE +(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, +updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) +VALUES(52476 , 0, 0, 'Y', TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, +'smenu.transfer.stock', 'Stock Transfer', ' ', 'I', 'D'); + +INSERT INTO AD_MESSAGE +(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, +updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) +VALUES(52477 , 0, 0, 'Y', TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, +'smenu.inventory.move', 'Inventory Move', ' ', 'I', 'D'); + +INSERT INTO AD_MESSAGE +(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, +updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) +VALUES(52478 , 0, 0, 'Y', TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, +'smenu.move.confirmation', 'Move Confirmation', ' ', 'I', 'D'); + +INSERT INTO AD_MESSAGE +(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, +updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) +VALUES(52479 , 0, 0, 'Y', TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, +'smenu.barcode.printing', 'Barcode Printing', ' ', 'I', 'D'); + +INSERT INTO AD_MESSAGE +(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, +updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) +VALUES(52480 , 0, 0, 'Y', TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, +'basePriceList', 'Base Price List', ' ', 'I', 'D'); + +INSERT INTO AD_MESSAGE +(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, +updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) +VALUES(52481, 0, 0, 'Y', TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, +'isDeleteOldRecords', 'Delete Old Records', ' ', 'I', 'D'); + +INSERT INTO AD_MESSAGE +(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, +updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) +VALUES(52482, 0, 0, 'Y', TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, +'sales.price.list', 'Sales Price List', ' ', 'I', 'D'); + +INSERT INTO AD_MESSAGE +(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, +updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) +VALUES(52483, 0, 0, 'Y', TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, +'purchase.price.list', 'Purchase Price List', ' ', 'I', 'D'); + +INSERT INTO AD_MESSAGE +(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, +updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) +VALUES(52484, 0, 0, 'Y', TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, +'pos.terminal', 'Terminal', ' ', 'I', 'D'); + +INSERT INTO AD_MESSAGE +(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, +updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) +VALUES(52485, 0, 0, 'Y', TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, +'pos.version', 'Version', ' ', 'I', 'D'); + +INSERT INTO AD_MESSAGE +(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, +updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) +VALUES(52486, 0, 0, 'Y', TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, +'pmenu.new.reports', 'Reports', ' ', 'I', 'D'); + +INSERT INTO AD_MESSAGE +(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, +updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) +VALUES(52487, 0, 0, 'Y', TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, +'isCreatePriceList', 'Create Price List', ' ', 'I', 'D'); + diff --git a/posterita/commons/Migration/1.7.0/postgresql/001_MixedPayment.sql b/posterita/commons/Migration/1.7.0/postgresql/001_MixedPayment.sql new file mode 100644 index 0000000000..266516c722 --- /dev/null +++ b/posterita/commons/Migration/1.7.0/postgresql/001_MixedPayment.sql @@ -0,0 +1,24 @@ +-- May 22, 2008 10:57:07 AM GMT+04:00 +-- Create Mixed in the payment rules list +INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Reference_ID,AD_Ref_List_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value) VALUES (0,0,195,52000,TO_DATE('2008-05-22 10:55:30','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Mixed',TO_DATE('2008-05-22 10:55:30','YYYY-MM-DD HH24:MI:SS'),100,'M') +; + +-- May 22, 2008 10:57:11 AM GMT+04:00 +-- Update the translation +INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=52000 AND EXISTS (SELECT * FROM AD_Ref_List_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Ref_List_ID!=t.AD_Ref_List_ID) +; + +-- May 22, 2008 11:28:12 AM GMT+04:00 +-- Creates new Validation rule so that rich client does not get Mixed rule +INSERT INTO AD_Val_Rule (AD_Client_ID,AD_Org_ID,AD_Val_Rule_ID,Code,Created,CreatedBy,EntityType,IsActive,Name,Type,Updated,UpdatedBy) VALUES (0,0,52002,'AD_Ref_List.Value <> ''M''',TO_DATE('2008-05-22 11:28:12','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','All_Payment Rule - No mixed','S',TO_DATE('2008-05-22 11:28:12','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- May 22, 2008 11:30:02 AM GMT+04:00 +-- Updates all columns in AD where the payment rule list is used with the validation created earlier +UPDATE AD_Column SET AD_Val_Rule_ID=52002 WHERE AD_Reference_Value_ID=195 AND AD_Val_Rule_ID IS NULL +; + +-- May 22, 2008 11:31:15 AM GMT+04:00 +-- Updates all columns in AD where an existing validation rule exist and set it to ignore the Mixed rule +UPDATE AD_Val_Rule SET Code='AD_Ref_List.Value <> ''B'' AND AD_Ref_List.Value <> ''M''' WHERE AD_Val_Rule_ID=161 +; diff --git a/posterita/commons/Migration/1.7.0/postgresql/002_Terminals_newTableStructure.sql b/posterita/commons/Migration/1.7.0/postgresql/002_Terminals_newTableStructure.sql new file mode 100644 index 0000000000..0c4aaf8e63 --- /dev/null +++ b/posterita/commons/Migration/1.7.0/postgresql/002_Terminals_newTableStructure.sql @@ -0,0 +1,629 @@ +-- Jun 2, 2008 9:19:48 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Table (AccessLevel,AD_Client_ID,AD_Org_ID,AD_Table_ID,CopyColumnsFromTable,Created,CreatedBy,EntityType,ImportTable,IsActive,IsChangeLog,IsDeleteable,IsHighVolume,IsSecurityEnabled,IsView,LoadSeq,Name,ReplicationType,TableName,Updated,UpdatedBy) VALUES ('1',0,0,52004,'N',TO_DATE('2008-06-02 21:19:47','YYYY-MM-DD HH24:MI:SS'),100,'A','N','Y','N','Y','N','N','N',0,'POS Terminal','L','U_POSTerminal',TO_DATE('2008-06-02 21:19:47','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Jun 2, 2008 9:19:48 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Table_Trl (AD_Language,AD_Table_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Table_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Table t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Table_ID=52004 AND EXISTS (SELECT * FROM AD_Table_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Table_ID!=t.AD_Table_ID) +; + +-- Jun 2, 2008 9:21:23 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,AD_Val_Rule_ID,ColumnName,Created,CreatedBy,DefaultValue,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52077,102,0,19,52004,129,'AD_Client_ID',TO_DATE('2008-06-02 21:21:22','YYYY-MM-DD HH24:MI:SS'),100,'@#AD_Client_ID@','Client/Tenant for this installation.','A',22,'A Client is a company or a legal entity. You cannot share data between Clients. Tenant is a synonym for Client.','Y','N','N','N','N','Y','N','N','N','N','Y','Client',0,TO_DATE('2008-06-02 21:21:22','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Jun 2, 2008 9:21:23 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52077 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + +-- Jun 2, 2008 9:22:32 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,AD_Val_Rule_ID,ColumnName,Created,CreatedBy,DefaultValue,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52078,113,0,19,52004,130,'AD_Org_ID',TO_DATE('2008-06-02 21:22:32','YYYY-MM-DD HH24:MI:SS'),100,'@#AD_Org_ID@','Organizational entity within client','A',22,'An organization is a unit of your client or legal entity - examples are store, department. You can share data between organizations.','Y','N','N','N','N','Y','N','N','N','N','Y','Organization',0,TO_DATE('2008-06-02 21:22:32','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Jun 2, 2008 9:22:32 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52078 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + + +-- Jun 2, 2008 9:23:51 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52030,0,'AutoLock',TO_DATE('2008-06-02 21:23:51','YYYY-MM-DD HH24:MI:SS'),100,'Whether to automatically lock the terminal when till is closed','A','Y','Auto Lock','Auto Lock',TO_DATE('2008-06-02 21:23:51','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Jun 2, 2008 9:23:51 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52030 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) +; + +-- Jun 2, 2008 9:24:30 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,DefaultValue,Description,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52079,52030,0,20,52004,'AutoLock',TO_DATE('2008-06-02 21:24:30','YYYY-MM-DD HH24:MI:SS'),100,'N','Whether to automatically lock the terminal when till is closed','A',1,'Y','N','N','N','N','Y','N','N','N','N','Y','Auto Lock',0,TO_DATE('2008-06-02 21:24:30','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Jun 2, 2008 9:24:30 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52079 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + +-- Jun 2, 2008 9:26:51 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52031,0,'CashBookTransferType',TO_DATE('2008-06-02 21:26:51','YYYY-MM-DD HH24:MI:SS'),100,'Where the money in the cash book should be transfered to. Either a Bank Account or another Cash Book','A','Y','Cash Book Transfer Type','Cash Book Transfer Type',TO_DATE('2008-06-02 21:26:51','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Jun 2, 2008 9:26:51 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52031 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) +; + +-- Jun 2, 2008 9:29:14 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Reference (AD_Client_ID,AD_Org_ID,AD_Reference_ID,Created,CreatedBy,Description,EntityType,IsActive,Name,Updated,UpdatedBy,ValidationType) VALUES (0,0,52002,TO_DATE('2008-06-02 21:29:14','YYYY-MM-DD HH24:MI:SS'),100,'Where money should be transfered to','A','Y','_TransferType',TO_DATE('2008-06-02 21:29:14','YYYY-MM-DD HH24:MI:SS'),100,'L') +; + +-- Jun 2, 2008 9:29:14 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Reference_Trl (AD_Language,AD_Reference_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Reference_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Reference t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Reference_ID=52002 AND EXISTS (SELECT * FROM AD_Reference_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Reference_ID!=t.AD_Reference_ID) +; + +-- Jun 2, 2008 9:29:42 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Reference_ID,AD_Ref_List_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value) VALUES (0,0,52002,52001,TO_DATE('2008-06-02 21:29:42','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','Bank Account',TO_DATE('2008-06-02 21:29:42','YYYY-MM-DD HH24:MI:SS'),100,'B') +; + +-- Jun 2, 2008 9:29:42 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=52001 AND EXISTS (SELECT * FROM AD_Ref_List_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Ref_List_ID!=t.AD_Ref_List_ID) +; + +-- Jun 2, 2008 9:29:51 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Reference_ID,AD_Ref_List_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value) VALUES (0,0,52002,52002,TO_DATE('2008-06-02 21:29:51','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','CashBook',TO_DATE('2008-06-02 21:29:51','YYYY-MM-DD HH24:MI:SS'),100,'C') +; + +-- Jun 2, 2008 9:29:51 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=52002 AND EXISTS (SELECT * FROM AD_Ref_List_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Ref_List_ID!=t.AD_Ref_List_ID) +; + +-- Jun 2, 2008 9:30:13 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52080,52031,0,17,52002,52004,'CashBookTransferType',TO_DATE('2008-06-02 21:30:13','YYYY-MM-DD HH24:MI:SS'),100,'Where the money in the cash book should be transfered to. Either a Bank Account or another Cash Book','A',1,'Y','N','N','N','N','Y','N','N','N','N','Y','Cash Book Transfer Type',0,TO_DATE('2008-06-02 21:30:13','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Jun 2, 2008 9:30:13 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52080 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + +-- Jun 2, 2008 9:32:22 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52032,0,'CashTransferBankAccount_ID',TO_DATE('2008-06-02 21:32:22','YYYY-MM-DD HH24:MI:SS'),100,'Bank Account on which to transfer all Cash transactions','A','Y','Transfer Cash trx to','Transfer Cash trx to',TO_DATE('2008-06-02 21:32:22','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Jun 2, 2008 9:32:22 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52032 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) +; + +-- Jun 2, 2008 9:33:15 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Reference (AD_Client_ID,AD_Org_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,ValidationType) VALUES (0,0,52003,TO_DATE('2008-06-02 21:33:15','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','C_BankAccount',TO_DATE('2008-06-02 21:33:15','YYYY-MM-DD HH24:MI:SS'),100,'T') +; + +-- Jun 2, 2008 9:33:15 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Reference_Trl (AD_Language,AD_Reference_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Reference_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Reference t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Reference_ID=52003 AND EXISTS (SELECT * FROM AD_Reference_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Reference_ID!=t.AD_Reference_ID) +; + +-- Jun 2, 2008 9:33:52 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Ref_Table (AD_Client_ID,AD_Display,AD_Key,AD_Org_ID,AD_Reference_ID,AD_Table_ID,Created,CreatedBy,EntityType,IsActive,IsValueDisplayed,Updated,UpdatedBy,WhereClause) VALUES (0,3074,3077,0,52003,297,TO_DATE('2008-06-02 21:33:52','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','N',TO_DATE('2008-06-02 21:33:52','YYYY-MM-DD HH24:MI:SS'),100,'C_BankAccount.IsActive=''Y''') +; + +-- Jun 2, 2008 9:34:10 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52081,52032,0,18,52003,52004,'CashTransferBankAccount_ID',TO_DATE('2008-06-02 21:34:10','YYYY-MM-DD HH24:MI:SS'),100,'Bank Account on which to transfer all Cash transactions','A',22,'Y','N','N','N','N','N','N','N','N','N','Y','Transfer Cash trx to',0,TO_DATE('2008-06-02 21:34:10','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Jun 2, 2008 9:34:10 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52081 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + +-- Jun 2, 2008 9:35:28 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52033,0,'CashTransferCashBook_ID',TO_DATE('2008-06-02 21:35:28','YYYY-MM-DD HH24:MI:SS'),100,'Cash Book on which to transfer all Cash transactions','A','Y','Transfer Cash trx to','Transfer Cash trx to',TO_DATE('2008-06-02 21:35:28','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Jun 2, 2008 9:35:28 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52033 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) +; + +-- Jun 2, 2008 9:36:18 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Reference (AD_Client_ID,AD_Org_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,ValidationType) VALUES (0,0,52004,TO_DATE('2008-06-02 21:36:18','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','C_CashBook',TO_DATE('2008-06-02 21:36:18','YYYY-MM-DD HH24:MI:SS'),100,'T') +; + +-- Jun 2, 2008 9:36:18 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Reference_Trl (AD_Language,AD_Reference_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Reference_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Reference t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Reference_ID=52004 AND EXISTS (SELECT * FROM AD_Reference_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Reference_ID!=t.AD_Reference_ID) +; + +-- Jun 2, 2008 9:36:54 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Ref_Table (AD_Client_ID,AD_Display,AD_Key,AD_Org_ID,AD_Reference_ID,AD_Table_ID,Created,CreatedBy,EntityType,IsActive,IsValueDisplayed,Updated,UpdatedBy,WhereClause) VALUES (0,5268,5260,0,52004,408,TO_DATE('2008-06-02 21:36:54','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','N',TO_DATE('2008-06-02 21:36:54','YYYY-MM-DD HH24:MI:SS'),100,'C_CashBook.IsActive=''Y''') +; + +-- Jun 2, 2008 9:37:11 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52082,52033,0,18,52004,52004,'CashTransferCashBook_ID',TO_DATE('2008-06-02 21:37:11','YYYY-MM-DD HH24:MI:SS'),100,'Cash Book on which to transfer all Cash transactions','A',22,'Y','N','N','N','N','N','N','N','N','N','Y','Transfer Cash trx to',0,TO_DATE('2008-06-02 21:37:11','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Jun 2, 2008 9:37:11 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52082 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + +-- Jun 2, 2008 9:37:53 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52083,1463,0,19,52004,'C_CashBook_ID',TO_DATE('2008-06-02 21:37:53','YYYY-MM-DD HH24:MI:SS'),100,'Cash Book for recording petty cash transactions','A',22,'The Cash Book identifies a unique cash book. The cash book is used to record cash transactions.','Y','N','N','N','N','Y','N','N','N','N','Y','Cash Book',0,TO_DATE('2008-06-02 21:37:53','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Jun 2, 2008 9:37:53 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52083 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + +-- Jun 2, 2008 9:39:00 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52034,0,'C_CashBPartner_ID',TO_DATE('2008-06-02 21:39:00','YYYY-MM-DD HH24:MI:SS'),100,'BPartner to be used for Cash transactions','A','Y','Cash BPartner','Cash BPartner',TO_DATE('2008-06-02 21:39:00','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Jun 2, 2008 9:39:00 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52034 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) +; + +-- Jun 2, 2008 9:39:32 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52084,52034,0,18,173,52004,'C_CashBPartner_ID',TO_DATE('2008-06-02 21:39:32','YYYY-MM-DD HH24:MI:SS'),100,'BPartner to be used for Cash transactions','A',22,'Y','N','N','N','N','Y','N','N','N','N','Y','Cash BPartner',0,TO_DATE('2008-06-02 21:39:32','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Jun 2, 2008 9:39:32 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52084 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + +-- Jun 2, 2008 9:41:11 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52035,0,'Check_BankAccount_ID',TO_DATE('2008-06-02 21:41:11','YYYY-MM-DD HH24:MI:SS'),100,'Bank Account to be used for processing Check transactions','A','Y','Check Bank Account','Check Bank Account',TO_DATE('2008-06-02 21:41:11','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Jun 2, 2008 9:41:11 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52035 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) +; + +-- Jun 2, 2008 9:41:34 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52085,52035,0,18,52003,52004,'Check_BankAccount_ID',TO_DATE('2008-06-02 21:41:34','YYYY-MM-DD HH24:MI:SS'),100,'Bank Account to be used for processing Check transactions','A',22,'Y','N','N','N','N','N','N','N','N','N','Y','Check Bank Account',0,TO_DATE('2008-06-02 21:41:34','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Jun 2, 2008 9:41:34 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52085 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + +-- Jun 2, 2008 9:42:51 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52036,0,'CheckTransferBankAccount_ID',TO_DATE('2008-06-02 21:42:50','YYYY-MM-DD HH24:MI:SS'),100,'Bank account on which to transfer Check transactions','A','Y','Tranfer Check trx to','Transfer Check trx to',TO_DATE('2008-06-02 21:42:50','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Jun 2, 2008 9:42:51 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52036 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) +; + +-- Jun 2, 2008 9:43:16 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52086,52036,0,18,52003,52004,'CheckTransferBankAccount_ID',TO_DATE('2008-06-02 21:43:15','YYYY-MM-DD HH24:MI:SS'),100,'Bank account on which to transfer Check transactions','A',22,'Y','N','N','N','N','N','N','N','N','N','Y','Tranfer Check trx to',0,TO_DATE('2008-06-02 21:43:15','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Jun 2, 2008 9:43:16 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52086 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + +-- Jun 2, 2008 9:44:12 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52037,0,'CheckTransferType',TO_DATE('2008-06-02 21:44:12','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','Check Transfer Type','Check Transfer Type',TO_DATE('2008-06-02 21:44:12','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Jun 2, 2008 9:44:12 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52037 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) +; + +-- Jun 2, 2008 9:44:39 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52087,52037,0,17,52002,52004,'CheckTransferType',TO_DATE('2008-06-02 21:44:39','YYYY-MM-DD HH24:MI:SS'),100,'A',1,'Y','N','N','N','N','N','N','N','N','N','Y','Check Transfer Type',0,TO_DATE('2008-06-02 21:44:39','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Jun 2, 2008 9:44:39 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52087 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + +-- Jun 2, 2008 9:46:05 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52038,0,'Card_BankAccount_ID',TO_DATE('2008-06-02 21:46:05','YYYY-MM-DD HH24:MI:SS'),100,'Bank Account on which card transactions will be processed','A','Y','Card Bank Account','Card Bank Account',TO_DATE('2008-06-02 21:46:05','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Jun 2, 2008 9:46:05 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52038 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) +; + +-- Jun 2, 2008 9:46:28 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52088,52038,0,18,52003,52004,'Card_BankAccount_ID',TO_DATE('2008-06-02 21:46:28','YYYY-MM-DD HH24:MI:SS'),100,'Bank Account on which card transactions will be processed','A',22,'Y','N','N','N','N','N','N','N','N','N','Y','Card Bank Account',0,TO_DATE('2008-06-02 21:46:28','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Jun 2, 2008 9:46:28 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52088 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + +-- Jun 2, 2008 9:47:33 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52039,0,'CardTransferBankAccount_ID',TO_DATE('2008-06-02 21:47:33','YYYY-MM-DD HH24:MI:SS'),100,'Bank account on which to transfer Card transactions','A','Y','Transfer Card trx to','Transfer Card trx to',TO_DATE('2008-06-02 21:47:33','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Jun 2, 2008 9:47:33 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52039 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) +; + +-- Jun 2, 2008 9:47:59 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52089,52039,0,18,52003,52004,'CardTransferBankAccount_ID',TO_DATE('2008-06-02 21:47:59','YYYY-MM-DD HH24:MI:SS'),100,'Bank account on which to transfer Card transactions','A',22,'Y','N','N','N','N','N','N','N','N','N','Y','Transfer Card trx to',0,TO_DATE('2008-06-02 21:47:59','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Jun 2, 2008 9:47:59 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52089 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + +-- Jun 2, 2008 9:48:55 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52040,0,'CardTransferCashBook_ID',TO_DATE('2008-06-02 21:48:55','YYYY-MM-DD HH24:MI:SS'),100,'Cash Book on which to transfer all Card transactions','A','Y','Transfer Card trx to','Transfer Card trx to',TO_DATE('2008-06-02 21:48:55','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Jun 2, 2008 9:48:55 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52040 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) +; + +-- Jun 2, 2008 9:49:35 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52090,52040,0,18,52004,52004,'CardTransferCashBook_ID',TO_DATE('2008-06-02 21:49:35','YYYY-MM-DD HH24:MI:SS'),100,'Cash Book on which to transfer all Card transactions','A',22,'Y','N','N','N','N','N','N','N','N','N','Y','Transfer Card trx to',0,TO_DATE('2008-06-02 21:49:35','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Jun 2, 2008 9:49:35 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52090 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + +-- Jun 2, 2008 9:50:21 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52041,0,'CardTransferType',TO_DATE('2008-06-02 21:50:21','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','Card Transfer Type','Card Transfer Type',TO_DATE('2008-06-02 21:50:21','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Jun 2, 2008 9:50:21 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52041 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) +; + +-- Jun 2, 2008 9:50:40 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52091,52041,0,17,52002,52004,'CardTransferType',TO_DATE('2008-06-02 21:50:40','YYYY-MM-DD HH24:MI:SS'),100,'A',1,'Y','N','N','N','N','N','N','N','N','N','Y','Card Transfer Type',0,TO_DATE('2008-06-02 21:50:40','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Jun 2, 2008 9:50:40 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52091 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + +-- Jun 2, 2008 9:51:10 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52092,245,0,16,52004,'Created',TO_DATE('2008-06-02 21:51:10','YYYY-MM-DD HH24:MI:SS'),100,'Date this record was created','A',7,'The Created field indicates the date that this record was created.','Y','N','N','N','N','Y','N','N','N','N','N','Created',0,TO_DATE('2008-06-02 21:51:10','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Jun 2, 2008 9:51:10 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52092 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + +-- Jun 2, 2008 9:52:01 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52093,246,0,18,110,52004,'CreatedBy',TO_DATE('2008-06-02 21:52:01','YYYY-MM-DD HH24:MI:SS'),100,'User who created this records','A',22,'The Created By field indicates the user who created this record.','Y','N','N','N','N','Y','N','N','N','N','N','Created By',0,TO_DATE('2008-06-02 21:52:01','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Jun 2, 2008 9:52:01 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52093 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + +-- Jun 2, 2008 9:53:40 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52042,0,'C_TemplateBPartner_ID',TO_DATE('2008-06-02 21:53:39','YYYY-MM-DD HH24:MI:SS'),100,'BPartner that is to be used as template when new customers are created','A','Y','Template BPartner','Template BPartner',TO_DATE('2008-06-02 21:53:39','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Jun 2, 2008 9:53:40 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52042 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) +; + +-- Jun 2, 2008 9:54:16 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52094,52042,0,18,173,52004,'C_TemplateBPartner_ID',TO_DATE('2008-06-02 21:54:16','YYYY-MM-DD HH24:MI:SS'),100,'BPartner that is to be used as template when new customers are created','A',22,'Y','N','N','N','N','N','N','N','N','N','Y','Template BPartner',0,TO_DATE('2008-06-02 21:54:16','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Jun 2, 2008 9:54:16 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52094 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + +-- Jun 2, 2008 9:55:01 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52095,275,0,10,52004,'Description',TO_DATE('2008-06-02 21:55:01','YYYY-MM-DD HH24:MI:SS'),100,'Optional short description of the record','A',255,'A description is limited to 255 characters.','Y','N','N','N','N','N','N','N','N','N','Y','Description',0,TO_DATE('2008-06-02 21:55:01','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Jun 2, 2008 9:55:01 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52095 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + +-- Jun 2, 2008 9:55:37 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52096,326,0,14,52004,'Help',TO_DATE('2008-06-02 21:55:37','YYYY-MM-DD HH24:MI:SS'),100,'Comment or Hint','A',2000,'The Help field contains a hint, comment or help about the use of this item.','Y','N','N','N','N','N','N','N','N','N','Y','Comment/Help',0,TO_DATE('2008-06-02 21:55:37','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Jun 2, 2008 9:55:37 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52096 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + +-- Jun 2, 2008 9:56:03 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,DefaultValue,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52097,348,0,20,52004,'IsActive',TO_DATE('2008-06-02 21:56:02','YYYY-MM-DD HH24:MI:SS'),100,'Y','The record is active in the system','A',1,'There are two methods of making records unavailable in the system: One is to delete the record, the other is to de-activate the record. A de-activated record is not available for selection, but available for reports. +There are two reasons for de-activating and not deleting records: +(1) The system requires the record for audit purposes. +(2) The record is referenced by other records. E.g., you cannot delete a Business Partner, if there are invoices for this partner record existing. You de-activate the Business Partner and prevent that this record is used for future entries.','Y','N','N','N','N','N','N','N','N','N','Y','Active',0,TO_DATE('2008-06-02 21:56:02','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Jun 2, 2008 9:56:03 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52097 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + +-- Jun 2, 2008 9:56:55 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52043,0,'LastLockTime',TO_DATE('2008-06-02 21:56:55','YYYY-MM-DD HH24:MI:SS'),100,'Last time at which the terminal was locked','A','Y','Last Lock Time','Last Lock Time',TO_DATE('2008-06-02 21:56:55','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Jun 2, 2008 9:56:55 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52043 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) +; + +-- Jun 2, 2008 9:57:13 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52098,52043,0,16,52004,'LastLockTime',TO_DATE('2008-06-02 21:57:13','YYYY-MM-DD HH24:MI:SS'),100,'Last time at which the terminal was locked','A',7,'Y','N','N','N','N','N','N','N','N','N','Y','Last Lock Time',0,TO_DATE('2008-06-02 21:57:13','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Jun 2, 2008 9:57:13 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52098 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + +-- Jun 2, 2008 9:58:06 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52044,0,'Locked',TO_DATE('2008-06-02 21:58:06','YYYY-MM-DD HH24:MI:SS'),100,'Whether the terminal is locked','A','Y','Locked','Locked',TO_DATE('2008-06-02 21:58:06','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Jun 2, 2008 9:58:06 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52044 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) +; + +-- Jun 2, 2008 9:58:26 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,DefaultValue,Description,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52099,52044,0,20,52004,'Locked',TO_DATE('2008-06-02 21:58:26','YYYY-MM-DD HH24:MI:SS'),100,'N','Whether the terminal is locked','A',1,'Y','N','N','N','N','N','N','N','N','N','Y','Locked',0,TO_DATE('2008-06-02 21:58:26','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Jun 2, 2008 9:58:26 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52099 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + +-- Jun 2, 2008 9:59:13 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52045,0,'LockTime',TO_DATE('2008-06-02 21:59:13','YYYY-MM-DD HH24:MI:SS'),100,'Time in minutes the terminal should be kept in a locked state.','A','Y','Lock Time','Lock Time',TO_DATE('2008-06-02 21:59:13','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Jun 2, 2008 9:59:13 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52045 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) +; + +-- Jun 2, 2008 9:59:40 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,ValueMin,Version) VALUES (0,52100,52045,0,11,52004,'LockTime',TO_DATE('2008-06-02 21:59:40','YYYY-MM-DD HH24:MI:SS'),100,'Time in minutes the terminal should be kept in a locked state.','A',10,'Y','N','N','N','N','N','N','N','N','N','Y','Lock Time',0,TO_DATE('2008-06-02 21:59:40','YYYY-MM-DD HH24:MI:SS'),100,'0',0) +; + +-- Jun 2, 2008 9:59:40 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52100 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + +-- Jun 2, 2008 10:00:25 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52101,459,0,19,52004,'M_Warehouse_ID',TO_DATE('2008-06-02 22:00:24','YYYY-MM-DD HH24:MI:SS'),100,'Storage Warehouse and Service Point','A',22,'The Warehouse identifies a unique Warehouse where products are stored or Services are provided.','Y','N','N','N','N','N','N','N','N','N','Y','Warehouse',0,TO_DATE('2008-06-02 22:00:24','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Jun 2, 2008 10:00:25 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52101 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + +-- Jun 2, 2008 10:00:44 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52102,469,0,10,52004,'Name',TO_DATE('2008-06-02 22:00:44','YYYY-MM-DD HH24:MI:SS'),100,'Alphanumeric identifier of the entity','A',60,'The name of an entity (record) is used as an default search option in addition to the search key. The name is up to 60 characters in length.','Y','N','N','N','N','N','N','N','N','N','Y','Name',0,TO_DATE('2008-06-02 22:00:44','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Jun 2, 2008 10:00:44 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52102 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + +-- Jun 2, 2008 10:02:07 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52103,480,0,18,166,52004,'PO_PriceList_ID',TO_DATE('2008-06-02 22:02:07','YYYY-MM-DD HH24:MI:SS'),100,'Price List used by this Business Partner','A',22,'Identifies the price list used by a Vendor for products purchased by this organization.','Y','N','N','N','N','N','N','N','N','N','Y','Purchase Pricelist',0,TO_DATE('2008-06-02 22:02:07','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Jun 2, 2008 10:02:07 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52103 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + +-- Jun 2, 2008 10:02:37 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52104,2051,0,10,52004,'PrinterName',TO_DATE('2008-06-02 22:02:37','YYYY-MM-DD HH24:MI:SS'),100,'Name of the Printer','A',60,'Internal (Opereating System) Name of the Printer; Please mote that the printer name may be different on different clients. Enter a printer name, which applies to ALL clients (e.g. printer on a server).

+If none is entered, the default printer is used. You specify your default printer when you log in. You can also change the default printer in Preferences.','Y','N','N','N','N','N','N','N','N','N','Y','Printer Name',0,TO_DATE('2008-06-02 22:02:37','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Jun 2, 2008 10:02:37 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52104 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + +-- Jun 2, 2008 10:03:16 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52105,1063,0,18,316,52004,'SalesRep_ID',TO_DATE('2008-06-02 22:03:16','YYYY-MM-DD HH24:MI:SS'),100,'Sales Representative or Company Agent','A',22,'The Sales Representative indicates the Sales Rep for this Region. Any Sales Rep must be a valid internal user.','Y','N','N','N','N','N','N','N','N','N','Y','Sales Representative',0,TO_DATE('2008-06-02 22:03:16','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Jun 2, 2008 10:03:16 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52105 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + +-- Jun 2, 2008 10:04:15 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52046,0,'SO_PriceList_ID',TO_DATE('2008-06-02 22:04:15','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','Sales Pricelist','Sales Pricelist',TO_DATE('2008-06-02 22:04:15','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Jun 2, 2008 10:04:15 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52046 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) +; + +-- Jun 2, 2008 10:04:46 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52106,52046,0,18,166,52004,'SO_PriceList_ID',TO_DATE('2008-06-02 22:04:46','YYYY-MM-DD HH24:MI:SS'),100,'A',22,'Y','N','N','N','N','N','N','N','N','N','Y','Sales Pricelist',0,TO_DATE('2008-06-02 22:04:46','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Jun 2, 2008 10:04:46 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52106 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + +-- Jun 2, 2008 10:05:16 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52047,0,'UnlockingTime',TO_DATE('2008-06-02 22:05:16','YYYY-MM-DD HH24:MI:SS'),100,'Time at which the terminal should be unlocked','A','Y','UnlockingTime','UnlockingTime',TO_DATE('2008-06-02 22:05:16','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Jun 2, 2008 10:05:16 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52047 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) +; + +-- Jun 2, 2008 10:05:34 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52107,52047,0,16,52004,'UnlockingTime',TO_DATE('2008-06-02 22:05:34','YYYY-MM-DD HH24:MI:SS'),100,'Time at which the terminal should be unlocked','A',7,'Y','N','N','N','N','N','N','N','N','N','Y','UnlockingTime',0,TO_DATE('2008-06-02 22:05:34','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Jun 2, 2008 10:05:34 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52107 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + +-- Jun 2, 2008 10:05:58 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52108,607,0,16,52004,'Updated',TO_DATE('2008-06-02 22:05:58','YYYY-MM-DD HH24:MI:SS'),100,'Date this record was updated','A',7,'The Updated field indicates the date that this record was updated.','Y','N','N','N','N','Y','N','N','N','N','N','Updated',0,TO_DATE('2008-06-02 22:05:58','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Jun 2, 2008 10:05:58 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52108 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + +-- Jun 2, 2008 10:06:30 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52109,608,0,18,110,52004,'UpdatedBy',TO_DATE('2008-06-02 22:06:30','YYYY-MM-DD HH24:MI:SS'),100,'User who updated this records','A',22,'The Updated By field indicates the user who updated this record.','Y','N','N','N','N','N','N','N','N','N','Y','Updated By',0,TO_DATE('2008-06-02 22:06:30','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Jun 2, 2008 10:06:30 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52109 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + +-- Jun 2, 2008 10:29:01 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52048,0,'U_POSTerminal_ID',TO_DATE('2008-06-02 22:29:01','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','POS Terminal','POS Terminal',TO_DATE('2008-06-02 22:29:01','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Jun 2, 2008 10:29:01 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52048 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) +; + +-- Jun 2, 2008 10:29:54 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52110,52048,0,13,52004,'U_POSTerminal_ID',TO_DATE('2008-06-02 22:29:54','YYYY-MM-DD HH24:MI:SS'),100,'A',22,'Y','N','N','N','Y','Y','N','N','N','N','N','POS Terminal',0,TO_DATE('2008-06-02 22:29:54','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Jun 2, 2008 10:29:54 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52110 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + +-- Jun 2, 2008 10:48:55 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52049,0,'CheckTransferCashBook_ID',TO_DATE('2008-06-02 22:48:55','YYYY-MM-DD HH24:MI:SS'),100,'Cash Book on which to transfer all Check transactions','A','Y','Transfer Check trx to','Transfer Check trx to',TO_DATE('2008-06-02 22:48:55','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Jun 2, 2008 10:48:55 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52049 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) +; + +-- Jun 2, 2008 10:49:35 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52111,52049,0,18,52004,52004,'CheckTransferCashBook_ID',TO_DATE('2008-06-02 22:49:35','YYYY-MM-DD HH24:MI:SS'),100,'Cash Book on which to transfer all Check transactions','A',22,'Y','N','N','N','N','N','N','N','N','N','Y','Transfer Check trx to',0,TO_DATE('2008-06-02 22:49:35','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- Jun 2, 2008 10:49:35 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52111 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + +-- Jun 3, 2008 2:27:59 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Sequence (AD_Client_ID,AD_Org_ID,AD_Sequence_ID,Created,CreatedBy,CurrentNext,CurrentNextSys,Description,IncrementNo,IsActive,IsAudited,IsAutoSequence,IsTableID,Name,StartNewYear,StartNo,Updated,UpdatedBy) VALUES (0,0,52006,TO_DATE('2008-06-03 14:27:59','YYYY-MM-DD HH24:MI:SS'),100,1000000,100,'Table U_POSTerminal',1,'Y','N','Y','Y','U_POSTerminal','N',1000000,TO_DATE('2008-06-03 14:27:59','YYYY-MM-DD HH24:MI:SS'),100) +; \ No newline at end of file diff --git a/posterita/commons/Migration/1.7.0/postgresql/003_Terminals_TransferConfiguration.sql b/posterita/commons/Migration/1.7.0/postgresql/003_Terminals_TransferConfiguration.sql new file mode 100644 index 0000000000..dab9bf8b1b --- /dev/null +++ b/posterita/commons/Migration/1.7.0/postgresql/003_Terminals_TransferConfiguration.sql @@ -0,0 +1,75 @@ +ALTER TABLE AD_OrgInfo ADD COLUMN TransferBank_ID NUMERIC; +ALTER TABLE AD_OrgInfo ADD COLUMN TransferCashBook_ID NUMERIC; + +ALTER TABLE AD_OrgInfo + ADD CONSTRAINT "cbank_adorginfo" + FOREIGN KEY(TransferBank_ID) + REFERENCES C_Bank(C_Bank_ID); + + +ALTER TABLE AD_OrgInfo + ADD CONSTRAINT "ccashbook_adorginfo" + FOREIGN KEY(TransferCashBook_ID) + REFERENCES C_CashBook(C_CashBook_ID); + + + + +-- May 26, 2008 23:25:51 AM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52028,0,'TransferBank_ID',TO_DATE('2008-05-26 23:25:50','YYYY-MM-DD HH24:MI:SS'),100,'Bank account depending on currency will be used from this bank for doing transfers','D','Y','Bank for transfers','Bank for transfers',TO_DATE('2008-05-26 23:25:50','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- May 26, 2008 23:25:51 AM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52028 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) +; + +-- May 26, 2008 23:26:38 AM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Reference (AD_Client_ID,AD_Org_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,ValidationType) VALUES (0,0,52001,TO_DATE('2008-05-26 23:26:38','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','C_Bank',TO_DATE('2008-05-26 23:26:38','YYYY-MM-DD HH24:MI:SS'),100,'T') +; + +-- May 26, 2008 23:26:38 AM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Reference_Trl (AD_Language,AD_Reference_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Reference_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Reference t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Reference_ID=52001 AND EXISTS (SELECT * FROM AD_Reference_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Reference_ID!=t.AD_Reference_ID) +; + +-- May 26, 2008 23:28:08 AM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Ref_Table (AD_Client_ID,AD_Display,AD_Key,AD_Org_ID,AD_Reference_ID,AD_Table_ID,Created,CreatedBy,EntityType,IsActive,IsValueDisplayed,Updated,UpdatedBy,WhereClause) VALUES (0,3039,3031,0,52001,296,TO_DATE('2008-05-26 23:28:08','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','N',TO_DATE('2008-05-26 23:28:08','YYYY-MM-DD HH24:MI:SS'),100,'C_Bank.IsOwnBank=''Y''') +; + +-- May 26, 2008 23:28:33 AM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52075,52028,0,18,52001,228,'TransferBank_ID',TO_DATE('2008-05-26 23:28:33','YYYY-MM-DD HH24:MI:SS'),100,'Bank account depending on currency will be used from this bank for doing transfers','D',22,'Y','N','N','N','N','N','N','N','N','N','Y','Bank for transfers',0,TO_DATE('2008-05-26 23:28:33','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- May 26, 2008 23:28:33 AM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52075 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + + + +-- Cash Book + +-- May 26, 2008 23:29:40 AM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52029,0,'TransferCashBook_ID',TO_DATE('2008-05-23 23:29:40','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','CashBook for transfers','CashBook for transfers',TO_DATE('2008-05-23 23:29:40','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- May 26, 2008 23:29:40 AM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52029 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) +; + +-- May 26, 2008 23:30:32 AM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52076,52029,0,18,52004,228,'TransferCashBook_ID',TO_DATE('2008-05-23 23:30:31','YYYY-MM-DD HH24:MI:SS'),100,'D',22,'Y','N','N','N','N','N','N','N','N','N','Y','CashBook for transfers',0,TO_DATE('2008-05-23 23:30:31','YYYY-MM-DD HH24:MI:SS'),100,0) +; + +-- May 26, 2008 23:30:32 AM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52076 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; diff --git a/posterita/commons/Migration/1.7.0/postgresql/004_Terminals_newTableDDL.sql b/posterita/commons/Migration/1.7.0/postgresql/004_Terminals_newTableDDL.sql new file mode 100644 index 0000000000..408b569bfa --- /dev/null +++ b/posterita/commons/Migration/1.7.0/postgresql/004_Terminals_newTableDDL.sql @@ -0,0 +1,4 @@ +-- Jun 2, 2008 23:58:02 AM GMT+04:00 +-- Default comment for updating dictionary +CREATE TABLE U_POSTerminal (AD_Client_ID NUMERIC(10) DEFAULT NULL NOT NULL, AD_Org_ID NUMERIC(10) DEFAULT NULL NOT NULL, AutoLock CHAR(1) DEFAULT 'N' CHECK (AutoLock IN ('Y','N')) NOT NULL, Card_BankAccount_ID NUMERIC(10), CardTransferBankAccount_ID NUMERIC(10), CardTransferCashBook_ID NUMERIC(10), CardTransferType CHAR(1), CashBookTransferType CHAR(1) NOT NULL, CashTransferBankAccount_ID NUMERIC(10), CashTransferCashBook_ID NUMERIC(10), C_CashBook_ID NUMERIC(10) NOT NULL, C_CashBPartner_ID NUMERIC(10) NOT NULL, Check_BankAccount_ID NUMERIC(10), CheckTransferBankAccount_ID NUMERIC(10), CheckTransferCashBook_ID NUMERIC(10), CheckTransferType CHAR(1), Created TIMESTAMP NOT NULL, CreatedBy NUMERIC(10) NOT NULL, C_TemplateBPartner_ID NUMERIC(10), Description VARCHAR(255), Help VARCHAR(2000), IsActive CHAR(1) DEFAULT 'Y' CHECK (IsActive IN ('Y','N')), LastLockTime TIMESTAMP, Locked CHAR(1) DEFAULT 'N' CHECK (Locked IN ('Y','N')), LockTime NUMERIC(10), M_Warehouse_ID NUMERIC(10), Name VARCHAR(60), PO_PriceList_ID NUMERIC(10), PrinterName VARCHAR(60), SalesRep_ID NUMERIC(10), SO_PriceList_ID NUMERIC(10), UnlockingTime TIMESTAMP, Updated TIMESTAMP NOT NULL, UpdatedBy NUMERIC(10), U_POSTerminal_ID NUMERIC(10) NOT NULL, CONSTRAINT U_POSTerminal_Key PRIMARY KEY (U_POSTerminal_ID)) +; \ No newline at end of file diff --git a/posterita/commons/Migration/1.7.0/postgresql/005_Messages.sql b/posterita/commons/Migration/1.7.0/postgresql/005_Messages.sql new file mode 100644 index 0000000000..10f0b71a0b --- /dev/null +++ b/posterita/commons/Migration/1.7.0/postgresql/005_Messages.sql @@ -0,0 +1,189 @@ +-- Jun 9, 2008 1:24:35 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,52452,0,TO_DATE('2008-06-09 13:24:35','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','Organisation','I',TO_DATE('2008-06-09 13:24:35','YYYY-MM-DD HH24:MI:SS'),100,'smenu.organisation') +; + +-- Jun 9, 2008 1:25:48 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,52453,0,TO_DATE('2008-06-09 13:25:48','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','Terminals','I',TO_DATE('2008-06-09 13:25:48','YYYY-MM-DD HH24:MI:SS'),100,'smenu.terminal') +; + +-- Jun 9, 2008 1:26:06 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,52454,0,TO_DATE('2008-06-09 13:26:06','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','Cash Books','I',TO_DATE('2008-06-09 13:26:06','YYYY-MM-DD HH24:MI:SS'),100,'smenu.cashbook') +; + +-- Jun 9, 2008 1:26:30 PM GMT+04:00 +-- Default comment for updating dictionary +UPDATE AD_Message SET MsgTip='Maintain POS Terminals',Updated=TO_DATE('2008-06-09 13:26:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Message_ID=52453 +; + +-- Jun 9, 2008 1:26:39 PM GMT+04:00 +-- Default comment for updating dictionary +UPDATE AD_Message SET MsgTip='Maintain Cash Books',Updated=TO_DATE('2008-06-09 13:26:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Message_ID=52454 +; + +-- Jun 9, 2008 1:27:15 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,52455,0,TO_DATE('2008-06-09 13:27:15','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','Completed','I',TO_DATE('2008-06-09 13:27:15','YYYY-MM-DD HH24:MI:SS'),100,'document.status.completed') +; + +-- Jun 9, 2008 1:28:05 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,52456,0,TO_DATE('2008-06-09 13:28:04','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','Drafted','I',TO_DATE('2008-06-09 13:28:04','YYYY-MM-DD HH24:MI:SS'),100,'document.status.drafted') +; + +-- Jun 9, 2008 1:28:27 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,52457,0,TO_DATE('2008-06-09 13:28:27','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','In Progress','I',TO_DATE('2008-06-09 13:28:27','YYYY-MM-DD HH24:MI:SS'),100,'document.status.inprogress') +; + +-- Jun 9, 2008 1:28:44 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,52458,0,TO_DATE('2008-06-09 13:28:44','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','Invalid','I',TO_DATE('2008-06-09 13:28:44','YYYY-MM-DD HH24:MI:SS'),100,'document.status.invalid') +; + +-- Jun 9, 2008 1:28:58 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,52459,0,TO_DATE('2008-06-09 13:28:58','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','Closed','I',TO_DATE('2008-06-09 13:28:58','YYYY-MM-DD HH24:MI:SS'),100,'document.status.closed') +; + +-- Jun 9, 2008 1:29:15 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,52460,0,TO_DATE('2008-06-09 13:29:15','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','Cash','I',TO_DATE('2008-06-09 13:29:15','YYYY-MM-DD HH24:MI:SS'),100,'payment.rule.cash') +; + +-- Jun 9, 2008 1:29:27 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,52461,0,TO_DATE('2008-06-09 13:29:27','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','Card','I',TO_DATE('2008-06-09 13:29:27','YYYY-MM-DD HH24:MI:SS'),100,'payment.rule.card') +; + +-- Jun 9, 2008 1:29:42 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,52462,0,TO_DATE('2008-06-09 13:29:41','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','Cheque','I',TO_DATE('2008-06-09 13:29:41','YYYY-MM-DD HH24:MI:SS'),100,'payment.rule.cheque') +; + +-- Jun 9, 2008 1:29:55 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,52463,0,TO_DATE('2008-06-09 13:29:55','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','Mixed','I',TO_DATE('2008-06-09 13:29:55','YYYY-MM-DD HH24:MI:SS'),100,'payment.rule.mixed') +; + +-- Jun 9, 2008 1:30:14 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,52464,0,TO_DATE('2008-06-09 13:30:13','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','Credit','I',TO_DATE('2008-06-09 13:30:13','YYYY-MM-DD HH24:MI:SS'),100,'payment.rule.credit') +; + +-- Jun 9, 2008 1:30:46 PM GMT+04:00 +-- Default comment for updating dictionary +INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,52465,0,TO_DATE('2008-06-09 13:30:46','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','Amount Paid','I',TO_DATE('2008-06-09 13:30:46','YYYY-MM-DD HH24:MI:SS'),100,'AmountPaid') +; + +-------------------------------------------------------------------------------------------------------------------------------------------------- +INSERT INTO AD_MESSAGE +(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, +updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) +VALUES(52470 , 0, 0, 'Y', TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, +'html', 'HTML', ' ', 'I', 'D'); + +INSERT INTO AD_MESSAGE +(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, +updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) +VALUES(52471 , 0, 0, 'Y', TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, +'pdf', 'PDF', ' ', 'I', 'D'); + +INSERT INTO AD_MESSAGE +(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, +updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) +VALUES(52472 , 0, 0, 'Y', TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, +'csv', 'CSV', ' ', 'I', 'D'); + +INSERT INTO adempiere.AD_MESSAGE +(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, +updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) +VALUES(52473 , 0, 0, 'Y', TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, +'smenu.sales.report', 'Sales Report', ' ', 'I', 'D'); + +INSERT INTO adempiere.AD_MESSAGE +(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, +updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) +VALUES(52474 , 0, 0, 'Y', TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, +'smenu.best.selling.items', 'Best Selling Items', ' ', 'I', 'D'); + +INSERT INTO adempiere.AD_MESSAGE +(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, +updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) +VALUES(52475 , 0, 0, 'Y', TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, +'smenu.stock.sales.report', 'Stock Sales Report', ' ', 'I', 'D'); + +INSERT INTO adempiere.AD_MESSAGE +(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, +updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) +VALUES(52476 , 0, 0, 'Y', TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, +'smenu.transfer.stock', 'Stock Transfer', ' ', 'I', 'D'); + +INSERT INTO adempiere.AD_MESSAGE +(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, +updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) +VALUES(52477 , 0, 0, 'Y', TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, +'smenu.inventory.move', 'Inventory Move', ' ', 'I', 'D'); + +INSERT INTO adempiere.AD_MESSAGE +(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, +updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) +VALUES(52478 , 0, 0, 'Y', TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, +'smenu.move.confirmation', 'Move Confirmation', ' ', 'I', 'D'); + +INSERT INTO adempiere.AD_MESSAGE +(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, +updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) +VALUES(52479 , 0, 0, 'Y', TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, +'smenu.barcode.printing', 'Barcode Printing', ' ', 'I', 'D'); + +INSERT INTO adempiere.AD_MESSAGE +(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, +updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) +VALUES(52480 , 0, 0, 'Y', TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, +'basePriceList', 'Base Price List', ' ', 'I', 'D'); + +INSERT INTO adempiere.AD_MESSAGE +(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, +updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) +VALUES(52481, 0, 0, 'Y', TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, +'isDeleteOldRecords', 'Delete Old Records', ' ', 'I', 'D'); + +INSERT INTO adempiere.AD_MESSAGE +(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, +updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) +VALUES(52482, 0, 0, 'Y', TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, +'sales.price.list', 'Sales Price List', ' ', 'I', 'D'); + +INSERT INTO adempiere.AD_MESSAGE +(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, +updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) +VALUES(52483, 0, 0, 'Y', TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, +'purchase.price.list', 'Purchase Price List', ' ', 'I', 'D'); + +INSERT INTO adempiere.AD_MESSAGE +(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, +updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) +VALUES(52484, 0, 0, 'Y', TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, +'pos.terminal', 'Terminal', ' ', 'I', 'D'); + +INSERT INTO adempiere.AD_MESSAGE +(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, +updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) +VALUES(52485, 0, 0, 'Y', TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, +'pos.version', 'Version', ' ', 'I', 'D'); + +INSERT INTO adempiere.AD_MESSAGE +(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, +updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) +VALUES(52486, 0, 0, 'Y', TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, +'pmenu.new.reports', 'Reports', ' ', 'I', 'D'); + +INSERT INTO adempiere.AD_MESSAGE +(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, +updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) +VALUES(52487, 0, 0, 'Y', TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, +'isCreatePriceList', 'Create Price List', ' ', 'I', 'D'); + diff --git a/posterita/commons/Migration/1.7.1/build.xml b/posterita/commons/Migration/1.7.1/build.xml new file mode 100644 index 0000000000..2d4b5fad85 --- /dev/null +++ b/posterita/commons/Migration/1.7.1/build.xml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + File ${file.name} status ${sqlplus.result} + + + + + + diff --git a/posterita/commons/Migration/1.7.1/oracle/001_M_Inventory.sql b/posterita/commons/Migration/1.7.1/oracle/001_M_Inventory.sql new file mode 100644 index 0000000000..545cf9f12e --- /dev/null +++ b/posterita/commons/Migration/1.7.1/oracle/001_M_Inventory.sql @@ -0,0 +1,2 @@ +-- Add QtyCsv in M_inventoryLine +ALTER TABLE M_INVENTORYLINE ADD ( QTYCSV NUMBER(10, 0) DEFAULT 0 NOT NULL); diff --git a/posterita/commons/Migration/1.7.1/postgresql/001_M_Inventory.sql b/posterita/commons/Migration/1.7.1/postgresql/001_M_Inventory.sql new file mode 100644 index 0000000000..cf41dc0d88 --- /dev/null +++ b/posterita/commons/Migration/1.7.1/postgresql/001_M_Inventory.sql @@ -0,0 +1,2 @@ +--Add QtyCSV +ALTER TABLE m_inventoryline ADD COLUMN qtycsv numeric NOT NULL DEFAULT 0; \ No newline at end of file diff --git a/posterita/commons/Migration/1.7.2/build.xml b/posterita/commons/Migration/1.7.2/build.xml new file mode 100644 index 0000000000..6426742ad6 --- /dev/null +++ b/posterita/commons/Migration/1.7.2/build.xml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + File ${file.name} status ${sqlplus.result} + + + + + + diff --git a/posterita/commons/Migration/1.7.2/oracle/001_ADRole.sql b/posterita/commons/Migration/1.7.2/oracle/001_ADRole.sql new file mode 100644 index 0000000000..eae1b645aa --- /dev/null +++ b/posterita/commons/Migration/1.7.2/oracle/001_ADRole.sql @@ -0,0 +1,3 @@ +-- Additional Role Configuration for Discount +ALTER TABLE AD_ROLE ADD (IsDiscountUptoLimitPrice char(1) DEFAULT 'N' NOT NULL); +ALTER TABLE AD_ROLE ADD (IsDiscountAllowedOnTotal char(1) DEFAULT 'N' NOT NULL); \ No newline at end of file diff --git a/posterita/commons/Migration/1.7.2/postgresql/001_ADRole.sql b/posterita/commons/Migration/1.7.2/postgresql/001_ADRole.sql new file mode 100644 index 0000000000..0117237506 --- /dev/null +++ b/posterita/commons/Migration/1.7.2/postgresql/001_ADRole.sql @@ -0,0 +1,3 @@ +-- Additional Role Configuration for Discount +ALTER TABLE ad_role ADD COLUMN IsDiscountUptoLimitPrice char(1) NOT NULL DEFAULT 'N'; +ALTER TABLE ad_role ADD COLUMN IsDiscountAllowedOnTotal char(1) NOT NULL DEFAULT 'N'; \ No newline at end of file diff --git a/posterita/commons/Migration/oracle.properties b/posterita/commons/Migration/oracle.properties new file mode 100644 index 0000000000..2feedd7454 --- /dev/null +++ b/posterita/commons/Migration/oracle.properties @@ -0,0 +1,6 @@ +#ORACLE_HOME +#Example Value: oracle.home=C:/oracle/xe/app/oracle/product/10.2.0/server +oracle.home=C:/adempiere-cd/progs/oracle-xe/app/oracle/product/10.2.0/server + +#sqlplus connection string +oracle.connect.param=ademstbl/adempiere \ No newline at end of file diff --git a/posterita/commons/Migration/oracle.properties.template b/posterita/commons/Migration/oracle.properties.template new file mode 100644 index 0000000000..37b4aec842 --- /dev/null +++ b/posterita/commons/Migration/oracle.properties.template @@ -0,0 +1,6 @@ +#ORACLE_HOME +#Example Value: oracle.home=C:/oracle/xe/app/oracle/product/10.2.0/server +oracle.home=C:/adempiere-cd/progs/oracle-xe/app/oracle/product/10.2.0/server + +#sqlplus connection string +oracle.connect.param=adempiere/adempiere \ No newline at end of file diff --git a/posterita/commons/Migration/trunk/build.xml b/posterita/commons/Migration/trunk/build.xml new file mode 100644 index 0000000000..f9f01b20f0 --- /dev/null +++ b/posterita/commons/Migration/trunk/build.xml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + File ${file.name} status ${sqlplus.result} + + + + + + diff --git a/posterita/commons/Migration/trunk/oracle/002_ADMessage.sql b/posterita/commons/Migration/trunk/oracle/002_ADMessage.sql new file mode 100644 index 0000000000..35e47626c5 --- /dev/null +++ b/posterita/commons/Migration/trunk/oracle/002_ADMessage.sql @@ -0,0 +1,14 @@ +INSERT INTO ad_message(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, value, msgtext, msgtip, msgtype, entitytype) + VALUES(52488, 0, 0, 'Y', sysdate, 100, sysdate, 100, 'discount.upto.price.limit', 'Enforce Discount Upto Limit Price', NULL, 'I', 'U'); +INSERT INTO ad_message(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, value, msgtext, msgtip, msgtype, entitytype) + VALUES(52489, 0, 0, 'Y', sysdate, 100, sysdate, 100, 'over.ride.limit.price', 'Enforce Overide Limit Price', NULL, 'I', 'U'); +INSERT INTO ad_message(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, value, msgtext, msgtip, msgtype, entitytype) + VALUES(52490, 0, 0, 'Y', sysdate, 100, sysdate, 100, 'discount.allowed.total', 'Allowed Discount On Total Sales', NULL, 'I', 'U'); +INSERT INTO ad_message(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, value, msgtext, msgtip, msgtype, entitytype) + VALUES(52491, 0, 0, 'Y', sysdate, 100, sysdate, 100, 'smenu.pos.purchase.report', 'Purchases Report', NULL, 'I', 'U'); +INSERT INTO ad_message(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, value, msgtext, msgtip, msgtype, entitytype) + VALUES(52492, 0, 0, 'Y', sysdate, 100, sysdate, 100, 'smenu.settle.payment.credit.purchase', 'Settle Payment For Purchases On Credit', NULL, 'I', 'U'); +INSERT INTO ad_message(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, value, msgtext, msgtip, msgtype, entitytype) + VALUES(52493, 0, 0, 'Y', sysdate, 100, sysdate, 100, 'smenu.user.manual', 'User Manual', NULL, 'I', 'U'); +INSERT INTO ad_message(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, value, msgtext, msgtip, msgtype, entitytype) + VALUES(52494, 0, 0, 'Y', sysdate, 100, sysdate, 100, 'smenu.contactus', 'Contact Us', NULL, 'I', 'U'); diff --git a/posterita/commons/Migration/trunk/oracle/003_AD_OrgInfo.sql b/posterita/commons/Migration/trunk/oracle/003_AD_OrgInfo.sql new file mode 100644 index 0000000000..4d39cae971 --- /dev/null +++ b/posterita/commons/Migration/trunk/oracle/003_AD_OrgInfo.sql @@ -0,0 +1 @@ +ALTER TABLE ad_orginfo ADD (receiptfootermsg varchar(1023)); diff --git a/posterita/commons/Migration/trunk/oracle/004_AD_Changes for AD_OrgInfo.sql b/posterita/commons/Migration/trunk/oracle/004_AD_Changes for AD_OrgInfo.sql new file mode 100644 index 0000000000..cdd020cb42 --- /dev/null +++ b/posterita/commons/Migration/trunk/oracle/004_AD_Changes for AD_OrgInfo.sql @@ -0,0 +1,15 @@ +INSERT INTO AD_Element +(ad_element_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, +columnname, entitytype, name, printname, description, help, po_name, po_printname, po_description, po_help) +VALUES(52050, 0, 0, 'Y', sysdate, 100, sysdate, 100, +'ReceiptFooterMsg', 'U', 'Receipt Footer Msg', 'Receipt Footer Msg', 'This message will be displayed at the bottom of a receipt when doing a sales or purchase', NULL, NULL, NULL, NULL, NULL); + + +INSERT INTO ad_column +(ad_column_id, ad_client_id, ad_org_id, isactive, created, updated, createdby, updatedby, name, +description, help, version, entitytype, columnname, ad_table_id, ad_reference_id, ad_reference_value_id, +ad_val_rule_id, fieldlength, defaultvalue, iskey, isparent, ismandatory, isupdateable, readonlylogic, +isidentifier, seqno, istranslated, isencrypted, callout, vformat, valuemin, valuemax, isselectioncolumn, +ad_element_id, ad_process_id, issyncdatabase, isalwaysupdateable, columnsql, mandatorylogic) +VALUES(52112, 0, 0, 'Y', sysdate, sysdate, 100, 100, 'ReceiptFooterMsg' , 'This message will be displayed at the bottom of a receipt when doing a sales or purchase', NULL, 0, 'U', 'ReceiptFooterMsg', 228, 10, NULL, NULL, 1024, 1, 'N', 'N', 'Y', 'Y', NULL, +'N', 0, 'N', 'N', NULL, NULL, NULL, NULL, 'N', 52050, NULL, 'N', 'N', NULL, NULL); diff --git a/posterita/commons/Migration/trunk/oracle/005_MissingIDs.sql b/posterita/commons/Migration/trunk/oracle/005_MissingIDs.sql new file mode 100644 index 0000000000..c2142b123d --- /dev/null +++ b/posterita/commons/Migration/trunk/oracle/005_MissingIDs.sql @@ -0,0 +1,20 @@ +-- Missing Ids for M_InventoryLine & AD_Role +-- AD Element +INSERT INTO ad_element(ad_element_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, columnname, entitytype, name, printname, description, help, po_name, po_printname, po_description, po_help) + VALUES(52051, 0, 0, 'Y', sysdate, 100, sysdate, 100, 'IsDiscountUptoLimitPrice', 'U', 'IsDiscountUptoLimitPrice', 'IsDiscountUptoLimitPrice', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO ad_element(ad_element_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, columnname, entitytype, name, printname, description, help, po_name, po_printname, po_description, po_help) + VALUES(52052, 0, 0, 'Y', sysdate, 100, sysdate, 100, 'IsDiscountAllowedOnTotal', 'U', 'IsDiscountAllowedOnTotal', 'IsDiscountAllowedOnTotal', NULL, NULL, NULL, NULL, NULL, NULL); + +-- AD Column +INSERT INTO ad_column(ad_column_id, ad_client_id, ad_org_id, isactive, created, updated, createdby, updatedby, name, description, help, version, entitytype, columnname, ad_table_id, ad_reference_id, ad_reference_value_id, ad_val_rule_id, fieldlength, defaultvalue, iskey, isparent, ismandatory, isupdateable, readonlylogic, isidentifier, seqno, istranslated, isencrypted, callout, vformat, valuemin, valuemax, isselectioncolumn, ad_element_id, ad_process_id, issyncdatabase, isalwaysupdateable, columnsql, mandatorylogic, infofactoryclass) + VALUES(52113, 0, 0, 'Y', sysdate, sysdate, 100, 100, 'IsDiscountUptoLimitPrice', NULL, NULL, 0, 'U', 'IsDiscountUptoLimitPrice', 156, 20, NULL, NULL, 1, NULL, 'N', 'N', 'Y', 'Y', NULL, 'N', NULL, 'N', 'N', NULL, NULL, NULL, NULL, 'N', 52051, NULL, 'N', 'N', NULL, NULL, NULL); +INSERT INTO ad_column(ad_column_id, ad_client_id, ad_org_id, isactive, created, updated, createdby, updatedby, name, description, help, version, entitytype, columnname, ad_table_id, ad_reference_id, ad_reference_value_id, ad_val_rule_id, fieldlength, defaultvalue, iskey, isparent, ismandatory, isupdateable, readonlylogic, isidentifier, seqno, istranslated, isencrypted, callout, vformat, valuemin, valuemax, isselectioncolumn, ad_element_id, ad_process_id, issyncdatabase, isalwaysupdateable, columnsql, mandatorylogic, infofactoryclass) + VALUES(52114, 0, 0, 'Y', sysdate, sysdate, 100, 100, 'IsDiscountAllowedOnTotal', NULL, NULL, 0, 'U', 'IsDiscountAllowedOnTotal', 156, 20, NULL, NULL, 1, NULL, 'N', 'N', 'Y', 'Y', NULL, 'N', NULL, 'N', 'N', NULL, NULL, NULL, NULL, 'N', 52052, NULL, 'N', 'N', NULL, NULL, NULL); + +-- AD Element +INSERT INTO ad_element(ad_element_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, columnname, entitytype, name, printname, description, help, po_name, po_printname, po_description, po_help) + VALUES(52053, 0, 0, 'Y', sysdate, 100, sysdate, 100, 'QtyCsv', 'U', 'QtyCsv', 'QtyCsv', NULL, NULL, NULL, NULL, NULL, NULL); + +-- AD Column +INSERT INTO ad_column(ad_column_id, ad_client_id, ad_org_id, isactive, created, updated, createdby, updatedby, name, description, help, version, entitytype, columnname, ad_table_id, ad_reference_id, ad_reference_value_id, ad_val_rule_id, fieldlength, defaultvalue, iskey, isparent, ismandatory, isupdateable, readonlylogic, isidentifier, seqno, istranslated, isencrypted, callout, vformat, valuemin, valuemax, isselectioncolumn, ad_element_id, ad_process_id, issyncdatabase, isalwaysupdateable, columnsql, mandatorylogic, infofactoryclass) + VALUES(52115, 0, 0, 'Y', sysdate, sysdate, 100, 100, 'QtyCsv', NULL, NULL, 0, 'U', 'QtyCsv', 322, 29, NULL, NULL, 131089, NULL, 'N', 'N', 'Y', 'Y', NULL, 'N', NULL, 'N', 'N', NULL, NULL, NULL, NULL, 'N', 52053, NULL, 'N', 'N', NULL, NULL, NULL); diff --git a/posterita/commons/Migration/trunk/oracle/006_PackSize_MProduct.sql b/posterita/commons/Migration/trunk/oracle/006_PackSize_MProduct.sql new file mode 100644 index 0000000000..b4e2943c21 --- /dev/null +++ b/posterita/commons/Migration/trunk/oracle/006_PackSize_MProduct.sql @@ -0,0 +1,10 @@ +-- The Units Per Pack indicates the no of units of a product packed together. +ALTER TABLE M_Product ADD (UnitsPerPack number(10,0) default 1 not null ); + +-- AD Element -- +INSERT INTO AD_ELEMENT(ad_element_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, columnname, entitytype, name, printname, description, help, po_name, po_printname, po_description, po_help) + VALUES(52054, 0, 0, 'Y', sysdate, 100, sysdate, 100, 'UnitsPerPack', 'U', 'UnitsPerPack', 'UnitsPerPack', 'The Units Per Pack indicates the no of units of a product packed together.', NULL, NULL, NULL, NULL, NULL); + +-- AD Column -- +INSERT INTO AD_COLUMN(ad_column_id, ad_client_id, ad_org_id, isactive, created, updated, createdby, updatedby, name, description, help, version, entitytype, columnname, ad_table_id, ad_reference_id, ad_reference_value_id, ad_val_rule_id, fieldlength, defaultvalue, iskey, isparent, ismandatory, isupdateable, readonlylogic, isidentifier, seqno, istranslated, isencrypted, callout, vformat, valuemin, valuemax, isselectioncolumn, ad_element_id, ad_process_id, issyncdatabase, isalwaysupdateable, columnsql, mandatorylogic, infofactoryclass) + VALUES(52116, 0, 0, 'Y', sysdate, sysdate, 100, 100, 'UnitsPerPack', 'The Units Per Pack indicates the no of units of a product packed together.', NULL, 0, 'U', 'UnitsPerPack', 208, 11, NULL, NULL, 14, NULL, 'N', 'N', 'N', 'Y', NULL, 'N', 0, 'N', 'N', NULL, NULL, NULL, NULL, 'N', 52054, NULL, 'N', 'N', NULL, NULL, NULL); diff --git a/posterita/commons/Migration/trunk/oracle/007_CashPayment.sql b/posterita/commons/Migration/trunk/oracle/007_CashPayment.sql new file mode 100644 index 0000000000..6a20e40e85 --- /dev/null +++ b/posterita/commons/Migration/trunk/oracle/007_CashPayment.sql @@ -0,0 +1,85 @@ +--- Alter table -- oracle +--- Table: C_Payment ----------------------------------------------------------- +ALTER TABLE C_Payment +MODIFY C_BankAccount_ID NUMBER(10,0) NULL; + + +ALTER TABLE C_Payment +ADD C_CashBook_ID NUMBER(10,0); + +ALTER TABLE C_Payment +ADD CONSTRAINT C_Payment__C_CashBo_C_CashBook +FOREIGN KEY(C_CashBook_ID) REFERENCES C_CashBook(C_CashBook_ID); + +-------------------------------------------------------------------------------- +ALTER TABLE C_CashLine +ADD C_Payment_ID NUMBER(10); + +--- Migration scripts ---------------------------------------------------------- +-- Aug 26, 2008 11:49:31 AM MUT +-- Default comment for updating dictionary +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsTranslated,IsUpdateable,Name,Updated,UpdatedBy,Version) +VALUES (0,52117,1463,0,19,335,'C_CashBook_ID',sysdate,100,'Cash Book for recording petty cash transactions','U',10,'The Cash Book identifies a unique cash book. The cash book is used to record cash transactions.','Y','N','N','N','N','N','N','N','N','Y','Cash Book',sysdate,100,0); + +-- Aug 26, 2008 11:49:31 AM MUT +-- Default comment for updating dictionary +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52117 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID); + + +-- Aug 26, 2008 11:50:27 AM MUT +-- Default comment for updating dictionary +UPDATE AD_Column SET IsMandatory='N',Updated=sysdate,UpdatedBy=100 WHERE AD_Column_ID=3880; + + +-- Aug 26, 2008 11:50:27 AM MUT +-- Default comment for updating dictionary +UPDATE AD_Field SET Name='Bank Account', Description='Account at the Bank', Help='The Bank Account identifies an account at this Bank.' WHERE AD_Column_ID=3880 AND IsCentrallyMaintained='Y'; + + +-- Aug 26, 2008 11:51:40 AM MUT +-- Default comment for updating dictionary +INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,Description,DisplayLength,EntityType,Help,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) +VALUES (0,52117,52052,0,330,sysdate,100,'Cash Book for recording petty cash transactions',10,'U','The Cash Book identifies a unique cash book. The cash book is used to record cash transactions.','Y','Y','Y','N','N','N','N','N','Cash Book',sysdate,100); + + +-- Aug 26, 2008 11:51:40 AM MUT +-- Default comment for updating dictionary +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=52052 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID); + + +-- Aug 26, 2008 11:51:40 AM MUT +-- Default comment for updating dictionary +INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) +VALUES (0,13705,52053,0,330,sysdate,100,10,'D','Y','Y','Y','N','N','N','N','N','Referenced Payment',sysdate,100); + + +-- Aug 26, 2008 11:51:40 AM MUT +-- Default comment for updating dictionary +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=52053 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID); + + +-- Aug 26, 2008 11:52:11 AM MUT +-- Default comment for updating dictionary +UPDATE AD_Field SET SeqNo=0,IsDisplayed='N' WHERE AD_Field_ID=52053; + + +-- Aug 26, 2008 11:52:11 AM MUT +-- Default comment for updating dictionary +UPDATE AD_Field SET SeqNo=660,IsDisplayed='Y' WHERE AD_Field_ID=52052; + + +-- Aug 26, 2008 11:52:56 AM MUT +-- Default comment for updating dictionary +UPDATE AD_Field SET DisplayLogic='@TenderType@ !''X''',Updated=sysdate,UpdatedBy=100 WHERE AD_Field_ID=4030; + + +-- Aug 26, 2008 11:54:17 AM MUT +-- Default comment for updating dictionary +UPDATE AD_Field SET DisplayLength=14, DisplayLogic='@TenderType@=''X''', IsSameLine='Y',Updated=sysdate,UpdatedBy=100 WHERE AD_Field_ID=52052; + + +-- Aug 26, 2008 11:54:42 AM MUT +-- Default comment for updating dictionary +UPDATE AD_Tab SET WhereClause=NULL,Updated=sysdate,UpdatedBy=100 WHERE AD_Tab_ID=330; + + diff --git a/posterita/commons/Migration/trunk/postgresql/002_ADMessage.sql b/posterita/commons/Migration/trunk/postgresql/002_ADMessage.sql new file mode 100644 index 0000000000..3b2096d498 --- /dev/null +++ b/posterita/commons/Migration/trunk/postgresql/002_ADMessage.sql @@ -0,0 +1,18 @@ +INSERT INTO ad_message(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, value, msgtext, msgtip, msgtype, entitytype) + VALUES(52488, 0, 0, 'Y', now(), 100, now(), 100, 'discount.upto.price.limit', 'Enforce Discount Upto Limit Price', NULL, 'I', 'U'); +INSERT INTO ad_message(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, value, msgtext, msgtip, msgtype, entitytype) + VALUES(52489, 0, 0, 'Y', now(), 100, now(), 100, 'over.ride.limit.price', 'Enforce Overide Limit Price', NULL, 'I', 'U'); +INSERT INTO ad_message(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, value, msgtext, msgtip, msgtype, entitytype) + VALUES(52490, 0, 0, 'Y', now(), 100, now(), 100, 'discount.allowed.total', 'Allowed Discount On Total Sales', NULL, 'I', 'U'); +INSERT INTO ad_message(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, value, msgtext, msgtip, msgtype, entitytype) + VALUES(52491, 0, 0, 'Y', now(), 100, now(), 100, 'smenu.pos.purchase.report', 'Purchases Report', NULL, 'I', 'U'); +INSERT INTO ad_message(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, value, msgtext, msgtip, msgtype, entitytype) + VALUES(52492, 0, 0, 'Y', now(), 100, now(), 100, 'smenu.settle.payment.credit.purchase', 'Settle Payment For Purchases On Credit', NULL, 'I', 'U'); +INSERT INTO ad_message(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, value, msgtext, msgtip, msgtype, entitytype) + VALUES(52493, 0, 0, 'Y', now(), 100, now(), 100, 'smenu.user.manual', 'User Manual', NULL, 'I', 'U'); +INSERT INTO ad_message(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, value, msgtext, msgtip, msgtype, entitytype) + VALUES(52494, 0, 0, 'Y', now(), 100, now(), 100, 'smenu.contactus', 'Contact Us', NULL, 'I', 'U'); +INSERT INTO ad_message(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, value, msgtext, msgtip, msgtype, entitytype) + VALUES(52495, 0, 0, 'Y', now(), 100, now(), 100, 'discount.amt.order.level', 'Discount Amount', NULL, 'I', 'U'); +INSERT INTO ad_message(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, value, msgtext, msgtip, msgtype, entitytype) + VALUES(52496, 0, 0, 'Y', now(), 100, now(), 100, 'write.off.amt.order.level', 'Writeoff Amount', NULL, 'I', 'U'); diff --git a/posterita/commons/Migration/trunk/postgresql/003_AD_OrgInfo.sql b/posterita/commons/Migration/trunk/postgresql/003_AD_OrgInfo.sql new file mode 100644 index 0000000000..b4d0793838 --- /dev/null +++ b/posterita/commons/Migration/trunk/postgresql/003_AD_OrgInfo.sql @@ -0,0 +1 @@ +ALTER TABLE ad_orginfo ADD COLUMN receiptfootermsg varchar(1023); diff --git a/posterita/commons/Migration/trunk/postgresql/004_AD_Changes for AD_OrgInfo.sql b/posterita/commons/Migration/trunk/postgresql/004_AD_Changes for AD_OrgInfo.sql new file mode 100644 index 0000000000..ab403e3f47 --- /dev/null +++ b/posterita/commons/Migration/trunk/postgresql/004_AD_Changes for AD_OrgInfo.sql @@ -0,0 +1,15 @@ +INSERT INTO AD_Element +(ad_element_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, +columnname, entitytype, name, printname, description, help, po_name, po_printname, po_description, po_help) +VALUES(52050, 0, 0, 'Y', now() , 100, now(), 100, +'ReceiptFooterMsg', 'U', 'Receipt Footer Msg', 'Receipt Footer Msg', 'This message will be displayed at the bottom of a receipt when doing a sales or purchase', NULL, NULL, NULL, NULL, NULL); + + +INSERT INTO ad_column +(ad_column_id, ad_client_id, ad_org_id, isactive, created, updated, createdby, updatedby, name, +description, help, version, entitytype, columnname, ad_table_id, ad_reference_id, ad_reference_value_id, +ad_val_rule_id, fieldlength, defaultvalue, iskey, isparent, ismandatory, isupdateable, readonlylogic, +isidentifier, seqno, istranslated, isencrypted, callout, vformat, valuemin, valuemax, isselectioncolumn, +ad_element_id, ad_process_id, issyncdatabase, isalwaysupdateable, columnsql, mandatorylogic) +VALUES(52112, 0, 0, 'Y', now(), now(), 100, 100, 'ReceiptFooterMsg' , 'This message will be displayed at the bottom of a receipt when doing a sales or purchase', NULL, 0, 'U', 'ReceiptFooterMsg', 228, 10, NULL, NULL, 1024, 1, 'N', 'N', 'Y', 'Y', NULL, +'N', 0, 'N', 'N', NULL, NULL, NULL, NULL, 'N', 52050, NULL, 'N', 'N', NULL, NULL); diff --git a/posterita/commons/Migration/trunk/postgresql/005_MissingIDs.sql b/posterita/commons/Migration/trunk/postgresql/005_MissingIDs.sql new file mode 100644 index 0000000000..230c7a4b97 --- /dev/null +++ b/posterita/commons/Migration/trunk/postgresql/005_MissingIDs.sql @@ -0,0 +1,20 @@ +-- Missing Ids for M_InventoryLine & AD_Role +-- AD Element +INSERT INTO ad_element(ad_element_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, columnname, entitytype, name, printname, description, help, po_name, po_printname, po_description, po_help) + VALUES(52051, 0, 0, 'Y', now(), 100, now(), 100, 'IsDiscountUptoLimitPrice', 'U', 'IsDiscountUptoLimitPrice', 'IsDiscountUptoLimitPrice', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO ad_element(ad_element_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, columnname, entitytype, name, printname, description, help, po_name, po_printname, po_description, po_help) + VALUES(52052, 0, 0, 'Y', now(), 100, now(), 100, 'IsDiscountAllowedOnTotal', 'U', 'IsDiscountAllowedOnTotal', 'IsDiscountAllowedOnTotal', NULL, NULL, NULL, NULL, NULL, NULL); + +-- AD Column +INSERT INTO ad_column(ad_column_id, ad_client_id, ad_org_id, isactive, created, updated, createdby, updatedby, name, description, help, version, entitytype, columnname, ad_table_id, ad_reference_id, ad_reference_value_id, ad_val_rule_id, fieldlength, defaultvalue, iskey, isparent, ismandatory, isupdateable, readonlylogic, isidentifier, seqno, istranslated, isencrypted, callout, vformat, valuemin, valuemax, isselectioncolumn, ad_element_id, ad_process_id, issyncdatabase, isalwaysupdateable, columnsql, mandatorylogic, infofactoryclass) + VALUES(52113, 0, 0, 'Y', now(), now(), 100, 100, 'IsDiscountUptoLimitPrice', NULL, NULL, 0, 'U', 'IsDiscountUptoLimitPrice', 156, 20, NULL, NULL, 1, NULL, 'N', 'N', 'Y', 'Y', NULL, 'N', NULL, 'N', 'N', NULL, NULL, NULL, NULL, 'N', 52051, NULL, 'N', 'N', NULL, NULL, NULL); +INSERT INTO ad_column(ad_column_id, ad_client_id, ad_org_id, isactive, created, updated, createdby, updatedby, name, description, help, version, entitytype, columnname, ad_table_id, ad_reference_id, ad_reference_value_id, ad_val_rule_id, fieldlength, defaultvalue, iskey, isparent, ismandatory, isupdateable, readonlylogic, isidentifier, seqno, istranslated, isencrypted, callout, vformat, valuemin, valuemax, isselectioncolumn, ad_element_id, ad_process_id, issyncdatabase, isalwaysupdateable, columnsql, mandatorylogic, infofactoryclass) + VALUES(52114, 0, 0, 'Y', now(), now(), 100, 100, 'IsDiscountAllowedOnTotal', NULL, NULL, 0, 'U', 'IsDiscountAllowedOnTotal', 156, 20, NULL, NULL, 1, NULL, 'N', 'N', 'Y', 'Y', NULL, 'N', NULL, 'N', 'N', NULL, NULL, NULL, NULL, 'N', 52052, NULL, 'N', 'N', NULL, NULL, NULL); + +-- AD Element +INSERT INTO ad_element(ad_element_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, columnname, entitytype, name, printname, description, help, po_name, po_printname, po_description, po_help) + VALUES(52053, 0, 0, 'Y', now(), 100, now(), 100, 'QtyCsv', 'U', 'QtyCsv', 'QtyCsv', NULL, NULL, NULL, NULL, NULL, NULL); + +-- AD Column +INSERT INTO ad_column(ad_column_id, ad_client_id, ad_org_id, isactive, created, updated, createdby, updatedby, name, description, help, version, entitytype, columnname, ad_table_id, ad_reference_id, ad_reference_value_id, ad_val_rule_id, fieldlength, defaultvalue, iskey, isparent, ismandatory, isupdateable, readonlylogic, isidentifier, seqno, istranslated, isencrypted, callout, vformat, valuemin, valuemax, isselectioncolumn, ad_element_id, ad_process_id, issyncdatabase, isalwaysupdateable, columnsql, mandatorylogic, infofactoryclass) + VALUES(52115, 0, 0, 'Y', now(), now(), 100, 100, 'QtyCsv', NULL, NULL, 0, 'U', 'QtyCsv', 322, 29, NULL, NULL, 131089, NULL, 'N', 'N', 'Y', 'Y', NULL, 'N', NULL, 'N', 'N', NULL, NULL, NULL, NULL, 'N', 52053, NULL, 'N', 'N', NULL, NULL, NULL); diff --git a/posterita/commons/Migration/trunk/postgresql/006_PackSize_MProduct.sql b/posterita/commons/Migration/trunk/postgresql/006_PackSize_MProduct.sql new file mode 100644 index 0000000000..d324689318 --- /dev/null +++ b/posterita/commons/Migration/trunk/postgresql/006_PackSize_MProduct.sql @@ -0,0 +1,10 @@ +-- The Units Per Pack indicates the no of units of a product packed together. +ALTER TABLE M_Product ADD COLUMN UnitsPerPack numeric(10,0) not null default 1; + +-- AD Element -- +INSERT INTO ad_element(ad_element_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, columnname, entitytype, name, printname, description, help, po_name, po_printname, po_description, po_help) + VALUES(52054, 0, 0, 'Y', now(), 100, now(), 100, 'UnitsPerPack', 'U', 'UnitsPerPack', 'UnitsPerPack', 'The Units Per Pack indicates the no of units of a product packed together.', NULL, NULL, NULL, NULL, NULL); + +-- AD Column -- +INSERT INTO ad_column(ad_column_id, ad_client_id, ad_org_id, isactive, created, updated, createdby, updatedby, name, description, help, version, entitytype, columnname, ad_table_id, ad_reference_id, ad_reference_value_id, ad_val_rule_id, fieldlength, defaultvalue, iskey, isparent, ismandatory, isupdateable, readonlylogic, isidentifier, seqno, istranslated, isencrypted, callout, vformat, valuemin, valuemax, isselectioncolumn, ad_element_id, ad_process_id, issyncdatabase, isalwaysupdateable, columnsql, mandatorylogic, infofactoryclass) + VALUES(52116, 0, 0, 'Y', now(), now(), 100, 100, 'UnitsPerPack', 'The Units Per Pack indicates the no of units of a product packed together.', NULL, 0, 'U', 'UnitsPerPack', 208, 11, NULL, NULL, 14, NULL, 'N', 'N', 'N', 'Y', NULL, 'N', 0, 'N', 'N', NULL, NULL, NULL, NULL, 'N', 52054, NULL, 'N', 'N', NULL, NULL, NULL); diff --git a/posterita/commons/Migration/trunk/postgresql/007_CashPayment.sql b/posterita/commons/Migration/trunk/postgresql/007_CashPayment.sql new file mode 100644 index 0000000000..365ee8e988 --- /dev/null +++ b/posterita/commons/Migration/trunk/postgresql/007_CashPayment.sql @@ -0,0 +1,87 @@ +-- Alter table -- postgres + +--- Table: C_Payment ----------------------------------------------------------- +ALTER TABLE C_Payment +ALTER COLUMN C_BankAccount_ID DROP NOT NULL; + + +ALTER TABLE C_Payment +ADD C_CashBook_ID NUMERIC(10); + +ALTER TABLE C_Payment +ADD CONSTRAINT C_Payment__C_CashBo_C_CashBook +FOREIGN KEY(C_CashBook_ID) REFERENCES C_CashBook(C_CashBook_ID); + +-------------------------------------------------------------------------------- +ALTER TABLE C_CashLine +ADD C_Payment_ID NUMERIC(10); + +--- Migration scripts ---------------------------------------------------------- +-- Aug 26, 2008 11:49:31 AM MUT +-- Default comment for updating dictionary +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsTranslated,IsUpdateable,Name,Updated,UpdatedBy,Version) +VALUES (0,52117,1463,0,19,335,'C_CashBook_ID',now(),100,'Cash Book for recording petty cash transactions','U',10,'The Cash Book identifies a unique cash book. The cash book is used to record cash transactions.','Y','N','N','N','N','N','N','N','N','Y','Cash Book',now(),100,0) +; + +-- Aug 26, 2008 11:49:31 AM MUT +-- Default comment for updating dictionary +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52117 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + +-- Aug 26, 2008 11:50:27 AM MUT +-- Default comment for updating dictionary +UPDATE AD_Column SET IsMandatory='N',Updated=now(),UpdatedBy=100 WHERE AD_Column_ID=3880 +; + +-- Aug 26, 2008 11:50:27 AM MUT +-- Default comment for updating dictionary +UPDATE AD_Field SET Name='Bank Account', Description='Account at the Bank', Help='The Bank Account identifies an account at this Bank.' WHERE AD_Column_ID=3880 AND IsCentrallyMaintained='Y' +; + +-- Aug 26, 2008 11:51:40 AM MUT +-- Default comment for updating dictionary +INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,Description,DisplayLength,EntityType,Help,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) +VALUES (0,52117,52052,0,330,now(),100,'Cash Book for recording petty cash transactions',10,'U','The Cash Book identifies a unique cash book. The cash book is used to record cash transactions.','Y','Y','Y','N','N','N','N','N','Cash Book',now(),100) +; + +-- Aug 26, 2008 11:51:40 AM MUT +-- Default comment for updating dictionary +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=52052 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID) +; + +-- Aug 26, 2008 11:51:40 AM MUT +-- Default comment for updating dictionary +INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) +VALUES (0,13705,52053,0,330,now(),100,10,'D','Y','Y','Y','N','N','N','N','N','Referenced Payment',now(),100) +; + +-- Aug 26, 2008 11:51:40 AM MUT +-- Default comment for updating dictionary +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=52053 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID) +; + +-- Aug 26, 2008 11:52:11 AM MUT +-- Default comment for updating dictionary +UPDATE AD_Field SET SeqNo=0,IsDisplayed='N' WHERE AD_Field_ID=52053 +; + +-- Aug 26, 2008 11:52:11 AM MUT +-- Default comment for updating dictionary +UPDATE AD_Field SET SeqNo=660,IsDisplayed='Y' WHERE AD_Field_ID=52052 +; + +-- Aug 26, 2008 11:52:56 AM MUT +-- Default comment for updating dictionary +UPDATE AD_Field SET DisplayLogic='@TenderType@ !''X''',Updated=now(),UpdatedBy=100 WHERE AD_Field_ID=4030 +; + +-- Aug 26, 2008 11:54:17 AM MUT +-- Default comment for updating dictionary +UPDATE AD_Field SET DisplayLength=14, DisplayLogic='@TenderType@=''X''', IsSameLine='Y',Updated=now(),UpdatedBy=100 WHERE AD_Field_ID=52052 +; + +-- Aug 26, 2008 11:54:42 AM MUT +-- Default comment for updating dictionary +UPDATE AD_Tab SET WhereClause=NULL,Updated=now(),UpdatedBy=100 WHERE AD_Tab_ID=330 +; + diff --git a/posterita/commons/build.xml b/posterita/commons/build.xml new file mode 100644 index 0000000000..c3a2633ba2 --- /dev/null +++ b/posterita/commons/build.xml @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/posterita/commons/properties.xml b/posterita/commons/properties.xml new file mode 100644 index 0000000000..be1e2401c9 --- /dev/null +++ b/posterita/commons/properties.xml @@ -0,0 +1,17 @@ + + + + This project file sets all properties needed during build and + installation. This file is imported in all other build.xml + files. This file provides a central place for managing + properties. + + + + + + + + + + diff --git a/posterita/posterita/build.properties b/posterita/posterita/build.properties new file mode 100644 index 0000000000..096807e0fc --- /dev/null +++ b/posterita/posterita/build.properties @@ -0,0 +1 @@ +posterita.dev.home= diff --git a/posterita/posterita/build.xml b/posterita/posterita/build.xml new file mode 100644 index 0000000000..359b104ea6 --- /dev/null +++ b/posterita/posterita/build.xml @@ -0,0 +1,151 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/posterita/posterita/properties.xml b/posterita/posterita/properties.xml new file mode 100644 index 0000000000..be1e2401c9 --- /dev/null +++ b/posterita/posterita/properties.xml @@ -0,0 +1,17 @@ + + + + This project file sets all properties needed during build and + installation. This file is imported in all other build.xml + files. This file provides a central place for managing + properties. + + + + + + + + + + diff --git a/posterita/posterita/src/aspect/org/posterita/aspect/POAspect.aj b/posterita/posterita/src/aspect/org/posterita/aspect/POAspect.aj new file mode 100644 index 0000000000..186fe56bf3 --- /dev/null +++ b/posterita/posterita/src/aspect/org/posterita/aspect/POAspect.aj @@ -0,0 +1,83 @@ +/****************************************************************************** + * Product: Posterita Web-Based POS and Adempiere Plugin * + * Copyright (C) 2008 Posterita Ltd * + * This file is part of POSterita * + * * + * POSterita is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * + *****************************************************************************/ + +package org.posterita.aspect; + +import org.posterita.businesslogic.POSTerminalManager; +import org.posterita.exceptions.POException; +import org.posterita.exceptions.TerminalLockedException; +import org.compiere.model.PO; +import org.compiere.model.X_C_Order; +import org.compiere.process.DocAction; +import org.compiere.util.CLogger; +import org.compiere.util.ValueNamePair; + +/** + * @author ashley + */ +public aspect POAspect +{ + pointcut savePO(): + call(public boolean PO.save()); + + boolean around() : savePO() + { + if (thisJoinPoint.getTarget() instanceof X_C_Order) + { + X_C_Order order = (X_C_Order)thisJointPoint.getTarget(); + int terminalId = order.getC_POS_ID(); + + if (terminalId > 0 && POSTerminalManager.isTerminalLocked(po.getCtx(), terminalId)) + { + throw new POException("Terminal is locked"); + } + } + + boolean val = proceed(); + + if (!val) + { + Exception ex = CLogger.retrieveException(); + ValueNamePair err = CLogger.retrieveError(); + String msg; + + if (ex != null) + { + msg = ex.getMessage(); + } + else if (err != null) + { + msg = err.getValue() + " " + err.getName(); + } + else if (thisJoinPoint.getTarget() instanceof DocAction) + { + msg = ((DocAction)thisJoinPoint.getTarget()).getProcessMsg(); + } + else + { + msg = "Unknown"; + } + + throw new POException("Could not save PO - Class: " + thisJoinPoint.getTarget().getClass().getName() + " Cause: " + msg); + } + + return val; + } +} \ No newline at end of file diff --git a/posterita/posterita/src/aspect/org/posterita/aspect/TrxAspect.aj b/posterita/posterita/src/aspect/org/posterita/aspect/TrxAspect.aj new file mode 100644 index 0000000000..059b06abac --- /dev/null +++ b/posterita/posterita/src/aspect/org/posterita/aspect/TrxAspect.aj @@ -0,0 +1,36 @@ +/****************************************************************************** + * Product: Posterita Web-Based POS and Adempiere Plugin * + * Copyright (C) 2008 Posterita Ltd * + * This file is part of POSterita * + * * + * POSterita is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * + *****************************************************************************/ +package org.posterita.aspect; + +import org.compiere.util.Trx; + +/** + * @author ashley + */ +public aspect TrxAspect +{ + pointcut closeTrx(): + call(public boolean Trx.close()); + + before() : closeTrx() + { + ((Trx)thisJoinPoint.getTarget()).rollback(); + } +} diff --git a/posterita/posterita/src/ear/application.xml b/posterita/posterita/src/ear/application.xml new file mode 100644 index 0000000000..924d1f2574 --- /dev/null +++ b/posterita/posterita/src/ear/application.xml @@ -0,0 +1,24 @@ + + + + Web POS + webPOS + + AdempiereSLib.jar + + + Adempiere.jar + + + adempiereApps.jar + + + + posterita.war + /posterita + + + diff --git a/posterita/posterita/src/main/ApproveOrderEmailTemplate.properties b/posterita/posterita/src/main/ApproveOrderEmailTemplate.properties new file mode 100644 index 0000000000..043228afef --- /dev/null +++ b/posterita/posterita/src/main/ApproveOrderEmailTemplate.properties @@ -0,0 +1,6 @@ +subject=Tamak Webstore - Order Approved +action=action +content=,
Your order has been approved. +signin.info=Order Information +link=Your products will be shipped shortly. An email will be sent to notify you when it has been shipped. +emailRegards=Regards,
Tamak Webmaster \ No newline at end of file diff --git a/posterita/posterita/src/main/CreateCustomerEmailTemplate.properties b/posterita/posterita/src/main/CreateCustomerEmailTemplate.properties new file mode 100644 index 0000000000..b5d2c7c746 --- /dev/null +++ b/posterita/posterita/src/main/CreateCustomerEmailTemplate.properties @@ -0,0 +1,12 @@ +subject=Tamak Webstore Account +action=action +&email=&username +&password=&password +signin.info=Your Login Information +login=Login: +password=Password: +content=Thank you for creating an account on Tamak.com + +link=Please click on the link below to automatically log you on Tamak.com. Enjoy! + +emailRegards=Regards,
Tamak Webmaster diff --git a/posterita/posterita/src/main/CreateOrderEmailTemplate.properties b/posterita/posterita/src/main/CreateOrderEmailTemplate.properties new file mode 100644 index 0000000000..6da43c37d7 --- /dev/null +++ b/posterita/posterita/src/main/CreateOrderEmailTemplate.properties @@ -0,0 +1,6 @@ +subject=Tamak Webstore - New Order Received +action=action +content=has created a new order on Tamak Webstore +signin.info=New Order Information +link=Please login on the Administration section to view the order for approval and shipping. +emailRegards=Regards,
Tamak Webmaster diff --git a/posterita/posterita/src/main/Factory.properties b/posterita/posterita/src/main/Factory.properties new file mode 100644 index 0000000000..0cc35a30ec --- /dev/null +++ b/posterita/posterita/src/main/Factory.properties @@ -0,0 +1,127 @@ +#Factory +#Mon Oct 24 12:14:38 GST 2005 +attribute.car.model.id=1016505 +smenu.order.history=1025273 +smenu.product.restriction.id=1056362 +smenu.dealer.transfer.request.id=1050047 +attributeset.car.id=1003664 +smenintu.dealer.transfer.history.id=1050050 +attributeset.bike.id=1003665 +pmenu.dealer.transfer.id=1050045 +smenu.view.all.users.id=1056370 +smenu.messagessent.id=1050002 +discountschema.id=1004556 +pmenu.ordersreceived.id=1050030 +taxCategory.default.id=1003155 +smenu.purchase.order.create.id=1050019 +attribute.bike.modelGroup.id=1016511 +smenu.dealer.order.history=1031333 +smenu.messagescompose.id=1050003 +smenu.movement.id=1056365 +smenu.createsco.id=1050028 +attribute.bike.model.id=1016510 +menu.createLocator.id=1056361 +productCategory.car.id=1003699 +smenu.mmovement.id=1031380 +smenu.allocation.edit.id=1050073 +smenu.view.all.banks.id=1056360 +attribute.bike.trx.id=1016513 +car.assetgroup.id=1000621 +role.HsafAutoAdmin.id=1016896 +smenu.purchase.order.history.id=1050021 +smenu.receive.new.vehicles.id=1050040 +smenu.group.models.id=1056369 +productCategory.usedCar.id=1003700 +pmenu.natis.release.id=1031345 +smenu.inquire.on.vin.number.id=1050014 +superUser.id=1016038 +smenu.createBankAccount.id=1056366 +role.udiAdmin.id=1016895 +smenu.inquiry.id=1031329 +smenu.role.id=1056373 +attribute.car.year.id=1016509 +smenu.view.wholesale.report.id=1050082 +smenu.special.colour.order.received.id=1031337 +smenu.dealer.order.received.id=1050052 +smenu.sell.release.vehicle.id=1050057 +smenu.view.sco.products.id=1031390 +smenu.allocation.orders.view.id=1050075 +smenu.my.certificates.id=1050059 +smenu.release.vehicle.id=1031347 +smenu.my.stock.id=1050012 +wholesale.priceList.purchase.id=1005554 +priceLV.sales.id=1005891 +role.stock.controller.id=1016893 +smenu.search.vin.number.id=1056374 +smenu.dealer.order.reeived.id=1031336 +smenu.view.all.orgs.id=1056371 +smenu.price.listing=1056372 +smenu.view.retail.report.id=1050081 +smenu.licensing.district.id=1031346 +pmenu.sales.id=1050055 +pmenu.stock.inquiry.id=1050008 +role.test.id=1016894 +smenu.view.sales.report.without.trans.id=1050080 +smenu.sco.history.id=1050027 +pmenu.invoice.id=1031338 +smenu.warehouse.id=1056359 +attribute.car.colour.id=1016507 +pmenu.my.details.id=1050004 +smenu.allocation.create.id=1050068 +pmenu.home.id=1049999 +pmenu.messages.id=1050000 +pmenu.payment.id=1031340 +attribute.car.make.id=1016504 +smenu.payment.history=1031341 +attribute.bike.colour.id=1016512 +role.sales.person.id=1016892 +smenu.create.customer.id=1056375 +smenu.new.car.stock.inquiry.id=1050009 +smenu.create.target.sales.id=1056368 +priceLV.purchase.id=1005889 +smenu.allocation.history.id=1050077 +smenu.invoice.history=1031339 +smenu.wholesale.order.history=1050038 +attribute.car.modelGroup.id=1016506 +smenu.productAttribute.id=1056367 +smenu.messagesinbox.id=1050001 +smenu.allocations.view.id=1031354 +role.sales.manager.id=1016891 +smenu.view.certificate.id=1031348 +smenu.upload.cvs.file.id=1050042 +pmenu.dealer.order.id=1050017 +attribute.car.trx.id=1016508 +role.system.administrator.id=1016889 +pmenu.specialcolourorder.id=1050025 +smenu.changeemail.id=1050007 +pricelist.sales.id=1005553 +pricelist.purchase.id=1005552 +pmenu.reports.id=1050078 +smenu.specialcolourorderreceived.id=1050034 +pmenu.admin.id=1050084 +smenu.allocation.order.create.id=1050071 +wholesale.priceLV.purchase.id=1005890 +smenu.create.shipper.id=1056376 +role.HsafWingAdmin.id=1016897 +smenu.view.my.details.ic=1050005 +pmenu.allocation.id=1050065 +smenu.my.used.car.stock.id=1050011 +smenu.sales.history.id=1050063 +smenu.createProduct.id=1056364 +tax.default.id=1002758 +smenu.view.receipt.history=1031344 +pmenu.logout.id=1056377 +smenu.trade.in.id=1050061 +usedCar.assetgroup.id=1000627 +pmenu.inOut.id=1031342 +smenu.view.sales.report.with.trans.id=1050079 +role.dealer.principal.id=1016890 +smenu.view.shipment.history=1031343 +smenu.closemenu.id=1031363 +smenu.changeuserpassword.id=1050006 +smenu.product.inquiry=1031373 +attribute.bike.year.id=1016514 +pmenu.allocations.id=1031350 +pmenu.wholesaler.order.id=1050036 +pmenu.history.id=1050083 +menu.createBPartner.id=1056358 diff --git a/posterita/posterita/src/main/MessageResources.properties b/posterita/posterita/src/main/MessageResources.properties new file mode 100644 index 0000000000..e909b58b6b --- /dev/null +++ b/posterita/posterita/src/main/MessageResources.properties @@ -0,0 +1,1262 @@ +asset.natisrelease.no=NaTIS Release No +asset.natiscontrol.no=NaTIS Control No +asset.register.no=Register No + +assetstatus.hsaf.stock=In Stock +assetstatus.onwater.stock=On Water +assetstatus.retailed=Retailed +assetStatus.wholesaled=Wholesaled + +#Tamak specific +#footer.copyright=All Contents ©2006 Tamak ICT +#title.welcome=Welcome to Tamak POS +#title.POS=Tamak POS + +footer.copyright=All Contents ©2006 Tamak ICT +title.welcome=Welcome to Tamak POS +title.POS=Tamak POS + + + +scostatus.update =Update SCO Status + +# -- standard errors -- +errors.header=

+# -- validator -- + +error.minlength.customerID=Customer ID should be of 13 digits +error.natiscustomer.alreadyexist=This customer already exists on your database.Please select the link "Existing Customer?" and choose the customer. +error.dataAccessException=Your request cannot be processed because some important data is missing. Please contact the System Administrator for more details. +error.operationException=Please specify an order to view +error.systemException=An error has been detected. Please contact the System Administrator for more information. +error.runtimeException=An runtime error has occurred. Please contact the System Administrator for more details +errorpage.title=Errror Page +errorpage.heading=You have performed an illegal operation. +errors.invalid={0} is invalid. +error.required={0} is required. +error.match={0} do not match. +error.date.prior.today=ArrivalDate cannot be prior to today's date. +error.dateRangeNotValidException=Date range is not valid. Please try another one +error.match.password=Your passwords do not match. Please retype your new password. +error.match.newPassword=Your passwords do not match. Please retype your new password. +error.match.newEmail=Your emails do not match. Please retype your new email. +errors.maxlength={0} can not be greater than {1} characters. +errors.minlength={0} can not be less than {1} characters. +errors.range={0} is not in the range {1} through {2}. +errors.required={0} is required. +errors.byte={0} must be a byte. +errors.date={0} is not a date. +errors.double={0} must be a double. +errors.float={0} must be a float. +errors.integer={0} must be an integer. +errors.long={0} must be a long. +errors.short={0} must be a short. +errors.creditcard={0} is not a valid credit card number. +errors.email={0} is an invalid e-mail address. +error.numberformatexception.quantity=Please enter a numeric value for quantity. +error.numberformatexception.customerIdBookNumber=Please enter a numeric value for customer ID Book Number. +error.numberformatexception.customerID=Please enter numeric values only for customerID. +error.role.Invalid=Role cannot be found. Please try login again with another role. Contact your System Administrator if the problem persists. +error.illegal.access=You cannot view this order because it does not belong to you. +error.noStock.Available=Quantity available in stock is less than input quantity for {0} {1} {2} {3} +error.webstore.noStock.Available=Quantity available for {0} is {1}. You cannot order for an amount more than {1} +error.orderedQuantity.invalid=Ordered quantity must be greater than 0 +error.productquantity.invalid=Ordered quantiry must be greater than 0. +error.invoice.nolineselected=Please select at least one line to generate invoice. +error.csvfile.invalid=There are errors in File, please delete the old file and download again to see the errors. +error.file.not.found=Please attach a file +error.stock.not.available=The Required Stock is Not Available. {0} +error.inventory=No Inventory Available. {0} +error.inventory.not.available=Insufficient Inventory Available. {0} +error.vehicle.alreadyReleased=The vehicle has already been released. +error.shipper.alreadyExists=Shipper already exists. Please choose another name. +error.allocationname.alreadyused=The name you supplied has already been used. Please input another one. +error.notallvins.available=Not all VIN numbers are currently available. +error.poReference.invalid=Please enter a valid reference number. +error.ftp.file=The file contains a VIN number that is already present in the system. This file may have already been processed. +error.naamsaModelCode.exist=The code you have entered already exist. Please enter another one. +error.naamsaDealerCode.exist=The code you have entered already exist. Please enter another one. +error.salesrep.required = Please select a sales representative. +error.date.notselected = Please choose a date. +error.emptycart = Your cart is empty! +error.trackingNo.not.found=Please Specify the Tracking Number of FedEx. +error.in.file=There is an error in the file, Please check for the for the ";" in the file and replace it by ","
and no field should be empty
If there is no discount and limit price, please make them same a the one for the List Price.
also check whether the tax rate that has been defined in the file exists. +error.invalid.address=The Customer does not has any address, Please Edit the customer. +error.invalid.orderType=The Order is not a POS Order, Please check the Document No +error.no.checkbox.selected=Please select a checkbox + +error.client.alreadyexist=Client with the name provided already exist +error.client.create=Could not create client with the details provided.
Please contact POSterita (info@posterita.org) for support.
Cause:{0} + + +error.allocation.notclosable=Cannot close allocation because one or more lines are not Accepted yet +error.allocation.report.notselected=Please select an allocation to generate report. +error.allocation.notselected=Please select an allocation to generate order. +error.vin.already.exists=VIN number has already been used. +error.role.already.exists = The name has already been used. Please enter another name. +error.role.edit=Could not edit role +error.attributevalue.description.exception = Please enter a description +error.too.many.invoice=Only one invoice at a time can be allocated with payments and credit memo. +error.allocation.amt.exceeds.openamt=Allocation amount is more than the open amount for invoice, can not allocate +error.no.invoice.to.allocate=Please select an invoice to allocate. +error.securityException=You are trying to view an order, that does not belong to your organisation. +error.required.agreement=You must agree to the terms and conditions before confirmation. +error.required.checkbox=Please make a selection. +error.required.sernoAttributeSetInstanceIds=Please select a product. + +error.notfound={0} not found. +error.required.productChange={0} +error.required.model=model. +error.required.colour=colour. +error.required.transmission=transmission. +error.required.year=year. +error.required.bpartnerId=Please enter the customer +error.required.amount.given=Please enter the amount given +error.required.paymentTermId=Please select a Payment term +error.product.name.required=Please enter a product +error.cannot.deactivate.paymentTermName=Cannot Deactivate PaymentTerm, Some customers are associated with it; + +error.required.username=Name is required. +error.required.userSurname=Surname is required. +error.required.password=Password is required. +error.required.oldPassword=Please enter your old password. +error.required.newPassword=Please enter your new password. +error.required.confirmPassword = Please confirm your new password. +error.required.creditCardNumber=Credit Card Number is required. +error.required.address1=Address is required +error.required.city = City is required +error.required.postalAddress = Postal Address is required +error.required.email = Please enter Email Address. +error.required.newEmail=Please enter your new email address. +error.required.confirmEmail=Please confirm your new email address. +error.wrong.old.password=The Old Password is wrong. +error.wrong.password.matching=The passwords do not match +error.wrong.password.length=The passweod should be at least six characters long + +error.required.warehouseName = Warehouse Name is required. +error.required.orgName = Organisation Name is required +error.required.poReference = Please enter a reference no. +error.required.orderId=Please enter a valid order Id +error.update.sequence=An error has been encountered while updating sequence, Please check database connection + +error.required.poreference=Please enter the purchase order number. +error.required.assetID=Please choose a VIN number. +error.required.description= Please enter description. +error.required.priceEntered=Please enter purchase price. +error.required.vinNumber=Please enter a VIN Number. +error.numberformatexception.priceEntered=Please enter a numeric value for purchase price. +error.invalid.barcode=Invalid Barcode! Barcode is either empty or null. + +error.required.name=Please enter name. +error.required.Surname=Please enter surname. +error.required.custIdNumber=Please enter customerID. +error.required.physicalCity=Please enter physical city. +error.required.physicalPostalCode=Please enter physical postal code. +error.required.physicalStreet1=Please enter physical street1. +error.required.postalCity=Please enter postal city. +error.required.postalPostalCode=Please enter postal code. +error.required.phone1=Please enter home Tel. +error.required.phoneNo=Please enter work tel. +error.required.cell=Please enter cell no. +error.required.aaCardnumber=Please enter card AA No. +error.natisRelease.firebird=Your vehicle has been transmitted to NaTIS and is queued for release. +error.duplicate.reference=You have already used this reference. Please use another one. +error.usernameAlreadyUsed=The username you provided already exists. Please choose another username. +error.name.exists=The name and surname you provided already exists. Please login with your email address. +error.email.exists=The email already exists. Please use another email address. +error.customer.id=Only numeric values are allowed for Customer Id Number. +error.email=Email has not been sent +error.duplicate.vin=You have selected vehicles with the same VIN number. Please make sure that all vehicles have been assigned different VIN numbers. +error.warehouse.alreadyexists = Warehouse already exists. Please choose another name. +error.targetQuantity.invalid = Please enter valid quantity. + +error.cannot.delete.order=Cannot Delete order as it has been invoiced +error.bp.alreadyexist=This customer already exists in your database. Please select the link /"Existing Customer" and choose the correct customer. +error.model.alreadyGrouped = Model already grouped +error.bank.already.exist=Bank already exists +error.attributevalue.alreadyexist = Value already exists +error.year.attributevalue.invalid = Please enter a valid year +error.product.alreadyexist = Product Already Exists, Please enter a new one +error.year.attributevalue.formatting.exception = Please enter numerical values for year +error.year.length.invalid = Invalid year. Length should be 4. +error.product.not.selected = Please select a product +error.bp.notselected=Please choose a Customer +error.no.vin.number=Please Specify a complete VIN Number +error.invalid.period=Start date should not be greater than end date. +error.required.fromDate = Please select start date. +error.required.toDate = Please select end date. +error.already.released= The Vehicle is already released, Can not swap the Vehicle +error.product.selected.not.same.warehouse=Warehouse of the selected products are different,please select the products from same warehouse +error.cannot.create.inventory.line==Cannot create Inventory line for the products which are service,
Please make the product item and then make a purchase. +error.ftp.novehicles = There is no vehicle for your Organisation in the FTP file uploaded + +error.vehicle.vinAlreadyPresent = The vin number entered is already present in the system. +error.vehicle.unitNumberPresent = The unit number entered is already present in the system. +error.numberformatexception.enginePower = Please enter a numeric value for Engine Power. +error.numberformatexception.natisModelNo = Please enter a numeric value for NaTIS Model Number. +error.numberformatexception.noOfWheels = Please enter a numeric value for No. of wheels. +error.numberformatexception.tare = Please enter a numeric value for Tare. +error.numberformatexception.engineCapacity = Please enter a numeric value for Engine Capacity. + + +error.modelmatching.notfound = Model Matching not found. +error.modelmatching.alreadyexist = Model Matching already exist +error.deactivatingproductinstock = Cannot deactivate product(s) as there are still some in HSAF or Dealers' stock. +error.orderId.null = Please enter an Order Id. +error.order.notExist = The Order does not exist. Please enter a valid Order Id. +error.order.noOrderline.selected = Please select at least one orderline to delete. + +error.product.keywords.required=Keywords are mandatory. Please set them before making a product featured in Webstore. + +error.colourmatching.alreadyexist=Colour Code Matching Already Exist +error.colourmatching.invalid=Colour Code Matching is invalid +error.colourmatching.errorsave=Could not save Colour Code Matching details + +error.import.nolineselected=You should choose at least one import line for processing +error.invalid.inputQty=Please enter a quantity greater than 0 +error.invalid.totalQty=Please enter a quantity per Size! +error.quantity.notAvailable=Entered quantity not available for {0} +error.updating.product=Could not update the status of the selected products +error.product.not.found=Product Not Found! +error.check.inserted.value=Please check the value inserted qty and the barcode should be separated by + sign +error.product.attributes.different=Cannot update Products with different attributes +error.updating.attribute=Could not change the specified Attribute Value +error.product.price.not.found=Product is Not On PriceList {0} +error.product.already.exists=Product already exists +error.barcode.already.exists=Barcode already exists +error.barcode.required = Barcode is required +error.reason.required = Please type in the reason +error.qty.required = Quantity is required +error.total.zero = Please check total amount. Cannot be zero +error.product.cannot.inactivate=product cannot be inactivated /Make it Services {0} +error.invalid.content= The Content of the uploaded file are wrong, should be an image +error.pos.no.orderline=There are no orderline in the order, please create a new order +error.no.transfer.amount=Please enter some amount +error.transferAmt.exceeds.endingBalance=Amount exceeding the ending balance, can not create transaction +error.cannot.close.till=The Till is already closed, can not transfer any amount until a new cash order is created
To transfer only card and cheque amount insert transfer amount as 0 and press submit +error.invalid.number=Please insert a valid number +tax.rate.not.defined=The Tax rate is not defined,Please define it {0} +error.required.revenue.recognition=Please enter Revenue Recognition +error.duplicate.product=Duplicate product name in the file Or the product already exists in the system {0} +error.duplicate.barcode=Duplicate barcode in the file Or the barcode already exists in the system {0} +error.cannot.adjust.till=The till is closed,cannot adjust the amount now +error.till.already.close=The Till is closed, can not close it again
To transfer only card and cheque amount just press submit +error.duplicate.userpin=The User Pin Already exists. +error.paymentTermName.duplicate=The Payment Term Name already Exists. +error.net.days.cannot.be.negative=Net Days cannot be negative or null. +error.name.mandatory = Please type the name +error.bpartner.over.credit.limit=Customer exceeds Credit Limit
{0} +error.bpartner.no.payment.term=Customer does not has a Payment Term,Please create one +error.insufficient.qty={0} +error.limit.price.violated={0} + +error.taxname.duplicate=Tax name already exists +error.taxrate.duplicate=Tax rate already exists +error.name.required=Please Insert the Name +error.required.field=field required {0} +error.tax.rate.nagative=tax rate cannot be negative +error.discount.nagative=Discount(s) cannot be negative +cannot.inactivate.tax=Cannot deactivate tax, some products have this tax + + +error.pos.payment.invalidCashAmount=Please enter a numeric value for Cash Amt. +error.pos.payment.invalidCardAmount=Please enter a numeric value for Card Amt. +error.pos.payment.invalidChequeAmount=Please enter a numeric value for Cheque Amt. +error.pos.incorrect.tendered.amount=Please enter the exact tender amount. +error.paymentamount.mandatory=Please enter Payment Amount. +error.allocate.amt.exceeds=Allocated Amt. exceeds the open amt of Invoice {0} +error.allocate.amt.payamt.notequal=Allocated Amt is not equal to the Payment Amt {0} + +error.collection.dir=Image Collection directory does not exist: {0} +error.inactive.collection.dir=Inactive Image Collection directory does not exist: {0} +error.errors.dir=Error image directory does not exist: {0} +error.synchronize.products.collection=Could not synchronize product collections: {0} + +error.related.product=No product found related with this attribute value +error.invalid.datetime=The date and time provided is invalid + +error.order.delete=Could not delete this order + +error.sessions.exceeded=You cannot log into the system.
Number of Licensed Sessions, ({0}), will be exceeded.
Please contact your administrator for further details. +error.requests.exceeded=The number of operations that you have performed has exceeded the limit that has been set for your license of Tamak ICT POS.
Please contact your administrator for further details. +error.license.invalid=Your license is invalid. Please change your licensing details as appropriate. +error.license.unexpected=An unexpected error has occurred. Please try to perform again all the operations that caused this error.
In case this error occurs again, please contact your administrator.
Details: {0} +error.licensinginfo.update=Licensing information could not be updated. Cause\: {0} +login.passwordError= Password is invalid +error.invalid.pin=Invalid User PIN +error.duplicate.pin=More than one user has the same PIN +error.customer.not.exists=The customer is either not present or is not active +error.vendor.not.exists=The vendor is either not present or is not active +# -- other -- +errors.cancel=Operation cancelled. +errors.detail={0} +errors.general=The process did not complete. Details should follow. +errors.token=Request could not be completed. Operation is not in sequence. + +error.required.vin.number=Please enter a VIN number +error.invalid.orderId=Order does not exist! +error.invoke.status=Cannot invoke order with status: {0} +# -- welcome -- + + +address = Address: +postaladdress = Postal Address: +city = City: +region = Region: + +welcome.title=Struts Blank Application +welcome.heading=Welcome! +welcome.message=To get started on your own application, copy the struts-blank.war to a new WAR file using the name for your application. Place it in your container's "webapp" folder (or equivalent), and let your container auto-deploy the application. Edit the skeleton configuration files as needed, restart your container, and you are on your way! (You can find the application.properties file with this message in the /WEB-INF/src/java/resources folder.) +login.emailNotFound=There is no email set for you please check with your administrator +login.userNotFound=Your Username can not be found on the system. +login.alreadyLogin=You are already logged in! Please logout before you attempt to login again. + +admin.changeEmail.title=Change My Email Address +admin.changeEmail.oldEmail=Old Email Address: +admin.changeEmail.newEmail=New Email Address: +admin.changeEmail.confirmEmail=Retype New Email Address: +admin.viewRoles.title=View All Roles + +admin.changePassword.title=Change My Password +admin.changePassword.old=Old Password: +admin.changePassword.new=New Password\: +admin.changePassword.confirm=Retype New Password\: + +admin.home.title=Dealer Admin - Document Storage +admin.home.link.stocks=My Stock +admin.home.link.certificates=My Certificates +admin.home.link.invoices=Invoices +admin.home.link.creditNotes=Credit Notes +admin.home.link.statements=Statements +admin.home.link.rebates=Rebates +admin.home.link.other=Other +admin.home.link.changePassword=Change Password +admin.home.link.changeEmail=Change Email Address +admin.home.link.viewMyDetails=View My Details +admin.invalidEmailError=You entered an invalid email address. +admin.wrongPasswordError=You wrongly entered your old password. + +admin.emailChanged.title=Email Address changed +admin.emailChanged.message=Your email has been changed. +admin.myCertificates.title=My Certificates +admin.myStocks.title=Available Stock - Not Yet Released +admin.passwordChanged.title=Password changed +admin.passwordChanged.message=Your password has been changed. +admin.userDeleted.title=User deleted +admin.userDeleted.message=You have successfully deleted the User. +admin.userDetails.title=User Details +admin.userForm.title=Create User +admin.userForm.select=Select User Role: +admin.viewMyDetails.title=My Details +admin.viewMyDetails.email=Email Address\: +admin.viewMyDetails.dealerName=Dealer Name: +admin.viewMyDetails.dealerCode=Dealer Code: +admin.viewMyDetails.phone=Phone Number: +admin.viewMyDetails.fax=Fax Number: +admin.viewMyDetails.deliveryAddress=Delivery Address: +admin.viewUsers.title=View All Users +admin.viewUsers.username=Username +admin.viewUsers.userRole=User Role +admin.viewUsers.editDelete=Edit/Delete User + +allocation.home.title=Allocations +allocation.home.link.result=Allocations +allocation.home.link.request=Allocation Requests +allocation.home.link.swap=Swap +allocation.request.confirm=Please confirm your allocation request +allocation.results.title=Allocations +allocation.results.vehicle.allocation=Your vehicle allocations for March 2005 are as follows: +allocation.results.eta=ETA +allocation.results.action=Action +allocation.results.accept=Accept +allocation.results.reject=Reject + +mmovement.title=Material Movement\t\t\t\t\t\t\t +mmovement.warehouse=Warehouse +mmovement.documentNo=Document No: +mmovement.description=Description: +mmovement.locator=Locator: +mmovement.destinationLocator=Destination Locator: +mmovement.header=Material Movement +mmovement.product.name=Name +mmovement.product.details=Details +mmovement.product.quantity=Quantity +mmovement.product.move=Move +mmovement.region=Region +mmovement.move=Move +mmovement.track=Track +mmovement.allWarehouses=All +mmovement.selectWarehouse=Move to Warehouse: +mmovement.button.confirm=Confirm +mmovement.button.complete=Complete +mmovement.button.delete=Delete +mmovement.button.cancel=Cancel +mmovement.documentStatus=Document Status: + + +mmovement.track.title=Track Material Movement +mmovement.track.header=Track Material Movement + +allocation.results.time.remaining=Time Remaining for this allocation: +allocation.results.time.numDays=22 days +allocation.results.swap.allocation=*NB: Should you choose to swap an allocated vehicle, the system will automatically accept that allocation. +allocation.resultsConfirm.title=Allocation - Allocation submitted +allocation.resultsConfirm.message=Thank You. Your allocations have been submitted. +allocation.status=Allocation Status +allocation.swap.title=Vehicle Allocation Request +allocation.swap.heading=Vehicle Allocation Request +allocation.swap.vehicles=Vehicles available for swap +allocation.swapConfirm.submit=Your request for swap has been submitted. +allocation.swapProcess.title=Swap Process +allocation.swap=Swap + +asset.status= Asset Status + +days.old=Days Old + +button.add=Add +button.cancel=Cancel +button.confirm=Confirm +button.create=Create Order +button.delete=Delete +button.edit=Edit User +button.process=Process Order +button.search=Search +button.submit=Submit +button.save=Save +button.reply = Reply +button.complete=Complete +button.createwarehouse=Create Warehouse +button.invoice = Create Invoice + + +dealer.order=Order +dealerOrder.cancelOrder.title=Dealer Order - Order cancelled +dealerOrder.cancelOrder.message=This order has been cancelled. +dealerOrder.createOrder.title=Dealer Order +dealerOrder.home.title=Orders +dealerOrder.home.link.result=Dealer Orders +dealerOrder.home.link.specialColour=Special Colour Orders +dealerOrder.home.printOrder=Dealer Order - Print Order +dealerOrder.input.all=Please input all values. +dealerOrder.process.title=Dealer Order - Order processed +dealerOrder.process.message=Thank You, Your orders have been processed +dealerOrder.results.title=Dealer Order - Results +dealerOrder.specialColour.title=Special Colour Orders +dealerOrder.specialColour.submission=*NB: Must be submitted four months in advance for Accord, All other models - 3 months in advance. +dealerOrder.createSpecialColour.title=Create Special Colour Order + +dealerOrder.terms.title=Dealer Order - Terms and Conditions +dealerOrder.terms.heading=Terms and Conditions +dealerOrder.terms.term1=All orders placed by the dealer (whose name and details appear on this order form) ("the Dealer") shall be final and binding on the Dealer once the Dealer has signed this order form and delivered the original signed order form or a copy thereof to Honda South Africa (Pty) Ltd (registration number 2000/010675/07) ("HSAF"). The Dealer shall not be entitled to cancel its order, return any of the Honda Products reflected on this order form or obtain a credit for Honda Products without HSAF's prior written consent. + +dealerOrder.terms.term2=The Dealer's order shall not be binding on HSAF until acceptance thereof by HSAF (whether in whole or in part) by the duly authorized HSAF divisional manager signing this order form in the space provided therefor. + +dealerOrder.terms.term3=Ownership in and to Honda Products forming the subject matter of this order form shall remain vested with HSAF until those Honda Products have been delivered to or collected by the Dealer, as the case may be, and HSAF has received payment in full of the total amounts reflected on this order form. The risk of loss and damage to the Honda Products reflected on this order form shall pass to the Dealer upon the collection or the delivery of those Honda Products to the Dealer, notwithstanding the fact that the Dealer has not paid HSAF in full for those Honda Products and that the Dealer is not the owner of those Honda Products. + +dealerOrder.terms.term4=Any purported variation on this order form of the provisions of any written agreement(s) concluded between HSAF and the Dealer in respect of the Honda Products shall not take precedence over the terms of those written agreements, notwithstanding HSAF's signature on this order form. + +dealerOrder.terms.term5=By the Dealer's signature of this order form, the Dealer acknowledges and agrees that it has read and understood the terms and conditions set out on this order form and agrees to be bound to those terms and conditions. + +dealerOrder.terms.term6=HSAF reserves the right at any time and from time to time to change or modify, without notice, the terms and conditions set out in this order form. + +dealerOrder.terms.term7=Notwithstanding the signature hereof by HSAF, HSAF will have obligation, under any circumstances, to accept orders for any Honda Products which are not in this current inventory. + +dealerOrder.terms.term8=For the purposes of this order form, Honda products means: +dealerOrder.terms.term8a=such new motorcycles and automobiles as are from time to time offered for sale by HSAF to Dealer for resale as part of HSAF's motorcycle or automobile line as determined by HSAF in its sole discretion; and/or + +dealerOrder.terms.term8b=all industrial and domestic engines manufactured by HSAF which form part of HSAF's engine line as determined by HSAF in its sole discretion; and/or\t\t\t + +dealerOrder.terms.term8c=all power products which form part of HSAF's power product line as determined by HSAF in its sole discretion, including without limitation, all HSAF generators, lawn mowers, brushcutters and water pumps; and/or + +dealerOrder.terms.term8d=all parts, accessories and optional equipment marketed by HSAF for use of with motorcycles, engines, automobiles and power products referred to above. + + +dealerOrder.qty.greaterThanZero=The quantity specified must be greater than zero. +dealerOrder.noOrders=Please add at least an order. + +dealerOrder.must.agree=You must agree to the terms and conditions before confirmation. + + +include.footer.poweredBy=Powered by UDI Technology +include.footer.allContent=All Content © 2005 Honda South Africa +include.header.link.loginSuccess=  Home +include.header.link.stockAction=  Stock Inquiries +include.header.link.dealerOrderHome=  Dealer Orders +include.header.link.natisReleaseHome=  NaTIS Release +include.header.link.allocationHome=  Allocations +include.header.link.interDealerHome=  Inter Dealer Transfers +include.header.link.adminHome=  Dealer Admin +include.header.link.loginActionNoInput=  Logout +include.header.link.myorders=My Orders + +interdealer.transfer=Transfer +interDealer.cancelTransfer.message=You have cancelled this request. +interDealer.dealerTransferOrder.title = Inter Dealer Transfer +interDealer.dealerTransferOrder.heading = Dealer Transfer: Request +interDealer.home.title=Dealer Transfers +interDealer.home.link.request=Request +interDealer.home.link.receiving=Receiving +interDealer.process.title=Dealer Transfer - Request sent +interDealer.process.message=Your request has been transmitted. +interDealer.request.title=Dealer Transfer - Requests +interDealer.receiving.title=Dealer Transfer - Receiving +interDealer.receiving.from=From: +interDealer.receiving.accept=Accept +interDealer.receiving.reject=Reject +interDealer.receiving.reason=Reason for rejection + +login.choose.title=Please choose a User from any of these Dealers +login.forgot.forgotPassword=Forgot your password?
Please enter your username and we will send your password to your email address +login.forgot.username=Username\: +login.forgot.sendPassword=Send Password +login.home.title=Welcome to Posterita POS +login.home.title.part1=Welcome to +login.home.title.part2=Posterita POS +login.home.login=Please Login +login.home.username=Username\: +login.home.password=Password: +login.home.loginButton=Login +login.home.loginForgot=Forgot password? +login.loginForm.message=Please enter your username and password.Remember your email is your username
NB: Case sensitive. +login.logout.logoutSuccess=You have successfully logged out. +login.logout.backToLogin=  Click Here to go back to the Login Screen +login.password.passwordSent=Your password has been sent you should receive it in a few minutes +login.password.backToLogin=  Click Here to go back to the Login Screen +login.password.emailTitle= Your password reminder. +login.password.emailSubject=The password to log in into the POS System is: +login.success.welcome=Welcome to Posterita
POS System +login.userInactive=Your user has been set inactive. + +menu.title = Menu +menu.close = Close Menu +menu.closed = Menu Closed +menu.isActive = Is Active +menu.list = List of Menu +menu.description = Description + +#============Email Errors============ +email.subject.error = Please enter a subject for the email +email.message.error = Please enter your message +email.send.error = Email cannot be sent. Please Check if you have properly configured your smtp host. + +#==================================== + +message.title = Create Message +message.from = From: +message.to = To: +message.recto = To +message.subject = Subject: +message.recsubject = Subject +message.writemessage = Message: +message.senttitle = Message Sent +message.sent = Your Message has been sent +message.sentmessages = Sent Messages +message.mymessages = My Messages +message.received = Received Messages +message.sender = Sender +message.date = Date +message.viewdate = Date: +message.view = View Message +message.markas = Mark as +message.delete = Delete +message.reply = Reply Message +message.viewreceivedmessage = View Received Message +message.viewsentmessage = View Sent Message +message.sendbutton = Send +message.goback = Go Back + +myorders.home.title=My Orders - Home +myorders.home.heading=My Orders + +myorders.orders.dealerorders.link=Dealer Orders +myorders.orders.scoorders.link=Special Colour Orders +myorders.orders.requesttransferorders.link=Dealer Transfer Orders + +myorders.purchaseorders.home.link=Purchase Orders +upload.file = Please attach the file for creating orders +download.file=Download file + +myorders.result.title=My Orders Result +myorders.result.heading=My Orders - Result +myorders.result.dateOrdered=Date Ordered +myorders.result.bpartnerName=Dealer +myorders.result.docStatus=Doc Status +myorders.result.hsafRef=HSAF Ref ID +myorders.result.poreference=PO Reference +myorders.result.grandTotal=Grand Total +myorders.result.viewOrder=View Order +myorders.result.orderfrom=Ordered From + + + +myorders.salesorders.home.link=Sales Orders +myorders.purchase.order= Purchase Order + +mycertificate.title = My Certificates +mycertificate.viewCertificate = View Certificate + + +natisRelease.home.title=NaTIS Release +natisRelease.process.title=NaTIS Release - Vehicle released +natisRelease.process.message=Thank you, the Vehicle has been released +natisRelease.release.name=Name +natisRelease.release.surname=Surname +natisRelease.release.idNumber=ID Number\: +natisRelease.release.physicalAddress=Physical Address +natisRelease.release.postalAddress=Postal Address +natisRelease.release.homeTelephone=Home Telephone +natisRelease.release.workTelephone=Work Telephone +natisRelease.release.cell=Cell +natisRelease.release.fax=Fax +natisRelease.viewCertificate.title=View Certificate +natisRelease.viewCertificate.message=Your NaTIS Certificate for this vehicle has been released. +natisRelease.viewCertificate.download=Click here for your certificate. +natis.order.history = NaTIS Release Sales History + +order.dealerPONo=Dealer Purchase Order No:  +order.HSAFRefNo=HSAF Ref No:  +order.terms=Terms and Conditions compulsory +order.specialColour=Special Colour Order +order.print=Printer Friendly Version + +orderView.orderFooter.use=FOR OFFICE USE +orderView.orderFooter.roNo=R/O NUMBER +orderView.orderFooter.invoiceNo=INVOICE NUMBER +orderView.orderFooter.dealerAuthor=DEALER AUTHORISATION: +orderView.orderFooter.signature=SIGNATURE: +orderView.orderFooter.recvBy=HSAF RECEIVED BY: +orderView.orderFooter.divMgr=AUTHORISED DIV MANAGER:  (Name & Sign.) + +orderView.orderHeader.honda=HONDA S.A AUTOMOBILE
DEALER ORDER +orderView.orderHeader.att=ATT: +orderView.orderHeader.fax=FAX: +orderView.orderHeader.tel=TEL: +orderView.orderHeader.date=DATE: +orderView.orderHeader.orderNo=DEALER ORDER NO: +orderView.orderHeader.dealerCode=DEALER CODE: +orderView.orderHeader.dealerName=DEALER NAME: +orderView.orderHeader.delAddress=DELIVERY ADDRESS: + +orderView.orderPriceDetails.subTotal=SUB TOTAL +orderView.orderPriceDetails.vat=VAT +orderView.orderPriceDetails.orderTotal=ORDER TOTAL + +product.create.car = Create New Car +product.create.bike = Create New Bike +product.create.usedcar = Create Used Car +product.create.usedbike = Create Used Bike +product.create.usedcar.attributevalue = Create Used Car Attribute Value +product.create.usedbike.attributevalue = Create Used Bike Attribute Value +product.create.car.attributevalue = Create New Car Attribute Value +product.create.bike.attributevalue = Create New Bike Attribute Value + +product.create = Create Product +product.details = Product Details +product.make=Make +product.model=Model +product.colour=Colour +product.transmission=Transmission +product.year =Year +product.purchase.price = Purchase Price +product.sales.price = Sales Price +product.wholesale.price= Wholesale Price +product.retail.price= Retail Price +product.quantity=Quantity +product.price=Price +product.vinNo=VIN No. +product.order=Order +product.salesRegion=Sales Region +product.request=Request +product.sendRequest=Send Request +product.release=Release +product.reserved=Reserved +product.status=Status +product.all=All +product.umodel=MODEL +product.ucolour=COLOUR +product.utransmission=TRANS +product.frameNo=FRAME NUMBER +product.uquantity=QTY +product.uprice=PRICE Ex VAT +product.uVAT=VAT +product.dealer=DEALER +product.uTotal=TOTAL +product.colourType=Colour Type +product.colour.group=Colour Group +product.wholesaleDate=Wholesale Date +product.natisApplicationDate=NaTIS Application Date +product.hide=Hide +product.refNo=Reference No +product.ordId=Order ID +product.ordBy=Order By +product.ordDate=Date Ordered +product.doctype=Doc Type +product.type = Product Type +product.home.title = Select Products For Order +product.isNatisReleased = Is NaTIS Released +product.description = Description +product.restriction = Product Restriction +product.name = Product Name +product.restrict = Restrict +product.pricelist = Pricelist +product.newprice = New Price +product.oldprice = Old Price +product.price.edit = Edit Product Price + +reprice.orders=Reprice Orders + + +customer.details=Customer's Details +customer.licensing.desc=Licensing Option Description +customer.finance.option=Finance Option Description +trade.in.make=Trade In Make +trade.in.makeModel=Trade In Make Model +trade.in.year=Trade In Year +customer.idBookNo=ID Book Number +engine.no=Engine Number +maintenance.contract=Maintenance Contract +registration.status=Registration Status + +sc.dealerOrder.home.quantity=Quantity + +target.sales.title = Target Sales +target.sales.month = Month +target.sales.year = Year +target.sales.ModelGroup = Model Group +target.sales.Quantity = Quantity +target.sales.organisation = Organisation + +stock.home.title=Stock Inquiry +stock.inquiry.show=Show ONLY stock from HSAF +stock.not.reserved.show=Show ONLY available stock +stock.process.title=Stock Inquiry - Request sent +stock.process.message=Thank You, your request has been sent +stock.filter.by=Filter by: + +error.workflow.violation=You can only progress in this application using the buttons and the menu that are offered. Hitting the browser's reload button or using the back button is not allowed. + +user.create = Create User +user.created = User Created +user.username=Username: +user.role=User Role: +user.password=Password: +user.address = Address: +user.city = City: +user.postaladdress = Postal Address: +user.region = Region +user.email=Email Address: +user.phone = Phone No: +user.cellphone=Cell Phone: +user.confirmPassword=Confirm Password: +user.isActive = Is Active +user.isSalesRep = Is Sales Representative +user.details = User Details +user.pin=User PIN +user.docBasisType=Document Basis for Commission +user.comm.per=% Commission for the sales rep +user.comm.fre=Calculation Frequency +user.substract.amt=Substract Amt** +user.substract.exp=**The Subtract Amount indicates the amount to subtract from the total amount prior to calculation of commission + +choose.VIN=Choose VIN Number + +select.month=Month +select.year=Year +select.status=Status +view.all=All + +calendar.day.default=Day +calendar.month.default=Month +calendar.year.default=Year +calendar.month1=Jan +calendar.month2=Feb +calendar.month3=Mar +calendar.month4=Apr +calendar.month5=May +calendar.month6=Jun +calendar.month7=Jul +calendar.month8=Aug +calendar.month9=Sep +calendar.month10=Oct +calendar.month11=Nov +calendar.month12=Dec +asset.owner=Owned By +queryVinNo.title=Query VIN No. +vinNo.search=Search VIN No. +vinNo.query=Query on the Status of VIN Number +vinNoDetails.title=VIN Number Details +searchOrderByRef.title=Query Order Reference Number +search.orderID=Search Order Ref No. +text.yes=Yes +text.no=No +query.dealers.stock.title=Query Dealers Stock + +bPartner.title = Business Partner +bPartner.create = Create Business Partner +bpartner.details = Business Partner Details +bpartner.name = Name +bpartner.name2 = Name2 +bPartner.address = Address +bPartner.address1 = Address1 +bPartner.address2 = Address2 +bPartner.postal.address = Postal Address +bPartner.city = City +bPartner.phone=Phone Number +bPartner.fax=Fax Number +bpartner.edit = Edit +bpartner.view = View +bPartner.isActive = Is Active: +bPartner.isCustomer = Is Customer: +bPartner.isVendor = Is Vendor: +bPartner.isEmployee = Is Employee: +bPartner.isSalesRep = Is Sales Rep: +bPartner.region = Region +bPartner.edit = Edit Business Partner Details +bPartner.credit.limit = Credit Limit +bPartner.credit.status = Credit Status +bPartner.dunning = Dunning + +bank.create = Create Bank +bank.name = Bank Name +bank.address = Address +bank.postaladdress = Postal Address +postal.address = Postal Address +bank.city = City +bank.routingnumber = Routing Number +bank.details = Bank Details + +locator.details = Locator Details +locator.create = Create Locator +locator.warehouse = Warehouse +locator.aisle = Aisle +locator.bin = Bin +locator.level = Level +locator.default = Is Default + +bAccount.create = Create Bank Account +bAccount.bank.name = Bank Name +bAccount.no = Account Number +bAccount.type = Account Type +bAccount.current.balance = Current Balance +bAccount.type.checking = Checking +bAccount.type.saving = Saving +bAccount.details=Bank Account Details + +order.history = Order History +invoice.history = Invoice History +payment.history = Payment History +inout.shipment.history = Shipment History +inout.receipt.history = Receipt History + + +history.receiptNumber = Receipt Number +history.shipmentNumber = Shipment Number +history.orderNumber = Order Number +history.invoiceNumber = Invoice Number +history.documentNumber = Document Number +history.documentStatus = Document Status +history.dealerName = Dealer Name +history.date = Date +history.dateInvoiced = Date Invoiced +history.dateOrdered = Date Ordered +history.grandTotal = Grand Total +history.isDelivered = Is Delivered +history.isInvoiced = Is Invoiced +history.isPaid = Is Paid +history.isReceipt = Is Receipt +history.paymentId = Payment Id +history.paymentAmt = Payment Amt \t +history.transactionDate = Transaction Date +history.orderReference = Order Reference +history.isSotrx = Is Sales Order + +warehouse.create = Create Warehouse +warehouse.created = Warehouse Created +warehouse.details = Warehouse Details +warehouse.wname = Warehouse Name +warehouse.name = Warehouse +warehouse.address = Address: +warehouse.postaladdress = Postal Address: +warehouse.city = City: +warehouse.region = Region +warehouse.isPublic = Is Accesible to Dealers +warehouse.isActive= Is Active +is.warehouse.allocation= Is Allocation Warehouse +warehouse.type=Warehouse Type +warehouse.all = All Warehouses +product.attribute.create = Create Product Attribute Value +product.attribute.set = Vehicle +product.attribute.name = Attribute +product.attribute.value = Value +product.attribute.value.created = Product Attribute Value Created +product.attribute.existingValues = Existing values +product.selected = Selected Products +quantity = Quantity + +engine.number= Engine Number +natis.application.date=NaTIS Application Date +natis.release.date=NaTIS Release Date +natis.control.number=NaTIS Control Number +natis.model.number=NaTIS Model Number +natis.unit.number=NaTIS Unit Number +natis.release.id=NaTIS Release Id +org.name=Dealer Name\: +register.number= Register Number + +customer.create.new=Create new customer +customer.information =NaTIS Release-Customer Information +customer.name = Customer Name: +customer.surname=Surname: +customer.id.number=ID Number: +customer.phy.add = Physical Address: +customer.street1 = Street 1: +customer.street2 = Street 2: +customer.city = city: +customer.postal.address = Postal Address: +postal.street1=Postal Street +postal.city=Postal city +postal.code = Postal Code: +customer.home.telephone =Home Telephone No: +customer.work.telephone =Work Telephone No: +customer.cell= Customer Cell\: \t +customer.aa.car.number=AA Card No\: \t +customer.maintenance.contract.number=Maintenance Contract No: +invoice.it = Invoice +unreserve.stock = Unreserve Stock +shipment.material.receipt=Shipment/Material Receipt + +#vehicle.createVehicle=Create Vehicle +#vehicle.unitNumber=Unit Number +#vehicle.vinNumber=Vin Number +#vehicle.engineNumber=Engine Number +#vehicle.natisModelDesc=Natis Model Desc +#vehicle.enginePower=Engine Power +#vehicle.engineCapacity=Engine Capacity +#vehicle.tare=Tare +#vehicle.noOfWheels=No. of Wheels +#vehicle.cntryOfImport=Country Of Import +#vehicle.colourCdHES=Colour Code HES +#vehicle.mainColourCd=Main Colour Code +#vehicle.natisModelNum=Natis Model Number + + +#========= DMS Messages + +error.required.attributeValue = Value is required +error.required.orgType = Choose a dealer type +error.required.vehicleType = Choose a product type +error.required.locator = Destination Locator required +error.required.warehouse = Destination Warehouse required +error.no.order.exists=The Order is already completed, Please make a new one + +org.create=Create Dealer +org.details = Dealer Details +reserved.for=Reserved For the Dealer: +org.type=Dealer Type: +org.product.type=Product Type: +click.order.id=Click this OrderId to get the Order: +org.retailer= Is Retailer: +org.wholesaler=Is Wholesaler: +org.automobile= Is Automobile: +org.motocycle=Is Motocycle: +org.address=Address: +org.address1=Address1: +org.address2=Address2: +org.city=City: +org.postalAddress=Postal Address: +org.region=Region: +org.isActive= Is Active +org.isVisible= Is Visible + +dealer.details = Dealer Details +dealer.name = Dealer Name +dealer.location = Location +dealer.phone = Phone +dealer.fax = Fax + +role.create = Create Role +role.name = Name +role.superuser = Access to all Dealers +role.accessibleToAll = Access to all Dealers +role.isActive = Is Active + +pos.name= POS Name +pos.begining.balance=Beginning Balance +pos.net.transaction=Net Cash Transaction +pos.cash.total=Cash Amount +pos.card.total=Card Amount +pos.cheque.total=Cheque Amount +pos.grandtotal=Grand Total +pos.current.till.balance= Current Till Balance + + +groupModel.title = Group Models +groupModel.group = Model Group +groupModel.model = Model + +licensing.district = Licensing District +licensing.district.code = Licensing District Code +licensing.district.description = Description +licensing.district.area = Licensing Area +licensing.district.area.domestic = Domestic +licensing.district.area.export = Export + +price.listing = Price Listing +pricelist.Version = PriceList Version +pricelist.name = PriceList Name +pricelist.listPrice = List Price + +error.required.currentBalance = Current Balance is required +error.required.accountNo = Account Number is required +error.required.accountType = Account Type is required +error.required.partnerName = Business Partner Name is required +error.required.supplierName = Vendor Name is required +error.required.sizes = Please select some sizes or enter a custom size + + +error.required.stdPurchasePrice = Purchase Price is required +error.required.stdSalesPrice = Sales Price is required + +error.numberformatexception.currentBalance=Only numeric values are supported for Current Balance +error.numberformatexception=Please Enter a Numeric Value +error.numberformatexception.stdSalesPrice= Sales prices should be numeric +error.numberformatexception.stdPurchasePrice=Purchase prices should be numeric +error.numberformatexception.price=Please enter a numeric value for the prices +error.modelgroup.notExist=Please specify a Model Group +error.deactivatingattributeproductinstock = Unable to perform action. There are some products that use the attribute value. + +invoice.customer.print=Customer Invoice - Print +invoice.customer=Customer Invoice +invoice.no=Invoice No + +search.order = Search Order +search.order.title = Query Order ID +search.order.label = Order ID + +search.order.vin = Search Order For a VIN No. +search.order.vin.title = Search Order For a VIN No. +search.order.vin.label = Enter VIN No. +swap.vin.success=The vehicle has been swapped successfully +reprice.order.success=The Orders have been Repriced successfully + +error.orderId.not.found=Order Id not found +material.movement.success=The products have been moved successfully. +sequence.update.success= The sequences have been updated successfully +data.integrity.success=The data intregriy has been checked and mails have been send for the failed tests +naamsa.dealercode.create=Create NAAMSA Dealer Code +naamsa.dealercode.title=NAAMSA Dealer Code +naamsa.dealercode.edit.title=Edit NAAMSA Dealer Code +naamsa.dealer=Dealer +naamsa.dealercode=Dealer Code + +naamsa.modelcode=Model Code +naamsa.modelcode.create=Create NAAMSA Model Code +naamsa.modelcode.title=NAAMSA Model Code +naamsa.modelcode.edit.title=Edit NAAMSA Model Code + +wholesaleorder.ftp.title=Upload FTP File +wholesaleorder.csv.title=Create Wholesale Order +wholesaleorder.information=Please go to the following site and select the ftp file which consist of the vehicles which you want to insert in the system. +wholesaleorder.site=ftp://ftp.honda-eu.com +wholesaleorder.upload.button=Upload File +error.ftp.notvalid=The ftp file uploaded is not valid +wholesaleorder.csv.invalid=CSV File is invalid +wholesaleorder.csv.unknownerror=An Error has occurred, please contact your system administrator +error.ftp.novehicle=The FTP does not contain vehicles for your Organisation Type +wholesaleorder.csv.download=Download the CSV generated from the FTP file that you have input.
Check whether all the records are good. Take appropriate action for those that have error descriptions.
+wholesaleorder.csv.download1=Download the CSV generated from the FTP file that you have input.
Modify this file by inputing genuine information concerning the vehices.
+wholesaleorder.csv.information=Upload the CSV that you have modified in order to generate the wholesale order. +wholesaleorder.csv.uploadFile=CSV File to upload\: + +error.natis.release=Your request to release this vehicle is in progress.\n The system will automatically complete this order and release the vehicle on NaTIS after some time. +error.natis.release_old=Could not release vehicle on NaTIS. Please try again. \nIf the problem persists please contact the administrator. +vin.number.not.found=VIN number not found +error.vin.number.duplicate=Duplicate VIN number found. +natis.info.not.found=Natis info not found +natis.info.duplicate=Natis info duplicate +released.by=Released by + + + +modelmatch.title=Model Matching +modelmatch.natisModelDesc=Natis Model Desc +modelmatch.modelDesc=Model Desc +modelmatch.transmission=Transmission +modelmatch.year=Year +wesbank.status=Wesbank Status + + +colourmatch.title=Colour Code Matching +colourmatch.colourCode=Colour Code +colourmatch.colourDesc=Colour Description + +wesbank.ping.title=Ping WesBank +wesbank.response.action=Action +wesbank.response.recordtype=Record Type +wesbank.response.reason=Reason +wesbank.response.reasonDescription=Reason Description +wesbank.response.date=Date +wesbank.response.time=Time +wesbank.response.transId=Transaction Id +wesbank.response.status=Status +import.vehicleImported.title=Vehicle imported +import.vehicleUnimported.title=Vehicle Not Imported +import.vehicle.model=Model +import.vehicle.vinNumber=Vin Number +import.vehicle.engineNumber=Engine Number +import.vehicle.natisModelNo=Natis Model No +import.vehicle.colour=Colour +import.vehicle.transmission=Transmission +import.vehicle.year=Year +import.vehicle.natisModelDesc=Natis Model Desc +import.vehicle.modelMatchingDesc=Model Matching +import.vehicle.colourCode=Colour Code +import.vehicle.errorDesc=Error Description +import.vehicle.selProcess=Process +import.vehicle.selectAll=Select All +import.vehicle.reperformMatching=Reperform Matching +import.vehicle.importVehicle=Import Vehicles +error.attachment.empty = Please select a file +error.attachment.invalid.image = Please select an image +error.required.cvv=CVV is required. +error.creditCardExpMonth=Credit card expiry date cannot be prior to this month. Please enter a valid date. +error.required.creditCardExpMonth=Credit card expiry month required. +error.pos.shoppingcart.empty = Your shopping cart is empty. +error.required.accountName=Credit Card Owner name required. +error.required.paymentMethod=Please select the preferred payment method. +error.minlength.creditCardNumber=Please enter a valid credit card number (Length from 13 to 16) +error.minlength.cvv=Please enter a CVV number greater than 2 digits +error.sending.email=Error sending email +error.creditcard.number=Credit Card number is not valid +error.creditcard.type=Credit Card type is not supported +error.creditcard.expiry=Credit Card expiry is not valid +error.creditcard.cvv=Credit Card VV is not valid +error.required.startDate = Please select from date. +error.required.endDate = Please select to date. +error.pos.invoke.no.orderline=Cannot invoke order that has no orderlines. +error.access.not.allowed=you do not have the role to access the window, please contact your administrator +error.shipment.condition.required=Please specity whether the shipment should be generated along with the order and invoice + + +document.status.drafted=Drafted +document.status.inprogress=In Progress +document.status.completed=Completed +document.status.closed=Closed +document.status.invalid=Invalid +payment.rule.cash=Cash +payment.rule.card=Card +payment.rule.cheque=Cheque +payment.rule.mixed=Mixed + +error.store.default=Default Application could not be set. Cause: {0}.
If the problem persists please clear your browser cookies. + +########### CRM MESSAGES ########### + +## ERROR MESSAGES +error.request.view=Cannot view the desired request +error.request.assign=Could not assign request to the specified user +error.request.create=Could not create request +error.request.init.resolve=Could not initialise request for resolving +error.request.resolve=Could not resolve request +error.request.close=Could not close request +error.request.view.summary=Could not retrieve your requests, please contact you administrator + + +vendor.create=Create Vendor +vendor.details = Vendor Details +user.discount = %Discount Allowed + + +error.file.save=Error occurred when saving file. +error.source.file.notpresent=Source file not present. +error.create.bank.account=Error occurred while creating bank account +error.bank.not.found=Bank not found. +error.edit.bank=Editing bank information failed +error.get.partner.detail=Retrieval of partner details failed +error.getall.partners=Retrieval of all partner details failed +error.activate.customer=Could not activate customer +error.deactivate.customer=Could not deactivate customer +error.editing.user=Error occurred while editing user +error.activate.vendor=Could not activate vendor +error.deactivate.vendor=Could not deactivate vendor +error.orderid.notpresent=OrderId not present +error.creating.invoice=Could not create invoice +error.only.pos.order.supported=Only POS Orders are Supported, Please check the number +error.only.credit.order.supported=Only Credit Orders are Supported, Please check the number +error.credit.order.not.completed=The Credit Order is not completed, cannot create Credit Memo +error.pos.order.not.completed=The POS Order is not completed, cannot create Customer Return Order +error.pos.invalid.customerID = The Customer ID entered is not valid! +error.discountLimit.exceeded = Discount allowed limit has been exceeded! +error.print.fidelity.card = Cannot print fidelity card! Please select some active customers. + +error.bpartner.nolocation = Business Partner does not have a location, you should set it first to be able to complete the current operation. +error.userRegistration.failed = Registration failed. Problem with mail server. Please try later. +error.round.off.cannot.be.negative = Round Off Factor cannot be negative. +error.no.product.found.on.pricelist = No product found on price list. + +############Fidelity Card ##################### +fidelitycard.address= TAMAK GROUP,3 DRAPER AVE,Q.BORNES,MAURITIUS.EMAIL:tamak@tamak.com +fidelitycard.telephone=Office Tel: (230)4549555 -Fax: (230)454 1542 -Shop Tel: (230)427 0276 +fidelitycard.note1=THIS TAMAK FIDELITY CARD IS THE PROPERTY OF TAMAK +fidelitycard.note2=THIS CARD ENTITLES YOU TO SPECIAL DISCOUNTS OF 10% +fidelitycard.note3=APPLICABLE IN TAMAK WORLD & TAMAK SHOP. +fidelitycard.note4=NOT APPLICABLE ON DISCOUNTED ITEMS. +fidelitycard.customer.name=Nom: + +################### Messages for Receipt ###################### +receipt.VATRegNo=VAT 20176097 +receipt.company.name1=Tamak World +receipt.company.address=Rte St-Jean, Q.Bornes +receipt.company.phone=Tel:427-0276 +receipt.company.name2=(Tamak Retail LTD) + +################### Messages for POS ###################### +pos.description=Description +pos.qty=Qty +pos.price=Price +pos.VAT=VAT +pos.totalprice=Total Price +pos.discountpercentage=Discount % +pos.actualprice=Actual price +pos.tendertype=Tender Type +pos.cashamt=Cash Amt +pos.chequeamt=Cheque Amt +pos.chequeno=Cheque No +pos.cardamt=Card Amt +pos.cardno=Card No +pos.mixed=Mixed +pos.cash=Cash +pos.card=Card +pos.cheque=Cheque +pos.continue=Continue + +################### Messages for POS ###################### +message.product.saved = Product updated successfully + +################## User Registration ###################### +success.userRegistration.successful = Registration Successful +success.product.prices.on.pricelist.deleted.successfully = Product prices on price list deleted successfully +success.currency.updated.successfully = Currency updated successfully + + +error.process=Fail to process your request. Cause : {0} +error.precision=Precision entered is not valid. {0} +error.import.uom.not.present={0} +error.import.uom.precision.not.valid={0} +error.role.org.access.edit=Error occurred while trying to update Role Organisation Access. Please contact the Administrator. +error.no.edit.access=You do not have the right organisational access for editing +error.import.file.data={0} +error.import.uom.duplicate={0} +error.no.materialmovement.exists=The Material Movement is already completed, Please make a new one +error.terminal.locked=Terminal is locked +error.no.cashjournal.present=There is no Cash Journal present in the system. Please check whether you have done a transaction yet +current.terminal.updated=The current terminal has been updated.
Log out and Log in to be able to create transactions on the terminal. +current.terminal.reset=The current terminal has been reset.
Log out and Log in to chose again the current terminal from the list of available terminals. +error.operation=An error has occured while executing the operation you requested.
Please make sure that all data are correctly entered and try again. +error.terminal.cashbook=The cash book assigned on this terminal is already assigned to another terminal +error.deactivate.cashbook=Cash book cannot be deactivated as it is being used on a terminal +error.deactivate.terminal=Terminal cannot be deactivated as no active terminal will be available for login diff --git a/posterita/posterita/src/main/ShipmentDispatchedEmailTemplate.properties b/posterita/posterita/src/main/ShipmentDispatchedEmailTemplate.properties new file mode 100644 index 0000000000..f2fc39fcfc --- /dev/null +++ b/posterita/posterita/src/main/ShipmentDispatchedEmailTemplate.properties @@ -0,0 +1,6 @@ +subject=Tamak Webstore - Shipment In Transit +action=action +content=,
Your order has been shipped. +signin.info=Order Information +link=Your will receive the product(s) shortly. +emailRegards=Regards,
Tamak Webmaster \ No newline at end of file diff --git a/posterita/posterita/src/main/displaytag.properties b/posterita/posterita/src/main/displaytag.properties new file mode 100644 index 0000000000..5b1eeee4b1 --- /dev/null +++ b/posterita/posterita/src/main/displaytag.properties @@ -0,0 +1,20 @@ +#sort.behavior=list +#sort.amount=list +#basic.empty.showtable=true +#basic.msg.empty_list=No results matched your criteria. +#paging.banner.placement=top +#paging.banner.onepage= +export.types=csv pdf rtf +export.excel=false +export.csv=true +export.xml=false +export.pdf=true +export.rtf=true +export.excel.class=org.displaytag.export.excel.ExcelView +export.pdf.class=org.displaytag.export.PdfView +export.rtf.class=org.displaytag.export.DefaultRtfExportView +decorator.media.html=org.posterita.decorator.HistoryWrapper +decorator.media.csv=org.posterita.decorator.HistoryCsvExportWrapper +decorator.media.pdf=org.posterita.decorator.HistoryPdfExportWrapper +decorator.media.rtf=org.posterita.decorator.HistoryRtfExportWrapper +locale.provider=org.posterita.core.I18nAdapter \ No newline at end of file diff --git a/posterita/posterita/src/main/org/compiere/model/I_AD_OrgInfo.java b/posterita/posterita/src/main/org/compiere/model/I_AD_OrgInfo.java new file mode 100644 index 0000000000..633eccd9cd --- /dev/null +++ b/posterita/posterita/src/main/org/compiere/model/I_AD_OrgInfo.java @@ -0,0 +1,203 @@ +/********************************************************************** + * This file is part of Adempiere ERP Bazaar * + * http://www.adempiere.org * + * * + * Copyright (C) Trifon Trifonov. * + * Copyright (C) Contributors * + * * + * This program is free software; + you can redistribute it and/or * + * modify it under the terms of the GNU General Public License * + * as published by the Free Software Foundation; + either version 2 * + * of the License, or (at your option) any later version. * + * * + * This program 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; + if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301, USA. * + * * + * Contributors: * + * - Trifon Trifonov (trifonnt@users.sourceforge.net) * + * * + * Sponsors: * + * - Company (http://www.site.com) * + **********************************************************************/ +package org.compiere.model; + +import java.math.BigDecimal; +import org.compiere.util.KeyNamePair; + +/** Generated Interface for AD_OrgInfo + * @author Trifon Trifonov (generated) + * @version Release 3.4.0s + */ +public interface I_AD_OrgInfo +{ + + /** TableName=AD_OrgInfo */ + public static final String Table_Name = "AD_OrgInfo"; + + /** AD_Table_ID=228 */ + public static final int Table_ID = MTable.getTable_ID(Table_Name); + + KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name); + + /** AccessLevel = 7 - System - Client - Org + */ + BigDecimal accessLevel = BigDecimal.valueOf(7); + + /** Load Meta Data */ + + /** Column name AD_OrgType_ID */ + public static final String COLUMNNAME_AD_OrgType_ID = "AD_OrgType_ID"; + + /** Set Organization Type. + * Organization Type allows you to categorize your organizations + */ + public void setAD_OrgType_ID (int AD_OrgType_ID); + + /** Get Organization Type. + * Organization Type allows you to categorize your organizations + */ + public int getAD_OrgType_ID(); + + public I_AD_OrgType getAD_OrgType() throws Exception; + + /** Column name C_Location_ID */ + public static final String COLUMNNAME_C_Location_ID = "C_Location_ID"; + + /** Set Address. + * Location or Address + */ + public void setC_Location_ID (int C_Location_ID); + + /** Get Address. + * Location or Address + */ + public int getC_Location_ID(); + + /** Column name DUNS */ + public static final String COLUMNNAME_DUNS = "DUNS"; + + /** Set D-U-N-S. + * Dun & Bradstreet Number + */ + public void setDUNS (String DUNS); + + /** Get D-U-N-S. + * Dun & Bradstreet Number + */ + public String getDUNS(); + + /** Column name M_Warehouse_ID */ + public static final String COLUMNNAME_M_Warehouse_ID = "M_Warehouse_ID"; + + /** Set Warehouse. + * Storage Warehouse and Service Point + */ + public void setM_Warehouse_ID (int M_Warehouse_ID); + + /** Get Warehouse. + * Storage Warehouse and Service Point + */ + public int getM_Warehouse_ID(); + + public I_M_Warehouse getM_Warehouse() throws Exception; + + /** Column name PA_Goal_ID */ + public static final String COLUMNNAME_PA_Goal_ID = "PA_Goal_ID"; + + /** Set Goal. + * Performance Goal + */ + public void setPA_Goal_ID (int PA_Goal_ID); + + /** Get Goal. + * Performance Goal + */ + public int getPA_Goal_ID(); + + public I_PA_Goal getPA_Goal() throws Exception; + + /** Column name Parent_Org_ID */ + public static final String COLUMNNAME_Parent_Org_ID = "Parent_Org_ID"; + + /** Set Parent Organization. + * Parent (superior) Organization + */ + public void setParent_Org_ID (int Parent_Org_ID); + + /** Get Parent Organization. + * Parent (superior) Organization + */ + public int getParent_Org_ID(); + + /** Column name ReceiptFooterMsg */ + public static final String COLUMNNAME_ReceiptFooterMsg = "ReceiptFooterMsg"; + + /** Set Receipt Footer Msg. + * This message will be displayed at the bottom of a receipt when doing a sales or purchase + */ + public void setReceiptFooterMsg (String ReceiptFooterMsg); + + /** Get Receipt Footer Msg. + * This message will be displayed at the bottom of a receipt when doing a sales or purchase + */ + public String getReceiptFooterMsg(); + + /** Column name Supervisor_ID */ + public static final String COLUMNNAME_Supervisor_ID = "Supervisor_ID"; + + /** Set Supervisor. + * Supervisor for this user/organization - used for escalation and approval + */ + public void setSupervisor_ID (int Supervisor_ID); + + /** Get Supervisor. + * Supervisor for this user/organization - used for escalation and approval + */ + public int getSupervisor_ID(); + + /** Column name TaxID */ + public static final String COLUMNNAME_TaxID = "TaxID"; + + /** Set Tax ID. + * Tax Identification + */ + public void setTaxID (String TaxID); + + /** Get Tax ID. + * Tax Identification + */ + public String getTaxID(); + + /** Column name TransferBank_ID */ + public static final String COLUMNNAME_TransferBank_ID = "TransferBank_ID"; + + /** Set Bank for transfers. + * Bank account depending on currency will be used from this bank for doing transfers + */ + public void setTransferBank_ID (int TransferBank_ID); + + /** Get Bank for transfers. + * Bank account depending on currency will be used from this bank for doing transfers + */ + public int getTransferBank_ID(); + + /** Column name TransferCashBook_ID */ + public static final String COLUMNNAME_TransferCashBook_ID = "TransferCashBook_ID"; + + /** Set CashBook for transfers */ + public void setTransferCashBook_ID (int TransferCashBook_ID); + + /** Get CashBook for transfers */ + public int getTransferCashBook_ID(); +} diff --git a/posterita/posterita/src/main/org/compiere/model/I_AD_Role.java b/posterita/posterita/src/main/org/compiere/model/I_AD_Role.java new file mode 100644 index 0000000000..841342136f --- /dev/null +++ b/posterita/posterita/src/main/org/compiere/model/I_AD_Role.java @@ -0,0 +1,498 @@ +/********************************************************************** + * This file is part of Adempiere ERP Bazaar * + * http://www.adempiere.org * + * * + * Copyright (C) Trifon Trifonov. * + * Copyright (C) Contributors * + * * + * This program is free software; + you can redistribute it and/or * + * modify it under the terms of the GNU General Public License * + * as published by the Free Software Foundation; + either version 2 * + * of the License, or (at your option) any later version. * + * * + * This program 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; + if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301, USA. * + * * + * Contributors: * + * - Trifon Trifonov (trifonnt@users.sourceforge.net) * + * * + * Sponsors: * + * - Company (http://www.site.com) * + **********************************************************************/ +package org.compiere.model; + +import java.math.BigDecimal; +import org.compiere.util.KeyNamePair; + +/** Generated Interface for AD_Role + * @author Trifon Trifonov (generated) + * @version Release 3.4.0s + */ +public interface I_AD_Role +{ + + /** TableName=AD_Role */ + public static final String Table_Name = "AD_Role"; + + /** AD_Table_ID=156 */ + public static final int Table_ID = MTable.getTable_ID(Table_Name); + + KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name); + + /** AccessLevel = 6 - System - Client + */ + BigDecimal accessLevel = BigDecimal.valueOf(6); + + /** Load Meta Data */ + + /** Column name AD_Role_ID */ + public static final String COLUMNNAME_AD_Role_ID = "AD_Role_ID"; + + /** Set Role. + * Responsibility Role + */ + public void setAD_Role_ID (int AD_Role_ID); + + /** Get Role. + * Responsibility Role + */ + public int getAD_Role_ID(); + + /** Column name AD_Tree_Menu_ID */ + public static final String COLUMNNAME_AD_Tree_Menu_ID = "AD_Tree_Menu_ID"; + + /** Set Menu Tree. + * Tree of the menu + */ + public void setAD_Tree_Menu_ID (int AD_Tree_Menu_ID); + + /** Get Menu Tree. + * Tree of the menu + */ + public int getAD_Tree_Menu_ID(); + + /** Column name AD_Tree_Org_ID */ + public static final String COLUMNNAME_AD_Tree_Org_ID = "AD_Tree_Org_ID"; + + /** Set Organization Tree. + * Tree to determine organizational hierarchy + */ + public void setAD_Tree_Org_ID (int AD_Tree_Org_ID); + + /** Get Organization Tree. + * Tree to determine organizational hierarchy + */ + public int getAD_Tree_Org_ID(); + + /** Column name Allow_Info_Account */ + public static final String COLUMNNAME_Allow_Info_Account = "Allow_Info_Account"; + + /** Set Allow Info Account */ + public void setAllow_Info_Account (boolean Allow_Info_Account); + + /** Get Allow Info Account */ + public boolean isAllow_Info_Account(); + + /** Column name Allow_Info_Asset */ + public static final String COLUMNNAME_Allow_Info_Asset = "Allow_Info_Asset"; + + /** Set Allow Info Asset */ + public void setAllow_Info_Asset (boolean Allow_Info_Asset); + + /** Get Allow Info Asset */ + public boolean isAllow_Info_Asset(); + + /** Column name Allow_Info_BPartner */ + public static final String COLUMNNAME_Allow_Info_BPartner = "Allow_Info_BPartner"; + + /** Set Allow Info BPartner */ + public void setAllow_Info_BPartner (boolean Allow_Info_BPartner); + + /** Get Allow Info BPartner */ + public boolean isAllow_Info_BPartner(); + + /** Column name Allow_Info_CashJournal */ + public static final String COLUMNNAME_Allow_Info_CashJournal = "Allow_Info_CashJournal"; + + /** Set Allow Info CashJournal */ + public void setAllow_Info_CashJournal (boolean Allow_Info_CashJournal); + + /** Get Allow Info CashJournal */ + public boolean isAllow_Info_CashJournal(); + + /** Column name Allow_Info_InOut */ + public static final String COLUMNNAME_Allow_Info_InOut = "Allow_Info_InOut"; + + /** Set Allow Info InOut */ + public void setAllow_Info_InOut (boolean Allow_Info_InOut); + + /** Get Allow Info InOut */ + public boolean isAllow_Info_InOut(); + + /** Column name Allow_Info_Invoice */ + public static final String COLUMNNAME_Allow_Info_Invoice = "Allow_Info_Invoice"; + + /** Set Allow Info Invoice */ + public void setAllow_Info_Invoice (boolean Allow_Info_Invoice); + + /** Get Allow Info Invoice */ + public boolean isAllow_Info_Invoice(); + + /** Column name Allow_Info_Order */ + public static final String COLUMNNAME_Allow_Info_Order = "Allow_Info_Order"; + + /** Set Allow Info Order */ + public void setAllow_Info_Order (boolean Allow_Info_Order); + + /** Get Allow Info Order */ + public boolean isAllow_Info_Order(); + + /** Column name Allow_Info_Payment */ + public static final String COLUMNNAME_Allow_Info_Payment = "Allow_Info_Payment"; + + /** Set Allow Info Payment */ + public void setAllow_Info_Payment (boolean Allow_Info_Payment); + + /** Get Allow Info Payment */ + public boolean isAllow_Info_Payment(); + + /** Column name Allow_Info_Product */ + public static final String COLUMNNAME_Allow_Info_Product = "Allow_Info_Product"; + + /** Set Allow Info Product */ + public void setAllow_Info_Product (boolean Allow_Info_Product); + + /** Get Allow Info Product */ + public boolean isAllow_Info_Product(); + + /** Column name Allow_Info_Resource */ + public static final String COLUMNNAME_Allow_Info_Resource = "Allow_Info_Resource"; + + /** Set Allow Info Resource */ + public void setAllow_Info_Resource (boolean Allow_Info_Resource); + + /** Get Allow Info Resource */ + public boolean isAllow_Info_Resource(); + + /** Column name Allow_Info_Schedule */ + public static final String COLUMNNAME_Allow_Info_Schedule = "Allow_Info_Schedule"; + + /** Set Allow Info Schedule */ + public void setAllow_Info_Schedule (boolean Allow_Info_Schedule); + + /** Get Allow Info Schedule */ + public boolean isAllow_Info_Schedule(); + + /** Column name AmtApproval */ + public static final String COLUMNNAME_AmtApproval = "AmtApproval"; + + /** Set Approval Amount. + * The approval amount limit for this role + */ + public void setAmtApproval (BigDecimal AmtApproval); + + /** Get Approval Amount. + * The approval amount limit for this role + */ + public BigDecimal getAmtApproval(); + + /** Column name C_Currency_ID */ + public static final String COLUMNNAME_C_Currency_ID = "C_Currency_ID"; + + /** Set Currency. + * The Currency for this record + */ + public void setC_Currency_ID (int C_Currency_ID); + + /** Get Currency. + * The Currency for this record + */ + public int getC_Currency_ID(); + + public I_C_Currency getC_Currency() throws Exception; + + /** Column name ConfirmQueryRecords */ + public static final String COLUMNNAME_ConfirmQueryRecords = "ConfirmQueryRecords"; + + /** Set Confirm Query Records. + * Require Confirmation if more records will be returned by the query (If not defined 500) + */ + public void setConfirmQueryRecords (int ConfirmQueryRecords); + + /** Get Confirm Query Records. + * Require Confirmation if more records will be returned by the query (If not defined 500) + */ + public int getConfirmQueryRecords(); + + /** Column name ConnectionProfile */ + public static final String COLUMNNAME_ConnectionProfile = "ConnectionProfile"; + + /** Set Connection Profile. + * How a Java Client connects to the server(s) + */ + public void setConnectionProfile (String ConnectionProfile); + + /** Get Connection Profile. + * How a Java Client connects to the server(s) + */ + public String getConnectionProfile(); + + /** Column name Description */ + public static final String COLUMNNAME_Description = "Description"; + + /** Set Description. + * Optional short description of the record + */ + public void setDescription (String Description); + + /** Get Description. + * Optional short description of the record + */ + public String getDescription(); + + /** Column name IsAccessAllOrgs */ + public static final String COLUMNNAME_IsAccessAllOrgs = "IsAccessAllOrgs"; + + /** Set Access all Orgs. + * Access all Organizations (no org access control) of the client + */ + public void setIsAccessAllOrgs (boolean IsAccessAllOrgs); + + /** Get Access all Orgs. + * Access all Organizations (no org access control) of the client + */ + public boolean isAccessAllOrgs(); + + /** Column name IsCanApproveOwnDoc */ + public static final String COLUMNNAME_IsCanApproveOwnDoc = "IsCanApproveOwnDoc"; + + /** Set Approve own Documents. + * Users with this role can approve their own documents + */ + public void setIsCanApproveOwnDoc (boolean IsCanApproveOwnDoc); + + /** Get Approve own Documents. + * Users with this role can approve their own documents + */ + public boolean isCanApproveOwnDoc(); + + /** Column name IsCanExport */ + public static final String COLUMNNAME_IsCanExport = "IsCanExport"; + + /** Set Can Export. + * Users with this role can export data + */ + public void setIsCanExport (boolean IsCanExport); + + /** Get Can Export. + * Users with this role can export data + */ + public boolean isCanExport(); + + /** Column name IsCanReport */ + public static final String COLUMNNAME_IsCanReport = "IsCanReport"; + + /** Set Can Report. + * Users with this role can create reports + */ + public void setIsCanReport (boolean IsCanReport); + + /** Get Can Report. + * Users with this role can create reports + */ + public boolean isCanReport(); + + /** Column name IsChangeLog */ + public static final String COLUMNNAME_IsChangeLog = "IsChangeLog"; + + /** Set Maintain Change Log. + * Maintain a log of changes + */ + public void setIsChangeLog (boolean IsChangeLog); + + /** Get Maintain Change Log. + * Maintain a log of changes + */ + public boolean isChangeLog(); + + /** Column name IsDiscountAllowedOnTotal */ + public static final String COLUMNNAME_IsDiscountAllowedOnTotal = "IsDiscountAllowedOnTotal"; + + /** Set IsDiscountAllowedOnTotal */ + public void setIsDiscountAllowedOnTotal (boolean IsDiscountAllowedOnTotal); + + /** Get IsDiscountAllowedOnTotal */ + public boolean isDiscountAllowedOnTotal(); + + /** Column name IsDiscountUptoLimitPrice */ + public static final String COLUMNNAME_IsDiscountUptoLimitPrice = "IsDiscountUptoLimitPrice"; + + /** Set IsDiscountUptoLimitPrice */ + public void setIsDiscountUptoLimitPrice (boolean IsDiscountUptoLimitPrice); + + /** Get IsDiscountUptoLimitPrice */ + public boolean isDiscountUptoLimitPrice(); + + /** Column name IsManual */ + public static final String COLUMNNAME_IsManual = "IsManual"; + + /** Set Manual. + * This is a manual process + */ + public void setIsManual (boolean IsManual); + + /** Get Manual. + * This is a manual process + */ + public boolean isManual(); + + /** Column name IsPersonalAccess */ + public static final String COLUMNNAME_IsPersonalAccess = "IsPersonalAccess"; + + /** Set Personal Access. + * Allow access to all personal records + */ + public void setIsPersonalAccess (boolean IsPersonalAccess); + + /** Get Personal Access. + * Allow access to all personal records + */ + public boolean isPersonalAccess(); + + /** Column name IsPersonalLock */ + public static final String COLUMNNAME_IsPersonalLock = "IsPersonalLock"; + + /** Set Personal Lock. + * Allow users with role to lock access to personal records + */ + public void setIsPersonalLock (boolean IsPersonalLock); + + /** Get Personal Lock. + * Allow users with role to lock access to personal records + */ + public boolean isPersonalLock(); + + /** Column name IsShowAcct */ + public static final String COLUMNNAME_IsShowAcct = "IsShowAcct"; + + /** Set Show Accounting. + * Users with this role can see accounting information + */ + public void setIsShowAcct (boolean IsShowAcct); + + /** Get Show Accounting. + * Users with this role can see accounting information + */ + public boolean isShowAcct(); + + /** Column name IsUseUserOrgAccess */ + public static final String COLUMNNAME_IsUseUserOrgAccess = "IsUseUserOrgAccess"; + + /** Set Use User Org Access. + * Use Org Access defined by user instead of Role Org Access + */ + public void setIsUseUserOrgAccess (boolean IsUseUserOrgAccess); + + /** Get Use User Org Access. + * Use Org Access defined by user instead of Role Org Access + */ + public boolean isUseUserOrgAccess(); + + /** Column name MaxQueryRecords */ + public static final String COLUMNNAME_MaxQueryRecords = "MaxQueryRecords"; + + /** Set Max Query Records. + * If defined, you cannot query more records as defined - the query criteria needs to be changed to query less records + */ + public void setMaxQueryRecords (int MaxQueryRecords); + + /** Get Max Query Records. + * If defined, you cannot query more records as defined - the query criteria needs to be changed to query less records + */ + public int getMaxQueryRecords(); + + /** Column name Name */ + public static final String COLUMNNAME_Name = "Name"; + + /** Set Name. + * Alphanumeric identifier of the entity + */ + public void setName (String Name); + + /** Get Name. + * Alphanumeric identifier of the entity + */ + public String getName(); + + /** Column name OverwritePriceLimit */ + public static final String COLUMNNAME_OverwritePriceLimit = "OverwritePriceLimit"; + + /** Set Overwrite Price Limit. + * Overwrite Price Limit if the Price List enforces the Price Limit + */ + public void setOverwritePriceLimit (boolean OverwritePriceLimit); + + /** Get Overwrite Price Limit. + * Overwrite Price Limit if the Price List enforces the Price Limit + */ + public boolean isOverwritePriceLimit(); + + /** Column name PreferenceType */ + public static final String COLUMNNAME_PreferenceType = "PreferenceType"; + + /** Set Preference Level. + * Determines what preferences the user can set + */ + public void setPreferenceType (String PreferenceType); + + /** Get Preference Level. + * Determines what preferences the user can set + */ + public String getPreferenceType(); + + /** Column name Supervisor_ID */ + public static final String COLUMNNAME_Supervisor_ID = "Supervisor_ID"; + + /** Set Supervisor. + * Supervisor for this user/organization - used for escalation and approval + */ + public void setSupervisor_ID (int Supervisor_ID); + + /** Get Supervisor. + * Supervisor for this user/organization - used for escalation and approval + */ + public int getSupervisor_ID(); + + /** Column name UserDiscount */ + public static final String COLUMNNAME_UserDiscount = "UserDiscount"; + + /** Set UserDiscount */ + public void setUserDiscount (BigDecimal UserDiscount); + + /** Get UserDiscount */ + public BigDecimal getUserDiscount(); + + /** Column name UserLevel */ + public static final String COLUMNNAME_UserLevel = "UserLevel"; + + /** Set User Level. + * System Client Organization + */ + public void setUserLevel (String UserLevel); + + /** Get User Level. + * System Client Organization + */ + public String getUserLevel(); +} diff --git a/posterita/posterita/src/main/org/compiere/model/I_C_CashLine.java b/posterita/posterita/src/main/org/compiere/model/I_C_CashLine.java new file mode 100644 index 0000000000..0a92c2e874 --- /dev/null +++ b/posterita/posterita/src/main/org/compiere/model/I_C_CashLine.java @@ -0,0 +1,265 @@ +/********************************************************************** + * This file is part of Adempiere ERP Bazaar * + * http://www.adempiere.org * + * * + * Copyright (C) Trifon Trifonov. * + * Copyright (C) Contributors * + * * + * This program is free software; + you can redistribute it and/or * + * modify it under the terms of the GNU General Public License * + * as published by the Free Software Foundation; + either version 2 * + * of the License, or (at your option) any later version. * + * * + * This program 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; + if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301, USA. * + * * + * Contributors: * + * - Trifon Trifonov (trifonnt@users.sourceforge.net) * + * * + * Sponsors: * + * - Company (http://www.site.com) * + **********************************************************************/ +package org.compiere.model; + +import java.math.BigDecimal; +import org.compiere.util.KeyNamePair; + +/** Generated Interface for C_CashLine + * @author Trifon Trifonov (generated) + * @version Release 3.4.0s + */ +public interface I_C_CashLine +{ + + /** TableName=C_CashLine */ + public static final String Table_Name = "C_CashLine"; + + /** AD_Table_ID=410 */ + public static final int Table_ID = MTable.getTable_ID(Table_Name); + + KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name); + + /** AccessLevel = 3 - Client - Org + */ + BigDecimal accessLevel = BigDecimal.valueOf(3); + + /** Load Meta Data */ + + /** Column name Amount */ + public static final String COLUMNNAME_Amount = "Amount"; + + /** Set Amount. + * Amount in a defined currency + */ + public void setAmount (BigDecimal Amount); + + /** Get Amount. + * Amount in a defined currency + */ + public BigDecimal getAmount(); + + /** Column name CashType */ + public static final String COLUMNNAME_CashType = "CashType"; + + /** Set Cash Type. + * Source of Cash + */ + public void setCashType (String CashType); + + /** Get Cash Type. + * Source of Cash + */ + public String getCashType(); + + /** Column name C_BankAccount_ID */ + public static final String COLUMNNAME_C_BankAccount_ID = "C_BankAccount_ID"; + + /** Set Bank Account. + * Account at the Bank + */ + public void setC_BankAccount_ID (int C_BankAccount_ID); + + /** Get Bank Account. + * Account at the Bank + */ + public int getC_BankAccount_ID(); + + public I_C_BankAccount getC_BankAccount() throws Exception; + + /** Column name C_Cash_ID */ + public static final String COLUMNNAME_C_Cash_ID = "C_Cash_ID"; + + /** Set Cash Journal. + * Cash Journal + */ + public void setC_Cash_ID (int C_Cash_ID); + + /** Get Cash Journal. + * Cash Journal + */ + public int getC_Cash_ID(); + + public I_C_Cash getC_Cash() throws Exception; + + /** Column name C_CashLine_ID */ + public static final String COLUMNNAME_C_CashLine_ID = "C_CashLine_ID"; + + /** Set Cash Journal Line. + * Cash Journal Line + */ + public void setC_CashLine_ID (int C_CashLine_ID); + + /** Get Cash Journal Line. + * Cash Journal Line + */ + public int getC_CashLine_ID(); + + /** Column name C_Charge_ID */ + public static final String COLUMNNAME_C_Charge_ID = "C_Charge_ID"; + + /** Set Charge. + * Additional document charges + */ + public void setC_Charge_ID (int C_Charge_ID); + + /** Get Charge. + * Additional document charges + */ + public int getC_Charge_ID(); + + public I_C_Charge getC_Charge() throws Exception; + + /** Column name C_Currency_ID */ + public static final String COLUMNNAME_C_Currency_ID = "C_Currency_ID"; + + /** Set Currency. + * The Currency for this record + */ + public void setC_Currency_ID (int C_Currency_ID); + + /** Get Currency. + * The Currency for this record + */ + public int getC_Currency_ID(); + + public I_C_Currency getC_Currency() throws Exception; + + /** Column name C_Invoice_ID */ + public static final String COLUMNNAME_C_Invoice_ID = "C_Invoice_ID"; + + /** Set Invoice. + * Invoice Identifier + */ + public void setC_Invoice_ID (int C_Invoice_ID); + + /** Get Invoice. + * Invoice Identifier + */ + public int getC_Invoice_ID(); + + public I_C_Invoice getC_Invoice() throws Exception; + + /** Column name C_Payment_ID */ + public static final String COLUMNNAME_C_Payment_ID = "C_Payment_ID"; + + /** Set Payment. + * Payment identifier + */ + public void setC_Payment_ID (int C_Payment_ID); + + /** Get Payment. + * Payment identifier + */ + public int getC_Payment_ID(); + + public I_C_Payment getC_Payment() throws Exception; + + /** Column name Description */ + public static final String COLUMNNAME_Description = "Description"; + + /** Set Description. + * Optional short description of the record + */ + public void setDescription (String Description); + + /** Get Description. + * Optional short description of the record + */ + public String getDescription(); + + /** Column name DiscountAmt */ + public static final String COLUMNNAME_DiscountAmt = "DiscountAmt"; + + /** Set Discount Amount. + * Calculated amount of discount + */ + public void setDiscountAmt (BigDecimal DiscountAmt); + + /** Get Discount Amount. + * Calculated amount of discount + */ + public BigDecimal getDiscountAmt(); + + /** Column name IsGenerated */ + public static final String COLUMNNAME_IsGenerated = "IsGenerated"; + + /** Set Generated. + * This Line is generated + */ + public void setIsGenerated (boolean IsGenerated); + + /** Get Generated. + * This Line is generated + */ + public boolean isGenerated(); + + /** Column name Line */ + public static final String COLUMNNAME_Line = "Line"; + + /** Set Line No. + * Unique line for this document + */ + public void setLine (int Line); + + /** Get Line No. + * Unique line for this document + */ + public int getLine(); + + /** Column name Processed */ + public static final String COLUMNNAME_Processed = "Processed"; + + /** Set Processed. + * The document has been processed + */ + public void setProcessed (boolean Processed); + + /** Get Processed. + * The document has been processed + */ + public boolean isProcessed(); + + /** Column name WriteOffAmt */ + public static final String COLUMNNAME_WriteOffAmt = "WriteOffAmt"; + + /** Set Write-off Amount. + * Amount to write-off + */ + public void setWriteOffAmt (BigDecimal WriteOffAmt); + + /** Get Write-off Amount. + * Amount to write-off + */ + public BigDecimal getWriteOffAmt(); +} diff --git a/posterita/posterita/src/main/org/compiere/model/I_C_Currency.java b/posterita/posterita/src/main/org/compiere/model/I_C_Currency.java new file mode 100644 index 0000000000..aa605355cf --- /dev/null +++ b/posterita/posterita/src/main/org/compiere/model/I_C_Currency.java @@ -0,0 +1,202 @@ +/********************************************************************** + * This file is part of Adempiere ERP Bazaar * + * http://www.adempiere.org * + * * + * Copyright (C) Trifon Trifonov. * + * Copyright (C) Contributors * + * * + * This program is free software; + you can redistribute it and/or * + * modify it under the terms of the GNU General Public License * + * as published by the Free Software Foundation; + either version 2 * + * of the License, or (at your option) any later version. * + * * + * This program 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; + if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301, USA. * + * * + * Contributors: * + * - Trifon Trifonov (trifonnt@users.sourceforge.net) * + * * + * Sponsors: * + * - Company (http://www.site.com) * + **********************************************************************/ +package org.compiere.model; + +import java.math.BigDecimal; +import java.sql.Timestamp; +import org.compiere.util.KeyNamePair; + +/** Generated Interface for C_Currency + * @author Trifon Trifonov (generated) + * @version Release 3.4.0s + */ +public interface I_C_Currency +{ + + /** TableName=C_Currency */ + public static final String Table_Name = "C_Currency"; + + /** AD_Table_ID=141 */ + public static final int Table_ID = MTable.getTable_ID(Table_Name); + + KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name); + + /** AccessLevel = 6 - System - Client + */ + BigDecimal accessLevel = BigDecimal.valueOf(6); + + /** Load Meta Data */ + + /** Column name C_Currency_ID */ + public static final String COLUMNNAME_C_Currency_ID = "C_Currency_ID"; + + /** Set Currency. + * The Currency for this record + */ + public void setC_Currency_ID (int C_Currency_ID); + + /** Get Currency. + * The Currency for this record + */ + public int getC_Currency_ID(); + + /** Column name CostingPrecision */ + public static final String COLUMNNAME_CostingPrecision = "CostingPrecision"; + + /** Set Costing Precision. + * Rounding used costing calculations + */ + public void setCostingPrecision (int CostingPrecision); + + /** Get Costing Precision. + * Rounding used costing calculations + */ + public int getCostingPrecision(); + + /** Column name CurSymbol */ + public static final String COLUMNNAME_CurSymbol = "CurSymbol"; + + /** Set Symbol. + * Symbol of the currency (opt used for printing only) + */ + public void setCurSymbol (String CurSymbol); + + /** Get Symbol. + * Symbol of the currency (opt used for printing only) + */ + public String getCurSymbol(); + + /** Column name Description */ + public static final String COLUMNNAME_Description = "Description"; + + /** Set Description. + * Optional short description of the record + */ + public void setDescription (String Description); + + /** Get Description. + * Optional short description of the record + */ + public String getDescription(); + + /** Column name EMUEntryDate */ + public static final String COLUMNNAME_EMUEntryDate = "EMUEntryDate"; + + /** Set EMU Entry Date. + * Date when the currency joined / will join the EMU + */ + public void setEMUEntryDate (Timestamp EMUEntryDate); + + /** Get EMU Entry Date. + * Date when the currency joined / will join the EMU + */ + public Timestamp getEMUEntryDate(); + + /** Column name EMURate */ + public static final String COLUMNNAME_EMURate = "EMURate"; + + /** Set EMU Rate. + * Official rate to the Euro + */ + public void setEMURate (BigDecimal EMURate); + + /** Get EMU Rate. + * Official rate to the Euro + */ + public BigDecimal getEMURate(); + + /** Column name IsEMUMember */ + public static final String COLUMNNAME_IsEMUMember = "IsEMUMember"; + + /** Set EMU Member. + * This currency is member if the European Monetary Union + */ + public void setIsEMUMember (boolean IsEMUMember); + + /** Get EMU Member. + * This currency is member if the European Monetary Union + */ + public boolean isEMUMember(); + + /** Column name IsEuro */ + public static final String COLUMNNAME_IsEuro = "IsEuro"; + + /** Set The Euro Currency. + * This currency is the Euro + */ + public void setIsEuro (boolean IsEuro); + + /** Get The Euro Currency. + * This currency is the Euro + */ + public boolean isEuro(); + + /** Column name ISO_Code */ + public static final String COLUMNNAME_ISO_Code = "ISO_Code"; + + /** Set ISO Currency Code. + * Three letter ISO 4217 Code of the Currency + */ + public void setISO_Code (String ISO_Code); + + /** Get ISO Currency Code. + * Three letter ISO 4217 Code of the Currency + */ + public String getISO_Code(); + + /** Column name RoundOffFactor */ + public static final String COLUMNNAME_RoundOffFactor = "RoundOffFactor"; + + /** Set RoundOffFactor. + * Used to Round Off Payment Amount + */ + public void setRoundOffFactor (BigDecimal RoundOffFactor); + + /** Get RoundOffFactor. + * Used to Round Off Payment Amount + */ + public BigDecimal getRoundOffFactor(); + + /** Column name StdPrecision */ + public static final String COLUMNNAME_StdPrecision = "StdPrecision"; + + /** Set Standard Precision. + * Rule for rounding calculated amounts + */ + public void setStdPrecision (int StdPrecision); + + /** Get Standard Precision. + * Rule for rounding calculated amounts + */ + public int getStdPrecision(); +} diff --git a/posterita/posterita/src/main/org/compiere/model/I_C_Invoice.java b/posterita/posterita/src/main/org/compiere/model/I_C_Invoice.java new file mode 100644 index 0000000000..4f5859dd59 --- /dev/null +++ b/posterita/posterita/src/main/org/compiere/model/I_C_Invoice.java @@ -0,0 +1,803 @@ +/********************************************************************** + * This file is part of Adempiere ERP Bazaar * + * http://www.adempiere.org * + * * + * Copyright (C) Trifon Trifonov. * + * Copyright (C) Contributors * + * * + * This program is free software; + you can redistribute it and/or * + * modify it under the terms of the GNU General Public License * + * as published by the Free Software Foundation; + either version 2 * + * of the License, or (at your option) any later version. * + * * + * This program 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; + if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301, USA. * + * * + * Contributors: * + * - Trifon Trifonov (trifonnt@users.sourceforge.net) * + * * + * Sponsors: * + * - Company (http://www.site.com) * + **********************************************************************/ +package org.compiere.model; + +import java.math.BigDecimal; +import java.sql.Timestamp; +import org.compiere.util.KeyNamePair; + +/** Generated Interface for C_Invoice + * @author Trifon Trifonov (generated) + * @version Release 3.4.0s + */ +public interface I_C_Invoice +{ + + /** TableName=C_Invoice */ + public static final String Table_Name = "C_Invoice"; + + /** AD_Table_ID=318 */ + public static final int Table_ID = MTable.getTable_ID(Table_Name); + + KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name); + + /** AccessLevel = 1 - Org + */ + BigDecimal accessLevel = BigDecimal.valueOf(1); + + /** Load Meta Data */ + + /** Column name AD_OrgTrx_ID */ + public static final String COLUMNNAME_AD_OrgTrx_ID = "AD_OrgTrx_ID"; + + /** Set Trx Organization. + * Performing or initiating organization + */ + public void setAD_OrgTrx_ID (int AD_OrgTrx_ID); + + /** Get Trx Organization. + * Performing or initiating organization + */ + public int getAD_OrgTrx_ID(); + + /** Column name AD_User_ID */ + public static final String COLUMNNAME_AD_User_ID = "AD_User_ID"; + + /** Set User/Contact. + * User within the system - Internal or Business Partner Contact + */ + public void setAD_User_ID (int AD_User_ID); + + /** Get User/Contact. + * User within the system - Internal or Business Partner Contact + */ + public int getAD_User_ID(); + + public I_AD_User getAD_User() throws Exception; + + /** Column name C_Activity_ID */ + public static final String COLUMNNAME_C_Activity_ID = "C_Activity_ID"; + + /** Set Activity. + * Business Activity + */ + public void setC_Activity_ID (int C_Activity_ID); + + /** Get Activity. + * Business Activity + */ + public int getC_Activity_ID(); + + public I_C_Activity getC_Activity() throws Exception; + + /** Column name C_BPartner_ID */ + public static final String COLUMNNAME_C_BPartner_ID = "C_BPartner_ID"; + + /** Set Business Partner . + * Identifies a Business Partner + */ + public void setC_BPartner_ID (int C_BPartner_ID); + + /** Get Business Partner . + * Identifies a Business Partner + */ + public int getC_BPartner_ID(); + + public I_C_BPartner getC_BPartner() throws Exception; + + /** Column name C_BPartner_Location_ID */ + public static final String COLUMNNAME_C_BPartner_Location_ID = "C_BPartner_Location_ID"; + + /** Set Partner Location. + * Identifies the (ship to) address for this Business Partner + */ + public void setC_BPartner_Location_ID (int C_BPartner_Location_ID); + + /** Get Partner Location. + * Identifies the (ship to) address for this Business Partner + */ + public int getC_BPartner_Location_ID(); + + public I_C_BPartner_Location getC_BPartner_Location() throws Exception; + + /** Column name C_Campaign_ID */ + public static final String COLUMNNAME_C_Campaign_ID = "C_Campaign_ID"; + + /** Set Campaign. + * Marketing Campaign + */ + public void setC_Campaign_ID (int C_Campaign_ID); + + /** Get Campaign. + * Marketing Campaign + */ + public int getC_Campaign_ID(); + + public I_C_Campaign getC_Campaign() throws Exception; + + /** Column name C_CashLine_ID */ + public static final String COLUMNNAME_C_CashLine_ID = "C_CashLine_ID"; + + /** Set Cash Journal Line. + * Cash Journal Line + */ + public void setC_CashLine_ID (int C_CashLine_ID); + + /** Get Cash Journal Line. + * Cash Journal Line + */ + public int getC_CashLine_ID(); + + public I_C_CashLine getC_CashLine() throws Exception; + + /** Column name C_Charge_ID */ + public static final String COLUMNNAME_C_Charge_ID = "C_Charge_ID"; + + /** Set Charge. + * Additional document charges + */ + public void setC_Charge_ID (int C_Charge_ID); + + /** Get Charge. + * Additional document charges + */ + public int getC_Charge_ID(); + + /** Column name C_ConversionType_ID */ + public static final String COLUMNNAME_C_ConversionType_ID = "C_ConversionType_ID"; + + /** Set Currency Type. + * Currency Conversion Rate Type + */ + public void setC_ConversionType_ID (int C_ConversionType_ID); + + /** Get Currency Type. + * Currency Conversion Rate Type + */ + public int getC_ConversionType_ID(); + + public I_C_ConversionType getC_ConversionType() throws Exception; + + /** Column name C_Currency_ID */ + public static final String COLUMNNAME_C_Currency_ID = "C_Currency_ID"; + + /** Set Currency. + * The Currency for this record + */ + public void setC_Currency_ID (int C_Currency_ID); + + /** Get Currency. + * The Currency for this record + */ + public int getC_Currency_ID(); + + public I_C_Currency getC_Currency() throws Exception; + + /** Column name C_DocType_ID */ + public static final String COLUMNNAME_C_DocType_ID = "C_DocType_ID"; + + /** Set Document Type. + * Document type or rules + */ + public void setC_DocType_ID (int C_DocType_ID); + + /** Get Document Type. + * Document type or rules + */ + public int getC_DocType_ID(); + + public I_C_DocType getC_DocType() throws Exception; + + /** Column name C_DocTypeTarget_ID */ + public static final String COLUMNNAME_C_DocTypeTarget_ID = "C_DocTypeTarget_ID"; + + /** Set Target Document Type. + * Target document type for conversing documents + */ + public void setC_DocTypeTarget_ID (int C_DocTypeTarget_ID); + + /** Get Target Document Type. + * Target document type for conversing documents + */ + public int getC_DocTypeTarget_ID(); + + /** Column name C_DunningLevel_ID */ + public static final String COLUMNNAME_C_DunningLevel_ID = "C_DunningLevel_ID"; + + /** Set Dunning Level */ + public void setC_DunningLevel_ID (int C_DunningLevel_ID); + + /** Get Dunning Level */ + public int getC_DunningLevel_ID(); + + public I_C_DunningLevel getC_DunningLevel() throws Exception; + + /** Column name ChargeAmt */ + public static final String COLUMNNAME_ChargeAmt = "ChargeAmt"; + + /** Set Charge amount. + * Charge Amount + */ + public void setChargeAmt (BigDecimal ChargeAmt); + + /** Get Charge amount. + * Charge Amount + */ + public BigDecimal getChargeAmt(); + + /** Column name C_Invoice_ID */ + public static final String COLUMNNAME_C_Invoice_ID = "C_Invoice_ID"; + + /** Set Invoice. + * Invoice Identifier + */ + public void setC_Invoice_ID (int C_Invoice_ID); + + /** Get Invoice. + * Invoice Identifier + */ + public int getC_Invoice_ID(); + + /** Column name CopyFrom */ + public static final String COLUMNNAME_CopyFrom = "CopyFrom"; + + /** Set Copy From. + * Copy From Record + */ + public void setCopyFrom (String CopyFrom); + + /** Get Copy From. + * Copy From Record + */ + public String getCopyFrom(); + + /** Column name C_Order_ID */ + public static final String COLUMNNAME_C_Order_ID = "C_Order_ID"; + + /** Set Order. + * Order + */ + public void setC_Order_ID (int C_Order_ID); + + /** Get Order. + * Order + */ + public int getC_Order_ID(); + + public I_C_Order getC_Order() throws Exception; + + /** Column name C_Payment_ID */ + public static final String COLUMNNAME_C_Payment_ID = "C_Payment_ID"; + + /** Set Payment. + * Payment identifier + */ + public void setC_Payment_ID (int C_Payment_ID); + + /** Get Payment. + * Payment identifier + */ + public int getC_Payment_ID(); + + public I_C_Payment getC_Payment() throws Exception; + + /** Column name C_PaymentTerm_ID */ + public static final String COLUMNNAME_C_PaymentTerm_ID = "C_PaymentTerm_ID"; + + /** Set Payment Term. + * The terms of Payment (timing, discount) + */ + public void setC_PaymentTerm_ID (int C_PaymentTerm_ID); + + /** Get Payment Term. + * The terms of Payment (timing, discount) + */ + public int getC_PaymentTerm_ID(); + + public I_C_PaymentTerm getC_PaymentTerm() throws Exception; + + /** Column name C_Project_ID */ + public static final String COLUMNNAME_C_Project_ID = "C_Project_ID"; + + /** Set Project. + * Financial Project + */ + public void setC_Project_ID (int C_Project_ID); + + /** Get Project. + * Financial Project + */ + public int getC_Project_ID(); + + public I_C_Project getC_Project() throws Exception; + + /** Column name CreateFrom */ + public static final String COLUMNNAME_CreateFrom = "CreateFrom"; + + /** Set Create lines from. + * Process which will generate a new document lines based on an existing document + */ + public void setCreateFrom (String CreateFrom); + + /** Get Create lines from. + * Process which will generate a new document lines based on an existing document + */ + public String getCreateFrom(); + + /** Column name DateAcct */ + public static final String COLUMNNAME_DateAcct = "DateAcct"; + + /** Set Account Date. + * Accounting Date + */ + public void setDateAcct (Timestamp DateAcct); + + /** Get Account Date. + * Accounting Date + */ + public Timestamp getDateAcct(); + + /** Column name DateInvoiced */ + public static final String COLUMNNAME_DateInvoiced = "DateInvoiced"; + + /** Set Date Invoiced. + * Date printed on Invoice + */ + public void setDateInvoiced (Timestamp DateInvoiced); + + /** Get Date Invoiced. + * Date printed on Invoice + */ + public Timestamp getDateInvoiced(); + + /** Column name DateOrdered */ + public static final String COLUMNNAME_DateOrdered = "DateOrdered"; + + /** Set Date Ordered. + * Date of Order + */ + public void setDateOrdered (Timestamp DateOrdered); + + /** Get Date Ordered. + * Date of Order + */ + public Timestamp getDateOrdered(); + + /** Column name DatePrinted */ + public static final String COLUMNNAME_DatePrinted = "DatePrinted"; + + /** Set Date printed. + * Date the document was printed. + */ + public void setDatePrinted (Timestamp DatePrinted); + + /** Get Date printed. + * Date the document was printed. + */ + public Timestamp getDatePrinted(); + + /** Column name Description */ + public static final String COLUMNNAME_Description = "Description"; + + /** Set Description. + * Optional short description of the record + */ + public void setDescription (String Description); + + /** Get Description. + * Optional short description of the record + */ + public String getDescription(); + + /** Column name DocAction */ + public static final String COLUMNNAME_DocAction = "DocAction"; + + /** Set Document Action. + * The targeted status of the document + */ + public void setDocAction (String DocAction); + + /** Get Document Action. + * The targeted status of the document + */ + public String getDocAction(); + + /** Column name DocStatus */ + public static final String COLUMNNAME_DocStatus = "DocStatus"; + + /** Set Document Status. + * The current status of the document + */ + public void setDocStatus (String DocStatus); + + /** Get Document Status. + * The current status of the document + */ + public String getDocStatus(); + + /** Column name DocumentNo */ + public static final String COLUMNNAME_DocumentNo = "DocumentNo"; + + /** Set Document No. + * Document sequence number of the document + */ + public void setDocumentNo (String DocumentNo); + + /** Get Document No. + * Document sequence number of the document + */ + public String getDocumentNo(); + + /** Column name DunningGrace */ + public static final String COLUMNNAME_DunningGrace = "DunningGrace"; + + /** Set Dunning Grace */ + public void setDunningGrace (Timestamp DunningGrace); + + /** Get Dunning Grace */ + public Timestamp getDunningGrace(); + + /** Column name GenerateTo */ + public static final String COLUMNNAME_GenerateTo = "GenerateTo"; + + /** Set Generate To. + * Generate To + */ + public void setGenerateTo (String GenerateTo); + + /** Get Generate To. + * Generate To + */ + public String getGenerateTo(); + + /** Column name GrandTotal */ + public static final String COLUMNNAME_GrandTotal = "GrandTotal"; + + /** Set Grand Total. + * Total amount of document + */ + public void setGrandTotal (BigDecimal GrandTotal); + + /** Get Grand Total. + * Total amount of document + */ + public BigDecimal getGrandTotal(); + + /** Column name InvoiceCollectionType */ + public static final String COLUMNNAME_InvoiceCollectionType = "InvoiceCollectionType"; + + /** Set Collection Status. + * Invoice Collection Status + */ + public void setInvoiceCollectionType (String InvoiceCollectionType); + + /** Get Collection Status. + * Invoice Collection Status + */ + public String getInvoiceCollectionType(); + + /** Column name IsApproved */ + public static final String COLUMNNAME_IsApproved = "IsApproved"; + + /** Set Approved. + * Indicates if this document requires approval + */ + public void setIsApproved (boolean IsApproved); + + /** Get Approved. + * Indicates if this document requires approval + */ + public boolean isApproved(); + + /** Column name IsDiscountPrinted */ + public static final String COLUMNNAME_IsDiscountPrinted = "IsDiscountPrinted"; + + /** Set Discount Printed. + * Print Discount on Invoice and Order + */ + public void setIsDiscountPrinted (boolean IsDiscountPrinted); + + /** Get Discount Printed. + * Print Discount on Invoice and Order + */ + public boolean isDiscountPrinted(); + + /** Column name IsInDispute */ + public static final String COLUMNNAME_IsInDispute = "IsInDispute"; + + /** Set In Dispute. + * Document is in dispute + */ + public void setIsInDispute (boolean IsInDispute); + + /** Get In Dispute. + * Document is in dispute + */ + public boolean isInDispute(); + + /** Column name IsPaid */ + public static final String COLUMNNAME_IsPaid = "IsPaid"; + + /** Set Paid. + * The document is paid + */ + public void setIsPaid (boolean IsPaid); + + /** Get Paid. + * The document is paid + */ + public boolean isPaid(); + + /** Column name IsPayScheduleValid */ + public static final String COLUMNNAME_IsPayScheduleValid = "IsPayScheduleValid"; + + /** Set Pay Schedule valid. + * Is the Payment Schedule is valid + */ + public void setIsPayScheduleValid (boolean IsPayScheduleValid); + + /** Get Pay Schedule valid. + * Is the Payment Schedule is valid + */ + public boolean isPayScheduleValid(); + + /** Column name IsPrinted */ + public static final String COLUMNNAME_IsPrinted = "IsPrinted"; + + /** Set Printed. + * Indicates if this document / line is printed + */ + public void setIsPrinted (boolean IsPrinted); + + /** Get Printed. + * Indicates if this document / line is printed + */ + public boolean isPrinted(); + + /** Column name IsSelfService */ + public static final String COLUMNNAME_IsSelfService = "IsSelfService"; + + /** Set Self-Service. + * This is a Self-Service entry or this entry can be changed via Self-Service + */ + public void setIsSelfService (boolean IsSelfService); + + /** Get Self-Service. + * This is a Self-Service entry or this entry can be changed via Self-Service + */ + public boolean isSelfService(); + + /** Column name IsSOTrx */ + public static final String COLUMNNAME_IsSOTrx = "IsSOTrx"; + + /** Set Sales Transaction. + * This is a Sales Transaction + */ + public void setIsSOTrx (boolean IsSOTrx); + + /** Get Sales Transaction. + * This is a Sales Transaction + */ + public boolean isSOTrx(); + + /** Column name IsTaxIncluded */ + public static final String COLUMNNAME_IsTaxIncluded = "IsTaxIncluded"; + + /** Set Price includes Tax. + * Tax is included in the price + */ + public void setIsTaxIncluded (boolean IsTaxIncluded); + + /** Get Price includes Tax. + * Tax is included in the price + */ + public boolean isTaxIncluded(); + + /** Column name IsTransferred */ + public static final String COLUMNNAME_IsTransferred = "IsTransferred"; + + /** Set Transferred. + * Transferred to General Ledger (i.e. accounted) + */ + public void setIsTransferred (boolean IsTransferred); + + /** Get Transferred. + * Transferred to General Ledger (i.e. accounted) + */ + public boolean isTransferred(); + + /** Column name M_PriceList_ID */ + public static final String COLUMNNAME_M_PriceList_ID = "M_PriceList_ID"; + + /** Set Price List. + * Unique identifier of a Price List + */ + public void setM_PriceList_ID (int M_PriceList_ID); + + /** Get Price List. + * Unique identifier of a Price List + */ + public int getM_PriceList_ID(); + + public I_M_PriceList getM_PriceList() throws Exception; + + /** Column name M_RMA_ID */ + public static final String COLUMNNAME_M_RMA_ID = "M_RMA_ID"; + + /** Set RMA. + * Return Material Authorization + */ + public void setM_RMA_ID (int M_RMA_ID); + + /** Get RMA. + * Return Material Authorization + */ + public int getM_RMA_ID(); + + public I_M_RMA getM_RMA() throws Exception; + + /** Column name PaymentRule */ + public static final String COLUMNNAME_PaymentRule = "PaymentRule"; + + /** Set Payment Rule. + * How you pay the invoice + */ + public void setPaymentRule (String PaymentRule); + + /** Get Payment Rule. + * How you pay the invoice + */ + public String getPaymentRule(); + + /** Column name POReference */ + public static final String COLUMNNAME_POReference = "POReference"; + + /** Set Order Reference. + * Transaction Reference Number (Sales Order, Purchase Order) of your Business Partner + */ + public void setPOReference (String POReference); + + /** Get Order Reference. + * Transaction Reference Number (Sales Order, Purchase Order) of your Business Partner + */ + public String getPOReference(); + + /** Column name Posted */ + public static final String COLUMNNAME_Posted = "Posted"; + + /** Set Posted. + * Posting status + */ + public void setPosted (boolean Posted); + + /** Get Posted. + * Posting status + */ + public boolean isPosted(); + + /** Column name Processed */ + public static final String COLUMNNAME_Processed = "Processed"; + + /** Set Processed. + * The document has been processed + */ + public void setProcessed (boolean Processed); + + /** Get Processed. + * The document has been processed + */ + public boolean isProcessed(); + + /** Column name Processing */ + public static final String COLUMNNAME_Processing = "Processing"; + + /** Set Process Now */ + public void setProcessing (boolean Processing); + + /** Get Process Now */ + public boolean isProcessing(); + + /** Column name Ref_Invoice_ID */ + public static final String COLUMNNAME_Ref_Invoice_ID = "Ref_Invoice_ID"; + + /** Set Referenced Invoice */ + public void setRef_Invoice_ID (int Ref_Invoice_ID); + + /** Get Referenced Invoice */ + public int getRef_Invoice_ID(); + + /** Column name SalesRep_ID */ + public static final String COLUMNNAME_SalesRep_ID = "SalesRep_ID"; + + /** Set Sales Representative. + * Sales Representative or Company Agent + */ + public void setSalesRep_ID (int SalesRep_ID); + + /** Get Sales Representative. + * Sales Representative or Company Agent + */ + public int getSalesRep_ID(); + + /** Column name SendEMail */ + public static final String COLUMNNAME_SendEMail = "SendEMail"; + + /** Set Send EMail. + * Enable sending Document EMail + */ + public void setSendEMail (boolean SendEMail); + + /** Get Send EMail. + * Enable sending Document EMail + */ + public boolean isSendEMail(); + + /** Column name TotalLines */ + public static final String COLUMNNAME_TotalLines = "TotalLines"; + + /** Set Total Lines. + * Total of all document lines + */ + public void setTotalLines (BigDecimal TotalLines); + + /** Get Total Lines. + * Total of all document lines + */ + public BigDecimal getTotalLines(); + + /** Column name User1_ID */ + public static final String COLUMNNAME_User1_ID = "User1_ID"; + + /** Set User List 1. + * User defined list element #1 + */ + public void setUser1_ID (int User1_ID); + + /** Get User List 1. + * User defined list element #1 + */ + public int getUser1_ID(); + + /** Column name User2_ID */ + public static final String COLUMNNAME_User2_ID = "User2_ID"; + + /** Set User List 2. + * User defined list element #2 + */ + public void setUser2_ID (int User2_ID); + + /** Get User List 2. + * User defined list element #2 + */ + public int getUser2_ID(); +} diff --git a/posterita/posterita/src/main/org/compiere/model/I_C_Order.java b/posterita/posterita/src/main/org/compiere/model/I_C_Order.java new file mode 100644 index 0000000000..35acc2e482 --- /dev/null +++ b/posterita/posterita/src/main/org/compiere/model/I_C_Order.java @@ -0,0 +1,977 @@ +/********************************************************************** + * This file is part of Adempiere ERP Bazaar * + * http://www.adempiere.org * + * * + * Copyright (C) Trifon Trifonov. * + * Copyright (C) Contributors * + * * + * This program is free software; + you can redistribute it and/or * + * modify it under the terms of the GNU General Public License * + * as published by the Free Software Foundation; + either version 2 * + * of the License, or (at your option) any later version. * + * * + * This program 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; + if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301, USA. * + * * + * Contributors: * + * - Trifon Trifonov (trifonnt@users.sourceforge.net) * + * * + * Sponsors: * + * - Company (http://www.site.com) * + **********************************************************************/ +package org.compiere.model; + +import java.math.BigDecimal; +import java.sql.Timestamp; +import org.compiere.util.KeyNamePair; + +/** Generated Interface for C_Order + * @author Trifon Trifonov (generated) + * @version Release 3.4.0s + */ +public interface I_C_Order +{ + + /** TableName=C_Order */ + public static final String Table_Name = "C_Order"; + + /** AD_Table_ID=259 */ + public static final int Table_ID = MTable.getTable_ID(Table_Name); + + KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name); + + /** AccessLevel = 1 - Org + */ + BigDecimal accessLevel = BigDecimal.valueOf(1); + + /** Load Meta Data */ + + /** Column name AD_OrgTrx_ID */ + public static final String COLUMNNAME_AD_OrgTrx_ID = "AD_OrgTrx_ID"; + + /** Set Trx Organization. + * Performing or initiating organization + */ + public void setAD_OrgTrx_ID (int AD_OrgTrx_ID); + + /** Get Trx Organization. + * Performing or initiating organization + */ + public int getAD_OrgTrx_ID(); + + /** Column name AD_User_ID */ + public static final String COLUMNNAME_AD_User_ID = "AD_User_ID"; + + /** Set User/Contact. + * User within the system - Internal or Business Partner Contact + */ + public void setAD_User_ID (int AD_User_ID); + + /** Get User/Contact. + * User within the system - Internal or Business Partner Contact + */ + public int getAD_User_ID(); + + public I_AD_User getAD_User() throws Exception; + + /** Column name AmountRefunded */ + public static final String COLUMNNAME_AmountRefunded = "AmountRefunded"; + + /** Set AmountRefunded */ + public void setAmountRefunded (BigDecimal AmountRefunded); + + /** Get AmountRefunded */ + public BigDecimal getAmountRefunded(); + + /** Column name AmountTendered */ + public static final String COLUMNNAME_AmountTendered = "AmountTendered"; + + /** Set AmountTendered */ + public void setAmountTendered (BigDecimal AmountTendered); + + /** Get AmountTendered */ + public BigDecimal getAmountTendered(); + + /** Column name Bill_BPartner_ID */ + public static final String COLUMNNAME_Bill_BPartner_ID = "Bill_BPartner_ID"; + + /** Set Invoice Partner. + * Business Partner to be invoiced + */ + public void setBill_BPartner_ID (int Bill_BPartner_ID); + + /** Get Invoice Partner. + * Business Partner to be invoiced + */ + public int getBill_BPartner_ID(); + + /** Column name Bill_Location_ID */ + public static final String COLUMNNAME_Bill_Location_ID = "Bill_Location_ID"; + + /** Set Invoice Location. + * Business Partner Location for invoicing + */ + public void setBill_Location_ID (int Bill_Location_ID); + + /** Get Invoice Location. + * Business Partner Location for invoicing + */ + public int getBill_Location_ID(); + + /** Column name Bill_User_ID */ + public static final String COLUMNNAME_Bill_User_ID = "Bill_User_ID"; + + /** Set Invoice Contact. + * Business Partner Contact for invoicing + */ + public void setBill_User_ID (int Bill_User_ID); + + /** Get Invoice Contact. + * Business Partner Contact for invoicing + */ + public int getBill_User_ID(); + + /** Column name C_Activity_ID */ + public static final String COLUMNNAME_C_Activity_ID = "C_Activity_ID"; + + /** Set Activity. + * Business Activity + */ + public void setC_Activity_ID (int C_Activity_ID); + + /** Get Activity. + * Business Activity + */ + public int getC_Activity_ID(); + + public I_C_Activity getC_Activity() throws Exception; + + /** Column name C_BPartner_ID */ + public static final String COLUMNNAME_C_BPartner_ID = "C_BPartner_ID"; + + /** Set Business Partner . + * Identifies a Business Partner + */ + public void setC_BPartner_ID (int C_BPartner_ID); + + /** Get Business Partner . + * Identifies a Business Partner + */ + public int getC_BPartner_ID(); + + public I_C_BPartner getC_BPartner() throws Exception; + + /** Column name C_BPartner_Location_ID */ + public static final String COLUMNNAME_C_BPartner_Location_ID = "C_BPartner_Location_ID"; + + /** Set Partner Location. + * Identifies the (ship to) address for this Business Partner + */ + public void setC_BPartner_Location_ID (int C_BPartner_Location_ID); + + /** Get Partner Location. + * Identifies the (ship to) address for this Business Partner + */ + public int getC_BPartner_Location_ID(); + + public I_C_BPartner_Location getC_BPartner_Location() throws Exception; + + /** Column name C_Campaign_ID */ + public static final String COLUMNNAME_C_Campaign_ID = "C_Campaign_ID"; + + /** Set Campaign. + * Marketing Campaign + */ + public void setC_Campaign_ID (int C_Campaign_ID); + + /** Get Campaign. + * Marketing Campaign + */ + public int getC_Campaign_ID(); + + public I_C_Campaign getC_Campaign() throws Exception; + + /** Column name C_CashLine_ID */ + public static final String COLUMNNAME_C_CashLine_ID = "C_CashLine_ID"; + + /** Set Cash Journal Line. + * Cash Journal Line + */ + public void setC_CashLine_ID (int C_CashLine_ID); + + /** Get Cash Journal Line. + * Cash Journal Line + */ + public int getC_CashLine_ID(); + + public I_C_CashLine getC_CashLine() throws Exception; + + /** Column name C_Charge_ID */ + public static final String COLUMNNAME_C_Charge_ID = "C_Charge_ID"; + + /** Set Charge. + * Additional document charges + */ + public void setC_Charge_ID (int C_Charge_ID); + + /** Get Charge. + * Additional document charges + */ + public int getC_Charge_ID(); + + /** Column name C_ConversionType_ID */ + public static final String COLUMNNAME_C_ConversionType_ID = "C_ConversionType_ID"; + + /** Set Currency Type. + * Currency Conversion Rate Type + */ + public void setC_ConversionType_ID (int C_ConversionType_ID); + + /** Get Currency Type. + * Currency Conversion Rate Type + */ + public int getC_ConversionType_ID(); + + public I_C_ConversionType getC_ConversionType() throws Exception; + + /** Column name C_Currency_ID */ + public static final String COLUMNNAME_C_Currency_ID = "C_Currency_ID"; + + /** Set Currency. + * The Currency for this record + */ + public void setC_Currency_ID (int C_Currency_ID); + + /** Get Currency. + * The Currency for this record + */ + public int getC_Currency_ID(); + + public I_C_Currency getC_Currency() throws Exception; + + /** Column name C_DocType_ID */ + public static final String COLUMNNAME_C_DocType_ID = "C_DocType_ID"; + + /** Set Document Type. + * Document type or rules + */ + public void setC_DocType_ID (int C_DocType_ID); + + /** Get Document Type. + * Document type or rules + */ + public int getC_DocType_ID(); + + public I_C_DocType getC_DocType() throws Exception; + + /** Column name C_DocTypeTarget_ID */ + public static final String COLUMNNAME_C_DocTypeTarget_ID = "C_DocTypeTarget_ID"; + + /** Set Target Document Type. + * Target document type for conversing documents + */ + public void setC_DocTypeTarget_ID (int C_DocTypeTarget_ID); + + /** Get Target Document Type. + * Target document type for conversing documents + */ + public int getC_DocTypeTarget_ID(); + + /** Column name ChargeAmt */ + public static final String COLUMNNAME_ChargeAmt = "ChargeAmt"; + + /** Set Charge amount. + * Charge Amount + */ + public void setChargeAmt (BigDecimal ChargeAmt); + + /** Get Charge amount. + * Charge Amount + */ + public BigDecimal getChargeAmt(); + + /** Column name CopyFrom */ + public static final String COLUMNNAME_CopyFrom = "CopyFrom"; + + /** Set Copy From. + * Copy From Record + */ + public void setCopyFrom (String CopyFrom); + + /** Get Copy From. + * Copy From Record + */ + public String getCopyFrom(); + + /** Column name C_Order_ID */ + public static final String COLUMNNAME_C_Order_ID = "C_Order_ID"; + + /** Set Order. + * Order + */ + public void setC_Order_ID (int C_Order_ID); + + /** Get Order. + * Order + */ + public int getC_Order_ID(); + + /** Column name C_Payment_ID */ + public static final String COLUMNNAME_C_Payment_ID = "C_Payment_ID"; + + /** Set Payment. + * Payment identifier + */ + public void setC_Payment_ID (int C_Payment_ID); + + /** Get Payment. + * Payment identifier + */ + public int getC_Payment_ID(); + + public I_C_Payment getC_Payment() throws Exception; + + /** Column name C_PaymentTerm_ID */ + public static final String COLUMNNAME_C_PaymentTerm_ID = "C_PaymentTerm_ID"; + + /** Set Payment Term. + * The terms of Payment (timing, discount) + */ + public void setC_PaymentTerm_ID (int C_PaymentTerm_ID); + + /** Get Payment Term. + * The terms of Payment (timing, discount) + */ + public int getC_PaymentTerm_ID(); + + public I_C_PaymentTerm getC_PaymentTerm() throws Exception; + + /** Column name C_POS_ID */ + public static final String COLUMNNAME_C_POS_ID = "C_POS_ID"; + + /** Set POS Terminal. + * Point of Sales Terminal + */ + public void setC_POS_ID (int C_POS_ID); + + /** Get POS Terminal. + * Point of Sales Terminal + */ + public int getC_POS_ID(); + + public I_C_POS getC_POS() throws Exception; + + /** Column name C_Project_ID */ + public static final String COLUMNNAME_C_Project_ID = "C_Project_ID"; + + /** Set Project. + * Financial Project + */ + public void setC_Project_ID (int C_Project_ID); + + /** Get Project. + * Financial Project + */ + public int getC_Project_ID(); + + public I_C_Project getC_Project() throws Exception; + + /** Column name DateAcct */ + public static final String COLUMNNAME_DateAcct = "DateAcct"; + + /** Set Account Date. + * Accounting Date + */ + public void setDateAcct (Timestamp DateAcct); + + /** Get Account Date. + * Accounting Date + */ + public Timestamp getDateAcct(); + + /** Column name DateOrdered */ + public static final String COLUMNNAME_DateOrdered = "DateOrdered"; + + /** Set Date Ordered. + * Date of Order + */ + public void setDateOrdered (Timestamp DateOrdered); + + /** Get Date Ordered. + * Date of Order + */ + public Timestamp getDateOrdered(); + + /** Column name DatePrinted */ + public static final String COLUMNNAME_DatePrinted = "DatePrinted"; + + /** Set Date printed. + * Date the document was printed. + */ + public void setDatePrinted (Timestamp DatePrinted); + + /** Get Date printed. + * Date the document was printed. + */ + public Timestamp getDatePrinted(); + + /** Column name DatePromised */ + public static final String COLUMNNAME_DatePromised = "DatePromised"; + + /** Set Date Promised. + * Date Order was promised + */ + public void setDatePromised (Timestamp DatePromised); + + /** Get Date Promised. + * Date Order was promised + */ + public Timestamp getDatePromised(); + + /** Column name DeliveryRule */ + public static final String COLUMNNAME_DeliveryRule = "DeliveryRule"; + + /** Set Delivery Rule. + * Defines the timing of Delivery + */ + public void setDeliveryRule (String DeliveryRule); + + /** Get Delivery Rule. + * Defines the timing of Delivery + */ + public String getDeliveryRule(); + + /** Column name DeliveryViaRule */ + public static final String COLUMNNAME_DeliveryViaRule = "DeliveryViaRule"; + + /** Set Delivery Via. + * How the order will be delivered + */ + public void setDeliveryViaRule (String DeliveryViaRule); + + /** Get Delivery Via. + * How the order will be delivered + */ + public String getDeliveryViaRule(); + + /** Column name Description */ + public static final String COLUMNNAME_Description = "Description"; + + /** Set Description. + * Optional short description of the record + */ + public void setDescription (String Description); + + /** Get Description. + * Optional short description of the record + */ + public String getDescription(); + + /** Column name DocAction */ + public static final String COLUMNNAME_DocAction = "DocAction"; + + /** Set Document Action. + * The targeted status of the document + */ + public void setDocAction (String DocAction); + + /** Get Document Action. + * The targeted status of the document + */ + public String getDocAction(); + + /** Column name DocStatus */ + public static final String COLUMNNAME_DocStatus = "DocStatus"; + + /** Set Document Status. + * The current status of the document + */ + public void setDocStatus (String DocStatus); + + /** Get Document Status. + * The current status of the document + */ + public String getDocStatus(); + + /** Column name DocumentNo */ + public static final String COLUMNNAME_DocumentNo = "DocumentNo"; + + /** Set Document No. + * Document sequence number of the document + */ + public void setDocumentNo (String DocumentNo); + + /** Get Document No. + * Document sequence number of the document + */ + public String getDocumentNo(); + + /** Column name FreightAmt */ + public static final String COLUMNNAME_FreightAmt = "FreightAmt"; + + /** Set Freight Amount. + * Freight Amount + */ + public void setFreightAmt (BigDecimal FreightAmt); + + /** Get Freight Amount. + * Freight Amount + */ + public BigDecimal getFreightAmt(); + + /** Column name FreightCostRule */ + public static final String COLUMNNAME_FreightCostRule = "FreightCostRule"; + + /** Set Freight Cost Rule. + * Method for charging Freight + */ + public void setFreightCostRule (String FreightCostRule); + + /** Get Freight Cost Rule. + * Method for charging Freight + */ + public String getFreightCostRule(); + + /** Column name GrandTotal */ + public static final String COLUMNNAME_GrandTotal = "GrandTotal"; + + /** Set Grand Total. + * Total amount of document + */ + public void setGrandTotal (BigDecimal GrandTotal); + + /** Get Grand Total. + * Total amount of document + */ + public BigDecimal getGrandTotal(); + + /** Column name InvoiceRule */ + public static final String COLUMNNAME_InvoiceRule = "InvoiceRule"; + + /** Set Invoice Rule. + * Frequency and method of invoicing + */ + public void setInvoiceRule (String InvoiceRule); + + /** Get Invoice Rule. + * Frequency and method of invoicing + */ + public String getInvoiceRule(); + + /** Column name IsApproved */ + public static final String COLUMNNAME_IsApproved = "IsApproved"; + + /** Set Approved. + * Indicates if this document requires approval + */ + public void setIsApproved (boolean IsApproved); + + /** Get Approved. + * Indicates if this document requires approval + */ + public boolean isApproved(); + + /** Column name IsCreditApproved */ + public static final String COLUMNNAME_IsCreditApproved = "IsCreditApproved"; + + /** Set Credit Approved. + * Credit has been approved + */ + public void setIsCreditApproved (boolean IsCreditApproved); + + /** Get Credit Approved. + * Credit has been approved + */ + public boolean isCreditApproved(); + + /** Column name IsDelivered */ + public static final String COLUMNNAME_IsDelivered = "IsDelivered"; + + /** Set Delivered */ + public void setIsDelivered (boolean IsDelivered); + + /** Get Delivered */ + public boolean isDelivered(); + + /** Column name IsDiscountPrinted */ + public static final String COLUMNNAME_IsDiscountPrinted = "IsDiscountPrinted"; + + /** Set Discount Printed. + * Print Discount on Invoice and Order + */ + public void setIsDiscountPrinted (boolean IsDiscountPrinted); + + /** Get Discount Printed. + * Print Discount on Invoice and Order + */ + public boolean isDiscountPrinted(); + + /** Column name IsDropShip */ + public static final String COLUMNNAME_IsDropShip = "IsDropShip"; + + /** Set Drop Shipment. + * Drop Shipments are sent from the Vendor directly to the Customer + */ + public void setIsDropShip (boolean IsDropShip); + + /** Get Drop Shipment. + * Drop Shipments are sent from the Vendor directly to the Customer + */ + public boolean isDropShip(); + + /** Column name IsInvoiced */ + public static final String COLUMNNAME_IsInvoiced = "IsInvoiced"; + + /** Set Invoiced. + * Is this invoiced? + */ + public void setIsInvoiced (boolean IsInvoiced); + + /** Get Invoiced. + * Is this invoiced? + */ + public boolean isInvoiced(); + + /** Column name IsPrinted */ + public static final String COLUMNNAME_IsPrinted = "IsPrinted"; + + /** Set Printed. + * Indicates if this document / line is printed + */ + public void setIsPrinted (boolean IsPrinted); + + /** Get Printed. + * Indicates if this document / line is printed + */ + public boolean isPrinted(); + + /** Column name IsSelected */ + public static final String COLUMNNAME_IsSelected = "IsSelected"; + + /** Set Selected */ + public void setIsSelected (boolean IsSelected); + + /** Get Selected */ + public boolean isSelected(); + + /** Column name IsSelfService */ + public static final String COLUMNNAME_IsSelfService = "IsSelfService"; + + /** Set Self-Service. + * This is a Self-Service entry or this entry can be changed via Self-Service + */ + public void setIsSelfService (boolean IsSelfService); + + /** Get Self-Service. + * This is a Self-Service entry or this entry can be changed via Self-Service + */ + public boolean isSelfService(); + + /** Column name IsSOTrx */ + public static final String COLUMNNAME_IsSOTrx = "IsSOTrx"; + + /** Set Sales Transaction. + * This is a Sales Transaction + */ + public void setIsSOTrx (boolean IsSOTrx); + + /** Get Sales Transaction. + * This is a Sales Transaction + */ + public boolean isSOTrx(); + + /** Column name IsTaxIncluded */ + public static final String COLUMNNAME_IsTaxIncluded = "IsTaxIncluded"; + + /** Set Price includes Tax. + * Tax is included in the price + */ + public void setIsTaxIncluded (boolean IsTaxIncluded); + + /** Get Price includes Tax. + * Tax is included in the price + */ + public boolean isTaxIncluded(); + + /** Column name IsTransferred */ + public static final String COLUMNNAME_IsTransferred = "IsTransferred"; + + /** Set Transferred. + * Transferred to General Ledger (i.e. accounted) + */ + public void setIsTransferred (boolean IsTransferred); + + /** Get Transferred. + * Transferred to General Ledger (i.e. accounted) + */ + public boolean isTransferred(); + + /** Column name M_PriceList_ID */ + public static final String COLUMNNAME_M_PriceList_ID = "M_PriceList_ID"; + + /** Set Price List. + * Unique identifier of a Price List + */ + public void setM_PriceList_ID (int M_PriceList_ID); + + /** Get Price List. + * Unique identifier of a Price List + */ + public int getM_PriceList_ID(); + + public I_M_PriceList getM_PriceList() throws Exception; + + /** Column name M_Shipper_ID */ + public static final String COLUMNNAME_M_Shipper_ID = "M_Shipper_ID"; + + /** Set Shipper. + * Method or manner of product delivery + */ + public void setM_Shipper_ID (int M_Shipper_ID); + + /** Get Shipper. + * Method or manner of product delivery + */ + public int getM_Shipper_ID(); + + public I_M_Shipper getM_Shipper() throws Exception; + + /** Column name M_Warehouse_ID */ + public static final String COLUMNNAME_M_Warehouse_ID = "M_Warehouse_ID"; + + /** Set Warehouse. + * Storage Warehouse and Service Point + */ + public void setM_Warehouse_ID (int M_Warehouse_ID); + + /** Get Warehouse. + * Storage Warehouse and Service Point + */ + public int getM_Warehouse_ID(); + + public I_M_Warehouse getM_Warehouse() throws Exception; + + /** Column name OrderType */ + public static final String COLUMNNAME_OrderType = "OrderType"; + + /** Set OrderType */ + public void setOrderType (String OrderType); + + /** Get OrderType */ + public String getOrderType(); + + /** Column name Pay_BPartner_ID */ + public static final String COLUMNNAME_Pay_BPartner_ID = "Pay_BPartner_ID"; + + /** Set Payment BPartner. + * Business Partner responsible for the payment + */ + public void setPay_BPartner_ID (int Pay_BPartner_ID); + + /** Get Payment BPartner. + * Business Partner responsible for the payment + */ + public int getPay_BPartner_ID(); + + /** Column name Pay_Location_ID */ + public static final String COLUMNNAME_Pay_Location_ID = "Pay_Location_ID"; + + /** Set Payment Location. + * Location of the Business Partner responsible for the payment + */ + public void setPay_Location_ID (int Pay_Location_ID); + + /** Get Payment Location. + * Location of the Business Partner responsible for the payment + */ + public int getPay_Location_ID(); + + /** Column name PaymentRule */ + public static final String COLUMNNAME_PaymentRule = "PaymentRule"; + + /** Set Payment Rule. + * How you pay the invoice + */ + public void setPaymentRule (String PaymentRule); + + /** Get Payment Rule. + * How you pay the invoice + */ + public String getPaymentRule(); + + /** Column name POReference */ + public static final String COLUMNNAME_POReference = "POReference"; + + /** Set Order Reference. + * Transaction Reference Number (Sales Order, Purchase Order) of your Business Partner + */ + public void setPOReference (String POReference); + + /** Get Order Reference. + * Transaction Reference Number (Sales Order, Purchase Order) of your Business Partner + */ + public String getPOReference(); + + /** Column name Posted */ + public static final String COLUMNNAME_Posted = "Posted"; + + /** Set Posted. + * Posting status + */ + public void setPosted (boolean Posted); + + /** Get Posted. + * Posting status + */ + public boolean isPosted(); + + /** Column name PriorityRule */ + public static final String COLUMNNAME_PriorityRule = "PriorityRule"; + + /** Set Priority. + * Priority of a document + */ + public void setPriorityRule (String PriorityRule); + + /** Get Priority. + * Priority of a document + */ + public String getPriorityRule(); + + /** Column name Processed */ + public static final String COLUMNNAME_Processed = "Processed"; + + /** Set Processed. + * The document has been processed + */ + public void setProcessed (boolean Processed); + + /** Get Processed. + * The document has been processed + */ + public boolean isProcessed(); + + /** Column name Processing */ + public static final String COLUMNNAME_Processing = "Processing"; + + /** Set Process Now */ + public void setProcessing (boolean Processing); + + /** Get Process Now */ + public boolean isProcessing(); + + /** Column name Ref_Order_ID */ + public static final String COLUMNNAME_Ref_Order_ID = "Ref_Order_ID"; + + /** Set Referenced Order. + * Reference to corresponding Sales/Purchase Order + */ + public void setRef_Order_ID (int Ref_Order_ID); + + /** Get Referenced Order. + * Reference to corresponding Sales/Purchase Order + */ + public int getRef_Order_ID(); + + /** Column name SalesRep_ID */ + public static final String COLUMNNAME_SalesRep_ID = "SalesRep_ID"; + + /** Set Sales Representative. + * Sales Representative or Company Agent + */ + public void setSalesRep_ID (int SalesRep_ID); + + /** Get Sales Representative. + * Sales Representative or Company Agent + */ + public int getSalesRep_ID(); + + /** Column name SendEMail */ + public static final String COLUMNNAME_SendEMail = "SendEMail"; + + /** Set Send EMail. + * Enable sending Document EMail + */ + public void setSendEMail (boolean SendEMail); + + /** Get Send EMail. + * Enable sending Document EMail + */ + public boolean isSendEMail(); + + /** Column name TotalLines */ + public static final String COLUMNNAME_TotalLines = "TotalLines"; + + /** Set Total Lines. + * Total of all document lines + */ + public void setTotalLines (BigDecimal TotalLines); + + /** Get Total Lines. + * Total of all document lines + */ + public BigDecimal getTotalLines(); + + /** Column name User1_ID */ + public static final String COLUMNNAME_User1_ID = "User1_ID"; + + /** Set User List 1. + * User defined list element #1 + */ + public void setUser1_ID (int User1_ID); + + /** Get User List 1. + * User defined list element #1 + */ + public int getUser1_ID(); + + /** Column name User2_ID */ + public static final String COLUMNNAME_User2_ID = "User2_ID"; + + /** Set User List 2. + * User defined list element #2 + */ + public void setUser2_ID (int User2_ID); + + /** Get User List 2. + * User defined list element #2 + */ + public int getUser2_ID(); + + /** Column name Volume */ + public static final String COLUMNNAME_Volume = "Volume"; + + /** Set Volume. + * Volume of a product + */ + public void setVolume (BigDecimal Volume); + + /** Get Volume. + * Volume of a product + */ + public BigDecimal getVolume(); + + /** Column name Weight */ + public static final String COLUMNNAME_Weight = "Weight"; + + /** Set Weight. + * Weight of a product + */ + public void setWeight (BigDecimal Weight); + + /** Get Weight. + * Weight of a product + */ + public BigDecimal getWeight(); +} diff --git a/posterita/posterita/src/main/org/compiere/model/I_C_Payment.java b/posterita/posterita/src/main/org/compiere/model/I_C_Payment.java new file mode 100644 index 0000000000..13b73bd96b --- /dev/null +++ b/posterita/posterita/src/main/org/compiere/model/I_C_Payment.java @@ -0,0 +1,1093 @@ +/********************************************************************** + * This file is part of Adempiere ERP Bazaar * + * http://www.adempiere.org * + * * + * Copyright (C) Trifon Trifonov. * + * Copyright (C) Contributors * + * * + * This program is free software; + you can redistribute it and/or * + * modify it under the terms of the GNU General Public License * + * as published by the Free Software Foundation; + either version 2 * + * of the License, or (at your option) any later version. * + * * + * This program 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; + if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301, USA. * + * * + * Contributors: * + * - Trifon Trifonov (trifonnt@users.sourceforge.net) * + * * + * Sponsors: * + * - Company (http://www.site.com) * + **********************************************************************/ +package org.compiere.model; + +import java.math.BigDecimal; +import java.sql.Timestamp; +import org.compiere.util.KeyNamePair; + +/** Generated Interface for C_Payment + * @author Trifon Trifonov (generated) + * @version Release 3.5.0 + */ +public interface I_C_Payment +{ + + /** TableName=C_Payment */ + public static final String Table_Name = "C_Payment"; + + /** AD_Table_ID=335 */ + public static final int Table_ID = MTable.getTable_ID(Table_Name); + + KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name); + + /** AccessLevel = 1 - Org + */ + BigDecimal accessLevel = BigDecimal.valueOf(1); + + /** Load Meta Data */ + + /** Column name AD_OrgTrx_ID */ + public static final String COLUMNNAME_AD_OrgTrx_ID = "AD_OrgTrx_ID"; + + /** Set Trx Organization. + * Performing or initiating organization + */ + public void setAD_OrgTrx_ID (int AD_OrgTrx_ID); + + /** Get Trx Organization. + * Performing or initiating organization + */ + public int getAD_OrgTrx_ID(); + + /** Column name A_City */ + public static final String COLUMNNAME_A_City = "A_City"; + + /** Set Account City. + * City or the Credit Card or Account Holder + */ + public void setA_City (String A_City); + + /** Get Account City. + * City or the Credit Card or Account Holder + */ + public String getA_City(); + + /** Column name A_Country */ + public static final String COLUMNNAME_A_Country = "A_Country"; + + /** Set Account Country. + * Country + */ + public void setA_Country (String A_Country); + + /** Get Account Country. + * Country + */ + public String getA_Country(); + + /** Column name A_EMail */ + public static final String COLUMNNAME_A_EMail = "A_EMail"; + + /** Set Account EMail. + * Email Address + */ + public void setA_EMail (String A_EMail); + + /** Get Account EMail. + * Email Address + */ + public String getA_EMail(); + + /** Column name A_Ident_DL */ + public static final String COLUMNNAME_A_Ident_DL = "A_Ident_DL"; + + /** Set Driver License. + * Payment Identification - Driver License + */ + public void setA_Ident_DL (String A_Ident_DL); + + /** Get Driver License. + * Payment Identification - Driver License + */ + public String getA_Ident_DL(); + + /** Column name A_Ident_SSN */ + public static final String COLUMNNAME_A_Ident_SSN = "A_Ident_SSN"; + + /** Set Social Security No. + * Payment Identification - Social Security No + */ + public void setA_Ident_SSN (String A_Ident_SSN); + + /** Get Social Security No. + * Payment Identification - Social Security No + */ + public String getA_Ident_SSN(); + + /** Column name A_Name */ + public static final String COLUMNNAME_A_Name = "A_Name"; + + /** Set Account Name. + * Name on Credit Card or Account holder + */ + public void setA_Name (String A_Name); + + /** Get Account Name. + * Name on Credit Card or Account holder + */ + public String getA_Name(); + + /** Column name A_State */ + public static final String COLUMNNAME_A_State = "A_State"; + + /** Set Account State. + * State of the Credit Card or Account holder + */ + public void setA_State (String A_State); + + /** Get Account State. + * State of the Credit Card or Account holder + */ + public String getA_State(); + + /** Column name A_Street */ + public static final String COLUMNNAME_A_Street = "A_Street"; + + /** Set Account Street. + * Street address of the Credit Card or Account holder + */ + public void setA_Street (String A_Street); + + /** Get Account Street. + * Street address of the Credit Card or Account holder + */ + public String getA_Street(); + + /** Column name A_Zip */ + public static final String COLUMNNAME_A_Zip = "A_Zip"; + + /** Set Account Zip/Postal. + * Zip Code of the Credit Card or Account Holder + */ + public void setA_Zip (String A_Zip); + + /** Get Account Zip/Postal. + * Zip Code of the Credit Card or Account Holder + */ + public String getA_Zip(); + + /** Column name AccountNo */ + public static final String COLUMNNAME_AccountNo = "AccountNo"; + + /** Set Account No. + * Account Number + */ + public void setAccountNo (String AccountNo); + + /** Get Account No. + * Account Number + */ + public String getAccountNo(); + + /** Column name C_Activity_ID */ + public static final String COLUMNNAME_C_Activity_ID = "C_Activity_ID"; + + /** Set Activity. + * Business Activity + */ + public void setC_Activity_ID (int C_Activity_ID); + + /** Get Activity. + * Business Activity + */ + public int getC_Activity_ID(); + + public I_C_Activity getC_Activity() throws Exception; + + /** Column name C_BP_BankAccount_ID */ + public static final String COLUMNNAME_C_BP_BankAccount_ID = "C_BP_BankAccount_ID"; + + /** Set Partner Bank Account. + * Bank Account of the Business Partner + */ + public void setC_BP_BankAccount_ID (int C_BP_BankAccount_ID); + + /** Get Partner Bank Account. + * Bank Account of the Business Partner + */ + public int getC_BP_BankAccount_ID(); + + public I_C_BP_BankAccount getC_BP_BankAccount() throws Exception; + + /** Column name C_BPartner_ID */ + public static final String COLUMNNAME_C_BPartner_ID = "C_BPartner_ID"; + + /** Set Business Partner . + * Identifies a Business Partner + */ + public void setC_BPartner_ID (int C_BPartner_ID); + + /** Get Business Partner . + * Identifies a Business Partner + */ + public int getC_BPartner_ID(); + + public I_C_BPartner getC_BPartner() throws Exception; + + /** Column name C_BankAccount_ID */ + public static final String COLUMNNAME_C_BankAccount_ID = "C_BankAccount_ID"; + + /** Set Bank Account. + * Account at the Bank + */ + public void setC_BankAccount_ID (int C_BankAccount_ID); + + /** Get Bank Account. + * Account at the Bank + */ + public int getC_BankAccount_ID(); + + public I_C_BankAccount getC_BankAccount() throws Exception; + + /** Column name C_Campaign_ID */ + public static final String COLUMNNAME_C_Campaign_ID = "C_Campaign_ID"; + + /** Set Campaign. + * Marketing Campaign + */ + public void setC_Campaign_ID (int C_Campaign_ID); + + /** Get Campaign. + * Marketing Campaign + */ + public int getC_Campaign_ID(); + + public I_C_Campaign getC_Campaign() throws Exception; + + /** Column name C_CashBook_ID */ + public static final String COLUMNNAME_C_CashBook_ID = "C_CashBook_ID"; + + /** Set Cash Book. + * Cash Book for recording petty cash transactions + */ + public void setC_CashBook_ID (int C_CashBook_ID); + + /** Get Cash Book. + * Cash Book for recording petty cash transactions + */ + public int getC_CashBook_ID(); + + public I_C_CashBook getC_CashBook() throws Exception; + + /** Column name C_Charge_ID */ + public static final String COLUMNNAME_C_Charge_ID = "C_Charge_ID"; + + /** Set Charge. + * Additional document charges + */ + public void setC_Charge_ID (int C_Charge_ID); + + /** Get Charge. + * Additional document charges + */ + public int getC_Charge_ID(); + + public I_C_Charge getC_Charge() throws Exception; + + /** Column name C_ConversionType_ID */ + public static final String COLUMNNAME_C_ConversionType_ID = "C_ConversionType_ID"; + + /** Set Currency Type. + * Currency Conversion Rate Type + */ + public void setC_ConversionType_ID (int C_ConversionType_ID); + + /** Get Currency Type. + * Currency Conversion Rate Type + */ + public int getC_ConversionType_ID(); + + public I_C_ConversionType getC_ConversionType() throws Exception; + + /** Column name C_Currency_ID */ + public static final String COLUMNNAME_C_Currency_ID = "C_Currency_ID"; + + /** Set Currency. + * The Currency for this record + */ + public void setC_Currency_ID (int C_Currency_ID); + + /** Get Currency. + * The Currency for this record + */ + public int getC_Currency_ID(); + + public I_C_Currency getC_Currency() throws Exception; + + /** Column name C_DocType_ID */ + public static final String COLUMNNAME_C_DocType_ID = "C_DocType_ID"; + + /** Set Document Type. + * Document type or rules + */ + public void setC_DocType_ID (int C_DocType_ID); + + /** Get Document Type. + * Document type or rules + */ + public int getC_DocType_ID(); + + public I_C_DocType getC_DocType() throws Exception; + + /** Column name C_Invoice_ID */ + public static final String COLUMNNAME_C_Invoice_ID = "C_Invoice_ID"; + + /** Set Invoice. + * Invoice Identifier + */ + public void setC_Invoice_ID (int C_Invoice_ID); + + /** Get Invoice. + * Invoice Identifier + */ + public int getC_Invoice_ID(); + + public I_C_Invoice getC_Invoice() throws Exception; + + /** Column name C_Order_ID */ + public static final String COLUMNNAME_C_Order_ID = "C_Order_ID"; + + /** Set Order. + * Order + */ + public void setC_Order_ID (int C_Order_ID); + + /** Get Order. + * Order + */ + public int getC_Order_ID(); + + public I_C_Order getC_Order() throws Exception; + + /** Column name C_PaymentBatch_ID */ + public static final String COLUMNNAME_C_PaymentBatch_ID = "C_PaymentBatch_ID"; + + /** Set Payment Batch. + * Payment batch for EFT + */ + public void setC_PaymentBatch_ID (int C_PaymentBatch_ID); + + /** Get Payment Batch. + * Payment batch for EFT + */ + public int getC_PaymentBatch_ID(); + + public I_C_PaymentBatch getC_PaymentBatch() throws Exception; + + /** Column name C_Payment_ID */ + public static final String COLUMNNAME_C_Payment_ID = "C_Payment_ID"; + + /** Set Payment. + * Payment identifier + */ + public void setC_Payment_ID (int C_Payment_ID); + + /** Get Payment. + * Payment identifier + */ + public int getC_Payment_ID(); + + /** Column name C_Project_ID */ + public static final String COLUMNNAME_C_Project_ID = "C_Project_ID"; + + /** Set Project. + * Financial Project + */ + public void setC_Project_ID (int C_Project_ID); + + /** Get Project. + * Financial Project + */ + public int getC_Project_ID(); + + public I_C_Project getC_Project() throws Exception; + + /** Column name ChargeAmt */ + public static final String COLUMNNAME_ChargeAmt = "ChargeAmt"; + + /** Set Charge amount. + * Charge Amount + */ + public void setChargeAmt (BigDecimal ChargeAmt); + + /** Get Charge amount. + * Charge Amount + */ + public BigDecimal getChargeAmt(); + + /** Column name CheckNo */ + public static final String COLUMNNAME_CheckNo = "CheckNo"; + + /** Set Check No. + * Check Number + */ + public void setCheckNo (String CheckNo); + + /** Get Check No. + * Check Number + */ + public String getCheckNo(); + + /** Column name CreditCardExpMM */ + public static final String COLUMNNAME_CreditCardExpMM = "CreditCardExpMM"; + + /** Set Exp. Month. + * Expiry Month + */ + public void setCreditCardExpMM (int CreditCardExpMM); + + /** Get Exp. Month. + * Expiry Month + */ + public int getCreditCardExpMM(); + + /** Column name CreditCardExpYY */ + public static final String COLUMNNAME_CreditCardExpYY = "CreditCardExpYY"; + + /** Set Exp. Year. + * Expiry Year + */ + public void setCreditCardExpYY (int CreditCardExpYY); + + /** Get Exp. Year. + * Expiry Year + */ + public int getCreditCardExpYY(); + + /** Column name CreditCardNumber */ + public static final String COLUMNNAME_CreditCardNumber = "CreditCardNumber"; + + /** Set Number. + * Credit Card Number + */ + public void setCreditCardNumber (String CreditCardNumber); + + /** Get Number. + * Credit Card Number + */ + public String getCreditCardNumber(); + + /** Column name CreditCardType */ + public static final String COLUMNNAME_CreditCardType = "CreditCardType"; + + /** Set Credit Card. + * Credit Card (Visa, MC, AmEx) + */ + public void setCreditCardType (String CreditCardType); + + /** Get Credit Card. + * Credit Card (Visa, MC, AmEx) + */ + public String getCreditCardType(); + + /** Column name CreditCardVV */ + public static final String COLUMNNAME_CreditCardVV = "CreditCardVV"; + + /** Set Verification Code. + * Credit Card Verification code on credit card + */ + public void setCreditCardVV (String CreditCardVV); + + /** Get Verification Code. + * Credit Card Verification code on credit card + */ + public String getCreditCardVV(); + + /** Column name DateAcct */ + public static final String COLUMNNAME_DateAcct = "DateAcct"; + + /** Set Account Date. + * Accounting Date + */ + public void setDateAcct (Timestamp DateAcct); + + /** Get Account Date. + * Accounting Date + */ + public Timestamp getDateAcct(); + + /** Column name DateTrx */ + public static final String COLUMNNAME_DateTrx = "DateTrx"; + + /** Set Transaction Date. + * Transaction Date + */ + public void setDateTrx (Timestamp DateTrx); + + /** Get Transaction Date. + * Transaction Date + */ + public Timestamp getDateTrx(); + + /** Column name Description */ + public static final String COLUMNNAME_Description = "Description"; + + /** Set Description. + * Optional short description of the record + */ + public void setDescription (String Description); + + /** Get Description. + * Optional short description of the record + */ + public String getDescription(); + + /** Column name DiscountAmt */ + public static final String COLUMNNAME_DiscountAmt = "DiscountAmt"; + + /** Set Discount Amount. + * Calculated amount of discount + */ + public void setDiscountAmt (BigDecimal DiscountAmt); + + /** Get Discount Amount. + * Calculated amount of discount + */ + public BigDecimal getDiscountAmt(); + + /** Column name DocAction */ + public static final String COLUMNNAME_DocAction = "DocAction"; + + /** Set Document Action. + * The targeted status of the document + */ + public void setDocAction (String DocAction); + + /** Get Document Action. + * The targeted status of the document + */ + public String getDocAction(); + + /** Column name DocStatus */ + public static final String COLUMNNAME_DocStatus = "DocStatus"; + + /** Set Document Status. + * The current status of the document + */ + public void setDocStatus (String DocStatus); + + /** Get Document Status. + * The current status of the document + */ + public String getDocStatus(); + + /** Column name DocumentNo */ + public static final String COLUMNNAME_DocumentNo = "DocumentNo"; + + /** Set Document No. + * Document sequence number of the document + */ + public void setDocumentNo (String DocumentNo); + + /** Get Document No. + * Document sequence number of the document + */ + public String getDocumentNo(); + + /** Column name IsAllocated */ + public static final String COLUMNNAME_IsAllocated = "IsAllocated"; + + /** Set Allocated. + * Indicates if the payment has been allocated + */ + public void setIsAllocated (boolean IsAllocated); + + /** Get Allocated. + * Indicates if the payment has been allocated + */ + public boolean isAllocated(); + + /** Column name IsApproved */ + public static final String COLUMNNAME_IsApproved = "IsApproved"; + + /** Set Approved. + * Indicates if this document requires approval + */ + public void setIsApproved (boolean IsApproved); + + /** Get Approved. + * Indicates if this document requires approval + */ + public boolean isApproved(); + + /** Column name IsDelayedCapture */ + public static final String COLUMNNAME_IsDelayedCapture = "IsDelayedCapture"; + + /** Set Delayed Capture. + * Charge after Shipment + */ + public void setIsDelayedCapture (boolean IsDelayedCapture); + + /** Get Delayed Capture. + * Charge after Shipment + */ + public boolean isDelayedCapture(); + + /** Column name IsOnline */ + public static final String COLUMNNAME_IsOnline = "IsOnline"; + + /** Set Online Access. + * Can be accessed online + */ + public void setIsOnline (boolean IsOnline); + + /** Get Online Access. + * Can be accessed online + */ + public boolean isOnline(); + + /** Column name IsOverUnderPayment */ + public static final String COLUMNNAME_IsOverUnderPayment = "IsOverUnderPayment"; + + /** Set Over/Under Payment. + * Over-Payment (unallocated) or Under-Payment (partial payment) + */ + public void setIsOverUnderPayment (boolean IsOverUnderPayment); + + /** Get Over/Under Payment. + * Over-Payment (unallocated) or Under-Payment (partial payment) + */ + public boolean isOverUnderPayment(); + + /** Column name IsPrepayment */ + public static final String COLUMNNAME_IsPrepayment = "IsPrepayment"; + + /** Set Prepayment. + * The Payment/Receipt is a Prepayment + */ + public void setIsPrepayment (boolean IsPrepayment); + + /** Get Prepayment. + * The Payment/Receipt is a Prepayment + */ + public boolean isPrepayment(); + + /** Column name IsReceipt */ + public static final String COLUMNNAME_IsReceipt = "IsReceipt"; + + /** Set Receipt. + * This is a sales transaction (receipt) + */ + public void setIsReceipt (boolean IsReceipt); + + /** Get Receipt. + * This is a sales transaction (receipt) + */ + public boolean isReceipt(); + + /** Column name IsReconciled */ + public static final String COLUMNNAME_IsReconciled = "IsReconciled"; + + /** Set Reconciled. + * Payment is reconciled with bank statement + */ + public void setIsReconciled (boolean IsReconciled); + + /** Get Reconciled. + * Payment is reconciled with bank statement + */ + public boolean isReconciled(); + + /** Column name IsSelfService */ + public static final String COLUMNNAME_IsSelfService = "IsSelfService"; + + /** Set Self-Service. + * This is a Self-Service entry or this entry can be changed via Self-Service + */ + public void setIsSelfService (boolean IsSelfService); + + /** Get Self-Service. + * This is a Self-Service entry or this entry can be changed via Self-Service + */ + public boolean isSelfService(); + + /** Column name Micr */ + public static final String COLUMNNAME_Micr = "Micr"; + + /** Set Micr. + * Combination of routing no, account and check no + */ + public void setMicr (String Micr); + + /** Get Micr. + * Combination of routing no, account and check no + */ + public String getMicr(); + + /** Column name OProcessing */ + public static final String COLUMNNAME_OProcessing = "OProcessing"; + + /** Set Online Processing. + * This payment can be processed online + */ + public void setOProcessing (String OProcessing); + + /** Get Online Processing. + * This payment can be processed online + */ + public String getOProcessing(); + + /** Column name Orig_TrxID */ + public static final String COLUMNNAME_Orig_TrxID = "Orig_TrxID"; + + /** Set Original Transaction ID. + * Original Transaction ID + */ + public void setOrig_TrxID (String Orig_TrxID); + + /** Get Original Transaction ID. + * Original Transaction ID + */ + public String getOrig_TrxID(); + + /** Column name OverUnderAmt */ + public static final String COLUMNNAME_OverUnderAmt = "OverUnderAmt"; + + /** Set Over/Under Payment. + * Over-Payment (unallocated) or Under-Payment (partial payment) Amount + */ + public void setOverUnderAmt (BigDecimal OverUnderAmt); + + /** Get Over/Under Payment. + * Over-Payment (unallocated) or Under-Payment (partial payment) Amount + */ + public BigDecimal getOverUnderAmt(); + + /** Column name PONum */ + public static final String COLUMNNAME_PONum = "PONum"; + + /** Set PO Number. + * Purchase Order Number + */ + public void setPONum (String PONum); + + /** Get PO Number. + * Purchase Order Number + */ + public String getPONum(); + + /** Column name PayAmt */ + public static final String COLUMNNAME_PayAmt = "PayAmt"; + + /** Set Payment amount. + * Amount being paid + */ + public void setPayAmt (BigDecimal PayAmt); + + /** Get Payment amount. + * Amount being paid + */ + public BigDecimal getPayAmt(); + + /** Column name Posted */ + public static final String COLUMNNAME_Posted = "Posted"; + + /** Set Posted. + * Posting status + */ + public void setPosted (boolean Posted); + + /** Get Posted. + * Posting status + */ + public boolean isPosted(); + + /** Column name Processed */ + public static final String COLUMNNAME_Processed = "Processed"; + + /** Set Processed. + * The document has been processed + */ + public void setProcessed (boolean Processed); + + /** Get Processed. + * The document has been processed + */ + public boolean isProcessed(); + + /** Column name Processing */ + public static final String COLUMNNAME_Processing = "Processing"; + + /** Set Process Now */ + public void setProcessing (boolean Processing); + + /** Get Process Now */ + public boolean isProcessing(); + + /** Column name R_AuthCode */ + public static final String COLUMNNAME_R_AuthCode = "R_AuthCode"; + + /** Set Authorization Code. + * Authorization Code returned + */ + public void setR_AuthCode (String R_AuthCode); + + /** Get Authorization Code. + * Authorization Code returned + */ + public String getR_AuthCode(); + + /** Column name R_AuthCode_DC */ + public static final String COLUMNNAME_R_AuthCode_DC = "R_AuthCode_DC"; + + /** Set Authorization Code (DC). + * Authorization Code Delayed Capture returned + */ + public void setR_AuthCode_DC (String R_AuthCode_DC); + + /** Get Authorization Code (DC). + * Authorization Code Delayed Capture returned + */ + public String getR_AuthCode_DC(); + + /** Column name R_AvsAddr */ + public static final String COLUMNNAME_R_AvsAddr = "R_AvsAddr"; + + /** Set Address verified. + * This address has been verified + */ + public void setR_AvsAddr (String R_AvsAddr); + + /** Get Address verified. + * This address has been verified + */ + public String getR_AvsAddr(); + + /** Column name R_AvsZip */ + public static final String COLUMNNAME_R_AvsZip = "R_AvsZip"; + + /** Set Zip verified. + * The Zip Code has been verified + */ + public void setR_AvsZip (String R_AvsZip); + + /** Get Zip verified. + * The Zip Code has been verified + */ + public String getR_AvsZip(); + + /** Column name R_CVV2Match */ + public static final String COLUMNNAME_R_CVV2Match = "R_CVV2Match"; + + /** Set CVV Match. + * Credit Card Verification Code Match + */ + public void setR_CVV2Match (boolean R_CVV2Match); + + /** Get CVV Match. + * Credit Card Verification Code Match + */ + public boolean isR_CVV2Match(); + + /** Column name R_Info */ + public static final String COLUMNNAME_R_Info = "R_Info"; + + /** Set Info. + * Response info + */ + public void setR_Info (String R_Info); + + /** Get Info. + * Response info + */ + public String getR_Info(); + + /** Column name R_PnRef */ + public static final String COLUMNNAME_R_PnRef = "R_PnRef"; + + /** Set Reference. + * Payment reference + */ + public void setR_PnRef (String R_PnRef); + + /** Get Reference. + * Payment reference + */ + public String getR_PnRef(); + + /** Column name R_PnRef_DC */ + public static final String COLUMNNAME_R_PnRef_DC = "R_PnRef_DC"; + + /** Set Reference (DC). + * Payment Reference Delayed Capture + */ + public void setR_PnRef_DC (String R_PnRef_DC); + + /** Get Reference (DC). + * Payment Reference Delayed Capture + */ + public String getR_PnRef_DC(); + + /** Column name R_RespMsg */ + public static final String COLUMNNAME_R_RespMsg = "R_RespMsg"; + + /** Set Response Message. + * Response message + */ + public void setR_RespMsg (String R_RespMsg); + + /** Get Response Message. + * Response message + */ + public String getR_RespMsg(); + + /** Column name R_Result */ + public static final String COLUMNNAME_R_Result = "R_Result"; + + /** Set Result. + * Result of transmission + */ + public void setR_Result (String R_Result); + + /** Get Result. + * Result of transmission + */ + public String getR_Result(); + + /** Column name Ref_Payment_ID */ + public static final String COLUMNNAME_Ref_Payment_ID = "Ref_Payment_ID"; + + /** Set Referenced Payment */ + public void setRef_Payment_ID (int Ref_Payment_ID); + + /** Get Referenced Payment */ + public int getRef_Payment_ID(); + + /** Column name RoutingNo */ + public static final String COLUMNNAME_RoutingNo = "RoutingNo"; + + /** Set Routing No. + * Bank Routing Number + */ + public void setRoutingNo (String RoutingNo); + + /** Get Routing No. + * Bank Routing Number + */ + public String getRoutingNo(); + + /** Column name Swipe */ + public static final String COLUMNNAME_Swipe = "Swipe"; + + /** Set Swipe. + * Track 1 and 2 of the Credit Card + */ + public void setSwipe (String Swipe); + + /** Get Swipe. + * Track 1 and 2 of the Credit Card + */ + public String getSwipe(); + + /** Column name TaxAmt */ + public static final String COLUMNNAME_TaxAmt = "TaxAmt"; + + /** Set Tax Amount. + * Tax Amount for a document + */ + public void setTaxAmt (BigDecimal TaxAmt); + + /** Get Tax Amount. + * Tax Amount for a document + */ + public BigDecimal getTaxAmt(); + + /** Column name TenderType */ + public static final String COLUMNNAME_TenderType = "TenderType"; + + /** Set Tender type. + * Method of Payment + */ + public void setTenderType (String TenderType); + + /** Get Tender type. + * Method of Payment + */ + public String getTenderType(); + + /** Column name TrxType */ + public static final String COLUMNNAME_TrxType = "TrxType"; + + /** Set Transaction Type. + * Type of credit card transaction + */ + public void setTrxType (String TrxType); + + /** Get Transaction Type. + * Type of credit card transaction + */ + public String getTrxType(); + + /** Column name User1_ID */ + public static final String COLUMNNAME_User1_ID = "User1_ID"; + + /** Set User List 1. + * User defined list element #1 + */ + public void setUser1_ID (int User1_ID); + + /** Get User List 1. + * User defined list element #1 + */ + public int getUser1_ID(); + + /** Column name User2_ID */ + public static final String COLUMNNAME_User2_ID = "User2_ID"; + + /** Set User List 2. + * User defined list element #2 + */ + public void setUser2_ID (int User2_ID); + + /** Get User List 2. + * User defined list element #2 + */ + public int getUser2_ID(); + + /** Column name VoiceAuthCode */ + public static final String COLUMNNAME_VoiceAuthCode = "VoiceAuthCode"; + + /** Set Voice authorization code. + * Voice Authorization Code from credit card company + */ + public void setVoiceAuthCode (String VoiceAuthCode); + + /** Get Voice authorization code. + * Voice Authorization Code from credit card company + */ + public String getVoiceAuthCode(); + + /** Column name WriteOffAmt */ + public static final String COLUMNNAME_WriteOffAmt = "WriteOffAmt"; + + /** Set Write-off Amount. + * Amount to write-off + */ + public void setWriteOffAmt (BigDecimal WriteOffAmt); + + /** Get Write-off Amount. + * Amount to write-off + */ + public BigDecimal getWriteOffAmt(); +} diff --git a/posterita/posterita/src/main/org/compiere/model/I_M_InventoryLine.java b/posterita/posterita/src/main/org/compiere/model/I_M_InventoryLine.java new file mode 100644 index 0000000000..660238fb1a --- /dev/null +++ b/posterita/posterita/src/main/org/compiere/model/I_M_InventoryLine.java @@ -0,0 +1,266 @@ +/********************************************************************** + * This file is part of Adempiere ERP Bazaar * + * http://www.adempiere.org * + * * + * Copyright (C) Trifon Trifonov. * + * Copyright (C) Contributors * + * * + * This program is free software; + you can redistribute it and/or * + * modify it under the terms of the GNU General Public License * + * as published by the Free Software Foundation; + either version 2 * + * of the License, or (at your option) any later version. * + * * + * This program 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; + if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301, USA. * + * * + * Contributors: * + * - Trifon Trifonov (trifonnt@users.sourceforge.net) * + * * + * Sponsors: * + * - Company (http://www.site.com) * + **********************************************************************/ +package org.compiere.model; + +import java.math.BigDecimal; +import org.compiere.util.KeyNamePair; + +/** Generated Interface for M_InventoryLine + * @author Trifon Trifonov (generated) + * @version Release 3.4.0s + */ +public interface I_M_InventoryLine +{ + + /** TableName=M_InventoryLine */ + public static final String Table_Name = "M_InventoryLine"; + + /** AD_Table_ID=322 */ + public static final int Table_ID = MTable.getTable_ID(Table_Name); + + KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name); + + /** AccessLevel = 1 - Org + */ + BigDecimal accessLevel = BigDecimal.valueOf(1); + + /** Load Meta Data */ + + /** Column name C_Charge_ID */ + public static final String COLUMNNAME_C_Charge_ID = "C_Charge_ID"; + + /** Set Charge. + * Additional document charges + */ + public void setC_Charge_ID (int C_Charge_ID); + + /** Get Charge. + * Additional document charges + */ + public int getC_Charge_ID(); + + public I_C_Charge getC_Charge() throws Exception; + + /** Column name Description */ + public static final String COLUMNNAME_Description = "Description"; + + /** Set Description. + * Optional short description of the record + */ + public void setDescription (String Description); + + /** Get Description. + * Optional short description of the record + */ + public String getDescription(); + + /** Column name InventoryType */ + public static final String COLUMNNAME_InventoryType = "InventoryType"; + + /** Set Inventory Type. + * Type of inventory difference + */ + public void setInventoryType (String InventoryType); + + /** Get Inventory Type. + * Type of inventory difference + */ + public String getInventoryType(); + + /** Column name Line */ + public static final String COLUMNNAME_Line = "Line"; + + /** Set Line No. + * Unique line for this document + */ + public void setLine (int Line); + + /** Get Line No. + * Unique line for this document + */ + public int getLine(); + + /** Column name M_AttributeSetInstance_ID */ + public static final String COLUMNNAME_M_AttributeSetInstance_ID = "M_AttributeSetInstance_ID"; + + /** Set Attribute Set Instance. + * Product Attribute Set Instance + */ + public void setM_AttributeSetInstance_ID (int M_AttributeSetInstance_ID); + + /** Get Attribute Set Instance. + * Product Attribute Set Instance + */ + public int getM_AttributeSetInstance_ID(); + + /** Column name M_Inventory_ID */ + public static final String COLUMNNAME_M_Inventory_ID = "M_Inventory_ID"; + + /** Set Phys.Inventory. + * Parameters for a Physical Inventory + */ + public void setM_Inventory_ID (int M_Inventory_ID); + + /** Get Phys.Inventory. + * Parameters for a Physical Inventory + */ + public int getM_Inventory_ID(); + + public I_M_Inventory getM_Inventory() throws Exception; + + /** Column name M_InventoryLine_ID */ + public static final String COLUMNNAME_M_InventoryLine_ID = "M_InventoryLine_ID"; + + /** Set Phys.Inventory Line. + * Unique line in an Inventory document + */ + public void setM_InventoryLine_ID (int M_InventoryLine_ID); + + /** Get Phys.Inventory Line. + * Unique line in an Inventory document + */ + public int getM_InventoryLine_ID(); + + /** Column name M_Locator_ID */ + public static final String COLUMNNAME_M_Locator_ID = "M_Locator_ID"; + + /** Set Locator. + * Warehouse Locator + */ + public void setM_Locator_ID (int M_Locator_ID); + + /** Get Locator. + * Warehouse Locator + */ + public int getM_Locator_ID(); + + /** Column name M_Product_ID */ + public static final String COLUMNNAME_M_Product_ID = "M_Product_ID"; + + /** Set Product. + * Product, Service, Item + */ + public void setM_Product_ID (int M_Product_ID); + + /** Get Product. + * Product, Service, Item + */ + public int getM_Product_ID(); + + /** Column name Processed */ + public static final String COLUMNNAME_Processed = "Processed"; + + /** Set Processed. + * The document has been processed + */ + public void setProcessed (boolean Processed); + + /** Get Processed. + * The document has been processed + */ + public boolean isProcessed(); + + /** Column name QtyBook */ + public static final String COLUMNNAME_QtyBook = "QtyBook"; + + /** Set Quantity book. + * Book Quantity + */ + public void setQtyBook (BigDecimal QtyBook); + + /** Get Quantity book. + * Book Quantity + */ + public BigDecimal getQtyBook(); + + /** Column name QtyCount */ + public static final String COLUMNNAME_QtyCount = "QtyCount"; + + /** Set Quantity count. + * Counted Quantity + */ + public void setQtyCount (BigDecimal QtyCount); + + /** Get Quantity count. + * Counted Quantity + */ + public BigDecimal getQtyCount(); + + /** Column name qtycsv */ + public static final String COLUMNNAME_QtyCsv = "QtyCsv"; + + /** Set qtycsv */ + public void setQtyCsv (BigDecimal QtyCsv); + + /** Get qtycsv */ + public BigDecimal getQtyCsv(); + + /** Column name QtyInternalUse */ + public static final String COLUMNNAME_QtyInternalUse = "QtyInternalUse"; + + /** Set Internal Use Qty. + * Internal Use Quantity removed from Inventory + */ + public void setQtyInternalUse (BigDecimal QtyInternalUse); + + /** Get Internal Use Qty. + * Internal Use Quantity removed from Inventory + */ + public BigDecimal getQtyInternalUse(); + + /** Column name UPC */ + public static final String COLUMNNAME_UPC = "UPC"; + + /** Set UPC/EAN. + * Bar Code (Universal Product Code or its superset European Article Number) + */ + public void setUPC (String UPC); + + /** Get UPC/EAN. + * Bar Code (Universal Product Code or its superset European Article Number) + */ + public String getUPC(); + + /** Column name Value */ + public static final String COLUMNNAME_Value = "Value"; + + /** Set Search Key. + * Search key for the record in the format required - must be unique + */ + public void setValue (String Value); + + /** Get Search Key. + * Search key for the record in the format required - must be unique + */ + public String getValue(); +} diff --git a/posterita/posterita/src/main/org/compiere/model/I_M_PriceList.java b/posterita/posterita/src/main/org/compiere/model/I_M_PriceList.java new file mode 100644 index 0000000000..e020d4dda6 --- /dev/null +++ b/posterita/posterita/src/main/org/compiere/model/I_M_PriceList.java @@ -0,0 +1,212 @@ +/********************************************************************** + * This file is part of Adempiere ERP Bazaar * + * http://www.adempiere.org * + * * + * Copyright (C) Trifon Trifonov. * + * Copyright (C) Contributors * + * * + * This program is free software; + you can redistribute it and/or * + * modify it under the terms of the GNU General Public License * + * as published by the Free Software Foundation; + either version 2 * + * of the License, or (at your option) any later version. * + * * + * This program 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; + if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301, USA. * + * * + * Contributors: * + * - Trifon Trifonov (trifonnt@users.sourceforge.net) * + * * + * Sponsors: * + * - Company (http://www.site.com) * + **********************************************************************/ +package org.compiere.model; + +import java.math.BigDecimal; +import org.compiere.util.KeyNamePair; + +/** Generated Interface for M_PriceList + * @author Trifon Trifonov (generated) + * @version Release 3.3.1b + */ +public interface I_M_PriceList +{ + + /** TableName=M_PriceList */ + public static final String Table_Name = "M_PriceList"; + + /** AD_Table_ID=255 */ + public static final int Table_ID = MTable.getTable_ID(Table_Name); + + KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name); + + /** AccessLevel = 3 - Client - Org + */ + BigDecimal accessLevel = BigDecimal.valueOf(3); + + /** Load Meta Data */ + + /** Column name BasePriceList_ID */ + public static final String COLUMNNAME_BasePriceList_ID = "BasePriceList_ID"; + + /** Set Base Pricelist. + * Pricelist to be used, if product not found on this pricelist + */ + public void setBasePriceList_ID (int BasePriceList_ID); + + /** Get Base Pricelist. + * Pricelist to be used, if product not found on this pricelist + */ + public int getBasePriceList_ID(); + + /** Column name C_Currency_ID */ + public static final String COLUMNNAME_C_Currency_ID = "C_Currency_ID"; + + /** Set Currency. + * The Currency for this record + */ + public void setC_Currency_ID (int C_Currency_ID); + + /** Get Currency. + * The Currency for this record + */ + public int getC_Currency_ID(); + + public I_C_Currency getC_Currency() throws Exception; + + /** Column name Description */ + public static final String COLUMNNAME_Description = "Description"; + + /** Set Description. + * Optional short description of the record + */ + public void setDescription (String Description); + + /** Get Description. + * Optional short description of the record + */ + public String getDescription(); + + /** Column name EnforcePriceLimit */ + public static final String COLUMNNAME_EnforcePriceLimit = "EnforcePriceLimit"; + + /** Set Enforce price limit. + * Do not allow prices below the limit price + */ + public void setEnforcePriceLimit (boolean EnforcePriceLimit); + + /** Get Enforce price limit. + * Do not allow prices below the limit price + */ + public boolean isEnforcePriceLimit(); + + /** Column name IsDefault */ + public static final String COLUMNNAME_IsDefault = "IsDefault"; + + /** Set Default. + * Default value + */ + public void setIsDefault (boolean IsDefault); + + /** Get Default. + * Default value + */ + public boolean isDefault(); + + /** Column name IsMandatory */ + public static final String COLUMNNAME_IsMandatory = "IsMandatory"; + + /** Set Mandatory. + * Data entry is required in this column + */ + public void setIsMandatory (boolean IsMandatory); + + /** Get Mandatory. + * Data entry is required in this column + */ + public boolean isMandatory(); + + /** Column name isPresentForProduct */ + public static final String COLUMNNAME_isPresentForProduct = "isPresentForProduct"; + + /** Set isPresentForProduct */ + public void setisPresentForProduct (boolean isPresentForProduct); + + /** Get isPresentForProduct */ + public boolean isPresentForProduct(); + + /** Column name IsSOPriceList */ + public static final String COLUMNNAME_IsSOPriceList = "IsSOPriceList"; + + /** Set Sales Price list. + * This is a Sales Price List + */ + public void setIsSOPriceList (boolean IsSOPriceList); + + /** Get Sales Price list. + * This is a Sales Price List + */ + public boolean isSOPriceList(); + + /** Column name IsTaxIncluded */ + public static final String COLUMNNAME_IsTaxIncluded = "IsTaxIncluded"; + + /** Set Price includes Tax. + * Tax is included in the price + */ + public void setIsTaxIncluded (boolean IsTaxIncluded); + + /** Get Price includes Tax. + * Tax is included in the price + */ + public boolean isTaxIncluded(); + + /** Column name M_PriceList_ID */ + public static final String COLUMNNAME_M_PriceList_ID = "M_PriceList_ID"; + + /** Set Price List. + * Unique identifier of a Price List + */ + public void setM_PriceList_ID (int M_PriceList_ID); + + /** Get Price List. + * Unique identifier of a Price List + */ + public int getM_PriceList_ID(); + + /** Column name Name */ + public static final String COLUMNNAME_Name = "Name"; + + /** Set Name. + * Alphanumeric identifier of the entity + */ + public void setName (String Name); + + /** Get Name. + * Alphanumeric identifier of the entity + */ + public String getName(); + + /** Column name PricePrecision */ + public static final String COLUMNNAME_PricePrecision = "PricePrecision"; + + /** Set Price Precision. + * Precision (number of decimals) for the Price + */ + public void setPricePrecision (BigDecimal PricePrecision); + + /** Get Price Precision. + * Precision (number of decimals) for the Price + */ + public BigDecimal getPricePrecision(); +} diff --git a/posterita/posterita/src/main/org/compiere/model/I_M_Product.java b/posterita/posterita/src/main/org/compiere/model/I_M_Product.java new file mode 100644 index 0000000000..1e00a2998c --- /dev/null +++ b/posterita/posterita/src/main/org/compiere/model/I_M_Product.java @@ -0,0 +1,741 @@ +/********************************************************************** + * This file is part of Adempiere ERP Bazaar * + * http://www.adempiere.org * + * * + * Copyright (C) Trifon Trifonov. * + * Copyright (C) Contributors * + * * + * This program is free software; + you can redistribute it and/or * + * modify it under the terms of the GNU General Public License * + * as published by the Free Software Foundation; + either version 2 * + * of the License, or (at your option) any later version. * + * * + * This program 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; + if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301, USA. * + * * + * Contributors: * + * - Trifon Trifonov (trifonnt@users.sourceforge.net) * + * * + * Sponsors: * + * - Company (http://www.site.com) * + **********************************************************************/ +package org.compiere.model; + +import java.math.BigDecimal; +import java.sql.Timestamp; +import org.compiere.util.KeyNamePair; + +/** Generated Interface for M_Product + * @author Trifon Trifonov (generated) + * @version Release 3.4.0s + */ +public interface I_M_Product +{ + + /** TableName=M_Product */ + public static final String Table_Name = "M_Product"; + + /** AD_Table_ID=208 */ + public static final int Table_ID = MTable.getTable_ID(Table_Name); + + KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name); + + /** AccessLevel = 3 - Client - Org + */ + BigDecimal accessLevel = BigDecimal.valueOf(3); + + /** Load Meta Data */ + + /** Column name Classification */ + public static final String COLUMNNAME_Classification = "Classification"; + + /** Set Classification. + * Classification for grouping + */ + public void setClassification (String Classification); + + /** Get Classification. + * Classification for grouping + */ + public String getClassification(); + + /** Column name C_RevenueRecognition_ID */ + public static final String COLUMNNAME_C_RevenueRecognition_ID = "C_RevenueRecognition_ID"; + + /** Set Revenue Recognition. + * Method for recording revenue + */ + public void setC_RevenueRecognition_ID (int C_RevenueRecognition_ID); + + /** Get Revenue Recognition. + * Method for recording revenue + */ + public int getC_RevenueRecognition_ID(); + + public I_C_RevenueRecognition getC_RevenueRecognition() throws Exception; + + /** Column name C_SubscriptionType_ID */ + public static final String COLUMNNAME_C_SubscriptionType_ID = "C_SubscriptionType_ID"; + + /** Set Subscription Type. + * Type of subscription + */ + public void setC_SubscriptionType_ID (int C_SubscriptionType_ID); + + /** Get Subscription Type. + * Type of subscription + */ + public int getC_SubscriptionType_ID(); + + /** Column name C_TaxCategory_ID */ + public static final String COLUMNNAME_C_TaxCategory_ID = "C_TaxCategory_ID"; + + /** Set Tax Category. + * Tax Category + */ + public void setC_TaxCategory_ID (int C_TaxCategory_ID); + + /** Get Tax Category. + * Tax Category + */ + public int getC_TaxCategory_ID(); + + public I_C_TaxCategory getC_TaxCategory() throws Exception; + + /** Column name C_UOM_ID */ + public static final String COLUMNNAME_C_UOM_ID = "C_UOM_ID"; + + /** Set UOM. + * Unit of Measure + */ + public void setC_UOM_ID (int C_UOM_ID); + + /** Get UOM. + * Unit of Measure + */ + public int getC_UOM_ID(); + + public I_C_UOM getC_UOM() throws Exception; + + /** Column name Description */ + public static final String COLUMNNAME_Description = "Description"; + + /** Set Description. + * Optional short description of the record + */ + public void setDescription (String Description); + + /** Get Description. + * Optional short description of the record + */ + public String getDescription(); + + /** Column name DescriptionURL */ + public static final String COLUMNNAME_DescriptionURL = "DescriptionURL"; + + /** Set Description URL. + * URL for the description + */ + public void setDescriptionURL (String DescriptionURL); + + /** Get Description URL. + * URL for the description + */ + public String getDescriptionURL(); + + /** Column name Discontinued */ + public static final String COLUMNNAME_Discontinued = "Discontinued"; + + /** Set Discontinued. + * This product is no longer available + */ + public void setDiscontinued (boolean Discontinued); + + /** Get Discontinued. + * This product is no longer available + */ + public boolean isDiscontinued(); + + /** Column name DiscontinuedBy */ + public static final String COLUMNNAME_DiscontinuedBy = "DiscontinuedBy"; + + /** Set Discontinued by. + * Discontinued By + */ + public void setDiscontinuedBy (Timestamp DiscontinuedBy); + + /** Get Discontinued by. + * Discontinued By + */ + public Timestamp getDiscontinuedBy(); + + /** Column name DocumentNote */ + public static final String COLUMNNAME_DocumentNote = "DocumentNote"; + + /** Set Document Note. + * Additional information for a Document + */ + public void setDocumentNote (String DocumentNote); + + /** Get Document Note. + * Additional information for a Document + */ + public String getDocumentNote(); + + /** Column name Group1 */ + public static final String COLUMNNAME_Group1 = "Group1"; + + /** Set Group1 */ + public void setGroup1 (String Group1); + + /** Get Group1 */ + public String getGroup1(); + + /** Column name Group2 */ + public static final String COLUMNNAME_Group2 = "Group2"; + + /** Set Group2 */ + public void setGroup2 (String Group2); + + /** Get Group2 */ + public String getGroup2(); + + /** Column name GuaranteeDays */ + public static final String COLUMNNAME_GuaranteeDays = "GuaranteeDays"; + + /** Set Guarantee Days. + * Number of days the product is guaranteed or available + */ + public void setGuaranteeDays (int GuaranteeDays); + + /** Get Guarantee Days. + * Number of days the product is guaranteed or available + */ + public int getGuaranteeDays(); + + /** Column name GuaranteeDaysMin */ + public static final String COLUMNNAME_GuaranteeDaysMin = "GuaranteeDaysMin"; + + /** Set Min Guarantee Days. + * Minumum number of guarantee days + */ + public void setGuaranteeDaysMin (int GuaranteeDaysMin); + + /** Get Min Guarantee Days. + * Minumum number of guarantee days + */ + public int getGuaranteeDaysMin(); + + /** Column name Help */ + public static final String COLUMNNAME_Help = "Help"; + + /** Set Comment/Help. + * Comment or Hint + */ + public void setHelp (String Help); + + /** Get Comment/Help. + * Comment or Hint + */ + public String getHelp(); + + /** Column name ImageURL */ + public static final String COLUMNNAME_ImageURL = "ImageURL"; + + /** Set Image URL. + * URL of image + */ + public void setImageURL (String ImageURL); + + /** Get Image URL. + * URL of image + */ + public String getImageURL(); + + /** Column name IsBOM */ + public static final String COLUMNNAME_IsBOM = "IsBOM"; + + /** Set Bill of Materials. + * Bill of Materials + */ + public void setIsBOM (boolean IsBOM); + + /** Get Bill of Materials. + * Bill of Materials + */ + public boolean isBOM(); + + /** Column name IsDropShip */ + public static final String COLUMNNAME_IsDropShip = "IsDropShip"; + + /** Set Drop Shipment. + * Drop Shipments are sent from the Vendor directly to the Customer + */ + public void setIsDropShip (boolean IsDropShip); + + /** Get Drop Shipment. + * Drop Shipments are sent from the Vendor directly to the Customer + */ + public boolean isDropShip(); + + /** Column name IsExcludeAutoDelivery */ + public static final String COLUMNNAME_IsExcludeAutoDelivery = "IsExcludeAutoDelivery"; + + /** Set Exclude Auto Delivery. + * Exclude from automatic Delivery + */ + public void setIsExcludeAutoDelivery (boolean IsExcludeAutoDelivery); + + /** Get Exclude Auto Delivery. + * Exclude from automatic Delivery + */ + public boolean isExcludeAutoDelivery(); + + /** Column name IsInvoicePrintDetails */ + public static final String COLUMNNAME_IsInvoicePrintDetails = "IsInvoicePrintDetails"; + + /** Set Print detail records on invoice . + * Print detail BOM elements on the invoice + */ + public void setIsInvoicePrintDetails (boolean IsInvoicePrintDetails); + + /** Get Print detail records on invoice . + * Print detail BOM elements on the invoice + */ + public boolean isInvoicePrintDetails(); + + /** Column name IsPickListPrintDetails */ + public static final String COLUMNNAME_IsPickListPrintDetails = "IsPickListPrintDetails"; + + /** Set Print detail records on pick list. + * Print detail BOM elements on the pick list + */ + public void setIsPickListPrintDetails (boolean IsPickListPrintDetails); + + /** Get Print detail records on pick list. + * Print detail BOM elements on the pick list + */ + public boolean isPickListPrintDetails(); + + /** Column name IsPurchased */ + public static final String COLUMNNAME_IsPurchased = "IsPurchased"; + + /** Set Purchased. + * Organization purchases this product + */ + public void setIsPurchased (boolean IsPurchased); + + /** Get Purchased. + * Organization purchases this product + */ + public boolean isPurchased(); + + /** Column name IsSelfService */ + public static final String COLUMNNAME_IsSelfService = "IsSelfService"; + + /** Set Self-Service. + * This is a Self-Service entry or this entry can be changed via Self-Service + */ + public void setIsSelfService (boolean IsSelfService); + + /** Get Self-Service. + * This is a Self-Service entry or this entry can be changed via Self-Service + */ + public boolean isSelfService(); + + /** Column name IsSold */ + public static final String COLUMNNAME_IsSold = "IsSold"; + + /** Set Sold. + * Organization sells this product + */ + public void setIsSold (boolean IsSold); + + /** Get Sold. + * Organization sells this product + */ + public boolean isSold(); + + /** Column name IsStocked */ + public static final String COLUMNNAME_IsStocked = "IsStocked"; + + /** Set Stocked. + * Organization stocks this product + */ + public void setIsStocked (boolean IsStocked); + + /** Get Stocked. + * Organization stocks this product + */ + public boolean isStocked(); + + /** Column name IsSummary */ + public static final String COLUMNNAME_IsSummary = "IsSummary"; + + /** Set Summary Level. + * This is a summary entity + */ + public void setIsSummary (boolean IsSummary); + + /** Get Summary Level. + * This is a summary entity + */ + public boolean isSummary(); + + /** Column name IsVerified */ + public static final String COLUMNNAME_IsVerified = "IsVerified"; + + /** Set Verified. + * The BOM configuration has been verified + */ + public void setIsVerified (boolean IsVerified); + + /** Get Verified. + * The BOM configuration has been verified + */ + public boolean isVerified(); + + /** Column name IsWebStoreFeatured */ + public static final String COLUMNNAME_IsWebStoreFeatured = "IsWebStoreFeatured"; + + /** Set Featured in Web Store. + * If selected, the product is displayed in the inital or any empy search + */ + public void setIsWebStoreFeatured (boolean IsWebStoreFeatured); + + /** Get Featured in Web Store. + * If selected, the product is displayed in the inital or any empy search + */ + public boolean isWebStoreFeatured(); + + /** Column name M_AttributeSet_ID */ + public static final String COLUMNNAME_M_AttributeSet_ID = "M_AttributeSet_ID"; + + /** Set Attribute Set. + * Product Attribute Set + */ + public void setM_AttributeSet_ID (int M_AttributeSet_ID); + + /** Get Attribute Set. + * Product Attribute Set + */ + public int getM_AttributeSet_ID(); + + public I_M_AttributeSet getM_AttributeSet() throws Exception; + + /** Column name M_AttributeSetInstance_ID */ + public static final String COLUMNNAME_M_AttributeSetInstance_ID = "M_AttributeSetInstance_ID"; + + /** Set Attribute Set Instance. + * Product Attribute Set Instance + */ + public void setM_AttributeSetInstance_ID (int M_AttributeSetInstance_ID); + + /** Get Attribute Set Instance. + * Product Attribute Set Instance + */ + public int getM_AttributeSetInstance_ID(); + + /** Column name M_FreightCategory_ID */ + public static final String COLUMNNAME_M_FreightCategory_ID = "M_FreightCategory_ID"; + + /** Set Freight Category. + * Category of the Freight + */ + public void setM_FreightCategory_ID (int M_FreightCategory_ID); + + /** Get Freight Category. + * Category of the Freight + */ + public int getM_FreightCategory_ID(); + + public I_M_FreightCategory getM_FreightCategory() throws Exception; + + /** Column name M_Locator_ID */ + public static final String COLUMNNAME_M_Locator_ID = "M_Locator_ID"; + + /** Set Locator. + * Warehouse Locator + */ + public void setM_Locator_ID (int M_Locator_ID); + + /** Get Locator. + * Warehouse Locator + */ + public int getM_Locator_ID(); + + /** Column name M_Product_Category_ID */ + public static final String COLUMNNAME_M_Product_Category_ID = "M_Product_Category_ID"; + + /** Set Product Category. + * Category of a Product + */ + public void setM_Product_Category_ID (int M_Product_Category_ID); + + /** Get Product Category. + * Category of a Product + */ + public int getM_Product_Category_ID(); + + public I_M_Product_Category getM_Product_Category() throws Exception; + + /** Column name M_Product_ID */ + public static final String COLUMNNAME_M_Product_ID = "M_Product_ID"; + + /** Set Product. + * Product, Service, Item + */ + public void setM_Product_ID (int M_Product_ID); + + /** Get Product. + * Product, Service, Item + */ + public int getM_Product_ID(); + + /** Column name Name */ + public static final String COLUMNNAME_Name = "Name"; + + /** Set Name. + * Alphanumeric identifier of the entity + */ + public void setName (String Name); + + /** Get Name. + * Alphanumeric identifier of the entity + */ + public String getName(); + + /** Column name Processing */ + public static final String COLUMNNAME_Processing = "Processing"; + + /** Set Process Now */ + public void setProcessing (boolean Processing); + + /** Get Process Now */ + public boolean isProcessing(); + + /** Column name ProductType */ + public static final String COLUMNNAME_ProductType = "ProductType"; + + /** Set Product Type. + * Type of product + */ + public void setProductType (String ProductType); + + /** Get Product Type. + * Type of product + */ + public String getProductType(); + + /** Column name R_MailText_ID */ + public static final String COLUMNNAME_R_MailText_ID = "R_MailText_ID"; + + /** Set Mail Template. + * Text templates for mailings + */ + public void setR_MailText_ID (int R_MailText_ID); + + /** Get Mail Template. + * Text templates for mailings + */ + public int getR_MailText_ID(); + + public I_R_MailText getR_MailText() throws Exception; + + /** Column name SalesRep_ID */ + public static final String COLUMNNAME_SalesRep_ID = "SalesRep_ID"; + + /** Set Sales Representative. + * Sales Representative or Company Agent + */ + public void setSalesRep_ID (int SalesRep_ID); + + /** Get Sales Representative. + * Sales Representative or Company Agent + */ + public int getSalesRep_ID(); + + /** Column name S_ExpenseType_ID */ + public static final String COLUMNNAME_S_ExpenseType_ID = "S_ExpenseType_ID"; + + /** Set Expense Type. + * Expense report type + */ + public void setS_ExpenseType_ID (int S_ExpenseType_ID); + + /** Get Expense Type. + * Expense report type + */ + public int getS_ExpenseType_ID(); + + public I_S_ExpenseType getS_ExpenseType() throws Exception; + + /** Column name ShelfDepth */ + public static final String COLUMNNAME_ShelfDepth = "ShelfDepth"; + + /** Set Shelf Depth. + * Shelf depth required + */ + public void setShelfDepth (int ShelfDepth); + + /** Get Shelf Depth. + * Shelf depth required + */ + public int getShelfDepth(); + + /** Column name ShelfHeight */ + public static final String COLUMNNAME_ShelfHeight = "ShelfHeight"; + + /** Set Shelf Height. + * Shelf height required + */ + public void setShelfHeight (int ShelfHeight); + + /** Get Shelf Height. + * Shelf height required + */ + public int getShelfHeight(); + + /** Column name ShelfWidth */ + public static final String COLUMNNAME_ShelfWidth = "ShelfWidth"; + + /** Set Shelf Width. + * Shelf width required + */ + public void setShelfWidth (int ShelfWidth); + + /** Get Shelf Width. + * Shelf width required + */ + public int getShelfWidth(); + + /** Column name SKU */ + public static final String COLUMNNAME_SKU = "SKU"; + + /** Set SKU. + * Stock Keeping Unit + */ + public void setSKU (String SKU); + + /** Get SKU. + * Stock Keeping Unit + */ + public String getSKU(); + + /** Column name S_Resource_ID */ + public static final String COLUMNNAME_S_Resource_ID = "S_Resource_ID"; + + /** Set Resource. + * Resource + */ + public void setS_Resource_ID (int S_Resource_ID); + + /** Get Resource. + * Resource + */ + public int getS_Resource_ID(); + + public I_S_Resource getS_Resource() throws Exception; + + /** Column name UnitsPerPack */ + public static final String COLUMNNAME_UnitsPerPack = "UnitsPerPack"; + + /** Set UnitsPerPack. + * The Units Per Pack indicates the no of units of a product packed together. + */ + public void setUnitsPerPack (int UnitsPerPack); + + /** Get UnitsPerPack. + * The Units Per Pack indicates the no of units of a product packed together. + */ + public int getUnitsPerPack(); + + /** Column name UnitsPerPallet */ + public static final String COLUMNNAME_UnitsPerPallet = "UnitsPerPallet"; + + /** Set Units Per Pallet. + * Units Per Pallet + */ + public void setUnitsPerPallet (int UnitsPerPallet); + + /** Get Units Per Pallet. + * Units Per Pallet + */ + public int getUnitsPerPallet(); + + /** Column name UPC */ + public static final String COLUMNNAME_UPC = "UPC"; + + /** Set UPC/EAN. + * Bar Code (Universal Product Code or its superset European Article Number) + */ + public void setUPC (String UPC); + + /** Get UPC/EAN. + * Bar Code (Universal Product Code or its superset European Article Number) + */ + public String getUPC(); + + /** Column name Value */ + public static final String COLUMNNAME_Value = "Value"; + + /** Set Search Key. + * Search key for the record in the format required - must be unique + */ + public void setValue (String Value); + + /** Get Search Key. + * Search key for the record in the format required - must be unique + */ + public String getValue(); + + /** Column name VersionNo */ + public static final String COLUMNNAME_VersionNo = "VersionNo"; + + /** Set Version No. + * Version Number + */ + public void setVersionNo (String VersionNo); + + /** Get Version No. + * Version Number + */ + public String getVersionNo(); + + /** Column name Volume */ + public static final String COLUMNNAME_Volume = "Volume"; + + /** Set Volume. + * Volume of a product + */ + public void setVolume (BigDecimal Volume); + + /** Get Volume. + * Volume of a product + */ + public BigDecimal getVolume(); + + /** Column name Weight */ + public static final String COLUMNNAME_Weight = "Weight"; + + /** Set Weight. + * Weight of a product + */ + public void setWeight (BigDecimal Weight); + + /** Get Weight. + * Weight of a product + */ + public BigDecimal getWeight(); +} diff --git a/posterita/posterita/src/main/org/compiere/model/I_U_POSTerminal.java b/posterita/posterita/src/main/org/compiere/model/I_U_POSTerminal.java new file mode 100644 index 0000000000..1e3fb600b1 --- /dev/null +++ b/posterita/posterita/src/main/org/compiere/model/I_U_POSTerminal.java @@ -0,0 +1,411 @@ +/********************************************************************** + * This file is part of Adempiere ERP Bazaar * + * http://www.adempiere.org * + * * + * Copyright (C) Trifon Trifonov. * + * Copyright (C) Contributors * + * * + * This program is free software; + you can redistribute it and/or * + * modify it under the terms of the GNU General Public License * + * as published by the Free Software Foundation; + either version 2 * + * of the License, or (at your option) any later version. * + * * + * This program 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; + if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * + * MA 02110-1301, USA. * + * * + * Contributors: * + * - Trifon Trifonov (trifonnt@users.sourceforge.net) * + * * + * Sponsors: * + * - Company (http://www.site.com) * + **********************************************************************/ +package org.compiere.model; + +import java.math.BigDecimal; +import java.sql.Timestamp; +import org.compiere.util.KeyNamePair; + +/** Generated Interface for U_POSTerminal + * @author Trifon Trifonov (generated) + * @version Release 3.4.0s + */ +public interface I_U_POSTerminal +{ + + /** TableName=U_POSTerminal */ + public static final String Table_Name = "U_POSTerminal"; + + /** AD_Table_ID=52004 */ + public static final int Table_ID = MTable.getTable_ID(Table_Name); + + KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name); + + /** AccessLevel = 1 - Org + */ + BigDecimal accessLevel = BigDecimal.valueOf(1); + + /** Load Meta Data */ + + /** Column name AutoLock */ + public static final String COLUMNNAME_AutoLock = "AutoLock"; + + /** Set Auto Lock. + * Whether to automatically lock the terminal when till is closed + */ + public void setAutoLock (boolean AutoLock); + + /** Get Auto Lock. + * Whether to automatically lock the terminal when till is closed + */ + public boolean isAutoLock(); + + /** Column name Card_BankAccount_ID */ + public static final String COLUMNNAME_Card_BankAccount_ID = "Card_BankAccount_ID"; + + /** Set Card Bank Account. + * Bank Account on which card transactions will be processed + */ + public void setCard_BankAccount_ID (int Card_BankAccount_ID); + + /** Get Card Bank Account. + * Bank Account on which card transactions will be processed + */ + public int getCard_BankAccount_ID(); + + /** Column name CardTransferBankAccount_ID */ + public static final String COLUMNNAME_CardTransferBankAccount_ID = "CardTransferBankAccount_ID"; + + /** Set Transfer Card trx to. + * Bank account on which to transfer Card transactions + */ + public void setCardTransferBankAccount_ID (int CardTransferBankAccount_ID); + + /** Get Transfer Card trx to. + * Bank account on which to transfer Card transactions + */ + public int getCardTransferBankAccount_ID(); + + /** Column name CardTransferCashBook_ID */ + public static final String COLUMNNAME_CardTransferCashBook_ID = "CardTransferCashBook_ID"; + + /** Set Transfer Card trx to. + * Cash Book on which to transfer all Card transactions + */ + public void setCardTransferCashBook_ID (int CardTransferCashBook_ID); + + /** Get Transfer Card trx to. + * Cash Book on which to transfer all Card transactions + */ + public int getCardTransferCashBook_ID(); + + /** Column name CardTransferType */ + public static final String COLUMNNAME_CardTransferType = "CardTransferType"; + + /** Set Card Transfer Type */ + public void setCardTransferType (String CardTransferType); + + /** Get Card Transfer Type */ + public String getCardTransferType(); + + /** Column name CashBookTransferType */ + public static final String COLUMNNAME_CashBookTransferType = "CashBookTransferType"; + + /** Set Cash Book Transfer Type. + * Where the money in the cash book should be transfered to. Either a Bank Account or another Cash Book + */ + public void setCashBookTransferType (String CashBookTransferType); + + /** Get Cash Book Transfer Type. + * Where the money in the cash book should be transfered to. Either a Bank Account or another Cash Book + */ + public String getCashBookTransferType(); + + /** Column name CashTransferBankAccount_ID */ + public static final String COLUMNNAME_CashTransferBankAccount_ID = "CashTransferBankAccount_ID"; + + /** Set Transfer Cash trx to. + * Bank Account on which to transfer all Cash transactions + */ + public void setCashTransferBankAccount_ID (int CashTransferBankAccount_ID); + + /** Get Transfer Cash trx to. + * Bank Account on which to transfer all Cash transactions + */ + public int getCashTransferBankAccount_ID(); + + /** Column name CashTransferCashBook_ID */ + public static final String COLUMNNAME_CashTransferCashBook_ID = "CashTransferCashBook_ID"; + + /** Set Transfer Cash trx to. + * Cash Book on which to transfer all Cash transactions + */ + public void setCashTransferCashBook_ID (int CashTransferCashBook_ID); + + /** Get Transfer Cash trx to. + * Cash Book on which to transfer all Cash transactions + */ + public int getCashTransferCashBook_ID(); + + /** Column name C_CashBook_ID */ + public static final String COLUMNNAME_C_CashBook_ID = "C_CashBook_ID"; + + /** Set Cash Book. + * Cash Book for recording petty cash transactions + */ + public void setC_CashBook_ID (int C_CashBook_ID); + + /** Get Cash Book. + * Cash Book for recording petty cash transactions + */ + public int getC_CashBook_ID(); + + public I_C_CashBook getC_CashBook() throws Exception; + + /** Column name C_CashBPartner_ID */ + public static final String COLUMNNAME_C_CashBPartner_ID = "C_CashBPartner_ID"; + + /** Set Cash BPartner. + * BPartner to be used for Cash transactions + */ + public void setC_CashBPartner_ID (int C_CashBPartner_ID); + + /** Get Cash BPartner. + * BPartner to be used for Cash transactions + */ + public int getC_CashBPartner_ID(); + + /** Column name Check_BankAccount_ID */ + public static final String COLUMNNAME_Check_BankAccount_ID = "Check_BankAccount_ID"; + + /** Set Check Bank Account. + * Bank Account to be used for processing Check transactions + */ + public void setCheck_BankAccount_ID (int Check_BankAccount_ID); + + /** Get Check Bank Account. + * Bank Account to be used for processing Check transactions + */ + public int getCheck_BankAccount_ID(); + + /** Column name CheckTransferBankAccount_ID */ + public static final String COLUMNNAME_CheckTransferBankAccount_ID = "CheckTransferBankAccount_ID"; + + /** Set Tranfer Check trx to. + * Bank account on which to transfer Check transactions + */ + public void setCheckTransferBankAccount_ID (int CheckTransferBankAccount_ID); + + /** Get Tranfer Check trx to. + * Bank account on which to transfer Check transactions + */ + public int getCheckTransferBankAccount_ID(); + + /** Column name CheckTransferCashBook_ID */ + public static final String COLUMNNAME_CheckTransferCashBook_ID = "CheckTransferCashBook_ID"; + + /** Set Transfer Check trx to. + * Cash Book on which to transfer all Check transactions + */ + public void setCheckTransferCashBook_ID (int CheckTransferCashBook_ID); + + /** Get Transfer Check trx to. + * Cash Book on which to transfer all Check transactions + */ + public int getCheckTransferCashBook_ID(); + + /** Column name CheckTransferType */ + public static final String COLUMNNAME_CheckTransferType = "CheckTransferType"; + + /** Set Check Transfer Type */ + public void setCheckTransferType (String CheckTransferType); + + /** Get Check Transfer Type */ + public String getCheckTransferType(); + + /** Column name C_TemplateBPartner_ID */ + public static final String COLUMNNAME_C_TemplateBPartner_ID = "C_TemplateBPartner_ID"; + + /** Set Template BPartner. + * BPartner that is to be used as template when new customers are created + */ + public void setC_TemplateBPartner_ID (int C_TemplateBPartner_ID); + + /** Get Template BPartner. + * BPartner that is to be used as template when new customers are created + */ + public int getC_TemplateBPartner_ID(); + + /** Column name Description */ + public static final String COLUMNNAME_Description = "Description"; + + /** Set Description. + * Optional short description of the record + */ + public void setDescription (String Description); + + /** Get Description. + * Optional short description of the record + */ + public String getDescription(); + + /** Column name Help */ + public static final String COLUMNNAME_Help = "Help"; + + /** Set Comment/Help. + * Comment or Hint + */ + public void setHelp (String Help); + + /** Get Comment/Help. + * Comment or Hint + */ + public String getHelp(); + + /** Column name LastLockTime */ + public static final String COLUMNNAME_LastLockTime = "LastLockTime"; + + /** Set Last Lock Time. + * Last time at which the terminal was locked + */ + public void setLastLockTime (Timestamp LastLockTime); + + /** Get Last Lock Time. + * Last time at which the terminal was locked + */ + public Timestamp getLastLockTime(); + + /** Column name Locked */ + public static final String COLUMNNAME_Locked = "Locked"; + + /** Set Locked. + * Whether the terminal is locked + */ + public void setLocked (boolean Locked); + + /** Get Locked. + * Whether the terminal is locked + */ + public boolean isLocked(); + + /** Column name LockTime */ + public static final String COLUMNNAME_LockTime = "LockTime"; + + /** Set Lock Time. + * Time in minutes the terminal should be kept in a locked state. + */ + public void setLockTime (int LockTime); + + /** Get Lock Time. + * Time in minutes the terminal should be kept in a locked state. + */ + public int getLockTime(); + + /** Column name M_Warehouse_ID */ + public static final String COLUMNNAME_M_Warehouse_ID = "M_Warehouse_ID"; + + /** Set Warehouse. + * Storage Warehouse and Service Point + */ + public void setM_Warehouse_ID (int M_Warehouse_ID); + + /** Get Warehouse. + * Storage Warehouse and Service Point + */ + public int getM_Warehouse_ID(); + + public I_M_Warehouse getM_Warehouse() throws Exception; + + /** Column name Name */ + public static final String COLUMNNAME_Name = "Name"; + + /** Set Name. + * Alphanumeric identifier of the entity + */ + public void setName (String Name); + + /** Get Name. + * Alphanumeric identifier of the entity + */ + public String getName(); + + /** Column name PO_PriceList_ID */ + public static final String COLUMNNAME_PO_PriceList_ID = "PO_PriceList_ID"; + + /** Set Purchase Pricelist. + * Price List used by this Business Partner + */ + public void setPO_PriceList_ID (int PO_PriceList_ID); + + /** Get Purchase Pricelist. + * Price List used by this Business Partner + */ + public int getPO_PriceList_ID(); + + /** Column name PrinterName */ + public static final String COLUMNNAME_PrinterName = "PrinterName"; + + /** Set Printer Name. + * Name of the Printer + */ + public void setPrinterName (String PrinterName); + + /** Get Printer Name. + * Name of the Printer + */ + public String getPrinterName(); + + /** Column name SalesRep_ID */ + public static final String COLUMNNAME_SalesRep_ID = "SalesRep_ID"; + + /** Set Sales Representative. + * Sales Representative or Company Agent + */ + public void setSalesRep_ID (int SalesRep_ID); + + /** Get Sales Representative. + * Sales Representative or Company Agent + */ + public int getSalesRep_ID(); + + /** Column name SO_PriceList_ID */ + public static final String COLUMNNAME_SO_PriceList_ID = "SO_PriceList_ID"; + + /** Set Sales Pricelist */ + public void setSO_PriceList_ID (int SO_PriceList_ID); + + /** Get Sales Pricelist */ + public int getSO_PriceList_ID(); + + /** Column name UnlockingTime */ + public static final String COLUMNNAME_UnlockingTime = "UnlockingTime"; + + /** Set UnlockingTime. + * Time at which the terminal should be unlocked + */ + public void setUnlockingTime (Timestamp UnlockingTime); + + /** Get UnlockingTime. + * Time at which the terminal should be unlocked + */ + public Timestamp getUnlockingTime(); + + /** Column name U_POSTerminal_ID */ + public static final String COLUMNNAME_U_POSTerminal_ID = "U_POSTerminal_ID"; + + /** Set POS Terminal */ + public void setU_POSTerminal_ID (int U_POSTerminal_ID); + + /** Get POS Terminal */ + public int getU_POSTerminal_ID(); +} diff --git a/posterita/posterita/src/main/org/compiere/model/MCash.java b/posterita/posterita/src/main/org/compiere/model/MCash.java new file mode 100644 index 0000000000..3ac5cc18dd --- /dev/null +++ b/posterita/posterita/src/main/org/compiere/model/MCash.java @@ -0,0 +1,780 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program 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 General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.io.File; +import java.math.BigDecimal; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.Properties; +import java.util.logging.Level; + +import org.compiere.process.DocAction; +import org.compiere.process.DocumentEngine; +import org.compiere.util.CLogger; +import org.compiere.util.DB; +import org.compiere.util.DisplayType; +import org.compiere.util.Env; +import org.compiere.util.Msg; +import org.compiere.util.TimeUtil; + +/** + * Cash Journal Model + * + * @author Jorg Janke + * @version $Id: MCash.java,v 1.3 2006/07/30 00:51:03 jjanke Exp $ + * + * @author Teo Sarca, SC ARHIPAC SERVICE SRL + *
  • BF [ 1831997 ] Cash journal allocation reversed + *
  • BF [ 1894524 ] Pay an reversed invoice + */ +public class MCash extends X_C_Cash implements DocAction +{ + /** + * Get Cash Journal for currency, org and date + * @param ctx context + * @param C_Currency_ID currency + * @param AD_Org_ID org + * @param dateAcct date + * @param trxName transaction + * @return cash + */ + public static MCash get (Properties ctx, int AD_Org_ID, + Timestamp dateAcct, int C_Currency_ID, String trxName) + { + MCash retValue = null; + // Existing Journal + String sql; + sql = "SELECT * FROM C_Cash c " + + "WHERE c.AD_Org_ID=?" // #1 + + " AND TRUNC(c.StatementDate)=?" // #2 + + " AND c.Processed='N'" + + " AND EXISTS (SELECT * FROM C_CashBook cb " + + "WHERE c.C_CashBook_ID=cb.C_CashBook_ID AND cb.AD_Org_ID=c.AD_Org_ID" + + " AND cb.C_Currency_ID=?)"; // #3 + + PreparedStatement pstmt = null; + ResultSet rs = null; + try + { + pstmt = DB.prepareStatement (sql, trxName); + pstmt.setInt (1, AD_Org_ID); + pstmt.setTimestamp (2, TimeUtil.getDay(dateAcct)); + pstmt.setInt (3, C_Currency_ID); + rs = pstmt.executeQuery (); + if (rs.next ()) + retValue = new MCash (ctx, rs, trxName); + } + catch (Exception e) + { + s_log.log(Level.SEVERE, sql, e); + } + finally + { + DB.close(rs, pstmt); + rs = null; pstmt = null; + } + if (retValue != null) + return retValue; + + // Get CashBook + MCashBook cb = MCashBook.get (ctx, AD_Org_ID, C_Currency_ID); + if (cb == null) + { + s_log.warning("No CashBook for AD_Org_ID=" + AD_Org_ID + ", C_Currency_ID=" + C_Currency_ID); + return null; + } + + // Create New Journal + retValue = new MCash (cb, dateAcct); + retValue.save(trxName); + return retValue; + } // get + + /** + * Get Cash Journal for CashBook and date + * @param ctx context + * @param C_CashBook_ID cashbook + * @param dateAcct date + * @param trxName transaction + * @return cash + */ + public static MCash get (Properties ctx, int C_CashBook_ID, + Timestamp dateAcct, String trxName) + { + MCash retValue = null; + // Existing Journal + String sql = "SELECT * FROM C_Cash c " + + "WHERE c.C_CashBook_ID=?" // #1 + + " AND TRUNC(c.StatementDate)=?" // #2 + + " AND c.Processed='N'"; + PreparedStatement pstmt = null; + ResultSet rs = null; + try + { + pstmt = DB.prepareStatement (sql, trxName); + pstmt.setInt (1, C_CashBook_ID); + pstmt.setTimestamp (2, TimeUtil.getDay(dateAcct)); + rs = pstmt.executeQuery (); + if (rs.next ()) + retValue = new MCash (ctx, rs, trxName); + } + catch (Exception e) + { + s_log.log(Level.SEVERE, sql, e); + } + finally + { + DB.close(rs, pstmt); + rs = null; pstmt = null; + } + if (retValue != null) + return retValue; + + // Get CashBook + MCashBook cb = new MCashBook (ctx, C_CashBook_ID, trxName); + if (cb.get_ID() ==0) + { + s_log.warning("Not found C_CashBook_ID=" + C_CashBook_ID); + return null; + } + + // Create New Journal + retValue = new MCash (cb, dateAcct); + retValue.save(trxName); + return retValue; + } // get + + /** Static Logger */ + private static CLogger s_log = CLogger.getCLogger (MCash.class); + + + /************************************************************************** + * Standard Constructor + * @param ctx context + * @param C_Cash_ID id + * @param trxName transaction + */ + public MCash (Properties ctx, int C_Cash_ID, String trxName) + { + super (ctx, C_Cash_ID, trxName); + if (C_Cash_ID == 0) + { + // setC_CashBook_ID (0); // FK + setBeginningBalance (Env.ZERO); + setEndingBalance (Env.ZERO); + setStatementDifference(Env.ZERO); + setDocAction(DOCACTION_Complete); + setDocStatus(DOCSTATUS_Drafted); + // + Timestamp today = TimeUtil.getDay(System.currentTimeMillis()); + setStatementDate (today); // @#Date@ + setDateAcct (today); // @#Date@ + String name = DisplayType.getDateFormat(DisplayType.Date).format(today) + + " " + MOrg.get(ctx, getAD_Org_ID()).getValue(); + setName (name); + setIsApproved(false); + setPosted (false); // N + setProcessed (false); + } + } // MCash + + /** + * Load Constructor + * @param ctx context + * @param rs result set + * @param trxName transaction + */ + public MCash (Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } // MCash + + /** + * Parent Constructor + * @param cb cash book + * @param today date - if null today + */ + public MCash (MCashBook cb, Timestamp today) + { + this (cb.getCtx(), 0, cb.get_TrxName()); + setClientOrg(cb); + setC_CashBook_ID(cb.getC_CashBook_ID()); + if (today != null) + { + setStatementDate (today); + setDateAcct (today); + String name = DisplayType.getDateFormat(DisplayType.Date).format(today) + + " " + cb.getName(); + setName (name); + } + m_book = cb; + } // MCash + + /** Lines */ + private MCashLine[] m_lines = null; + /** CashBook */ + private MCashBook m_book = null; + + /** + * Get Lines + * @param requery requery + * @return lines + */ + public MCashLine[] getLines (boolean requery) + { + if (m_lines != null && !requery) { + set_TrxName(m_lines, get_TrxName()); + return m_lines; + } + ArrayList list = new ArrayList(); + String sql = "SELECT * FROM C_CashLine WHERE C_Cash_ID=? ORDER BY Line"; + PreparedStatement pstmt = null; + ResultSet rs = null; + try + { + pstmt = DB.prepareStatement (sql, get_TrxName()); + pstmt.setInt (1, getC_Cash_ID()); + rs = pstmt.executeQuery (); + while (rs.next ()) + list.add (new MCashLine (getCtx(), rs, get_TrxName())); + } + catch (Exception e) + { + log.log(Level.SEVERE, sql, e); + } + finally + { + DB.close(rs, pstmt); + rs = null; pstmt = null; + } + + m_lines = new MCashLine[list.size ()]; + list.toArray (m_lines); + return m_lines; + } // getLines + + /** + * Get Cash Book + * @return cash book + */ + public MCashBook getCashBook() + { + if (m_book == null) + m_book = MCashBook.get(getCtx(), getC_CashBook_ID()); + return m_book; + } // getCashBook + + /** + * Get Document No + * @return name + */ + public String getDocumentNo() + { + return getName(); + } // getDocumentNo + + /** + * Get Document Info + * @return document info (untranslated) + */ + public String getDocumentInfo() + { + return Msg.getElement(getCtx(), "C_Cash_ID") + " " + getDocumentNo(); + } // getDocumentInfo + + /** + * Create PDF + * @return File or null + */ + public File createPDF () + { + try + { + File temp = File.createTempFile(get_TableName()+get_ID()+"_", ".pdf"); + return createPDF (temp); + } + catch (Exception e) + { + log.severe("Could not create PDF - " + e.getMessage()); + } + return null; + } // getPDF + + /** + * Create PDF file + * @param file output file + * @return file if success + */ + public File createPDF (File file) + { + // ReportEngine re = ReportEngine.get (getCtx(), ReportEngine.INVOICE, getC_Invoice_ID()); + // if (re == null) + return null; + // return re.getPDF(file); + } // createPDF + + /** + * Before Save + * @param newRecord + * @return true + */ + protected boolean beforeSave (boolean newRecord) + { + setAD_Org_ID(getCashBook().getAD_Org_ID()); + if (getAD_Org_ID() == 0) + { + log.saveError("Error", Msg.parseTranslation(getCtx(), "@AD_Org_ID@")); + return false; + } + // Calculate End Balance + setEndingBalance(getBeginningBalance().add(getStatementDifference())); + return true; + } // beforeSave + + + /************************************************************************** + * Process document + * @param processAction document action + * @return true if performed + */ + public boolean processIt (String processAction) + { + m_processMsg = null; + DocumentEngine engine = new DocumentEngine (this, getDocStatus()); + return engine.processIt (processAction, getDocAction()); + } // process + + /** Process Message */ + private String m_processMsg = null; + /** Just Prepared Flag */ + private boolean m_justPrepared = false; + + /** + * Unlock Document. + * @return true if success + */ + public boolean unlockIt() + { + log.info(toString()); + setProcessing(false); + return true; + } // unlockIt + + /** + * Invalidate Document + * @return true if success + */ + public boolean invalidateIt() + { + log.info(toString()); + setDocAction(DOCACTION_Prepare); + return true; + } // invalidateIt + + /** + * Prepare Document + * @return new status (In Progress or Invalid) + */ + public String prepareIt() + { + log.info(toString()); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_PREPARE); + if (m_processMsg != null) + return DocAction.STATUS_Invalid; + + // Std Period open? + if (!MPeriod.isOpen(getCtx(), getDateAcct(), MDocType.DOCBASETYPE_CashJournal)) + { + m_processMsg = "@PeriodClosed@"; + return DocAction.STATUS_Invalid; + } + MCashLine[] lines = getLines(false); + if (lines.length == 0) + { + m_processMsg = "@NoLines@"; + return DocAction.STATUS_Invalid; + } + // Add up Amounts + BigDecimal difference = Env.ZERO; + int C_Currency_ID = getC_Currency_ID(); + for (int i = 0; i < lines.length; i++) + { + MCashLine line = lines[i]; + if (!line.isActive()) + continue; + if (C_Currency_ID == line.getC_Currency_ID()) + difference = difference.add(line.getAmount()); + else + { + BigDecimal amt = MConversionRate.convert(getCtx(), line.getAmount(), + line.getC_Currency_ID(), C_Currency_ID, getDateAcct(), 0, + getAD_Client_ID(), getAD_Org_ID()); + if (amt == null) + { + m_processMsg = "No Conversion Rate found - @C_CashLine_ID@= " + line.getLine(); + return DocAction.STATUS_Invalid; + } + difference = difference.add(amt); + } + } + setStatementDifference(difference); + // setEndingBalance(getBeginningBalance().add(getStatementDifference())); + + m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_PREPARE); + if (m_processMsg != null) + return DocAction.STATUS_Invalid; + + m_justPrepared = true; + if (!DOCACTION_Complete.equals(getDocAction())) + setDocAction(DOCACTION_Complete); + return DocAction.STATUS_InProgress; + } // prepareIt + + /** + * Approve Document + * @return true if success + */ + public boolean approveIt() + { + log.info(toString()); + setIsApproved(true); + return true; + } // approveIt + + /** + * Reject Approval + * @return true if success + */ + public boolean rejectIt() + { + log.info(toString()); + setIsApproved(false); + return true; + } // rejectIt + + /** + * Complete Document + * @return new status (Complete, In Progress, Invalid, Waiting ..) + */ + public String completeIt() + { + // Re-Check + if (!m_justPrepared) + { + String status = prepareIt(); + if (!DocAction.STATUS_InProgress.equals(status)) + return status; + } + + m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_COMPLETE); + if (m_processMsg != null) + return DocAction.STATUS_Invalid; + + + // Implicit Approval + if (!isApproved()) + approveIt(); + // + log.info(toString()); + + MCashLine[] lines = getLines(false); + for (int i = 0; i < lines.length; i++) + { + MCashLine line = lines[i]; + if (MCashLine.CASHTYPE_Invoice.equals(line.getCashType())) + { + // Check if the invoice is completed - teo_sarca BF [ 1894524 ] + MInvoice invoice = line.getInvoice(); + if (!MInvoice.DOCSTATUS_Completed.equals(invoice.getDocStatus()) + && !MInvoice.DOCSTATUS_Closed.equals(invoice.getDocStatus())) + { + m_processMsg = "@Line@ "+line.getLine()+": @InvoiceCreateDocNotCompleted@"; + return DocAction.STATUS_Invalid; + } + // + String name = Msg.translate(getCtx(), "C_Cash_ID") + ": " + getName() + + " - " + Msg.translate(getCtx(), "Line") + " " + line.getLine(); + MAllocationHdr hdr = new MAllocationHdr(getCtx(), false, + getDateAcct(), line.getC_Currency_ID(), + name, get_TrxName()); + hdr.setAD_Org_ID(getAD_Org_ID()); + if (!hdr.save()) + { + m_processMsg = CLogger.retrieveErrorString("Could not create Allocation Hdr"); + return DocAction.STATUS_Invalid; + } + // Allocation Line + MAllocationLine aLine = new MAllocationLine (hdr, line.getAmount(), + line.getDiscountAmt(), line.getWriteOffAmt(), Env.ZERO); + aLine.setC_Invoice_ID(line.getC_Invoice_ID()); + aLine.setC_CashLine_ID(line.getC_CashLine_ID()); + if (!aLine.save()) + { + m_processMsg = CLogger.retrieveErrorString("Could not create Allocation Line"); + return DocAction.STATUS_Invalid; + } + // Should start WF + if(!hdr.processIt(DocAction.ACTION_Complete)) { + m_processMsg = CLogger.retrieveErrorString("Could not process Allocation"); + return DocAction.STATUS_Invalid; + } + if (!hdr.save()) { + m_processMsg = CLogger.retrieveErrorString("Could not save Allocation"); + return DocAction.STATUS_Invalid; + } + } + else if (MCashLine.CASHTYPE_BankAccountTransfer.equals(line.getCashType())) + { + // Payment just as intermediate info + MPayment pay = new MPayment (getCtx(), 0, get_TrxName()); + pay.setAD_Org_ID(getAD_Org_ID()); + String documentNo = getName(); + pay.setDocumentNo(documentNo); + pay.setR_PnRef(documentNo); + pay.set_Value("TrxType", "X"); // Transfer + pay.set_Value("TenderType", "X"); + // + //Modification for cash payment + pay.setC_CashBook_ID(getC_CashBook_ID()); + //End of modification + + pay.setC_BankAccount_ID(line.getC_BankAccount_ID()); + pay.setC_DocType_ID(true); // Receipt + pay.setDateTrx(getStatementDate()); + pay.setDateAcct(getDateAcct()); + pay.setAmount(line.getC_Currency_ID(), line.getAmount().negate()); // Transfer + pay.setDescription(line.getDescription()); + pay.setDocStatus(MPayment.DOCSTATUS_Closed); + pay.setDocAction(MPayment.DOCACTION_None); + pay.setPosted(true); + pay.setIsAllocated(true); // Has No Allocation! + pay.setProcessed(true); + if (!pay.save()) + { + m_processMsg = CLogger.retrieveErrorString("Could not create Payment"); + return DocAction.STATUS_Invalid; + } + } + } + + // User Validation + String valid = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_COMPLETE); + if (valid != null) + { + m_processMsg = valid; + return DocAction.STATUS_Invalid; + } + // + setProcessed(true); + setDocAction(DOCACTION_Close); + return DocAction.STATUS_Completed; + } // completeIt + + /** + * Void Document. + * Same as Close. + * @return true if success + */ + public boolean voidIt() + { + log.info(toString()); + // Before Void + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_VOID); + if (m_processMsg != null) + return false; + // After Void + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_VOID); + if (m_processMsg != null) + return false; + setDocAction(DOCACTION_None); + return false; + } // voidIt + + /** + * Close Document. + * Cancel not delivered Qunatities + * @return true if success + */ + public boolean closeIt() + { + log.info(toString()); + // Before Close + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_CLOSE); + if (m_processMsg != null) + return false; + // After Close + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_CLOSE); + if (m_processMsg != null) + return false; + + setDocAction(DOCACTION_None); + return true; + } // closeIt + + /** + * Reverse Correction + * @return true if success + */ + public boolean reverseCorrectIt() + { + log.info(toString()); + // Before reverseCorrect + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSECORRECT); + if (m_processMsg != null) + return false; + + // After reverseCorrect + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSECORRECT); + if (m_processMsg != null) + return false; + + return false; + } // reverseCorrectionIt + + /** + * Reverse Accrual - none + * @return true if success + */ + public boolean reverseAccrualIt() + { + log.info(toString()); + // Before reverseAccrual + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSEACCRUAL); + if (m_processMsg != null) + return false; + + // After reverseAccrual + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSEACCRUAL); + if (m_processMsg != null) + return false; + + return false; + } // reverseAccrualIt + + /** + * Re-activate + * @return true if success + */ + public boolean reActivateIt() + { + log.info(toString()); + // Before reActivate + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REACTIVATE); + if (m_processMsg != null) + return false; + + setProcessed(false); + if (reverseCorrectIt()) + return true; + + // After reActivate + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REACTIVATE); + if (m_processMsg != null) + return false; + return false; + } // reActivateIt + + /** + * Set Processed + * @param processed processed + */ + public void setProcessed (boolean processed) + { + super.setProcessed (processed); + String sql = "UPDATE C_CashLine SET Processed='" + + (processed ? "Y" : "N") + + "' WHERE C_Cash_ID=" + getC_Cash_ID(); + int noLine = DB.executeUpdate (sql, get_TrxName()); + m_lines = null; + log.fine(processed + " - Lines=" + noLine); + } // setProcessed + + /** + * String Representation + * @return info + */ + public String toString () + { + StringBuffer sb = new StringBuffer ("MCash["); + sb.append (get_ID ()) + .append ("-").append (getName()) + .append(", Balance=").append(getBeginningBalance()) + .append("->").append(getEndingBalance()) + .append ("]"); + return sb.toString (); + } // toString + + /************************************************************************* + * Get Summary + * @return Summary of Document + */ + public String getSummary() + { + StringBuffer sb = new StringBuffer(); + sb.append(getName()); + // : Total Lines = 123.00 (#1) + sb.append(": ") + .append(Msg.translate(getCtx(),"BeginningBalance")).append("=").append(getBeginningBalance()) + .append(",") + .append(Msg.translate(getCtx(),"EndingBalance")).append("=").append(getEndingBalance()) + .append(" (#").append(getLines(false).length).append(")"); + // - Description + if (getDescription() != null && getDescription().length() > 0) + sb.append(" - ").append(getDescription()); + return sb.toString(); + } // getSummary + + /** + * Get Process Message + * @return clear text error message + */ + public String getProcessMsg() + { + return m_processMsg; + } // getProcessMsg + + /** + * Get Document Owner (Responsible) + * @return AD_User_ID + */ + public int getDoc_User_ID() + { + return getCreatedBy(); + } // getDoc_User_ID + + /** + * Get Document Approval Amount + * @return amount difference + */ + public BigDecimal getApprovalAmt() + { + return getStatementDifference(); + } // getApprovalAmt + + /** + * Get Currency + * @return Currency + */ + public int getC_Currency_ID () + { + return getCashBook().getC_Currency_ID(); + } // getC_Currency_ID + +} // MCash diff --git a/posterita/posterita/src/main/org/compiere/model/MCashBook.java b/posterita/posterita/src/main/org/compiere/model/MCashBook.java new file mode 100644 index 0000000000..f563eba26b --- /dev/null +++ b/posterita/posterita/src/main/org/compiere/model/MCashBook.java @@ -0,0 +1,170 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program 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 General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.sql.*; +import java.util.*; +import java.util.logging.*; +import org.compiere.util.*; + +/** + * Cash Book Model + * + * @author Jorg Janke + * @version $Id: MCashBook.java,v 1.3 2006/07/30 00:51:02 jjanke Exp $ + */ +public class MCashBook extends X_C_CashBook +{ + /** + * Get MCashBook from Cache + * @param ctx context + * @param C_CashBook_ID id + * @return MCashBook + */ + public static MCashBook get (Properties ctx, int C_CashBook_ID) + { + return get(ctx, C_CashBook_ID, null); + } // get + + /** + * Gets MCashBook from Cache under transaction scope + * @param ctx context + * @param C_CashBook_ID id of cashbook to load + * @param trxName transaction name + * @return Cashbook + */ + public static MCashBook get(Properties ctx, int C_CashBook_ID, String trxName) + { + Integer key = new Integer (C_CashBook_ID); + MCashBook retValue = (MCashBook) s_cache.get (key); + if (retValue != null) + return retValue; + retValue = new MCashBook (ctx, C_CashBook_ID, trxName); + if (retValue.get_ID () != 0) + s_cache.put (key, retValue); + return retValue; + } + /** + * Get CashBook for Org and Currency + * @param ctx context + * @param AD_Org_ID org + * @param C_Currency_ID currency + * @return cash book or null + */ + public static MCashBook get (Properties ctx, int AD_Org_ID, int C_Currency_ID) + { + // Try from cache + Iterator it = s_cache.values().iterator(); + while (it.hasNext()) + { + MCashBook cb = (MCashBook)it.next(); + if (cb.getAD_Org_ID() == AD_Org_ID && cb.getC_Currency_ID() == C_Currency_ID) + return cb; + } + + // Get from DB + MCashBook retValue = null; + String sql = "SELECT * FROM C_CashBook " + + "WHERE AD_Org_ID=? AND C_Currency_ID=? " + + "ORDER BY IsDefault DESC"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement (sql, null); + pstmt.setInt (1, AD_Org_ID); + pstmt.setInt (2, C_Currency_ID); + ResultSet rs = pstmt.executeQuery (); + if (rs.next ()) + { + retValue = new MCashBook (ctx, rs, null); + Integer key = new Integer (retValue.getC_CashBook_ID()); + s_cache.put (key, retValue); + } + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + s_log.log(Level.SEVERE, "get", e); + } + try + { + if (pstmt != null) + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + return retValue; + } // get + + + /** Cache */ + private static CCache s_cache + = new CCache("", 20); + /** Static Logger */ + private static CLogger s_log = CLogger.getCLogger (MCashBook.class); + + /************************************************************************** + * Standard Constructor + * @param ctx context + * @param C_CashBook_ID id + * @param trxName transaction + */ + public MCashBook (Properties ctx, int C_CashBook_ID, String trxName) + { + super (ctx, C_CashBook_ID, trxName); + } // MCashBook + + /** + * Load Constructor + * @param ctx context + * @param rs result set + * @param trxName transaction + */ + public MCashBook (Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } // MCashBook + + /** + * After Save + * @param newRecord new + * @param success success + * @return success + */ + protected boolean afterSave (boolean newRecord, boolean success) + { + if (newRecord && success) + insert_Accounting("C_CashBook_Acct", "C_AcctSchema_Default", null); + + return success; + } // afterSave + + /** + * Before Delete + * @return true + */ + protected boolean beforeDelete () + { + return delete_Accounting("C_Cashbook_Acct"); + } // beforeDelete + +} // MCashBook diff --git a/posterita/posterita/src/main/org/compiere/model/MElementValue.java b/posterita/posterita/src/main/org/compiere/model/MElementValue.java new file mode 100644 index 0000000000..49b270b991 --- /dev/null +++ b/posterita/posterita/src/main/org/compiere/model/MElementValue.java @@ -0,0 +1,262 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program 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 General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.sql.*; +import java.util.*; +import org.compiere.util.*; + +/** + * Natural Account + * + * @author Jorg Janke + * @version $Id: MElementValue.java,v 1.3 2006/07/30 00:58:37 jjanke Exp $ + */ +public class MElementValue extends X_C_ElementValue +{ + /** + * Standard Constructor + * @param ctx context + * @param C_ElementValue_ID ID or 0 for new + * @param trxName transaction + */ + public MElementValue(Properties ctx, int C_ElementValue_ID, String trxName) + { + super(ctx, C_ElementValue_ID, trxName); + if (C_ElementValue_ID == 0) + { + // setC_Element_ID (0); // Parent + // setName (null); + // setValue (null); + setIsSummary (false); + setAccountSign (ACCOUNTSIGN_Natural); + setAccountType (ACCOUNTTYPE_Expense); + setIsDocControlled(false); + setIsForeignCurrency(false); + setIsBankAccount(false); + // + setPostActual (true); + setPostBudget (true); + setPostEncumbrance (true); + setPostStatistical (true); + } + } // MElementValue + + /** + * Load Constructor + * @param ctx context + * @param rs result set + * @param trxName transaction + */ + public MElementValue(Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } // MElementValue + + /** + * Full Constructor + * @param ctx context + * @param Value value + * @param Name name + * @param Description description + * @param AccountType account type + * @param AccountSign account sign + * @param IsDocControlled doc controlled + * @param IsSummary summary + * @param trxName transaction + */ + public MElementValue (Properties ctx, String Value, String Name, String Description, + String AccountType, String AccountSign, + boolean IsDocControlled, boolean IsSummary, String trxName) + { + this (ctx, 0, trxName); + setValue(Value); + setName(Name); + setDescription(Description); + setAccountType(AccountType); + setAccountSign(AccountSign); + setIsDocControlled(IsDocControlled); + setIsSummary(IsSummary); + } // MElementValue + + /** + * Import Constructor + * @param imp import + */ + public MElementValue (X_I_ElementValue imp) + { + this (imp.getCtx(), 0, imp.get_TrxName()); + setClientOrg(imp); + set(imp); + } // MElementValue + + /** + * Set/Update Settings from import + * @param imp import + */ + public void set (X_I_ElementValue imp) + { + setValue(imp.getValue()); + setName(imp.getName()); + setDescription(imp.getDescription()); + setAccountType(imp.getAccountType()); + setAccountSign(imp.getAccountSign()); + setIsSummary(imp.isSummary()); + setIsDocControlled(imp.isDocControlled()); + setC_Element_ID(imp.getC_Element_ID()); + // + setPostActual(imp.isPostActual()); + setPostBudget(imp.isPostBudget()); + setPostEncumbrance(imp.isPostEncumbrance()); + setPostStatistical(imp.isPostStatistical()); + // + // setC_BankAccount_ID(imp.getC_BankAccount_ID()); + // setIsForeignCurrency(imp.isForeignCurrency()); + // setC_Currency_ID(imp.getC_Currency_ID()); + // setIsBankAccount(imp.isIsBankAccount()); + // setValidFrom(null); + // setValidTo(null); + } // set + + + + /** + * Is this a Balance Sheet Account + * @return boolean + */ + public boolean isBalanceSheet() + { + String accountType = getAccountType(); + return (ACCOUNTTYPE_Asset.equals(accountType) + || ACCOUNTTYPE_Liability.equals(accountType) + || ACCOUNTTYPE_OwnerSEquity.equals(accountType)); + } // isBalanceSheet + + /** + * Is this an Activa Account + * @return boolean + */ + public boolean isActiva() + { + return ACCOUNTTYPE_Asset.equals(getAccountType()); + } // isActive + + /** + * Is this a Passiva Account + * @return boolean + */ + public boolean isPassiva() + { + String accountType = getAccountType(); + return (ACCOUNTTYPE_Liability.equals(accountType) + || ACCOUNTTYPE_OwnerSEquity.equals(accountType)); + } // isPassiva + + /** + * User String Representation + * @return info value - name + */ + public String toString () + { + StringBuffer sb = new StringBuffer (); + sb.append(getValue()).append(" - ").append(getName()); + return sb.toString (); + } // toString + + /** + * Extended String Representation + * @return info + */ + public String toStringX () + { + StringBuffer sb = new StringBuffer ("MElementValue["); + sb.append(get_ID()).append(",").append(getValue()).append(" - ").append(getName()) + .append ("]"); + return sb.toString (); + } // toStringX + + + + /** + * Before Save + * @param newRecord + * @return true if ir can be saved + */ + protected boolean beforeSave (boolean newRecord) + { + if (getAD_Org_ID() != 0) + setAD_Org_ID(0); + // + if (!newRecord && isSummary() + && is_ValueChanged("IsSummary")) + { + String sql = "SELECT COUNT(*) FROM Fact_Acct WHERE Account_ID=?"; + int no = DB.getSQLValue(get_TrxName(), sql, getC_ElementValue_ID()); + if (no != 0) + { + log.saveError("Error", "Already posted to"); + return false; + } + } + return true; + } // beforeSave + + /** + * After Save + * @param newRecord new + * @param success success + * @return success + */ + protected boolean afterSave (boolean newRecord, boolean success) + { + if (newRecord) + { + // afalcone [Bugs #1837219] + // sendy (transaction scope included) + int ad_Tree_ID= (new MElement(getCtx(), getC_Element_ID(), get_TrxName())).getAD_Tree_ID(); + String treeType= (new MTree(getCtx(),ad_Tree_ID, get_TrxName())).getTreeType(); + insert_Tree(treeType, getC_Element_ID()); + // insert_Tree(MTree_Base.TREETYPE_ElementValue, getC_Element_ID()); Old + + } + + // Value/Name change + if (!newRecord && (is_ValueChanged("Value") || is_ValueChanged("Name"))) + { + MAccount.updateValueDescription(getCtx(), "Account_ID=" + getC_ElementValue_ID(),get_TrxName()); + if ("Y".equals(Env.getContext(getCtx(), "$Element_U1"))) + MAccount.updateValueDescription(getCtx(), "User1_ID=" + getC_ElementValue_ID(),get_TrxName()); + if ("Y".equals(Env.getContext(getCtx(), "$Element_U2"))) + MAccount.updateValueDescription(getCtx(), "User2_ID=" + getC_ElementValue_ID(),get_TrxName()); + } + + return success; + } // afterSave + + /** + * After Delete + * @param success + * @return deleted + */ + protected boolean afterDelete (boolean success) + { + if (success) + delete_Tree(MTree_Base.TREETYPE_ElementValue); + return success; + } // afterDelete + +} // MElementValue diff --git a/posterita/posterita/src/main/org/compiere/model/MInvoice.java b/posterita/posterita/src/main/org/compiere/model/MInvoice.java new file mode 100644 index 0000000000..b91a7270a0 --- /dev/null +++ b/posterita/posterita/src/main/org/compiere/model/MInvoice.java @@ -0,0 +1,2370 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program 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 General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.io.*; +import java.math.*; +import java.sql.*; +import java.util.*; +import java.util.logging.*; +import org.compiere.print.*; +import org.compiere.process.*; +import org.compiere.util.*; + + +/** + * Invoice Model. + * Please do not set DocStatus and C_DocType_ID directly. + * They are set in the process() method. + * Use DocAction and C_DocTypeTarget_ID instead. + * + * @author Jorg Janke + * @version $Id: MInvoice.java,v 1.2 2006/07/30 00:51:02 jjanke Exp $ + * + * Modifications: Added RMA functionality (Ashley Ramdass) + */ +public class MInvoice extends X_C_Invoice implements DocAction +{ + /** + * Get Payments Of BPartner + * @param ctx context + * @param C_BPartner_ID id + * @param trxName transaction + * @return array + */ + public static MInvoice[] getOfBPartner (Properties ctx, int C_BPartner_ID, String trxName) + { + ArrayList list = new ArrayList(); + String sql = "SELECT * FROM C_Invoice WHERE C_BPartner_ID=?"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement(sql, trxName); + pstmt.setInt(1, C_BPartner_ID); + ResultSet rs = pstmt.executeQuery(); + while (rs.next()) + list.add(new MInvoice(ctx,rs, trxName)); + rs.close(); + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + s_log.log(Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + + // + MInvoice[] retValue = new MInvoice[list.size()]; + list.toArray(retValue); + return retValue; + } // getOfBPartner + + /** + * Create new Invoice by copying + * @param from invoice + * @param dateDoc date of the document date + * @param C_DocTypeTarget_ID target doc type + * @param isSOTrx sales order + * @param counter create counter links + * @param trxName trx + * @param setOrder set Order links + * @return Invoice + */ + public static MInvoice copyFrom (MInvoice from, Timestamp dateDoc, + int C_DocTypeTarget_ID, boolean isSOTrx, boolean counter, + String trxName, boolean setOrder) + { + MInvoice to = new MInvoice (from.getCtx(), 0, null); + to.set_TrxName(trxName); + PO.copyValues (from, to, from.getAD_Client_ID(), from.getAD_Org_ID()); + to.set_ValueNoCheck ("C_Invoice_ID", I_ZERO); + to.set_ValueNoCheck ("DocumentNo", null); + // + to.setDocStatus (DOCSTATUS_Drafted); // Draft + to.setDocAction(DOCACTION_Complete); + // + to.setC_DocType_ID(0); + to.setC_DocTypeTarget_ID (C_DocTypeTarget_ID); + to.setIsSOTrx(isSOTrx); + // + to.setDateInvoiced (dateDoc); + to.setDateAcct (dateDoc); + to.setDatePrinted(null); + to.setIsPrinted (false); + // + to.setIsApproved (false); + to.setC_Payment_ID(0); + to.setC_CashLine_ID(0); + to.setIsPaid (false); + to.setIsInDispute(false); + // + // Amounts are updated by trigger when adding lines + to.setGrandTotal(Env.ZERO); + to.setTotalLines(Env.ZERO); + // + to.setIsTransferred (false); + to.setPosted (false); + to.setProcessed (false); + //[ 1633721 ] Reverse Documents- Processing=Y + to.setProcessing(false); + // delete references + to.setIsSelfService(false); + if (!setOrder) + to.setC_Order_ID(0); + if (counter) + { + to.setRef_Invoice_ID(from.getC_Invoice_ID()); + // Try to find Order link + if (from.getC_Order_ID() != 0) + { + MOrder peer = new MOrder (from.getCtx(), from.getC_Order_ID(), from.get_TrxName()); + if (peer.getRef_Order_ID() != 0) + to.setC_Order_ID(peer.getRef_Order_ID()); + } + } + else + to.setRef_Invoice_ID(0); + + if (!to.save(trxName)) + throw new IllegalStateException("Could not create Invoice"); + if (counter) + from.setRef_Invoice_ID(to.getC_Invoice_ID()); + + // Lines + if (to.copyLinesFrom(from, counter, setOrder) == 0) + throw new IllegalStateException("Could not create Invoice Lines"); + + return to; + } // copyFrom + + /** + * Get PDF File Name + * @param documentDir directory + * @param C_Invoice_ID invoice + * @return file name + */ + public static String getPDFFileName (String documentDir, int C_Invoice_ID) + { + StringBuffer sb = new StringBuffer (documentDir); + if (sb.length() == 0) + sb.append("."); + if (!sb.toString().endsWith(File.separator)) + sb.append(File.separator); + sb.append("C_Invoice_ID_") + .append(C_Invoice_ID) + .append(".pdf"); + return sb.toString(); + } // getPDFFileName + + + /** + * Get MInvoice from Cache + * @param ctx context + * @param C_Invoice_ID id + * @return MInvoice + */ + public static MInvoice get (Properties ctx, int C_Invoice_ID) + { + Integer key = new Integer (C_Invoice_ID); + MInvoice retValue = (MInvoice) s_cache.get (key); + if (retValue != null) + return retValue; + retValue = new MInvoice (ctx, C_Invoice_ID, null); + if (retValue.get_ID () != 0) + s_cache.put (key, retValue); + return retValue; + } // get + + /** Cache */ + private static CCache s_cache = new CCache("C_Invoice", 20, 2); // 2 minutes + + + /************************************************************************** + * Invoice Constructor + * @param ctx context + * @param C_Invoice_ID invoice or 0 for new + * @param trxName trx name + */ + public MInvoice (Properties ctx, int C_Invoice_ID, String trxName) + { + super (ctx, C_Invoice_ID, trxName); + if (C_Invoice_ID == 0) + { + setDocStatus (DOCSTATUS_Drafted); // Draft + setDocAction (DOCACTION_Complete); + // + setPaymentRule(PAYMENTRULE_OnCredit); // Payment Terms + + setDateInvoiced (new Timestamp (System.currentTimeMillis ())); + setDateAcct (new Timestamp (System.currentTimeMillis ())); + // + setChargeAmt (Env.ZERO); + setTotalLines (Env.ZERO); + setGrandTotal (Env.ZERO); + // + setIsSOTrx (true); + setIsTaxIncluded (false); + setIsApproved (false); + setIsDiscountPrinted (false); + setIsPaid (false); + setSendEMail (false); + setIsPrinted (false); + setIsTransferred (false); + setIsSelfService(false); + setIsPayScheduleValid(false); + setIsInDispute(false); + setPosted(false); + super.setProcessed (false); + setProcessing(false); + } + } // MInvoice + + /** + * Load Constructor + * @param ctx context + * @param rs result set record + * @param trxName transaction + */ + public MInvoice (Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } // MInvoice + + /** + * Create Invoice from Order + * @param order order + * @param C_DocTypeTarget_ID target document type + * @param invoiceDate date or null + */ + public MInvoice (MOrder order, int C_DocTypeTarget_ID, Timestamp invoiceDate) + { + this (order.getCtx(), 0, order.get_TrxName()); + setClientOrg(order); + setOrder(order); // set base settings + // + if (C_DocTypeTarget_ID == 0) + C_DocTypeTarget_ID = DB.getSQLValue(null, + "SELECT C_DocTypeInvoice_ID FROM C_DocType WHERE C_DocType_ID=?", + order.getC_DocType_ID()); + setC_DocTypeTarget_ID(C_DocTypeTarget_ID); + if (invoiceDate != null) + setDateInvoiced(invoiceDate); + setDateAcct(getDateInvoiced()); + // + setSalesRep_ID(order.getSalesRep_ID()); + // + setC_BPartner_ID(order.getBill_BPartner_ID()); + setC_BPartner_Location_ID(order.getBill_Location_ID()); + setAD_User_ID(order.getBill_User_ID()); + } // MInvoice + + /** + * Create Invoice from Shipment + * @param ship shipment + * @param invoiceDate date or null + */ + public MInvoice (MInOut ship, Timestamp invoiceDate) + { + this (ship.getCtx(), 0, ship.get_TrxName()); + setClientOrg(ship); + setShipment(ship); // set base settings + // + setC_DocTypeTarget_ID(); + if (invoiceDate != null) + setDateInvoiced(invoiceDate); + setDateAcct(getDateInvoiced()); + // + setSalesRep_ID(ship.getSalesRep_ID()); + setAD_User_ID(ship.getAD_User_ID()); + } // MInvoice + + /** + * Create Invoice from Batch Line + * @param batch batch + * @param line batch line + */ + public MInvoice (MInvoiceBatch batch, MInvoiceBatchLine line) + { + this (line.getCtx(), 0, line.get_TrxName()); + setClientOrg(line); + setDocumentNo(line.getDocumentNo()); + // + setIsSOTrx(batch.isSOTrx()); + MBPartner bp = new MBPartner (line.getCtx(), line.getC_BPartner_ID(), line.get_TrxName()); + setBPartner(bp); // defaults + // + setIsTaxIncluded(line.isTaxIncluded()); + // May conflict with default price list + setC_Currency_ID(batch.getC_Currency_ID()); + setC_ConversionType_ID(batch.getC_ConversionType_ID()); + // + // setPaymentRule(order.getPaymentRule()); + // setC_PaymentTerm_ID(order.getC_PaymentTerm_ID()); + // setPOReference(""); + setDescription(batch.getDescription()); + // setDateOrdered(order.getDateOrdered()); + // + setAD_OrgTrx_ID(line.getAD_OrgTrx_ID()); + setC_Project_ID(line.getC_Project_ID()); + // setC_Campaign_ID(line.getC_Campaign_ID()); + setC_Activity_ID(line.getC_Activity_ID()); + setUser1_ID(line.getUser1_ID()); + setUser2_ID(line.getUser2_ID()); + // + setC_DocTypeTarget_ID(line.getC_DocType_ID()); + setDateInvoiced(line.getDateInvoiced()); + setDateAcct(line.getDateAcct()); + // + setSalesRep_ID(batch.getSalesRep_ID()); + // + setC_BPartner_ID(line.getC_BPartner_ID()); + setC_BPartner_Location_ID(line.getC_BPartner_Location_ID()); + setAD_User_ID(line.getAD_User_ID()); + } // MInvoice + + /** Open Amount */ + private BigDecimal m_openAmt = null; + + /** Invoice Lines */ + private MInvoiceLine[] m_lines; + /** Invoice Taxes */ + private MInvoiceTax[] m_taxes; + /** Logger */ + private static CLogger s_log = CLogger.getCLogger(MInvoice.class); + + /** + * Overwrite Client/Org if required + * @param AD_Client_ID client + * @param AD_Org_ID org + */ + public void setClientOrg (int AD_Client_ID, int AD_Org_ID) + { + super.setClientOrg(AD_Client_ID, AD_Org_ID); + } // setClientOrg + + /** + * Set Business Partner Defaults & Details + * @param bp business partner + */ + public void setBPartner (MBPartner bp) + { + if (bp == null) + return; + + setC_BPartner_ID(bp.getC_BPartner_ID()); + // Set Defaults + int ii = 0; + if (isSOTrx()) + ii = bp.getC_PaymentTerm_ID(); + else + ii = bp.getPO_PaymentTerm_ID(); + if (ii != 0) + setC_PaymentTerm_ID(ii); + // + if (isSOTrx()) + ii = bp.getM_PriceList_ID(); + else + ii = bp.getPO_PriceList_ID(); + if (ii != 0) + setM_PriceList_ID(ii); + // + String ss = bp.getPaymentRule(); + if (ss != null) + setPaymentRule(ss); + + + // Set Locations + MBPartnerLocation[] locs = bp.getLocations(false); + if (locs != null) + { + for (int i = 0; i < locs.length; i++) + { + if ((locs[i].isBillTo() && isSOTrx()) + || (locs[i].isPayFrom() && !isSOTrx())) + setC_BPartner_Location_ID(locs[i].getC_BPartner_Location_ID()); + } + // set to first + if (getC_BPartner_Location_ID() == 0 && locs.length > 0) + setC_BPartner_Location_ID(locs[0].getC_BPartner_Location_ID()); + } + if (getC_BPartner_Location_ID() == 0) + log.log(Level.SEVERE, "Has no To Address: " + bp); + + // Set Contact + MUser[] contacts = bp.getContacts(false); + if (contacts != null && contacts.length > 0) // get first User + setAD_User_ID(contacts[0].getAD_User_ID()); + } // setBPartner + + /** + * Set Order References + * @param order order + */ + public void setOrder (MOrder order) + { + if (order == null) + return; + + setC_Order_ID(order.getC_Order_ID()); + setIsSOTrx(order.isSOTrx()); + setIsDiscountPrinted(order.isDiscountPrinted()); + setIsSelfService(order.isSelfService()); + setSendEMail(order.isSendEMail()); + // + setM_PriceList_ID(order.getM_PriceList_ID()); + setIsTaxIncluded(order.isTaxIncluded()); + setC_Currency_ID(order.getC_Currency_ID()); + setC_ConversionType_ID(order.getC_ConversionType_ID()); + // + setPaymentRule(order.getPaymentRule()); + setC_PaymentTerm_ID(order.getC_PaymentTerm_ID()); + setPOReference(order.getPOReference()); + setDescription(order.getDescription()); + setDateOrdered(order.getDateOrdered()); + // + setAD_OrgTrx_ID(order.getAD_OrgTrx_ID()); + setC_Project_ID(order.getC_Project_ID()); + setC_Campaign_ID(order.getC_Campaign_ID()); + setC_Activity_ID(order.getC_Activity_ID()); + setUser1_ID(order.getUser1_ID()); + setUser2_ID(order.getUser2_ID()); + } // setOrder + + /** + * Set Shipment References + * @param ship shipment + */ + public void setShipment (MInOut ship) + { + if (ship == null) + return; + + setIsSOTrx(ship.isSOTrx()); + // + MBPartner bp = new MBPartner (getCtx(), ship.getC_BPartner_ID(), null); + setBPartner (bp); + // + setSendEMail(ship.isSendEMail()); + // + setPOReference(ship.getPOReference()); + setDescription(ship.getDescription()); + setDateOrdered(ship.getDateOrdered()); + // + setAD_OrgTrx_ID(ship.getAD_OrgTrx_ID()); + setC_Project_ID(ship.getC_Project_ID()); + setC_Campaign_ID(ship.getC_Campaign_ID()); + setC_Activity_ID(ship.getC_Activity_ID()); + setUser1_ID(ship.getUser1_ID()); + setUser2_ID(ship.getUser2_ID()); + // + if (ship.getC_Order_ID() != 0) + { + setC_Order_ID(ship.getC_Order_ID()); + MOrder order = new MOrder (getCtx(), ship.getC_Order_ID(), get_TrxName()); + setIsDiscountPrinted(order.isDiscountPrinted()); + setM_PriceList_ID(order.getM_PriceList_ID()); + setIsTaxIncluded(order.isTaxIncluded()); + setC_Currency_ID(order.getC_Currency_ID()); + setC_ConversionType_ID(order.getC_ConversionType_ID()); + setPaymentRule(order.getPaymentRule()); + setC_PaymentTerm_ID(order.getC_PaymentTerm_ID()); + // + MDocType dt = MDocType.get(getCtx(), order.getC_DocType_ID()); + if (dt.getC_DocTypeInvoice_ID() != 0) + setC_DocTypeTarget_ID(dt.getC_DocTypeInvoice_ID()); + // Overwrite Invoice Address + setC_BPartner_Location_ID(order.getBill_Location_ID()); + } + // Check if Shipment/Receipt is based on RMA + if (ship.getM_RMA_ID() != 0) + { + MRMA rma = new MRMA(getCtx(), ship.getM_RMA_ID(), get_TrxName()); + MOrder rmaOrder = rma.getOriginalOrder(); + setM_RMA_ID(ship.getM_RMA_ID()); + setIsSOTrx(rma.isSOTrx()); + setM_PriceList_ID(rmaOrder.getM_PriceList_ID()); + setIsTaxIncluded(rmaOrder.isTaxIncluded()); + setC_Currency_ID(rmaOrder.getC_Currency_ID()); + setC_ConversionType_ID(rmaOrder.getC_ConversionType_ID()); + setPaymentRule(rmaOrder.getPaymentRule()); + setC_PaymentTerm_ID(rmaOrder.getC_PaymentTerm_ID()); + + // Retrieves the invoice DocType + MDocType dt = MDocType.get(getCtx(), rma.getC_DocType_ID()); + if (dt.getC_DocTypeInvoice_ID() != 0) + { + setC_DocTypeTarget_ID(dt.getC_DocTypeInvoice_ID()); + } + setC_BPartner_Location_ID(rmaOrder.getBill_Location_ID()); + } + + } // setShipment + + /** + * Set Target Document Type + * @param DocBaseType doc type MDocType.DOCBASETYPE_ + */ + public void setC_DocTypeTarget_ID (String DocBaseType) + { + String sql = "SELECT C_DocType_ID FROM C_DocType " + + "WHERE AD_Client_ID=? AND DocBaseType=?" + + " AND IsActive='Y' " + + "ORDER BY IsDefault DESC"; + int C_DocType_ID = DB.getSQLValue(null, sql, getAD_Client_ID(), DocBaseType); + if (C_DocType_ID <= 0) + log.log(Level.SEVERE, "Not found for AC_Client_ID=" + + getAD_Client_ID() + " - " + DocBaseType); + else + { + log.fine(DocBaseType); + setC_DocTypeTarget_ID (C_DocType_ID); + boolean isSOTrx = MDocType.DOCBASETYPE_ARInvoice.equals(DocBaseType) + || MDocType.DOCBASETYPE_ARCreditMemo.equals(DocBaseType); + setIsSOTrx (isSOTrx); + } + } // setC_DocTypeTarget_ID + + /** + * Set Target Document Type. + * Based on SO flag AP/AP Invoice + */ + public void setC_DocTypeTarget_ID () + { + if (getC_DocTypeTarget_ID() > 0) + return; + if (isSOTrx()) + setC_DocTypeTarget_ID(MDocType.DOCBASETYPE_ARInvoice); + else + setC_DocTypeTarget_ID(MDocType.DOCBASETYPE_APInvoice); + } // setC_DocTypeTarget_ID + + + /** + * Get Grand Total + * @param creditMemoAdjusted adjusted for CM (negative) + * @return grand total + */ + public BigDecimal getGrandTotal (boolean creditMemoAdjusted) + { + if (!creditMemoAdjusted) + return super.getGrandTotal(); + // + BigDecimal amt = getGrandTotal(); + if (isCreditMemo()) + return amt.negate(); + return amt; + } // getGrandTotal + + + /** + * Get Invoice Lines of Invoice + * @param whereClause starting with AND + * @return lines + */ + private MInvoiceLine[] getLines (String whereClause) + { + ArrayList list = new ArrayList(); + String sql = "SELECT * FROM C_InvoiceLine WHERE C_Invoice_ID=? "; + if (whereClause != null) + sql += whereClause; + sql += " ORDER BY Line"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement(sql, get_TrxName()); + pstmt.setInt(1, getC_Invoice_ID()); + ResultSet rs = pstmt.executeQuery(); + while (rs.next()) + { + MInvoiceLine il = new MInvoiceLine(getCtx(), rs, get_TrxName()); + il.setInvoice(this); + list.add(il); + } + rs.close(); + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + log.log(Level.SEVERE, "getLines", e); + } + finally + { + try + { + if (pstmt != null) + pstmt.close (); + } + catch (Exception e) + {} + pstmt = null; + } + + // + MInvoiceLine[] lines = new MInvoiceLine[list.size()]; + list.toArray(lines); + return lines; + } // getLines + + /** + * Get Invoice Lines + * @param requery + * @return lines + */ + public MInvoiceLine[] getLines (boolean requery) + { + if (m_lines == null || m_lines.length == 0 || requery) + m_lines = getLines(null); + set_TrxName(m_lines, get_TrxName()); + return m_lines; + } // getLines + + /** + * Get Lines of Invoice + * @return lines + */ + public MInvoiceLine[] getLines() + { + return getLines(false); + } // getLines + + + /** + * Renumber Lines + * @param step start and step + */ + public void renumberLines (int step) + { + int number = step; + MInvoiceLine[] lines = getLines(false); + for (int i = 0; i < lines.length; i++) + { + MInvoiceLine line = lines[i]; + line.setLine(number); + line.save(); + number += step; + } + m_lines = null; + } // renumberLines + + /** + * Copy Lines From other Invoice. + * @param otherInvoice invoice + * @param counter create counter links + * @param setOrder set order links + * @return number of lines copied + */ + public int copyLinesFrom (MInvoice otherInvoice, boolean counter, boolean setOrder) + { + if (isProcessed() || isPosted() || otherInvoice == null) + return 0; + MInvoiceLine[] fromLines = otherInvoice.getLines(false); + int count = 0; + for (int i = 0; i < fromLines.length; i++) + { + MInvoiceLine line = new MInvoiceLine (getCtx(), 0, get_TrxName()); + MInvoiceLine fromLine = fromLines[i]; + if (counter) // header + PO.copyValues (fromLine, line, getAD_Client_ID(), getAD_Org_ID()); + else + PO.copyValues (fromLine, line, fromLine.getAD_Client_ID(), fromLine.getAD_Org_ID()); + line.setC_Invoice_ID(getC_Invoice_ID()); + line.setInvoice(this); + line.set_ValueNoCheck ("C_InvoiceLine_ID", I_ZERO); // new + // Reset + if (!setOrder) + line.setC_OrderLine_ID(0); + line.setRef_InvoiceLine_ID(0); + line.setM_InOutLine_ID(0); + line.setA_Asset_ID(0); + line.setM_AttributeSetInstance_ID(0); + line.setS_ResourceAssignment_ID(0); + // New Tax + if (getC_BPartner_ID() != otherInvoice.getC_BPartner_ID()) + line.setTax(); // recalculate + // + if (counter) + { + line.setRef_InvoiceLine_ID(fromLine.getC_InvoiceLine_ID()); + if (fromLine.getC_OrderLine_ID() != 0) + { + MOrderLine peer = new MOrderLine (getCtx(), fromLine.getC_OrderLine_ID(), get_TrxName()); + if (peer.getRef_OrderLine_ID() != 0) + line.setC_OrderLine_ID(peer.getRef_OrderLine_ID()); + } + line.setM_InOutLine_ID(0); + if (fromLine.getM_InOutLine_ID() != 0) + { + MInOutLine peer = new MInOutLine (getCtx(), fromLine.getM_InOutLine_ID(), get_TrxName()); + if (peer.getRef_InOutLine_ID() != 0) + line.setM_InOutLine_ID(peer.getRef_InOutLine_ID()); + } + } + // + line.setProcessed(false); + if (line.save(get_TrxName())) + count++; + // Cross Link + if (counter) + { + fromLine.setRef_InvoiceLine_ID(line.getC_InvoiceLine_ID()); + fromLine.save(get_TrxName()); + } + + // MZ Goodwill + // copy the landed cost + line.copyLandedCostFrom(fromLine); + line.allocateLandedCosts(); + // end MZ + } + if (fromLines.length != count) + log.log(Level.SEVERE, "Line difference - From=" + fromLines.length + " <> Saved=" + count); + return count; + } // copyLinesFrom + + /** Reversal Flag */ + private boolean m_reversal = false; + + /** + * Set Reversal + * @param reversal reversal + */ + private void setReversal(boolean reversal) + { + m_reversal = reversal; + } // setReversal + /** + * Is Reversal + * @return reversal + */ + private boolean isReversal() + { + return m_reversal; + } // isReversal + + /** + * Get Taxes + * @param requery requery + * @return array of taxes + */ + public MInvoiceTax[] getTaxes (boolean requery) + { + if (m_taxes != null && !requery) + return m_taxes; + String sql = "SELECT * FROM C_InvoiceTax WHERE C_Invoice_ID=?"; + ArrayList list = new ArrayList(); + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement (sql, get_TrxName()); + pstmt.setInt (1, getC_Invoice_ID()); + ResultSet rs = pstmt.executeQuery (); + while (rs.next ()) + list.add(new MInvoiceTax(getCtx(), rs, get_TrxName())); + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + log.log(Level.SEVERE, "getTaxes", e); + } + try + { + if (pstmt != null) + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + + m_taxes = new MInvoiceTax[list.size ()]; + list.toArray (m_taxes); + return m_taxes; + } // getTaxes + + /** + * Add to Description + * @param description text + */ + public void addDescription (String description) + { + String desc = getDescription(); + if (desc == null) + setDescription(description); + else + setDescription(desc + " | " + description); + } // addDescription + + /** + * Is it a Credit Memo? + * @return true if CM + */ + public boolean isCreditMemo() + { + MDocType dt = MDocType.get(getCtx(), + getC_DocType_ID()==0 ? getC_DocTypeTarget_ID() : getC_DocType_ID()); + return MDocType.DOCBASETYPE_APCreditMemo.equals(dt.getDocBaseType()) + || MDocType.DOCBASETYPE_ARCreditMemo.equals(dt.getDocBaseType()); + } // isCreditMemo + + /** + * Set Processed. + * Propergate to Lines/Taxes + * @param processed processed + */ + public void setProcessed (boolean processed) + { + super.setProcessed (processed); + if (get_ID() == 0) + return; + String set = "SET Processed='" + + (processed ? "Y" : "N") + + "' WHERE C_Invoice_ID=" + getC_Invoice_ID(); + int noLine = DB.executeUpdate("UPDATE C_InvoiceLine " + set, get_TrxName()); + int noTax = DB.executeUpdate("UPDATE C_InvoiceTax " + set, get_TrxName()); + m_lines = null; + m_taxes = null; + log.fine(processed + " - Lines=" + noLine + ", Tax=" + noTax); + } // setProcessed + + /** + * Validate Invoice Pay Schedule + * @return pay schedule is valid + */ + public boolean validatePaySchedule() + { + MInvoicePaySchedule[] schedule = MInvoicePaySchedule.getInvoicePaySchedule + (getCtx(), getC_Invoice_ID(), 0, get_TrxName()); + log.fine("#" + schedule.length); + if (schedule.length == 0) + { + setIsPayScheduleValid(false); + return false; + } + // Add up due amounts + BigDecimal total = Env.ZERO; + for (int i = 0; i < schedule.length; i++) + { + schedule[i].setParent(this); + BigDecimal due = schedule[i].getDueAmt(); + if (due != null) + total = total.add(due); + } + boolean valid = getGrandTotal().compareTo(total) == 0; + setIsPayScheduleValid(valid); + + // Update Schedule Lines + for (int i = 0; i < schedule.length; i++) + { + if (schedule[i].isValid() != valid) + { + schedule[i].setIsValid(valid); + schedule[i].save(get_TrxName()); + } + } + return valid; + } // validatePaySchedule + + + /************************************************************************** + * Before Save + * @param newRecord new + * @return true + */ + protected boolean beforeSave (boolean newRecord) + { + log.fine(""); + // No Partner Info - set Template + if (getC_BPartner_ID() == 0) + setBPartner(MBPartner.getTemplate(getCtx(), getAD_Client_ID())); + if (getC_BPartner_Location_ID() == 0) + setBPartner(new MBPartner(getCtx(), getC_BPartner_ID(), null)); + + // Price List + if (getM_PriceList_ID() == 0) + { + int ii = Env.getContextAsInt(getCtx(), "#M_PriceList_ID"); + if (ii != 0) + setM_PriceList_ID(ii); + else + { + String sql = "SELECT M_PriceList_ID FROM M_PriceList WHERE AD_Client_ID=? AND IsDefault='Y'"; + ii = DB.getSQLValue (null, sql, getAD_Client_ID()); + if (ii != 0) + setM_PriceList_ID (ii); + } + } + + // Currency + if (getC_Currency_ID() == 0) + { + String sql = "SELECT C_Currency_ID FROM M_PriceList WHERE M_PriceList_ID=?"; + int ii = DB.getSQLValue (null, sql, getM_PriceList_ID()); + if (ii != 0) + setC_Currency_ID (ii); + else + setC_Currency_ID(Env.getContextAsInt(getCtx(), "#C_Currency_ID")); + } + + // Sales Rep + if (getSalesRep_ID() == 0) + { + int ii = Env.getContextAsInt(getCtx(), "#SalesRep_ID"); + if (ii != 0) + setSalesRep_ID (ii); + } + + // Document Type + if (getC_DocType_ID() == 0) + setC_DocType_ID (0); // make sure it's set to 0 + if (getC_DocTypeTarget_ID() == 0) + setC_DocTypeTarget_ID(isSOTrx() ? MDocType.DOCBASETYPE_ARInvoice : MDocType.DOCBASETYPE_APInvoice); + + // Payment Term + if (getC_PaymentTerm_ID() == 0) + { + int ii = Env.getContextAsInt(getCtx(), "#C_PaymentTerm_ID"); + if (ii != 0) + setC_PaymentTerm_ID (ii); + else + { + String sql = "SELECT C_PaymentTerm_ID FROM C_PaymentTerm WHERE AD_Client_ID=? AND IsDefault='Y'"; + ii = DB.getSQLValue(null, sql, getAD_Client_ID()); + if (ii != 0) + setC_PaymentTerm_ID (ii); + } + } + return true; + } // beforeSave + + /** + * Before Delete + * @return true if it can be deleted + */ + protected boolean beforeDelete () + { + if (getC_Order_ID() != 0) + { + log.saveError("Error", Msg.getMsg(getCtx(), "CannotDelete")); + return false; + } + return true; + } // beforeDelete + + /** + * String Representation + * @return info + */ + public String toString () + { + StringBuffer sb = new StringBuffer ("MInvoice[") + .append(get_ID()).append("-").append(getDocumentNo()) + .append(",GrandTotal=").append(getGrandTotal()); + if (m_lines != null) + sb.append(" (#").append(m_lines.length).append(")"); + sb.append ("]"); + return sb.toString (); + } // toString + + /** + * Get Document Info + * @return document info (untranslated) + */ + public String getDocumentInfo() + { + MDocType dt = MDocType.get(getCtx(), getC_DocType_ID()); + return dt.getName() + " " + getDocumentNo(); + } // getDocumentInfo + + + /** + * After Save + * @param newRecord new + * @param success success + * @return success + */ + protected boolean afterSave (boolean newRecord, boolean success) + { + if (!success || newRecord) + return success; + + if (is_ValueChanged("AD_Org_ID")) + { + String sql = "UPDATE C_InvoiceLine ol" + + " SET AD_Org_ID =" + + "(SELECT AD_Org_ID" + + " FROM C_Invoice o WHERE ol.C_Invoice_ID=o.C_Invoice_ID) " + + "WHERE C_Invoice_ID=" + getC_Invoice_ID(); + int no = DB.executeUpdate(sql, get_TrxName()); + log.fine("Lines -> #" + no); + } + return true; + } // afterSave + + + /** + * Set Price List (and Currency) when valid + * @param M_PriceList_ID price list + */ + public void setM_PriceList_ID (int M_PriceList_ID) + { + String sql = "SELECT M_PriceList_ID, C_Currency_ID " + + "FROM M_PriceList WHERE M_PriceList_ID=?"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement(sql, null); + pstmt.setInt(1, M_PriceList_ID); + ResultSet rs = pstmt.executeQuery(); + if (rs.next()) + { + super.setM_PriceList_ID (rs.getInt(1)); + setC_Currency_ID (rs.getInt(2)); + } + rs.close(); + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + log.log(Level.SEVERE, "setM_PriceList_ID", e); + } + finally + { + try + { + if (pstmt != null) + pstmt.close (); + } + catch (Exception e) + {} + pstmt = null; + } + } // setM_PriceList_ID + + + /** + * Get Allocated Amt in Invoice Currency + * @return pos/neg amount or null + */ + public BigDecimal getAllocatedAmt () + { + BigDecimal retValue = null; + String sql = "SELECT SUM(currencyConvert(al.Amount+al.DiscountAmt+al.WriteOffAmt," + + "ah.C_Currency_ID, i.C_Currency_ID,ah.DateTrx,COALESCE(i.C_ConversionType_ID,0), al.AD_Client_ID,al.AD_Org_ID)) " + + "FROM C_AllocationLine al" + + " INNER JOIN C_AllocationHdr ah ON (al.C_AllocationHdr_ID=ah.C_AllocationHdr_ID)" + + " INNER JOIN C_Invoice i ON (al.C_Invoice_ID=i.C_Invoice_ID) " + + "WHERE al.C_Invoice_ID=?" + + " AND ah.IsActive='Y' AND al.IsActive='Y'"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement(sql, get_TrxName()); + pstmt.setInt(1, getC_Invoice_ID()); + ResultSet rs = pstmt.executeQuery(); + if (rs.next()) + retValue = rs.getBigDecimal(1); + rs.close(); + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + log.log(Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + // log.fine("getAllocatedAmt - " + retValue); + // ? ROUND(NVL(v_AllocatedAmt,0), 2); + return retValue; + } // getAllocatedAmt + + /** + * Test Allocation (and set paid flag) + * @return true if updated + */ + public boolean testAllocation() + { + boolean change = false; + + if ( isProcessed() ) { + BigDecimal alloc = getAllocatedAmt(); // absolute + if (alloc == null) + alloc = Env.ZERO; + BigDecimal total = getGrandTotal(); + if (!isSOTrx()) + total = total.negate(); + if (isCreditMemo()) + total = total.negate(); + boolean test = total.compareTo(alloc) == 0; + change = test != isPaid(); + if (change) + setIsPaid(test); + log.fine("Paid=" + test + + " (" + alloc + "=" + total + ")"); + } + + return change; + } // testAllocation + + /** + * Set Paid Flag for invoices + * @param ctx context + * @param C_BPartner_ID if 0 all + * @param trxName transaction + */ + public static void setIsPaid (Properties ctx, int C_BPartner_ID, String trxName) + { + int counter = 0; + String sql = "SELECT * FROM C_Invoice " + + "WHERE IsPaid='N' AND DocStatus IN ('CO','CL')"; + if (C_BPartner_ID > 1) + sql += " AND C_BPartner_ID=?"; + else + sql += " AND AD_Client_ID=" + Env.getAD_Client_ID(ctx); + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement (sql, trxName); + if (C_BPartner_ID > 1) + pstmt.setInt (1, C_BPartner_ID); + ResultSet rs = pstmt.executeQuery (); + while (rs.next ()) + { + MInvoice invoice = new MInvoice(ctx, rs, trxName); + if (invoice.testAllocation()) + if (invoice.save()) + counter++; + } + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + s_log.log(Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + s_log.config("#" + counter); + /**/ + } // setIsPaid + + /** + * Get Open Amount. + * Used by web interface + * @return Open Amt + */ + public BigDecimal getOpenAmt () + { + return getOpenAmt (true, null); + } // getOpenAmt + + /** + * Get Open Amount + * @param creditMemoAdjusted adjusted for CM (negative) + * @param paymentDate ignored Payment Date + * @return Open Amt + */ + public BigDecimal getOpenAmt (boolean creditMemoAdjusted, Timestamp paymentDate) + { + if (isPaid()) + return Env.ZERO; + // + if (m_openAmt == null) + { + m_openAmt = getGrandTotal(); + if (paymentDate != null) + { + // Payment Discount + // Payment Schedule + } + BigDecimal allocated = getAllocatedAmt(); + if (allocated != null) + { + allocated = allocated.abs(); // is absolute + m_openAmt = m_openAmt.subtract(allocated); + } + } + // + if (!creditMemoAdjusted) + return m_openAmt; + if (isCreditMemo()) + return m_openAmt.negate(); + return m_openAmt; + } // getOpenAmt + + + /** + * Get Document Status + * @return Document Status Clear Text + */ + public String getDocStatusName() + { + return MRefList.getListName(getCtx(), 131, getDocStatus()); + } // getDocStatusName + + + /************************************************************************** + * Create PDF + * @return File or null + */ + public File createPDF () + { + try + { + File temp = File.createTempFile(get_TableName()+get_ID()+"_", ".pdf"); + return createPDF (temp); + } + catch (Exception e) + { + log.severe("Could not create PDF - " + e.getMessage()); + } + return null; + } // getPDF + + /** + * Create PDF file + * @param file output file + * @return file if success + */ + public File createPDF (File file) + { + ReportEngine re = ReportEngine.get (getCtx(), ReportEngine.INVOICE, getC_Invoice_ID()); + if (re == null) + return null; + return re.getPDF(file); + } // createPDF + + /** + * Get PDF File Name + * @param documentDir directory + * @return file name + */ + public String getPDFFileName (String documentDir) + { + return getPDFFileName (documentDir, getC_Invoice_ID()); + } // getPDFFileName + + /** + * Get ISO Code of Currency + * @return Currency ISO + */ + public String getCurrencyISO() + { + return MCurrency.getISO_Code (getCtx(), getC_Currency_ID()); + } // getCurrencyISO + + /** + * Get Currency Precision + * @return precision + */ + public int getPrecision() + { + return MCurrency.getStdPrecision(getCtx(), getC_Currency_ID()); + } // getPrecision + + + /************************************************************************** + * Process document + * @param processAction document action + * @return true if performed + */ + public boolean processIt (String processAction) + { + m_processMsg = null; + DocumentEngine engine = new DocumentEngine (this, getDocStatus()); + return engine.processIt (processAction, getDocAction()); + } // process + + /** Process Message */ + private String m_processMsg = null; + /** Just Prepared Flag */ + private boolean m_justPrepared = false; + + /** + * Unlock Document. + * @return true if success + */ + public boolean unlockIt() + { + log.info("unlockIt - " + toString()); + setProcessing(false); + return true; + } // unlockIt + + /** + * Invalidate Document + * @return true if success + */ + public boolean invalidateIt() + { + log.info("invalidateIt - " + toString()); + setDocAction(DOCACTION_Prepare); + return true; + } // invalidateIt + + /** + * Prepare Document + * @return new status (In Progress or Invalid) + */ + public String prepareIt() + { + log.info(toString()); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_PREPARE); + if (m_processMsg != null) + return DocAction.STATUS_Invalid; + MDocType dt = MDocType.get(getCtx(), getC_DocTypeTarget_ID()); + + // Std Period open? + if (!MPeriod.isOpen(getCtx(), getDateAcct(), dt.getDocBaseType())) + { + m_processMsg = "@PeriodClosed@"; + return DocAction.STATUS_Invalid; + } + // Lines + MInvoiceLine[] lines = getLines(true); + if (lines.length == 0) + { + m_processMsg = "@NoLines@"; + return DocAction.STATUS_Invalid; + } + // No Cash Book + if (PAYMENTRULE_Cash.equals(getPaymentRule()) + && MCashBook.get(getCtx(), getAD_Org_ID(), getC_Currency_ID()) == null) + { + m_processMsg = "@NoCashBook@"; + return DocAction.STATUS_Invalid; + } + + // Convert/Check DocType + if (getC_DocType_ID() != getC_DocTypeTarget_ID() ) + setC_DocType_ID(getC_DocTypeTarget_ID()); + if (getC_DocType_ID() == 0) + { + m_processMsg = "No Document Type"; + return DocAction.STATUS_Invalid; + } + + explodeBOM(); + if (!calculateTaxTotal()) // setTotals + { + m_processMsg = "Error calculating Tax"; + return DocAction.STATUS_Invalid; + } + + createPaySchedule(); + + // Credit Status + if (isSOTrx() && !isReversal()) + { + MBPartner bp = new MBPartner (getCtx(), getC_BPartner_ID(), null); + if (MBPartner.SOCREDITSTATUS_CreditStop.equals(bp.getSOCreditStatus())) + { + m_processMsg = "@BPartnerCreditStop@ - @TotalOpenBalance@=" + + bp.getTotalOpenBalance() + + ", @SO_CreditLimit@=" + bp.getSO_CreditLimit(); + return DocAction.STATUS_Invalid; + } + } + + // Landed Costs + if (!isSOTrx()) + { + for (int i = 0; i < lines.length; i++) + { + MInvoiceLine line = lines[i]; + String error = line.allocateLandedCosts(); + if (error != null && error.length() > 0) + { + m_processMsg = error; + return DocAction.STATUS_Invalid; + } + } + } + + m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_PREPARE); + if (m_processMsg != null) + return DocAction.STATUS_Invalid; + + // Add up Amounts + m_justPrepared = true; + if (!DOCACTION_Complete.equals(getDocAction())) + setDocAction(DOCACTION_Complete); + return DocAction.STATUS_InProgress; + } // prepareIt + + /** + * Explode non stocked BOM. + */ + private void explodeBOM () + { + String where = "AND IsActive='Y' AND EXISTS " + + "(SELECT * FROM M_Product p WHERE C_InvoiceLine.M_Product_ID=p.M_Product_ID" + + " AND p.IsBOM='Y' AND p.IsVerified='Y' AND p.IsStocked='N')"; + // + String sql = "SELECT COUNT(*) FROM C_InvoiceLine " + + "WHERE C_Invoice_ID=? " + where; + int count = DB.getSQLValue(get_TrxName(), sql, getC_Invoice_ID()); + while (count != 0) + { + renumberLines (100); + + // Order Lines with non-stocked BOMs + MInvoiceLine[] lines = getLines (where); + for (int i = 0; i < lines.length; i++) + { + MInvoiceLine line = lines[i]; + MProduct product = MProduct.get (getCtx(), line.getM_Product_ID()); + log.fine(product.getName()); + // New Lines + int lineNo = line.getLine (); + MProductBOM[] boms = MProductBOM.getBOMLines (product); + for (int j = 0; j < boms.length; j++) + { + MProductBOM bom = boms[j]; + MInvoiceLine newLine = new MInvoiceLine (this); + newLine.setLine (++lineNo); + newLine.setM_Product_ID (bom.getProduct().getM_Product_ID(), + bom.getProduct().getC_UOM_ID()); + newLine.setQty (line.getQtyInvoiced().multiply( + bom.getBOMQty ())); // Invoiced/Entered + if (bom.getDescription () != null) + newLine.setDescription (bom.getDescription ()); + // + newLine.setPrice (); + newLine.save (get_TrxName()); + } + // Convert into Comment Line + line.setM_Product_ID (0); + line.setM_AttributeSetInstance_ID (0); + line.setPriceEntered (Env.ZERO); + line.setPriceActual (Env.ZERO); + line.setPriceLimit (Env.ZERO); + line.setPriceList (Env.ZERO); + line.setLineNetAmt (Env.ZERO); + // + String description = product.getName (); + if (product.getDescription () != null) + description += " " + product.getDescription (); + if (line.getDescription () != null) + description += " " + line.getDescription (); + line.setDescription (description); + line.save (get_TrxName()); + } // for all lines with BOM + + m_lines = null; + count = DB.getSQLValue (get_TrxName(), sql, getC_Invoice_ID ()); + renumberLines (10); + } // while count != 0 + } // explodeBOM + + /** + * Calculate Tax and Total + * @return true if calculated + */ + private boolean calculateTaxTotal() + { + log.fine(""); + // Delete Taxes + DB.executeUpdate("DELETE C_InvoiceTax WHERE C_Invoice_ID=" + getC_Invoice_ID(), get_TrxName()); + m_taxes = null; + + // Lines + BigDecimal totalLines = Env.ZERO; + ArrayList taxList = new ArrayList(); + MInvoiceLine[] lines = getLines(false); + for (int i = 0; i < lines.length; i++) + { + MInvoiceLine line = lines[i]; + /** Sync ownership for SO + if (isSOTrx() && line.getAD_Org_ID() != getAD_Org_ID()) + { + line.setAD_Org_ID(getAD_Org_ID()); + line.save(); + } **/ + Integer taxID = new Integer(line.getC_Tax_ID()); + if (!taxList.contains(taxID)) + { + MInvoiceTax iTax = MInvoiceTax.get (line, getPrecision(), + false, get_TrxName()); // current Tax + if (iTax != null) + { + iTax.setIsTaxIncluded(isTaxIncluded()); + if (!iTax.calculateTaxFromLines()) + return false; + if (!iTax.save()) + return false; + taxList.add(taxID); + } + } + totalLines = totalLines.add(line.getLineNetAmt()); + } + + // Taxes + BigDecimal grandTotal = totalLines; + MInvoiceTax[] taxes = getTaxes(true); + for (int i = 0; i < taxes.length; i++) + { + MInvoiceTax iTax = taxes[i]; + MTax tax = iTax.getTax(); + if (tax.isSummary()) + { + MTax[] cTaxes = tax.getChildTaxes(false); // Multiple taxes + for (int j = 0; j < cTaxes.length; j++) + { + MTax cTax = cTaxes[j]; + BigDecimal taxAmt = cTax.calculateTax(iTax.getTaxBaseAmt(), isTaxIncluded(), getPrecision()); + // + MInvoiceTax newITax = new MInvoiceTax(getCtx(), 0, get_TrxName()); + newITax.setClientOrg(this); + newITax.setC_Invoice_ID(getC_Invoice_ID()); + newITax.setC_Tax_ID(cTax.getC_Tax_ID()); + newITax.setPrecision(getPrecision()); + newITax.setIsTaxIncluded(isTaxIncluded()); + newITax.setTaxBaseAmt(iTax.getTaxBaseAmt()); + newITax.setTaxAmt(taxAmt); + if (!newITax.save(get_TrxName())) + return false; + // + if (!isTaxIncluded()) + grandTotal = grandTotal.add(taxAmt); + } + if (!iTax.delete(true, get_TrxName())) + return false; + } + else + { + if (!isTaxIncluded()) + grandTotal = grandTotal.add(iTax.getTaxAmt()); + } + } + // + setTotalLines(totalLines); + setGrandTotal(grandTotal); + return true; + } // calculateTaxTotal + + + /** + * (Re) Create Pay Schedule + * @return true if valid schedule + */ + private boolean createPaySchedule() + { + if (getC_PaymentTerm_ID() == 0) + return false; + MPaymentTerm pt = new MPaymentTerm(getCtx(), getC_PaymentTerm_ID(), null); + log.fine(pt.toString()); + return pt.apply(this); // calls validate pay schedule + } // createPaySchedule + + + /** + * Approve Document + * @return true if success + */ + public boolean approveIt() + { + log.info(toString()); + setIsApproved(true); + return true; + } // approveIt + + /** + * Reject Approval + * @return true if success + */ + public boolean rejectIt() + { + log.info(toString()); + setIsApproved(false); + return true; + } // rejectIt + + /** + * Complete Document + * @return new status (Complete, In Progress, Invalid, Waiting ..) + */ + public String completeIt() + { + // Re-Check + if (!m_justPrepared) + { + String status = prepareIt(); + if (!DocAction.STATUS_InProgress.equals(status)) + return status; + } + + m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_COMPLETE); + if (m_processMsg != null) + return DocAction.STATUS_Invalid; + + // Implicit Approval + if (!isApproved()) + approveIt(); + log.info(toString()); + StringBuffer info = new StringBuffer(); + + //Modifications for cash payment + /* + // Create Cash + if (PAYMENTRULE_Cash.equals(getPaymentRule())) + { + // Modifications for POSterita + // + // MCash cash = MCash.get (getCtx(), getAD_Org_ID(), + // getDateInvoiced(), getC_Currency_ID(), get_TrxName()); + + MCash cash; + + int posId = Env.getContextAsInt(getCtx(),Env.POS_ID); + + if (posId != 0) + { + MPOSTerminal terminal = new MPOSTerminal(getCtx(), posId, get_TrxName()); // Posterita Terminal changes + int cashBookId = terminal.getC_CashBook_ID(); + cash = MCash.get(getCtx(), cashBookId, getDateInvoiced(), get_TrxName()); + } + else + { + cash = MCash.get (getCtx(), getAD_Org_ID(), + getDateInvoiced(), getC_Currency_ID(), get_TrxName()); + } + + // End Posterita Modifications + + if (cash == null || cash.get_ID() == 0) + { + m_processMsg = "@NoCashBook@"; + return DocAction.STATUS_Invalid; + } + MCashLine cl = new MCashLine (cash); + cl.setInvoice(this); + if (!cl.save(get_TrxName())) + { + m_processMsg = "Could not save Cash Journal Line"; + return DocAction.STATUS_Invalid; + } + info.append("@C_Cash_ID@: " + cash.getName() + " #" + cl.getLine()); + setC_CashLine_ID(cl.getC_CashLine_ID()); + } // CashBook + */ + + // Update Order & Match + int matchInv = 0; + int matchPO = 0; + MInvoiceLine[] lines = getLines(false); + for (int i = 0; i < lines.length; i++) + { + MInvoiceLine line = lines[i]; + + // Update Order Line + MOrderLine ol = null; + if (line.getC_OrderLine_ID() != 0) + { + if (isSOTrx() + || line.getM_Product_ID() == 0) + { + ol = new MOrderLine (getCtx(), line.getC_OrderLine_ID(), get_TrxName()); + if (line.getQtyInvoiced() != null) + ol.setQtyInvoiced(ol.getQtyInvoiced().add(line.getQtyInvoiced())); + if (!ol.save(get_TrxName())) + { + m_processMsg = "Could not update Order Line"; + return DocAction.STATUS_Invalid; + } + } + // Order Invoiced Qty updated via Matching Inv-PO + else if (!isSOTrx() + && line.getM_Product_ID() != 0 + && !isReversal()) + { + // MatchPO is created also from MInOut when Invoice exists before Shipment + BigDecimal matchQty = line.getQtyInvoiced(); + MMatchPO po = MMatchPO.create (line, null, + getDateInvoiced(), matchQty); + if (!po.save(get_TrxName())) + { + m_processMsg = "Could not create PO Matching"; + return DocAction.STATUS_Invalid; + } + else + matchPO++; + } + } + + // Matching - Inv-Shipment + if (!isSOTrx() + && line.getM_InOutLine_ID() != 0 + && line.getM_Product_ID() != 0 + && !isReversal()) + { + MInOutLine receiptLine = new MInOutLine (getCtx(),line.getM_InOutLine_ID(), get_TrxName()); + BigDecimal matchQty = line.getQtyInvoiced(); + + if (receiptLine.getMovementQty().compareTo(matchQty) < 0) + matchQty = receiptLine.getMovementQty(); + + MMatchInv inv = new MMatchInv(line, getDateInvoiced(), matchQty); + if (!inv.save(get_TrxName())) + { + m_processMsg = "Could not create Invoice Matching"; + return DocAction.STATUS_Invalid; + } + else + matchInv++; + } + } // for all lines + if (matchInv > 0) + info.append(" @M_MatchInv_ID@#").append(matchInv).append(" "); + if (matchPO > 0) + info.append(" @M_MatchPO_ID@#").append(matchPO).append(" "); + + + + // Update BP Statistics + MBPartner bp = new MBPartner (getCtx(), getC_BPartner_ID(), get_TrxName()); + // Update total revenue and balance / credit limit (reversed on AllocationLine.processIt) + BigDecimal invAmt = MConversionRate.convertBase(getCtx(), getGrandTotal(true), // CM adjusted + getC_Currency_ID(), getDateAcct(), 0, getAD_Client_ID(), getAD_Org_ID()); + if (invAmt == null) + { + m_processMsg = "Could not convert C_Currency_ID=" + getC_Currency_ID() + + " to base C_Currency_ID=" + MClient.get(Env.getCtx()).getC_Currency_ID(); + return DocAction.STATUS_Invalid; + } + // Total Balance + BigDecimal newBalance = bp.getTotalOpenBalance(false); + if (newBalance == null) + newBalance = Env.ZERO; + if (isSOTrx()) + { + newBalance = newBalance.add(invAmt); + // + if (bp.getFirstSale() == null) + bp.setFirstSale(getDateInvoiced()); + BigDecimal newLifeAmt = bp.getActualLifeTimeValue(); + if (newLifeAmt == null) + newLifeAmt = invAmt; + else + newLifeAmt = newLifeAmt.add(invAmt); + BigDecimal newCreditAmt = bp.getSO_CreditUsed(); + if (newCreditAmt == null) + newCreditAmt = invAmt; + else + newCreditAmt = newCreditAmt.add(invAmt); + // + log.fine("GrandTotal=" + getGrandTotal(true) + "(" + invAmt + + ") BP Life=" + bp.getActualLifeTimeValue() + "->" + newLifeAmt + + ", Credit=" + bp.getSO_CreditUsed() + "->" + newCreditAmt + + ", Balance=" + bp.getTotalOpenBalance(false) + " -> " + newBalance); + bp.setActualLifeTimeValue(newLifeAmt); + bp.setSO_CreditUsed(newCreditAmt); + } // SO + else + { + newBalance = newBalance.subtract(invAmt); + log.fine("GrandTotal=" + getGrandTotal(true) + "(" + invAmt + + ") Balance=" + bp.getTotalOpenBalance(false) + " -> " + newBalance); + } + bp.setTotalOpenBalance(newBalance); + bp.setSOCreditStatus(); + if (!bp.save(get_TrxName())) + { + m_processMsg = "Could not update Business Partner"; + return DocAction.STATUS_Invalid; + } + + // User - Last Result/Contact + if (getAD_User_ID() != 0) + { + MUser user = new MUser (getCtx(), getAD_User_ID(), get_TrxName()); + user.setLastContact(new Timestamp(System.currentTimeMillis())); + user.setLastResult(Msg.translate(getCtx(), "C_Invoice_ID") + ": " + getDocumentNo()); + if (!user.save(get_TrxName())) + { + m_processMsg = "Could not update Business Partner User"; + return DocAction.STATUS_Invalid; + } + } // user + + // Update Project + if (isSOTrx() && getC_Project_ID() != 0) + { + MProject project = new MProject (getCtx(), getC_Project_ID(), get_TrxName()); + BigDecimal amt = getGrandTotal(true); + int C_CurrencyTo_ID = project.getC_Currency_ID(); + if (C_CurrencyTo_ID != getC_Currency_ID()) + amt = MConversionRate.convert(getCtx(), amt, getC_Currency_ID(), C_CurrencyTo_ID, + getDateAcct(), 0, getAD_Client_ID(), getAD_Org_ID()); + if (amt == null) + { + m_processMsg = "Could not convert C_Currency_ID=" + getC_Currency_ID() + + " to Project C_Currency_ID=" + C_CurrencyTo_ID; + return DocAction.STATUS_Invalid; + } + BigDecimal newAmt = project.getInvoicedAmt(); + if (newAmt == null) + newAmt = amt; + else + newAmt = newAmt.add(amt); + log.fine("GrandTotal=" + getGrandTotal(true) + "(" + amt + + ") Project " + project.getName() + + " - Invoiced=" + project.getInvoicedAmt() + "->" + newAmt); + project.setInvoicedAmt(newAmt); + if (!project.save(get_TrxName())) + { + m_processMsg = "Could not update Project"; + return DocAction.STATUS_Invalid; + } + } // project + + // User Validation + String valid = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_COMPLETE); + if (valid != null) + { + m_processMsg = valid; + return DocAction.STATUS_Invalid; + } + + // Set the definite document number after completed (if needed) + setDefiniteDocumentNo(); + + // Counter Documents + MInvoice counter = createCounterDoc(); + if (counter != null) + info.append(" - @CounterDoc@: @C_Invoice_ID@=").append(counter.getDocumentNo()); + + m_processMsg = info.toString().trim(); + setProcessed(true); + setDocAction(DOCACTION_Close); + return DocAction.STATUS_Completed; + } // completeIt + + /** + * Set the definite document number after completed + */ + private void setDefiniteDocumentNo() { + MDocType dt = MDocType.get(getCtx(), getC_DocType_ID()); + if (dt.isOverwriteDateOnComplete()) { + setDateInvoiced(new Timestamp (System.currentTimeMillis())); + } + if (dt.isOverwriteSeqOnComplete()) { + String value = DB.getDocumentNo(getC_DocType_ID(), get_TrxName(), true, this); + if (value != null) + setDocumentNo(value); + } + } + + /** + * Create Counter Document + * @return counter invoice + */ + private MInvoice createCounterDoc() + { + // Is this a counter doc ? + if (getRef_Invoice_ID() != 0) + return null; + + // Org Must be linked to BPartner + MOrg org = MOrg.get(getCtx(), getAD_Org_ID()); + int counterC_BPartner_ID = org.getLinkedC_BPartner_ID(get_TrxName()); + if (counterC_BPartner_ID == 0) + return null; + // Business Partner needs to be linked to Org + MBPartner bp = new MBPartner (getCtx(), getC_BPartner_ID(), null); + int counterAD_Org_ID = bp.getAD_OrgBP_ID_Int(); + if (counterAD_Org_ID == 0) + return null; + + MBPartner counterBP = new MBPartner (getCtx(), counterC_BPartner_ID, null); + MOrgInfo counterOrgInfo = MOrgInfo.get(getCtx(), counterAD_Org_ID); + log.info("Counter BP=" + counterBP.getName()); + + // Document Type + int C_DocTypeTarget_ID = 0; + MDocTypeCounter counterDT = MDocTypeCounter.getCounterDocType(getCtx(), getC_DocType_ID()); + if (counterDT != null) + { + log.fine(counterDT.toString()); + if (!counterDT.isCreateCounter() || !counterDT.isValid()) + return null; + C_DocTypeTarget_ID = counterDT.getCounter_C_DocType_ID(); + } + else // indirect + { + C_DocTypeTarget_ID = MDocTypeCounter.getCounterDocType_ID(getCtx(), getC_DocType_ID()); + log.fine("Indirect C_DocTypeTarget_ID=" + C_DocTypeTarget_ID); + if (C_DocTypeTarget_ID <= 0) + return null; + } + + // Deep Copy + MInvoice counter = copyFrom(this, getDateInvoiced(), + C_DocTypeTarget_ID, !isSOTrx(), true, get_TrxName(), true); + // + counter.setAD_Org_ID(counterAD_Org_ID); + // counter.setM_Warehouse_ID(counterOrgInfo.getM_Warehouse_ID()); + // + counter.setBPartner(counterBP); + // Refernces (Should not be required + counter.setSalesRep_ID(getSalesRep_ID()); + counter.save(get_TrxName()); + + // Update copied lines + MInvoiceLine[] counterLines = counter.getLines(true); + for (int i = 0; i < counterLines.length; i++) + { + MInvoiceLine counterLine = counterLines[i]; + counterLine.setClientOrg(counter); + counterLine.setInvoice(counter); // copies header values (BP, etc.) + counterLine.setPrice(); + counterLine.setTax(); + // + counterLine.save(get_TrxName()); + } + + log.fine(counter.toString()); + + // Document Action + if (counterDT != null) + { + if (counterDT.getDocAction() != null) + { + counter.setDocAction(counterDT.getDocAction()); + counter.processIt(counterDT.getDocAction()); + counter.save(get_TrxName()); + } + } + return counter; + } // createCounterDoc + + /** + * Void Document. + * @return true if success + */ + public boolean voidIt() + { + log.info(toString()); + // Before Void + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_VOID); + if (m_processMsg != null) + return false; + + if (DOCSTATUS_Closed.equals(getDocStatus()) + || DOCSTATUS_Reversed.equals(getDocStatus()) + || DOCSTATUS_Voided.equals(getDocStatus())) + { + m_processMsg = "Document Closed: " + getDocStatus(); + setDocAction(DOCACTION_None); + return false; + } + + // Not Processed + if (DOCSTATUS_Drafted.equals(getDocStatus()) + || DOCSTATUS_Invalid.equals(getDocStatus()) + || DOCSTATUS_InProgress.equals(getDocStatus()) + || DOCSTATUS_Approved.equals(getDocStatus()) + || DOCSTATUS_NotApproved.equals(getDocStatus()) ) + { + // Set lines to 0 + MInvoiceLine[] lines = getLines(false); + for (int i = 0; i < lines.length; i++) + { + MInvoiceLine line = lines[i]; + BigDecimal old = line.getQtyInvoiced(); + if (old.compareTo(Env.ZERO) != 0) + { + line.setQty(Env.ZERO); + line.setTaxAmt(Env.ZERO); + line.setLineNetAmt(Env.ZERO); + line.setLineTotalAmt(Env.ZERO); + line.addDescription(Msg.getMsg(getCtx(), "Voided") + " (" + old + ")"); + // Unlink Shipment + if (line.getM_InOutLine_ID() != 0) + { + MInOutLine ioLine = new MInOutLine(getCtx(), line.getM_InOutLine_ID(), get_TrxName()); + ioLine.setIsInvoiced(false); + ioLine.save(get_TrxName()); + line.setM_InOutLine_ID(0); + } + line.save(get_TrxName()); + } + } + addDescription(Msg.getMsg(getCtx(), "Voided")); + setIsPaid(true); + setC_Payment_ID(0); + } + else + { + return reverseCorrectIt(); + } + + // After Void + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_VOID); + if (m_processMsg != null) + return false; + + setProcessed(true); + setDocAction(DOCACTION_None); + return true; + } // voidIt + + /** + * Close Document. + * @return true if success + */ + public boolean closeIt() + { + log.info(toString()); + // Before Close + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_CLOSE); + if (m_processMsg != null) + return false; + + // After Close + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_CLOSE); + if (m_processMsg != null) + return false; + + setProcessed(true); + setDocAction(DOCACTION_None); + return true; + } // closeIt + + /** + * Reverse Correction - same date + * @return true if success + */ + public boolean reverseCorrectIt() + { + log.info(toString()); + // Before reverseCorrect + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSECORRECT); + if (m_processMsg != null) + return false; + + MDocType dt = MDocType.get(getCtx(), getC_DocType_ID()); + if (!MPeriod.isOpen(getCtx(), getDateAcct(), dt.getDocBaseType())) + { + m_processMsg = "@PeriodClosed@"; + return false; + } + // + MAllocationHdr[] allocations = MAllocationHdr.getOfInvoice(getCtx(), + getC_Invoice_ID(), get_TrxName()); + for (int i = 0; i < allocations.length; i++) + { + allocations[i].setDocAction(DocAction.ACTION_Reverse_Correct); + allocations[i].reverseCorrectIt(); + allocations[i].save(get_TrxName()); + } + // Reverse/Delete Matching + if (!isSOTrx()) + { + MMatchInv[] mInv = MMatchInv.getInvoice(getCtx(), getC_Invoice_ID(), get_TrxName()); + for (int i = 0; i < mInv.length; i++) + mInv[i].delete(true); + MMatchPO[] mPO = MMatchPO.getInvoice(getCtx(), getC_Invoice_ID(), get_TrxName()); + for (int i = 0; i < mPO.length; i++) + { + if (mPO[i].getM_InOutLine_ID() == 0) + mPO[i].delete(true); + else + { + mPO[i].setC_InvoiceLine_ID(null); + mPO[i].save(get_TrxName()); + } + } + } + // + load(get_TrxName()); // reload allocation reversal info + + // Deep Copy + MInvoice reversal = copyFrom (this, getDateInvoiced(), + getC_DocType_ID(), isSOTrx(), false, get_TrxName(), true); + if (reversal == null) + { + m_processMsg = "Could not create Invoice Reversal"; + return false; + } + reversal.setReversal(true); + + // Reverse Line Qty + MInvoiceLine[] rLines = reversal.getLines(false); + for (int i = 0; i < rLines.length; i++) + { + MInvoiceLine rLine = rLines[i]; + rLine.setQtyEntered(rLine.getQtyEntered().negate()); + rLine.setQtyInvoiced(rLine.getQtyInvoiced().negate()); + rLine.setLineNetAmt(rLine.getLineNetAmt().negate()); + if (rLine.getTaxAmt() != null && rLine.getTaxAmt().compareTo(Env.ZERO) != 0) + rLine.setTaxAmt(rLine.getTaxAmt().negate()); + if (rLine.getLineTotalAmt() != null && rLine.getLineTotalAmt().compareTo(Env.ZERO) != 0) + rLine.setLineTotalAmt(rLine.getLineTotalAmt().negate()); + if (!rLine.save(get_TrxName())) + { + m_processMsg = "Could not correct Invoice Reversal Line"; + return false; + } + } + reversal.setC_Order_ID(getC_Order_ID()); + reversal.addDescription("{->" + getDocumentNo() + ")"); + // + if (!reversal.processIt(DocAction.ACTION_Complete)) + { + m_processMsg = "Reversal ERROR: " + reversal.getProcessMsg(); + return false; + } + reversal.setC_Payment_ID(0); + reversal.setIsPaid(true); + reversal.closeIt(); + reversal.setProcessing (false); + reversal.setDocStatus(DOCSTATUS_Reversed); + reversal.setDocAction(DOCACTION_None); + reversal.save(get_TrxName()); + m_processMsg = reversal.getDocumentNo(); + // + addDescription("(" + reversal.getDocumentNo() + "<-)"); + + // Clean up Reversed (this) + MInvoiceLine[] iLines = getLines(false); + for (int i = 0; i < iLines.length; i++) + { + MInvoiceLine iLine = iLines[i]; + if (iLine.getM_InOutLine_ID() != 0) + { + MInOutLine ioLine = new MInOutLine(getCtx(), iLine.getM_InOutLine_ID(), get_TrxName()); + ioLine.setIsInvoiced(false); + ioLine.save(get_TrxName()); + // Reconsiliation + iLine.setM_InOutLine_ID(0); + iLine.save(get_TrxName()); + } + } + setProcessed(true); + setDocStatus(DOCSTATUS_Reversed); // may come from void + setDocAction(DOCACTION_None); + setC_Payment_ID(0); + setIsPaid(true); + + // Create Allocation + MAllocationHdr alloc = new MAllocationHdr(getCtx(), false, getDateAcct(), + getC_Currency_ID(), + Msg.translate(getCtx(), "C_Invoice_ID") + ": " + getDocumentNo() + "/" + reversal.getDocumentNo(), + get_TrxName()); + alloc.setAD_Org_ID(getAD_Org_ID()); + if (alloc.save()) + { + // Amount + BigDecimal gt = getGrandTotal(true); + if (!isSOTrx()) + gt = gt.negate(); + // Orig Line + MAllocationLine aLine = new MAllocationLine (alloc, gt, + Env.ZERO, Env.ZERO, Env.ZERO); + aLine.setC_Invoice_ID(getC_Invoice_ID()); + aLine.save(); + // Reversal Line + MAllocationLine rLine = new MAllocationLine (alloc, gt.negate(), + Env.ZERO, Env.ZERO, Env.ZERO); + rLine.setC_Invoice_ID(reversal.getC_Invoice_ID()); + rLine.save(); + // Process It + if (alloc.processIt(DocAction.ACTION_Complete)) + alloc.save(); + } + + //MZ Goodwill + if (!isSOTrx()) + { + // delete Matched Invoice Cost Detail + MInvoiceLine[] lines = getLines(); + for (int i = 0; i < lines.length; i++) + { + MCostDetail cd = MCostDetail.get (getCtx(), "C_InvoiceLine_ID=? AND M_AttributeSetInstance_ID=?", + lines[i].getC_InvoiceLine_ID(), lines[i].getM_AttributeSetInstance_ID(), get_TrxName()); + if (cd != null) + { + cd.setProcessed(false); + cd.delete(true); + } + } + } + //End MZ + // After reverseCorrect + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSECORRECT); + if (m_processMsg != null) + return false; + + return true; + } // reverseCorrectIt + + /** + * Reverse Accrual - none + * @return false + */ + public boolean reverseAccrualIt() + { + log.info(toString()); + // Before reverseAccrual + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSEACCRUAL); + if (m_processMsg != null) + return false; + + // After reverseAccrual + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSEACCRUAL); + if (m_processMsg != null) + return false; + + return false; + } // reverseAccrualIt + + /** + * Re-activate + * @return false + */ + public boolean reActivateIt() + { + log.info(toString()); + // Before reActivate + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REACTIVATE); + if (m_processMsg != null) + return false; + + // After reActivate + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REACTIVATE); + if (m_processMsg != null) + return false; + + + return false; + } // reActivateIt + + + /************************************************************************* + * Get Summary + * @return Summary of Document + */ + public String getSummary() + { + StringBuffer sb = new StringBuffer(); + sb.append(getDocumentNo()); + // : Grand Total = 123.00 (#1) + sb.append(": "). + append(Msg.translate(getCtx(),"GrandTotal")).append("=").append(getGrandTotal()) + .append(" (#").append(getLines(false).length).append(")"); + // - Description + if (getDescription() != null && getDescription().length() > 0) + sb.append(" - ").append(getDescription()); + return sb.toString(); + } // getSummary + + /** + * Get Process Message + * @return clear text error message + */ + public String getProcessMsg() + { + return m_processMsg; + } // getProcessMsg + + /** + * Get Document Owner (Responsible) + * @return AD_User_ID + */ + public int getDoc_User_ID() + { + return getSalesRep_ID(); + } // getDoc_User_ID + + /** + * Get Document Approval Amount + * @return amount + */ + public BigDecimal getApprovalAmt() + { + return getGrandTotal(); + } // getApprovalAmt + + /** + * + * @param rma + */ + public void setRMA(MRMA rma) + { + setM_RMA_ID(rma.getM_RMA_ID()); + setAD_Org_ID(rma.getAD_Org_ID()); + setDescription(rma.getDescription()); + setC_BPartner_ID(rma.getC_BPartner_ID()); + setSalesRep_ID(rma.getSalesRep_ID()); + + setGrandTotal(rma.getAmt()); + setIsSOTrx(rma.isSOTrx()); + setTotalLines(rma.getAmt()); + + MInvoice originalInvoice = rma.getOriginalInvoice(); + + if (originalInvoice == null) + { + throw new IllegalStateException("Not invoiced - RMA: " + rma.getDocumentNo()); + } + + setC_BPartner_Location_ID(originalInvoice.getC_BPartner_Location_ID()); + setAD_User_ID(originalInvoice.getAD_User_ID()); + setC_Currency_ID(originalInvoice.getC_Currency_ID()); + setIsTaxIncluded(originalInvoice.isTaxIncluded()); + setM_PriceList_ID(originalInvoice.getM_PriceList_ID()); + setC_Project_ID(originalInvoice.getC_Project_ID()); + setC_Activity_ID(originalInvoice.getC_Activity_ID()); + setC_Campaign_ID(originalInvoice.getC_Campaign_ID()); + setUser1_ID(originalInvoice.getUser1_ID()); + setUser2_ID(originalInvoice.getUser2_ID()); + } + +} // MInvoice diff --git a/posterita/posterita/src/main/org/compiere/model/MOrder.java b/posterita/posterita/src/main/org/compiere/model/MOrder.java new file mode 100644 index 0000000000..a92f1f3adb --- /dev/null +++ b/posterita/posterita/src/main/org/compiere/model/MOrder.java @@ -0,0 +1,2330 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program 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 General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.io.File; +import java.math.BigDecimal; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.Properties; +import java.util.logging.Level; + +import org.compiere.print.ReportEngine; +import org.compiere.process.DocAction; +import org.compiere.process.DocumentEngine; +import org.compiere.util.DB; +import org.compiere.util.Env; +import org.compiere.util.Msg; + +/** + * Order Model. + * Please do not set DocStatus and C_DocType_ID directly. + * They are set in the process() method. + * Use DocAction and C_DocTypeTarget_ID instead. + * + * @author Jorg Janke + * @version $Id: MOrder.java,v 1.5 2006/10/06 00:42:24 jjanke Exp $ + */ +public class MOrder extends X_C_Order implements DocAction +{ + /** + * Create new Order by copying + * @param from order + * @param dateDoc date of the document date + * @param C_DocTypeTarget_ID target document type + * @param isSOTrx sales order + * @param counter create counter links + * @param copyASI copy line attributes Attribute Set Instance, Resaouce Assignment + * @param trxName trx + * @return Order + */ + public static MOrder copyFrom (MOrder from, Timestamp dateDoc, + int C_DocTypeTarget_ID, boolean isSOTrx, boolean counter, boolean copyASI, + String trxName) + { + MOrder to = new MOrder (from.getCtx(), 0, trxName); + to.set_TrxName(trxName); + PO.copyValues(from, to, from.getAD_Client_ID(), from.getAD_Org_ID()); + to.set_ValueNoCheck ("C_Order_ID", I_ZERO); + to.set_ValueNoCheck ("DocumentNo", null); + // + to.setDocStatus (DOCSTATUS_Drafted); // Draft + to.setDocAction(DOCACTION_Complete); + // + to.setC_DocType_ID(0); + to.setC_DocTypeTarget_ID (C_DocTypeTarget_ID); + to.setIsSOTrx(isSOTrx); + // + to.setIsSelected (false); + to.setDateOrdered (dateDoc); + to.setDateAcct (dateDoc); + to.setDatePromised (dateDoc); // assumption + to.setDatePrinted(null); + to.setIsPrinted (false); + // + to.setIsApproved (false); + to.setIsCreditApproved(false); + to.setC_Payment_ID(0); + to.setC_CashLine_ID(0); + // Amounts are updated when adding lines + to.setGrandTotal(Env.ZERO); + to.setTotalLines(Env.ZERO); + // + to.setIsDelivered(false); + to.setIsInvoiced(false); + to.setIsSelfService(false); + to.setIsTransferred (false); + to.setPosted (false); + to.setProcessed (false); + if (counter) + to.setRef_Order_ID(from.getC_Order_ID()); + else + to.setRef_Order_ID(0); + // + if (!to.save(trxName)) + throw new IllegalStateException("Could not create Order"); + if (counter) + from.setRef_Order_ID(to.getC_Order_ID()); + + if (to.copyLinesFrom(from, counter, copyASI) == 0) + throw new IllegalStateException("Could not create Order Lines"); + + return to; + } // copyFrom + + + /************************************************************************** + * Default Constructor + * @param ctx context + * @param C_Order_ID order to load, (0 create new order) + * @param trxName trx name + */ + public MOrder(Properties ctx, int C_Order_ID, String trxName) + { + super (ctx, C_Order_ID, trxName); + // New + if (C_Order_ID == 0) + { + setDocStatus(DOCSTATUS_Drafted); + setDocAction (DOCACTION_Prepare); + // + setDeliveryRule (DELIVERYRULE_Availability); + setFreightCostRule (FREIGHTCOSTRULE_FreightIncluded); + setInvoiceRule (INVOICERULE_Immediate); + setPaymentRule(PAYMENTRULE_OnCredit); + setPriorityRule (PRIORITYRULE_Medium); + setDeliveryViaRule (DELIVERYVIARULE_Pickup); + // + setIsDiscountPrinted (false); + setIsSelected (false); + setIsTaxIncluded (false); + setIsSOTrx (true); + setIsDropShip(false); + setSendEMail (false); + // + setIsApproved(false); + setIsPrinted(false); + setIsCreditApproved(false); + setIsDelivered(false); + setIsInvoiced(false); + setIsTransferred(false); + setIsSelfService(false); + // + super.setProcessed(false); + setProcessing(false); + setPosted(false); + + setDateAcct (new Timestamp(System.currentTimeMillis())); + setDatePromised (new Timestamp(System.currentTimeMillis())); + setDateOrdered (new Timestamp(System.currentTimeMillis())); + + setFreightAmt (Env.ZERO); + setChargeAmt (Env.ZERO); + setTotalLines (Env.ZERO); + setGrandTotal (Env.ZERO); + } + } // MOrder + + /************************************************************************** + * Project Constructor + * @param project Project to create Order from + * @param IsSOTrx sales order + * @param DocSubTypeSO if SO DocType Target (default DocSubTypeSO_OnCredit) + */ + public MOrder (MProject project, boolean IsSOTrx, String DocSubTypeSO) + { + this (project.getCtx(), 0, project.get_TrxName()); + setAD_Client_ID(project.getAD_Client_ID()); + setAD_Org_ID(project.getAD_Org_ID()); + setC_Campaign_ID(project.getC_Campaign_ID()); + setSalesRep_ID(project.getSalesRep_ID()); + // + setC_Project_ID(project.getC_Project_ID()); + setDescription(project.getName()); + Timestamp ts = project.getDateContract(); + if (ts != null) + setDateOrdered (ts); + ts = project.getDateFinish(); + if (ts != null) + setDatePromised (ts); + // + setC_BPartner_ID(project.getC_BPartner_ID()); + setC_BPartner_Location_ID(project.getC_BPartner_Location_ID()); + setAD_User_ID(project.getAD_User_ID()); + // + setM_Warehouse_ID(project.getM_Warehouse_ID()); + setM_PriceList_ID(project.getM_PriceList_ID()); + setC_PaymentTerm_ID(project.getC_PaymentTerm_ID()); + // + setIsSOTrx(IsSOTrx); + if (IsSOTrx) + { + if (DocSubTypeSO == null || DocSubTypeSO.length() == 0) + setC_DocTypeTarget_ID(DocSubTypeSO_OnCredit); + else + setC_DocTypeTarget_ID(DocSubTypeSO); + } + else + setC_DocTypeTarget_ID(); + } // MOrder + + /** + * Load Constructor + * @param ctx context + * @param rs result set record + * @param trxName transaction + */ + public MOrder (Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } // MOrder + + /** Order Lines */ + private MOrderLine[] m_lines = null; + /** Tax Lines */ + private MOrderTax[] m_taxes = null; + /** Force Creation of order */ + private boolean m_forceCreation = false; + + /** + * Overwrite Client/Org if required + * @param AD_Client_ID client + * @param AD_Org_ID org + */ + public void setClientOrg (int AD_Client_ID, int AD_Org_ID) + { + super.setClientOrg(AD_Client_ID, AD_Org_ID); + } // setClientOrg + + + /** + * Add to Description + * @param description text + */ + public void addDescription (String description) + { + String desc = getDescription(); + if (desc == null) + setDescription(description); + else + setDescription(desc + " | " + description); + } // addDescription + + /** + * Set Business Partner (Ship+Bill) + * @param C_BPartner_ID bpartner + */ + public void setC_BPartner_ID (int C_BPartner_ID) + { + super.setC_BPartner_ID (C_BPartner_ID); + super.setBill_BPartner_ID (C_BPartner_ID); + } // setC_BPartner_ID + + /** + * Set Business Partner Location (Ship+Bill) + * @param C_BPartner_Location_ID bp location + */ + public void setC_BPartner_Location_ID (int C_BPartner_Location_ID) + { + super.setC_BPartner_Location_ID (C_BPartner_Location_ID); + super.setBill_Location_ID(C_BPartner_Location_ID); + } // setC_BPartner_Location_ID + + /** + * Set Business Partner Contact (Ship+Bill) + * @param AD_User_ID user + */ + public void setAD_User_ID (int AD_User_ID) + { + super.setAD_User_ID (AD_User_ID); + super.setBill_User_ID (AD_User_ID); + } // setAD_User_ID + + /** + * Set Ship Business Partner + * @param C_BPartner_ID bpartner + */ + public void setShip_BPartner_ID (int C_BPartner_ID) + { + super.setC_BPartner_ID (C_BPartner_ID); + } // setShip_BPartner_ID + + /** + * Set Ship Business Partner Location + * @param C_BPartner_Location_ID bp location + */ + public void setShip_Location_ID (int C_BPartner_Location_ID) + { + super.setC_BPartner_Location_ID (C_BPartner_Location_ID); + } // setShip_Location_ID + + /** + * Set Ship Business Partner Contact + * @param AD_User_ID user + */ + public void setShip_User_ID (int AD_User_ID) + { + super.setAD_User_ID (AD_User_ID); + } // setShip_User_ID + + + /** + * Set Warehouse + * @param M_Warehouse_ID warehouse + */ + public void setM_Warehouse_ID (int M_Warehouse_ID) + { + super.setM_Warehouse_ID (M_Warehouse_ID); + } // setM_Warehouse_ID + + /** + * Set Drop Ship + * @param IsDropShip drop ship + */ + public void setIsDropShip (boolean IsDropShip) + { + super.setIsDropShip (IsDropShip); + } // setIsDropShip + + /*************************************************************************/ + + /** Sales Order Sub Type - SO */ + public static final String DocSubTypeSO_Standard = "SO"; + /** Sales Order Sub Type - OB */ + public static final String DocSubTypeSO_Quotation = "OB"; + /** Sales Order Sub Type - ON */ + public static final String DocSubTypeSO_Proposal = "ON"; + /** Sales Order Sub Type - PR */ + public static final String DocSubTypeSO_Prepay = "PR"; + /** Sales Order Sub Type - WR */ + public static final String DocSubTypeSO_POS = "WR"; + /** Sales Order Sub Type - WP */ + public static final String DocSubTypeSO_Warehouse = "WP"; + /** Sales Order Sub Type - WI */ + public static final String DocSubTypeSO_OnCredit = "WI"; + /** Sales Order Sub Type - RM */ + public static final String DocSubTypeSO_RMA = "RM"; + + /** + * Set Target Sales Document Type + * @param DocSubTypeSO_x SO sub type - see DocSubTypeSO_* + */ + public void setC_DocTypeTarget_ID (String DocSubTypeSO_x) + { + String sql = "SELECT C_DocType_ID FROM C_DocType " + + "WHERE AD_Client_ID=? AND AD_Org_ID IN (0," + getAD_Org_ID() + + ") AND DocSubTypeSO=? " + + "ORDER BY AD_Org_ID DESC, IsDefault DESC"; + int C_DocType_ID = DB.getSQLValue(null, sql, getAD_Client_ID(), DocSubTypeSO_x); + if (C_DocType_ID <= 0) + log.severe ("Not found for AD_Client_ID=" + getAD_Client_ID () + ", SubType=" + DocSubTypeSO_x); + else + { + log.fine("(SO) - " + DocSubTypeSO_x); + setC_DocTypeTarget_ID (C_DocType_ID); + setIsSOTrx(true); + } + } // setC_DocTypeTarget_ID + + /** + * Set Target Document Type. + * Standard Order or PO + */ + public void setC_DocTypeTarget_ID () + { + if (isSOTrx()) // SO = Std Order + { + setC_DocTypeTarget_ID(DocSubTypeSO_Standard); + return; + } + // PO + String sql = "SELECT C_DocType_ID FROM C_DocType " + + "WHERE AD_Client_ID=? AND AD_Org_ID IN (0," + getAD_Org_ID() + + ") AND DocBaseType='POO' " + + "ORDER BY AD_Org_ID DESC, IsDefault DESC"; + int C_DocType_ID = DB.getSQLValue(null, sql, getAD_Client_ID()); + if (C_DocType_ID <= 0) + log.severe ("No POO found for AD_Client_ID=" + getAD_Client_ID ()); + else + { + log.fine("(PO) - " + C_DocType_ID); + setC_DocTypeTarget_ID (C_DocType_ID); + } + } // setC_DocTypeTarget_ID + + + /** + * Set Business Partner Defaults & Details. + * SOTrx should be set. + * @param bp business partner + */ + public void setBPartner (MBPartner bp) + { + if (bp == null) + return; + + setC_BPartner_ID(bp.getC_BPartner_ID()); + // Defaults Payment Term + int ii = 0; + if (isSOTrx()) + ii = bp.getC_PaymentTerm_ID(); + else + ii = bp.getPO_PaymentTerm_ID(); + if (ii != 0) + setC_PaymentTerm_ID(ii); + // Default Price List + if (isSOTrx()) + ii = bp.getM_PriceList_ID(); + else + ii = bp.getPO_PriceList_ID(); + if (ii != 0) + setM_PriceList_ID(ii); + // Default Delivery/Via Rule + String ss = bp.getDeliveryRule(); + if (ss != null) + setDeliveryRule(ss); + ss = bp.getDeliveryViaRule(); + if (ss != null) + setDeliveryViaRule(ss); + // Default Invoice/Payment Rule + ss = bp.getInvoiceRule(); + if (ss != null) + setInvoiceRule(ss); + ss = bp.getPaymentRule(); + if (ss != null) + setPaymentRule(ss); + // Sales Rep + ii = bp.getSalesRep_ID(); + if (ii != 0) + setSalesRep_ID(ii); + + + // Set Locations + MBPartnerLocation[] locs = bp.getLocations(false); + if (locs != null) + { + for (int i = 0; i < locs.length; i++) + { + if (locs[i].isShipTo()) + super.setC_BPartner_Location_ID(locs[i].getC_BPartner_Location_ID()); + if (locs[i].isBillTo()) + setBill_Location_ID(locs[i].getC_BPartner_Location_ID()); + } + // set to first + if (getC_BPartner_Location_ID() == 0 && locs.length > 0) + super.setC_BPartner_Location_ID(locs[0].getC_BPartner_Location_ID()); + if (getBill_Location_ID() == 0 && locs.length > 0) + setBill_Location_ID(locs[0].getC_BPartner_Location_ID()); + } + if (getC_BPartner_Location_ID() == 0) + log.log(Level.SEVERE, "MOrder.setBPartner - Has no Ship To Address: " + bp); + if (getBill_Location_ID() == 0) + log.log(Level.SEVERE, "MOrder.setBPartner - Has no Bill To Address: " + bp); + + // Set Contact + MUser[] contacts = bp.getContacts(false); + if (contacts != null && contacts.length == 1) + setAD_User_ID(contacts[0].getAD_User_ID()); + } // setBPartner + + + /** + * Copy Lines From other Order + * @param otherOrder order + * @param counter set counter info + * @param copyASI copy line attributes Attribute Set Instance, Resaouce Assignment + * @return number of lines copied + */ + public int copyLinesFrom (MOrder otherOrder, boolean counter, boolean copyASI) + { + if (isProcessed() || isPosted() || otherOrder == null) + return 0; + MOrderLine[] fromLines = otherOrder.getLines(false, null); + int count = 0; + for (int i = 0; i < fromLines.length; i++) + { + MOrderLine line = new MOrderLine (this); + PO.copyValues(fromLines[i], line, getAD_Client_ID(), getAD_Org_ID()); + line.setC_Order_ID(getC_Order_ID()); + line.setOrder(this); + line.set_ValueNoCheck ("C_OrderLine_ID", I_ZERO); // new + // References + if (!copyASI) + { + line.setM_AttributeSetInstance_ID(0); + line.setS_ResourceAssignment_ID(0); + } + if (counter) + line.setRef_OrderLine_ID(fromLines[i].getC_OrderLine_ID()); + else + line.setRef_OrderLine_ID(0); + // + line.setQtyDelivered(Env.ZERO); + line.setQtyInvoiced(Env.ZERO); + line.setQtyReserved(Env.ZERO); + line.setDateDelivered(null); + line.setDateInvoiced(null); + // Tax + if (getC_BPartner_ID() != otherOrder.getC_BPartner_ID()) + line.setTax(); // recalculate + // + // + line.setProcessed(false); + if (line.save(get_TrxName())) + count++; + // Cross Link + if (counter) + { + fromLines[i].setRef_OrderLine_ID(line.getC_OrderLine_ID()); + fromLines[i].save(get_TrxName()); + } + } + if (fromLines.length != count) + log.log(Level.SEVERE, "Line difference - From=" + fromLines.length + " <> Saved=" + count); + return count; + } // copyLinesFrom + + + /************************************************************************** + * String Representation + * @return info + */ + public String toString () + { + StringBuffer sb = new StringBuffer ("MOrder[") + .append(get_ID()).append("-").append(getDocumentNo()) + .append(",IsSOTrx=").append(isSOTrx()) + .append(",C_DocType_ID=").append(getC_DocType_ID()) + .append(", GrandTotal=").append(getGrandTotal()) + .append ("]"); + return sb.toString (); + } // toString + + /** + * Get Document Info + * @return document info (untranslated) + */ + public String getDocumentInfo() + { + MDocType dt = MDocType.get(getCtx(), getC_DocType_ID()); + return dt.getName() + " " + getDocumentNo(); + } // getDocumentInfo + + /** + * Create PDF + * @return File or null + */ + public File createPDF () + { + try + { + File temp = File.createTempFile(get_TableName()+get_ID()+"_", ".pdf"); + return createPDF (temp); + } + catch (Exception e) + { + log.severe("Could not create PDF - " + e.getMessage()); + } + return null; + } // getPDF + + /** + * Create PDF file + * @param file output file + * @return file if success + */ + public File createPDF (File file) + { + ReportEngine re = ReportEngine.get (getCtx(), ReportEngine.ORDER, getC_Order_ID()); + if (re == null) + return null; + return re.getPDF(file); + } // createPDF + + /** + * Set Price List (and Currency, TaxIncluded) when valid + * @param M_PriceList_ID price list + */ + public void setM_PriceList_ID (int M_PriceList_ID) + { + MPriceList pl = MPriceList.get(getCtx(), M_PriceList_ID, null); + if (pl.get_ID() == M_PriceList_ID) + { + super.setM_PriceList_ID(M_PriceList_ID); + setC_Currency_ID(pl.getC_Currency_ID()); + setIsTaxIncluded(pl.isTaxIncluded()); + } + } // setM_PriceList_ID + + + /************************************************************************** + * Get Lines of Order + * @param whereClause where clause or null (starting with AND) + * @param orderClause order clause + * @return lines + */ + public MOrderLine[] getLines (String whereClause, String orderClause) + { + ArrayList list = new ArrayList (); + StringBuffer sql = new StringBuffer("SELECT * FROM C_OrderLine WHERE C_Order_ID=? "); + if (whereClause != null) + sql.append(whereClause); + if (orderClause != null) + sql.append(" ").append(orderClause); + PreparedStatement pstmt = null; + ResultSet rs = null; + try + { + pstmt = DB.prepareStatement(sql.toString(), get_TrxName()); + pstmt.setInt(1, getC_Order_ID()); + rs = pstmt.executeQuery(); + while (rs.next()) + { + MOrderLine ol = new MOrderLine(getCtx(), rs, get_TrxName()); + ol.setHeaderInfo (this); + list.add(ol); + } + } + catch (Exception e) + { + log.log(Level.SEVERE, sql.toString(), e); + } + finally + { + DB.close(rs, pstmt); + rs = null; pstmt = null; + } + // + MOrderLine[] lines = new MOrderLine[list.size ()]; + list.toArray (lines); + return lines; + } // getLines + + /** + * Get Lines of Order + * @param requery requery + * @param orderBy optional order by column + * @return lines + */ + public MOrderLine[] getLines (boolean requery, String orderBy) + { + if (m_lines != null && !requery) { + set_TrxName(m_lines, get_TrxName()); + return m_lines; + } + // + String orderClause = "ORDER BY "; + if (orderBy != null && orderBy.length() > 0) + orderClause += orderBy; + else + orderClause += "Line"; + m_lines = getLines(null, orderClause); + return m_lines; + } // getLines + + /** + * Get Lines of Order. + * (useb by web store) + * @return lines + */ + public MOrderLine[] getLines() + { + return getLines(false, null); + } // getLines + + /** + * Renumber Lines + * @param step start and step + */ + public void renumberLines (int step) + { + int number = step; + MOrderLine[] lines = getLines(true, null); // Line is default + for (int i = 0; i < lines.length; i++) + { + MOrderLine line = lines[i]; + line.setLine(number); + line.save(get_TrxName()); + number += step; + } + m_lines = null; + } // renumberLines + + /** + * Does the Order Line belong to this Order + * @param C_OrderLine_ID line + * @return true if part of the order + */ + public boolean isOrderLine(int C_OrderLine_ID) + { + if (m_lines == null) + getLines(); + for (int i = 0; i < m_lines.length; i++) + if (m_lines[i].getC_OrderLine_ID() == C_OrderLine_ID) + return true; + return false; + } // isOrderLine + + /** + * Get Taxes of Order + * @param requery requery + * @return array of taxes + */ + public MOrderTax[] getTaxes(boolean requery) + { + if (m_taxes != null && !requery) + return m_taxes; + // + ArrayList list = new ArrayList(); + String sql = "SELECT * FROM C_OrderTax WHERE C_Order_ID=?"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement(sql, get_TrxName()); + pstmt.setInt(1, getC_Order_ID()); + ResultSet rs = pstmt.executeQuery(); + while (rs.next()) + list.add(new MOrderTax(getCtx(), rs, get_TrxName())); + rs.close(); + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + log.log(Level.SEVERE, "getTaxes", e); + } + finally + { + try + { + if (pstmt != null) + pstmt.close (); + } + catch (Exception e) + {} + pstmt = null; + } + // + m_taxes = new MOrderTax[list.size ()]; + list.toArray (m_taxes); + return m_taxes; + } // getTaxes + + + /** + * Get Invoices of Order + * @return invoices + */ + public MInvoice[] getInvoices() + { + ArrayList list = new ArrayList(); + String sql = " SELECT DISTINCT i.* FROM C_InvoiceLine il " + + "INNER JOIN C_OrderLine ol ON (ol.C_OrderLine_ID = il.C_OrderLine_ID) " + + "INNER JOIN C_Order o ON (o.C_Order_ID = ol.C_Order_ID) " + + "INNER JOIN C_Invoice i ON (i.C_Invoice_ID = il.C_Invoice_ID) " + + "WHERE o.C_Order_ID=? " + + "ORDER BY i.Created DESC"; + PreparedStatement pstmt = null; + ResultSet rs = null; + try + { + pstmt = DB.prepareStatement(sql, get_TrxName()); + pstmt.setInt(1, getC_Order_ID()); + rs = pstmt.executeQuery(); + while (rs.next()) + list.add(new MInvoice(getCtx(), rs, get_TrxName())); + } + catch (Exception e) + { + log.log(Level.SEVERE, sql, e); + } + finally + { + DB.close(rs, pstmt); + rs = null; pstmt = null; + } + // + MInvoice[] retValue = new MInvoice[list.size()]; + list.toArray(retValue); + return retValue; + } // getInvoices + + /** + * Get latest Invoice of Order + * @return invoice id or 0 + */ + public int getC_Invoice_ID() + { + int C_Invoice_ID = 0; + String sql = "SELECT C_Invoice_ID FROM C_Invoice " + + "WHERE C_Order_ID=? AND DocStatus IN ('CO','CL') " + + "ORDER BY Created DESC"; + PreparedStatement pstmt = null; + ResultSet rs = null; + try + { + pstmt = DB.prepareStatement(sql, get_TrxName()); + pstmt.setInt(1, getC_Order_ID()); + rs = pstmt.executeQuery(); + if (rs.next()) + C_Invoice_ID = rs.getInt(1); + } + catch (Exception e) + { + log.log(Level.SEVERE, "getC_Invoice_ID", e); + } + finally + { + DB.close(rs, pstmt); + rs = null; pstmt = null; + } + return C_Invoice_ID; + } // getC_Invoice_ID + + + /** + * Get Shipments of Order + * @return shipments + */ + public MInOut[] getShipments() + { + ArrayList list = new ArrayList(); + String sql = "SELECT DISTINCT io.* FROM M_InOutLine iol " + + "INNER JOIN M_InOut io ON (io.M_InOut_ID = iol.M_InOut_ID) " + + "INNER JOIN C_ORDERLINE ol ON (ol.C_ORDERLINE_ID=iol.C_ORDERLINE_ID) " + + "INNER JOIN C_ORDER o ON (o.C_ORDER_ID=ol.C_ORDER_ID) " + + "WHERE o.C_ORDER_ID=? " + + "ORDER BY io.Created DESC"; + + PreparedStatement pstmt = null; + ResultSet rs = null; + try + { + pstmt = DB.prepareStatement(sql, get_TrxName()); + pstmt.setInt(1, getC_Order_ID()); + rs = pstmt.executeQuery(); + while (rs.next()) + list.add(new MInOut(getCtx(), rs, get_TrxName())); + } + catch (Exception e) + { + log.log(Level.SEVERE, sql, e); + } + finally + { + DB.close(rs, pstmt); + rs = null; pstmt = null; + } + // + MInOut[] retValue = new MInOut[list.size()]; + list.toArray(retValue); + return retValue; + } // getShipments + + /** + * Get ISO Code of Currency + * @return Currency ISO + */ + public String getCurrencyISO() + { + return MCurrency.getISO_Code (getCtx(), getC_Currency_ID()); + } // getCurrencyISO + + /** + * Get Currency Precision + * @return precision + */ + public int getPrecision() + { + return MCurrency.getStdPrecision(getCtx(), getC_Currency_ID()); + } // getPrecision + + /** + * Get Document Status + * @return Document Status Clear Text + */ + public String getDocStatusName() + { + return MRefList.getListName(getCtx(), 131, getDocStatus()); + } // getDocStatusName + + /** + * Set DocAction + * @param DocAction doc action + */ + public void setDocAction (String DocAction) + { + setDocAction (DocAction, false); + } // setDocAction + + /** + * Set DocAction + * @param DocAction doc oction + * @param forceCreation force creation + */ + public void setDocAction (String DocAction, boolean forceCreation) + { + super.setDocAction (DocAction); + m_forceCreation = forceCreation; + } // setDocAction + + /** + * Set Processed. + * Propergate to Lines/Taxes + * @param processed processed + */ + public void setProcessed (boolean processed) + { + super.setProcessed (processed); + if (get_ID() == 0) + return; + String set = "SET Processed='" + + (processed ? "Y" : "N") + + "' WHERE C_Order_ID=" + getC_Order_ID(); + int noLine = DB.executeUpdate("UPDATE C_OrderLine " + set, get_TrxName()); + int noTax = DB.executeUpdate("UPDATE C_OrderTax " + set, get_TrxName()); + m_lines = null; + m_taxes = null; + log.fine("setProcessed - " + processed + " - Lines=" + noLine + ", Tax=" + noTax); + } // setProcessed + + + + /************************************************************************** + * Before Save + * @param newRecord new + * @return save + */ + protected boolean beforeSave (boolean newRecord) + { + // Client/Org Check + if (getAD_Org_ID() == 0) + { + int context_AD_Org_ID = Env.getAD_Org_ID(getCtx()); + if (context_AD_Org_ID != 0) + { + setAD_Org_ID(context_AD_Org_ID); + log.warning("Changed Org to Context=" + context_AD_Org_ID); + } + } + if (getAD_Client_ID() == 0) + { + m_processMsg = "AD_Client_ID = 0"; + return false; + } + + // New Record Doc Type - make sure DocType set to 0 + if (newRecord && getC_DocType_ID() == 0) + setC_DocType_ID (0); + + // Default Warehouse + if (getM_Warehouse_ID() == 0) + { + int ii = Env.getContextAsInt(getCtx(), "#M_Warehouse_ID"); + if (ii != 0) + setM_Warehouse_ID(ii); + else + { + log.saveError("FillMandatory", Msg.getElement(getCtx(), "M_Warehouse_ID")); + return false; + } + } + // Warehouse Org + if (newRecord + || is_ValueChanged("AD_Org_ID") || is_ValueChanged("M_Warehouse_ID")) + { + MWarehouse wh = MWarehouse.get(getCtx(), getM_Warehouse_ID()); + if (wh.getAD_Org_ID() != getAD_Org_ID()) + log.saveWarning("WarehouseOrgConflict", ""); + } + // Reservations in Warehouse + if (!newRecord && is_ValueChanged("M_Warehouse_ID")) + { + MOrderLine[] lines = getLines(false,null); + for (int i = 0; i < lines.length; i++) + { + if (!lines[i].canChangeWarehouse()) + return false; + } + } + + // No Partner Info - set Template + if (getC_BPartner_ID() == 0) + setBPartner(MBPartner.getTemplate(getCtx(), getAD_Client_ID())); + if (getC_BPartner_Location_ID() == 0) + setBPartner(new MBPartner(getCtx(), getC_BPartner_ID(), null)); + // No Bill - get from Ship + if (getBill_BPartner_ID() == 0) + { + setBill_BPartner_ID(getC_BPartner_ID()); + setBill_Location_ID(getC_BPartner_Location_ID()); + } + if (getBill_Location_ID() == 0) + setBill_Location_ID(getC_BPartner_Location_ID()); + + // Default Price List + if (getM_PriceList_ID() == 0) + { + int ii = DB.getSQLValue(null, + "SELECT M_PriceList_ID FROM M_PriceList " + + "WHERE AD_Client_ID=? AND IsSOPriceList=? " + + "ORDER BY IsDefault DESC", getAD_Client_ID(), isSOTrx() ? "Y" : "N"); + if (ii != 0) + setM_PriceList_ID (ii); + } + // Default Currency + if (getC_Currency_ID() == 0) + { + String sql = "SELECT C_Currency_ID FROM M_PriceList WHERE M_PriceList_ID=?"; + int ii = DB.getSQLValue (null, sql, getM_PriceList_ID()); + if (ii != 0) + setC_Currency_ID (ii); + else + setC_Currency_ID(Env.getContextAsInt(getCtx(), "#C_Currency_ID")); + } + + // Default Sales Rep + if (getSalesRep_ID() == 0) + { + int ii = Env.getContextAsInt(getCtx(), "#SalesRep_ID"); + if (ii != 0) + setSalesRep_ID (ii); + } + + // Default Document Type + if (getC_DocTypeTarget_ID() == 0) + setC_DocTypeTarget_ID(DocSubTypeSO_Standard); + + // Default Payment Term + if (getC_PaymentTerm_ID() == 0) + { + int ii = Env.getContextAsInt(getCtx(), "#C_PaymentTerm_ID"); + if (ii != 0) + setC_PaymentTerm_ID(ii); + else + { + String sql = "SELECT C_PaymentTerm_ID FROM C_PaymentTerm WHERE AD_Client_ID=? AND IsDefault='Y'"; + ii = DB.getSQLValue(null, sql, getAD_Client_ID()); + if (ii != 0) + setC_PaymentTerm_ID (ii); + } + } + + return true; + } // beforeSave + + + /** + * After Save + * @param newRecord new + * @param success success + * @return true if can be saved + */ + protected boolean afterSave (boolean newRecord, boolean success) + { + if (!success || newRecord) + return success; + + // Propagate Description changes + if (is_ValueChanged("Description") || is_ValueChanged("POReference")) + { + String sql = "UPDATE C_Invoice i" + + " SET (Description,POReference)=" + + "(SELECT Description,POReference " + + "FROM C_Order o WHERE i.C_Order_ID=o.C_Order_ID) " + + "WHERE DocStatus NOT IN ('RE','CL') AND C_Order_ID=" + getC_Order_ID(); + int no = DB.executeUpdate(sql, get_TrxName()); + log.fine("Description -> #" + no); + } + + // Propagate Changes of Payment Info to existing (not reversed/closed) invoices + if (is_ValueChanged("PaymentRule") || is_ValueChanged("C_PaymentTerm_ID") + || is_ValueChanged("DateAcct") || is_ValueChanged("C_Payment_ID") + || is_ValueChanged("C_CashLine_ID")) + { + String sql = "UPDATE C_Invoice i " + + "SET (PaymentRule,C_PaymentTerm_ID,DateAcct,C_Payment_ID,C_CashLine_ID)=" + + "(SELECT PaymentRule,C_PaymentTerm_ID,DateAcct,C_Payment_ID,C_CashLine_ID " + + "FROM C_Order o WHERE i.C_Order_ID=o.C_Order_ID)" + + "WHERE DocStatus NOT IN ('RE','CL') AND C_Order_ID=" + getC_Order_ID(); + // Don't touch Closed/Reversed entries + int no = DB.executeUpdate(sql, get_TrxName()); + log.fine("Payment -> #" + no); + } + + // Sync Lines + afterSaveSync("AD_Org_ID"); + afterSaveSync("C_BPartner_ID"); + afterSaveSync("C_BPartner_Location_ID"); + afterSaveSync("DateOrdered"); + afterSaveSync("DatePromised"); + afterSaveSync("M_Warehouse_ID"); + afterSaveSync("M_Shipper_ID"); + afterSaveSync("C_Currency_ID"); + // + return true; + } // afterSave + + private void afterSaveSync (String columnName) + { + if (is_ValueChanged(columnName)) + { + String sql = "UPDATE C_OrderLine ol" + + " SET " + columnName + " =" + + "(SELECT " + columnName + + " FROM C_Order o WHERE ol.C_Order_ID=o.C_Order_ID) " + + "WHERE C_Order_ID=" + getC_Order_ID(); + int no = DB.executeUpdate(sql, get_TrxName()); + log.fine(columnName + " Lines -> #" + no); + } + } // afterSaveSync + + /** + * Before Delete + * @return true of it can be deleted + */ + protected boolean beforeDelete () + { + if (isProcessed()) + return false; + + getLines(); + for (int i = 0; i < m_lines.length; i++) + { + if (!m_lines[i].beforeDelete()) + return false; + } + return true; + } // beforeDelete + + /************************************************************************** + * Process document + * @param processAction document action + * @return true if performed + */ + public boolean processIt (String processAction) + { + m_processMsg = null; + DocumentEngine engine = new DocumentEngine (this, getDocStatus()); + return engine.processIt (processAction, getDocAction()); + } // processIt + + /** Process Message */ + private String m_processMsg = null; + /** Just Prepared Flag */ + private boolean m_justPrepared = false; + + /** + * Unlock Document. + * @return true if success + */ + public boolean unlockIt() + { + log.info("unlockIt - " + toString()); + setProcessing(false); + return true; + } // unlockIt + + /** + * Invalidate Document + * @return true if success + */ + public boolean invalidateIt() + { + log.info(toString()); + setDocAction(DOCACTION_Prepare); + return true; + } // invalidateIt + + + /************************************************************************** + * Prepare Document + * @return new status (In Progress or Invalid) + */ + public String prepareIt() + { + log.info(toString()); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_PREPARE); + if (m_processMsg != null) + return DocAction.STATUS_Invalid; + MDocType dt = MDocType.get(getCtx(), getC_DocTypeTarget_ID()); + + // Std Period open? + if (!MPeriod.isOpen(getCtx(), getDateAcct(), dt.getDocBaseType())) + { + m_processMsg = "@PeriodClosed@"; + return DocAction.STATUS_Invalid; + } + + // Lines + MOrderLine[] lines = getLines(true, "M_Product_ID"); + if (lines.length == 0) + { + m_processMsg = "@NoLines@"; + return DocAction.STATUS_Invalid; + } + + // Bug 1564431 + if (getDeliveryRule() != null && getDeliveryRule().equals(MOrder.DELIVERYRULE_CompleteOrder)) + { + for (int i = 0; i < lines.length; i++) + { + MOrderLine line = lines[i]; + MProduct product = line.getProduct(); + if (product != null && product.isExcludeAutoDelivery()) + { + m_processMsg = "@M_Product_ID@ "+product.getValue()+" @IsExcludeAutoDelivery@"; + return DocAction.STATUS_Invalid; + } + } + } + + // Convert DocType to Target + if (getC_DocType_ID() != getC_DocTypeTarget_ID() ) + { + // Cannot change Std to anything else if different warehouses + if (getC_DocType_ID() != 0) + { + MDocType dtOld = MDocType.get(getCtx(), getC_DocType_ID()); + if (MDocType.DOCSUBTYPESO_StandardOrder.equals(dtOld.getDocSubTypeSO()) // From SO + && !MDocType.DOCSUBTYPESO_StandardOrder.equals(dt.getDocSubTypeSO())) // To !SO + { + for (int i = 0; i < lines.length; i++) + { + if (lines[i].getM_Warehouse_ID() != getM_Warehouse_ID()) + { + log.warning("different Warehouse " + lines[i]); + m_processMsg = "@CannotChangeDocType@"; + return DocAction.STATUS_Invalid; + } + } + } + } + + // New or in Progress/Invalid + if (DOCSTATUS_Drafted.equals(getDocStatus()) + || DOCSTATUS_InProgress.equals(getDocStatus()) + || DOCSTATUS_Invalid.equals(getDocStatus()) + || getC_DocType_ID() == 0) + { + setC_DocType_ID(getC_DocTypeTarget_ID()); + } + else // convert only if offer + { + if (dt.isOffer()) + setC_DocType_ID(getC_DocTypeTarget_ID()); + else + { + m_processMsg = "@CannotChangeDocType@"; + return DocAction.STATUS_Invalid; + } + } + } // convert DocType + + // Mandatory Product Attribute Set Instance + String mandatoryType = "='Y'"; // IN ('Y','S') + String sql = "SELECT COUNT(*) " + + "FROM C_OrderLine ol" + + " INNER JOIN M_Product p ON (ol.M_Product_ID=p.M_Product_ID)" + + " INNER JOIN M_AttributeSet pas ON (p.M_AttributeSet_ID=pas.M_AttributeSet_ID) " + + "WHERE pas.MandatoryType" + mandatoryType + + " AND ol.M_AttributeSetInstance_ID IS NULL" + + " AND ol.C_Order_ID=?"; + int no = DB.getSQLValue(get_TrxName(), sql, getC_Order_ID()); + if (no != 0) + { + m_processMsg = "@LinesWithoutProductAttribute@ (" + no + ")"; + return DocAction.STATUS_Invalid; + } + + // Lines + if (explodeBOM()) + lines = getLines(true, "M_Product_ID"); + if (!reserveStock(dt, lines)) + { + m_processMsg = "Cannot reserve Stock"; + return DocAction.STATUS_Invalid; + } + if (!calculateTaxTotal()) + { + m_processMsg = "Error calculating tax"; + return DocAction.STATUS_Invalid; + } + + // Credit Check + if (isSOTrx()) + { + MBPartner bp = new MBPartner (getCtx(), getC_BPartner_ID(), get_TrxName()); + if (MBPartner.SOCREDITSTATUS_CreditStop.equals(bp.getSOCreditStatus())) + { + m_processMsg = "@BPartnerCreditStop@ - @TotalOpenBalance@=" + + bp.getTotalOpenBalance() + + ", @SO_CreditLimit@=" + bp.getSO_CreditLimit(); + return DocAction.STATUS_Invalid; + } + if (MBPartner.SOCREDITSTATUS_CreditHold.equals(bp.getSOCreditStatus())) + { + m_processMsg = "@BPartnerCreditHold@ - @TotalOpenBalance@=" + + bp.getTotalOpenBalance() + + ", @SO_CreditLimit@=" + bp.getSO_CreditLimit(); + return DocAction.STATUS_Invalid; + } + BigDecimal grandTotal = MConversionRate.convertBase(getCtx(), + getGrandTotal(), getC_Currency_ID(), getDateOrdered(), + getC_ConversionType_ID(), getAD_Client_ID(), getAD_Org_ID()); + if (MBPartner.SOCREDITSTATUS_CreditHold.equals(bp.getSOCreditStatus(grandTotal))) + { + m_processMsg = "@BPartnerOverOCreditHold@ - @TotalOpenBalance@=" + + bp.getTotalOpenBalance() + ", @GrandTotal@=" + grandTotal + + ", @SO_CreditLimit@=" + bp.getSO_CreditLimit(); + return DocAction.STATUS_Invalid; + } + } + + m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_PREPARE); + if (m_processMsg != null) + return DocAction.STATUS_Invalid; + + m_justPrepared = true; + // if (!DOCACTION_Complete.equals(getDocAction())) don't set for just prepare + // setDocAction(DOCACTION_Complete); + return DocAction.STATUS_InProgress; + } // prepareIt + + /** + * Explode non stocked BOM. + * @return true if bom exploded + */ + private boolean explodeBOM() + { + boolean retValue = false; + String where = "AND IsActive='Y' AND EXISTS " + + "(SELECT * FROM M_Product p WHERE C_OrderLine.M_Product_ID=p.M_Product_ID" + + " AND p.IsBOM='Y' AND p.IsVerified='Y' AND p.IsStocked='N')"; + // + String sql = "SELECT COUNT(*) FROM C_OrderLine " + + "WHERE C_Order_ID=? " + where; + int count = DB.getSQLValue(get_TrxName(), sql, getC_Order_ID()); + while (count != 0) + { + retValue = true; + renumberLines (1000); // max 999 bom items + + // Order Lines with non-stocked BOMs + MOrderLine[] lines = getLines (where, "ORDER BY Line"); + for (int i = 0; i < lines.length; i++) + { + MOrderLine line = lines[i]; + MProduct product = MProduct.get (getCtx(), line.getM_Product_ID()); + log.fine(product.getName()); + // New Lines + int lineNo = line.getLine (); + MProductBOM[] boms = MProductBOM.getBOMLines (product); + for (int j = 0; j < boms.length; j++) + { + MProductBOM bom = boms[j]; + MOrderLine newLine = new MOrderLine (this); + newLine.setLine (++lineNo); + newLine.setM_Product_ID (bom.getProduct () + .getM_Product_ID ()); + newLine.setC_UOM_ID (bom.getProduct ().getC_UOM_ID ()); + newLine.setQty (line.getQtyOrdered ().multiply ( + bom.getBOMQty ())); + if (bom.getDescription () != null) + newLine.setDescription (bom.getDescription ()); + // + newLine.setPrice (); + newLine.save (get_TrxName()); + } + // Convert into Comment Line + line.setM_Product_ID (0); + line.setM_AttributeSetInstance_ID (0); + line.setPrice (Env.ZERO); + line.setPriceLimit (Env.ZERO); + line.setPriceList (Env.ZERO); + line.setLineNetAmt (Env.ZERO); + line.setFreightAmt (Env.ZERO); + // + String description = product.getName (); + if (product.getDescription () != null) + description += " " + product.getDescription (); + if (line.getDescription () != null) + description += " " + line.getDescription (); + line.setDescription (description); + line.save (get_TrxName()); + } // for all lines with BOM + + m_lines = null; // force requery + count = DB.getSQLValue (get_TrxName(), sql, getC_Invoice_ID ()); + renumberLines (10); + } // while count != 0 + return retValue; + } // explodeBOM + + + /** + * Reserve Inventory. + * Counterpart: MInOut.completeIt() + * @param dt document type or null + * @param lines order lines (ordered by M_Product_ID for deadlock prevention) + * @return true if (un) reserved + */ + private boolean reserveStock (MDocType dt, MOrderLine[] lines) + { + if (dt == null) + dt = MDocType.get(getCtx(), getC_DocType_ID()); + + // Binding + boolean binding = !dt.isProposal(); + // Not binding - i.e. Target=0 + if (DOCACTION_Void.equals(getDocAction()) + // Closing Binding Quotation + || (MDocType.DOCSUBTYPESO_Quotation.equals(dt.getDocSubTypeSO()) + && DOCACTION_Close.equals(getDocAction())) + || isDropShip() ) + binding = false; + boolean isSOTrx = isSOTrx(); + log.fine("Binding=" + binding + " - IsSOTrx=" + isSOTrx); + // Force same WH for all but SO/PO + int header_M_Warehouse_ID = getM_Warehouse_ID(); + if (MDocType.DOCSUBTYPESO_StandardOrder.equals(dt.getDocSubTypeSO()) + || MDocType.DOCBASETYPE_PurchaseOrder.equals(dt.getDocBaseType())) + header_M_Warehouse_ID = 0; // don't enforce + + BigDecimal Volume = Env.ZERO; + BigDecimal Weight = Env.ZERO; + + // Always check and (un) Reserve Inventory + for (int i = 0; i < lines.length; i++) + { + MOrderLine line = lines[i]; + // Check/set WH/Org + if (header_M_Warehouse_ID != 0) // enforce WH + { + if (header_M_Warehouse_ID != line.getM_Warehouse_ID()) + line.setM_Warehouse_ID(header_M_Warehouse_ID); + if (getAD_Org_ID() != line.getAD_Org_ID()) + line.setAD_Org_ID(getAD_Org_ID()); + } + // Binding + BigDecimal target = binding ? line.getQtyOrdered() : Env.ZERO; + BigDecimal difference = target + .subtract(line.getQtyReserved()) + .subtract(line.getQtyDelivered()); + if (difference.signum() == 0) + { + MProduct product = line.getProduct(); + if (product != null) + { + Volume = Volume.add(product.getVolume().multiply(line.getQtyOrdered())); + Weight = Weight.add(product.getWeight().multiply(line.getQtyOrdered())); + } + continue; + } + + log.fine("Line=" + line.getLine() + + " - Target=" + target + ",Difference=" + difference + + " - Ordered=" + line.getQtyOrdered() + + ",Reserved=" + line.getQtyReserved() + ",Delivered=" + line.getQtyDelivered()); + + // Check Product - Stocked and Item + MProduct product = line.getProduct(); + if (product != null) + { + if (product.isStocked()) + { + BigDecimal ordered = isSOTrx ? Env.ZERO : difference; + BigDecimal reserved = isSOTrx ? difference : Env.ZERO; + int M_Locator_ID = 0; + // Get Locator to reserve + if (line.getM_AttributeSetInstance_ID() != 0) // Get existing Location + M_Locator_ID = MStorage.getM_Locator_ID (line.getM_Warehouse_ID(), + line.getM_Product_ID(), line.getM_AttributeSetInstance_ID(), + ordered, get_TrxName()); + // Get default Location + if (M_Locator_ID == 0) + { + // try to take default locator for product first + // if it is from the selected warehouse + MWarehouse wh = MWarehouse.get(getCtx(), line.getM_Warehouse_ID()); + M_Locator_ID = product.getM_Locator_ID(); + if (M_Locator_ID!=0) { + MLocator locator = new MLocator(getCtx(), product.getM_Locator_ID(), get_TrxName()); + //product has default locator defined but is not from the order warehouse + if(locator.getM_Warehouse_ID()!=wh.get_ID()) { + M_Locator_ID = wh.getDefaultLocator().getM_Locator_ID(); + } + } else { + M_Locator_ID = wh.getDefaultLocator().getM_Locator_ID(); + } + } + // Update Storage + if (!MStorage.add(getCtx(), line.getM_Warehouse_ID(), M_Locator_ID, + line.getM_Product_ID(), + line.getM_AttributeSetInstance_ID(), line.getM_AttributeSetInstance_ID(), + Env.ZERO, reserved, ordered, get_TrxName())) + return false; + } // stockec + // update line + line.setQtyReserved(line.getQtyReserved().add(difference)); + if (!line.save(get_TrxName())) + return false; + // + Volume = Volume.add(product.getVolume().multiply(line.getQtyOrdered())); + Weight = Weight.add(product.getWeight().multiply(line.getQtyOrdered())); + } // product + } // reverse inventory + + setVolume(Volume); + setWeight(Weight); + return true; + } // reserveStock + + /** + * Calculate Tax and Total + * @return true if tax total calculated + */ + private boolean calculateTaxTotal() + { + log.fine(""); + // Delete Taxes + DB.executeUpdate("DELETE C_OrderTax WHERE C_Order_ID=" + getC_Order_ID(), get_TrxName()); + m_taxes = null; + + // Lines + BigDecimal totalLines = Env.ZERO; + ArrayList taxList = new ArrayList(); + MOrderLine[] lines = getLines(); + for (int i = 0; i < lines.length; i++) + { + MOrderLine line = lines[i]; + Integer taxID = new Integer(line.getC_Tax_ID()); + if (!taxList.contains(taxID)) + { + MOrderTax oTax = MOrderTax.get (line, getPrecision(), + false, get_TrxName()); // current Tax + oTax.setIsTaxIncluded(isTaxIncluded()); + if (!oTax.calculateTaxFromLines()) + return false; + if (!oTax.save(get_TrxName())) + return false; + taxList.add(taxID); + } + totalLines = totalLines.add(line.getLineNetAmt()); + } + + // Taxes + BigDecimal grandTotal = totalLines; + MOrderTax[] taxes = getTaxes(true); + for (int i = 0; i < taxes.length; i++) + { + MOrderTax oTax = taxes[i]; + MTax tax = oTax.getTax(); + if (tax.isSummary()) + { + MTax[] cTaxes = tax.getChildTaxes(false); + for (int j = 0; j < cTaxes.length; j++) + { + MTax cTax = cTaxes[j]; + BigDecimal taxAmt = cTax.calculateTax(oTax.getTaxBaseAmt(), isTaxIncluded(), getPrecision()); + // + MOrderTax newOTax = new MOrderTax(getCtx(), 0, get_TrxName()); + newOTax.setClientOrg(this); + newOTax.setC_Order_ID(getC_Order_ID()); + newOTax.setC_Tax_ID(cTax.getC_Tax_ID()); + newOTax.setPrecision(getPrecision()); + newOTax.setIsTaxIncluded(isTaxIncluded()); + newOTax.setTaxBaseAmt(oTax.getTaxBaseAmt()); + newOTax.setTaxAmt(taxAmt); + if (!newOTax.save(get_TrxName())) + return false; + // + if (!isTaxIncluded()) + grandTotal = grandTotal.add(taxAmt); + } + if (!oTax.delete(true, get_TrxName())) + return false; + if (!oTax.save(get_TrxName())) + return false; + } + else + { + if (!isTaxIncluded()) + grandTotal = grandTotal.add(oTax.getTaxAmt()); + } + } + // + setTotalLines(totalLines); + setGrandTotal(grandTotal); + return true; + } // calculateTaxTotal + + + /** + * Approve Document + * @return true if success + */ + public boolean approveIt() + { + log.info("approveIt - " + toString()); + setIsApproved(true); + return true; + } // approveIt + + /** + * Reject Approval + * @return true if success + */ + public boolean rejectIt() + { + log.info("rejectIt - " + toString()); + setIsApproved(false); + return true; + } // rejectIt + + + /************************************************************************** + * Complete Document + * @return new status (Complete, In Progress, Invalid, Waiting ..) + */ + public String completeIt() + { + MDocType dt = MDocType.get(getCtx(), getC_DocType_ID()); + String DocSubTypeSO = dt.getDocSubTypeSO(); + + // Just prepare + if (DOCACTION_Prepare.equals(getDocAction())) + { + setProcessed(false); + return DocAction.STATUS_InProgress; + } + // Offers + if (MDocType.DOCSUBTYPESO_Proposal.equals(DocSubTypeSO) + || MDocType.DOCSUBTYPESO_Quotation.equals(DocSubTypeSO)) + { + // Binding + if (MDocType.DOCSUBTYPESO_Quotation.equals(DocSubTypeSO)) + reserveStock(dt, getLines(true, "M_Product_ID")); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_COMPLETE); + if (m_processMsg != null) + return DocAction.STATUS_Invalid; + m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_COMPLETE); + if (m_processMsg != null) + return DocAction.STATUS_Invalid; + // Set the definite document number after completed (if needed) + setDefiniteDocumentNo(); + setProcessed(true); + return DocAction.STATUS_Completed; + } + // Waiting Payment - until we have a payment + if (!m_forceCreation + && MDocType.DOCSUBTYPESO_PrepayOrder.equals(DocSubTypeSO) + && getC_Payment_ID() == 0 && getC_CashLine_ID() == 0) + { + setProcessed(true); + return DocAction.STATUS_WaitingPayment; + } + + // Re-Check + if (!m_justPrepared) + { + String status = prepareIt(); + if (!DocAction.STATUS_InProgress.equals(status)) + return status; + } + + m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_COMPLETE); + if (m_processMsg != null) + return DocAction.STATUS_Invalid; + + // Implicit Approval + if (!isApproved()) + approveIt(); + getLines(true,null); + log.info(toString()); + StringBuffer info = new StringBuffer(); + + boolean realTimePOS = false; + + // Create SO Shipment - Force Shipment + MInOut shipment = null; + if (MDocType.DOCSUBTYPESO_OnCreditOrder.equals(DocSubTypeSO) // (W)illCall(I)nvoice + || MDocType.DOCSUBTYPESO_WarehouseOrder.equals(DocSubTypeSO) // (W)illCall(P)ickup + || MDocType.DOCSUBTYPESO_POSOrder.equals(DocSubTypeSO) // (W)alkIn(R)eceipt + || MDocType.DOCSUBTYPESO_PrepayOrder.equals(DocSubTypeSO)) + { + if (!DELIVERYRULE_Force.equals(getDeliveryRule())) + setDeliveryRule(DELIVERYRULE_Force); + // + shipment = createShipment (dt, realTimePOS ? null : getDateOrdered()); + if (shipment == null) + return DocAction.STATUS_Invalid; + info.append("@M_InOut_ID@: ").append(shipment.getDocumentNo()); + String msg = shipment.getProcessMsg(); + if (msg != null && msg.length() > 0) + info.append(" (").append(msg).append(")"); + } // Shipment + + + // Create SO Invoice - Always invoice complete Order + if ( MDocType.DOCSUBTYPESO_POSOrder.equals(DocSubTypeSO) + || MDocType.DOCSUBTYPESO_OnCreditOrder.equals(DocSubTypeSO) + || MDocType.DOCSUBTYPESO_PrepayOrder.equals(DocSubTypeSO)) + { + MInvoice invoice = createInvoice (dt, shipment, realTimePOS ? null : getDateOrdered()); + if (invoice == null) + return DocAction.STATUS_Invalid; + info.append(" - @C_Invoice_ID@: ").append(invoice.getDocumentNo()); + String msg = invoice.getProcessMsg(); + if (msg != null && msg.length() > 0) + info.append(" (").append(msg).append(")"); + } // Invoice + + // Counter Documents + MOrder counter = createCounterDoc(); + if (counter != null) + info.append(" - @CounterDoc@: @Order@=").append(counter.getDocumentNo()); + // User Validation + String valid = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_COMPLETE); + if (valid != null) + { + if (info.length() > 0) + info.append(" - "); + info.append(valid); + m_processMsg = info.toString(); + return DocAction.STATUS_Invalid; + } + + // Set the definite document number after completed (if needed) + setDefiniteDocumentNo(); + + setProcessed(true); + m_processMsg = info.toString(); + // + setDocAction(DOCACTION_Close); + return DocAction.STATUS_Completed; + } // completeIt + + /** + * Set the definite document number after completed + */ + private void setDefiniteDocumentNo() { + MDocType dt = MDocType.get(getCtx(), getC_DocType_ID()); + if (dt.isOverwriteDateOnComplete()) { + setDateOrdered(new Timestamp (System.currentTimeMillis())); + } + if (dt.isOverwriteSeqOnComplete()) { + String value = DB.getDocumentNo(getC_DocType_ID(), get_TrxName(), true, this); + if (value != null) + setDocumentNo(value); + } + } + + /** + * Create Shipment + * @param dt order document type + * @param movementDate optional movement date (default today) + * @return shipment or null + */ + private MInOut createShipment(MDocType dt, Timestamp movementDate) + { + log.info("For " + dt); + MInOut shipment = new MInOut (this, dt.getC_DocTypeShipment_ID(), movementDate); + // shipment.setDateAcct(getDateAcct()); + if (!shipment.save(get_TrxName())) + { + m_processMsg = "Could not create Shipment"; + return null; + } + // + MOrderLine[] oLines = getLines(true, null); + for (int i = 0; i < oLines.length; i++) + { + MOrderLine oLine = oLines[i]; + // + MInOutLine ioLine = new MInOutLine(shipment); + // Qty = Ordered - Delivered + BigDecimal MovementQty = oLine.getQtyOrdered().subtract(oLine.getQtyDelivered()); + // Location + int M_Locator_ID = MStorage.getM_Locator_ID (oLine.getM_Warehouse_ID(), + oLine.getM_Product_ID(), oLine.getM_AttributeSetInstance_ID(), + MovementQty, get_TrxName()); + if (M_Locator_ID == 0) // Get default Location + { + MWarehouse wh = MWarehouse.get(getCtx(), oLine.getM_Warehouse_ID()); + M_Locator_ID = wh.getDefaultLocator().getM_Locator_ID(); + } + // + ioLine.setOrderLine(oLine, M_Locator_ID, MovementQty); + ioLine.setQty(MovementQty); + if (oLine.getQtyEntered().compareTo(oLine.getQtyOrdered()) != 0) + ioLine.setQtyEntered(MovementQty + .multiply(oLine.getQtyEntered()) + .divide(oLine.getQtyOrdered(), 6, BigDecimal.ROUND_HALF_UP)); + if (!ioLine.save(get_TrxName())) + { + m_processMsg = "Could not create Shipment Line"; + return null; + } + } + // Manually Process Shipment + String status = shipment.completeIt(); + shipment.setDocStatus(status); + shipment.save(get_TrxName()); + if (!DOCSTATUS_Completed.equals(status)) + { + m_processMsg = "@M_InOut_ID@: " + shipment.getProcessMsg(); + return null; + } + return shipment; + } // createShipment + + /** + * Create Invoice + * @param dt order document type + * @param shipment optional shipment + * @param invoiceDate invoice date + * @return invoice or null + */ + private MInvoice createInvoice (MDocType dt, MInOut shipment, Timestamp invoiceDate) + { + log.info(dt.toString()); + MInvoice invoice = new MInvoice (this, dt.getC_DocTypeInvoice_ID(), invoiceDate); + if (!invoice.save(get_TrxName())) + { + m_processMsg = "Could not create Invoice"; + return null; + } + + // If we have a Shipment - use that as a base + if (shipment != null) + { + if (!INVOICERULE_AfterDelivery.equals(getInvoiceRule())) + setInvoiceRule(INVOICERULE_AfterDelivery); + // + MInOutLine[] sLines = shipment.getLines(false); + for (int i = 0; i < sLines.length; i++) + { + MInOutLine sLine = sLines[i]; + // + MInvoiceLine iLine = new MInvoiceLine(invoice); + iLine.setShipLine(sLine); + // Qty = Delivered + iLine.setQtyEntered(sLine.getQtyEntered()); + iLine.setQtyInvoiced(sLine.getMovementQty()); + if (!iLine.save(get_TrxName())) + { + m_processMsg = "Could not create Invoice Line from Shipment Line"; + return null; + } + // + sLine.setIsInvoiced(true); + if (!sLine.save(get_TrxName())) + { + log.warning("Could not update Shipment line: " + sLine); + } + } + } + else // Create Invoice from Order + { + if (!INVOICERULE_Immediate.equals(getInvoiceRule())) + setInvoiceRule(INVOICERULE_Immediate); + // + MOrderLine[] oLines = getLines(); + for (int i = 0; i < oLines.length; i++) + { + MOrderLine oLine = oLines[i]; + // + MInvoiceLine iLine = new MInvoiceLine(invoice); + iLine.setOrderLine(oLine); + // Qty = Ordered - Invoiced + iLine.setQtyInvoiced(oLine.getQtyOrdered().subtract(oLine.getQtyInvoiced())); + if (oLine.getQtyOrdered().compareTo(oLine.getQtyEntered()) == 0) + iLine.setQtyEntered(iLine.getQtyInvoiced()); + else + iLine.setQtyEntered(iLine.getQtyInvoiced().multiply(oLine.getQtyEntered()) + .divide(oLine.getQtyOrdered(), 12, BigDecimal.ROUND_HALF_UP)); + if (!iLine.save(get_TrxName())) + { + m_processMsg = "Could not create Invoice Line from Order Line"; + return null; + } + } + } + // Manually Process Invoice + String status = invoice.completeIt(); + invoice.setDocStatus(status); + invoice.save(get_TrxName()); + setC_CashLine_ID(invoice.getC_CashLine_ID()); + if (!DOCSTATUS_Completed.equals(status)) + { + m_processMsg = "@C_Invoice_ID@: " + invoice.getProcessMsg(); + return null; + } + return invoice; + } // createInvoice + + /** + * Create Counter Document + * @return counter order + */ + private MOrder createCounterDoc() + { + // Is this itself a counter doc ? + if (getRef_Order_ID() != 0) + return null; + + // Org Must be linked to BPartner + MOrg org = MOrg.get(getCtx(), getAD_Org_ID()); + int counterC_BPartner_ID = org.getLinkedC_BPartner_ID(get_TrxName()); + if (counterC_BPartner_ID == 0) + return null; + // Business Partner needs to be linked to Org + MBPartner bp = new MBPartner (getCtx(), getC_BPartner_ID(), get_TrxName()); + int counterAD_Org_ID = bp.getAD_OrgBP_ID_Int(); + if (counterAD_Org_ID == 0) + return null; + + MBPartner counterBP = new MBPartner (getCtx(), counterC_BPartner_ID, null); + MOrgInfo counterOrgInfo = MOrgInfo.get(getCtx(), counterAD_Org_ID); + log.info("Counter BP=" + counterBP.getName()); + + // Document Type + int C_DocTypeTarget_ID = 0; + MDocTypeCounter counterDT = MDocTypeCounter.getCounterDocType(getCtx(), getC_DocType_ID()); + if (counterDT != null) + { + log.fine(counterDT.toString()); + if (!counterDT.isCreateCounter() || !counterDT.isValid()) + return null; + C_DocTypeTarget_ID = counterDT.getCounter_C_DocType_ID(); + } + else // indirect + { + C_DocTypeTarget_ID = MDocTypeCounter.getCounterDocType_ID(getCtx(), getC_DocType_ID()); + log.fine("Indirect C_DocTypeTarget_ID=" + C_DocTypeTarget_ID); + if (C_DocTypeTarget_ID <= 0) + return null; + } + // Deep Copy + MOrder counter = copyFrom (this, getDateOrdered(), + C_DocTypeTarget_ID, !isSOTrx(), true, false, get_TrxName()); + // + counter.setAD_Org_ID(counterAD_Org_ID); + counter.setM_Warehouse_ID(counterOrgInfo.getM_Warehouse_ID()); + // + counter.setBPartner(counterBP); + counter.setDatePromised(getDatePromised()); // default is date ordered + // Refernces (Should not be required + counter.setSalesRep_ID(getSalesRep_ID()); + counter.save(get_TrxName()); + + // Update copied lines + MOrderLine[] counterLines = counter.getLines(true, null); + for (int i = 0; i < counterLines.length; i++) + { + MOrderLine counterLine = counterLines[i]; + counterLine.setOrder(counter); // copies header values (BP, etc.) + counterLine.setPrice(); + counterLine.setTax(); + counterLine.save(get_TrxName()); + } + log.fine(counter.toString()); + + // Document Action + if (counterDT != null) + { + if (counterDT.getDocAction() != null) + { + counter.setDocAction(counterDT.getDocAction()); + counter.processIt(counterDT.getDocAction()); + counter.save(get_TrxName()); + } + } + return counter; + } // createCounterDoc + + /** + * Void Document. + * Set Qtys to 0 - Sales: reverse all documents + * @return true if success + */ + public boolean voidIt() + { + log.info(toString()); + // Before Void + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_VOID); + if (m_processMsg != null) + return false; + + MOrderLine[] lines = getLines(true, "M_Product_ID"); + for (int i = 0; i < lines.length; i++) + { + MOrderLine line = lines[i]; + BigDecimal old = line.getQtyOrdered(); + if (old.signum() != 0) + { + line.addDescription(Msg.getMsg(getCtx(), "Voided") + " (" + old + ")"); + line.setQty(Env.ZERO); + line.setLineNetAmt(Env.ZERO); + line.save(get_TrxName()); + } + } + addDescription(Msg.getMsg(getCtx(), "Voided")); + // Clear Reservations + if (!reserveStock(null, lines)) + { + m_processMsg = "Cannot unreserve Stock (void)"; + return false; + } + + if (!createReversals()) + return false; + + //MZ Goodwill + if (!isSOTrx()) + { + // delete Matched PO Cost Detail + MOrderLine[] linesMZ = getLines(); + for (int i = 0; i < lines.length; i++) + { + MMatchPO[] mPO = MMatchPO.getOrderLine(getCtx(), linesMZ[i].getC_OrderLine_ID(), get_TrxName()); + // delete Cost Detail if the Matched PO has been deleted + if (mPO.length == 0) + { + MCostDetail cd = MCostDetail.get(getCtx(), "C_OrderLine_ID=? AND M_AttributeSetInstance_ID=?", + linesMZ[i].getC_OrderLine_ID(), linesMZ[i].getM_AttributeSetInstance_ID(), get_TrxName()); + if (cd != null) + { + cd.setProcessed(false); + cd.delete(true); + } + } + } + } + //End MZ + + // After Void + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_VOID); + if (m_processMsg != null) + return false; + + setProcessed(true); + setDocAction(DOCACTION_None); + return true; + } // voidIt + + /** + * Create Shipment/Invoice Reversals + * @return true if success + */ + private boolean createReversals() + { + // Cancel only Sales + if (!isSOTrx()) + return true; + + log.info("createReversals"); + StringBuffer info = new StringBuffer(); + + // Reverse All *Shipments* + info.append("@M_InOut_ID@:"); + MInOut[] shipments = getShipments(); + for (int i = 0; i < shipments.length; i++) + { + MInOut ship = shipments[i]; + // if closed - ignore + if (MInOut.DOCSTATUS_Closed.equals(ship.getDocStatus()) + || MInOut.DOCSTATUS_Reversed.equals(ship.getDocStatus()) + || MInOut.DOCSTATUS_Voided.equals(ship.getDocStatus()) ) + continue; + ship.set_TrxName(get_TrxName()); + + // If not completed - void - otherwise reverse it + if (!MInOut.DOCSTATUS_Completed.equals(ship.getDocStatus())) + { + if (ship.voidIt()) + ship.setDocStatus(MInOut.DOCSTATUS_Voided); + } + else if (ship.reverseCorrectIt()) // completed shipment + { + ship.setDocStatus(MInOut.DOCSTATUS_Reversed); + info.append(" ").append(ship.getDocumentNo()); + } + else + { + m_processMsg = "Could not reverse Shipment " + ship; + return false; + } + ship.setDocAction(MInOut.DOCACTION_None); + ship.save(get_TrxName()); + } // for all shipments + + // Reverse All *Invoices* + info.append(" - @C_Invoice_ID@:"); + MInvoice[] invoices = getInvoices(); + for (int i = 0; i < invoices.length; i++) + { + MInvoice invoice = invoices[i]; + // if closed - ignore + if (MInvoice.DOCSTATUS_Closed.equals(invoice.getDocStatus()) + || MInvoice.DOCSTATUS_Reversed.equals(invoice.getDocStatus()) + || MInvoice.DOCSTATUS_Voided.equals(invoice.getDocStatus()) ) + continue; + invoice.set_TrxName(get_TrxName()); + + // If not completed - void - otherwise reverse it + if (!MInvoice.DOCSTATUS_Completed.equals(invoice.getDocStatus())) + { + if (invoice.voidIt()) + invoice.setDocStatus(MInvoice.DOCSTATUS_Voided); + } + else if (invoice.reverseCorrectIt()) // completed invoice + { + invoice.setDocStatus(MInvoice.DOCSTATUS_Reversed); + info.append(" ").append(invoice.getDocumentNo()); + } + else + { + m_processMsg = "Could not reverse Invoice " + invoice; + return false; + } + invoice.setDocAction(MInvoice.DOCACTION_None); + invoice.save(get_TrxName()); + } // for all shipments + + m_processMsg = info.toString(); + return true; + } // createReversals + + + /** + * Close Document. + * Cancel not delivered Qunatities + * @return true if success + */ + public boolean closeIt() + { + log.info(toString()); + // Before Close + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_CLOSE); + if (m_processMsg != null) + return false; + + // Close Not delivered Qty - SO/PO + MOrderLine[] lines = getLines(true, "M_Product_ID"); + for (int i = 0; i < lines.length; i++) + { + MOrderLine line = lines[i]; + BigDecimal old = line.getQtyOrdered(); + if (old.compareTo(line.getQtyDelivered()) != 0) + { + line.setQtyLostSales(line.getQtyOrdered().subtract(line.getQtyDelivered())); + line.setQtyOrdered(line.getQtyDelivered()); + // QtyEntered unchanged + line.addDescription("Close (" + old + ")"); + line.save(get_TrxName()); + } + } + // Clear Reservations + if (!reserveStock(null, lines)) + { + m_processMsg = "Cannot unreserve Stock (close)"; + return false; + } + // After Close + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_CLOSE); + if (m_processMsg != null) + return false; + + setProcessed(true); + setDocAction(DOCACTION_None); + return true; + } // closeIt + + /** + * Reverse Correction - same void + * @return true if success + */ + public boolean reverseCorrectIt() + { + log.info(toString()); + // Before reverseCorrect + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSECORRECT); + if (m_processMsg != null) + return false; + + // After reverseCorrect + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSECORRECT); + if (m_processMsg != null) + return false; + + return voidIt(); + } // reverseCorrectionIt + + /** + * Reverse Accrual - none + * @return false + */ + public boolean reverseAccrualIt() + { + log.info(toString()); + // Before reverseAccrual + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSEACCRUAL); + if (m_processMsg != null) + return false; + + // After reverseAccrual + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSEACCRUAL); + if (m_processMsg != null) + return false; + + return false; + } // reverseAccrualIt + + /** + * Re-activate. + * @return true if success + */ + public boolean reActivateIt() + { + log.info(toString()); + // Before reActivate + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REACTIVATE); + if (m_processMsg != null) + return false; + + + + MDocType dt = MDocType.get(getCtx(), getC_DocType_ID()); + String DocSubTypeSO = dt.getDocSubTypeSO(); + + // Replace Prepay with POS to revert all doc + if (MDocType.DOCSUBTYPESO_PrepayOrder.equals (DocSubTypeSO)) + { + MDocType newDT = null; + MDocType[] dts = MDocType.getOfClient (getCtx()); + for (int i = 0; i < dts.length; i++) + { + MDocType type = dts[i]; + if (MDocType.DOCSUBTYPESO_PrepayOrder.equals(type.getDocSubTypeSO())) + { + if (type.isDefault() || newDT == null) + newDT = type; + } + } + if (newDT == null) + return false; + else + setC_DocType_ID (newDT.getC_DocType_ID()); + } + + // PO - just re-open + if (!isSOTrx()) + log.info("Existing documents not modified - " + dt); + // Reverse Direct Documents + else if (MDocType.DOCSUBTYPESO_OnCreditOrder.equals(DocSubTypeSO) // (W)illCall(I)nvoice + || MDocType.DOCSUBTYPESO_WarehouseOrder.equals(DocSubTypeSO) // (W)illCall(P)ickup + || MDocType.DOCSUBTYPESO_POSOrder.equals(DocSubTypeSO)) // (W)alkIn(R)eceipt + { + if (!createReversals()) + return false; + } + else + { + log.info("Existing documents not modified - SubType=" + DocSubTypeSO); + } + // After reActivate + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REACTIVATE); + if (m_processMsg != null) + return false; + + setDocAction(DOCACTION_Complete); + setProcessed(false); + return true; + } // reActivateIt + + + /************************************************************************* + * Get Summary + * @return Summary of Document + */ + public String getSummary() + { + StringBuffer sb = new StringBuffer(); + sb.append(getDocumentNo()); + // : Grand Total = 123.00 (#1) + sb.append(": "). + append(Msg.translate(getCtx(),"GrandTotal")).append("=").append(getGrandTotal()); + if (m_lines != null) + sb.append(" (#").append(m_lines.length).append(")"); + // - Description + if (getDescription() != null && getDescription().length() > 0) + sb.append(" - ").append(getDescription()); + return sb.toString(); + } // getSummary + + /** + * Get Process Message + * @return clear text error message + */ + public String getProcessMsg() + { + return m_processMsg; + } // getProcessMsg + + /** + * Get Document Owner (Responsible) + * @return AD_User_ID + */ + public int getDoc_User_ID() + { + return getSalesRep_ID(); + } // getDoc_User_ID + + /** + * Get Document Approval Amount + * @return amount + */ + public BigDecimal getApprovalAmt() + { + return getGrandTotal(); + } // getApprovalAmt + +} // MOrder diff --git a/posterita/posterita/src/main/org/compiere/model/MPOS.java b/posterita/posterita/src/main/org/compiere/model/MPOS.java new file mode 100644 index 0000000000..b284c90ab8 --- /dev/null +++ b/posterita/posterita/src/main/org/compiere/model/MPOS.java @@ -0,0 +1,134 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program 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 General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.sql.*; +import java.util.*; +import org.compiere.util.*; + + +/** + * POS Terminal definition + * + * @author Jorg Janke + * @version $Id: MPOS.java,v 1.3 2006/07/30 00:51:05 jjanke Exp $ + */ +public class MPOS extends X_C_POS +{ + /** + * Get POS from Cache + * @param ctx context + * @param C_POS_ID id + * @return MPOS + */ + public static MPOS get (Properties ctx, int C_POS_ID) + { + Integer key = new Integer (C_POS_ID); + MPOS retValue = (MPOS) s_cache.get (key); + if (retValue != null) + return retValue; + retValue = new MPOS (ctx, C_POS_ID, null); + if (retValue.get_ID () != 0) + s_cache.put (key, retValue); + return retValue; + } // get + + /** Cache */ + private static CCache s_cache = new CCache("C_POS", 20); + + /** + * Standard Constructor + * @param ctx context + * @param C_POS_ID id + * @param trxName transaction + */ + public MPOS (Properties ctx, int C_POS_ID, String trxName) + { + super (ctx, C_POS_ID, trxName); + if (C_POS_ID == 0) + { + // setName (null); + // setSalesRep_ID (0); + // setC_CashBook_ID (0); + // setM_PriceList_ID (0); + setIsModifyPrice (false); // N + // setM_Warehouse_ID (0); + } + } // MPOS + + /** + * Load Constructor + * @param ctx context + * @param rs result set + * @param trxName transaction + */ + public MPOS (Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } // MPOS + + /** Cash Business Partner */ + private MBPartner m_template = null; + + + + /** + * Before Save + * @param newRecord new + * @return true + */ + protected boolean beforeSave (boolean newRecord) + { + // Org Consistency + if (newRecord + || is_ValueChanged("C_CashBook_ID") || is_ValueChanged("M_Warehouse_ID")) + { + MCashBook cb = MCashBook.get(getCtx(), getC_CashBook_ID(), get_TrxName()); + if (cb.getAD_Org_ID() != getAD_Org_ID()) + { + log.saveError("Error", Msg.parseTranslation(getCtx(), "@AD_Org_ID@: @C_CashBook_ID@")); + return false; + } + MWarehouse wh = MWarehouse.get(getCtx(), getM_Warehouse_ID(), get_TrxName()); + if (wh.getAD_Org_ID() != getAD_Org_ID()) + { + log.saveError("Error", Msg.parseTranslation(getCtx(), "@AD_Org_ID@: @M_Warehouse_ID@")); + return false; + } + } + return true; + } // beforeSave + + + /** + * Get default Cash BPartner + * @return BPartner + */ + public MBPartner getBPartner() + { + if (m_template == null) + { + if (getC_BPartnerCashTrx_ID() == 0) + m_template = MBPartner.getBPartnerCashTrx (getCtx(), getAD_Client_ID()); + else + m_template = new MBPartner(getCtx(), getC_BPartnerCashTrx_ID(), get_TrxName()); + log.fine("getBPartner - " + m_template); + } + return m_template; + } // getBPartner + +} // MPOS diff --git a/posterita/posterita/src/main/org/compiere/model/MPOSTerminal.java b/posterita/posterita/src/main/org/compiere/model/MPOSTerminal.java new file mode 100644 index 0000000000..635585b003 --- /dev/null +++ b/posterita/posterita/src/main/org/compiere/model/MPOSTerminal.java @@ -0,0 +1,137 @@ +/****************************************************************************** + * Product: Posterita Web-Based POS and Adempiere Plugin * + * Copyright (C) 2008 Posterita Ltd * + * This file is part of POSterita * + * * + * POSterita is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * + *****************************************************************************/ +package org.compiere.model; + +import java.sql.ResultSet; +import java.sql.Timestamp; +import java.util.Properties; + +import org.compiere.util.CCache; + +/** + * @author Ashley G Ramdass + * + */ +public class MPOSTerminal extends X_U_POSTerminal +{ + /** Cache */ + static private CCache s_cache = new CCache("U_POSTerminal", 10, 60); + + /** + * @param ctx Context + * @param rs Result Set + * @param trxName Transaction + */ + public MPOSTerminal(Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } + + /** + * @param ctx + * @param U_POSTerminal_ID + * @param trxName + */ + public MPOSTerminal(Properties ctx, int U_POSTerminal_ID, String trxName) + { + super(ctx, U_POSTerminal_ID, trxName); + } + + /** + * @param ctx Context + * @param U_POSTerminal_ID Terminal ID + * @return Terminal + */ + public static MPOSTerminal get(Properties ctx, int U_POSTerminal_ID) + { + Integer key = new Integer(U_POSTerminal_ID); + MPOSTerminal retValue = (MPOSTerminal)s_cache.get(key); + if (retValue == null) + { + retValue = new MPOSTerminal (ctx, U_POSTerminal_ID, null); + if (retValue.get_ID() <= 0) + { + return null; + } + s_cache.put(key, retValue); + } + + checkLock(retValue); + return retValue; + } + + protected void loadComplete(boolean success) + { + if (success) + { + checkLock(this); + } + } + + public static void checkLock(MPOSTerminal terminal) + { + if (terminal.isLocked()) + { + Timestamp currentTime = new Timestamp(System.currentTimeMillis()); + if (terminal.getUnlockingTime() != null && currentTime.after(terminal.getUnlockingTime())) + { + terminal.setLocked(false); + } + + if (terminal.getLastLockTime() != null && terminal.getLockTime() > 0) + { + long timeToUnlock = terminal.getLastLockTime().getTime() + (terminal.getLockTime() * 60 * 1000); + if (currentTime.after(new Timestamp(timeToUnlock))) + { + terminal.setLocked(false); + } + } + terminal.save(); + } + } + + /** + * @see org.compiere.model.PO#beforeSave(boolean) + */ + protected boolean beforeSave(boolean newRecord) + { + if (is_ValueChanged(COLUMNNAME_Locked) && isLocked()) + { + setLastLockTime(new Timestamp(System.currentTimeMillis())); + } + + return true; + } + + /** + * @see org.compiere.model.PO#afterSave(boolean, boolean) + */ + protected boolean afterSave(boolean newRecord, boolean success) + { + success = super.afterSave(newRecord, success); + + if (success) + { + s_cache.remove(new Integer(get_ID())); + } + + return success; + } +} diff --git a/posterita/posterita/src/main/org/compiere/model/MPayment.java b/posterita/posterita/src/main/org/compiere/model/MPayment.java new file mode 100644 index 0000000000..e657ce317d --- /dev/null +++ b/posterita/posterita/src/main/org/compiere/model/MPayment.java @@ -0,0 +1,2467 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program 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 General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.io.*; +import java.math.*; +import java.rmi.*; +import java.sql.*; +import java.util.*; +import java.util.logging.*; + +import org.compiere.db.*; +import org.compiere.interfaces.*; +import org.compiere.process.*; +import org.compiere.util.*; + +/** + * Payment Model. + * - retrieve and create payments for invoice + *
    + *  Event chain
    + *  - Payment inserted
    + *      C_Payment_Trg fires
    + *          update DocumentNo with payment summary
    + *  - Payment posted (C_Payment_Post)
    + *      create allocation line
    + *          C_Allocation_Trg fires
    + *              Update C_BPartner Open Item Amount
    + *      update invoice (IsPaid)
    + *      link invoice-payment if batch
    + *
    + *  Lifeline:
    + *  -   Created by VPayment or directly
    + *  -   When changed in VPayment
    + *      - old payment is reversed
    + *      - new payment created
    + *
    + *  When Payment is posed, the Allocation is made
    + *  
    + * @author Jorg Janke + * @version $Id: MPayment.java,v 1.4 2006/10/02 05:18:39 jjanke Exp $ + */ +public final class MPayment extends X_C_Payment + implements DocAction, ProcessCall +{ + /** + * Get Payments Of BPartner + * @param ctx context + * @param C_BPartner_ID id + * @param trxName transaction + * @return array + */ + public static MPayment[] getOfBPartner (Properties ctx, int C_BPartner_ID, String trxName) + { + ArrayList list = new ArrayList(); + String sql = "SELECT * FROM C_Payment WHERE C_BPartner_ID=?"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement(sql, trxName); + pstmt.setInt(1, C_BPartner_ID); + ResultSet rs = pstmt.executeQuery(); + while (rs.next()) + list.add(new MPayment(ctx,rs, trxName)); + rs.close(); + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + s_log.log(Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + + // + MPayment[] retValue = new MPayment[list.size()]; + list.toArray(retValue); + return retValue; + } // getOfBPartner + + + /************************************************************************** + * Default Constructor + * @param ctx context + * @param C_Payment_ID payment to load, (0 create new payment) + * @param trxName trx name + */ + public MPayment (Properties ctx, int C_Payment_ID, String trxName) + { + super (ctx, C_Payment_ID, trxName); + // New + if (C_Payment_ID == 0) + { + setDocAction(DOCACTION_Complete); + setDocStatus(DOCSTATUS_Drafted); + setTrxType(TRXTYPE_Sales); + // + setR_AvsAddr (R_AVSZIP_Unavailable); + setR_AvsZip (R_AVSZIP_Unavailable); + // + setIsReceipt (true); + setIsApproved (false); + setIsReconciled (false); + setIsAllocated(false); + setIsOnline (false); + setIsSelfService(false); + setIsDelayedCapture (false); + setIsPrepayment(false); + setProcessed(false); + setProcessing(false); + setPosted (false); + // + setPayAmt(Env.ZERO); + setDiscountAmt(Env.ZERO); + setTaxAmt(Env.ZERO); + setWriteOffAmt(Env.ZERO); + setIsOverUnderPayment (false); + setOverUnderAmt(Env.ZERO); + // + setDateTrx (new Timestamp(System.currentTimeMillis())); + setDateAcct (getDateTrx()); + setTenderType(TENDERTYPE_Check); + } + } // MPayment + + /** + * Load Constructor + * @param ctx context + * @param rs result set record + * @param trxName transaction + */ + public MPayment (Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } // MPayment + + /** Temporary Payment Processors */ + private MPaymentProcessor[] m_mPaymentProcessors = null; + /** Temporary Payment Processor */ + private MPaymentProcessor m_mPaymentProcessor = null; + /** Logger */ + private static CLogger s_log = CLogger.getCLogger (MPayment.class); + /** Error Message */ + private String m_errorMessage = null; + + /** Reversal Indicator */ + public static String REVERSE_INDICATOR = "^"; + + /** + * Reset Payment to new status + */ + public void resetNew() + { + setC_Payment_ID(0); // forces new Record + set_ValueNoCheck ("DocumentNo", null); + setDocAction(DOCACTION_Prepare); + setDocStatus(DOCSTATUS_Drafted); + setProcessed(false); + setPosted (false); + setIsReconciled (false); + setIsAllocated(false); + setIsOnline(false); + setIsDelayedCapture (false); + // setC_BPartner_ID(0); + setC_Invoice_ID(0); + setC_Order_ID(0); + setC_Charge_ID(0); + setC_Project_ID(0); + setIsPrepayment(false); + } // resetNew + + /** + * Is Cashbook Transfer Trx + * @return true if Cash Trx + */ + public boolean isCashTrx() + { + return "X".equals(getTenderType()); + } // isCashTrx + + /************************************************************************** + * Set Credit Card. + * Need to set PatmentProcessor after Amount/Currency Set + * + * @param TrxType Transaction Type see TRX_ + * @param creditCardType CC type + * @param creditCardNumber CC number + * @param creditCardVV CC verification + * @param creditCardExpMM CC Exp MM + * @param creditCardExpYY CC Exp YY + * @return true if valid + */ + public boolean setCreditCard (String TrxType, String creditCardType, String creditCardNumber, + String creditCardVV, int creditCardExpMM, int creditCardExpYY) + { + setTenderType(TENDERTYPE_CreditCard); + setTrxType(TrxType); + // + setCreditCardType (creditCardType); + setCreditCardNumber (creditCardNumber); + setCreditCardVV (creditCardVV); + setCreditCardExpMM (creditCardExpMM); + setCreditCardExpYY (creditCardExpYY); + // + int check = MPaymentValidate.validateCreditCardNumber(creditCardNumber, creditCardType).length() + + MPaymentValidate.validateCreditCardExp(creditCardExpMM, creditCardExpYY).length(); + if (creditCardVV.length() > 0) + check += MPaymentValidate.validateCreditCardVV(creditCardVV, creditCardType).length(); + return check == 0; + } // setCreditCard + + /** + * Set Credit Card - Exp. + * Need to set PatmentProcessor after Amount/Currency Set + * + * @param TrxType Transaction Type see TRX_ + * @param creditCardType CC type + * @param creditCardNumber CC number + * @param creditCardVV CC verification + * @param creditCardExp CC Exp + * @return true if valid + */ + public boolean setCreditCard (String TrxType, String creditCardType, String creditCardNumber, + String creditCardVV, String creditCardExp) + { + return setCreditCard(TrxType, creditCardType, creditCardNumber, + creditCardVV, MPaymentValidate.getCreditCardExpMM(creditCardExp), + MPaymentValidate.getCreditCardExpYY(creditCardExp)); + } // setCreditCard + + /** + * Set ACH BankAccount Info + * + * @param C_BankAccount_ID bank account + * @param isReceipt true if receipt + * @return true if valid + */ + public boolean setBankACH (MPaySelectionCheck preparedPayment) + { + // Our Bank + setC_BankAccount_ID(preparedPayment.getParent().getC_BankAccount_ID()); + // Target Bank + int C_BP_BankAccount_ID = preparedPayment.getC_BP_BankAccount_ID(); + MBPBankAccount ba = new MBPBankAccount (preparedPayment.getCtx(), C_BP_BankAccount_ID, null); + setRoutingNo(ba.getRoutingNo()); + setAccountNo(ba.getAccountNo()); + setIsReceipt (X_C_Order.PAYMENTRULE_DirectDebit.equals // AR only + (preparedPayment.getPaymentRule())); + // + int check = MPaymentValidate.validateRoutingNo(getRoutingNo()).length() + + MPaymentValidate.validateAccountNo(getAccountNo()).length(); + return check == 0; + } // setBankACH + + /** + * Set ACH BankAccount Info + * + * @param C_BankAccount_ID bank account + * @param isReceipt true if receipt + * @param tenderType - Direct Debit or Direct Deposit + * @param routingNo routing + * @param accountNo account + * @return true if valid + */ + public boolean setBankACH (int C_BankAccount_ID, boolean isReceipt, String tenderType, + String routingNo, String accountNo) + { + setTenderType (tenderType); + setIsReceipt (isReceipt); + // + if (C_BankAccount_ID > 0 + && (routingNo == null || routingNo.length() == 0 || accountNo == null || accountNo.length() == 0)) + setBankAccountDetails(C_BankAccount_ID); + else + { + setC_BankAccount_ID(C_BankAccount_ID); + setRoutingNo (routingNo); + setAccountNo (accountNo); + } + setCheckNo (""); + // + int check = MPaymentValidate.validateRoutingNo(routingNo).length() + + MPaymentValidate.validateAccountNo(accountNo).length(); + return check == 0; + } // setBankACH + + /** + * Set Check BankAccount Info + * + * @param C_BankAccount_ID bank account + * @param isReceipt true if receipt + * @param checkNo chack no + * @return true if valid + */ + public boolean setBankCheck (int C_BankAccount_ID, boolean isReceipt, String checkNo) + { + return setBankCheck (C_BankAccount_ID, isReceipt, null, null, checkNo); + } // setBankCheck + + /** + * Set Check BankAccount Info + * + * @param C_BankAccount_ID bank account + * @param isReceipt true if receipt + * @param routingNo routing no + * @param accountNo account no + * @param checkNo chack no + * @return true if valid + */ + public boolean setBankCheck (int C_BankAccount_ID, boolean isReceipt, + String routingNo, String accountNo, String checkNo) + { + setTenderType (TENDERTYPE_Check); + setIsReceipt (isReceipt); + // + if (C_BankAccount_ID > 0 + && (routingNo == null || routingNo.length() == 0 + || accountNo == null || accountNo.length() == 0)) + setBankAccountDetails(C_BankAccount_ID); + else + { + setC_BankAccount_ID(C_BankAccount_ID); + setRoutingNo (routingNo); + setAccountNo (accountNo); + } + setCheckNo (checkNo); + // + int check = MPaymentValidate.validateRoutingNo(routingNo).length() + + MPaymentValidate.validateAccountNo(accountNo).length() + + MPaymentValidate.validateCheckNo(checkNo).length(); + return check == 0; // no error message + } // setBankCheck + + /** + * Set Bank Account Details. + * Look up Routing No & Bank Acct No + * @param C_BankAccount_ID bank account + */ + public void setBankAccountDetails (int C_BankAccount_ID) + { + if (C_BankAccount_ID == 0) + return; + setC_BankAccount_ID(C_BankAccount_ID); + // + String sql = "SELECT b.RoutingNo, ba.AccountNo " + + "FROM C_BankAccount ba" + + " INNER JOIN C_Bank b ON (ba.C_Bank_ID=b.C_Bank_ID) " + + "WHERE C_BankAccount_ID=?"; + try + { + PreparedStatement pstmt = DB.prepareStatement(sql, get_TrxName()); + pstmt.setInt(1, C_BankAccount_ID); + ResultSet rs = pstmt.executeQuery(); + if (rs.next()) + { + setRoutingNo (rs.getString(1)); + setAccountNo (rs.getString(2)); + } + rs.close(); + pstmt.close(); + } + catch (SQLException e) + { + log.log(Level.SEVERE, sql, e); + } + } // setBankAccountDetails + + /** + * Set Account Address + * + * @param name name + * @param street street + * @param city city + * @param state state + * @param zip zip + * @param country country + */ + public void setAccountAddress (String name, String street, + String city, String state, String zip, String country) + { + setA_Name (name); + setA_Street (street); + setA_City (city); + setA_State (state); + setA_Zip (zip); + setA_Country(country); + } // setAccountAddress + + + /************************************************************************** + * Process Payment + * @return true if approved + */ + public boolean processOnline() + { + log.info ("Amt=" + getPayAmt()); + // + setIsOnline(true); + setErrorMessage(null); + // prevent charging twice + if (isApproved()) + { + log.info("Already processed - " + getR_Result() + " - " + getR_RespMsg()); + setErrorMessage("Payment already Processed"); + return true; + } + + if (m_mPaymentProcessor == null) + setPaymentProcessor(); + if (m_mPaymentProcessor == null) + { + log.log(Level.WARNING, "No Payment Processor Model"); + setErrorMessage("No Payment Processor Model"); + return false; + } + + boolean approved = false; + /** Process Payment on Server */ + if (DB.isRemoteObjects()) + { + Server server = CConnection.get().getServer(); + try + { + if (server != null) + { // See ServerBean + String trxName = null; // unconditionally save + save(trxName); // server reads from disk + approved = server.paymentOnline (getCtx(), getC_Payment_ID(), + m_mPaymentProcessor.getC_PaymentProcessor_ID(), trxName); + if (CLogMgt.isLevelFinest()) + s_log.fine("server => " + approved); + load(trxName); // server saves to disk + setIsApproved(approved); + return approved; + } + log.log(Level.WARNING, "AppsServer not found"); + } + catch (RemoteException ex) + { + log.log(Level.SEVERE, "AppsServer error", ex); + } + } + /** **/ + + // Try locally + try + { + PaymentProcessor pp = PaymentProcessor.create(m_mPaymentProcessor, this); + if (pp == null) + setErrorMessage("No Payment Processor"); + else + { + approved = pp.processCC (); + if (approved) + setErrorMessage(null); + else + setErrorMessage("From " + getCreditCardName() + ": " + getR_RespMsg()); + } + } + catch (Exception e) + { + log.log(Level.SEVERE, "processOnline", e); + setErrorMessage("Payment Processor Error"); + } + setIsApproved(approved); + return approved; + } // processOnline + + /** + * Process Online Payment. + * implements ProcessCall after standard constructor + * Called when pressing the Process_Online button in C_Payment + * + * @param ctx Context + * @param pi Process Info + * @param trx transaction + * @return true if the next process should be performed + */ + public boolean startProcess (Properties ctx, ProcessInfo pi, Trx trx) + { + log.info("startProcess - " + pi.getRecord_ID()); + boolean retValue = false; + // + if (pi.getRecord_ID() != get_ID()) + { + log.log(Level.SEVERE, "startProcess - Not same Payment - " + pi.getRecord_ID()); + return false; + } + // Process it + retValue = processOnline(); + save(); + return retValue; // Payment processed + } // startProcess + + + /** + * Before Save + * @param newRecord new + * @return save + */ + protected boolean beforeSave (boolean newRecord) + { + // @Trifon - CashPayments + //if ( getTenderType().equals("X") ) { + if ( isCashTrx() ) { + // Cash Book Is mandatory + if ( getC_CashBook_ID() <= 0 ) { + log.saveError("Error", Msg.parseTranslation(getCtx(), "@Mandatory@: @C_CashBook_ID@")); + return false; + } + } else { + // Bank Account Is mandatory + if ( getC_BankAccount_ID() <= 0 ) { + log.saveError("Error", Msg.parseTranslation(getCtx(), "@Mandatory@: @C_BankAccount_ID@")); + return false; + } + } + // end @Trifon - CashPayments + + // We have a charge + if (getC_Charge_ID() != 0) + { + if (newRecord || is_ValueChanged("C_Charge_ID")) + { + setC_Order_ID(0); + setC_Invoice_ID(0); + setWriteOffAmt(Env.ZERO); + setDiscountAmt(Env.ZERO); + setIsOverUnderPayment(false); + setOverUnderAmt(Env.ZERO); + setIsPrepayment(false); + } + } + // We need a BPartner + else if (getC_BPartner_ID() == 0 && !isCashTrx()) + { + if (getC_Invoice_ID() != 0) + ; + else if (getC_Order_ID() != 0) + ; + else + { + log.saveError("Error", Msg.parseTranslation(getCtx(), "@NotFound@: @C_BPartner_ID@")); + return false; + } + } + // Prepayment: No charge and order or project (not as acct dimension) + if (newRecord + || is_ValueChanged("C_Charge_ID") || is_ValueChanged("C_Invoice_ID") + || is_ValueChanged("C_Order_ID") || is_ValueChanged("C_Project_ID")) + setIsPrepayment (getC_Charge_ID() == 0 + && getC_BPartner_ID() != 0 + && (getC_Order_ID() != 0 + || (getC_Project_ID() != 0 && getC_Invoice_ID() == 0))); + if (isPrepayment()) + { + if (newRecord + || is_ValueChanged("C_Order_ID") || is_ValueChanged("C_Project_ID")) + { + setWriteOffAmt(Env.ZERO); + setDiscountAmt(Env.ZERO); + setIsOverUnderPayment(false); + setOverUnderAmt(Env.ZERO); + } + } + + // Document Type/Receipt + if (getC_DocType_ID() == 0) + setC_DocType_ID(); + else + { + MDocType dt = MDocType.get(getCtx(), getC_DocType_ID()); + setIsReceipt(dt.isSOTrx()); + } + setDocumentNo(); + // + if (getDateAcct() == null) + setDateAcct(getDateTrx()); + // + if (!isOverUnderPayment()) + setOverUnderAmt(Env.ZERO); + + // Organization + if ((newRecord || is_ValueChanged("C_BankAccount_ID")) + && getC_Charge_ID() == 0) // allow different org for charge + { + MBankAccount ba = MBankAccount.get(getCtx(), getC_BankAccount_ID()); + if (ba.getAD_Org_ID() != 0) + setAD_Org_ID(ba.getAD_Org_ID()); + } + + // [ adempiere-Bugs-1885417 ] Validate BP on Payment Prepare or BeforeSave + // there is bp and (invoice or order) + if (getC_BPartner_ID() != 0 && (getC_Invoice_ID() != 0 || getC_Order_ID() != 0)) { + if (getC_Invoice_ID() != 0) { + MInvoice inv = new MInvoice(getCtx(), getC_Invoice_ID(), get_TrxName()); + if (inv.getC_BPartner_ID() != getC_BPartner_ID()) { + log.saveError("Error", Msg.parseTranslation(getCtx(), "BP different from BP Invoice")); + return false; + } + } + if (getC_Order_ID() != 0) { + MOrder ord = new MOrder(getCtx(), getC_Order_ID(), get_TrxName()); + if (ord.getC_BPartner_ID() != getC_BPartner_ID()) { + log.saveError("Error", Msg.parseTranslation(getCtx(), "BP different from BP Order")); + return false; + } + } + } + + return true; + } // beforeSave + + /** + * Get Allocated Amt in Payment Currency + * @return amount or null + */ + public BigDecimal getAllocatedAmt () + { + BigDecimal retValue = null; + if (getC_Charge_ID() != 0) + return getPayAmt(); + // + String sql = "SELECT SUM(currencyConvert(al.Amount," + + "ah.C_Currency_ID, p.C_Currency_ID,ah.DateTrx,p.C_ConversionType_ID, al.AD_Client_ID,al.AD_Org_ID)) " + + "FROM C_AllocationLine al" + + " INNER JOIN C_AllocationHdr ah ON (al.C_AllocationHdr_ID=ah.C_AllocationHdr_ID) " + + " INNER JOIN C_Payment p ON (al.C_Payment_ID=p.C_Payment_ID) " + + "WHERE al.C_Payment_ID=?" + + " AND ah.IsActive='Y' AND al.IsActive='Y'"; + // + " AND al.C_Invoice_ID IS NOT NULL"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement(sql, get_TrxName()); + pstmt.setInt(1, getC_Payment_ID()); + ResultSet rs = pstmt.executeQuery(); + if (rs.next()) + retValue = rs.getBigDecimal(1); + rs.close(); + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + log.log(Level.SEVERE, "getAllocatedAmt", e); + } + try + { + if (pstmt != null) + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + // log.fine("getAllocatedAmt - " + retValue); + // ? ROUND(NVL(v_AllocatedAmt,0), 2); + return retValue; + } // getAllocatedAmt + + /** + * Test Allocation (and set allocated flag) + * @return true if updated + */ + public boolean testAllocation() + { + // Cash Trx always allocated!!! WHY??? +/* @Trifon - CashPayments + if (isCashTrx()) + { + if (!isAllocated()) + { + setIsAllocated(true); + return true; + } + return false; + } +*/ + // + BigDecimal alloc = getAllocatedAmt(); + if (alloc == null) + alloc = Env.ZERO; + BigDecimal total = getPayAmt(); + if (!isReceipt()) + total = total.negate(); + boolean test = total.compareTo(alloc) == 0; + boolean change = test != isAllocated(); + if (change) + setIsAllocated(test); + log.fine("Allocated=" + test + + " (" + alloc + "=" + total + ")"); + return change; + } // testAllocation + + /** + * Set Allocated Flag for payments + * @param ctx context + * @param C_BPartner_ID if 0 all + * @param trxName trx + */ + public static void setIsAllocated (Properties ctx, int C_BPartner_ID, String trxName) + { + int counter = 0; + String sql = "SELECT * FROM C_Payment " + + "WHERE IsAllocated='N' AND DocStatus IN ('CO','CL')"; + if (C_BPartner_ID > 1) + sql += " AND C_BPartner_ID=?"; + else + sql += " AND AD_Client_ID=" + Env.getAD_Client_ID(ctx); + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement (sql, trxName); + if (C_BPartner_ID > 1) + pstmt.setInt (1, C_BPartner_ID); + ResultSet rs = pstmt.executeQuery (); + while (rs.next ()) + { + MPayment pay = new MPayment (ctx, rs, trxName); + if (pay.testAllocation()) + if (pay.save()) + counter++; + } + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + s_log.log(Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + s_log.config("#" + counter); + } // setIsAllocated + + /************************************************************************** + * Set Error Message + * @param errorMessage error message + */ + public void setErrorMessage(String errorMessage) + { + m_errorMessage = errorMessage; + } // setErrorMessage + + /** + * Get Error Message + * @return error message + */ + public String getErrorMessage() + { + return m_errorMessage; + } // getErrorMessage + + + /** + * Set Bank Account for Payment. + * @param C_BankAccount_ID C_BankAccount_ID + */ + public void setC_BankAccount_ID (int C_BankAccount_ID) + { + if (C_BankAccount_ID == 0) + { + setPaymentProcessor(); + if (getC_BankAccount_ID() == 0) + throw new IllegalArgumentException("Can't find Bank Account"); + } + else + super.setC_BankAccount_ID(C_BankAccount_ID); + } // setC_BankAccount_ID + + /** + * Set BankAccount and PaymentProcessor + * @return true if found + */ + public boolean setPaymentProcessor () + { + return setPaymentProcessor (getTenderType(), getCreditCardType()); + } // setPaymentProcessor + + /** + * Set BankAccount and PaymentProcessor + * @param tender TenderType see TENDER_ + * @param CCType CC Type see CC_ + * @return true if found + */ + public boolean setPaymentProcessor (String tender, String CCType) + { + m_mPaymentProcessor = null; + // Get Processor List + if (m_mPaymentProcessors == null || m_mPaymentProcessors.length == 0) + m_mPaymentProcessors = MPaymentProcessor.find (getCtx(), tender, CCType, getAD_Client_ID(), + getC_Currency_ID(), getPayAmt(), get_TrxName()); + // Relax Amount + if (m_mPaymentProcessors == null || m_mPaymentProcessors.length == 0) + m_mPaymentProcessors = MPaymentProcessor.find (getCtx(), tender, CCType, getAD_Client_ID(), + getC_Currency_ID(), Env.ZERO, get_TrxName()); + if (m_mPaymentProcessors == null || m_mPaymentProcessors.length == 0) + return false; + + // Find the first right one + for (int i = 0; i < m_mPaymentProcessors.length; i++) + { + if (m_mPaymentProcessors[i].accepts (tender, CCType)) + { + m_mPaymentProcessor = m_mPaymentProcessors[i]; + } + } + if (m_mPaymentProcessor != null) + setC_BankAccount_ID (m_mPaymentProcessor.getC_BankAccount_ID()); + // + return m_mPaymentProcessor != null; + } // setPaymentProcessor + + + /** + * Get Accepted Credit Cards for PayAmt (default 0) + * @return credit cards + */ + public ValueNamePair[] getCreditCards () + { + return getCreditCards(getPayAmt()); + } // getCreditCards + + + /** + * Get Accepted Credit Cards for amount + * @param amt trx amount + * @return credit cards + */ + public ValueNamePair[] getCreditCards (BigDecimal amt) + { + try + { + if (m_mPaymentProcessors == null || m_mPaymentProcessors.length == 0) + m_mPaymentProcessors = MPaymentProcessor.find (getCtx (), null, null, + getAD_Client_ID (), getC_Currency_ID (), amt, get_TrxName()); + // + HashMap map = new HashMap(); // to eliminate duplicates + for (int i = 0; i < m_mPaymentProcessors.length; i++) + { + if (m_mPaymentProcessors[i].isAcceptAMEX ()) + map.put (CREDITCARDTYPE_Amex, getCreditCardPair (CREDITCARDTYPE_Amex)); + if (m_mPaymentProcessors[i].isAcceptDiners ()) + map.put (CREDITCARDTYPE_Diners, getCreditCardPair (CREDITCARDTYPE_Diners)); + if (m_mPaymentProcessors[i].isAcceptDiscover ()) + map.put (CREDITCARDTYPE_Discover, getCreditCardPair (CREDITCARDTYPE_Discover)); + if (m_mPaymentProcessors[i].isAcceptMC ()) + map.put (CREDITCARDTYPE_MasterCard, getCreditCardPair (CREDITCARDTYPE_MasterCard)); + if (m_mPaymentProcessors[i].isAcceptCorporate ()) + map.put (CREDITCARDTYPE_PurchaseCard, getCreditCardPair (CREDITCARDTYPE_PurchaseCard)); + if (m_mPaymentProcessors[i].isAcceptVisa ()) + map.put (CREDITCARDTYPE_Visa, getCreditCardPair (CREDITCARDTYPE_Visa)); + } // for all payment processors + // + ValueNamePair[] retValue = new ValueNamePair[map.size ()]; + map.values ().toArray (retValue); + log.fine("getCreditCards - #" + retValue.length + " - Processors=" + m_mPaymentProcessors.length); + return retValue; + } + catch (Exception ex) + { + ex.printStackTrace(); + return null; + } + } // getCreditCards + + /** + * Get Type and name pair + * @param CreditCardType credit card Type + * @return pair + */ + private ValueNamePair getCreditCardPair (String CreditCardType) + { + return new ValueNamePair (CreditCardType, getCreditCardName(CreditCardType)); + } // getCreditCardPair + + + /************************************************************************** + * Credit Card Number + * @param CreditCardNumber CreditCard Number + */ + public void setCreditCardNumber (String CreditCardNumber) + { + super.setCreditCardNumber (MPaymentValidate.checkNumeric(CreditCardNumber)); + } // setCreditCardNumber + + /** + * Verification Code + * @param newCreditCardVV CC verification + */ + public void setCreditCardVV(String newCreditCardVV) + { + super.setCreditCardVV (MPaymentValidate.checkNumeric(newCreditCardVV)); + } // setCreditCardVV + + /** + * Two Digit CreditCard MM + * @param CreditCardExpMM Exp month + */ + public void setCreditCardExpMM (int CreditCardExpMM) + { + if (CreditCardExpMM < 1 || CreditCardExpMM > 12) + ; + else + super.setCreditCardExpMM (CreditCardExpMM); + } // setCreditCardExpMM + + /** + * Two digit CreditCard YY (til 2020) + * @param newCreditCardExpYY 2 or 4 digit year + */ + public void setCreditCardExpYY (int newCreditCardExpYY) + { + int CreditCardExpYY = newCreditCardExpYY; + if (newCreditCardExpYY > 1999) + CreditCardExpYY = newCreditCardExpYY-2000; + super.setCreditCardExpYY(CreditCardExpYY); + } // setCreditCardExpYY + + /** + * CreditCard Exp MMYY + * @param mmyy Exp in form of mmyy + * @return true if valid + */ + public boolean setCreditCardExp (String mmyy) + { + if (MPaymentValidate.validateCreditCardExp(mmyy).length() != 0) + return false; + // + String exp = MPaymentValidate.checkNumeric(mmyy); + String mmStr = exp.substring(0,2); + String yyStr = exp.substring(2,4); + setCreditCardExpMM (Integer.parseInt(mmStr)); + setCreditCardExpYY (Integer.parseInt(yyStr)); + return true; + } // setCreditCardExp + + + /** + * CreditCard Exp MMYY + * @param delimiter / - or null + * @return Exp + */ + public String getCreditCardExp(String delimiter) + { + String mm = String.valueOf(getCreditCardExpMM()); + String yy = String.valueOf(getCreditCardExpYY()); + + StringBuffer retValue = new StringBuffer(); + if (mm.length() == 1) + retValue.append("0"); + retValue.append(mm); + // + if (delimiter != null) + retValue.append(delimiter); + // + if (yy.length() == 1) + retValue.append("0"); + retValue.append(yy); + // + return (retValue.toString()); + } // getCreditCardExp + + /** + * MICR + * @param MICR MICR + */ + public void setMicr (String MICR) + { + super.setMicr (MPaymentValidate.checkNumeric(MICR)); + } // setBankMICR + + /** + * Routing No + * @param RoutingNo Routing No + */ + public void setRoutingNo(String RoutingNo) + { + super.setRoutingNo (MPaymentValidate.checkNumeric(RoutingNo)); + } // setBankRoutingNo + + + /** + * Bank Account No + * @param AccountNo AccountNo + */ + public void setAccountNo (String AccountNo) + { + super.setAccountNo (MPaymentValidate.checkNumeric(AccountNo)); + } // setBankAccountNo + + + /** + * Check No + * @param CheckNo Check No + */ + public void setCheckNo(String CheckNo) + { + super.setCheckNo(MPaymentValidate.checkNumeric(CheckNo)); + } // setBankCheckNo + + + /** + * Set DocumentNo to Payment info. + * If there is a R_PnRef that is set automatically + */ + private void setDocumentNo() + { + // Cash Transfer + if ("X".equals(getTenderType())) + return; + // Current Document No + String documentNo = getDocumentNo(); + // Existing reversal + if (documentNo != null + && documentNo.indexOf(REVERSE_INDICATOR) >= 0) + return; + + // If external number exists - enforce it + if (getR_PnRef() != null && getR_PnRef().length() > 0) + { + if (!getR_PnRef().equals(documentNo)) + setDocumentNo(getR_PnRef()); + return; + } + + documentNo = ""; + // globalqss - read configuration to assign credit card or check number number for Payments + // Credit Card + if (TENDERTYPE_CreditCard.equals(getTenderType())) + { + if (MSysConfig.getBooleanValue("PAYMENT_OVERWRITE_DOCUMENTNO_WITH_CREDIT_CARD", true, getAD_Client_ID())) { + documentNo = getCreditCardType() + + " " + Obscure.obscure(getCreditCardNumber()) + + " " + getCreditCardExpMM() + + "/" + getCreditCardExpYY(); + } + } + // Own Check No + else if (TENDERTYPE_Check.equals(getTenderType()) + && !isReceipt() + && getCheckNo() != null && getCheckNo().length() > 0) + { + if (MSysConfig.getBooleanValue("PAYMENT_OVERWRITE_DOCUMENTNO_WITH_CHECK_ON_PAYMENT", true, getAD_Client_ID())) { + documentNo = getCheckNo(); + } + } + // Customer Check: Routing: Account #Check + else if (TENDERTYPE_Check.equals(getTenderType()) + && isReceipt()) + { + if (MSysConfig.getBooleanValue("PAYMENT_OVERWRITE_DOCUMENTNO_WITH_CHECK_ON_RECEIPT", true, getAD_Client_ID())) { + if (getRoutingNo() != null) + documentNo = getRoutingNo() + ": "; + if (getAccountNo() != null) + documentNo += getAccountNo(); + if (getCheckNo() != null) + { + if (documentNo.length() > 0) + documentNo += " "; + documentNo += "#" + getCheckNo(); + } + } + } + + // Set Document No + documentNo = documentNo.trim(); + if (documentNo.length() > 0) + setDocumentNo(documentNo); + } // setDocumentNo + + /** + * Set Refernce No (and Document No) + * @param R_PnRef reference + */ + public void setR_PnRef (String R_PnRef) + { + super.setR_PnRef (R_PnRef); + if (R_PnRef != null) + setDocumentNo (R_PnRef); + } // setR_PnRef + + // --------------- + + /** + * Set Payment Amount + * @param PayAmt Pay Amt + */ + public void setPayAmt (BigDecimal PayAmt) + { + super.setPayAmt(PayAmt == null ? Env.ZERO : PayAmt); + } // setPayAmt + + /** + * Set Payment Amount + * + * @param C_Currency_ID currency + * @param payAmt amount + */ + public void setAmount (int C_Currency_ID, BigDecimal payAmt) + { + if (C_Currency_ID == 0) + C_Currency_ID = MClient.get(getCtx()).getC_Currency_ID(); + setC_Currency_ID(C_Currency_ID); + setPayAmt(payAmt); + } // setAmount + + /** + * Discount Amt + * @param DiscountAmt Discount + */ + public void setDiscountAmt (BigDecimal DiscountAmt) + { + super.setDiscountAmt (DiscountAmt == null ? Env.ZERO : DiscountAmt); + } // setDiscountAmt + + /** + * WriteOff Amt + * @param WriteOffAmt WriteOff + */ + public void setWriteOffAmt (BigDecimal WriteOffAmt) + { + super.setWriteOffAmt (WriteOffAmt == null ? Env.ZERO : WriteOffAmt); + } // setWriteOffAmt + + /** + * OverUnder Amt + * @param OverUnderAmt OverUnder + */ + public void setOverUnderAmt (BigDecimal OverUnderAmt) + { + super.setOverUnderAmt (OverUnderAmt == null ? Env.ZERO : OverUnderAmt); + setIsOverUnderPayment(getOverUnderAmt().compareTo(Env.ZERO) != 0); + } // setOverUnderAmt + + /** + * Tax Amt + * @param TaxAmt Tax + */ + public void setTaxAmt (BigDecimal TaxAmt) + { + super.setTaxAmt (TaxAmt == null ? Env.ZERO : TaxAmt); + } // setTaxAmt + + /** + * Set Info from BP Bank Account + * @param ba BP bank account + */ + public void setBP_BankAccount (MBPBankAccount ba) + { + log.fine("" + ba); + if (ba == null) + return; + setC_BPartner_ID(ba.getC_BPartner_ID()); + setAccountAddress(ba.getA_Name(), ba.getA_Street(), ba.getA_City(), + ba.getA_State(), ba.getA_Zip(), ba.getA_Country()); + setA_EMail(ba.getA_EMail()); + setA_Ident_DL(ba.getA_Ident_DL()); + setA_Ident_SSN(ba.getA_Ident_SSN()); + // CC + if (ba.getCreditCardType() != null) + setCreditCardType(ba.getCreditCardType()); + if (ba.getCreditCardNumber() != null) + setCreditCardNumber(ba.getCreditCardNumber()); + if (ba.getCreditCardExpMM() != 0) + setCreditCardExpMM(ba.getCreditCardExpMM()); + if (ba.getCreditCardExpYY() != 0) + setCreditCardExpYY(ba.getCreditCardExpYY()); + if (ba.getCreditCardVV() != null) + setCreditCardVV(ba.getCreditCardVV()); + // Bank + if (ba.getAccountNo() != null) + setAccountNo(ba.getAccountNo()); + if (ba.getRoutingNo() != null) + setRoutingNo(ba.getRoutingNo()); + } // setBP_BankAccount + + /** + * Save Info from BP Bank Account + * @param ba BP bank account + * @return true if saved + */ + public boolean saveToBP_BankAccount (MBPBankAccount ba) + { + if (ba == null) + return false; + ba.setA_Name(getA_Name()); + ba.setA_Street(getA_Street()); + ba.setA_City(getA_City()); + ba.setA_State(getA_State()); + ba.setA_Zip(getA_Zip()); + ba.setA_Country(getA_Country()); + ba.setA_EMail(getA_EMail()); + ba.setA_Ident_DL(getA_Ident_DL()); + ba.setA_Ident_SSN(getA_Ident_SSN()); + // CC + ba.setCreditCardType(getCreditCardType()); + ba.setCreditCardNumber(getCreditCardNumber()); + ba.setCreditCardExpMM(getCreditCardExpMM()); + ba.setCreditCardExpYY(getCreditCardExpYY()); + ba.setCreditCardVV(getCreditCardVV()); + // Bank + if (getAccountNo() != null) + ba.setAccountNo(getAccountNo()); + if (getRoutingNo() != null) + ba.setRoutingNo(getRoutingNo()); + // Trx + ba.setR_AvsAddr(getR_AvsAddr()); + ba.setR_AvsZip(getR_AvsZip()); + // + boolean ok = ba.save(get_TrxName()); + log.fine("saveToBP_BankAccount - " + ba); + return ok; + } // setBP_BankAccount + + /** + * Set Doc Type bases on IsReceipt + */ + private void setC_DocType_ID () + { + setC_DocType_ID(isReceipt()); + } // setC_DocType_ID + + /** + * Set Doc Type + * @param isReceipt is receipt + */ + public void setC_DocType_ID (boolean isReceipt) + { + setIsReceipt(isReceipt); + String sql = "SELECT C_DocType_ID FROM C_DocType WHERE AD_Client_ID=? AND DocBaseType=? ORDER BY IsDefault DESC"; + try + { + PreparedStatement pstmt = DB.prepareStatement(sql, get_TrxName()); + pstmt.setInt(1, getAD_Client_ID()); + if (isReceipt) + pstmt.setString(2, X_C_DocType.DOCBASETYPE_ARReceipt); + else + pstmt.setString(2, X_C_DocType.DOCBASETYPE_APPayment); + ResultSet rs = pstmt.executeQuery(); + if (rs.next()) + setC_DocType_ID(rs.getInt(1)); + else + log.warning ("setDocType - NOT found - isReceipt=" + isReceipt); + rs.close(); + pstmt.close(); + } + catch (SQLException e) + { + log.log(Level.SEVERE, sql, e); + } + } // setC_DocType_ID + + + /** + * Set Document Type + * @param C_DocType_ID doc type + */ + public void setC_DocType_ID (int C_DocType_ID) + { + // if (getDocumentNo() != null && getC_DocType_ID() != C_DocType_ID) + // setDocumentNo(null); + super.setC_DocType_ID(C_DocType_ID); + } // setC_DocType_ID + + /** + * Verify Document Type with Invoice + * @return true if ok + */ + private boolean verifyDocType() + { + if (getC_DocType_ID() == 0) + return false; + // + Boolean invoiceSO = null; + // Check Invoice First + if (getC_Invoice_ID() > 0) + { + String sql = "SELECT idt.IsSOTrx " + + "FROM C_Invoice i" + + " INNER JOIN C_DocType idt ON (i.C_DocType_ID=idt.C_DocType_ID) " + + "WHERE i.C_Invoice_ID=?"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement(sql, get_TrxName()); + pstmt.setInt(1, getC_Invoice_ID()); + ResultSet rs = pstmt.executeQuery(); + if (rs.next()) + invoiceSO = new Boolean ("Y".equals(rs.getString(1))); + rs.close(); + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + log.log(Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + } // Invoice + + // DocumentType + Boolean paymentSO = null; + PreparedStatement pstmt = null; + String sql = "SELECT IsSOTrx " + + "FROM C_DocType " + + "WHERE C_DocType_ID=?"; + try + { + pstmt = DB.prepareStatement(sql, get_TrxName()); + pstmt.setInt(1, getC_DocType_ID()); + ResultSet rs = pstmt.executeQuery(); + if (rs.next()) + paymentSO = new Boolean ("Y".equals(rs.getString(1))); + rs.close(); + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + log.log(Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + // No Payment info + if (paymentSO == null) + return false; + setIsReceipt(paymentSO.booleanValue()); + + // We have an Invoice .. and it does not match + if (invoiceSO != null + && invoiceSO.booleanValue() != paymentSO.booleanValue()) + return false; + // OK + return true; + } // verifyDocType + + + /** + * Get ISO Code of Currency + * @return Currency ISO + */ + public String getCurrencyISO() + { + return MCurrency.getISO_Code (getCtx(), getC_Currency_ID()); + } // getCurrencyISO + + /** + * Get Document Status + * @return Document Status Clear Text + */ + public String getDocStatusName() + { + return MRefList.getListName(getCtx(), 131, getDocStatus()); + } // getDocStatusName + + /** + * Get Name of Credit Card + * @return Name + */ + public String getCreditCardName() + { + return getCreditCardName(getCreditCardType()); + } // getCreditCardName + + /** + * Get Name of Credit Card + * @param CreditCardType credit card type + * @return Name + */ + public String getCreditCardName(String CreditCardType) + { + if (CreditCardType == null) + return "--"; + else if (CREDITCARDTYPE_MasterCard.equals(CreditCardType)) + return "MasterCard"; + else if (CREDITCARDTYPE_Visa.equals(CreditCardType)) + return "Visa"; + else if (CREDITCARDTYPE_Amex.equals(CreditCardType)) + return "Amex"; + else if (CREDITCARDTYPE_ATM.equals(CreditCardType)) + return "ATM"; + else if (CREDITCARDTYPE_Diners.equals(CreditCardType)) + return "Diners"; + else if (CREDITCARDTYPE_Discover.equals(CreditCardType)) + return "Discover"; + else if (CREDITCARDTYPE_PurchaseCard.equals(CreditCardType)) + return "PurchaseCard"; + return "?" + CreditCardType + "?"; + } // getCreditCardName + + /** + * Add to Description + * @param description text + */ + public void addDescription (String description) + { + String desc = getDescription(); + if (desc == null) + setDescription(description); + else + setDescription(desc + " | " + description); + } // addDescription + + + /** + * Get Pay Amt + * @param absolute if true the absolute amount (i.e. negative if payment) + * @return amount + */ + public BigDecimal getPayAmt (boolean absolute) + { + if (isReceipt()) + return super.getPayAmt(); + return super.getPayAmt().negate(); + } // getPayAmt + + /** + * Get Pay Amt in cents + * @return amount in cents + */ + public int getPayAmtInCents () + { + BigDecimal bd = super.getPayAmt().multiply(Env.ONEHUNDRED); + return bd.intValue(); + } // getPayAmtInCents + + /************************************************************************** + * Process document + * @param processAction document action + * @return true if performed + */ + public boolean processIt (String processAction) + { + m_processMsg = null; + DocumentEngine engine = new DocumentEngine (this, getDocStatus()); + return engine.processIt (processAction, getDocAction()); + } // process + + /** Process Message */ + private String m_processMsg = null; + /** Just Prepared Flag */ + private boolean m_justPrepared = false; + + /** + * Unlock Document. + * @return true if success + */ + public boolean unlockIt() + { + log.info(toString()); + setProcessing(false); + return true; + } // unlockIt + + /** + * Invalidate Document + * @return true if success + */ + public boolean invalidateIt() + { + log.info(toString()); + setDocAction(DOCACTION_Prepare); + return true; + } // invalidateIt + + + /************************************************************************** + * Prepare Document + * @return new status (In Progress or Invalid) + */ + public String prepareIt() + { + log.info(toString()); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_PREPARE); + if (m_processMsg != null) + return DocAction.STATUS_Invalid; + + // Std Period open? + if (!MPeriod.isOpen(getCtx(), getDateAcct(), + isReceipt() ? X_C_DocType.DOCBASETYPE_ARReceipt : X_C_DocType.DOCBASETYPE_APPayment)) + { + m_processMsg = "@PeriodClosed@"; + return DocAction.STATUS_Invalid; + } + + // Unsuccessful Online Payment + if (isOnline() && !isApproved()) + { + if (getR_Result() != null) + m_processMsg = "@OnlinePaymentFailed@"; + else + m_processMsg = "@PaymentNotProcessed@"; + return DocAction.STATUS_Invalid; + } + + // Waiting Payment - Need to create Invoice & Shipment + if (getC_Order_ID() != 0 && getC_Invoice_ID() == 0) + { // see WebOrder.process + MOrder order = new MOrder (getCtx(), getC_Order_ID(), get_TrxName()); + if (DOCSTATUS_WaitingPayment.equals(order.getDocStatus())) + { + order.setC_Payment_ID(getC_Payment_ID()); + order.setDocAction(X_C_Order.DOCACTION_WaitComplete); + order.set_TrxName(get_TrxName()); + // boolean ok = + order.processIt (X_C_Order.DOCACTION_WaitComplete); + m_processMsg = order.getProcessMsg(); + order.save(get_TrxName()); + // Set Invoice + MInvoice[] invoices = order.getInvoices(); + int length = invoices.length; + if (length > 0) // get last invoice + setC_Invoice_ID (invoices[length-1].getC_Invoice_ID()); + // + if (getC_Invoice_ID() == 0) + { + m_processMsg = "@NotFound@ @C_Invoice_ID@"; + return DocAction.STATUS_Invalid; + } + } // WaitingPayment + } + + // Consistency of Invoice / Document Type and IsReceipt + if (!verifyDocType()) + { + m_processMsg = "@PaymentDocTypeInvoiceInconsistent@"; + return DocAction.STATUS_Invalid; + } + + // Do not pay when Credit Stop/Hold + if (!isReceipt()) + { + MBPartner bp = new MBPartner (getCtx(), getC_BPartner_ID(), get_TrxName()); + if (X_C_BPartner.SOCREDITSTATUS_CreditStop.equals(bp.getSOCreditStatus())) + { + m_processMsg = "@BPartnerCreditStop@ - @TotalOpenBalance@=" + + bp.getTotalOpenBalance() + + ", @SO_CreditLimit@=" + bp.getSO_CreditLimit(); + return DocAction.STATUS_Invalid; + } + if (X_C_BPartner.SOCREDITSTATUS_CreditHold.equals(bp.getSOCreditStatus())) + { + m_processMsg = "@BPartnerCreditHold@ - @TotalOpenBalance@=" + + bp.getTotalOpenBalance() + + ", @SO_CreditLimit@=" + bp.getSO_CreditLimit(); + return DocAction.STATUS_Invalid; + } + } + + m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_PREPARE); + if (m_processMsg != null) + return DocAction.STATUS_Invalid; + + m_justPrepared = true; + if (!DOCACTION_Complete.equals(getDocAction())) + setDocAction(DOCACTION_Complete); + return DocAction.STATUS_InProgress; + } // prepareIt + + /** + * Approve Document + * @return true if success + */ + public boolean approveIt() + { + log.info(toString()); + setIsApproved(true); + return true; + } // approveIt + + /** + * Reject Approval + * @return true if success + */ + public boolean rejectIt() + { + log.info(toString()); + setIsApproved(false); + return true; + } // rejectIt + + + /************************************************************************** + * Complete Document + * @return new status (Complete, In Progress, Invalid, Waiting ..) + */ + public String completeIt() + { + // Re-Check + if (!m_justPrepared) + { + String status = prepareIt(); + if (!DocAction.STATUS_InProgress.equals(status)) + return status; + } + + m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_COMPLETE); + if (m_processMsg != null) + return DocAction.STATUS_Invalid; + + // Implicit Approval + if (!isApproved()) + approveIt(); + log.info(toString()); + + // Charge Handling + if (getC_Charge_ID() != 0) + { + setIsAllocated(true); + } + else + { + allocateIt(); // Create Allocation Records + testAllocation(); + } + + // Project update + if (getC_Project_ID() != 0) + { + // MProject project = new MProject(getCtx(), getC_Project_ID()); + } + // Update BP for Prepayments + if (getC_BPartner_ID() != 0 && getC_Invoice_ID() == 0) + { + MBPartner bp = new MBPartner (getCtx(), getC_BPartner_ID(), get_TrxName()); + bp.setTotalOpenBalance(); + bp.save(); + } + + // Counter Doc + MPayment counter = createCounterDoc(); + if (counter != null) + m_processMsg += " @CounterDoc@: @C_Payment_ID@=" + counter.getDocumentNo(); + + // @Trifon - CashPayments + //if ( getTenderType().equals("X") ) { + if ( isCashTrx() ) { + // Create Cash Book entry + if ( getC_CashBook_ID() <= 0 ) { + log.saveError("Error", Msg.parseTranslation(getCtx(), "@Mandatory@: @C_CashBook_ID@")); + m_processMsg = "@NoCashBook@"; + return DocAction.STATUS_Invalid; + } + MCash cash = MCash.get (getCtx(), getAD_Org_ID(), getDateAcct(), getC_Currency_ID(), get_TrxName()); + if (cash == null || cash.get_ID() == 0) + { + m_processMsg = "@NoCashBook@"; + return DocAction.STATUS_Invalid; + } + MCashLine cl = new MCashLine( cash ); + cl.setCashType( X_C_CashLine.CASHTYPE_GeneralReceipts ); + cl.setDescription("Generated From Payment #" + getDocumentNo()); + cl.setC_Currency_ID( this.getC_Currency_ID() ); + cl.setC_Payment_ID( getC_Payment_ID() ); // Set Reference to payment. + StringBuffer info=new StringBuffer(); + info.append("Cash journal ( ") + .append(cash.getDocumentNo()).append(" )"); + m_processMsg = info.toString(); + // Amount + BigDecimal amt = this.getPayAmt(); +/* + MDocType dt = MDocType.get(getCtx(), invoice.getC_DocType_ID()); + if (MDocType.DOCBASETYPE_APInvoice.equals( dt.getDocBaseType() ) + || MDocType.DOCBASETYPE_ARCreditMemo.equals( dt.getDocBaseType() ) + ) { + amt = amt.negate(); + } +*/ + cl.setAmount( amt ); + // + cl.setDiscountAmt( Env.ZERO ); + cl.setWriteOffAmt( Env.ZERO ); + cl.setIsGenerated( true ); + + if (!cl.save(get_TrxName())) + { + m_processMsg = "Could not save Cash Journal Line"; + return DocAction.STATUS_Invalid; + } + } + // End Trifon - CashPayments + + // User Validation + String valid = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_COMPLETE); + if (valid != null) + { + m_processMsg = valid; + return DocAction.STATUS_Invalid; + } + + // Set the definite document number after completed (if needed) + setDefiniteDocumentNo(); + + // + setProcessed(true); + setDocAction(DOCACTION_Close); + return DocAction.STATUS_Completed; + } // completeIt + + /** + * Set the definite document number after completed + */ + private void setDefiniteDocumentNo() { + MDocType dt = MDocType.get(getCtx(), getC_DocType_ID()); + if (dt.isOverwriteDateOnComplete()) { + setDateTrx(new Timestamp (System.currentTimeMillis())); + } + if (dt.isOverwriteSeqOnComplete()) { + String value = DB.getDocumentNo(getC_DocType_ID(), get_TrxName(), true, this); + if (value != null) + setDocumentNo(value); + } + } + + /** + * Create Counter Document + * @return payment + */ + private MPayment createCounterDoc() + { + // Is this a counter doc ? + if (getRef_Payment_ID() != 0) + return null; + + // Org Must be linked to BPartner + MOrg org = MOrg.get(getCtx(), getAD_Org_ID()); + int counterC_BPartner_ID = org.getLinkedC_BPartner_ID(get_TrxName()); + if (counterC_BPartner_ID == 0) + return null; + // Business Partner needs to be linked to Org + MBPartner bp = new MBPartner (getCtx(), getC_BPartner_ID(), get_TrxName()); + int counterAD_Org_ID = bp.getAD_OrgBP_ID_Int(); + if (counterAD_Org_ID == 0) + return null; + + MBPartner counterBP = new MBPartner (getCtx(), counterC_BPartner_ID, get_TrxName()); + // MOrgInfo counterOrgInfo = MOrgInfo.get(getCtx(), counterAD_Org_ID); + log.info("Counter BP=" + counterBP.getName()); + + // Document Type + int C_DocTypeTarget_ID = 0; + MDocTypeCounter counterDT = MDocTypeCounter.getCounterDocType(getCtx(), getC_DocType_ID()); + if (counterDT != null) + { + log.fine(counterDT.toString()); + if (!counterDT.isCreateCounter() || !counterDT.isValid()) + return null; + C_DocTypeTarget_ID = counterDT.getCounter_C_DocType_ID(); + } + else // indirect + { + C_DocTypeTarget_ID = MDocTypeCounter.getCounterDocType_ID(getCtx(), getC_DocType_ID()); + log.fine("Indirect C_DocTypeTarget_ID=" + C_DocTypeTarget_ID); + if (C_DocTypeTarget_ID <= 0) + return null; + } + + // Deep Copy + MPayment counter = new MPayment (getCtx(), 0, get_TrxName()); + counter.setAD_Org_ID(counterAD_Org_ID); + counter.setC_BPartner_ID(counterBP.getC_BPartner_ID()); + counter.setIsReceipt(!isReceipt()); + counter.setC_DocType_ID(C_DocTypeTarget_ID); + counter.setTrxType(getTrxType()); + counter.setTenderType(getTenderType()); + // + counter.setPayAmt(getPayAmt()); + counter.setDiscountAmt(getDiscountAmt()); + counter.setTaxAmt(getTaxAmt()); + counter.setWriteOffAmt(getWriteOffAmt()); + counter.setIsOverUnderPayment (isOverUnderPayment()); + counter.setOverUnderAmt(getOverUnderAmt()); + counter.setC_Currency_ID(getC_Currency_ID()); + counter.setC_ConversionType_ID(getC_ConversionType_ID()); + // + counter.setDateTrx (getDateTrx()); + counter.setDateAcct (getDateAcct()); + counter.setRef_Payment_ID(getC_Payment_ID()); + // + String sql = "SELECT C_BankAccount_ID FROM C_BankAccount " + + "WHERE C_Currency_ID=? AND AD_Org_ID IN (0,?) AND IsActive='Y' " + + "ORDER BY IsDefault DESC"; + int C_BankAccount_ID = DB.getSQLValue(get_TrxName(), sql, getC_Currency_ID(), counterAD_Org_ID); + counter.setC_BankAccount_ID(C_BankAccount_ID); + + // References + counter.setC_Activity_ID(getC_Activity_ID()); + counter.setC_Campaign_ID(getC_Campaign_ID()); + counter.setC_Project_ID(getC_Project_ID()); + counter.setUser1_ID(getUser1_ID()); + counter.setUser2_ID(getUser2_ID()); + counter.save(get_TrxName()); + log.fine(counter.toString()); + setRef_Payment_ID(counter.getC_Payment_ID()); + + // Document Action + if (counterDT != null) + { + if (counterDT.getDocAction() != null) + { + counter.setDocAction(counterDT.getDocAction()); + counter.processIt(counterDT.getDocAction()); + counter.save(get_TrxName()); + } + } + return counter; + } // createCounterDoc + + /** + * Allocate It. + * Only call when there is NO allocation as it will create duplicates. + * If an invoice exists, it allocates that + * otherwise it allocates Payment Selection. + * @return true if allocated + */ + public boolean allocateIt() + { + // Create invoice Allocation - See also MCash.completeIt + if (getC_Invoice_ID() != 0) + return allocateInvoice(); + // Invoices of a AP Payment Selection + if (allocatePaySelection()) + return true; + + if (getC_Order_ID() != 0) + return false; + + // Allocate to multiple Payments based on entry + MPaymentAllocate[] pAllocs = MPaymentAllocate.get(this); + if (pAllocs.length == 0) + return false; + + MAllocationHdr alloc = new MAllocationHdr(getCtx(), false, + getDateTrx(), getC_Currency_ID(), + Msg.translate(getCtx(), "C_Payment_ID") + ": " + getDocumentNo(), + get_TrxName()); + alloc.setAD_Org_ID(getAD_Org_ID()); + if (!alloc.save()) + { + log.severe("P.Allocations not created"); + return false; + } + // Lines + for (int i = 0; i < pAllocs.length; i++) + { + MPaymentAllocate pa = pAllocs[i]; + MAllocationLine aLine = null; + if (isReceipt()) + aLine = new MAllocationLine (alloc, pa.getAmount(), + pa.getDiscountAmt(), pa.getWriteOffAmt(), pa.getOverUnderAmt()); + else + aLine = new MAllocationLine (alloc, pa.getAmount().negate(), + pa.getDiscountAmt().negate(), pa.getWriteOffAmt().negate(), pa.getOverUnderAmt().negate()); + aLine.setDocInfo(pa.getC_BPartner_ID(), 0, pa.getC_Invoice_ID()); + aLine.setPaymentInfo(getC_Payment_ID(), 0); + if (!aLine.save(get_TrxName())) + log.warning("P.Allocations - line not saved"); + else + { + pa.setC_AllocationLine_ID(aLine.getC_AllocationLine_ID()); + pa.save(); + } + } + // Should start WF + alloc.processIt(DocAction.ACTION_Complete); + m_processMsg = "@C_AllocationHdr_ID@: " + alloc.getDocumentNo(); + return alloc.save(get_TrxName()); + } // allocateIt + + /** + * Allocate single AP/AR Invoice + * @return true if allocated + */ + private boolean allocateInvoice() + { + // calculate actual allocation + BigDecimal allocationAmt = getPayAmt(); // underpayment + if (getOverUnderAmt().signum() < 0 && getPayAmt().signum() > 0) + allocationAmt = allocationAmt.add(getOverUnderAmt()); // overpayment (negative) + + MAllocationHdr alloc = new MAllocationHdr(getCtx(), false, + getDateTrx(), getC_Currency_ID(), + Msg.translate(getCtx(), "C_Payment_ID") + ": " + getDocumentNo() + " [1]", get_TrxName()); + alloc.setAD_Org_ID(getAD_Org_ID()); + if (!alloc.save()) + { + log.log(Level.SEVERE, "Could not create Allocation Hdr"); + return false; + } + MAllocationLine aLine = null; + if (isReceipt()) + aLine = new MAllocationLine (alloc, allocationAmt, + getDiscountAmt(), getWriteOffAmt(), getOverUnderAmt()); + else + aLine = new MAllocationLine (alloc, allocationAmt.negate(), + getDiscountAmt().negate(), getWriteOffAmt().negate(), getOverUnderAmt().negate()); + aLine.setDocInfo(getC_BPartner_ID(), 0, getC_Invoice_ID()); + aLine.setC_Payment_ID(getC_Payment_ID()); + if (!aLine.save(get_TrxName())) + { + log.log(Level.SEVERE, "Could not create Allocation Line"); + return false; + } + // Should start WF + alloc.processIt(DocAction.ACTION_Complete); + alloc.save(get_TrxName()); + m_processMsg = "@C_AllocationHdr_ID@: " + alloc.getDocumentNo(); + + // Get Project from Invoice + int C_Project_ID = DB.getSQLValue(get_TrxName(), + "SELECT MAX(C_Project_ID) FROM C_Invoice WHERE C_Invoice_ID=?", getC_Invoice_ID()); + if (C_Project_ID > 0 && getC_Project_ID() == 0) + setC_Project_ID(C_Project_ID); + else if (C_Project_ID > 0 && getC_Project_ID() > 0 && C_Project_ID != getC_Project_ID()) + log.warning("Invoice C_Project_ID=" + C_Project_ID + + " <> Payment C_Project_ID=" + getC_Project_ID()); + return true; + } // allocateInvoice + + /** + * Allocate Payment Selection + * @return true if allocated + */ + private boolean allocatePaySelection() + { + MAllocationHdr alloc = new MAllocationHdr(getCtx(), false, + getDateTrx(), getC_Currency_ID(), + Msg.translate(getCtx(), "C_Payment_ID") + ": " + getDocumentNo() + " [n]", get_TrxName()); + alloc.setAD_Org_ID(getAD_Org_ID()); + + String sql = "SELECT psc.C_BPartner_ID, psl.C_Invoice_ID, psl.IsSOTrx, " // 1..3 + + " psl.PayAmt, psl.DiscountAmt, psl.DifferenceAmt, psl.OpenAmt " + + "FROM C_PaySelectionLine psl" + + " INNER JOIN C_PaySelectionCheck psc ON (psl.C_PaySelectionCheck_ID=psc.C_PaySelectionCheck_ID) " + + "WHERE psc.C_Payment_ID=?"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement(sql, get_TrxName()); + pstmt.setInt(1, getC_Payment_ID()); + ResultSet rs = pstmt.executeQuery(); + while (rs.next()) + { + int C_BPartner_ID = rs.getInt(1); + int C_Invoice_ID = rs.getInt(2); + if (C_BPartner_ID == 0 && C_Invoice_ID == 0) + continue; + boolean isSOTrx = "Y".equals(rs.getString(3)); + BigDecimal PayAmt = rs.getBigDecimal(4); + BigDecimal DiscountAmt = rs.getBigDecimal(5); + BigDecimal WriteOffAmt = rs.getBigDecimal(6); + BigDecimal OpenAmt = rs.getBigDecimal(7); + BigDecimal OverUnderAmt = OpenAmt.subtract(PayAmt) + .subtract(DiscountAmt).subtract(WriteOffAmt); + // + if (alloc.get_ID() == 0 && !alloc.save(get_TrxName())) + { + log.log(Level.SEVERE, "Could not create Allocation Hdr"); + rs.close(); + pstmt.close(); + return false; + } + MAllocationLine aLine = null; + if (isSOTrx) + aLine = new MAllocationLine (alloc, PayAmt, + DiscountAmt, WriteOffAmt, OverUnderAmt); + else + aLine = new MAllocationLine (alloc, PayAmt.negate(), + DiscountAmt.negate(), WriteOffAmt.negate(), OverUnderAmt.negate()); + aLine.setDocInfo(C_BPartner_ID, 0, C_Invoice_ID); + aLine.setC_Payment_ID(getC_Payment_ID()); + if (!aLine.save(get_TrxName())) + log.log(Level.SEVERE, "Could not create Allocation Line"); + } + rs.close(); + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + log.log(Level.SEVERE, "allocatePaySelection", e); + } + try + { + if (pstmt != null) + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + + // Should start WF + boolean ok = true; + if (alloc.get_ID() == 0) + { + log.fine("No Allocation created - C_Payment_ID=" + + getC_Payment_ID()); + ok = false; + } + else + { + alloc.processIt(DocAction.ACTION_Complete); + ok = alloc.save(get_TrxName()); + m_processMsg = "@C_AllocationHdr_ID@: " + alloc.getDocumentNo(); + } + return ok; + } // allocatePaySelection + + /** + * De-allocate Payment. + * Unkink Invoices and Orders and delete Allocations + */ + private void deAllocate() + { + if (getC_Order_ID() != 0) + setC_Order_ID(0); + // if (getC_Invoice_ID() == 0) + // return; + // De-Allocate all + MAllocationHdr[] allocations = MAllocationHdr.getOfPayment(getCtx(), + getC_Payment_ID(), get_TrxName()); + log.fine("#" + allocations.length); + for (int i = 0; i < allocations.length; i++) + { + allocations[i].set_TrxName(get_TrxName()); + allocations[i].setDocAction(DocAction.ACTION_Reverse_Correct); + allocations[i].processIt(DocAction.ACTION_Reverse_Correct); + allocations[i].save(); + } + + // Unlink (in case allocation did not get it) + if (getC_Invoice_ID() != 0) + { + // Invoice + String sql = "UPDATE C_Invoice " + + "SET C_Payment_ID = NULL, IsPaid='N' " + + "WHERE C_Invoice_ID=" + getC_Invoice_ID() + + " AND C_Payment_ID=" + getC_Payment_ID(); + int no = DB.executeUpdate(sql, get_TrxName()); + if (no != 0) + log.fine("Unlink Invoice #" + no); + // Order + sql = "UPDATE C_Order o " + + "SET C_Payment_ID = NULL " + + "WHERE EXISTS (SELECT * FROM C_Invoice i " + + "WHERE o.C_Order_ID=i.C_Order_ID AND i.C_Invoice_ID=" + getC_Invoice_ID() + ")" + + " AND C_Payment_ID=" + getC_Payment_ID(); + no = DB.executeUpdate(sql, get_TrxName()); + if (no != 0) + log.fine("Unlink Order #" + no); + } + // + setC_Invoice_ID(0); + setIsAllocated(false); + } // deallocate + + /** + * Void Document. + * @return true if success + */ + public boolean voidIt() + { + log.info(toString()); + // Before Void + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_VOID); + if (m_processMsg != null) + return false; + + if (DOCSTATUS_Closed.equals(getDocStatus()) + || DOCSTATUS_Reversed.equals(getDocStatus()) + || DOCSTATUS_Voided.equals(getDocStatus())) + { + m_processMsg = "Document Closed: " + getDocStatus(); + setDocAction(DOCACTION_None); + return false; + } + // If on Bank Statement, don't void it - reverse it + if (getC_BankStatementLine_ID() > 0) + return reverseCorrectIt(); + + // Not Processed + if (DOCSTATUS_Drafted.equals(getDocStatus()) + || DOCSTATUS_Invalid.equals(getDocStatus()) + || DOCSTATUS_InProgress.equals(getDocStatus()) + || DOCSTATUS_Approved.equals(getDocStatus()) + || DOCSTATUS_NotApproved.equals(getDocStatus()) ) + { + addDescription(Msg.getMsg(getCtx(), "Voided") + " (" + getPayAmt() + ")"); + setPayAmt(Env.ZERO); + setDiscountAmt(Env.ZERO); + setWriteOffAmt(Env.ZERO); + setOverUnderAmt(Env.ZERO); + setIsAllocated(false); + // Unlink & De-Allocate + deAllocate(); + } + else + return reverseCorrectIt(); + + // + // After Void + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_VOID); + if (m_processMsg != null) + return false; + + setProcessed(true); + setDocAction(DOCACTION_None); + return true; + } // voidIt + + /** + * Close Document. + * @return true if success + */ + public boolean closeIt() + { + log.info(toString()); + // Before Close + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_CLOSE); + if (m_processMsg != null) + return false; + // After Close + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_CLOSE); + if (m_processMsg != null) + return false; + setDocAction(DOCACTION_None); + return true; + } // closeIt + + /** + * Reverse Correction + * @return true if success + */ + public boolean reverseCorrectIt() + { + log.info(toString()); + // Before reverseCorrect + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSECORRECT); + if (m_processMsg != null) + return false; + + // Std Period open? + Timestamp dateAcct = getDateAcct(); + if (!MPeriod.isOpen(getCtx(), dateAcct, + isReceipt() ? X_C_DocType.DOCBASETYPE_ARReceipt : X_C_DocType.DOCBASETYPE_APPayment)) + dateAcct = new Timestamp(System.currentTimeMillis()); + + // Auto Reconcile if not on Bank Statement + boolean reconciled = getC_BankStatementLine_ID() == 0; //AZ Goodwill + + // Create Reversal + MPayment reversal = new MPayment (getCtx(), 0, get_TrxName()); + copyValues(this, reversal); + reversal.setClientOrg(this); + reversal.setC_Order_ID(0); + reversal.setC_Invoice_ID(0); + reversal.setDateAcct(dateAcct); + // + reversal.setDocumentNo(getDocumentNo() + REVERSE_INDICATOR); // indicate reversals + reversal.setDocStatus(DOCSTATUS_Drafted); + reversal.setDocAction(DOCACTION_Complete); + // + reversal.setPayAmt(getPayAmt().negate()); + reversal.setDiscountAmt(getDiscountAmt().negate()); + reversal.setWriteOffAmt(getWriteOffAmt().negate()); + reversal.setOverUnderAmt(getOverUnderAmt().negate()); + // + reversal.setIsAllocated(true); + reversal.setIsReconciled(reconciled); // to put on bank statement + reversal.setIsOnline(false); + reversal.setIsApproved(true); + reversal.setR_PnRef(null); + reversal.setR_Result(null); + reversal.setR_RespMsg(null); + reversal.setR_AuthCode(null); + reversal.setR_Info(null); + reversal.setProcessing(false); + reversal.setOProcessing("N"); + reversal.setProcessed(false); + reversal.setPosted(false); + reversal.setDescription(getDescription()); + reversal.addDescription("{->" + getDocumentNo() + ")"); + reversal.save(get_TrxName()); + // Post Reversal + if (!reversal.processIt(DocAction.ACTION_Complete)) + { + m_processMsg = "Reversal ERROR: " + reversal.getProcessMsg(); + return false; + } + reversal.closeIt(); + reversal.setDocStatus(DOCSTATUS_Reversed); + reversal.setDocAction(DOCACTION_None); + reversal.save(get_TrxName()); + + // Unlink & De-Allocate + deAllocate(); + setIsReconciled (reconciled); + setIsAllocated (true); // the allocation below is overwritten + // Set Status + addDescription("(" + reversal.getDocumentNo() + "<-)"); + setDocStatus(DOCSTATUS_Reversed); + setDocAction(DOCACTION_None); + setProcessed(true); + + // Create automatic Allocation + MAllocationHdr alloc = new MAllocationHdr (getCtx(), false, + getDateTrx(), getC_Currency_ID(), + Msg.translate(getCtx(), "C_Payment_ID") + ": " + reversal.getDocumentNo(), get_TrxName()); + alloc.setAD_Org_ID(getAD_Org_ID()); + if (!alloc.save()) + log.warning("Automatic allocation - hdr not saved"); + else + { + // Original Allocation + MAllocationLine aLine = new MAllocationLine (alloc, getPayAmt(true), + Env.ZERO, Env.ZERO, Env.ZERO); + aLine.setDocInfo(getC_BPartner_ID(), 0, 0); + aLine.setPaymentInfo(getC_Payment_ID(), 0); + if (!aLine.save(get_TrxName())) + log.warning("Automatic allocation - line not saved"); + // Reversal Allocation + aLine = new MAllocationLine (alloc, reversal.getPayAmt(true), + Env.ZERO, Env.ZERO, Env.ZERO); + aLine.setDocInfo(reversal.getC_BPartner_ID(), 0, 0); + aLine.setPaymentInfo(reversal.getC_Payment_ID(), 0); + if (!aLine.save(get_TrxName())) + log.warning("Automatic allocation - reversal line not saved"); + } + alloc.processIt(DocAction.ACTION_Complete); + alloc.save(get_TrxName()); + // + StringBuffer info = new StringBuffer (reversal.getDocumentNo()); + info.append(" - @C_AllocationHdr_ID@: ").append(alloc.getDocumentNo()); + + // Update BPartner + if (getC_BPartner_ID() != 0) + { + MBPartner bp = new MBPartner (getCtx(), getC_BPartner_ID(), get_TrxName()); + bp.setTotalOpenBalance(); + bp.save(get_TrxName()); + } + // After reverseCorrect + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSECORRECT); + if (m_processMsg != null) + return false; + + m_processMsg = info.toString(); + return true; + } // reverseCorrectionIt + + /** + * Get Bank Statement Line of payment or 0 + * @return id or 0 + */ + private int getC_BankStatementLine_ID() + { + String sql = "SELECT C_BankStatementLine_ID FROM C_BankStatementLine WHERE C_Payment_ID=?"; + int id = DB.getSQLValue(get_TrxName(), sql, getC_Payment_ID()); + if (id < 0) + return 0; + return id; + } // getC_BankStatementLine_ID + + /** + * Reverse Accrual - none + * @return true if success + */ + public boolean reverseAccrualIt() + { + log.info(toString()); + + // Before reverseAccrual + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSEACCRUAL); + if (m_processMsg != null) + return false; + + // After reverseAccrual + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSEACCRUAL); + if (m_processMsg != null) + return false; + + return false; + } // reverseAccrualIt + + /** + * Re-activate + * @return true if success + */ + public boolean reActivateIt() + { + log.info(toString()); + // Before reActivate + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REACTIVATE); + if (m_processMsg != null) + return false; + + if (! reverseCorrectIt()) + return false; + + // After reActivate + m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REACTIVATE); + if (m_processMsg != null) + return false; + + return true; + } // reActivateIt + + /** + * String Representation + * @return info + */ + public String toString () + { + StringBuffer sb = new StringBuffer ("MPayment["); + sb.append(get_ID()).append("-").append(getDocumentNo()) + .append(",Receipt=").append(isReceipt()) + .append(",PayAmt=").append(getPayAmt()) + .append(",Discount=").append(getDiscountAmt()) + .append(",WriteOff=").append(getWriteOffAmt()) + .append(",OverUnder=").append(getOverUnderAmt()); + return sb.toString (); + } // toString + + /** + * Get Document Info + * @return document info (untranslated) + */ + public String getDocumentInfo() + { + MDocType dt = MDocType.get(getCtx(), getC_DocType_ID()); + return dt.getName() + " " + getDocumentNo(); + } // getDocumentInfo + + /** + * Create PDF + * @return File or null + */ + public File createPDF () + { + try + { + File temp = File.createTempFile(get_TableName()+get_ID()+"_", ".pdf"); + return createPDF (temp); + } + catch (Exception e) + { + log.severe("Could not create PDF - " + e.getMessage()); + } + return null; + } // getPDF + + /** + * Create PDF file + * @param file output file + * @return file if success + */ + public File createPDF (File file) + { + // ReportEngine re = ReportEngine.get (getCtx(), ReportEngine.PAYMENT, getC_Payment_ID()); + // if (re == null) + return null; + // return re.getPDF(file); + } // createPDF + + + /************************************************************************* + * Get Summary + * @return Summary of Document + */ + public String getSummary() + { + StringBuffer sb = new StringBuffer(); + sb.append(getDocumentNo()); + // : Total Lines = 123.00 (#1) + sb.append(": ") + .append(Msg.translate(getCtx(),"PayAmt")).append("=").append(getPayAmt()) + .append(",").append(Msg.translate(getCtx(),"WriteOffAmt")).append("=").append(getWriteOffAmt()); + // - Description + if (getDescription() != null && getDescription().length() > 0) + sb.append(" - ").append(getDescription()); + return sb.toString(); + } // getSummary + + /** + * Get Process Message + * @return clear text error message + */ + public String getProcessMsg() + { + return m_processMsg; + } // getProcessMsg + + /** + * Get Document Owner (Responsible) + * @return AD_User_ID + */ + public int getDoc_User_ID() + { + return getCreatedBy(); + } // getDoc_User_ID + + /** + * Get Document Approval Amount + * @return amount payment(AP) or write-off(AR) + */ + public BigDecimal getApprovalAmt() + { + if (isReceipt()) + return getWriteOffAmt(); + return getPayAmt(); + } // getApprovalAmt + +} // MPayment diff --git a/posterita/posterita/src/main/org/compiere/model/MSequence.java b/posterita/posterita/src/main/org/compiere/model/MSequence.java new file mode 100644 index 0000000000..6095b79c71 --- /dev/null +++ b/posterita/posterita/src/main/org/compiere/model/MSequence.java @@ -0,0 +1,1621 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program 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 General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.io.InputStream; +import java.io.OutputStreamWriter; +import java.io.PrintWriter; +import java.net.Socket; +import java.net.URL; +import java.net.URLEncoder; +import java.rmi.RemoteException; +import java.sql.CallableStatement; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Types; +import java.text.DecimalFormat; +import java.text.SimpleDateFormat; +import java.util.Arrays; +import java.util.Date; +import java.util.Properties; +import java.util.Vector; +import java.util.logging.Level; + +import org.compiere.db.CConnection; +import org.compiere.interfaces.Server; +import org.compiere.util.CLogMgt; +import org.compiere.util.CLogger; +import org.compiere.util.DB; +import org.compiere.util.DBException; +import org.compiere.util.Env; +import org.compiere.util.Ini; +import org.compiere.util.Trx; + +/** + * Sequence Model. + * @see org.compiere.process.SequenceCheck + * @author Jorg Janke + * @version $Id: MSequence.java,v 1.3 2006/07/30 00:58:04 jjanke Exp $ + */ +public class MSequence extends X_AD_Sequence +{ + /** Use SQL procedure to get next id */ + //begin vpj-cd e-evolution 02/11/2005 PostgreSQL + //private static final boolean USE_PROCEDURE = true; + private static boolean USE_PROCEDURE = false; + //end vpj-cd e-evolution 02/11/2005 + /** Log Level for Next ID Call */ + private static final Level LOGLEVEL = Level.ALL; + + public static synchronized int getNextID (int AD_Client_ID, String TableName) + { + return getNextID(AD_Client_ID, TableName, null); + } + + /** + * + * Get next number for Key column = 0 is Error. + * @param AD_Client_ID client + * @param TableName table name + * @param trxName deprecated. + * @return next no or (-1=not found, -2=error) + */ + public static synchronized int getNextID (int AD_Client_ID, String TableName, String trxName) + { + if (TableName == null || TableName.length() == 0) + throw new IllegalArgumentException("TableName missing"); + + //get from server + if (DB.isRemoteObjects()) + { + Server server = CConnection.get().getServer(); + try + { + if (server != null) + { // See ServerBean + // hengsin: don't execute getNextID in tranaction to fix performance and locking issue + int id = server.getNextID(AD_Client_ID, TableName, null); + s_log.finest("server => " + id); + if (id < 0) + throw new DBException("No NextID"); + return id; + } + s_log.log(Level.SEVERE, "AppsServer not found - " + TableName); + } + catch (RemoteException ex) + { + s_log.log(Level.SEVERE, "AppsServer error", ex); + } + // Try locally + } + + int retValue = -1; + + // Check AdempiereSys + boolean adempiereSys = Ini.isPropertyBool(Ini.P_ADEMPIERESYS); + if (adempiereSys && AD_Client_ID > 11) + adempiereSys = false; + // + if (CLogMgt.isLevel(LOGLEVEL)) + s_log.log(LOGLEVEL, TableName + " - AdempiereSys=" + adempiereSys + " [" + trxName + "]"); + //begin vpj-cd e-evolution 09/02/2005 PostgreSQL + String selectSQL = null; + if (DB.isOracle() == false || DB.isRemoteObjects()) + { + selectSQL = "SELECT CurrentNext, CurrentNextSys, IncrementNo, AD_Sequence_ID " + + "FROM AD_Sequence " + + "WHERE Name=?" + + " AND IsActive='Y' AND IsTableID='Y' AND IsAutoSequence='Y' " + + " FOR UPDATE OF AD_Sequence "; + USE_PROCEDURE=false; + } + else + { + selectSQL = "SELECT CurrentNext, CurrentNextSys, IncrementNo, AD_Sequence_ID " + + "FROM AD_Sequence " + + "WHERE Name=?" + + " AND IsActive='Y' AND IsTableID='Y' AND IsAutoSequence='Y' " + + "FOR UPDATE"; // jz derby needs expicitly said it//OF CurrentNext, CurrentNextSys"; + + USE_PROCEDURE = true; + } + + //hengsin: executing getNextID in transaction create huge performance and locking issue + //Trx trx = trxName == null ? null : Trx.get(trxName, true); + Connection conn = null; + PreparedStatement pstmt = null; + ResultSet rs = null; + for (int i = 0; i < 3; i++) + { + try + { + conn = DB.getConnectionID(); + // Error + if (conn == null) + return -1; + + pstmt = conn.prepareStatement(selectSQL, + ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE); + pstmt.setString(1, TableName); + // + rs = pstmt.executeQuery(); + if (CLogMgt.isLevelFinest()) + s_log.finest("AC=" + conn.getAutoCommit() + ", RO=" + conn.isReadOnly() + + " - Isolation=" + conn.getTransactionIsolation() + "(" + Connection.TRANSACTION_READ_COMMITTED + + ") - RSType=" + pstmt.getResultSetType() + "(" + ResultSet.TYPE_SCROLL_SENSITIVE + + "), RSConcur=" + pstmt.getResultSetConcurrency() + "(" + ResultSet.CONCUR_UPDATABLE + + ")"); + if (rs.next()) + { + + // Get the table + MTable table = MTable.get(Env.getCtx(), TableName); + boolean hasEntityType = false; + if (table.getColumn("EntityType") != null) + hasEntityType = true; + + int AD_Sequence_ID = rs.getInt(4); + boolean gotFromHTTP = false; + + // If maintaining official dictionary try to get the ID from http official server + if (adempiereSys) { + + String isUseCentralizedID = MSysConfig.getValue("DICTIONARY_ID_USE_CENTRALIZED_ID", "Y"); // defaults to Y + if ( ( ! isUseCentralizedID.equals("N") ) && ( ! isExceptionCentralized(TableName) ) ) { + // get ID from http site + retValue = getNextOfficialID_HTTP(TableName); + if (retValue > 0) { + PreparedStatement updateSQL; + updateSQL = conn.prepareStatement("UPDATE AD_Sequence SET CurrentNextSys = ? + 1 WHERE AD_Sequence_ID = ?"); + try { + updateSQL.setInt(1, retValue); + updateSQL.setInt(2, AD_Sequence_ID); + updateSQL.executeUpdate(); + } finally { + updateSQL.close(); + } + } + gotFromHTTP = true; + } + + } + + // If not official dictionary try to get the ID from http custom server - if configured + if (hasEntityType && ( ! adempiereSys ) && ( ! isExceptionCentralized(TableName) ) ) { + + String isUseProjectCentralizedID = MSysConfig.getValue("PROJECT_ID_USE_CENTRALIZED_ID", "N"); // defaults to N + if (isUseProjectCentralizedID.equals("Y")) { + // get ID from http site + retValue = getNextProjectID_HTTP(TableName); + if (retValue > 0) { + PreparedStatement updateSQL; + updateSQL = conn.prepareStatement("UPDATE AD_Sequence SET CurrentNext = GREATEST(CurrentNext, ? + 1) WHERE AD_Sequence_ID = ?"); + try { + updateSQL.setInt(1, retValue); + updateSQL.setInt(2, AD_Sequence_ID); + updateSQL.executeUpdate(); + } finally { + updateSQL.close(); + } + } + gotFromHTTP = true; + } + + } + + if (! gotFromHTTP) { + // + if (USE_PROCEDURE) + { + retValue = nextID(conn, AD_Sequence_ID, adempiereSys); + } + else + { + PreparedStatement updateSQL; + int incrementNo = rs.getInt(3); + if (adempiereSys) { + updateSQL = conn + .prepareStatement("UPDATE AD_Sequence SET CurrentNextSys = CurrentNextSys + ? WHERE AD_Sequence_ID = ?"); + retValue = rs.getInt(2); + } else { + updateSQL = conn + .prepareStatement("UPDATE AD_Sequence SET CurrentNext = CurrentNext + ? WHERE AD_Sequence_ID = ?"); + retValue = rs.getInt(1); + } + try { + updateSQL.setInt(1, incrementNo); + updateSQL.setInt(2, AD_Sequence_ID); + updateSQL.executeUpdate(); + } finally { + updateSQL.close(); + } + } + } + + //if (trx == null) + conn.commit(); + } + else + s_log.severe ("No record found - " + TableName); + + // + break; // EXIT + } + catch (Exception e) + { + s_log.log(Level.SEVERE, TableName + " - " + e.getMessage(), e); + try + { + if (conn != null) + conn.rollback(); + } catch (SQLException e1) { } + } + finally + { + DB.close(rs, pstmt); + pstmt = null; + rs = null; + if (conn != null) + { + try { + conn.close(); + } catch (SQLException e) {} + conn = null; + } + } + Thread.yield(); // give it time + } + + + //s_log.finest (retValue + " - Table=" + TableName + " [" + trx + "]"); + return retValue; + } // getNextID + + /** + * Get Next ID + * @param conn connection + * @param AD_Sequence_ID sequence + * @param adempiereSys sys + * @return next id or -1 (error) or -3 (parameter) + */ + private static int nextID (Connection conn, int AD_Sequence_ID, boolean adempiereSys) + { + if (conn == null || AD_Sequence_ID == 0) + return -3; + // + int retValue = -1; + String sqlUpdate = "{call nextID(?,?,?)}"; + CallableStatement cstmt = null; + try + { + cstmt = conn.prepareCall (sqlUpdate, + ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY); + cstmt.setInt(1, AD_Sequence_ID); + cstmt.setString(2, adempiereSys ? "Y" : "N"); + cstmt.registerOutParameter(3, Types.INTEGER); + cstmt.execute(); + retValue = cstmt.getInt(3); + } + catch (Exception e) + { + s_log.log(Level.SEVERE, e.toString()); + } + finally + { + DB.close(cstmt); + } + return retValue; + } // nextID + + /** + * Get next id by year + * @param conn + * @param AD_Sequence_ID + * @param incrementNo + * @param calendarYear + * @return next id + */ + private static int nextIDByYear(Connection conn, int AD_Sequence_ID, + int incrementNo, String calendarYear) { + if (conn == null || AD_Sequence_ID == 0) + return -3; + // + int retValue = -1; + String sqlUpdate = "{call nextIDByYear(?,?,?,?)}"; + CallableStatement cstmt = null; + try { + cstmt = conn.prepareCall(sqlUpdate, ResultSet.TYPE_FORWARD_ONLY, + ResultSet.CONCUR_READ_ONLY); + + cstmt.setInt(1, AD_Sequence_ID); + cstmt.setInt(2, incrementNo); + cstmt.setString(3, calendarYear); + cstmt.registerOutParameter(4, Types.INTEGER); + cstmt.execute(); + retValue = cstmt.getInt(4); + } catch (Exception e) { + s_log.log(Level.SEVERE, e.toString()); + } finally { + DB.close(cstmt); + } + return retValue; + } // nextID + + /************************************************************************** + * Get Document No from table + * @param AD_Client_ID client + * @param TableName table name + * @param trxName optional Transaction Name + * @return document no or null + */ + public static synchronized String getDocumentNo (int AD_Client_ID, String TableName, String trxName) + { + return getDocumentNo(AD_Client_ID, TableName, trxName, null); + + } + /************************************************************************** + * Get Document No from table + * @param AD_Client_ID client + * @param TableName table name + * @param trxName optional Transaction Name + * @param PO + * @return document no or null + */ + public static synchronized String getDocumentNo (int AD_Client_ID, String TableName, String trxName, PO po) + { + if (TableName == null || TableName.length() == 0) + throw new IllegalArgumentException("TableName missing"); + + //get from server + if (DB.isRemoteObjects()) + { + Server server = CConnection.get().getServer(); + try + { + if (server != null) + { // See ServerBean + String dn = server.getDocumentNo (AD_Client_ID, TableName, trxName, po); + s_log.finest("Server => " + dn); + if (dn != null) + return dn; + } + s_log.log(Level.SEVERE, "AppsServer not found - " + TableName); + } + catch (RemoteException ex) + { + s_log.log(Level.SEVERE, "AppsServer error", ex); + } + } + + //local + // Check AdempiereSys + boolean adempiereSys = Ini.isPropertyBool(Ini.P_ADEMPIERESYS); + if (adempiereSys && AD_Client_ID > 11) + adempiereSys = false; + // + if (CLogMgt.isLevel(LOGLEVEL)) + s_log.log(LOGLEVEL, TableName + " - AdempiereSys=" + adempiereSys + " [" + trxName + "]"); + + PreparedStatement pstmt = null; + ResultSet rs = null; + boolean isStartNewYear = false; + String dateColumn = null; + + if (!adempiereSys) + { + // Get the Start New Year flag + String startNewYearSQL = "SELECT StartNewYear, DateColumn FROM AD_Sequence " + + "WHERE Name = ? AND IsActive = 'Y' AND IsTableID = 'N' AND IsAutoSequence='Y' AND AD_Client_ID = ?"; + try + { + pstmt = DB.prepareStatement(startNewYearSQL, trxName); + pstmt.setString(1, PREFIX_DOCSEQ + TableName); + pstmt.setInt(2, AD_Client_ID); + rs = pstmt.executeQuery(); + if (rs.next()) { + isStartNewYear = "Y".equals(rs.getString(1)); + dateColumn = rs.getString(2); + } + } + catch (Exception e) + { + s_log.log(Level.SEVERE, "(Table) [" + trxName + "]", e); + } + finally + { + DB.close(rs, pstmt); + } + } + + + String selectSQL = null; + if (DB.isOracle() == false || DB.isRemoteObjects()) + { + if (isStartNewYear) { + selectSQL = "SELECT y.CurrentNext, s.CurrentNextSys, s.IncrementNo, s.Prefix, s.Suffix, s.DecimalPattern, s.AD_Sequence_ID " + + "FROM AD_Sequence_No y, AD_Sequence s " + + "WHERE y.AD_Sequence_ID = s.AD_Sequence_ID " + + "AND s.Name = ? " + + "AND s.AD_Client_ID = ? " + + "AND y.CalendarYear = ? " + + "AND s.IsActive='Y' AND s.IsTableID='N' AND s.IsAutoSequence='Y' " + + "ORDER BY s.AD_Client_ID DESC " + + "FOR UPDATE OF AD_Sequence_No"; + } else { + selectSQL = "SELECT CurrentNext, CurrentNextSys, IncrementNo, Prefix, Suffix, DecimalPattern, AD_Sequence_ID " + + "FROM AD_Sequence " + + "WHERE Name = ? " + + "AND AD_Client_ID = ? " + + "AND IsActive='Y' AND IsTableID='N' AND IsAutoSequence='Y' " + + "ORDER BY AD_Client_ID DESC " + + "FOR UPDATE OF AD_Sequence"; + } + USE_PROCEDURE=false; + } + else + { + if (isStartNewYear) { + selectSQL = "SELECT y.CurrentNext, s.CurrentNextSys, s.IncrementNo, Prefix, Suffix, DecimalPattern, s.AD_Sequence_ID " + + "FROM AD_Sequence_No y, AD_Sequence s " + + "WHERE y.AD_Sequence_ID = s.AD_Sequence_ID " + + "AND s.Name = ? " + + "AND s.AD_Client_ID = ? " + + "AND y.CalendarYear = ? " + + "AND s.IsActive='Y' AND s.IsTableID='N' AND s.IsAutoSequence='Y' " + + "ORDER BY s.AD_Client_ID DESC"; + } else { + selectSQL = "SELECT CurrentNext, CurrentNextSys, IncrementNo, Prefix, Suffix, DecimalPattern, AD_Sequence_ID " + + "FROM AD_Sequence " + + "WHERE Name = ? " + + "AND AD_Client_ID = ? " + + "AND IsActive='Y' AND IsTableID='N' AND IsAutoSequence='Y' " + + "ORDER BY AD_Client_ID DESC"; + } + USE_PROCEDURE = true; + } + Connection conn = null; + Trx trx = trxName == null ? null : Trx.get(trxName, true); + // + int AD_Sequence_ID = 0; + int incrementNo = 0; + int next = -1; + String prefix = ""; + String suffix = ""; + String decimalPattern = ""; + String calendarYear = ""; + try + { + if (trx != null) + conn = trx.getConnection(); + else + conn = DB.getConnectionID(); + // Error + if (conn == null) + return null; + + if (isStartNewYear) + { + if (po != null && dateColumn != null && dateColumn.length() > 0) + { + Date docDate = (Date)po.get_Value(dateColumn); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy"); + calendarYear = sdf.format(docDate); + } + else + { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy"); + calendarYear = sdf.format(new Date()); + } + } + + // + pstmt = conn.prepareStatement(selectSQL, + ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE); + pstmt.setString(1, PREFIX_DOCSEQ + TableName); + pstmt.setInt(2, AD_Client_ID); + if (isStartNewYear) + pstmt.setString(3, calendarYear); + + // + rs = pstmt.executeQuery(); + // s_log.fine("AC=" + conn.getAutoCommit() + " -Iso=" + conn.getTransactionIsolation() + // + " - Type=" + pstmt.getResultSetType() + " - Concur=" + pstmt.getResultSetConcurrency()); + if (rs.next()) + { + AD_Sequence_ID = rs.getInt(7); + prefix = rs.getString(4); + suffix = rs.getString(5); + decimalPattern = rs.getString(6); + incrementNo = rs.getInt(3); + if (USE_PROCEDURE) + { + next = isStartNewYear + ? nextIDByYear(conn, AD_Sequence_ID, incrementNo, calendarYear) + : nextID(conn, AD_Sequence_ID, adempiereSys); + } + else + { + PreparedStatement updateSQL = null; + try + { + if (adempiereSys) { + updateSQL = conn + .prepareStatement("UPDATE AD_Sequence SET CurrentNextSys = CurrentNextSys + ? WHERE AD_Sequence_ID = ?"); + next = rs.getInt(2); + } else { + String sql = isStartNewYear + ? "UPDATE AD_Sequence_No SET CurrentNext = CurrentNext + ? WHERE AD_Sequence_ID = ? AND CalendarYear = ?" + : "UPDATE AD_Sequence SET CurrentNext = CurrentNext + ? WHERE AD_Sequence_ID = ?"; + updateSQL = conn + .prepareStatement(sql); + next = rs.getInt(1); + } + updateSQL.setInt(1, incrementNo); + updateSQL.setInt(2, AD_Sequence_ID); + if (isStartNewYear) + updateSQL.setString(3, calendarYear); + updateSQL.executeUpdate(); + } + finally + { + DB.close(updateSQL); + } + } + } + else + { + s_log.warning ("(Table) - no record found - " + TableName); + MSequence seq = new MSequence (Env.getCtx(), AD_Client_ID, TableName, null); + next = seq.getNextID(); + seq.save(); + } + // Commit + if (trx == null) + { + conn.commit(); + } + } + catch (Exception e) + { + s_log.log(Level.SEVERE, "(Table) [" + trxName + "]", e); + next = -2; + } + finally + { + //Finish + DB.close(rs, pstmt); + try + { + if (trx == null && conn != null) { + conn.close(); + conn = null; + } + } + catch (Exception e) + { + s_log.log(Level.SEVERE, "(Table) - finish", e); + } + } + + // Error + if (next < 0) + return null; + + // create DocumentNo + StringBuffer doc = new StringBuffer(); + if (prefix != null && prefix.length() > 0) + doc.append(Env.parseVariable(prefix, po, trxName, false)); + if (decimalPattern != null && decimalPattern.length() > 0) + doc.append(new DecimalFormat(decimalPattern).format(next)); + else + doc.append(next); + if (suffix != null && suffix.length() > 0) + doc.append(Env.parseVariable(suffix, po, trxName, false)); + String documentNo = doc.toString(); + s_log.finer (documentNo + " (" + incrementNo + ")" + + " - Table=" + TableName + " [" + trx + "]"); + return documentNo; + } // getDocumentNo + + /** + * Get Document No based on Document Type + * @param C_DocType_ID document type + * @param trxName optional Transaction Name + * @return document no or null + * @deprecated + */ + public static String getDocumentNo(int C_DocType_ID, String trxName) + { + return getDocumentNo (C_DocType_ID, trxName, false); + } // getDocumentNo + + /** + * Get Document No based on Document Type + * @param C_DocType_ID document type + * @param trxName optional Transaction Name + * @param definite asking for a definitive or temporary sequence + * @return document no or null + */ + public static String getDocumentNo (int C_DocType_ID, String trxName, boolean definite) + { + return getDocumentNo(C_DocType_ID, trxName, definite, null); + } + + /** + * Get Document No based on Document Type + * @param C_DocType_ID document type + * @param trxName optional Transaction Name + * @param definite asking for a definitive or temporary sequence + * @param po + * @return document no or null + */ + public static String getDocumentNo (int C_DocType_ID, String trxName, boolean definite, PO po) + { + if (C_DocType_ID == 0) + { + s_log.severe ("C_DocType_ID=0"); + return null; + } + + //get from server + + if (DB.isRemoteObjects()) + { + Server server = CConnection.get().getServer(); + try + { + if (server != null) + { // See ServerBean + String dn = server.getDocumentNo (C_DocType_ID, trxName, definite, po); + s_log.finest("Server => " + dn); + if (dn != null) + return dn; + } + s_log.log(Level.SEVERE, "AppsServer not found - " + C_DocType_ID); + } + catch (RemoteException ex) + { + s_log.log(Level.SEVERE, "AppsServer error", ex); + } + } + + //local + MDocType dt = MDocType.get (Env.getCtx(), C_DocType_ID); // wrong for SERVER, but r/o + if (dt != null && !dt.isDocNoControlled()) + { + s_log.finer("DocType_ID=" + C_DocType_ID + " Not DocNo controlled"); + return null; + } + if (definite && ! dt.isOverwriteSeqOnComplete()) { + s_log.finer("DocType_ID=" + C_DocType_ID + " Not Sequence Overwrite on Complete"); + return null; + } + if (dt == null || dt.getDocNoSequence_ID() == 0) + { + s_log.warning ("No Sequence for DocType - " + dt); + return null; + } + if (definite && dt.getDefiniteSequence_ID() == 0) + { + s_log.warning ("No Definite Sequence for DocType - " + dt); + return null; + } + + // Check AdempiereSys + boolean adempiereSys = Ini.isPropertyBool(Ini.P_ADEMPIERESYS); + if (CLogMgt.isLevel(LOGLEVEL)) + s_log.log(LOGLEVEL, "DocType_ID=" + C_DocType_ID + " [" + trxName + "]"); + + PreparedStatement pstmt = null; + ResultSet rs = null; + boolean isStartNewYear = false; + String dateColumn = null; + + if (!adempiereSys) + { + // Get the Start New Year & Sequence Type + String startNewYearSQL = "SELECT StartNewYear, DateColumn FROM AD_Sequence " + + "WHERE AD_Sequence_ID = ? AND IsActive = 'Y' AND IsTableID = 'N' AND IsAutoSequence='Y'"; + try { + pstmt = DB.prepareStatement(startNewYearSQL, trxName); + pstmt.setInt(1, definite ? dt.getDefiniteSequence_ID() : dt + .getDocNoSequence_ID()); + rs = pstmt.executeQuery(); + if (rs.next()) { + isStartNewYear = "Y".equals(rs.getString(1)); + dateColumn = rs.getString(2); + } + } catch (Exception e) { + s_log.log(Level.SEVERE, "(Table) [" + trxName + "]", e); + } + finally + { + DB.close(rs, pstmt); + } + } + + String selectSQL = null; + if (DB.isOracle() == false) + { + if (isStartNewYear) + { + selectSQL = "SELECT y.CurrentNext, s.CurrentNextSys, s.IncrementNo, s.Prefix, s.Suffix, s.DecimalPattern, s.AD_Client_ID, s.AD_Sequence_ID " + + "FROM AD_Sequence_No y, AD_Sequence s " + + "WHERE y.AD_Sequence_ID = s.AD_Sequence_ID " + + "AND s.AD_Sequence_ID = ? " + + "AND y.CalendarYear = ? " + + "AND s.IsActive='Y' AND s.IsTableID='N' AND s.IsAutoSequence='Y' " + + "FOR UPDATE OF AD_Sequence_No"; + } + else + { + selectSQL = "SELECT CurrentNext, CurrentNextSys, IncrementNo, Prefix, Suffix, DecimalPattern, AD_Client_ID, AD_Sequence_ID " + + "FROM AD_Sequence " + + "WHERE AD_Sequence_ID = ? " + + "AND IsActive='Y' AND IsTableID='N' AND IsAutoSequence='Y' " + + "FOR UPDATE OF AD_Sequence"; + } + USE_PROCEDURE=false; + } + else + { + if (isStartNewYear) { + selectSQL = "SELECT y.CurrentNext, s.CurrentNextSys, s.IncrementNo, s.Prefix, s.Suffix, s.DecimalPattern, s.AD_Client_ID, s.AD_Sequence_ID " + + "FROM AD_Sequence_No y, AD_Sequence s " + + "WHERE y.AD_Sequence_ID = s.AD_Sequence_ID " + + "AND s.AD_Sequence_ID = ? " + + "AND y.CalendarYear = ? " + + "AND s.IsActive='Y' AND s.IsTableID='N' AND s.IsAutoSequence='Y' "; + } else { + selectSQL = "SELECT CurrentNext, CurrentNextSys, IncrementNo, Prefix, Suffix, DecimalPattern, AD_Client_ID, AD_Sequence_ID " + + "FROM AD_Sequence " + + "WHERE AD_Sequence_ID = ? " + + "AND IsActive='Y' AND IsTableID='N' AND IsAutoSequence='Y' "; + } + USE_PROCEDURE = true; + } + Connection conn = null; + Trx trx = trxName == null ? null : Trx.get(trxName, true); + // + int AD_Sequence_ID = 0; + int incrementNo = 0; + int next = -1; + String prefix = ""; + String suffix = ""; + String decimalPattern = ""; + String calendarYear = ""; + try + { + if (trx != null) + conn = trx.getConnection(); + else + conn = DB.getConnectionID(); + // Error + if (conn == null) + return null; + + if (isStartNewYear) + { + if (po != null && dateColumn != null && dateColumn.length() > 0) + { + Date docDate = (Date)po.get_Value(dateColumn); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy"); + calendarYear = sdf.format(docDate); + } + else + { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy"); + calendarYear = sdf.format(new Date()); + } + } + + pstmt = conn.prepareStatement(selectSQL, + ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE); + if (definite) + pstmt.setInt(1, dt.getDefiniteSequence_ID()); + else + pstmt.setInt(1, dt.getDocNoSequence_ID()); + if (isStartNewYear) + pstmt.setString(2, calendarYear); + + // + rs = pstmt.executeQuery(); + // s_log.fine("AC=" + conn.getAutoCommit() + " -Iso=" + conn.getTransactionIsolation() + // + " - Type=" + pstmt.getResultSetType() + " - Concur=" + pstmt.getResultSetConcurrency()); + if (rs.next()) + { + incrementNo = rs.getInt(3); + prefix = rs.getString(4); + suffix = rs.getString(5); + decimalPattern = rs.getString(6); + int AD_Client_ID = rs.getInt(7); + if (adempiereSys && AD_Client_ID > 11) + adempiereSys = false; + AD_Sequence_ID = rs.getInt(8); + + if (USE_PROCEDURE) + { + next = isStartNewYear + ? nextIDByYear(conn, AD_Sequence_ID, incrementNo, calendarYear) + : nextID(conn, AD_Sequence_ID, adempiereSys); + } + else + { + PreparedStatement updateSQL = null; + try + { + if (adempiereSys) { + updateSQL = conn + .prepareStatement("UPDATE AD_Sequence SET CurrentNextSys = CurrentNextSys + ? WHERE AD_Sequence_ID = ?"); + next = rs.getInt(2); + } else { + String sql = isStartNewYear + ? "UPDATE AD_Sequence_No SET CurrentNext = CurrentNext + ? WHERE AD_Sequence_ID = ? AND CalendarYear = ?" + : "UPDATE AD_Sequence SET CurrentNext = CurrentNext + ? WHERE AD_Sequence_ID = ?"; + updateSQL = conn.prepareStatement(sql); + next = rs.getInt(1); + } + updateSQL.setInt(1, incrementNo); + updateSQL.setInt(2, AD_Sequence_ID); + if (isStartNewYear) + updateSQL.setString(3, calendarYear); + updateSQL.executeUpdate(); + } + finally + { + DB.close(updateSQL); + } + } + } + else + { + s_log.warning ("(DocType)- no record found - " + dt); + next = -2; + } + // Commit + if (trx == null) + { + conn.commit(); + } + } + catch (Exception e) + { + s_log.log(Level.SEVERE, "(DocType) [" + trxName + "]", e); + next = -2; + } + finally + { + // Finish + try + { + DB.close(rs, pstmt); + if (trx == null && conn != null) { + conn.close(); + conn = null; + } + } + catch (Exception e) + { + s_log.log(Level.SEVERE, "(DocType) - finish", e); + } + } + // Error + if (next < 0) + return null; + + // create DocumentNo + StringBuffer doc = new StringBuffer(); + if (prefix != null && prefix.length() > 0) + doc.append(Env.parseVariable(prefix, po, trxName, false)); + if (decimalPattern != null && decimalPattern.length() > 0) + doc.append(new DecimalFormat(decimalPattern).format(next)); + else + doc.append(next); + if (suffix != null && suffix.length() > 0) + doc.append(Env.parseVariable(suffix, po, trxName, false)); + String documentNo = doc.toString(); + s_log.finer (documentNo + " (" + incrementNo + ")" + + " - C_DocType_ID=" + C_DocType_ID + " [" + trx + "]"); + return documentNo; + } // getDocumentNo + + + /************************************************************************** + * Check/Initialize Client DocumentNo/Value Sequences + * @param ctx context + * @param AD_Client_ID client + * @param trxName transaction + * @return true if no error + */ + public static boolean checkClientSequences (Properties ctx, int AD_Client_ID, String trxName) + { + String sql = "SELECT TableName " + + "FROM AD_Table t " + + "WHERE IsActive='Y' AND IsView='N'" + // Get all Tables with DocumentNo or Value + + " AND AD_Table_ID IN " + + "(SELECT AD_Table_ID FROM AD_Column " + + "WHERE ColumnName = 'DocumentNo' OR ColumnName = 'Value')" + // Ability to run multiple times + + " AND 'DocumentNo_' || TableName NOT IN " + + "(SELECT Name FROM AD_Sequence s " + + "WHERE s.AD_Client_ID=?)"; + int counter = 0; + boolean success = true; + // + PreparedStatement pstmt = null; + ResultSet rs = null; + try + { + pstmt = DB.prepareStatement(sql, trxName); + pstmt.setInt(1, AD_Client_ID); + rs = pstmt.executeQuery(); + while (rs.next()) + { + String tableName = rs.getString(1); + s_log.fine("Add: " + tableName); + MSequence seq = new MSequence (ctx, AD_Client_ID, tableName, trxName); + if (seq.save()) + counter++; + else + { + s_log.severe ("Not created - AD_Client_ID=" + AD_Client_ID + + " - " + tableName); + success = false; + } + } + } + catch (Exception e) + { + s_log.log(Level.SEVERE, sql, e); + } + finally + { + DB.close(rs, pstmt); + rs = null; + pstmt = null; + } + s_log.info ("AD_Client_ID=" + AD_Client_ID + + " - created #" + counter + + " - success=" + success); + return success; + } // checkClientSequences + + + /** + * Create Table ID Sequence + * @param ctx context + * @param TableName table name + * @param trxName transaction + * @return true if created + */ + public static boolean createTableSequence (Properties ctx, String TableName, String trxName) + { + MSequence seq = new MSequence (ctx, 0, trxName); + seq.setClientOrg(0, 0); + seq.setName(TableName); + seq.setDescription("Table " + TableName); + seq.setIsTableID(true); + return seq.save(); + } // createTableSequence + + + /** + * Get Sequence + * @param ctx context + * @param tableName table name + * @return Sequence + */ + public static MSequence get (Properties ctx, String tableName) + { + return get(ctx, tableName, null); + } + + /** + * Get Sequence + * @param ctx context + * @param tableName table name + * @param trxName optional transaction name + * @return Sequence + */ + public static MSequence get (Properties ctx, String tableName, String trxName) + { + String sql = "SELECT * FROM AD_Sequence " + + "WHERE UPPER(Name)=?" + + " AND IsTableID='Y'"; + MSequence retValue = null; + PreparedStatement pstmt = null; + ResultSet rs = null; + try + { + pstmt = DB.prepareStatement (sql, trxName); + pstmt.setString (1, tableName.toUpperCase()); + rs = pstmt.executeQuery (); + if (rs.next ()) + retValue = new MSequence (ctx, rs, trxName); + if (rs.next()) + s_log.log(Level.SEVERE, "More then one sequence for " + tableName); + } + catch (Exception e) + { + s_log.log(Level.SEVERE, "get", e); + } + finally + { + DB.close(rs, pstmt); + rs = null; + pstmt = null; + } + return retValue; + } // get + + + /** Sequence for Table Document No's */ + private static final String PREFIX_DOCSEQ = "DocumentNo_"; + /** Start Number */ + public static final int INIT_NO = 1000000; // 1 Mio + /** Start System Number */ + // public static final int INIT_SYS_NO = 100; // start number for Compiere + public static final int INIT_SYS_NO = 50000; // start number for Adempiere + /** Static Logger */ + private static CLogger s_log = CLogger.getCLogger(MSequence.class); + + + /************************************************************************** + * Standard Constructor + * @param ctx context + * @param AD_Sequence_ID id + * @param trxName transaction + */ + public MSequence (Properties ctx, int AD_Sequence_ID, String trxName) + { + super(ctx, AD_Sequence_ID, trxName); + if (AD_Sequence_ID == 0) + { + // setName (null); + // + setIsTableID(false); + setStartNo (INIT_NO); + setCurrentNext (INIT_NO); + setCurrentNextSys (INIT_SYS_NO); + setIncrementNo (1); + setIsAutoSequence (true); + setIsAudited(false); + setStartNewYear(false); + } + } // MSequence + + /** + * Load Constructor + * @param ctx context + * @param rs result set + * @param trxName transaction + */ + public MSequence (Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } // MSequence + + /** + * New Document Sequence Constructor + * @param ctx context + * @param AD_Client_ID owner + * @param tableName name + * @param trxName transaction + */ + public MSequence (Properties ctx, int AD_Client_ID, String tableName, String trxName) + { + this (ctx, 0, trxName); + setClientOrg(AD_Client_ID, 0); // Client Ownership + setName(PREFIX_DOCSEQ + tableName); + setDescription("DocumentNo/Value for Table " + tableName); + } // MSequence; + + /** + * New Document Sequence Constructor + * @param ctx context + * @param AD_Client_ID owner + * @param sequenceName name + * @param StartNo start + * @param trxName trx + */ + public MSequence (Properties ctx, int AD_Client_ID, String sequenceName, int StartNo, String trxName) + { + this (ctx, 0, trxName); + setClientOrg(AD_Client_ID, 0); // Client Ownership + setName(sequenceName); + setDescription(sequenceName); + setStartNo(StartNo); + setCurrentNext(StartNo); + setCurrentNextSys(StartNo/10); + } // MSequence; + + + /************************************************************************** + * Get Next No and increase current next + * @return next no to use + */ + public int getNextID() + { + int retValue = getCurrentNext(); + setCurrentNext(retValue + getIncrementNo()); + return retValue; + } // getNextNo + + /** + * Validate Table Sequence Values + * @return true if updated + */ + public boolean validateTableIDValue() + { + if (!isTableID()) + return false; + String tableName = getName(); + int AD_Column_ID = DB.getSQLValue(null, "SELECT MAX(c.AD_Column_ID) " + + "FROM AD_Table t" + + " INNER JOIN AD_Column c ON (t.AD_Table_ID=c.AD_Table_ID) " + + "WHERE t.TableName='" + tableName + "'" + + " AND c.ColumnName='" + tableName + "_ID'"); + if (AD_Column_ID <= 0) + return false; + // + MSystem system = MSystem.get(getCtx()); + int IDRangeEnd = 0; + if (system.getIDRangeEnd() != null) + IDRangeEnd = system.getIDRangeEnd().intValue(); + boolean change = false; + String info = null; + + // Current Next + String sql = "SELECT MAX(" + tableName + "_ID) FROM " + tableName; + if (IDRangeEnd > 0) + sql += " WHERE " + tableName + "_ID < " + IDRangeEnd; + int maxTableID = DB.getSQLValue(null, sql); + if (maxTableID < INIT_NO) + maxTableID = INIT_NO - 1; + maxTableID++; // Next + if (getCurrentNext() < maxTableID) + { + setCurrentNext(maxTableID); + info = "CurrentNext=" + maxTableID; + change = true; + } + + // Get Max System_ID used in Table + sql = "SELECT MAX(" + tableName + "_ID) FROM " + tableName + + " WHERE " + tableName + "_ID < " + INIT_NO; + int maxTableSysID = DB.getSQLValue(null, sql); + if (maxTableSysID <= 0) + maxTableSysID = INIT_SYS_NO - 1; + maxTableSysID++; // Next + if (getCurrentNextSys() < maxTableSysID) + { + setCurrentNextSys(maxTableSysID); + if (info == null) + info = "CurrentNextSys=" + maxTableSysID; + else + info += " - CurrentNextSys=" + maxTableSysID; + change = true; + } + if (info != null) + log.fine(getName() + " - " + info); + return change; + } // validate + + + /************************************************************************** + * Test + * @param args ignored + */ + static public void main (String[] args) + { + // int id = getNextID_HTTP("AD_Column"); + // if (true) return; + + org.compiere.Adempiere.startup(true); + CLogMgt.setLevel(Level.SEVERE); + CLogMgt.setLoggerLevel(Level.SEVERE, null); + s_list = new Vector(1000); + + /** Lock Test **/ + String trxName = "test"; + System.out.println(DB.getDocumentNo(115, trxName)); + System.out.println(DB.getDocumentNo(116, trxName)); + System.out.println(DB.getDocumentNo(117, trxName)); + System.out.println(DB.getDocumentNo(118, trxName)); + System.out.println(DB.getDocumentNo(118, trxName)); + System.out.println(DB.getDocumentNo(117, trxName)); + + trxName = "test1"; + System.out.println(DB.getDocumentNo(115, trxName)); // hangs here as supposed + System.out.println(DB.getDocumentNo(116, trxName)); + System.out.println(DB.getDocumentNo(117, trxName)); + System.out.println(DB.getDocumentNo(118, trxName)); + + + + + + /** **/ + + /** Time Test */ + long time = System.currentTimeMillis(); + Thread[] threads = new Thread[10]; + for (int i = 0; i < 10; i++) + { + Runnable r = new GetIDs(i); + threads[i] = new Thread(r); + threads[i].start(); + } + for (int i = 0; i < 10; i++) + { + try + { + threads[i].join(); + } + catch (InterruptedException e) + { + } + } + time = System.currentTimeMillis() - time; + + System.out.println("-------------------------------------------"); + System.out.println("Size=" + s_list.size() + " (should be 1000)"); + Integer[] ia = new Integer[s_list.size()]; + s_list.toArray(ia); + Arrays.sort(ia); + Integer last = null; + int duplicates = 0; + for (int i = 0; i < ia.length; i++) + { + if (last != null) + { + if (last.compareTo(ia[i]) == 0) + { + // System.out.println(i + ": " + ia[i]); + duplicates++; + } + } + last = ia[i]; + } + System.out.println("-------------------------------------------"); + System.out.println("Size=" + s_list.size() + " (should be 1000)"); + System.out.println("Duplicates=" + duplicates); + System.out.println("Time (ms)=" + time + " - " + ((float)time/s_list.size()) + " each" ); + System.out.println("-------------------------------------------"); + + + + /** ** + try + { + int retValue = -1; + Connection conn = DB.getConnectionRW (); + // DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver()); + // Connection conn = DriverManager.getConnection ("jdbc:oracle:thin:@//dev2:1521/dev2", "adempiere", "adempiere"); + + conn.setAutoCommit(false); + String sql = "SELECT CurrentNext, CurrentNextSys, IncrementNo " + + "FROM AD_Sequence " + + "WHERE Name='AD_Sequence' "; + sql += "FOR UPDATE"; + // creates ORA-00907: missing right parenthesis + // sql += "FOR UPDATE OF CurrentNext, CurrentNextSys"; + + + PreparedStatement pstmt = conn.prepareStatement(sql, + ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE); + ResultSet rs = pstmt.executeQuery(); + System.out.println("AC=" + conn.getAutoCommit() + ", RO=" + conn.isReadOnly() + + " - Isolation=" + conn.getTransactionIsolation() + "(" + Connection.TRANSACTION_READ_COMMITTED + + ") - RSType=" + pstmt.getResultSetType() + "(" + ResultSet.TYPE_SCROLL_SENSITIVE + + "), RSConcur=" + pstmt.getResultSetConcurrency() + "(" + ResultSet.CONCUR_UPDATABLE + + ")"); + + if (rs.next()) + { + int IncrementNo = rs.getInt(3); + retValue = rs.getInt(1); + rs.updateInt(1, retValue + IncrementNo); + rs.updateRow(); + } + else + s_log.severe ("no record found"); + rs.close(); + pstmt.close(); + conn.commit(); + conn.close(); + // + System.out.println("Next=" + retValue); + + } + catch (Exception e) + { + e.printStackTrace (); + } + + System.exit(0); + + /** ** + + int AD_Client_ID = 0; + int C_DocType_ID = 115; // GL + String TableName = "C_Invoice"; + String trxName = "x"; + Trx trx = Trx.get(trxName, true); + + System.out.println ("none " + getNextID (0, "Test")); + System.out.println ("----------------------------------------------"); + System.out.println ("trx1 " + getNextID (0, "Test")); + System.out.println ("trx2 " + getNextID (0, "Test")); + // trx.rollback(); + System.out.println ("trx3 " + getNextID (0, "Test")); + // trx.commit(); + System.out.println ("trx4 " + getNextID (0, "Test")); + // trx.rollback(); + // trx.close(); + System.out.println ("----------------------------------------------"); + System.out.println ("none " + getNextID (0, "Test")); + System.out.println ("=============================================="); + + + trx = Trx.get(trxName, true); + System.out.println ("none " + getDocumentNo(AD_Client_ID, TableName, null)); + System.out.println ("----------------------------------------------"); + System.out.println ("trx1 " + getDocumentNo(AD_Client_ID, TableName, trxName)); + System.out.println ("trx2 " + getDocumentNo(AD_Client_ID, TableName, trxName)); + trx.rollback(); + System.out.println ("trx3 " + getDocumentNo(AD_Client_ID, TableName, trxName)); + trx.commit(); + System.out.println ("trx4 " + getDocumentNo(AD_Client_ID, TableName, trxName)); + trx.rollback(); + trx.close(); + System.out.println ("----------------------------------------------"); + System.out.println ("none " + getDocumentNo(AD_Client_ID, TableName, null)); + System.out.println ("=============================================="); + + + trx = Trx.get(trxName, true); + System.out.println ("none " + getDocumentNo(C_DocType_ID, null)); + System.out.println ("----------------------------------------------"); + System.out.println ("trx1 " + getDocumentNo(C_DocType_ID, trxName)); + System.out.println ("trx2 " + getDocumentNo(C_DocType_ID, trxName)); + trx.rollback(); + System.out.println ("trx3 " + getDocumentNo(C_DocType_ID, trxName)); + trx.commit(); + System.out.println ("trx4 " + getDocumentNo(C_DocType_ID, trxName)); + trx.rollback(); + trx.close(); + System.out.println ("----------------------------------------------"); + System.out.println ("none " + getDocumentNo(C_DocType_ID, null)); + System.out.println ("=============================================="); + /** **/ + } // main + + /** Test */ + private static Vector s_list = null; + + /** + * Test Sequence - Get IDs + * + * @author Jorg Janke + * @version $Id: MSequence.java,v 1.3 2006/07/30 00:58:04 jjanke Exp $ + */ + public static class GetIDs implements Runnable + { + /** + * Get IDs + * @param i + */ + public GetIDs (int i) + { + m_i = i; + } + private int m_i; + + /** + * Run + */ + public void run() + { + for (int i = 0; i < 100; i++) + { + try + { + int no = DB.getNextID(0, "Test", null); + s_list.add(new Integer(no)); + // System.out.println("#" + m_i + ": " + no); + } + catch (Exception e) + { + System.err.println(e.getMessage()); + } + } + } + } // GetIDs + + /** + * Get next number for Key column + * @param AD_Client_ID client + * @param TableName table name + * @param trxName optional Transaction Name + * @return next no or (-1=error) + */ + public static synchronized int getNextOfficialID_HTTP (String TableName) + { + String website = MSysConfig.getValue("DICTIONARY_ID_WEBSITE"); // "http://developer.adempiere.com/cgi-bin/get_ID"; + String prm_USER = MSysConfig.getValue("DICTIONARY_ID_USER"); // "globalqss"; + String prm_PASSWORD = MSysConfig.getValue("DICTIONARY_ID_PASSWORD"); // "password_inseguro"; + String prm_TABLE = TableName; + String prm_ALTKEY = ""; // TODO: generate alt-key based on key of table + String prm_COMMENT = MSysConfig.getValue("DICTIONARY_ID_COMMENTS"); + String prm_PROJECT = new String("Adempiere"); + + return getNextID_HTTP(TableName, website, prm_USER, + prm_PASSWORD, prm_TABLE, prm_ALTKEY, prm_COMMENT, prm_PROJECT); + } + + /** + * Get next number for Key column + * @param AD_Client_ID client + * @param TableName table name + * @param trxName optional Transaction Name + * @return next no or (-1=error) + */ + public static synchronized int getNextProjectID_HTTP (String TableName) + { + String website = MSysConfig.getValue("PROJECT_ID_WEBSITE"); // "http://developer.adempiere.com/cgi-bin/get_ID"; + String prm_USER = MSysConfig.getValue("PROJECT_ID_USER"); // "globalqss"; + String prm_PASSWORD = MSysConfig.getValue("PROJECT_ID_PASSWORD"); // "password_inseguro"; + String prm_TABLE = TableName; + String prm_ALTKEY = ""; // TODO: generate alt-key based on key of table + String prm_COMMENT = MSysConfig.getValue("PROJECT_ID_COMMENTS"); + String prm_PROJECT = MSysConfig.getValue("PROJECT_ID_PROJECT"); + + return getNextID_HTTP(TableName, website, prm_USER, + prm_PASSWORD, prm_TABLE, prm_ALTKEY, prm_COMMENT, prm_PROJECT); + } + + private static int getNextID_HTTP(String TableName, + String website, String prm_USER, String prm_PASSWORD, + String prm_TABLE, String prm_ALTKEY, String prm_COMMENT, + String prm_PROJECT) { + StringBuffer read = new StringBuffer(""); + int retValue = -1; + try { + String completeUrl = website + "?" + "USER=" + + URLEncoder.encode(prm_USER, "UTF-8") + "&PASSWORD=" + + URLEncoder.encode(prm_PASSWORD, "UTF-8") + "&PROJECT=" + + URLEncoder.encode(prm_PROJECT, "UTF-8") + "&TABLE=" + + URLEncoder.encode(prm_TABLE, "UTF-8") + "&ALTKEY=" + + URLEncoder.encode(prm_ALTKEY, "UTF-8") + "&COMMENT=" + + URLEncoder.encode(prm_COMMENT, "UTF-8"); + + // Now use the URL class to parse the user-specified URL into + // its various parts: protocol, host, port, filename. Check the protocol + URL url = new URL(completeUrl); + String protocol = url.getProtocol(); + if (!protocol.equals("http")) + throw new IllegalArgumentException("URL must use 'http:' protocol"); + String host = url.getHost(); + int port = url.getPort(); + if (port == -1) port = 80; // if no port, use the default HTTP port + String filename = url.getFile(); + // Open a network socket connection to the specified host and port + Socket socket = new Socket(host, port); + // Get input and output streams for the socket + InputStream from_server = socket.getInputStream(); + PrintWriter to_server = + new PrintWriter(new OutputStreamWriter(socket.getOutputStream())); + + // Send the HTTP GET command to the Web server, specifying the file. + // This uses an old and very simple version of the HTTP protocol + to_server.println("GET " + filename); + to_server.flush(); // Send it right now! + + // Now read the server's response, and write it to the file + byte[] buffer = new byte[4096]; + int bytes_read; + while((bytes_read = from_server.read(buffer)) != -1) { + for (int i = 0; i < bytes_read; i++) { + if (buffer[i] != 10) + read.append((char) buffer[i]); + } + } + + // When the server closes the connection, we close our stuff + socket.close(); + retValue = Integer.parseInt(read.toString()); + if (retValue <= 0) + retValue = -1; + } + catch (Exception e) { // Report any errors that arise + System.err.println(e); + retValue = -1; + } + s_log.log(Level.INFO, "getNextID_HTTP - " + TableName + "=" + read + "(" + retValue + ")"); + + return retValue; + } + + private static boolean isExceptionCentralized(String tableName) { + String [] exceptionTables = new String[] { + "AD_ACCESSLOG", + "AD_ALERTPROCESSORLOG", + "AD_CHANGELOG", + "AD_ISSUE", + "AD_LDAPPROCESSORLOG", + "AD_PACKAGE_IMP", + "AD_PACKAGE_IMP_BACKUP", + "AD_PACKAGE_IMP_DETAIL", + "AD_PACKAGE_IMP_INST", + "AD_PACKAGE_IMP_PROC", + "AD_PINSTANCE", + "AD_PINSTANCE_LOG", + "AD_PINSTANCE_PARA", + "AD_REPLICATION_LOG", + "AD_SCHEDULERLOG", + "AD_SESSION", + "AD_WORKFLOWPROCESSORLOG", + "CM_WEBACCESSLOG", + "C_ACCTPROCESSORLOG", + "K_INDEXLOG", + "R_REQUESTPROCESSORLOG", + "T_AGING", + "T_ALTER_COLUMN", + "T_DISTRIBUTIONRUNDETAIL", + "T_INVENTORYVALUE", + "T_INVOICEGL", + "T_REPLENISH", + "T_REPORT", + "T_REPORTSTATEMENT", + "T_SELECTION", + "T_SELECTION2", + "T_SPOOL", + "T_TRANSACTION", + "T_TRIALBALANCE" + }; + for (int i = 0; i < exceptionTables.length; i++) { + if (tableName.equalsIgnoreCase(exceptionTables[i])) + return true; + } + + // don't log selects or insert/update for exception tables (i.e. AD_Issue, AD_ChangeLog) + return false; + } + + /** + * Get preliminary document no by year + * @param tab + * @param AD_Sequence_ID + * @param dateColumn + * @return Preliminary document no + */ + public static String getPreliminaryNoByYear(GridTab tab, int AD_Sequence_ID, String dateColumn, String trxName) { + Date d = (Date)tab.getValue(dateColumn); + if (d == null) + d = new Date(); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy"); + String calendarYear = sdf.format(d); + String sql = "select CurrentNext From AD_Sequence_No Where AD_Sequence_ID = ? and CalendarYear = ?"; + + return DB.getSQLValueString(trxName, sql, AD_Sequence_ID, calendarYear); + } + +} // MSequence \ No newline at end of file diff --git a/posterita/posterita/src/main/org/compiere/model/MWarehouse.java b/posterita/posterita/src/main/org/compiere/model/MWarehouse.java new file mode 100644 index 0000000000..fbbfb4079c --- /dev/null +++ b/posterita/posterita/src/main/org/compiere/model/MWarehouse.java @@ -0,0 +1,247 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program 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 General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.sql.*; +import java.util.*; +import java.util.logging.*; +import org.compiere.util.*; + +/** + * Warehouse Model + * + * @author Jorg Janke + * @version $Id: MWarehouse.java,v 1.3 2006/07/30 00:58:05 jjanke Exp $ + */ +public class MWarehouse extends X_M_Warehouse +{ + /** + * Get from Cache + * @param ctx context + * @param M_Warehouse_ID id + * @return warehouse + */ + public static MWarehouse get (Properties ctx, int M_Warehouse_ID) + { + return get(ctx, M_Warehouse_ID, null); + } // get + + /** + * Retrieves warehouse from cache under transaction scope + * @param ctx context + * @param M_Warehouse_ID id of warehouse to load + * @param trxName transaction name + * @return warehouse + */ + public static MWarehouse get (Properties ctx, int M_Warehouse_ID, String trxName) + { + Integer key = new Integer(M_Warehouse_ID); + MWarehouse retValue = (MWarehouse)s_cache.get(key); + if (retValue != null) + return retValue; + // + retValue = new MWarehouse (ctx, M_Warehouse_ID, trxName); + s_cache.put (key, retValue); + return retValue; + } + /** + * Get Warehouses for Org + * @param ctx context + * @param AD_Org_ID id + * @return warehouse + */ + public static MWarehouse[] getForOrg (Properties ctx, int AD_Org_ID) + { + ArrayList list = new ArrayList(); + String sql = "SELECT * FROM M_Warehouse WHERE AD_Org_ID=? ORDER BY Created"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement (sql, null); + pstmt.setInt (1, AD_Org_ID); + ResultSet rs = pstmt.executeQuery (); + while (rs.next ()) + list.add (new MWarehouse (ctx, rs, null)); + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + s_log.log(Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + MWarehouse[] retValue = new MWarehouse[list.size ()]; + list.toArray (retValue); + return retValue; + } // get + + + /** Cache */ + private static CCache s_cache = new CCache("M_Warehouse", 5); + /** Static Logger */ + private static CLogger s_log = CLogger.getCLogger (MWarehouse.class); + + /** + * Standard Constructor + * @param ctx context + * @param M_Warehouse_ID id + * @param trxName transaction + */ + public MWarehouse (Properties ctx, int M_Warehouse_ID, String trxName) + { + super(ctx, M_Warehouse_ID, trxName); + if (M_Warehouse_ID == 0) + { + // setValue (null); + // setName (null); + // setC_Location_ID (0); + setSeparator ("*"); // * + } + } // MWarehouse + + /** + * Load Constructor + * @param ctx context + * @param rs result set + * @param trxName transaction + */ + public MWarehouse (Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } // MWarehouse + + /** + * Organization Constructor + * @param org parent + */ + public MWarehouse (MOrg org) + { + this (org.getCtx(), 0, org.get_TrxName()); + setClientOrg(org); + setValue (org.getValue()); + setName (org.getName()); + if (org.getInfo() != null) + setC_Location_ID (org.getInfo().getC_Location_ID()); + } // MWarehouse + + /** Warehouse Locators */ + private MLocator[] m_locators = null; + + /** + * Get Locators + * @param reload if true reload + * @return array of locators + */ + public MLocator[] getLocators(boolean reload) + { + if (!reload && m_locators != null) + return m_locators; + // + String sql = "SELECT * FROM M_Locator WHERE M_Warehouse_ID=? ORDER BY X,Y,Z"; + ArrayList list = new ArrayList(); + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement (sql, null); + pstmt.setInt (1, getM_Warehouse_ID()); + ResultSet rs = pstmt.executeQuery (); + while (rs.next ()) + list.add(new MLocator (getCtx(), rs, null)); + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + log.log(Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + // + m_locators = new MLocator[list.size()]; + list.toArray (m_locators); + return m_locators; + } // getLocators + + /** + * Get Default Locator + * @return (first) default locator + */ + public MLocator getDefaultLocator() + { + MLocator[] locators = getLocators(false); + for (int i = 0; i < locators.length; i++) + { + if (locators[i].isDefault() && locators[i].isActive()) + return locators[i]; + } + // No Default - first one + if (locators.length > 0) + { + log.warning("No default locator for " + getName()); + return locators[0]; + } + // No Locator - create one + MLocator loc = new MLocator (this, "Standard"); + loc.setIsDefault(true); + loc.save(); + log.info("Created default locator for " + getName()); + return loc; + } // getLocators + + /** + * After Save + * @param newRecord new + * @param success success + * @return success + */ + protected boolean afterSave (boolean newRecord, boolean success) + { + if (newRecord && success) + insert_Accounting("M_Warehouse_Acct", "C_AcctSchema_Default", null); + + return success; + } // afterSave + + /** + * Before Delete + * @return true + */ + protected boolean beforeDelete () + { + return delete_Accounting("M_Warehouse_Acct"); + } // beforeDelete + +} // MWarehouse diff --git a/posterita/posterita/src/main/org/compiere/model/X_AD_OrgInfo.java b/posterita/posterita/src/main/org/compiere/model/X_AD_OrgInfo.java new file mode 100644 index 0000000000..d90eaae83f --- /dev/null +++ b/posterita/posterita/src/main/org/compiere/model/X_AD_OrgInfo.java @@ -0,0 +1,384 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2007 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program 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 General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +/** Generated Model - DO NOT CHANGE */ +package org.compiere.model; + +import java.lang.reflect.Constructor; +import java.sql.ResultSet; +import java.util.Properties; +import java.util.logging.Level; + +/** Generated Model for AD_OrgInfo + * @author Adempiere (generated) + * @version Release 3.4.0s - $Id$ */ +public class X_AD_OrgInfo extends PO implements I_AD_OrgInfo, I_Persistent +{ + + /** + * + */ + private static final long serialVersionUID = 1L; + + /** Standard Constructor */ + public X_AD_OrgInfo (Properties ctx, int AD_OrgInfo_ID, String trxName) + { + super (ctx, AD_OrgInfo_ID, trxName); + /** if (AD_OrgInfo_ID == 0) + { + setDUNS (null); + setTaxID (null); + } */ + } + + /** Load Constructor */ + public X_AD_OrgInfo (Properties ctx, ResultSet rs, String trxName) + { + super (ctx, rs, trxName); + } + + /** AccessLevel + * @return 7 - System - Client - Org + */ + protected int get_AccessLevel() + { + return accessLevel.intValue(); + } + + /** Load Meta Data */ + protected POInfo initPO (Properties ctx) + { + POInfo poi = POInfo.getPOInfo (ctx, Table_ID, get_TrxName()); + return poi; + } + + public String toString() + { + StringBuffer sb = new StringBuffer ("X_AD_OrgInfo[") + .append(get_ID()).append("]"); + return sb.toString(); + } + + public I_AD_OrgType getAD_OrgType() throws Exception + { + Class clazz = MTable.getClass(I_AD_OrgType.Table_Name); + I_AD_OrgType result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_AD_OrgType)constructor.newInstance(new Object[] {getCtx(), new Integer(getAD_OrgType_ID()), get_TrxName()}); + } catch (Exception e) { + log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); + log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); + throw e; + } + return result; + } + + /** Set Organization Type. + @param AD_OrgType_ID + Organization Type allows you to categorize your organizations + */ + public void setAD_OrgType_ID (int AD_OrgType_ID) + { + if (AD_OrgType_ID < 1) + set_Value (COLUMNNAME_AD_OrgType_ID, null); + else + set_Value (COLUMNNAME_AD_OrgType_ID, Integer.valueOf(AD_OrgType_ID)); + } + + /** Get Organization Type. + @return Organization Type allows you to categorize your organizations + */ + public int getAD_OrgType_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_AD_OrgType_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set Address. + @param C_Location_ID + Location or Address + */ + public void setC_Location_ID (int C_Location_ID) + { + if (C_Location_ID < 1) + set_Value (COLUMNNAME_C_Location_ID, null); + else + set_Value (COLUMNNAME_C_Location_ID, Integer.valueOf(C_Location_ID)); + } + + /** Get Address. + @return Location or Address + */ + public int getC_Location_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_Location_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set D-U-N-S. + @param DUNS + Dun & Bradstreet Number + */ + public void setDUNS (String DUNS) + { + if (DUNS == null) + throw new IllegalArgumentException ("DUNS is mandatory."); + + if (DUNS.length() > 11) + { + log.warning("Length > 11 - truncated"); + DUNS = DUNS.substring(0, 11); + } + set_Value (COLUMNNAME_DUNS, DUNS); + } + + /** Get D-U-N-S. + @return Dun & Bradstreet Number + */ + public String getDUNS () + { + return (String)get_Value(COLUMNNAME_DUNS); + } + + public I_M_Warehouse getM_Warehouse() throws Exception + { + Class clazz = MTable.getClass(I_M_Warehouse.Table_Name); + I_M_Warehouse result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_M_Warehouse)constructor.newInstance(new Object[] {getCtx(), new Integer(getM_Warehouse_ID()), get_TrxName()}); + } catch (Exception e) { + log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); + log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); + throw e; + } + return result; + } + + /** Set Warehouse. + @param M_Warehouse_ID + Storage Warehouse and Service Point + */ + public void setM_Warehouse_ID (int M_Warehouse_ID) + { + if (M_Warehouse_ID < 1) + set_Value (COLUMNNAME_M_Warehouse_ID, null); + else + set_Value (COLUMNNAME_M_Warehouse_ID, Integer.valueOf(M_Warehouse_ID)); + } + + /** Get Warehouse. + @return Storage Warehouse and Service Point + */ + public int getM_Warehouse_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_M_Warehouse_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + public I_PA_Goal getPA_Goal() throws Exception + { + Class clazz = MTable.getClass(I_PA_Goal.Table_Name); + I_PA_Goal result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_PA_Goal)constructor.newInstance(new Object[] {getCtx(), new Integer(getPA_Goal_ID()), get_TrxName()}); + } catch (Exception e) { + log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); + log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); + throw e; + } + return result; + } + + /** Set Goal. + @param PA_Goal_ID + Performance Goal + */ + public void setPA_Goal_ID (int PA_Goal_ID) + { + if (PA_Goal_ID < 1) + set_Value (COLUMNNAME_PA_Goal_ID, null); + else + set_Value (COLUMNNAME_PA_Goal_ID, Integer.valueOf(PA_Goal_ID)); + } + + /** Get Goal. + @return Performance Goal + */ + public int getPA_Goal_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_PA_Goal_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Parent_Org_ID AD_Reference_ID=130 */ + public static final int PARENT_ORG_ID_AD_Reference_ID=130; + /** Set Parent Organization. + @param Parent_Org_ID + Parent (superior) Organization + */ + public void setParent_Org_ID (int Parent_Org_ID) + { + if (Parent_Org_ID < 1) + set_Value (COLUMNNAME_Parent_Org_ID, null); + else + set_Value (COLUMNNAME_Parent_Org_ID, Integer.valueOf(Parent_Org_ID)); + } + + /** Get Parent Organization. + @return Parent (superior) Organization + */ + public int getParent_Org_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_Parent_Org_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set Receipt Footer Msg. + @param ReceiptFooterMsg + This message will be displayed at the bottom of a receipt when doing a sales or purchase + */ + public void setReceiptFooterMsg (String ReceiptFooterMsg) + { + + if (ReceiptFooterMsg != null && ReceiptFooterMsg.length() > 1023) + { + log.warning("Length > 1023 - truncated"); + ReceiptFooterMsg = ReceiptFooterMsg.substring(0, 1023); + } + set_Value (COLUMNNAME_ReceiptFooterMsg, ReceiptFooterMsg); + } + + /** Get Receipt Footer Msg. + @return This message will be displayed at the bottom of a receipt when doing a sales or purchase + */ + public String getReceiptFooterMsg () + { + return (String)get_Value(COLUMNNAME_ReceiptFooterMsg); + } + + /** Supervisor_ID AD_Reference_ID=286 */ + public static final int SUPERVISOR_ID_AD_Reference_ID=286; + /** Set Supervisor. + @param Supervisor_ID + Supervisor for this user/organization - used for escalation and approval + */ + public void setSupervisor_ID (int Supervisor_ID) + { + if (Supervisor_ID < 1) + set_Value (COLUMNNAME_Supervisor_ID, null); + else + set_Value (COLUMNNAME_Supervisor_ID, Integer.valueOf(Supervisor_ID)); + } + + /** Get Supervisor. + @return Supervisor for this user/organization - used for escalation and approval + */ + public int getSupervisor_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_Supervisor_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set Tax ID. + @param TaxID + Tax Identification + */ + public void setTaxID (String TaxID) + { + if (TaxID == null) + throw new IllegalArgumentException ("TaxID is mandatory."); + + if (TaxID.length() > 20) + { + log.warning("Length > 20 - truncated"); + TaxID = TaxID.substring(0, 20); + } + set_Value (COLUMNNAME_TaxID, TaxID); + } + + /** Get Tax ID. + @return Tax Identification + */ + public String getTaxID () + { + return (String)get_Value(COLUMNNAME_TaxID); + } + + /** TransferBank_ID AD_Reference_ID=52001 */ + public static final int TRANSFERBANK_ID_AD_Reference_ID=52001; + /** Set Bank for transfers. + @param TransferBank_ID + Bank account depending on currency will be used from this bank for doing transfers + */ + public void setTransferBank_ID (int TransferBank_ID) + { + if (TransferBank_ID < 1) + set_Value (COLUMNNAME_TransferBank_ID, null); + else + set_Value (COLUMNNAME_TransferBank_ID, Integer.valueOf(TransferBank_ID)); + } + + /** Get Bank for transfers. + @return Bank account depending on currency will be used from this bank for doing transfers + */ + public int getTransferBank_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_TransferBank_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** TransferCashBook_ID AD_Reference_ID=52004 */ + public static final int TRANSFERCASHBOOK_ID_AD_Reference_ID=52004; + /** Set CashBook for transfers. + @param TransferCashBook_ID CashBook for transfers */ + public void setTransferCashBook_ID (int TransferCashBook_ID) + { + if (TransferCashBook_ID < 1) + set_Value (COLUMNNAME_TransferCashBook_ID, null); + else + set_Value (COLUMNNAME_TransferCashBook_ID, Integer.valueOf(TransferCashBook_ID)); + } + + /** Get CashBook for transfers. + @return CashBook for transfers */ + public int getTransferCashBook_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_TransferCashBook_ID); + if (ii == null) + return 0; + return ii.intValue(); + } +} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/compiere/model/X_AD_Role.java b/posterita/posterita/src/main/org/compiere/model/X_AD_Role.java new file mode 100644 index 0000000000..221b025e78 --- /dev/null +++ b/posterita/posterita/src/main/org/compiere/model/X_AD_Role.java @@ -0,0 +1,1015 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2007 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program 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 General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +/** Generated Model - DO NOT CHANGE */ +package org.compiere.model; + +import java.lang.reflect.Constructor; +import java.math.BigDecimal; +import java.sql.ResultSet; +import java.util.Properties; +import java.util.logging.Level; +import org.compiere.util.Env; +import org.compiere.util.KeyNamePair; + +/** Generated Model for AD_Role + * @author Adempiere (generated) + * @version Release 3.4.0s - $Id$ */ +public class X_AD_Role extends PO implements I_AD_Role, I_Persistent +{ + + /** + * + */ + private static final long serialVersionUID = 1L; + + /** Standard Constructor */ + public X_AD_Role (Properties ctx, int AD_Role_ID, String trxName) + { + super (ctx, AD_Role_ID, trxName); + /** if (AD_Role_ID == 0) + { + setAD_Role_ID (0); + setConfirmQueryRecords (0); +// 0 + setIsAccessAllOrgs (false); +// N + setIsCanApproveOwnDoc (false); + setIsCanExport (true); +// Y + setIsCanReport (true); +// Y + setIsChangeLog (false); +// N + setIsDiscountAllowedOnTotal (false); + setIsDiscountUptoLimitPrice (false); + setIsManual (false); + setIsPersonalAccess (false); +// N + setIsPersonalLock (false); +// N + setIsShowAcct (false); +// N + setIsUseUserOrgAccess (false); +// N + setMaxQueryRecords (0); +// 0 + setName (null); + setOverwritePriceLimit (false); +// N + setPreferenceType (null); +// O + setUserLevel (null); +// O + } */ + } + + /** Load Constructor */ + public X_AD_Role (Properties ctx, ResultSet rs, String trxName) + { + super (ctx, rs, trxName); + } + + /** AccessLevel + * @return 6 - System - Client + */ + protected int get_AccessLevel() + { + return accessLevel.intValue(); + } + + /** Load Meta Data */ + protected POInfo initPO (Properties ctx) + { + POInfo poi = POInfo.getPOInfo (ctx, Table_ID, get_TrxName()); + return poi; + } + + public String toString() + { + StringBuffer sb = new StringBuffer ("X_AD_Role[") + .append(get_ID()).append("]"); + return sb.toString(); + } + + /** Set Role. + @param AD_Role_ID + Responsibility Role + */ + public void setAD_Role_ID (int AD_Role_ID) + { + if (AD_Role_ID < 0) + throw new IllegalArgumentException ("AD_Role_ID is mandatory."); + set_ValueNoCheck (COLUMNNAME_AD_Role_ID, Integer.valueOf(AD_Role_ID)); + } + + /** Get Role. + @return Responsibility Role + */ + public int getAD_Role_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_AD_Role_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** AD_Tree_Menu_ID AD_Reference_ID=184 */ + public static final int AD_TREE_MENU_ID_AD_Reference_ID=184; + /** Set Menu Tree. + @param AD_Tree_Menu_ID + Tree of the menu + */ + public void setAD_Tree_Menu_ID (int AD_Tree_Menu_ID) + { + if (AD_Tree_Menu_ID < 1) + set_Value (COLUMNNAME_AD_Tree_Menu_ID, null); + else + set_Value (COLUMNNAME_AD_Tree_Menu_ID, Integer.valueOf(AD_Tree_Menu_ID)); + } + + /** Get Menu Tree. + @return Tree of the menu + */ + public int getAD_Tree_Menu_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_AD_Tree_Menu_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** AD_Tree_Org_ID AD_Reference_ID=184 */ + public static final int AD_TREE_ORG_ID_AD_Reference_ID=184; + /** Set Organization Tree. + @param AD_Tree_Org_ID + Tree to determine organizational hierarchy + */ + public void setAD_Tree_Org_ID (int AD_Tree_Org_ID) + { + if (AD_Tree_Org_ID < 1) + set_Value (COLUMNNAME_AD_Tree_Org_ID, null); + else + set_Value (COLUMNNAME_AD_Tree_Org_ID, Integer.valueOf(AD_Tree_Org_ID)); + } + + /** Get Organization Tree. + @return Tree to determine organizational hierarchy + */ + public int getAD_Tree_Org_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_AD_Tree_Org_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set Allow Info Account. + @param Allow_Info_Account Allow Info Account */ + public void setAllow_Info_Account (boolean Allow_Info_Account) + { + set_Value (COLUMNNAME_Allow_Info_Account, Boolean.valueOf(Allow_Info_Account)); + } + + /** Get Allow Info Account. + @return Allow Info Account */ + public boolean isAllow_Info_Account () + { + Object oo = get_Value(COLUMNNAME_Allow_Info_Account); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Allow Info Asset. + @param Allow_Info_Asset Allow Info Asset */ + public void setAllow_Info_Asset (boolean Allow_Info_Asset) + { + set_Value (COLUMNNAME_Allow_Info_Asset, Boolean.valueOf(Allow_Info_Asset)); + } + + /** Get Allow Info Asset. + @return Allow Info Asset */ + public boolean isAllow_Info_Asset () + { + Object oo = get_Value(COLUMNNAME_Allow_Info_Asset); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Allow Info BPartner. + @param Allow_Info_BPartner Allow Info BPartner */ + public void setAllow_Info_BPartner (boolean Allow_Info_BPartner) + { + set_Value (COLUMNNAME_Allow_Info_BPartner, Boolean.valueOf(Allow_Info_BPartner)); + } + + /** Get Allow Info BPartner. + @return Allow Info BPartner */ + public boolean isAllow_Info_BPartner () + { + Object oo = get_Value(COLUMNNAME_Allow_Info_BPartner); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Allow Info CashJournal. + @param Allow_Info_CashJournal Allow Info CashJournal */ + public void setAllow_Info_CashJournal (boolean Allow_Info_CashJournal) + { + set_Value (COLUMNNAME_Allow_Info_CashJournal, Boolean.valueOf(Allow_Info_CashJournal)); + } + + /** Get Allow Info CashJournal. + @return Allow Info CashJournal */ + public boolean isAllow_Info_CashJournal () + { + Object oo = get_Value(COLUMNNAME_Allow_Info_CashJournal); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Allow Info InOut. + @param Allow_Info_InOut Allow Info InOut */ + public void setAllow_Info_InOut (boolean Allow_Info_InOut) + { + set_Value (COLUMNNAME_Allow_Info_InOut, Boolean.valueOf(Allow_Info_InOut)); + } + + /** Get Allow Info InOut. + @return Allow Info InOut */ + public boolean isAllow_Info_InOut () + { + Object oo = get_Value(COLUMNNAME_Allow_Info_InOut); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Allow Info Invoice. + @param Allow_Info_Invoice Allow Info Invoice */ + public void setAllow_Info_Invoice (boolean Allow_Info_Invoice) + { + set_Value (COLUMNNAME_Allow_Info_Invoice, Boolean.valueOf(Allow_Info_Invoice)); + } + + /** Get Allow Info Invoice. + @return Allow Info Invoice */ + public boolean isAllow_Info_Invoice () + { + Object oo = get_Value(COLUMNNAME_Allow_Info_Invoice); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Allow Info Order. + @param Allow_Info_Order Allow Info Order */ + public void setAllow_Info_Order (boolean Allow_Info_Order) + { + set_Value (COLUMNNAME_Allow_Info_Order, Boolean.valueOf(Allow_Info_Order)); + } + + /** Get Allow Info Order. + @return Allow Info Order */ + public boolean isAllow_Info_Order () + { + Object oo = get_Value(COLUMNNAME_Allow_Info_Order); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Allow Info Payment. + @param Allow_Info_Payment Allow Info Payment */ + public void setAllow_Info_Payment (boolean Allow_Info_Payment) + { + set_Value (COLUMNNAME_Allow_Info_Payment, Boolean.valueOf(Allow_Info_Payment)); + } + + /** Get Allow Info Payment. + @return Allow Info Payment */ + public boolean isAllow_Info_Payment () + { + Object oo = get_Value(COLUMNNAME_Allow_Info_Payment); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Allow Info Product. + @param Allow_Info_Product Allow Info Product */ + public void setAllow_Info_Product (boolean Allow_Info_Product) + { + set_Value (COLUMNNAME_Allow_Info_Product, Boolean.valueOf(Allow_Info_Product)); + } + + /** Get Allow Info Product. + @return Allow Info Product */ + public boolean isAllow_Info_Product () + { + Object oo = get_Value(COLUMNNAME_Allow_Info_Product); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Allow Info Resource. + @param Allow_Info_Resource Allow Info Resource */ + public void setAllow_Info_Resource (boolean Allow_Info_Resource) + { + set_Value (COLUMNNAME_Allow_Info_Resource, Boolean.valueOf(Allow_Info_Resource)); + } + + /** Get Allow Info Resource. + @return Allow Info Resource */ + public boolean isAllow_Info_Resource () + { + Object oo = get_Value(COLUMNNAME_Allow_Info_Resource); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Allow Info Schedule. + @param Allow_Info_Schedule Allow Info Schedule */ + public void setAllow_Info_Schedule (boolean Allow_Info_Schedule) + { + set_Value (COLUMNNAME_Allow_Info_Schedule, Boolean.valueOf(Allow_Info_Schedule)); + } + + /** Get Allow Info Schedule. + @return Allow Info Schedule */ + public boolean isAllow_Info_Schedule () + { + Object oo = get_Value(COLUMNNAME_Allow_Info_Schedule); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Approval Amount. + @param AmtApproval + The approval amount limit for this role + */ + public void setAmtApproval (BigDecimal AmtApproval) + { + set_Value (COLUMNNAME_AmtApproval, AmtApproval); + } + + /** Get Approval Amount. + @return The approval amount limit for this role + */ + public BigDecimal getAmtApproval () + { + BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_AmtApproval); + if (bd == null) + return Env.ZERO; + return bd; + } + + public I_C_Currency getC_Currency() throws Exception + { + Class clazz = MTable.getClass(I_C_Currency.Table_Name); + I_C_Currency result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_C_Currency)constructor.newInstance(new Object[] {getCtx(), new Integer(getC_Currency_ID()), get_TrxName()}); + } catch (Exception e) { + log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); + log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); + throw e; + } + return result; + } + + /** Set Currency. + @param C_Currency_ID + The Currency for this record + */ + public void setC_Currency_ID (int C_Currency_ID) + { + if (C_Currency_ID < 1) + set_Value (COLUMNNAME_C_Currency_ID, null); + else + set_Value (COLUMNNAME_C_Currency_ID, Integer.valueOf(C_Currency_ID)); + } + + /** Get Currency. + @return The Currency for this record + */ + public int getC_Currency_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_Currency_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set Confirm Query Records. + @param ConfirmQueryRecords + Require Confirmation if more records will be returned by the query (If not defined 500) + */ + public void setConfirmQueryRecords (int ConfirmQueryRecords) + { + set_Value (COLUMNNAME_ConfirmQueryRecords, Integer.valueOf(ConfirmQueryRecords)); + } + + /** Get Confirm Query Records. + @return Require Confirmation if more records will be returned by the query (If not defined 500) + */ + public int getConfirmQueryRecords () + { + Integer ii = (Integer)get_Value(COLUMNNAME_ConfirmQueryRecords); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** ConnectionProfile AD_Reference_ID=364 */ + public static final int CONNECTIONPROFILE_AD_Reference_ID=364; + /** LAN = L */ + public static final String CONNECTIONPROFILE_LAN = "L"; + /** Terminal Server = T */ + public static final String CONNECTIONPROFILE_TerminalServer = "T"; + /** VPN = V */ + public static final String CONNECTIONPROFILE_VPN = "V"; + /** WAN = W */ + public static final String CONNECTIONPROFILE_WAN = "W"; + /** Set Connection Profile. + @param ConnectionProfile + How a Java Client connects to the server(s) + */ + public void setConnectionProfile (String ConnectionProfile) + { + + if (ConnectionProfile == null || ConnectionProfile.equals("L") || ConnectionProfile.equals("T") || ConnectionProfile.equals("V") || ConnectionProfile.equals("W")); else throw new IllegalArgumentException ("ConnectionProfile Invalid value - " + ConnectionProfile + " - Reference_ID=364 - L - T - V - W"); + if (ConnectionProfile != null && ConnectionProfile.length() > 1) + { + log.warning("Length > 1 - truncated"); + ConnectionProfile = ConnectionProfile.substring(0, 1); + } + set_Value (COLUMNNAME_ConnectionProfile, ConnectionProfile); + } + + /** Get Connection Profile. + @return How a Java Client connects to the server(s) + */ + public String getConnectionProfile () + { + return (String)get_Value(COLUMNNAME_ConnectionProfile); + } + + /** Set Description. + @param Description + Optional short description of the record + */ + public void setDescription (String Description) + { + + if (Description != null && Description.length() > 255) + { + log.warning("Length > 255 - truncated"); + Description = Description.substring(0, 255); + } + set_Value (COLUMNNAME_Description, Description); + } + + /** Get Description. + @return Optional short description of the record + */ + public String getDescription () + { + return (String)get_Value(COLUMNNAME_Description); + } + + /** Set Access all Orgs. + @param IsAccessAllOrgs + Access all Organizations (no org access control) of the client + */ + public void setIsAccessAllOrgs (boolean IsAccessAllOrgs) + { + set_Value (COLUMNNAME_IsAccessAllOrgs, Boolean.valueOf(IsAccessAllOrgs)); + } + + /** Get Access all Orgs. + @return Access all Organizations (no org access control) of the client + */ + public boolean isAccessAllOrgs () + { + Object oo = get_Value(COLUMNNAME_IsAccessAllOrgs); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Approve own Documents. + @param IsCanApproveOwnDoc + Users with this role can approve their own documents + */ + public void setIsCanApproveOwnDoc (boolean IsCanApproveOwnDoc) + { + set_Value (COLUMNNAME_IsCanApproveOwnDoc, Boolean.valueOf(IsCanApproveOwnDoc)); + } + + /** Get Approve own Documents. + @return Users with this role can approve their own documents + */ + public boolean isCanApproveOwnDoc () + { + Object oo = get_Value(COLUMNNAME_IsCanApproveOwnDoc); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Can Export. + @param IsCanExport + Users with this role can export data + */ + public void setIsCanExport (boolean IsCanExport) + { + set_Value (COLUMNNAME_IsCanExport, Boolean.valueOf(IsCanExport)); + } + + /** Get Can Export. + @return Users with this role can export data + */ + public boolean isCanExport () + { + Object oo = get_Value(COLUMNNAME_IsCanExport); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Can Report. + @param IsCanReport + Users with this role can create reports + */ + public void setIsCanReport (boolean IsCanReport) + { + set_Value (COLUMNNAME_IsCanReport, Boolean.valueOf(IsCanReport)); + } + + /** Get Can Report. + @return Users with this role can create reports + */ + public boolean isCanReport () + { + Object oo = get_Value(COLUMNNAME_IsCanReport); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Maintain Change Log. + @param IsChangeLog + Maintain a log of changes + */ + public void setIsChangeLog (boolean IsChangeLog) + { + set_Value (COLUMNNAME_IsChangeLog, Boolean.valueOf(IsChangeLog)); + } + + /** Get Maintain Change Log. + @return Maintain a log of changes + */ + public boolean isChangeLog () + { + Object oo = get_Value(COLUMNNAME_IsChangeLog); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set IsDiscountAllowedOnTotal. + @param IsDiscountAllowedOnTotal IsDiscountAllowedOnTotal */ + public void setIsDiscountAllowedOnTotal (boolean IsDiscountAllowedOnTotal) + { + set_Value (COLUMNNAME_IsDiscountAllowedOnTotal, Boolean.valueOf(IsDiscountAllowedOnTotal)); + } + + /** Get IsDiscountAllowedOnTotal. + @return IsDiscountAllowedOnTotal */ + public boolean isDiscountAllowedOnTotal () + { + Object oo = get_Value(COLUMNNAME_IsDiscountAllowedOnTotal); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set IsDiscountUptoLimitPrice. + @param IsDiscountUptoLimitPrice IsDiscountUptoLimitPrice */ + public void setIsDiscountUptoLimitPrice (boolean IsDiscountUptoLimitPrice) + { + set_Value (COLUMNNAME_IsDiscountUptoLimitPrice, Boolean.valueOf(IsDiscountUptoLimitPrice)); + } + + /** Get IsDiscountUptoLimitPrice. + @return IsDiscountUptoLimitPrice */ + public boolean isDiscountUptoLimitPrice () + { + Object oo = get_Value(COLUMNNAME_IsDiscountUptoLimitPrice); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Manual. + @param IsManual + This is a manual process + */ + public void setIsManual (boolean IsManual) + { + set_Value (COLUMNNAME_IsManual, Boolean.valueOf(IsManual)); + } + + /** Get Manual. + @return This is a manual process + */ + public boolean isManual () + { + Object oo = get_Value(COLUMNNAME_IsManual); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Personal Access. + @param IsPersonalAccess + Allow access to all personal records + */ + public void setIsPersonalAccess (boolean IsPersonalAccess) + { + set_Value (COLUMNNAME_IsPersonalAccess, Boolean.valueOf(IsPersonalAccess)); + } + + /** Get Personal Access. + @return Allow access to all personal records + */ + public boolean isPersonalAccess () + { + Object oo = get_Value(COLUMNNAME_IsPersonalAccess); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Personal Lock. + @param IsPersonalLock + Allow users with role to lock access to personal records + */ + public void setIsPersonalLock (boolean IsPersonalLock) + { + set_Value (COLUMNNAME_IsPersonalLock, Boolean.valueOf(IsPersonalLock)); + } + + /** Get Personal Lock. + @return Allow users with role to lock access to personal records + */ + public boolean isPersonalLock () + { + Object oo = get_Value(COLUMNNAME_IsPersonalLock); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Show Accounting. + @param IsShowAcct + Users with this role can see accounting information + */ + public void setIsShowAcct (boolean IsShowAcct) + { + set_Value (COLUMNNAME_IsShowAcct, Boolean.valueOf(IsShowAcct)); + } + + /** Get Show Accounting. + @return Users with this role can see accounting information + */ + public boolean isShowAcct () + { + Object oo = get_Value(COLUMNNAME_IsShowAcct); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Use User Org Access. + @param IsUseUserOrgAccess + Use Org Access defined by user instead of Role Org Access + */ + public void setIsUseUserOrgAccess (boolean IsUseUserOrgAccess) + { + set_Value (COLUMNNAME_IsUseUserOrgAccess, Boolean.valueOf(IsUseUserOrgAccess)); + } + + /** Get Use User Org Access. + @return Use Org Access defined by user instead of Role Org Access + */ + public boolean isUseUserOrgAccess () + { + Object oo = get_Value(COLUMNNAME_IsUseUserOrgAccess); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Max Query Records. + @param MaxQueryRecords + If defined, you cannot query more records as defined - the query criteria needs to be changed to query less records + */ + public void setMaxQueryRecords (int MaxQueryRecords) + { + set_Value (COLUMNNAME_MaxQueryRecords, Integer.valueOf(MaxQueryRecords)); + } + + /** Get Max Query Records. + @return If defined, you cannot query more records as defined - the query criteria needs to be changed to query less records + */ + public int getMaxQueryRecords () + { + Integer ii = (Integer)get_Value(COLUMNNAME_MaxQueryRecords); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set Name. + @param Name + Alphanumeric identifier of the entity + */ + public void setName (String Name) + { + if (Name == null) + throw new IllegalArgumentException ("Name is mandatory."); + + if (Name.length() > 60) + { + log.warning("Length > 60 - truncated"); + Name = Name.substring(0, 60); + } + set_Value (COLUMNNAME_Name, Name); + } + + /** Get Name. + @return Alphanumeric identifier of the entity + */ + public String getName () + { + return (String)get_Value(COLUMNNAME_Name); + } + + /** Get Record ID/ColumnName + @return ID/ColumnName pair + */ + public KeyNamePair getKeyNamePair() + { + return new KeyNamePair(get_ID(), getName()); + } + + /** Set Overwrite Price Limit. + @param OverwritePriceLimit + Overwrite Price Limit if the Price List enforces the Price Limit + */ + public void setOverwritePriceLimit (boolean OverwritePriceLimit) + { + set_Value (COLUMNNAME_OverwritePriceLimit, Boolean.valueOf(OverwritePriceLimit)); + } + + /** Get Overwrite Price Limit. + @return Overwrite Price Limit if the Price List enforces the Price Limit + */ + public boolean isOverwritePriceLimit () + { + Object oo = get_Value(COLUMNNAME_OverwritePriceLimit); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** PreferenceType AD_Reference_ID=330 */ + public static final int PREFERENCETYPE_AD_Reference_ID=330; + /** Client = C */ + public static final String PREFERENCETYPE_Client = "C"; + /** Organization = O */ + public static final String PREFERENCETYPE_Organization = "O"; + /** User = U */ + public static final String PREFERENCETYPE_User = "U"; + /** None = N */ + public static final String PREFERENCETYPE_None = "N"; + /** Set Preference Level. + @param PreferenceType + Determines what preferences the user can set + */ + public void setPreferenceType (String PreferenceType) + { + if (PreferenceType == null) throw new IllegalArgumentException ("PreferenceType is mandatory"); + if (PreferenceType.equals("C") || PreferenceType.equals("O") || PreferenceType.equals("U") || PreferenceType.equals("N")); else throw new IllegalArgumentException ("PreferenceType Invalid value - " + PreferenceType + " - Reference_ID=330 - C - O - U - N"); + if (PreferenceType.length() > 1) + { + log.warning("Length > 1 - truncated"); + PreferenceType = PreferenceType.substring(0, 1); + } + set_Value (COLUMNNAME_PreferenceType, PreferenceType); + } + + /** Get Preference Level. + @return Determines what preferences the user can set + */ + public String getPreferenceType () + { + return (String)get_Value(COLUMNNAME_PreferenceType); + } + + /** Supervisor_ID AD_Reference_ID=286 */ + public static final int SUPERVISOR_ID_AD_Reference_ID=286; + /** Set Supervisor. + @param Supervisor_ID + Supervisor for this user/organization - used for escalation and approval + */ + public void setSupervisor_ID (int Supervisor_ID) + { + if (Supervisor_ID < 1) + set_Value (COLUMNNAME_Supervisor_ID, null); + else + set_Value (COLUMNNAME_Supervisor_ID, Integer.valueOf(Supervisor_ID)); + } + + /** Get Supervisor. + @return Supervisor for this user/organization - used for escalation and approval + */ + public int getSupervisor_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_Supervisor_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set UserDiscount. + @param UserDiscount UserDiscount */ + public void setUserDiscount (BigDecimal UserDiscount) + { + set_Value (COLUMNNAME_UserDiscount, UserDiscount); + } + + /** Get UserDiscount. + @return UserDiscount */ + public BigDecimal getUserDiscount () + { + BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_UserDiscount); + if (bd == null) + return Env.ZERO; + return bd; + } + + /** UserLevel AD_Reference_ID=226 */ + public static final int USERLEVEL_AD_Reference_ID=226; + /** System = S */ + public static final String USERLEVEL_System = "S "; + /** Client = C */ + public static final String USERLEVEL_Client = " C "; + /** Organization = O */ + public static final String USERLEVEL_Organization = " O"; + /** Client+Organization = CO */ + public static final String USERLEVEL_ClientPlusOrganization = " CO"; + /** Set User Level. + @param UserLevel + System Client Organization + */ + public void setUserLevel (String UserLevel) + { + if (UserLevel == null) throw new IllegalArgumentException ("UserLevel is mandatory"); + if (UserLevel.equals("S ") || UserLevel.equals(" C ") || UserLevel.equals(" O") || UserLevel.equals(" CO")); else throw new IllegalArgumentException ("UserLevel Invalid value - " + UserLevel + " - Reference_ID=226 - S - C - O - CO"); + if (UserLevel.length() > 3) + { + log.warning("Length > 3 - truncated"); + UserLevel = UserLevel.substring(0, 3); + } + set_Value (COLUMNNAME_UserLevel, UserLevel); + } + + /** Get User Level. + @return System Client Organization + */ + public String getUserLevel () + { + return (String)get_Value(COLUMNNAME_UserLevel); + } +} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/compiere/model/X_C_CashLine.java b/posterita/posterita/src/main/org/compiere/model/X_C_CashLine.java new file mode 100644 index 0000000000..b808c8ac18 --- /dev/null +++ b/posterita/posterita/src/main/org/compiere/model/X_C_CashLine.java @@ -0,0 +1,537 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2007 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program 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 General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +/** Generated Model - DO NOT CHANGE */ +package org.compiere.model; + +import java.lang.reflect.Constructor; +import java.math.BigDecimal; +import java.sql.ResultSet; +import java.util.Properties; +import java.util.logging.Level; +import org.compiere.util.Env; +import org.compiere.util.KeyNamePair; + +/** Generated Model for C_CashLine + * @author Adempiere (generated) + * @version Release 3.4.0s - $Id$ */ +public class X_C_CashLine extends PO implements I_C_CashLine, I_Persistent +{ + + /** + * + */ + private static final long serialVersionUID = 1L; + + /** Standard Constructor */ + public X_C_CashLine (Properties ctx, int C_CashLine_ID, String trxName) + { + super (ctx, C_CashLine_ID, trxName); + /** if (C_CashLine_ID == 0) + { + setAmount (Env.ZERO); + setCashType (null); +// E + setC_Cash_ID (0); + setC_CashLine_ID (0); + setLine (0); +// @SQL=SELECT COALESCE(MAX(Line),0)+10 AS DefaultValue FROM C_CashLine WHERE C_Cash_ID=@C_Cash_ID@ + setProcessed (false); + } */ + } + + /** Load Constructor */ + public X_C_CashLine (Properties ctx, ResultSet rs, String trxName) + { + super (ctx, rs, trxName); + } + + /** AccessLevel + * @return 3 - Client - Org + */ + protected int get_AccessLevel() + { + return accessLevel.intValue(); + } + + /** Load Meta Data */ + protected POInfo initPO (Properties ctx) + { + POInfo poi = POInfo.getPOInfo (ctx, Table_ID, get_TrxName()); + return poi; + } + + public String toString() + { + StringBuffer sb = new StringBuffer ("X_C_CashLine[") + .append(get_ID()).append("]"); + return sb.toString(); + } + + /** Set Amount. + @param Amount + Amount in a defined currency + */ + public void setAmount (BigDecimal Amount) + { + if (Amount == null) + throw new IllegalArgumentException ("Amount is mandatory."); + set_Value (COLUMNNAME_Amount, Amount); + } + + /** Get Amount. + @return Amount in a defined currency + */ + public BigDecimal getAmount () + { + BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_Amount); + if (bd == null) + return Env.ZERO; + return bd; + } + + /** CashType AD_Reference_ID=217 */ + public static final int CASHTYPE_AD_Reference_ID=217; + /** Bank Account Transfer = T */ + public static final String CASHTYPE_BankAccountTransfer = "T"; + /** Invoice = I */ + public static final String CASHTYPE_Invoice = "I"; + /** General Expense = E */ + public static final String CASHTYPE_GeneralExpense = "E"; + /** General Receipts = R */ + public static final String CASHTYPE_GeneralReceipts = "R"; + /** Charge = C */ + public static final String CASHTYPE_Charge = "C"; + /** Difference = D */ + public static final String CASHTYPE_Difference = "D"; + /** Set Cash Type. + @param CashType + Source of Cash + */ + public void setCashType (String CashType) + { + if (CashType == null) throw new IllegalArgumentException ("CashType is mandatory"); + if (CashType.equals("T") || CashType.equals("I") || CashType.equals("E") || CashType.equals("R") || CashType.equals("C") || CashType.equals("D")); else throw new IllegalArgumentException ("CashType Invalid value - " + CashType + " - Reference_ID=217 - T - I - E - R - C - D"); + if (CashType.length() > 1) + { + log.warning("Length > 1 - truncated"); + CashType = CashType.substring(0, 1); + } + set_ValueNoCheck (COLUMNNAME_CashType, CashType); + } + + /** Get Cash Type. + @return Source of Cash + */ + public String getCashType () + { + return (String)get_Value(COLUMNNAME_CashType); + } + + public I_C_BankAccount getC_BankAccount() throws Exception + { + Class clazz = MTable.getClass(I_C_BankAccount.Table_Name); + I_C_BankAccount result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_C_BankAccount)constructor.newInstance(new Object[] {getCtx(), new Integer(getC_BankAccount_ID()), get_TrxName()}); + } catch (Exception e) { + log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); + log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); + throw e; + } + return result; + } + + /** Set Bank Account. + @param C_BankAccount_ID + Account at the Bank + */ + public void setC_BankAccount_ID (int C_BankAccount_ID) + { + if (C_BankAccount_ID < 1) + set_Value (COLUMNNAME_C_BankAccount_ID, null); + else + set_Value (COLUMNNAME_C_BankAccount_ID, Integer.valueOf(C_BankAccount_ID)); + } + + /** Get Bank Account. + @return Account at the Bank + */ + public int getC_BankAccount_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_BankAccount_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + public I_C_Cash getC_Cash() throws Exception + { + Class clazz = MTable.getClass(I_C_Cash.Table_Name); + I_C_Cash result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_C_Cash)constructor.newInstance(new Object[] {getCtx(), new Integer(getC_Cash_ID()), get_TrxName()}); + } catch (Exception e) { + log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); + log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); + throw e; + } + return result; + } + + /** Set Cash Journal. + @param C_Cash_ID + Cash Journal + */ + public void setC_Cash_ID (int C_Cash_ID) + { + if (C_Cash_ID < 1) + throw new IllegalArgumentException ("C_Cash_ID is mandatory."); + set_ValueNoCheck (COLUMNNAME_C_Cash_ID, Integer.valueOf(C_Cash_ID)); + } + + /** Get Cash Journal. + @return Cash Journal + */ + public int getC_Cash_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_Cash_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Get Record ID/ColumnName + @return ID/ColumnName pair + */ + public KeyNamePair getKeyNamePair() + { + return new KeyNamePair(get_ID(), String.valueOf(getC_Cash_ID())); + } + + /** Set Cash Journal Line. + @param C_CashLine_ID + Cash Journal Line + */ + public void setC_CashLine_ID (int C_CashLine_ID) + { + if (C_CashLine_ID < 1) + throw new IllegalArgumentException ("C_CashLine_ID is mandatory."); + set_ValueNoCheck (COLUMNNAME_C_CashLine_ID, Integer.valueOf(C_CashLine_ID)); + } + + /** Get Cash Journal Line. + @return Cash Journal Line + */ + public int getC_CashLine_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_CashLine_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + public I_C_Charge getC_Charge() throws Exception + { + Class clazz = MTable.getClass(I_C_Charge.Table_Name); + I_C_Charge result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_C_Charge)constructor.newInstance(new Object[] {getCtx(), new Integer(getC_Charge_ID()), get_TrxName()}); + } catch (Exception e) { + log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); + log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); + throw e; + } + return result; + } + + /** Set Charge. + @param C_Charge_ID + Additional document charges + */ + public void setC_Charge_ID (int C_Charge_ID) + { + if (C_Charge_ID < 1) + set_Value (COLUMNNAME_C_Charge_ID, null); + else + set_Value (COLUMNNAME_C_Charge_ID, Integer.valueOf(C_Charge_ID)); + } + + /** Get Charge. + @return Additional document charges + */ + public int getC_Charge_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_Charge_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + public I_C_Currency getC_Currency() throws Exception + { + Class clazz = MTable.getClass(I_C_Currency.Table_Name); + I_C_Currency result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_C_Currency)constructor.newInstance(new Object[] {getCtx(), new Integer(getC_Currency_ID()), get_TrxName()}); + } catch (Exception e) { + log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); + log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); + throw e; + } + return result; + } + + /** Set Currency. + @param C_Currency_ID + The Currency for this record + */ + public void setC_Currency_ID (int C_Currency_ID) + { + if (C_Currency_ID < 1) + set_ValueNoCheck (COLUMNNAME_C_Currency_ID, null); + else + set_ValueNoCheck (COLUMNNAME_C_Currency_ID, Integer.valueOf(C_Currency_ID)); + } + + /** Get Currency. + @return The Currency for this record + */ + public int getC_Currency_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_Currency_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + public I_C_Invoice getC_Invoice() throws Exception + { + Class clazz = MTable.getClass(I_C_Invoice.Table_Name); + I_C_Invoice result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_C_Invoice)constructor.newInstance(new Object[] {getCtx(), new Integer(getC_Invoice_ID()), get_TrxName()}); + } catch (Exception e) { + log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); + log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); + throw e; + } + return result; + } + + /** Set Invoice. + @param C_Invoice_ID + Invoice Identifier + */ + public void setC_Invoice_ID (int C_Invoice_ID) + { + if (C_Invoice_ID < 1) + set_ValueNoCheck (COLUMNNAME_C_Invoice_ID, null); + else + set_ValueNoCheck (COLUMNNAME_C_Invoice_ID, Integer.valueOf(C_Invoice_ID)); + } + + /** Get Invoice. + @return Invoice Identifier + */ + public int getC_Invoice_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_Invoice_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + public I_C_Payment getC_Payment() throws Exception + { + Class clazz = MTable.getClass(I_C_Payment.Table_Name); + I_C_Payment result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_C_Payment)constructor.newInstance(new Object[] {getCtx(), new Integer(getC_Payment_ID()), get_TrxName()}); + } catch (Exception e) { + log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); + log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); + throw e; + } + return result; + } + + /** Set Payment. + @param C_Payment_ID + Payment identifier + */ + public void setC_Payment_ID (int C_Payment_ID) + { + if (C_Payment_ID < 1) + set_ValueNoCheck (COLUMNNAME_C_Payment_ID, null); + else + set_ValueNoCheck (COLUMNNAME_C_Payment_ID, Integer.valueOf(C_Payment_ID)); + } + + /** Get Payment. + @return Payment identifier + */ + public int getC_Payment_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_Payment_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set Description. + @param Description + Optional short description of the record + */ + public void setDescription (String Description) + { + + if (Description != null && Description.length() > 255) + { + log.warning("Length > 255 - truncated"); + Description = Description.substring(0, 255); + } + set_Value (COLUMNNAME_Description, Description); + } + + /** Get Description. + @return Optional short description of the record + */ + public String getDescription () + { + return (String)get_Value(COLUMNNAME_Description); + } + + /** Set Discount Amount. + @param DiscountAmt + Calculated amount of discount + */ + public void setDiscountAmt (BigDecimal DiscountAmt) + { + set_Value (COLUMNNAME_DiscountAmt, DiscountAmt); + } + + /** Get Discount Amount. + @return Calculated amount of discount + */ + public BigDecimal getDiscountAmt () + { + BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_DiscountAmt); + if (bd == null) + return Env.ZERO; + return bd; + } + + /** Set Generated. + @param IsGenerated + This Line is generated + */ + public void setIsGenerated (boolean IsGenerated) + { + set_ValueNoCheck (COLUMNNAME_IsGenerated, Boolean.valueOf(IsGenerated)); + } + + /** Get Generated. + @return This Line is generated + */ + public boolean isGenerated () + { + Object oo = get_Value(COLUMNNAME_IsGenerated); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Line No. + @param Line + Unique line for this document + */ + public void setLine (int Line) + { + set_Value (COLUMNNAME_Line, Integer.valueOf(Line)); + } + + /** Get Line No. + @return Unique line for this document + */ + public int getLine () + { + Integer ii = (Integer)get_Value(COLUMNNAME_Line); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set Processed. + @param Processed + The document has been processed + */ + public void setProcessed (boolean Processed) + { + set_Value (COLUMNNAME_Processed, Boolean.valueOf(Processed)); + } + + /** Get Processed. + @return The document has been processed + */ + public boolean isProcessed () + { + Object oo = get_Value(COLUMNNAME_Processed); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Write-off Amount. + @param WriteOffAmt + Amount to write-off + */ + public void setWriteOffAmt (BigDecimal WriteOffAmt) + { + set_Value (COLUMNNAME_WriteOffAmt, WriteOffAmt); + } + + /** Get Write-off Amount. + @return Amount to write-off + */ + public BigDecimal getWriteOffAmt () + { + BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_WriteOffAmt); + if (bd == null) + return Env.ZERO; + return bd; + } +} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/compiere/model/X_C_Currency.java b/posterita/posterita/src/main/org/compiere/model/X_C_Currency.java new file mode 100644 index 0000000000..e01758e0b1 --- /dev/null +++ b/posterita/posterita/src/main/org/compiere/model/X_C_Currency.java @@ -0,0 +1,337 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2007 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program 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 General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +/** Generated Model - DO NOT CHANGE */ +package org.compiere.model; + +import java.math.BigDecimal; +import java.sql.ResultSet; +import java.sql.Timestamp; +import java.util.Properties; +import org.compiere.util.Env; +import org.compiere.util.KeyNamePair; + +/** Generated Model for C_Currency + * @author Adempiere (generated) + * @version Release 3.4.0s - $Id$ */ +public class X_C_Currency extends PO implements I_C_Currency, I_Persistent +{ + + /** + * + */ + private static final long serialVersionUID = 1L; + + /** Standard Constructor */ + public X_C_Currency (Properties ctx, int C_Currency_ID, String trxName) + { + super (ctx, C_Currency_ID, trxName); + /** if (C_Currency_ID == 0) + { + setC_Currency_ID (0); + setCostingPrecision (0); +// 4 + setDescription (null); + setIsEMUMember (false); +// N + setIsEuro (false); +// N + setISO_Code (null); + setRoundOffFactor (Env.ZERO); +// 1 + setStdPrecision (0); +// 2 + } */ + } + + /** Load Constructor */ + public X_C_Currency (Properties ctx, ResultSet rs, String trxName) + { + super (ctx, rs, trxName); + } + + /** AccessLevel + * @return 6 - System - Client + */ + protected int get_AccessLevel() + { + return accessLevel.intValue(); + } + + /** Load Meta Data */ + protected POInfo initPO (Properties ctx) + { + POInfo poi = POInfo.getPOInfo (ctx, Table_ID, get_TrxName()); + return poi; + } + + public String toString() + { + StringBuffer sb = new StringBuffer ("X_C_Currency[") + .append(get_ID()).append("]"); + return sb.toString(); + } + + /** Set Currency. + @param C_Currency_ID + The Currency for this record + */ + public void setC_Currency_ID (int C_Currency_ID) + { + if (C_Currency_ID < 1) + throw new IllegalArgumentException ("C_Currency_ID is mandatory."); + set_ValueNoCheck (COLUMNNAME_C_Currency_ID, Integer.valueOf(C_Currency_ID)); + } + + /** Get Currency. + @return The Currency for this record + */ + public int getC_Currency_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_Currency_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set Costing Precision. + @param CostingPrecision + Rounding used costing calculations + */ + public void setCostingPrecision (int CostingPrecision) + { + set_Value (COLUMNNAME_CostingPrecision, Integer.valueOf(CostingPrecision)); + } + + /** Get Costing Precision. + @return Rounding used costing calculations + */ + public int getCostingPrecision () + { + Integer ii = (Integer)get_Value(COLUMNNAME_CostingPrecision); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set Symbol. + @param CurSymbol + Symbol of the currency (opt used for printing only) + */ + public void setCurSymbol (String CurSymbol) + { + + if (CurSymbol != null && CurSymbol.length() > 10) + { + log.warning("Length > 10 - truncated"); + CurSymbol = CurSymbol.substring(0, 10); + } + set_Value (COLUMNNAME_CurSymbol, CurSymbol); + } + + /** Get Symbol. + @return Symbol of the currency (opt used for printing only) + */ + public String getCurSymbol () + { + return (String)get_Value(COLUMNNAME_CurSymbol); + } + + /** Set Description. + @param Description + Optional short description of the record + */ + public void setDescription (String Description) + { + if (Description == null) + throw new IllegalArgumentException ("Description is mandatory."); + + if (Description.length() > 255) + { + log.warning("Length > 255 - truncated"); + Description = Description.substring(0, 255); + } + set_Value (COLUMNNAME_Description, Description); + } + + /** Get Description. + @return Optional short description of the record + */ + public String getDescription () + { + return (String)get_Value(COLUMNNAME_Description); + } + + /** Set EMU Entry Date. + @param EMUEntryDate + Date when the currency joined / will join the EMU + */ + public void setEMUEntryDate (Timestamp EMUEntryDate) + { + set_Value (COLUMNNAME_EMUEntryDate, EMUEntryDate); + } + + /** Get EMU Entry Date. + @return Date when the currency joined / will join the EMU + */ + public Timestamp getEMUEntryDate () + { + return (Timestamp)get_Value(COLUMNNAME_EMUEntryDate); + } + + /** Set EMU Rate. + @param EMURate + Official rate to the Euro + */ + public void setEMURate (BigDecimal EMURate) + { + set_Value (COLUMNNAME_EMURate, EMURate); + } + + /** Get EMU Rate. + @return Official rate to the Euro + */ + public BigDecimal getEMURate () + { + BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_EMURate); + if (bd == null) + return Env.ZERO; + return bd; + } + + /** Set EMU Member. + @param IsEMUMember + This currency is member if the European Monetary Union + */ + public void setIsEMUMember (boolean IsEMUMember) + { + set_Value (COLUMNNAME_IsEMUMember, Boolean.valueOf(IsEMUMember)); + } + + /** Get EMU Member. + @return This currency is member if the European Monetary Union + */ + public boolean isEMUMember () + { + Object oo = get_Value(COLUMNNAME_IsEMUMember); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set The Euro Currency. + @param IsEuro + This currency is the Euro + */ + public void setIsEuro (boolean IsEuro) + { + set_Value (COLUMNNAME_IsEuro, Boolean.valueOf(IsEuro)); + } + + /** Get The Euro Currency. + @return This currency is the Euro + */ + public boolean isEuro () + { + Object oo = get_Value(COLUMNNAME_IsEuro); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set ISO Currency Code. + @param ISO_Code + Three letter ISO 4217 Code of the Currency + */ + public void setISO_Code (String ISO_Code) + { + if (ISO_Code == null) + throw new IllegalArgumentException ("ISO_Code is mandatory."); + + if (ISO_Code.length() > 3) + { + log.warning("Length > 3 - truncated"); + ISO_Code = ISO_Code.substring(0, 3); + } + set_Value (COLUMNNAME_ISO_Code, ISO_Code); + } + + /** Get ISO Currency Code. + @return Three letter ISO 4217 Code of the Currency + */ + public String getISO_Code () + { + return (String)get_Value(COLUMNNAME_ISO_Code); + } + + /** Get Record ID/ColumnName + @return ID/ColumnName pair + */ + public KeyNamePair getKeyNamePair() + { + return new KeyNamePair(get_ID(), getISO_Code()); + } + + /** Set RoundOffFactor. + @param RoundOffFactor + Used to Round Off Payment Amount + */ + public void setRoundOffFactor (BigDecimal RoundOffFactor) + { + if (RoundOffFactor == null) + throw new IllegalArgumentException ("RoundOffFactor is mandatory."); + set_Value (COLUMNNAME_RoundOffFactor, RoundOffFactor); + } + + /** Get RoundOffFactor. + @return Used to Round Off Payment Amount + */ + public BigDecimal getRoundOffFactor () + { + BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_RoundOffFactor); + if (bd == null) + return Env.ZERO; + return bd; + } + + /** Set Standard Precision. + @param StdPrecision + Rule for rounding calculated amounts + */ + public void setStdPrecision (int StdPrecision) + { + set_Value (COLUMNNAME_StdPrecision, Integer.valueOf(StdPrecision)); + } + + /** Get Standard Precision. + @return Rule for rounding calculated amounts + */ + public int getStdPrecision () + { + Integer ii = (Integer)get_Value(COLUMNNAME_StdPrecision); + if (ii == null) + return 0; + return ii.intValue(); + } +} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/compiere/model/X_C_Invoice.java b/posterita/posterita/src/main/org/compiere/model/X_C_Invoice.java new file mode 100644 index 0000000000..959b7eb534 --- /dev/null +++ b/posterita/posterita/src/main/org/compiere/model/X_C_Invoice.java @@ -0,0 +1,1731 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2007 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program 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 General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +/** Generated Model - DO NOT CHANGE */ +package org.compiere.model; + +import java.lang.reflect.Constructor; +import java.math.BigDecimal; +import java.sql.ResultSet; +import java.sql.Timestamp; +import java.util.Properties; +import java.util.logging.Level; +import org.compiere.util.Env; +import org.compiere.util.KeyNamePair; + +/** Generated Model for C_Invoice + * @author Adempiere (generated) + * @version Release 3.4.0s - $Id$ */ +public class X_C_Invoice extends PO implements I_C_Invoice, I_Persistent +{ + + /** + * + */ + private static final long serialVersionUID = 1L; + + /** Standard Constructor */ + public X_C_Invoice (Properties ctx, int C_Invoice_ID, String trxName) + { + super (ctx, C_Invoice_ID, trxName); + /** if (C_Invoice_ID == 0) + { + setC_BPartner_ID (0); + setC_BPartner_Location_ID (0); + setC_Currency_ID (0); +// @C_Currency_ID@ + setC_DocType_ID (0); +// 0 + setC_DocTypeTarget_ID (0); + setC_Invoice_ID (0); + setC_PaymentTerm_ID (0); + setDateAcct (new Timestamp(System.currentTimeMillis())); +// @#Date@ + setDateInvoiced (new Timestamp(System.currentTimeMillis())); +// @#Date@ + setDocAction (null); +// CO + setDocStatus (null); +// DR + setDocumentNo (null); + setGrandTotal (Env.ZERO); + setIsApproved (false); +// @IsApproved@ + setIsDiscountPrinted (false); + setIsInDispute (false); +// N + setIsPaid (false); + setIsPayScheduleValid (false); + setIsPrinted (false); + setIsSelfService (false); + setIsSOTrx (false); +// @IsSOTrx@ + setIsTaxIncluded (false); + setIsTransferred (false); + setM_PriceList_ID (0); + setPaymentRule (null); +// P + setPosted (false); +// N + setProcessed (false); + setSendEMail (false); + setTotalLines (Env.ZERO); + } */ + } + + /** Load Constructor */ + public X_C_Invoice (Properties ctx, ResultSet rs, String trxName) + { + super (ctx, rs, trxName); + } + + /** AccessLevel + * @return 1 - Org + */ + protected int get_AccessLevel() + { + return accessLevel.intValue(); + } + + /** Load Meta Data */ + protected POInfo initPO (Properties ctx) + { + POInfo poi = POInfo.getPOInfo (ctx, Table_ID, get_TrxName()); + return poi; + } + + public String toString() + { + StringBuffer sb = new StringBuffer ("X_C_Invoice[") + .append(get_ID()).append("]"); + return sb.toString(); + } + + /** AD_OrgTrx_ID AD_Reference_ID=130 */ + public static final int AD_ORGTRX_ID_AD_Reference_ID=130; + /** Set Trx Organization. + @param AD_OrgTrx_ID + Performing or initiating organization + */ + public void setAD_OrgTrx_ID (int AD_OrgTrx_ID) + { + if (AD_OrgTrx_ID < 1) + set_Value (COLUMNNAME_AD_OrgTrx_ID, null); + else + set_Value (COLUMNNAME_AD_OrgTrx_ID, Integer.valueOf(AD_OrgTrx_ID)); + } + + /** Get Trx Organization. + @return Performing or initiating organization + */ + public int getAD_OrgTrx_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_AD_OrgTrx_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + public I_AD_User getAD_User() throws Exception + { + Class clazz = MTable.getClass(I_AD_User.Table_Name); + I_AD_User result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_AD_User)constructor.newInstance(new Object[] {getCtx(), new Integer(getAD_User_ID()), get_TrxName()}); + } catch (Exception e) { + log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); + log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); + throw e; + } + return result; + } + + /** Set User/Contact. + @param AD_User_ID + User within the system - Internal or Business Partner Contact + */ + public void setAD_User_ID (int AD_User_ID) + { + if (AD_User_ID < 0) + set_Value (COLUMNNAME_AD_User_ID, null); + else + set_Value (COLUMNNAME_AD_User_ID, Integer.valueOf(AD_User_ID)); + } + + /** Get User/Contact. + @return User within the system - Internal or Business Partner Contact + */ + public int getAD_User_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_AD_User_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + public I_C_Activity getC_Activity() throws Exception + { + Class clazz = MTable.getClass(I_C_Activity.Table_Name); + I_C_Activity result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_C_Activity)constructor.newInstance(new Object[] {getCtx(), new Integer(getC_Activity_ID()), get_TrxName()}); + } catch (Exception e) { + log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); + log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); + throw e; + } + return result; + } + + /** Set Activity. + @param C_Activity_ID + Business Activity + */ + public void setC_Activity_ID (int C_Activity_ID) + { + if (C_Activity_ID < 1) + set_Value (COLUMNNAME_C_Activity_ID, null); + else + set_Value (COLUMNNAME_C_Activity_ID, Integer.valueOf(C_Activity_ID)); + } + + /** Get Activity. + @return Business Activity + */ + public int getC_Activity_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_Activity_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + public I_C_BPartner getC_BPartner() throws Exception + { + Class clazz = MTable.getClass(I_C_BPartner.Table_Name); + I_C_BPartner result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_C_BPartner)constructor.newInstance(new Object[] {getCtx(), new Integer(getC_BPartner_ID()), get_TrxName()}); + } catch (Exception e) { + log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); + log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); + throw e; + } + return result; + } + + /** Set Business Partner . + @param C_BPartner_ID + Identifies a Business Partner + */ + public void setC_BPartner_ID (int C_BPartner_ID) + { + if (C_BPartner_ID < 1) + throw new IllegalArgumentException ("C_BPartner_ID is mandatory."); + set_Value (COLUMNNAME_C_BPartner_ID, Integer.valueOf(C_BPartner_ID)); + } + + /** Get Business Partner . + @return Identifies a Business Partner + */ + public int getC_BPartner_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_BPartner_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + public I_C_BPartner_Location getC_BPartner_Location() throws Exception + { + Class clazz = MTable.getClass(I_C_BPartner_Location.Table_Name); + I_C_BPartner_Location result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_C_BPartner_Location)constructor.newInstance(new Object[] {getCtx(), new Integer(getC_BPartner_Location_ID()), get_TrxName()}); + } catch (Exception e) { + log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); + log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); + throw e; + } + return result; + } + + /** Set Partner Location. + @param C_BPartner_Location_ID + Identifies the (ship to) address for this Business Partner + */ + public void setC_BPartner_Location_ID (int C_BPartner_Location_ID) + { + if (C_BPartner_Location_ID < 1) + throw new IllegalArgumentException ("C_BPartner_Location_ID is mandatory."); + set_Value (COLUMNNAME_C_BPartner_Location_ID, Integer.valueOf(C_BPartner_Location_ID)); + } + + /** Get Partner Location. + @return Identifies the (ship to) address for this Business Partner + */ + public int getC_BPartner_Location_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_BPartner_Location_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + public I_C_Campaign getC_Campaign() throws Exception + { + Class clazz = MTable.getClass(I_C_Campaign.Table_Name); + I_C_Campaign result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_C_Campaign)constructor.newInstance(new Object[] {getCtx(), new Integer(getC_Campaign_ID()), get_TrxName()}); + } catch (Exception e) { + log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); + log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); + throw e; + } + return result; + } + + /** Set Campaign. + @param C_Campaign_ID + Marketing Campaign + */ + public void setC_Campaign_ID (int C_Campaign_ID) + { + if (C_Campaign_ID < 1) + set_Value (COLUMNNAME_C_Campaign_ID, null); + else + set_Value (COLUMNNAME_C_Campaign_ID, Integer.valueOf(C_Campaign_ID)); + } + + /** Get Campaign. + @return Marketing Campaign + */ + public int getC_Campaign_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_Campaign_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + public I_C_CashLine getC_CashLine() throws Exception + { + Class clazz = MTable.getClass(I_C_CashLine.Table_Name); + I_C_CashLine result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_C_CashLine)constructor.newInstance(new Object[] {getCtx(), new Integer(getC_CashLine_ID()), get_TrxName()}); + } catch (Exception e) { + log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); + log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); + throw e; + } + return result; + } + + /** Set Cash Journal Line. + @param C_CashLine_ID + Cash Journal Line + */ + public void setC_CashLine_ID (int C_CashLine_ID) + { + if (C_CashLine_ID < 1) + set_Value (COLUMNNAME_C_CashLine_ID, null); + else + set_Value (COLUMNNAME_C_CashLine_ID, Integer.valueOf(C_CashLine_ID)); + } + + /** Get Cash Journal Line. + @return Cash Journal Line + */ + public int getC_CashLine_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_CashLine_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** C_Charge_ID AD_Reference_ID=200 */ + public static final int C_CHARGE_ID_AD_Reference_ID=200; + /** Set Charge. + @param C_Charge_ID + Additional document charges + */ + public void setC_Charge_ID (int C_Charge_ID) + { + if (C_Charge_ID < 1) + set_Value (COLUMNNAME_C_Charge_ID, null); + else + set_Value (COLUMNNAME_C_Charge_ID, Integer.valueOf(C_Charge_ID)); + } + + /** Get Charge. + @return Additional document charges + */ + public int getC_Charge_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_Charge_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + public I_C_ConversionType getC_ConversionType() throws Exception + { + Class clazz = MTable.getClass(I_C_ConversionType.Table_Name); + I_C_ConversionType result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_C_ConversionType)constructor.newInstance(new Object[] {getCtx(), new Integer(getC_ConversionType_ID()), get_TrxName()}); + } catch (Exception e) { + log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); + log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); + throw e; + } + return result; + } + + /** Set Currency Type. + @param C_ConversionType_ID + Currency Conversion Rate Type + */ + public void setC_ConversionType_ID (int C_ConversionType_ID) + { + if (C_ConversionType_ID < 1) + set_Value (COLUMNNAME_C_ConversionType_ID, null); + else + set_Value (COLUMNNAME_C_ConversionType_ID, Integer.valueOf(C_ConversionType_ID)); + } + + /** Get Currency Type. + @return Currency Conversion Rate Type + */ + public int getC_ConversionType_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_ConversionType_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + public I_C_Currency getC_Currency() throws Exception + { + Class clazz = MTable.getClass(I_C_Currency.Table_Name); + I_C_Currency result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_C_Currency)constructor.newInstance(new Object[] {getCtx(), new Integer(getC_Currency_ID()), get_TrxName()}); + } catch (Exception e) { + log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); + log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); + throw e; + } + return result; + } + + /** Set Currency. + @param C_Currency_ID + The Currency for this record + */ + public void setC_Currency_ID (int C_Currency_ID) + { + if (C_Currency_ID < 1) + throw new IllegalArgumentException ("C_Currency_ID is mandatory."); + set_Value (COLUMNNAME_C_Currency_ID, Integer.valueOf(C_Currency_ID)); + } + + /** Get Currency. + @return The Currency for this record + */ + public int getC_Currency_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_Currency_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + public I_C_DocType getC_DocType() throws Exception + { + Class clazz = MTable.getClass(I_C_DocType.Table_Name); + I_C_DocType result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_C_DocType)constructor.newInstance(new Object[] {getCtx(), new Integer(getC_DocType_ID()), get_TrxName()}); + } catch (Exception e) { + log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); + log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); + throw e; + } + return result; + } + + /** Set Document Type. + @param C_DocType_ID + Document type or rules + */ + public void setC_DocType_ID (int C_DocType_ID) + { + if (C_DocType_ID < 0) + throw new IllegalArgumentException ("C_DocType_ID is mandatory."); + set_ValueNoCheck (COLUMNNAME_C_DocType_ID, Integer.valueOf(C_DocType_ID)); + } + + /** Get Document Type. + @return Document type or rules + */ + public int getC_DocType_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_DocType_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** C_DocTypeTarget_ID AD_Reference_ID=170 */ + public static final int C_DOCTYPETARGET_ID_AD_Reference_ID=170; + /** Set Target Document Type. + @param C_DocTypeTarget_ID + Target document type for conversing documents + */ + public void setC_DocTypeTarget_ID (int C_DocTypeTarget_ID) + { + if (C_DocTypeTarget_ID < 1) + throw new IllegalArgumentException ("C_DocTypeTarget_ID is mandatory."); + set_Value (COLUMNNAME_C_DocTypeTarget_ID, Integer.valueOf(C_DocTypeTarget_ID)); + } + + /** Get Target Document Type. + @return Target document type for conversing documents + */ + public int getC_DocTypeTarget_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_DocTypeTarget_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + public I_C_DunningLevel getC_DunningLevel() throws Exception + { + Class clazz = MTable.getClass(I_C_DunningLevel.Table_Name); + I_C_DunningLevel result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_C_DunningLevel)constructor.newInstance(new Object[] {getCtx(), new Integer(getC_DunningLevel_ID()), get_TrxName()}); + } catch (Exception e) { + log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); + log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); + throw e; + } + return result; + } + + /** Set Dunning Level. + @param C_DunningLevel_ID Dunning Level */ + public void setC_DunningLevel_ID (int C_DunningLevel_ID) + { + if (C_DunningLevel_ID < 1) + set_Value (COLUMNNAME_C_DunningLevel_ID, null); + else + set_Value (COLUMNNAME_C_DunningLevel_ID, Integer.valueOf(C_DunningLevel_ID)); + } + + /** Get Dunning Level. + @return Dunning Level */ + public int getC_DunningLevel_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_DunningLevel_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set Charge amount. + @param ChargeAmt + Charge Amount + */ + public void setChargeAmt (BigDecimal ChargeAmt) + { + set_Value (COLUMNNAME_ChargeAmt, ChargeAmt); + } + + /** Get Charge amount. + @return Charge Amount + */ + public BigDecimal getChargeAmt () + { + BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_ChargeAmt); + if (bd == null) + return Env.ZERO; + return bd; + } + + /** Set Invoice. + @param C_Invoice_ID + Invoice Identifier + */ + public void setC_Invoice_ID (int C_Invoice_ID) + { + if (C_Invoice_ID < 1) + throw new IllegalArgumentException ("C_Invoice_ID is mandatory."); + set_ValueNoCheck (COLUMNNAME_C_Invoice_ID, Integer.valueOf(C_Invoice_ID)); + } + + /** Get Invoice. + @return Invoice Identifier + */ + public int getC_Invoice_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_Invoice_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set Copy From. + @param CopyFrom + Copy From Record + */ + public void setCopyFrom (String CopyFrom) + { + + if (CopyFrom != null && CopyFrom.length() > 1) + { + log.warning("Length > 1 - truncated"); + CopyFrom = CopyFrom.substring(0, 1); + } + set_Value (COLUMNNAME_CopyFrom, CopyFrom); + } + + /** Get Copy From. + @return Copy From Record + */ + public String getCopyFrom () + { + return (String)get_Value(COLUMNNAME_CopyFrom); + } + + public I_C_Order getC_Order() throws Exception + { + Class clazz = MTable.getClass(I_C_Order.Table_Name); + I_C_Order result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_C_Order)constructor.newInstance(new Object[] {getCtx(), new Integer(getC_Order_ID()), get_TrxName()}); + } catch (Exception e) { + log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); + log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); + throw e; + } + return result; + } + + /** Set Order. + @param C_Order_ID + Order + */ + public void setC_Order_ID (int C_Order_ID) + { + if (C_Order_ID < 1) + set_ValueNoCheck (COLUMNNAME_C_Order_ID, null); + else + set_ValueNoCheck (COLUMNNAME_C_Order_ID, Integer.valueOf(C_Order_ID)); + } + + /** Get Order. + @return Order + */ + public int getC_Order_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_Order_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + public I_C_Payment getC_Payment() throws Exception + { + Class clazz = MTable.getClass(I_C_Payment.Table_Name); + I_C_Payment result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_C_Payment)constructor.newInstance(new Object[] {getCtx(), new Integer(getC_Payment_ID()), get_TrxName()}); + } catch (Exception e) { + log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); + log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); + throw e; + } + return result; + } + + /** Set Payment. + @param C_Payment_ID + Payment identifier + */ + public void setC_Payment_ID (int C_Payment_ID) + { + if (C_Payment_ID < 1) + set_Value (COLUMNNAME_C_Payment_ID, null); + else + set_Value (COLUMNNAME_C_Payment_ID, Integer.valueOf(C_Payment_ID)); + } + + /** Get Payment. + @return Payment identifier + */ + public int getC_Payment_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_Payment_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + public I_C_PaymentTerm getC_PaymentTerm() throws Exception + { + Class clazz = MTable.getClass(I_C_PaymentTerm.Table_Name); + I_C_PaymentTerm result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_C_PaymentTerm)constructor.newInstance(new Object[] {getCtx(), new Integer(getC_PaymentTerm_ID()), get_TrxName()}); + } catch (Exception e) { + log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); + log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); + throw e; + } + return result; + } + + /** Set Payment Term. + @param C_PaymentTerm_ID + The terms of Payment (timing, discount) + */ + public void setC_PaymentTerm_ID (int C_PaymentTerm_ID) + { + if (C_PaymentTerm_ID < 1) + throw new IllegalArgumentException ("C_PaymentTerm_ID is mandatory."); + set_Value (COLUMNNAME_C_PaymentTerm_ID, Integer.valueOf(C_PaymentTerm_ID)); + } + + /** Get Payment Term. + @return The terms of Payment (timing, discount) + */ + public int getC_PaymentTerm_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_PaymentTerm_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + public I_C_Project getC_Project() throws Exception + { + Class clazz = MTable.getClass(I_C_Project.Table_Name); + I_C_Project result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_C_Project)constructor.newInstance(new Object[] {getCtx(), new Integer(getC_Project_ID()), get_TrxName()}); + } catch (Exception e) { + log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); + log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); + throw e; + } + return result; + } + + /** Set Project. + @param C_Project_ID + Financial Project + */ + public void setC_Project_ID (int C_Project_ID) + { + if (C_Project_ID < 1) + set_Value (COLUMNNAME_C_Project_ID, null); + else + set_Value (COLUMNNAME_C_Project_ID, Integer.valueOf(C_Project_ID)); + } + + /** Get Project. + @return Financial Project + */ + public int getC_Project_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_Project_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set Create lines from. + @param CreateFrom + Process which will generate a new document lines based on an existing document + */ + public void setCreateFrom (String CreateFrom) + { + + if (CreateFrom != null && CreateFrom.length() > 1) + { + log.warning("Length > 1 - truncated"); + CreateFrom = CreateFrom.substring(0, 1); + } + set_Value (COLUMNNAME_CreateFrom, CreateFrom); + } + + /** Get Create lines from. + @return Process which will generate a new document lines based on an existing document + */ + public String getCreateFrom () + { + return (String)get_Value(COLUMNNAME_CreateFrom); + } + + /** Set Account Date. + @param DateAcct + Accounting Date + */ + public void setDateAcct (Timestamp DateAcct) + { + if (DateAcct == null) + throw new IllegalArgumentException ("DateAcct is mandatory."); + set_Value (COLUMNNAME_DateAcct, DateAcct); + } + + /** Get Account Date. + @return Accounting Date + */ + public Timestamp getDateAcct () + { + return (Timestamp)get_Value(COLUMNNAME_DateAcct); + } + + /** Set Date Invoiced. + @param DateInvoiced + Date printed on Invoice + */ + public void setDateInvoiced (Timestamp DateInvoiced) + { + if (DateInvoiced == null) + throw new IllegalArgumentException ("DateInvoiced is mandatory."); + set_Value (COLUMNNAME_DateInvoiced, DateInvoiced); + } + + /** Get Date Invoiced. + @return Date printed on Invoice + */ + public Timestamp getDateInvoiced () + { + return (Timestamp)get_Value(COLUMNNAME_DateInvoiced); + } + + /** Set Date Ordered. + @param DateOrdered + Date of Order + */ + public void setDateOrdered (Timestamp DateOrdered) + { + set_ValueNoCheck (COLUMNNAME_DateOrdered, DateOrdered); + } + + /** Get Date Ordered. + @return Date of Order + */ + public Timestamp getDateOrdered () + { + return (Timestamp)get_Value(COLUMNNAME_DateOrdered); + } + + /** Set Date printed. + @param DatePrinted + Date the document was printed. + */ + public void setDatePrinted (Timestamp DatePrinted) + { + set_Value (COLUMNNAME_DatePrinted, DatePrinted); + } + + /** Get Date printed. + @return Date the document was printed. + */ + public Timestamp getDatePrinted () + { + return (Timestamp)get_Value(COLUMNNAME_DatePrinted); + } + + /** Set Description. + @param Description + Optional short description of the record + */ + public void setDescription (String Description) + { + + if (Description != null && Description.length() > 255) + { + log.warning("Length > 255 - truncated"); + Description = Description.substring(0, 255); + } + set_Value (COLUMNNAME_Description, Description); + } + + /** Get Description. + @return Optional short description of the record + */ + public String getDescription () + { + return (String)get_Value(COLUMNNAME_Description); + } + + /** DocAction AD_Reference_ID=135 */ + public static final int DOCACTION_AD_Reference_ID=135; + /** Complete = CO */ + public static final String DOCACTION_Complete = "CO"; + /** Approve = AP */ + public static final String DOCACTION_Approve = "AP"; + /** Reject = RJ */ + public static final String DOCACTION_Reject = "RJ"; + /** Post = PO */ + public static final String DOCACTION_Post = "PO"; + /** Void = VO */ + public static final String DOCACTION_Void = "VO"; + /** Close = CL */ + public static final String DOCACTION_Close = "CL"; + /** Reverse - Correct = RC */ + public static final String DOCACTION_Reverse_Correct = "RC"; + /** Reverse - Accrual = RA */ + public static final String DOCACTION_Reverse_Accrual = "RA"; + /** Invalidate = IN */ + public static final String DOCACTION_Invalidate = "IN"; + /** Re-activate = RE */ + public static final String DOCACTION_Re_Activate = "RE"; + /** = -- */ + public static final String DOCACTION_None = "--"; + /** Prepare = PR */ + public static final String DOCACTION_Prepare = "PR"; + /** Unlock = XL */ + public static final String DOCACTION_Unlock = "XL"; + /** Wait Complete = WC */ + public static final String DOCACTION_WaitComplete = "WC"; + /** Set Document Action. + @param DocAction + The targeted status of the document + */ + public void setDocAction (String DocAction) + { + if (DocAction == null) throw new IllegalArgumentException ("DocAction is mandatory"); + if (DocAction.equals("CO") || DocAction.equals("AP") || DocAction.equals("RJ") || DocAction.equals("PO") || DocAction.equals("VO") || DocAction.equals("CL") || DocAction.equals("RC") || DocAction.equals("RA") || DocAction.equals("IN") || DocAction.equals("RE") || DocAction.equals("--") || DocAction.equals("PR") || DocAction.equals("XL") || DocAction.equals("WC")); else throw new IllegalArgumentException ("DocAction Invalid value - " + DocAction + " - Reference_ID=135 - CO - AP - RJ - PO - VO - CL - RC - RA - IN - RE - -- - PR - XL - WC"); + if (DocAction.length() > 2) + { + log.warning("Length > 2 - truncated"); + DocAction = DocAction.substring(0, 2); + } + set_Value (COLUMNNAME_DocAction, DocAction); + } + + /** Get Document Action. + @return The targeted status of the document + */ + public String getDocAction () + { + return (String)get_Value(COLUMNNAME_DocAction); + } + + /** DocStatus AD_Reference_ID=131 */ + public static final int DOCSTATUS_AD_Reference_ID=131; + /** Drafted = DR */ + public static final String DOCSTATUS_Drafted = "DR"; + /** Completed = CO */ + public static final String DOCSTATUS_Completed = "CO"; + /** Approved = AP */ + public static final String DOCSTATUS_Approved = "AP"; + /** Not Approved = NA */ + public static final String DOCSTATUS_NotApproved = "NA"; + /** Voided = VO */ + public static final String DOCSTATUS_Voided = "VO"; + /** Invalid = IN */ + public static final String DOCSTATUS_Invalid = "IN"; + /** Reversed = RE */ + public static final String DOCSTATUS_Reversed = "RE"; + /** Closed = CL */ + public static final String DOCSTATUS_Closed = "CL"; + /** Unknown = ?? */ + public static final String DOCSTATUS_Unknown = "??"; + /** In Progress = IP */ + public static final String DOCSTATUS_InProgress = "IP"; + /** Waiting Payment = WP */ + public static final String DOCSTATUS_WaitingPayment = "WP"; + /** Waiting Confirmation = WC */ + public static final String DOCSTATUS_WaitingConfirmation = "WC"; + /** Set Document Status. + @param DocStatus + The current status of the document + */ + public void setDocStatus (String DocStatus) + { + if (DocStatus == null) throw new IllegalArgumentException ("DocStatus is mandatory"); + if (DocStatus.equals("DR") || DocStatus.equals("CO") || DocStatus.equals("AP") || DocStatus.equals("NA") || DocStatus.equals("VO") || DocStatus.equals("IN") || DocStatus.equals("RE") || DocStatus.equals("CL") || DocStatus.equals("??") || DocStatus.equals("IP") || DocStatus.equals("WP") || DocStatus.equals("WC")); else throw new IllegalArgumentException ("DocStatus Invalid value - " + DocStatus + " - Reference_ID=131 - DR - CO - AP - NA - VO - IN - RE - CL - ?? - IP - WP - WC"); + if (DocStatus.length() > 2) + { + log.warning("Length > 2 - truncated"); + DocStatus = DocStatus.substring(0, 2); + } + set_Value (COLUMNNAME_DocStatus, DocStatus); + } + + /** Get Document Status. + @return The current status of the document + */ + public String getDocStatus () + { + return (String)get_Value(COLUMNNAME_DocStatus); + } + + /** Set Document No. + @param DocumentNo + Document sequence number of the document + */ + public void setDocumentNo (String DocumentNo) + { + if (DocumentNo == null) + throw new IllegalArgumentException ("DocumentNo is mandatory."); + + if (DocumentNo.length() > 30) + { + log.warning("Length > 30 - truncated"); + DocumentNo = DocumentNo.substring(0, 30); + } + set_ValueNoCheck (COLUMNNAME_DocumentNo, DocumentNo); + } + + /** Get Document No. + @return Document sequence number of the document + */ + public String getDocumentNo () + { + return (String)get_Value(COLUMNNAME_DocumentNo); + } + + /** Get Record ID/ColumnName + @return ID/ColumnName pair + */ + public KeyNamePair getKeyNamePair() + { + return new KeyNamePair(get_ID(), getDocumentNo()); + } + + /** Set Dunning Grace. + @param DunningGrace Dunning Grace */ + public void setDunningGrace (Timestamp DunningGrace) + { + set_Value (COLUMNNAME_DunningGrace, DunningGrace); + } + + /** Get Dunning Grace. + @return Dunning Grace */ + public Timestamp getDunningGrace () + { + return (Timestamp)get_Value(COLUMNNAME_DunningGrace); + } + + /** Set Generate To. + @param GenerateTo + Generate To + */ + public void setGenerateTo (String GenerateTo) + { + + if (GenerateTo != null && GenerateTo.length() > 1) + { + log.warning("Length > 1 - truncated"); + GenerateTo = GenerateTo.substring(0, 1); + } + set_Value (COLUMNNAME_GenerateTo, GenerateTo); + } + + /** Get Generate To. + @return Generate To + */ + public String getGenerateTo () + { + return (String)get_Value(COLUMNNAME_GenerateTo); + } + + /** Set Grand Total. + @param GrandTotal + Total amount of document + */ + public void setGrandTotal (BigDecimal GrandTotal) + { + if (GrandTotal == null) + throw new IllegalArgumentException ("GrandTotal is mandatory."); + set_ValueNoCheck (COLUMNNAME_GrandTotal, GrandTotal); + } + + /** Get Grand Total. + @return Total amount of document + */ + public BigDecimal getGrandTotal () + { + BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_GrandTotal); + if (bd == null) + return Env.ZERO; + return bd; + } + + /** InvoiceCollectionType AD_Reference_ID=394 */ + public static final int INVOICECOLLECTIONTYPE_AD_Reference_ID=394; + /** Dunning = D */ + public static final String INVOICECOLLECTIONTYPE_Dunning = "D"; + /** Collection Agency = C */ + public static final String INVOICECOLLECTIONTYPE_CollectionAgency = "C"; + /** Legal Procedure = L */ + public static final String INVOICECOLLECTIONTYPE_LegalProcedure = "L"; + /** Uncollectable = U */ + public static final String INVOICECOLLECTIONTYPE_Uncollectable = "U"; + /** Set Collection Status. + @param InvoiceCollectionType + Invoice Collection Status + */ + public void setInvoiceCollectionType (String InvoiceCollectionType) + { + + if (InvoiceCollectionType == null || InvoiceCollectionType.equals("D") || InvoiceCollectionType.equals("C") || InvoiceCollectionType.equals("L") || InvoiceCollectionType.equals("U")); else throw new IllegalArgumentException ("InvoiceCollectionType Invalid value - " + InvoiceCollectionType + " - Reference_ID=394 - D - C - L - U"); + if (InvoiceCollectionType != null && InvoiceCollectionType.length() > 1) + { + log.warning("Length > 1 - truncated"); + InvoiceCollectionType = InvoiceCollectionType.substring(0, 1); + } + set_Value (COLUMNNAME_InvoiceCollectionType, InvoiceCollectionType); + } + + /** Get Collection Status. + @return Invoice Collection Status + */ + public String getInvoiceCollectionType () + { + return (String)get_Value(COLUMNNAME_InvoiceCollectionType); + } + + /** Set Approved. + @param IsApproved + Indicates if this document requires approval + */ + public void setIsApproved (boolean IsApproved) + { + set_ValueNoCheck (COLUMNNAME_IsApproved, Boolean.valueOf(IsApproved)); + } + + /** Get Approved. + @return Indicates if this document requires approval + */ + public boolean isApproved () + { + Object oo = get_Value(COLUMNNAME_IsApproved); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Discount Printed. + @param IsDiscountPrinted + Print Discount on Invoice and Order + */ + public void setIsDiscountPrinted (boolean IsDiscountPrinted) + { + set_Value (COLUMNNAME_IsDiscountPrinted, Boolean.valueOf(IsDiscountPrinted)); + } + + /** Get Discount Printed. + @return Print Discount on Invoice and Order + */ + public boolean isDiscountPrinted () + { + Object oo = get_Value(COLUMNNAME_IsDiscountPrinted); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set In Dispute. + @param IsInDispute + Document is in dispute + */ + public void setIsInDispute (boolean IsInDispute) + { + set_Value (COLUMNNAME_IsInDispute, Boolean.valueOf(IsInDispute)); + } + + /** Get In Dispute. + @return Document is in dispute + */ + public boolean isInDispute () + { + Object oo = get_Value(COLUMNNAME_IsInDispute); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Paid. + @param IsPaid + The document is paid + */ + public void setIsPaid (boolean IsPaid) + { + set_Value (COLUMNNAME_IsPaid, Boolean.valueOf(IsPaid)); + } + + /** Get Paid. + @return The document is paid + */ + public boolean isPaid () + { + Object oo = get_Value(COLUMNNAME_IsPaid); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Pay Schedule valid. + @param IsPayScheduleValid + Is the Payment Schedule is valid + */ + public void setIsPayScheduleValid (boolean IsPayScheduleValid) + { + set_ValueNoCheck (COLUMNNAME_IsPayScheduleValid, Boolean.valueOf(IsPayScheduleValid)); + } + + /** Get Pay Schedule valid. + @return Is the Payment Schedule is valid + */ + public boolean isPayScheduleValid () + { + Object oo = get_Value(COLUMNNAME_IsPayScheduleValid); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Printed. + @param IsPrinted + Indicates if this document / line is printed + */ + public void setIsPrinted (boolean IsPrinted) + { + set_ValueNoCheck (COLUMNNAME_IsPrinted, Boolean.valueOf(IsPrinted)); + } + + /** Get Printed. + @return Indicates if this document / line is printed + */ + public boolean isPrinted () + { + Object oo = get_Value(COLUMNNAME_IsPrinted); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Self-Service. + @param IsSelfService + This is a Self-Service entry or this entry can be changed via Self-Service + */ + public void setIsSelfService (boolean IsSelfService) + { + set_Value (COLUMNNAME_IsSelfService, Boolean.valueOf(IsSelfService)); + } + + /** Get Self-Service. + @return This is a Self-Service entry or this entry can be changed via Self-Service + */ + public boolean isSelfService () + { + Object oo = get_Value(COLUMNNAME_IsSelfService); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Sales Transaction. + @param IsSOTrx + This is a Sales Transaction + */ + public void setIsSOTrx (boolean IsSOTrx) + { + set_ValueNoCheck (COLUMNNAME_IsSOTrx, Boolean.valueOf(IsSOTrx)); + } + + /** Get Sales Transaction. + @return This is a Sales Transaction + */ + public boolean isSOTrx () + { + Object oo = get_Value(COLUMNNAME_IsSOTrx); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Price includes Tax. + @param IsTaxIncluded + Tax is included in the price + */ + public void setIsTaxIncluded (boolean IsTaxIncluded) + { + set_Value (COLUMNNAME_IsTaxIncluded, Boolean.valueOf(IsTaxIncluded)); + } + + /** Get Price includes Tax. + @return Tax is included in the price + */ + public boolean isTaxIncluded () + { + Object oo = get_Value(COLUMNNAME_IsTaxIncluded); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Transferred. + @param IsTransferred + Transferred to General Ledger (i.e. accounted) + */ + public void setIsTransferred (boolean IsTransferred) + { + set_ValueNoCheck (COLUMNNAME_IsTransferred, Boolean.valueOf(IsTransferred)); + } + + /** Get Transferred. + @return Transferred to General Ledger (i.e. accounted) + */ + public boolean isTransferred () + { + Object oo = get_Value(COLUMNNAME_IsTransferred); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + public I_M_PriceList getM_PriceList() throws Exception + { + Class clazz = MTable.getClass(I_M_PriceList.Table_Name); + I_M_PriceList result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_M_PriceList)constructor.newInstance(new Object[] {getCtx(), new Integer(getM_PriceList_ID()), get_TrxName()}); + } catch (Exception e) { + log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); + log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); + throw e; + } + return result; + } + + /** Set Price List. + @param M_PriceList_ID + Unique identifier of a Price List + */ + public void setM_PriceList_ID (int M_PriceList_ID) + { + if (M_PriceList_ID < 1) + throw new IllegalArgumentException ("M_PriceList_ID is mandatory."); + set_Value (COLUMNNAME_M_PriceList_ID, Integer.valueOf(M_PriceList_ID)); + } + + /** Get Price List. + @return Unique identifier of a Price List + */ + public int getM_PriceList_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_M_PriceList_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + public I_M_RMA getM_RMA() throws Exception + { + Class clazz = MTable.getClass(I_M_RMA.Table_Name); + I_M_RMA result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_M_RMA)constructor.newInstance(new Object[] {getCtx(), new Integer(getM_RMA_ID()), get_TrxName()}); + } catch (Exception e) { + log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); + log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); + throw e; + } + return result; + } + + /** Set RMA. + @param M_RMA_ID + Return Material Authorization + */ + public void setM_RMA_ID (int M_RMA_ID) + { + if (M_RMA_ID < 1) + set_Value (COLUMNNAME_M_RMA_ID, null); + else + set_Value (COLUMNNAME_M_RMA_ID, Integer.valueOf(M_RMA_ID)); + } + + /** Get RMA. + @return Return Material Authorization + */ + public int getM_RMA_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_M_RMA_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** PaymentRule AD_Reference_ID=195 */ + public static final int PAYMENTRULE_AD_Reference_ID=195; + /** Cash = B */ + public static final String PAYMENTRULE_Cash = "B"; + /** Credit Card = K */ + public static final String PAYMENTRULE_CreditCard = "K"; + /** Direct Deposit = T */ + public static final String PAYMENTRULE_DirectDeposit = "T"; + /** Check = S */ + public static final String PAYMENTRULE_Check = "S"; + /** On Credit = P */ + public static final String PAYMENTRULE_OnCredit = "P"; + /** Direct Debit = D */ + public static final String PAYMENTRULE_DirectDebit = "D"; + /** Mixed = M */ + public static final String PAYMENTRULE_Mixed = "M"; + /** Set Payment Rule. + @param PaymentRule + How you pay the invoice + */ + public void setPaymentRule (String PaymentRule) + { + if (PaymentRule == null) throw new IllegalArgumentException ("PaymentRule is mandatory"); + if (PaymentRule.equals("B") || PaymentRule.equals("K") || PaymentRule.equals("T") || PaymentRule.equals("S") || PaymentRule.equals("P") || PaymentRule.equals("D") || PaymentRule.equals("M")); else throw new IllegalArgumentException ("PaymentRule Invalid value - " + PaymentRule + " - Reference_ID=195 - B - K - T - S - P - D - M"); + if (PaymentRule.length() > 1) + { + log.warning("Length > 1 - truncated"); + PaymentRule = PaymentRule.substring(0, 1); + } + set_Value (COLUMNNAME_PaymentRule, PaymentRule); + } + + /** Get Payment Rule. + @return How you pay the invoice + */ + public String getPaymentRule () + { + return (String)get_Value(COLUMNNAME_PaymentRule); + } + + /** Set Order Reference. + @param POReference + Transaction Reference Number (Sales Order, Purchase Order) of your Business Partner + */ + public void setPOReference (String POReference) + { + + if (POReference != null && POReference.length() > 20) + { + log.warning("Length > 20 - truncated"); + POReference = POReference.substring(0, 20); + } + set_Value (COLUMNNAME_POReference, POReference); + } + + /** Get Order Reference. + @return Transaction Reference Number (Sales Order, Purchase Order) of your Business Partner + */ + public String getPOReference () + { + return (String)get_Value(COLUMNNAME_POReference); + } + + /** Set Posted. + @param Posted + Posting status + */ + public void setPosted (boolean Posted) + { + set_Value (COLUMNNAME_Posted, Boolean.valueOf(Posted)); + } + + /** Get Posted. + @return Posting status + */ + public boolean isPosted () + { + Object oo = get_Value(COLUMNNAME_Posted); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Processed. + @param Processed + The document has been processed + */ + public void setProcessed (boolean Processed) + { + set_ValueNoCheck (COLUMNNAME_Processed, Boolean.valueOf(Processed)); + } + + /** Get Processed. + @return The document has been processed + */ + public boolean isProcessed () + { + Object oo = get_Value(COLUMNNAME_Processed); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Process Now. + @param Processing Process Now */ + public void setProcessing (boolean Processing) + { + set_Value (COLUMNNAME_Processing, Boolean.valueOf(Processing)); + } + + /** Get Process Now. + @return Process Now */ + public boolean isProcessing () + { + Object oo = get_Value(COLUMNNAME_Processing); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Referenced Invoice. + @param Ref_Invoice_ID Referenced Invoice */ + public void setRef_Invoice_ID (int Ref_Invoice_ID) + { + if (Ref_Invoice_ID < 1) + set_Value (COLUMNNAME_Ref_Invoice_ID, null); + else + set_Value (COLUMNNAME_Ref_Invoice_ID, Integer.valueOf(Ref_Invoice_ID)); + } + + /** Get Referenced Invoice. + @return Referenced Invoice */ + public int getRef_Invoice_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_Ref_Invoice_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** SalesRep_ID AD_Reference_ID=190 */ + public static final int SALESREP_ID_AD_Reference_ID=190; + /** Set Sales Representative. + @param SalesRep_ID + Sales Representative or Company Agent + */ + public void setSalesRep_ID (int SalesRep_ID) + { + if (SalesRep_ID < 1) + set_Value (COLUMNNAME_SalesRep_ID, null); + else + set_Value (COLUMNNAME_SalesRep_ID, Integer.valueOf(SalesRep_ID)); + } + + /** Get Sales Representative. + @return Sales Representative or Company Agent + */ + public int getSalesRep_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_SalesRep_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set Send EMail. + @param SendEMail + Enable sending Document EMail + */ + public void setSendEMail (boolean SendEMail) + { + set_Value (COLUMNNAME_SendEMail, Boolean.valueOf(SendEMail)); + } + + /** Get Send EMail. + @return Enable sending Document EMail + */ + public boolean isSendEMail () + { + Object oo = get_Value(COLUMNNAME_SendEMail); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Total Lines. + @param TotalLines + Total of all document lines + */ + public void setTotalLines (BigDecimal TotalLines) + { + if (TotalLines == null) + throw new IllegalArgumentException ("TotalLines is mandatory."); + set_ValueNoCheck (COLUMNNAME_TotalLines, TotalLines); + } + + /** Get Total Lines. + @return Total of all document lines + */ + public BigDecimal getTotalLines () + { + BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_TotalLines); + if (bd == null) + return Env.ZERO; + return bd; + } + + /** User1_ID AD_Reference_ID=134 */ + public static final int USER1_ID_AD_Reference_ID=134; + /** Set User List 1. + @param User1_ID + User defined list element #1 + */ + public void setUser1_ID (int User1_ID) + { + if (User1_ID < 1) + set_Value (COLUMNNAME_User1_ID, null); + else + set_Value (COLUMNNAME_User1_ID, Integer.valueOf(User1_ID)); + } + + /** Get User List 1. + @return User defined list element #1 + */ + public int getUser1_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_User1_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** User2_ID AD_Reference_ID=137 */ + public static final int USER2_ID_AD_Reference_ID=137; + /** Set User List 2. + @param User2_ID + User defined list element #2 + */ + public void setUser2_ID (int User2_ID) + { + if (User2_ID < 1) + set_Value (COLUMNNAME_User2_ID, null); + else + set_Value (COLUMNNAME_User2_ID, Integer.valueOf(User2_ID)); + } + + /** Get User List 2. + @return User defined list element #2 + */ + public int getUser2_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_User2_ID); + if (ii == null) + return 0; + return ii.intValue(); + } +} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/compiere/model/X_C_Order.java b/posterita/posterita/src/main/org/compiere/model/X_C_Order.java new file mode 100644 index 0000000000..c49bd4c9ac --- /dev/null +++ b/posterita/posterita/src/main/org/compiere/model/X_C_Order.java @@ -0,0 +1,2117 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2007 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program 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 General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +/** Generated Model - DO NOT CHANGE */ +package org.compiere.model; + +import java.lang.reflect.Constructor; +import java.math.BigDecimal; +import java.sql.ResultSet; +import java.sql.Timestamp; +import java.util.Properties; +import java.util.logging.Level; +import org.compiere.util.Env; +import org.compiere.util.KeyNamePair; + +/** Generated Model for C_Order + * @author Adempiere (generated) + * @version Release 3.4.0s - $Id$ */ +public class X_C_Order extends PO implements I_C_Order, I_Persistent +{ + + /** + * + */ + private static final long serialVersionUID = 1L; + + /** Standard Constructor */ + public X_C_Order (Properties ctx, int C_Order_ID, String trxName) + { + super (ctx, C_Order_ID, trxName); + /** if (C_Order_ID == 0) + { + setC_BPartner_ID (0); + setC_BPartner_Location_ID (0); + setC_Currency_ID (0); +// @C_Currency_ID@ + setC_DocType_ID (0); +// 0 + setC_DocTypeTarget_ID (0); + setC_Order_ID (0); + setC_PaymentTerm_ID (0); + setDateAcct (new Timestamp(System.currentTimeMillis())); +// @#Date@ + setDateOrdered (new Timestamp(System.currentTimeMillis())); +// @#Date@ + setDatePromised (new Timestamp(System.currentTimeMillis())); +// @#Date@ + setDeliveryRule (null); +// F + setDeliveryViaRule (null); +// P + setDocAction (null); +// CO + setDocStatus (null); +// DR + setDocumentNo (null); + setFreightAmt (Env.ZERO); + setFreightCostRule (null); +// I + setGrandTotal (Env.ZERO); + setInvoiceRule (null); +// I + setIsApproved (false); +// @IsApproved@ + setIsCreditApproved (false); + setIsDelivered (false); + setIsDiscountPrinted (false); + setIsDropShip (false); +// N + setIsInvoiced (false); + setIsPrinted (false); + setIsSelected (false); + setIsSelfService (false); + setIsSOTrx (false); +// @IsSOTrx@ + setIsTaxIncluded (false); + setIsTransferred (false); + setM_PriceList_ID (0); + setM_Warehouse_ID (0); + setPaymentRule (null); +// B + setPosted (false); +// N + setPriorityRule (null); +// 5 + setProcessed (false); + setSalesRep_ID (0); + setSendEMail (false); + setTotalLines (Env.ZERO); + } */ + } + + /** Load Constructor */ + public X_C_Order (Properties ctx, ResultSet rs, String trxName) + { + super (ctx, rs, trxName); + } + + /** AccessLevel + * @return 1 - Org + */ + protected int get_AccessLevel() + { + return accessLevel.intValue(); + } + + /** Load Meta Data */ + protected POInfo initPO (Properties ctx) + { + POInfo poi = POInfo.getPOInfo (ctx, Table_ID, get_TrxName()); + return poi; + } + + public String toString() + { + StringBuffer sb = new StringBuffer ("X_C_Order[") + .append(get_ID()).append("]"); + return sb.toString(); + } + + /** AD_OrgTrx_ID AD_Reference_ID=130 */ + public static final int AD_ORGTRX_ID_AD_Reference_ID=130; + /** Set Trx Organization. + @param AD_OrgTrx_ID + Performing or initiating organization + */ + public void setAD_OrgTrx_ID (int AD_OrgTrx_ID) + { + if (AD_OrgTrx_ID < 1) + set_Value (COLUMNNAME_AD_OrgTrx_ID, null); + else + set_Value (COLUMNNAME_AD_OrgTrx_ID, Integer.valueOf(AD_OrgTrx_ID)); + } + + /** Get Trx Organization. + @return Performing or initiating organization + */ + public int getAD_OrgTrx_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_AD_OrgTrx_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + public I_AD_User getAD_User() throws Exception + { + Class clazz = MTable.getClass(I_AD_User.Table_Name); + I_AD_User result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_AD_User)constructor.newInstance(new Object[] {getCtx(), new Integer(getAD_User_ID()), get_TrxName()}); + } catch (Exception e) { + log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); + log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); + throw e; + } + return result; + } + + /** Set User/Contact. + @param AD_User_ID + User within the system - Internal or Business Partner Contact + */ + public void setAD_User_ID (int AD_User_ID) + { + if (AD_User_ID < 0) + set_Value (COLUMNNAME_AD_User_ID, null); + else + set_Value (COLUMNNAME_AD_User_ID, Integer.valueOf(AD_User_ID)); + } + + /** Get User/Contact. + @return User within the system - Internal or Business Partner Contact + */ + public int getAD_User_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_AD_User_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set AmountRefunded. + @param AmountRefunded AmountRefunded */ + public void setAmountRefunded (BigDecimal AmountRefunded) + { + set_Value (COLUMNNAME_AmountRefunded, AmountRefunded); + } + + /** Get AmountRefunded. + @return AmountRefunded */ + public BigDecimal getAmountRefunded () + { + BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_AmountRefunded); + if (bd == null) + return Env.ZERO; + return bd; + } + + /** Set AmountTendered. + @param AmountTendered AmountTendered */ + public void setAmountTendered (BigDecimal AmountTendered) + { + set_Value (COLUMNNAME_AmountTendered, AmountTendered); + } + + /** Get AmountTendered. + @return AmountTendered */ + public BigDecimal getAmountTendered () + { + BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_AmountTendered); + if (bd == null) + return Env.ZERO; + return bd; + } + + /** Bill_BPartner_ID AD_Reference_ID=138 */ + public static final int BILL_BPARTNER_ID_AD_Reference_ID=138; + /** Set Invoice Partner. + @param Bill_BPartner_ID + Business Partner to be invoiced + */ + public void setBill_BPartner_ID (int Bill_BPartner_ID) + { + if (Bill_BPartner_ID < 1) + set_Value (COLUMNNAME_Bill_BPartner_ID, null); + else + set_Value (COLUMNNAME_Bill_BPartner_ID, Integer.valueOf(Bill_BPartner_ID)); + } + + /** Get Invoice Partner. + @return Business Partner to be invoiced + */ + public int getBill_BPartner_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_Bill_BPartner_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Bill_Location_ID AD_Reference_ID=159 */ + public static final int BILL_LOCATION_ID_AD_Reference_ID=159; + /** Set Invoice Location. + @param Bill_Location_ID + Business Partner Location for invoicing + */ + public void setBill_Location_ID (int Bill_Location_ID) + { + if (Bill_Location_ID < 1) + set_Value (COLUMNNAME_Bill_Location_ID, null); + else + set_Value (COLUMNNAME_Bill_Location_ID, Integer.valueOf(Bill_Location_ID)); + } + + /** Get Invoice Location. + @return Business Partner Location for invoicing + */ + public int getBill_Location_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_Bill_Location_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Bill_User_ID AD_Reference_ID=110 */ + public static final int BILL_USER_ID_AD_Reference_ID=110; + /** Set Invoice Contact. + @param Bill_User_ID + Business Partner Contact for invoicing + */ + public void setBill_User_ID (int Bill_User_ID) + { + if (Bill_User_ID < 1) + set_Value (COLUMNNAME_Bill_User_ID, null); + else + set_Value (COLUMNNAME_Bill_User_ID, Integer.valueOf(Bill_User_ID)); + } + + /** Get Invoice Contact. + @return Business Partner Contact for invoicing + */ + public int getBill_User_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_Bill_User_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + public I_C_Activity getC_Activity() throws Exception + { + Class clazz = MTable.getClass(I_C_Activity.Table_Name); + I_C_Activity result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_C_Activity)constructor.newInstance(new Object[] {getCtx(), new Integer(getC_Activity_ID()), get_TrxName()}); + } catch (Exception e) { + log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); + log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); + throw e; + } + return result; + } + + /** Set Activity. + @param C_Activity_ID + Business Activity + */ + public void setC_Activity_ID (int C_Activity_ID) + { + if (C_Activity_ID < 1) + set_Value (COLUMNNAME_C_Activity_ID, null); + else + set_Value (COLUMNNAME_C_Activity_ID, Integer.valueOf(C_Activity_ID)); + } + + /** Get Activity. + @return Business Activity + */ + public int getC_Activity_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_Activity_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + public I_C_BPartner getC_BPartner() throws Exception + { + Class clazz = MTable.getClass(I_C_BPartner.Table_Name); + I_C_BPartner result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_C_BPartner)constructor.newInstance(new Object[] {getCtx(), new Integer(getC_BPartner_ID()), get_TrxName()}); + } catch (Exception e) { + log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); + log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); + throw e; + } + return result; + } + + /** Set Business Partner . + @param C_BPartner_ID + Identifies a Business Partner + */ + public void setC_BPartner_ID (int C_BPartner_ID) + { + if (C_BPartner_ID < 1) + throw new IllegalArgumentException ("C_BPartner_ID is mandatory."); + set_Value (COLUMNNAME_C_BPartner_ID, Integer.valueOf(C_BPartner_ID)); + } + + /** Get Business Partner . + @return Identifies a Business Partner + */ + public int getC_BPartner_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_BPartner_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + public I_C_BPartner_Location getC_BPartner_Location() throws Exception + { + Class clazz = MTable.getClass(I_C_BPartner_Location.Table_Name); + I_C_BPartner_Location result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_C_BPartner_Location)constructor.newInstance(new Object[] {getCtx(), new Integer(getC_BPartner_Location_ID()), get_TrxName()}); + } catch (Exception e) { + log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); + log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); + throw e; + } + return result; + } + + /** Set Partner Location. + @param C_BPartner_Location_ID + Identifies the (ship to) address for this Business Partner + */ + public void setC_BPartner_Location_ID (int C_BPartner_Location_ID) + { + if (C_BPartner_Location_ID < 1) + throw new IllegalArgumentException ("C_BPartner_Location_ID is mandatory."); + set_Value (COLUMNNAME_C_BPartner_Location_ID, Integer.valueOf(C_BPartner_Location_ID)); + } + + /** Get Partner Location. + @return Identifies the (ship to) address for this Business Partner + */ + public int getC_BPartner_Location_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_BPartner_Location_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + public I_C_Campaign getC_Campaign() throws Exception + { + Class clazz = MTable.getClass(I_C_Campaign.Table_Name); + I_C_Campaign result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_C_Campaign)constructor.newInstance(new Object[] {getCtx(), new Integer(getC_Campaign_ID()), get_TrxName()}); + } catch (Exception e) { + log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); + log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); + throw e; + } + return result; + } + + /** Set Campaign. + @param C_Campaign_ID + Marketing Campaign + */ + public void setC_Campaign_ID (int C_Campaign_ID) + { + if (C_Campaign_ID < 1) + set_Value (COLUMNNAME_C_Campaign_ID, null); + else + set_Value (COLUMNNAME_C_Campaign_ID, Integer.valueOf(C_Campaign_ID)); + } + + /** Get Campaign. + @return Marketing Campaign + */ + public int getC_Campaign_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_Campaign_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + public I_C_CashLine getC_CashLine() throws Exception + { + Class clazz = MTable.getClass(I_C_CashLine.Table_Name); + I_C_CashLine result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_C_CashLine)constructor.newInstance(new Object[] {getCtx(), new Integer(getC_CashLine_ID()), get_TrxName()}); + } catch (Exception e) { + log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); + log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); + throw e; + } + return result; + } + + /** Set Cash Journal Line. + @param C_CashLine_ID + Cash Journal Line + */ + public void setC_CashLine_ID (int C_CashLine_ID) + { + if (C_CashLine_ID < 1) + set_Value (COLUMNNAME_C_CashLine_ID, null); + else + set_Value (COLUMNNAME_C_CashLine_ID, Integer.valueOf(C_CashLine_ID)); + } + + /** Get Cash Journal Line. + @return Cash Journal Line + */ + public int getC_CashLine_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_CashLine_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** C_Charge_ID AD_Reference_ID=200 */ + public static final int C_CHARGE_ID_AD_Reference_ID=200; + /** Set Charge. + @param C_Charge_ID + Additional document charges + */ + public void setC_Charge_ID (int C_Charge_ID) + { + if (C_Charge_ID < 1) + set_Value (COLUMNNAME_C_Charge_ID, null); + else + set_Value (COLUMNNAME_C_Charge_ID, Integer.valueOf(C_Charge_ID)); + } + + /** Get Charge. + @return Additional document charges + */ + public int getC_Charge_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_Charge_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + public I_C_ConversionType getC_ConversionType() throws Exception + { + Class clazz = MTable.getClass(I_C_ConversionType.Table_Name); + I_C_ConversionType result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_C_ConversionType)constructor.newInstance(new Object[] {getCtx(), new Integer(getC_ConversionType_ID()), get_TrxName()}); + } catch (Exception e) { + log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); + log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); + throw e; + } + return result; + } + + /** Set Currency Type. + @param C_ConversionType_ID + Currency Conversion Rate Type + */ + public void setC_ConversionType_ID (int C_ConversionType_ID) + { + if (C_ConversionType_ID < 1) + set_Value (COLUMNNAME_C_ConversionType_ID, null); + else + set_Value (COLUMNNAME_C_ConversionType_ID, Integer.valueOf(C_ConversionType_ID)); + } + + /** Get Currency Type. + @return Currency Conversion Rate Type + */ + public int getC_ConversionType_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_ConversionType_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + public I_C_Currency getC_Currency() throws Exception + { + Class clazz = MTable.getClass(I_C_Currency.Table_Name); + I_C_Currency result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_C_Currency)constructor.newInstance(new Object[] {getCtx(), new Integer(getC_Currency_ID()), get_TrxName()}); + } catch (Exception e) { + log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); + log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); + throw e; + } + return result; + } + + /** Set Currency. + @param C_Currency_ID + The Currency for this record + */ + public void setC_Currency_ID (int C_Currency_ID) + { + if (C_Currency_ID < 1) + throw new IllegalArgumentException ("C_Currency_ID is mandatory."); + set_ValueNoCheck (COLUMNNAME_C_Currency_ID, Integer.valueOf(C_Currency_ID)); + } + + /** Get Currency. + @return The Currency for this record + */ + public int getC_Currency_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_Currency_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** C_DocType_ID AD_Reference_ID=170 */ + public static final int C_DOCTYPE_ID_AD_Reference_ID=170; + public I_C_DocType getC_DocType() throws Exception + { + Class clazz = MTable.getClass(I_C_DocType.Table_Name); + I_C_DocType result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_C_DocType)constructor.newInstance(new Object[] {getCtx(), new Integer(getC_DocType_ID()), get_TrxName()}); + } catch (Exception e) { + log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); + log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); + throw e; + } + return result; + } + + /** Set Document Type. + @param C_DocType_ID + Document type or rules + */ + public void setC_DocType_ID (int C_DocType_ID) + { + if (C_DocType_ID < 0) + throw new IllegalArgumentException ("C_DocType_ID is mandatory."); + set_ValueNoCheck (COLUMNNAME_C_DocType_ID, Integer.valueOf(C_DocType_ID)); + } + + /** Get Document Type. + @return Document type or rules + */ + public int getC_DocType_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_DocType_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** C_DocTypeTarget_ID AD_Reference_ID=170 */ + public static final int C_DOCTYPETARGET_ID_AD_Reference_ID=170; + /** Set Target Document Type. + @param C_DocTypeTarget_ID + Target document type for conversing documents + */ + public void setC_DocTypeTarget_ID (int C_DocTypeTarget_ID) + { + if (C_DocTypeTarget_ID < 1) + throw new IllegalArgumentException ("C_DocTypeTarget_ID is mandatory."); + set_Value (COLUMNNAME_C_DocTypeTarget_ID, Integer.valueOf(C_DocTypeTarget_ID)); + } + + /** Get Target Document Type. + @return Target document type for conversing documents + */ + public int getC_DocTypeTarget_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_DocTypeTarget_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set Charge amount. + @param ChargeAmt + Charge Amount + */ + public void setChargeAmt (BigDecimal ChargeAmt) + { + set_Value (COLUMNNAME_ChargeAmt, ChargeAmt); + } + + /** Get Charge amount. + @return Charge Amount + */ + public BigDecimal getChargeAmt () + { + BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_ChargeAmt); + if (bd == null) + return Env.ZERO; + return bd; + } + + /** Set Copy From. + @param CopyFrom + Copy From Record + */ + public void setCopyFrom (String CopyFrom) + { + + if (CopyFrom != null && CopyFrom.length() > 1) + { + log.warning("Length > 1 - truncated"); + CopyFrom = CopyFrom.substring(0, 1); + } + set_Value (COLUMNNAME_CopyFrom, CopyFrom); + } + + /** Get Copy From. + @return Copy From Record + */ + public String getCopyFrom () + { + return (String)get_Value(COLUMNNAME_CopyFrom); + } + + /** Set Order. + @param C_Order_ID + Order + */ + public void setC_Order_ID (int C_Order_ID) + { + if (C_Order_ID < 1) + throw new IllegalArgumentException ("C_Order_ID is mandatory."); + set_ValueNoCheck (COLUMNNAME_C_Order_ID, Integer.valueOf(C_Order_ID)); + } + + /** Get Order. + @return Order + */ + public int getC_Order_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_Order_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + public I_C_Payment getC_Payment() throws Exception + { + Class clazz = MTable.getClass(I_C_Payment.Table_Name); + I_C_Payment result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_C_Payment)constructor.newInstance(new Object[] {getCtx(), new Integer(getC_Payment_ID()), get_TrxName()}); + } catch (Exception e) { + log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); + log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); + throw e; + } + return result; + } + + /** Set Payment. + @param C_Payment_ID + Payment identifier + */ + public void setC_Payment_ID (int C_Payment_ID) + { + if (C_Payment_ID < 1) + set_Value (COLUMNNAME_C_Payment_ID, null); + else + set_Value (COLUMNNAME_C_Payment_ID, Integer.valueOf(C_Payment_ID)); + } + + /** Get Payment. + @return Payment identifier + */ + public int getC_Payment_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_Payment_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + public I_C_PaymentTerm getC_PaymentTerm() throws Exception + { + Class clazz = MTable.getClass(I_C_PaymentTerm.Table_Name); + I_C_PaymentTerm result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_C_PaymentTerm)constructor.newInstance(new Object[] {getCtx(), new Integer(getC_PaymentTerm_ID()), get_TrxName()}); + } catch (Exception e) { + log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); + log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); + throw e; + } + return result; + } + + /** Set Payment Term. + @param C_PaymentTerm_ID + The terms of Payment (timing, discount) + */ + public void setC_PaymentTerm_ID (int C_PaymentTerm_ID) + { + if (C_PaymentTerm_ID < 1) + throw new IllegalArgumentException ("C_PaymentTerm_ID is mandatory."); + set_Value (COLUMNNAME_C_PaymentTerm_ID, Integer.valueOf(C_PaymentTerm_ID)); + } + + /** Get Payment Term. + @return The terms of Payment (timing, discount) + */ + public int getC_PaymentTerm_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_PaymentTerm_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + public I_C_POS getC_POS() throws Exception + { + Class clazz = MTable.getClass(I_C_POS.Table_Name); + I_C_POS result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_C_POS)constructor.newInstance(new Object[] {getCtx(), new Integer(getC_POS_ID()), get_TrxName()}); + } catch (Exception e) { + log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); + log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); + throw e; + } + return result; + } + + /** Set POS Terminal. + @param C_POS_ID + Point of Sales Terminal + */ + public void setC_POS_ID (int C_POS_ID) + { + if (C_POS_ID < 1) + set_Value (COLUMNNAME_C_POS_ID, null); + else + set_Value (COLUMNNAME_C_POS_ID, Integer.valueOf(C_POS_ID)); + } + + /** Get POS Terminal. + @return Point of Sales Terminal + */ + public int getC_POS_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_POS_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + public I_C_Project getC_Project() throws Exception + { + Class clazz = MTable.getClass(I_C_Project.Table_Name); + I_C_Project result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_C_Project)constructor.newInstance(new Object[] {getCtx(), new Integer(getC_Project_ID()), get_TrxName()}); + } catch (Exception e) { + log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); + log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); + throw e; + } + return result; + } + + /** Set Project. + @param C_Project_ID + Financial Project + */ + public void setC_Project_ID (int C_Project_ID) + { + if (C_Project_ID < 1) + set_Value (COLUMNNAME_C_Project_ID, null); + else + set_Value (COLUMNNAME_C_Project_ID, Integer.valueOf(C_Project_ID)); + } + + /** Get Project. + @return Financial Project + */ + public int getC_Project_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_Project_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set Account Date. + @param DateAcct + Accounting Date + */ + public void setDateAcct (Timestamp DateAcct) + { + if (DateAcct == null) + throw new IllegalArgumentException ("DateAcct is mandatory."); + set_Value (COLUMNNAME_DateAcct, DateAcct); + } + + /** Get Account Date. + @return Accounting Date + */ + public Timestamp getDateAcct () + { + return (Timestamp)get_Value(COLUMNNAME_DateAcct); + } + + /** Set Date Ordered. + @param DateOrdered + Date of Order + */ + public void setDateOrdered (Timestamp DateOrdered) + { + if (DateOrdered == null) + throw new IllegalArgumentException ("DateOrdered is mandatory."); + set_Value (COLUMNNAME_DateOrdered, DateOrdered); + } + + /** Get Date Ordered. + @return Date of Order + */ + public Timestamp getDateOrdered () + { + return (Timestamp)get_Value(COLUMNNAME_DateOrdered); + } + + /** Set Date printed. + @param DatePrinted + Date the document was printed. + */ + public void setDatePrinted (Timestamp DatePrinted) + { + set_Value (COLUMNNAME_DatePrinted, DatePrinted); + } + + /** Get Date printed. + @return Date the document was printed. + */ + public Timestamp getDatePrinted () + { + return (Timestamp)get_Value(COLUMNNAME_DatePrinted); + } + + /** Set Date Promised. + @param DatePromised + Date Order was promised + */ + public void setDatePromised (Timestamp DatePromised) + { + if (DatePromised == null) + throw new IllegalArgumentException ("DatePromised is mandatory."); + set_Value (COLUMNNAME_DatePromised, DatePromised); + } + + /** Get Date Promised. + @return Date Order was promised + */ + public Timestamp getDatePromised () + { + return (Timestamp)get_Value(COLUMNNAME_DatePromised); + } + + /** DeliveryRule AD_Reference_ID=151 */ + public static final int DELIVERYRULE_AD_Reference_ID=151; + /** After Receipt = R */ + public static final String DELIVERYRULE_AfterReceipt = "R"; + /** Availability = A */ + public static final String DELIVERYRULE_Availability = "A"; + /** Complete Line = L */ + public static final String DELIVERYRULE_CompleteLine = "L"; + /** Complete Order = O */ + public static final String DELIVERYRULE_CompleteOrder = "O"; + /** Force = F */ + public static final String DELIVERYRULE_Force = "F"; + /** Manual = M */ + public static final String DELIVERYRULE_Manual = "M"; + /** Set Delivery Rule. + @param DeliveryRule + Defines the timing of Delivery + */ + public void setDeliveryRule (String DeliveryRule) + { + if (DeliveryRule == null) throw new IllegalArgumentException ("DeliveryRule is mandatory"); + if (DeliveryRule.equals("R") || DeliveryRule.equals("A") || DeliveryRule.equals("L") || DeliveryRule.equals("O") || DeliveryRule.equals("F") || DeliveryRule.equals("M")); else throw new IllegalArgumentException ("DeliveryRule Invalid value - " + DeliveryRule + " - Reference_ID=151 - R - A - L - O - F - M"); + if (DeliveryRule.length() > 1) + { + log.warning("Length > 1 - truncated"); + DeliveryRule = DeliveryRule.substring(0, 1); + } + set_Value (COLUMNNAME_DeliveryRule, DeliveryRule); + } + + /** Get Delivery Rule. + @return Defines the timing of Delivery + */ + public String getDeliveryRule () + { + return (String)get_Value(COLUMNNAME_DeliveryRule); + } + + /** DeliveryViaRule AD_Reference_ID=152 */ + public static final int DELIVERYVIARULE_AD_Reference_ID=152; + /** Pickup = P */ + public static final String DELIVERYVIARULE_Pickup = "P"; + /** Delivery = D */ + public static final String DELIVERYVIARULE_Delivery = "D"; + /** Shipper = S */ + public static final String DELIVERYVIARULE_Shipper = "S"; + /** Set Delivery Via. + @param DeliveryViaRule + How the order will be delivered + */ + public void setDeliveryViaRule (String DeliveryViaRule) + { + if (DeliveryViaRule == null) throw new IllegalArgumentException ("DeliveryViaRule is mandatory"); + if (DeliveryViaRule.equals("P") || DeliveryViaRule.equals("D") || DeliveryViaRule.equals("S")); else throw new IllegalArgumentException ("DeliveryViaRule Invalid value - " + DeliveryViaRule + " - Reference_ID=152 - P - D - S"); + if (DeliveryViaRule.length() > 1) + { + log.warning("Length > 1 - truncated"); + DeliveryViaRule = DeliveryViaRule.substring(0, 1); + } + set_Value (COLUMNNAME_DeliveryViaRule, DeliveryViaRule); + } + + /** Get Delivery Via. + @return How the order will be delivered + */ + public String getDeliveryViaRule () + { + return (String)get_Value(COLUMNNAME_DeliveryViaRule); + } + + /** Set Description. + @param Description + Optional short description of the record + */ + public void setDescription (String Description) + { + + if (Description != null && Description.length() > 255) + { + log.warning("Length > 255 - truncated"); + Description = Description.substring(0, 255); + } + set_Value (COLUMNNAME_Description, Description); + } + + /** Get Description. + @return Optional short description of the record + */ + public String getDescription () + { + return (String)get_Value(COLUMNNAME_Description); + } + + /** DocAction AD_Reference_ID=135 */ + public static final int DOCACTION_AD_Reference_ID=135; + /** Complete = CO */ + public static final String DOCACTION_Complete = "CO"; + /** Approve = AP */ + public static final String DOCACTION_Approve = "AP"; + /** Reject = RJ */ + public static final String DOCACTION_Reject = "RJ"; + /** Post = PO */ + public static final String DOCACTION_Post = "PO"; + /** Void = VO */ + public static final String DOCACTION_Void = "VO"; + /** Close = CL */ + public static final String DOCACTION_Close = "CL"; + /** Reverse - Correct = RC */ + public static final String DOCACTION_Reverse_Correct = "RC"; + /** Reverse - Accrual = RA */ + public static final String DOCACTION_Reverse_Accrual = "RA"; + /** Invalidate = IN */ + public static final String DOCACTION_Invalidate = "IN"; + /** Re-activate = RE */ + public static final String DOCACTION_Re_Activate = "RE"; + /** = -- */ + public static final String DOCACTION_None = "--"; + /** Prepare = PR */ + public static final String DOCACTION_Prepare = "PR"; + /** Unlock = XL */ + public static final String DOCACTION_Unlock = "XL"; + /** Wait Complete = WC */ + public static final String DOCACTION_WaitComplete = "WC"; + /** Set Document Action. + @param DocAction + The targeted status of the document + */ + public void setDocAction (String DocAction) + { + if (DocAction == null) throw new IllegalArgumentException ("DocAction is mandatory"); + if (DocAction.equals("CO") || DocAction.equals("AP") || DocAction.equals("RJ") || DocAction.equals("PO") || DocAction.equals("VO") || DocAction.equals("CL") || DocAction.equals("RC") || DocAction.equals("RA") || DocAction.equals("IN") || DocAction.equals("RE") || DocAction.equals("--") || DocAction.equals("PR") || DocAction.equals("XL") || DocAction.equals("WC")); else throw new IllegalArgumentException ("DocAction Invalid value - " + DocAction + " - Reference_ID=135 - CO - AP - RJ - PO - VO - CL - RC - RA - IN - RE - -- - PR - XL - WC"); + if (DocAction.length() > 2) + { + log.warning("Length > 2 - truncated"); + DocAction = DocAction.substring(0, 2); + } + set_Value (COLUMNNAME_DocAction, DocAction); + } + + /** Get Document Action. + @return The targeted status of the document + */ + public String getDocAction () + { + return (String)get_Value(COLUMNNAME_DocAction); + } + + /** DocStatus AD_Reference_ID=131 */ + public static final int DOCSTATUS_AD_Reference_ID=131; + /** Drafted = DR */ + public static final String DOCSTATUS_Drafted = "DR"; + /** Completed = CO */ + public static final String DOCSTATUS_Completed = "CO"; + /** Approved = AP */ + public static final String DOCSTATUS_Approved = "AP"; + /** Not Approved = NA */ + public static final String DOCSTATUS_NotApproved = "NA"; + /** Voided = VO */ + public static final String DOCSTATUS_Voided = "VO"; + /** Invalid = IN */ + public static final String DOCSTATUS_Invalid = "IN"; + /** Reversed = RE */ + public static final String DOCSTATUS_Reversed = "RE"; + /** Closed = CL */ + public static final String DOCSTATUS_Closed = "CL"; + /** Unknown = ?? */ + public static final String DOCSTATUS_Unknown = "??"; + /** In Progress = IP */ + public static final String DOCSTATUS_InProgress = "IP"; + /** Waiting Payment = WP */ + public static final String DOCSTATUS_WaitingPayment = "WP"; + /** Waiting Confirmation = WC */ + public static final String DOCSTATUS_WaitingConfirmation = "WC"; + /** Set Document Status. + @param DocStatus + The current status of the document + */ + public void setDocStatus (String DocStatus) + { + if (DocStatus == null) throw new IllegalArgumentException ("DocStatus is mandatory"); + if (DocStatus.equals("DR") || DocStatus.equals("CO") || DocStatus.equals("AP") || DocStatus.equals("NA") || DocStatus.equals("VO") || DocStatus.equals("IN") || DocStatus.equals("RE") || DocStatus.equals("CL") || DocStatus.equals("??") || DocStatus.equals("IP") || DocStatus.equals("WP") || DocStatus.equals("WC")); else throw new IllegalArgumentException ("DocStatus Invalid value - " + DocStatus + " - Reference_ID=131 - DR - CO - AP - NA - VO - IN - RE - CL - ?? - IP - WP - WC"); + if (DocStatus.length() > 2) + { + log.warning("Length > 2 - truncated"); + DocStatus = DocStatus.substring(0, 2); + } + set_Value (COLUMNNAME_DocStatus, DocStatus); + } + + /** Get Document Status. + @return The current status of the document + */ + public String getDocStatus () + { + return (String)get_Value(COLUMNNAME_DocStatus); + } + + /** Set Document No. + @param DocumentNo + Document sequence number of the document + */ + public void setDocumentNo (String DocumentNo) + { + if (DocumentNo == null) + throw new IllegalArgumentException ("DocumentNo is mandatory."); + + if (DocumentNo.length() > 30) + { + log.warning("Length > 30 - truncated"); + DocumentNo = DocumentNo.substring(0, 30); + } + set_ValueNoCheck (COLUMNNAME_DocumentNo, DocumentNo); + } + + /** Get Document No. + @return Document sequence number of the document + */ + public String getDocumentNo () + { + return (String)get_Value(COLUMNNAME_DocumentNo); + } + + /** Get Record ID/ColumnName + @return ID/ColumnName pair + */ + public KeyNamePair getKeyNamePair() + { + return new KeyNamePair(get_ID(), getDocumentNo()); + } + + /** Set Freight Amount. + @param FreightAmt + Freight Amount + */ + public void setFreightAmt (BigDecimal FreightAmt) + { + if (FreightAmt == null) + throw new IllegalArgumentException ("FreightAmt is mandatory."); + set_Value (COLUMNNAME_FreightAmt, FreightAmt); + } + + /** Get Freight Amount. + @return Freight Amount + */ + public BigDecimal getFreightAmt () + { + BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_FreightAmt); + if (bd == null) + return Env.ZERO; + return bd; + } + + /** FreightCostRule AD_Reference_ID=153 */ + public static final int FREIGHTCOSTRULE_AD_Reference_ID=153; + /** Freight included = I */ + public static final String FREIGHTCOSTRULE_FreightIncluded = "I"; + /** Fix price = F */ + public static final String FREIGHTCOSTRULE_FixPrice = "F"; + /** Calculated = C */ + public static final String FREIGHTCOSTRULE_Calculated = "C"; + /** Line = L */ + public static final String FREIGHTCOSTRULE_Line = "L"; + /** Set Freight Cost Rule. + @param FreightCostRule + Method for charging Freight + */ + public void setFreightCostRule (String FreightCostRule) + { + if (FreightCostRule == null) throw new IllegalArgumentException ("FreightCostRule is mandatory"); + if (FreightCostRule.equals("I") || FreightCostRule.equals("F") || FreightCostRule.equals("C") || FreightCostRule.equals("L")); else throw new IllegalArgumentException ("FreightCostRule Invalid value - " + FreightCostRule + " - Reference_ID=153 - I - F - C - L"); + if (FreightCostRule.length() > 1) + { + log.warning("Length > 1 - truncated"); + FreightCostRule = FreightCostRule.substring(0, 1); + } + set_Value (COLUMNNAME_FreightCostRule, FreightCostRule); + } + + /** Get Freight Cost Rule. + @return Method for charging Freight + */ + public String getFreightCostRule () + { + return (String)get_Value(COLUMNNAME_FreightCostRule); + } + + /** Set Grand Total. + @param GrandTotal + Total amount of document + */ + public void setGrandTotal (BigDecimal GrandTotal) + { + if (GrandTotal == null) + throw new IllegalArgumentException ("GrandTotal is mandatory."); + set_ValueNoCheck (COLUMNNAME_GrandTotal, GrandTotal); + } + + /** Get Grand Total. + @return Total amount of document + */ + public BigDecimal getGrandTotal () + { + BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_GrandTotal); + if (bd == null) + return Env.ZERO; + return bd; + } + + /** InvoiceRule AD_Reference_ID=150 */ + public static final int INVOICERULE_AD_Reference_ID=150; + /** After Order delivered = O */ + public static final String INVOICERULE_AfterOrderDelivered = "O"; + /** After Delivery = D */ + public static final String INVOICERULE_AfterDelivery = "D"; + /** Customer Schedule after Delivery = S */ + public static final String INVOICERULE_CustomerScheduleAfterDelivery = "S"; + /** Immediate = I */ + public static final String INVOICERULE_Immediate = "I"; + /** Set Invoice Rule. + @param InvoiceRule + Frequency and method of invoicing + */ + public void setInvoiceRule (String InvoiceRule) + { + if (InvoiceRule == null) throw new IllegalArgumentException ("InvoiceRule is mandatory"); + if (InvoiceRule.equals("O") || InvoiceRule.equals("D") || InvoiceRule.equals("S") || InvoiceRule.equals("I")); else throw new IllegalArgumentException ("InvoiceRule Invalid value - " + InvoiceRule + " - Reference_ID=150 - O - D - S - I"); + if (InvoiceRule.length() > 1) + { + log.warning("Length > 1 - truncated"); + InvoiceRule = InvoiceRule.substring(0, 1); + } + set_Value (COLUMNNAME_InvoiceRule, InvoiceRule); + } + + /** Get Invoice Rule. + @return Frequency and method of invoicing + */ + public String getInvoiceRule () + { + return (String)get_Value(COLUMNNAME_InvoiceRule); + } + + /** Set Approved. + @param IsApproved + Indicates if this document requires approval + */ + public void setIsApproved (boolean IsApproved) + { + set_ValueNoCheck (COLUMNNAME_IsApproved, Boolean.valueOf(IsApproved)); + } + + /** Get Approved. + @return Indicates if this document requires approval + */ + public boolean isApproved () + { + Object oo = get_Value(COLUMNNAME_IsApproved); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Credit Approved. + @param IsCreditApproved + Credit has been approved + */ + public void setIsCreditApproved (boolean IsCreditApproved) + { + set_ValueNoCheck (COLUMNNAME_IsCreditApproved, Boolean.valueOf(IsCreditApproved)); + } + + /** Get Credit Approved. + @return Credit has been approved + */ + public boolean isCreditApproved () + { + Object oo = get_Value(COLUMNNAME_IsCreditApproved); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Delivered. + @param IsDelivered Delivered */ + public void setIsDelivered (boolean IsDelivered) + { + set_ValueNoCheck (COLUMNNAME_IsDelivered, Boolean.valueOf(IsDelivered)); + } + + /** Get Delivered. + @return Delivered */ + public boolean isDelivered () + { + Object oo = get_Value(COLUMNNAME_IsDelivered); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Discount Printed. + @param IsDiscountPrinted + Print Discount on Invoice and Order + */ + public void setIsDiscountPrinted (boolean IsDiscountPrinted) + { + set_Value (COLUMNNAME_IsDiscountPrinted, Boolean.valueOf(IsDiscountPrinted)); + } + + /** Get Discount Printed. + @return Print Discount on Invoice and Order + */ + public boolean isDiscountPrinted () + { + Object oo = get_Value(COLUMNNAME_IsDiscountPrinted); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Drop Shipment. + @param IsDropShip + Drop Shipments are sent from the Vendor directly to the Customer + */ + public void setIsDropShip (boolean IsDropShip) + { + set_ValueNoCheck (COLUMNNAME_IsDropShip, Boolean.valueOf(IsDropShip)); + } + + /** Get Drop Shipment. + @return Drop Shipments are sent from the Vendor directly to the Customer + */ + public boolean isDropShip () + { + Object oo = get_Value(COLUMNNAME_IsDropShip); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Invoiced. + @param IsInvoiced + Is this invoiced? + */ + public void setIsInvoiced (boolean IsInvoiced) + { + set_ValueNoCheck (COLUMNNAME_IsInvoiced, Boolean.valueOf(IsInvoiced)); + } + + /** Get Invoiced. + @return Is this invoiced? + */ + public boolean isInvoiced () + { + Object oo = get_Value(COLUMNNAME_IsInvoiced); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Printed. + @param IsPrinted + Indicates if this document / line is printed + */ + public void setIsPrinted (boolean IsPrinted) + { + set_ValueNoCheck (COLUMNNAME_IsPrinted, Boolean.valueOf(IsPrinted)); + } + + /** Get Printed. + @return Indicates if this document / line is printed + */ + public boolean isPrinted () + { + Object oo = get_Value(COLUMNNAME_IsPrinted); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Selected. + @param IsSelected Selected */ + public void setIsSelected (boolean IsSelected) + { + set_Value (COLUMNNAME_IsSelected, Boolean.valueOf(IsSelected)); + } + + /** Get Selected. + @return Selected */ + public boolean isSelected () + { + Object oo = get_Value(COLUMNNAME_IsSelected); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Self-Service. + @param IsSelfService + This is a Self-Service entry or this entry can be changed via Self-Service + */ + public void setIsSelfService (boolean IsSelfService) + { + set_Value (COLUMNNAME_IsSelfService, Boolean.valueOf(IsSelfService)); + } + + /** Get Self-Service. + @return This is a Self-Service entry or this entry can be changed via Self-Service + */ + public boolean isSelfService () + { + Object oo = get_Value(COLUMNNAME_IsSelfService); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Sales Transaction. + @param IsSOTrx + This is a Sales Transaction + */ + public void setIsSOTrx (boolean IsSOTrx) + { + set_Value (COLUMNNAME_IsSOTrx, Boolean.valueOf(IsSOTrx)); + } + + /** Get Sales Transaction. + @return This is a Sales Transaction + */ + public boolean isSOTrx () + { + Object oo = get_Value(COLUMNNAME_IsSOTrx); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Price includes Tax. + @param IsTaxIncluded + Tax is included in the price + */ + public void setIsTaxIncluded (boolean IsTaxIncluded) + { + set_Value (COLUMNNAME_IsTaxIncluded, Boolean.valueOf(IsTaxIncluded)); + } + + /** Get Price includes Tax. + @return Tax is included in the price + */ + public boolean isTaxIncluded () + { + Object oo = get_Value(COLUMNNAME_IsTaxIncluded); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Transferred. + @param IsTransferred + Transferred to General Ledger (i.e. accounted) + */ + public void setIsTransferred (boolean IsTransferred) + { + set_ValueNoCheck (COLUMNNAME_IsTransferred, Boolean.valueOf(IsTransferred)); + } + + /** Get Transferred. + @return Transferred to General Ledger (i.e. accounted) + */ + public boolean isTransferred () + { + Object oo = get_Value(COLUMNNAME_IsTransferred); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + public I_M_PriceList getM_PriceList() throws Exception + { + Class clazz = MTable.getClass(I_M_PriceList.Table_Name); + I_M_PriceList result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_M_PriceList)constructor.newInstance(new Object[] {getCtx(), new Integer(getM_PriceList_ID()), get_TrxName()}); + } catch (Exception e) { + log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); + log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); + throw e; + } + return result; + } + + /** Set Price List. + @param M_PriceList_ID + Unique identifier of a Price List + */ + public void setM_PriceList_ID (int M_PriceList_ID) + { + if (M_PriceList_ID < 1) + throw new IllegalArgumentException ("M_PriceList_ID is mandatory."); + set_Value (COLUMNNAME_M_PriceList_ID, Integer.valueOf(M_PriceList_ID)); + } + + /** Get Price List. + @return Unique identifier of a Price List + */ + public int getM_PriceList_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_M_PriceList_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + public I_M_Shipper getM_Shipper() throws Exception + { + Class clazz = MTable.getClass(I_M_Shipper.Table_Name); + I_M_Shipper result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_M_Shipper)constructor.newInstance(new Object[] {getCtx(), new Integer(getM_Shipper_ID()), get_TrxName()}); + } catch (Exception e) { + log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); + log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); + throw e; + } + return result; + } + + /** Set Shipper. + @param M_Shipper_ID + Method or manner of product delivery + */ + public void setM_Shipper_ID (int M_Shipper_ID) + { + if (M_Shipper_ID < 1) + set_Value (COLUMNNAME_M_Shipper_ID, null); + else + set_Value (COLUMNNAME_M_Shipper_ID, Integer.valueOf(M_Shipper_ID)); + } + + /** Get Shipper. + @return Method or manner of product delivery + */ + public int getM_Shipper_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_M_Shipper_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + public I_M_Warehouse getM_Warehouse() throws Exception + { + Class clazz = MTable.getClass(I_M_Warehouse.Table_Name); + I_M_Warehouse result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_M_Warehouse)constructor.newInstance(new Object[] {getCtx(), new Integer(getM_Warehouse_ID()), get_TrxName()}); + } catch (Exception e) { + log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); + log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); + throw e; + } + return result; + } + + /** Set Warehouse. + @param M_Warehouse_ID + Storage Warehouse and Service Point + */ + public void setM_Warehouse_ID (int M_Warehouse_ID) + { + if (M_Warehouse_ID < 1) + throw new IllegalArgumentException ("M_Warehouse_ID is mandatory."); + set_Value (COLUMNNAME_M_Warehouse_ID, Integer.valueOf(M_Warehouse_ID)); + } + + /** Get Warehouse. + @return Storage Warehouse and Service Point + */ + public int getM_Warehouse_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_M_Warehouse_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set OrderType. + @param OrderType OrderType */ + public void setOrderType (String OrderType) + { + + if (OrderType != null && OrderType.length() > 510) + { + log.warning("Length > 510 - truncated"); + OrderType = OrderType.substring(0, 510); + } + set_Value (COLUMNNAME_OrderType, OrderType); + } + + /** Get OrderType. + @return OrderType */ + public String getOrderType () + { + return (String)get_Value(COLUMNNAME_OrderType); + } + + /** Set Payment BPartner. + @param Pay_BPartner_ID + Business Partner responsible for the payment + */ + public void setPay_BPartner_ID (int Pay_BPartner_ID) + { + if (Pay_BPartner_ID < 1) + set_Value (COLUMNNAME_Pay_BPartner_ID, null); + else + set_Value (COLUMNNAME_Pay_BPartner_ID, Integer.valueOf(Pay_BPartner_ID)); + } + + /** Get Payment BPartner. + @return Business Partner responsible for the payment + */ + public int getPay_BPartner_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_Pay_BPartner_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set Payment Location. + @param Pay_Location_ID + Location of the Business Partner responsible for the payment + */ + public void setPay_Location_ID (int Pay_Location_ID) + { + if (Pay_Location_ID < 1) + set_Value (COLUMNNAME_Pay_Location_ID, null); + else + set_Value (COLUMNNAME_Pay_Location_ID, Integer.valueOf(Pay_Location_ID)); + } + + /** Get Payment Location. + @return Location of the Business Partner responsible for the payment + */ + public int getPay_Location_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_Pay_Location_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** PaymentRule AD_Reference_ID=195 */ + public static final int PAYMENTRULE_AD_Reference_ID=195; + /** Cash = B */ + public static final String PAYMENTRULE_Cash = "B"; + /** Credit Card = K */ + public static final String PAYMENTRULE_CreditCard = "K"; + /** Direct Deposit = T */ + public static final String PAYMENTRULE_DirectDeposit = "T"; + /** Check = S */ + public static final String PAYMENTRULE_Check = "S"; + /** On Credit = P */ + public static final String PAYMENTRULE_OnCredit = "P"; + /** Direct Debit = D */ + public static final String PAYMENTRULE_DirectDebit = "D"; + /** Mixed = M */ + public static final String PAYMENTRULE_Mixed = "M"; + /** Set Payment Rule. + @param PaymentRule + How you pay the invoice + */ + public void setPaymentRule (String PaymentRule) + { + if (PaymentRule == null) throw new IllegalArgumentException ("PaymentRule is mandatory"); + if (PaymentRule.equals("B") || PaymentRule.equals("K") || PaymentRule.equals("T") || PaymentRule.equals("S") || PaymentRule.equals("P") || PaymentRule.equals("D") || PaymentRule.equals("M")); else throw new IllegalArgumentException ("PaymentRule Invalid value - " + PaymentRule + " - Reference_ID=195 - B - K - T - S - P - D - M"); + if (PaymentRule.length() > 1) + { + log.warning("Length > 1 - truncated"); + PaymentRule = PaymentRule.substring(0, 1); + } + set_Value (COLUMNNAME_PaymentRule, PaymentRule); + } + + /** Get Payment Rule. + @return How you pay the invoice + */ + public String getPaymentRule () + { + return (String)get_Value(COLUMNNAME_PaymentRule); + } + + /** Set Order Reference. + @param POReference + Transaction Reference Number (Sales Order, Purchase Order) of your Business Partner + */ + public void setPOReference (String POReference) + { + + if (POReference != null && POReference.length() > 20) + { + log.warning("Length > 20 - truncated"); + POReference = POReference.substring(0, 20); + } + set_Value (COLUMNNAME_POReference, POReference); + } + + /** Get Order Reference. + @return Transaction Reference Number (Sales Order, Purchase Order) of your Business Partner + */ + public String getPOReference () + { + return (String)get_Value(COLUMNNAME_POReference); + } + + /** Set Posted. + @param Posted + Posting status + */ + public void setPosted (boolean Posted) + { + set_Value (COLUMNNAME_Posted, Boolean.valueOf(Posted)); + } + + /** Get Posted. + @return Posting status + */ + public boolean isPosted () + { + Object oo = get_Value(COLUMNNAME_Posted); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** PriorityRule AD_Reference_ID=154 */ + public static final int PRIORITYRULE_AD_Reference_ID=154; + /** High = 3 */ + public static final String PRIORITYRULE_High = "3"; + /** Medium = 5 */ + public static final String PRIORITYRULE_Medium = "5"; + /** Low = 7 */ + public static final String PRIORITYRULE_Low = "7"; + /** Urgent = 1 */ + public static final String PRIORITYRULE_Urgent = "1"; + /** Minor = 9 */ + public static final String PRIORITYRULE_Minor = "9"; + /** Set Priority. + @param PriorityRule + Priority of a document + */ + public void setPriorityRule (String PriorityRule) + { + if (PriorityRule == null) throw new IllegalArgumentException ("PriorityRule is mandatory"); + if (PriorityRule.equals("3") || PriorityRule.equals("5") || PriorityRule.equals("7") || PriorityRule.equals("1") || PriorityRule.equals("9")); else throw new IllegalArgumentException ("PriorityRule Invalid value - " + PriorityRule + " - Reference_ID=154 - 3 - 5 - 7 - 1 - 9"); + if (PriorityRule.length() > 1) + { + log.warning("Length > 1 - truncated"); + PriorityRule = PriorityRule.substring(0, 1); + } + set_Value (COLUMNNAME_PriorityRule, PriorityRule); + } + + /** Get Priority. + @return Priority of a document + */ + public String getPriorityRule () + { + return (String)get_Value(COLUMNNAME_PriorityRule); + } + + /** Set Processed. + @param Processed + The document has been processed + */ + public void setProcessed (boolean Processed) + { + set_ValueNoCheck (COLUMNNAME_Processed, Boolean.valueOf(Processed)); + } + + /** Get Processed. + @return The document has been processed + */ + public boolean isProcessed () + { + Object oo = get_Value(COLUMNNAME_Processed); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Process Now. + @param Processing Process Now */ + public void setProcessing (boolean Processing) + { + set_Value (COLUMNNAME_Processing, Boolean.valueOf(Processing)); + } + + /** Get Process Now. + @return Process Now */ + public boolean isProcessing () + { + Object oo = get_Value(COLUMNNAME_Processing); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Ref_Order_ID AD_Reference_ID=290 */ + public static final int REF_ORDER_ID_AD_Reference_ID=290; + /** Set Referenced Order. + @param Ref_Order_ID + Reference to corresponding Sales/Purchase Order + */ + public void setRef_Order_ID (int Ref_Order_ID) + { + if (Ref_Order_ID < 1) + set_Value (COLUMNNAME_Ref_Order_ID, null); + else + set_Value (COLUMNNAME_Ref_Order_ID, Integer.valueOf(Ref_Order_ID)); + } + + /** Get Referenced Order. + @return Reference to corresponding Sales/Purchase Order + */ + public int getRef_Order_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_Ref_Order_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** SalesRep_ID AD_Reference_ID=190 */ + public static final int SALESREP_ID_AD_Reference_ID=190; + /** Set Sales Representative. + @param SalesRep_ID + Sales Representative or Company Agent + */ + public void setSalesRep_ID (int SalesRep_ID) + { + if (SalesRep_ID < 1) + throw new IllegalArgumentException ("SalesRep_ID is mandatory."); + set_Value (COLUMNNAME_SalesRep_ID, Integer.valueOf(SalesRep_ID)); + } + + /** Get Sales Representative. + @return Sales Representative or Company Agent + */ + public int getSalesRep_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_SalesRep_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set Send EMail. + @param SendEMail + Enable sending Document EMail + */ + public void setSendEMail (boolean SendEMail) + { + set_Value (COLUMNNAME_SendEMail, Boolean.valueOf(SendEMail)); + } + + /** Get Send EMail. + @return Enable sending Document EMail + */ + public boolean isSendEMail () + { + Object oo = get_Value(COLUMNNAME_SendEMail); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Total Lines. + @param TotalLines + Total of all document lines + */ + public void setTotalLines (BigDecimal TotalLines) + { + if (TotalLines == null) + throw new IllegalArgumentException ("TotalLines is mandatory."); + set_ValueNoCheck (COLUMNNAME_TotalLines, TotalLines); + } + + /** Get Total Lines. + @return Total of all document lines + */ + public BigDecimal getTotalLines () + { + BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_TotalLines); + if (bd == null) + return Env.ZERO; + return bd; + } + + /** User1_ID AD_Reference_ID=134 */ + public static final int USER1_ID_AD_Reference_ID=134; + /** Set User List 1. + @param User1_ID + User defined list element #1 + */ + public void setUser1_ID (int User1_ID) + { + if (User1_ID < 1) + set_Value (COLUMNNAME_User1_ID, null); + else + set_Value (COLUMNNAME_User1_ID, Integer.valueOf(User1_ID)); + } + + /** Get User List 1. + @return User defined list element #1 + */ + public int getUser1_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_User1_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** User2_ID AD_Reference_ID=137 */ + public static final int USER2_ID_AD_Reference_ID=137; + /** Set User List 2. + @param User2_ID + User defined list element #2 + */ + public void setUser2_ID (int User2_ID) + { + if (User2_ID < 1) + set_Value (COLUMNNAME_User2_ID, null); + else + set_Value (COLUMNNAME_User2_ID, Integer.valueOf(User2_ID)); + } + + /** Get User List 2. + @return User defined list element #2 + */ + public int getUser2_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_User2_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set Volume. + @param Volume + Volume of a product + */ + public void setVolume (BigDecimal Volume) + { + set_Value (COLUMNNAME_Volume, Volume); + } + + /** Get Volume. + @return Volume of a product + */ + public BigDecimal getVolume () + { + BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_Volume); + if (bd == null) + return Env.ZERO; + return bd; + } + + /** Set Weight. + @param Weight + Weight of a product + */ + public void setWeight (BigDecimal Weight) + { + set_Value (COLUMNNAME_Weight, Weight); + } + + /** Get Weight. + @return Weight of a product + */ + public BigDecimal getWeight () + { + BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_Weight); + if (bd == null) + return Env.ZERO; + return bd; + } +} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/compiere/model/X_C_Payment.java b/posterita/posterita/src/main/org/compiere/model/X_C_Payment.java new file mode 100644 index 0000000000..7e73a76dcc --- /dev/null +++ b/posterita/posterita/src/main/org/compiere/model/X_C_Payment.java @@ -0,0 +1,2242 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2007 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program 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 General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +/** Generated Model - DO NOT CHANGE */ +package org.compiere.model; + +import java.lang.reflect.Constructor; +import java.math.BigDecimal; +import java.sql.ResultSet; +import java.sql.Timestamp; +import java.util.Properties; +import java.util.logging.Level; +import org.compiere.util.Env; +import org.compiere.util.KeyNamePair; + +/** Generated Model for C_Payment + * @author Adempiere (generated) + * @version Release 3.5.0 - $Id$ */ +public class X_C_Payment extends PO implements I_C_Payment, I_Persistent +{ + + /** + * + */ + private static final long serialVersionUID = 1L; + + /** Standard Constructor */ + public X_C_Payment (Properties ctx, int C_Payment_ID, String trxName) + { + super (ctx, C_Payment_ID, trxName); + /** if (C_Payment_ID == 0) + { + setC_BPartner_ID (0); + setC_BankAccount_ID (0); + setC_Currency_ID (0); + setC_DocType_ID (0); + setC_Payment_ID (0); + setDateAcct (new Timestamp(System.currentTimeMillis())); +// @#Date@ + setDateTrx (new Timestamp(System.currentTimeMillis())); +// @#Date@ + setDocAction (null); +// CO + setDocStatus (null); +// DR + setDocumentNo (null); + setIsAllocated (false); + setIsApproved (false); +// N + setIsDelayedCapture (false); + setIsOnline (false); + setIsOverUnderPayment (false); +// N + setIsPrepayment (false); + setIsReceipt (false); + setIsReconciled (false); + setIsSelfService (false); + setPayAmt (Env.ZERO); +// 0 + setPosted (false); +// N + setProcessed (false); + setTenderType (null); +// K + setTrxType (null); +// S + } */ + } + + /** Load Constructor */ + public X_C_Payment (Properties ctx, ResultSet rs, String trxName) + { + super (ctx, rs, trxName); + } + + /** AccessLevel + * @return 1 - Org + */ + protected int get_AccessLevel() + { + return accessLevel.intValue(); + } + + /** Load Meta Data */ + protected POInfo initPO (Properties ctx) + { + POInfo poi = POInfo.getPOInfo (ctx, Table_ID, get_TrxName()); + return poi; + } + + public String toString() + { + StringBuffer sb = new StringBuffer ("X_C_Payment[") + .append(get_ID()).append("]"); + return sb.toString(); + } + + /** AD_OrgTrx_ID AD_Reference_ID=130 */ + public static final int AD_ORGTRX_ID_AD_Reference_ID=130; + /** Set Trx Organization. + @param AD_OrgTrx_ID + Performing or initiating organization + */ + public void setAD_OrgTrx_ID (int AD_OrgTrx_ID) + { + if (AD_OrgTrx_ID < 1) + set_Value (COLUMNNAME_AD_OrgTrx_ID, null); + else + set_Value (COLUMNNAME_AD_OrgTrx_ID, Integer.valueOf(AD_OrgTrx_ID)); + } + + /** Get Trx Organization. + @return Performing or initiating organization + */ + public int getAD_OrgTrx_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_AD_OrgTrx_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set Account City. + @param A_City + City or the Credit Card or Account Holder + */ + public void setA_City (String A_City) + { + + if (A_City != null && A_City.length() > 60) + { + log.warning("Length > 60 - truncated"); + A_City = A_City.substring(0, 60); + } + set_Value (COLUMNNAME_A_City, A_City); + } + + /** Get Account City. + @return City or the Credit Card or Account Holder + */ + public String getA_City () + { + return (String)get_Value(COLUMNNAME_A_City); + } + + /** Set Account Country. + @param A_Country + Country + */ + public void setA_Country (String A_Country) + { + + if (A_Country != null && A_Country.length() > 40) + { + log.warning("Length > 40 - truncated"); + A_Country = A_Country.substring(0, 40); + } + set_Value (COLUMNNAME_A_Country, A_Country); + } + + /** Get Account Country. + @return Country + */ + public String getA_Country () + { + return (String)get_Value(COLUMNNAME_A_Country); + } + + /** Set Account EMail. + @param A_EMail + Email Address + */ + public void setA_EMail (String A_EMail) + { + + if (A_EMail != null && A_EMail.length() > 60) + { + log.warning("Length > 60 - truncated"); + A_EMail = A_EMail.substring(0, 60); + } + set_Value (COLUMNNAME_A_EMail, A_EMail); + } + + /** Get Account EMail. + @return Email Address + */ + public String getA_EMail () + { + return (String)get_Value(COLUMNNAME_A_EMail); + } + + /** Set Driver License. + @param A_Ident_DL + Payment Identification - Driver License + */ + public void setA_Ident_DL (String A_Ident_DL) + { + + if (A_Ident_DL != null && A_Ident_DL.length() > 20) + { + log.warning("Length > 20 - truncated"); + A_Ident_DL = A_Ident_DL.substring(0, 20); + } + set_Value (COLUMNNAME_A_Ident_DL, A_Ident_DL); + } + + /** Get Driver License. + @return Payment Identification - Driver License + */ + public String getA_Ident_DL () + { + return (String)get_Value(COLUMNNAME_A_Ident_DL); + } + + /** Set Social Security No. + @param A_Ident_SSN + Payment Identification - Social Security No + */ + public void setA_Ident_SSN (String A_Ident_SSN) + { + + if (A_Ident_SSN != null && A_Ident_SSN.length() > 20) + { + log.warning("Length > 20 - truncated"); + A_Ident_SSN = A_Ident_SSN.substring(0, 20); + } + set_Value (COLUMNNAME_A_Ident_SSN, A_Ident_SSN); + } + + /** Get Social Security No. + @return Payment Identification - Social Security No + */ + public String getA_Ident_SSN () + { + return (String)get_Value(COLUMNNAME_A_Ident_SSN); + } + + /** Set Account Name. + @param A_Name + Name on Credit Card or Account holder + */ + public void setA_Name (String A_Name) + { + + if (A_Name != null && A_Name.length() > 60) + { + log.warning("Length > 60 - truncated"); + A_Name = A_Name.substring(0, 60); + } + set_Value (COLUMNNAME_A_Name, A_Name); + } + + /** Get Account Name. + @return Name on Credit Card or Account holder + */ + public String getA_Name () + { + return (String)get_Value(COLUMNNAME_A_Name); + } + + /** Set Account State. + @param A_State + State of the Credit Card or Account holder + */ + public void setA_State (String A_State) + { + + if (A_State != null && A_State.length() > 40) + { + log.warning("Length > 40 - truncated"); + A_State = A_State.substring(0, 40); + } + set_Value (COLUMNNAME_A_State, A_State); + } + + /** Get Account State. + @return State of the Credit Card or Account holder + */ + public String getA_State () + { + return (String)get_Value(COLUMNNAME_A_State); + } + + /** Set Account Street. + @param A_Street + Street address of the Credit Card or Account holder + */ + public void setA_Street (String A_Street) + { + + if (A_Street != null && A_Street.length() > 60) + { + log.warning("Length > 60 - truncated"); + A_Street = A_Street.substring(0, 60); + } + set_Value (COLUMNNAME_A_Street, A_Street); + } + + /** Get Account Street. + @return Street address of the Credit Card or Account holder + */ + public String getA_Street () + { + return (String)get_Value(COLUMNNAME_A_Street); + } + + /** Set Account Zip/Postal. + @param A_Zip + Zip Code of the Credit Card or Account Holder + */ + public void setA_Zip (String A_Zip) + { + + if (A_Zip != null && A_Zip.length() > 20) + { + log.warning("Length > 20 - truncated"); + A_Zip = A_Zip.substring(0, 20); + } + set_Value (COLUMNNAME_A_Zip, A_Zip); + } + + /** Get Account Zip/Postal. + @return Zip Code of the Credit Card or Account Holder + */ + public String getA_Zip () + { + return (String)get_Value(COLUMNNAME_A_Zip); + } + + /** Set Account No. + @param AccountNo + Account Number + */ + public void setAccountNo (String AccountNo) + { + + if (AccountNo != null && AccountNo.length() > 20) + { + log.warning("Length > 20 - truncated"); + AccountNo = AccountNo.substring(0, 20); + } + set_Value (COLUMNNAME_AccountNo, AccountNo); + } + + /** Get Account No. + @return Account Number + */ + public String getAccountNo () + { + return (String)get_Value(COLUMNNAME_AccountNo); + } + + public I_C_Activity getC_Activity() throws Exception + { + Class clazz = MTable.getClass(I_C_Activity.Table_Name); + I_C_Activity result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_C_Activity)constructor.newInstance(new Object[] {getCtx(), new Integer(getC_Activity_ID()), get_TrxName()}); + } catch (Exception e) { + log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); + log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); + throw e; + } + return result; + } + + /** Set Activity. + @param C_Activity_ID + Business Activity + */ + public void setC_Activity_ID (int C_Activity_ID) + { + if (C_Activity_ID < 1) + set_Value (COLUMNNAME_C_Activity_ID, null); + else + set_Value (COLUMNNAME_C_Activity_ID, Integer.valueOf(C_Activity_ID)); + } + + /** Get Activity. + @return Business Activity + */ + public int getC_Activity_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_Activity_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + public I_C_BP_BankAccount getC_BP_BankAccount() throws Exception + { + Class clazz = MTable.getClass(I_C_BP_BankAccount.Table_Name); + I_C_BP_BankAccount result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_C_BP_BankAccount)constructor.newInstance(new Object[] {getCtx(), new Integer(getC_BP_BankAccount_ID()), get_TrxName()}); + } catch (Exception e) { + log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); + log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); + throw e; + } + return result; + } + + /** Set Partner Bank Account. + @param C_BP_BankAccount_ID + Bank Account of the Business Partner + */ + public void setC_BP_BankAccount_ID (int C_BP_BankAccount_ID) + { + if (C_BP_BankAccount_ID < 1) + set_Value (COLUMNNAME_C_BP_BankAccount_ID, null); + else + set_Value (COLUMNNAME_C_BP_BankAccount_ID, Integer.valueOf(C_BP_BankAccount_ID)); + } + + /** Get Partner Bank Account. + @return Bank Account of the Business Partner + */ + public int getC_BP_BankAccount_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_BP_BankAccount_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + public I_C_BPartner getC_BPartner() throws Exception + { + Class clazz = MTable.getClass(I_C_BPartner.Table_Name); + I_C_BPartner result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_C_BPartner)constructor.newInstance(new Object[] {getCtx(), new Integer(getC_BPartner_ID()), get_TrxName()}); + } catch (Exception e) { + log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); + log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); + throw e; + } + return result; + } + + /** Set Business Partner . + @param C_BPartner_ID + Identifies a Business Partner + */ + public void setC_BPartner_ID (int C_BPartner_ID) + { + if (C_BPartner_ID < 1) + throw new IllegalArgumentException ("C_BPartner_ID is mandatory."); + set_Value (COLUMNNAME_C_BPartner_ID, Integer.valueOf(C_BPartner_ID)); + } + + /** Get Business Partner . + @return Identifies a Business Partner + */ + public int getC_BPartner_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_BPartner_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + public I_C_BankAccount getC_BankAccount() throws Exception + { + Class clazz = MTable.getClass(I_C_BankAccount.Table_Name); + I_C_BankAccount result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_C_BankAccount)constructor.newInstance(new Object[] {getCtx(), new Integer(getC_BankAccount_ID()), get_TrxName()}); + } catch (Exception e) { + log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); + log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); + throw e; + } + return result; + } + + /** Set Bank Account. + @param C_BankAccount_ID + Account at the Bank + */ + public void setC_BankAccount_ID (int C_BankAccount_ID) + { + if (C_BankAccount_ID < 1) + set_Value (COLUMNNAME_C_BankAccount_ID, null); + else + set_Value (COLUMNNAME_C_BankAccount_ID, Integer.valueOf(C_BankAccount_ID)); + } + + /** Get Bank Account. + @return Account at the Bank + */ + public int getC_BankAccount_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_BankAccount_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + public I_C_Campaign getC_Campaign() throws Exception + { + Class clazz = MTable.getClass(I_C_Campaign.Table_Name); + I_C_Campaign result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_C_Campaign)constructor.newInstance(new Object[] {getCtx(), new Integer(getC_Campaign_ID()), get_TrxName()}); + } catch (Exception e) { + log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); + log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); + throw e; + } + return result; + } + + /** Set Campaign. + @param C_Campaign_ID + Marketing Campaign + */ + public void setC_Campaign_ID (int C_Campaign_ID) + { + if (C_Campaign_ID < 1) + set_Value (COLUMNNAME_C_Campaign_ID, null); + else + set_Value (COLUMNNAME_C_Campaign_ID, Integer.valueOf(C_Campaign_ID)); + } + + /** Get Campaign. + @return Marketing Campaign + */ + public int getC_Campaign_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_Campaign_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + public I_C_CashBook getC_CashBook() throws Exception + { + Class clazz = MTable.getClass(I_C_CashBook.Table_Name); + I_C_CashBook result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_C_CashBook)constructor.newInstance(new Object[] {getCtx(), new Integer(getC_CashBook_ID()), get_TrxName()}); + } catch (Exception e) { + log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); + log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); + throw e; + } + return result; + } + + /** Set Cash Book. + @param C_CashBook_ID + Cash Book for recording petty cash transactions + */ + public void setC_CashBook_ID (int C_CashBook_ID) + { + if (C_CashBook_ID < 1) + set_Value (COLUMNNAME_C_CashBook_ID, null); + else + set_Value (COLUMNNAME_C_CashBook_ID, Integer.valueOf(C_CashBook_ID)); + } + + /** Get Cash Book. + @return Cash Book for recording petty cash transactions + */ + public int getC_CashBook_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_CashBook_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + public I_C_Charge getC_Charge() throws Exception + { + Class clazz = MTable.getClass(I_C_Charge.Table_Name); + I_C_Charge result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_C_Charge)constructor.newInstance(new Object[] {getCtx(), new Integer(getC_Charge_ID()), get_TrxName()}); + } catch (Exception e) { + log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); + log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); + throw e; + } + return result; + } + + /** Set Charge. + @param C_Charge_ID + Additional document charges + */ + public void setC_Charge_ID (int C_Charge_ID) + { + if (C_Charge_ID < 1) + set_Value (COLUMNNAME_C_Charge_ID, null); + else + set_Value (COLUMNNAME_C_Charge_ID, Integer.valueOf(C_Charge_ID)); + } + + /** Get Charge. + @return Additional document charges + */ + public int getC_Charge_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_Charge_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + public I_C_ConversionType getC_ConversionType() throws Exception + { + Class clazz = MTable.getClass(I_C_ConversionType.Table_Name); + I_C_ConversionType result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_C_ConversionType)constructor.newInstance(new Object[] {getCtx(), new Integer(getC_ConversionType_ID()), get_TrxName()}); + } catch (Exception e) { + log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); + log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); + throw e; + } + return result; + } + + /** Set Currency Type. + @param C_ConversionType_ID + Currency Conversion Rate Type + */ + public void setC_ConversionType_ID (int C_ConversionType_ID) + { + if (C_ConversionType_ID < 1) + set_Value (COLUMNNAME_C_ConversionType_ID, null); + else + set_Value (COLUMNNAME_C_ConversionType_ID, Integer.valueOf(C_ConversionType_ID)); + } + + /** Get Currency Type. + @return Currency Conversion Rate Type + */ + public int getC_ConversionType_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_ConversionType_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + public I_C_Currency getC_Currency() throws Exception + { + Class clazz = MTable.getClass(I_C_Currency.Table_Name); + I_C_Currency result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_C_Currency)constructor.newInstance(new Object[] {getCtx(), new Integer(getC_Currency_ID()), get_TrxName()}); + } catch (Exception e) { + log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); + log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); + throw e; + } + return result; + } + + /** Set Currency. + @param C_Currency_ID + The Currency for this record + */ + public void setC_Currency_ID (int C_Currency_ID) + { + if (C_Currency_ID < 1) + throw new IllegalArgumentException ("C_Currency_ID is mandatory."); + set_Value (COLUMNNAME_C_Currency_ID, Integer.valueOf(C_Currency_ID)); + } + + /** Get Currency. + @return The Currency for this record + */ + public int getC_Currency_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_Currency_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + public I_C_DocType getC_DocType() throws Exception + { + Class clazz = MTable.getClass(I_C_DocType.Table_Name); + I_C_DocType result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_C_DocType)constructor.newInstance(new Object[] {getCtx(), new Integer(getC_DocType_ID()), get_TrxName()}); + } catch (Exception e) { + log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); + log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); + throw e; + } + return result; + } + + /** Set Document Type. + @param C_DocType_ID + Document type or rules + */ + public void setC_DocType_ID (int C_DocType_ID) + { + if (C_DocType_ID < 0) + throw new IllegalArgumentException ("C_DocType_ID is mandatory."); + set_Value (COLUMNNAME_C_DocType_ID, Integer.valueOf(C_DocType_ID)); + } + + /** Get Document Type. + @return Document type or rules + */ + public int getC_DocType_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_DocType_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + public I_C_Invoice getC_Invoice() throws Exception + { + Class clazz = MTable.getClass(I_C_Invoice.Table_Name); + I_C_Invoice result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_C_Invoice)constructor.newInstance(new Object[] {getCtx(), new Integer(getC_Invoice_ID()), get_TrxName()}); + } catch (Exception e) { + log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); + log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); + throw e; + } + return result; + } + + /** Set Invoice. + @param C_Invoice_ID + Invoice Identifier + */ + public void setC_Invoice_ID (int C_Invoice_ID) + { + if (C_Invoice_ID < 1) + set_Value (COLUMNNAME_C_Invoice_ID, null); + else + set_Value (COLUMNNAME_C_Invoice_ID, Integer.valueOf(C_Invoice_ID)); + } + + /** Get Invoice. + @return Invoice Identifier + */ + public int getC_Invoice_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_Invoice_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + public I_C_Order getC_Order() throws Exception + { + Class clazz = MTable.getClass(I_C_Order.Table_Name); + I_C_Order result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_C_Order)constructor.newInstance(new Object[] {getCtx(), new Integer(getC_Order_ID()), get_TrxName()}); + } catch (Exception e) { + log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); + log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); + throw e; + } + return result; + } + + /** Set Order. + @param C_Order_ID + Order + */ + public void setC_Order_ID (int C_Order_ID) + { + if (C_Order_ID < 1) + set_Value (COLUMNNAME_C_Order_ID, null); + else + set_Value (COLUMNNAME_C_Order_ID, Integer.valueOf(C_Order_ID)); + } + + /** Get Order. + @return Order + */ + public int getC_Order_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_Order_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + public I_C_PaymentBatch getC_PaymentBatch() throws Exception + { + Class clazz = MTable.getClass(I_C_PaymentBatch.Table_Name); + I_C_PaymentBatch result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_C_PaymentBatch)constructor.newInstance(new Object[] {getCtx(), new Integer(getC_PaymentBatch_ID()), get_TrxName()}); + } catch (Exception e) { + log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); + log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); + throw e; + } + return result; + } + + /** Set Payment Batch. + @param C_PaymentBatch_ID + Payment batch for EFT + */ + public void setC_PaymentBatch_ID (int C_PaymentBatch_ID) + { + if (C_PaymentBatch_ID < 1) + set_Value (COLUMNNAME_C_PaymentBatch_ID, null); + else + set_Value (COLUMNNAME_C_PaymentBatch_ID, Integer.valueOf(C_PaymentBatch_ID)); + } + + /** Get Payment Batch. + @return Payment batch for EFT + */ + public int getC_PaymentBatch_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_PaymentBatch_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set Payment. + @param C_Payment_ID + Payment identifier + */ + public void setC_Payment_ID (int C_Payment_ID) + { + if (C_Payment_ID < 1) + throw new IllegalArgumentException ("C_Payment_ID is mandatory."); + set_ValueNoCheck (COLUMNNAME_C_Payment_ID, Integer.valueOf(C_Payment_ID)); + } + + /** Get Payment. + @return Payment identifier + */ + public int getC_Payment_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_Payment_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + public I_C_Project getC_Project() throws Exception + { + Class clazz = MTable.getClass(I_C_Project.Table_Name); + I_C_Project result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_C_Project)constructor.newInstance(new Object[] {getCtx(), new Integer(getC_Project_ID()), get_TrxName()}); + } catch (Exception e) { + log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); + log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); + throw e; + } + return result; + } + + /** Set Project. + @param C_Project_ID + Financial Project + */ + public void setC_Project_ID (int C_Project_ID) + { + if (C_Project_ID < 1) + set_Value (COLUMNNAME_C_Project_ID, null); + else + set_Value (COLUMNNAME_C_Project_ID, Integer.valueOf(C_Project_ID)); + } + + /** Get Project. + @return Financial Project + */ + public int getC_Project_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_Project_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set Charge amount. + @param ChargeAmt + Charge Amount + */ + public void setChargeAmt (BigDecimal ChargeAmt) + { + set_Value (COLUMNNAME_ChargeAmt, ChargeAmt); + } + + /** Get Charge amount. + @return Charge Amount + */ + public BigDecimal getChargeAmt () + { + BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_ChargeAmt); + if (bd == null) + return Env.ZERO; + return bd; + } + + /** Set Check No. + @param CheckNo + Check Number + */ + public void setCheckNo (String CheckNo) + { + + if (CheckNo != null && CheckNo.length() > 20) + { + log.warning("Length > 20 - truncated"); + CheckNo = CheckNo.substring(0, 20); + } + set_Value (COLUMNNAME_CheckNo, CheckNo); + } + + /** Get Check No. + @return Check Number + */ + public String getCheckNo () + { + return (String)get_Value(COLUMNNAME_CheckNo); + } + + /** Set Exp. Month. + @param CreditCardExpMM + Expiry Month + */ + public void setCreditCardExpMM (int CreditCardExpMM) + { + set_Value (COLUMNNAME_CreditCardExpMM, Integer.valueOf(CreditCardExpMM)); + } + + /** Get Exp. Month. + @return Expiry Month + */ + public int getCreditCardExpMM () + { + Integer ii = (Integer)get_Value(COLUMNNAME_CreditCardExpMM); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set Exp. Year. + @param CreditCardExpYY + Expiry Year + */ + public void setCreditCardExpYY (int CreditCardExpYY) + { + set_Value (COLUMNNAME_CreditCardExpYY, Integer.valueOf(CreditCardExpYY)); + } + + /** Get Exp. Year. + @return Expiry Year + */ + public int getCreditCardExpYY () + { + Integer ii = (Integer)get_Value(COLUMNNAME_CreditCardExpYY); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set Number. + @param CreditCardNumber + Credit Card Number + */ + public void setCreditCardNumber (String CreditCardNumber) + { + + if (CreditCardNumber != null && CreditCardNumber.length() > 20) + { + log.warning("Length > 20 - truncated"); + CreditCardNumber = CreditCardNumber.substring(0, 20); + } + set_Value (COLUMNNAME_CreditCardNumber, CreditCardNumber); + } + + /** Get Number. + @return Credit Card Number + */ + public String getCreditCardNumber () + { + return (String)get_Value(COLUMNNAME_CreditCardNumber); + } + + /** CreditCardType AD_Reference_ID=149 */ + public static final int CREDITCARDTYPE_AD_Reference_ID=149; + /** Amex = A */ + public static final String CREDITCARDTYPE_Amex = "A"; + /** MasterCard = M */ + public static final String CREDITCARDTYPE_MasterCard = "M"; + /** Visa = V */ + public static final String CREDITCARDTYPE_Visa = "V"; + /** ATM = C */ + public static final String CREDITCARDTYPE_ATM = "C"; + /** Diners = D */ + public static final String CREDITCARDTYPE_Diners = "D"; + /** Discover = N */ + public static final String CREDITCARDTYPE_Discover = "N"; + /** Purchase Card = P */ + public static final String CREDITCARDTYPE_PurchaseCard = "P"; + /** Set Credit Card. + @param CreditCardType + Credit Card (Visa, MC, AmEx) + */ + public void setCreditCardType (String CreditCardType) + { + + if (CreditCardType == null || CreditCardType.equals("A") || CreditCardType.equals("M") || CreditCardType.equals("V") || CreditCardType.equals("C") || CreditCardType.equals("D") || CreditCardType.equals("N") || CreditCardType.equals("P")); else throw new IllegalArgumentException ("CreditCardType Invalid value - " + CreditCardType + " - Reference_ID=149 - A - M - V - C - D - N - P"); + if (CreditCardType != null && CreditCardType.length() > 1) + { + log.warning("Length > 1 - truncated"); + CreditCardType = CreditCardType.substring(0, 1); + } + set_Value (COLUMNNAME_CreditCardType, CreditCardType); + } + + /** Get Credit Card. + @return Credit Card (Visa, MC, AmEx) + */ + public String getCreditCardType () + { + return (String)get_Value(COLUMNNAME_CreditCardType); + } + + /** Set Verification Code. + @param CreditCardVV + Credit Card Verification code on credit card + */ + public void setCreditCardVV (String CreditCardVV) + { + + if (CreditCardVV != null && CreditCardVV.length() > 4) + { + log.warning("Length > 4 - truncated"); + CreditCardVV = CreditCardVV.substring(0, 4); + } + set_Value (COLUMNNAME_CreditCardVV, CreditCardVV); + } + + /** Get Verification Code. + @return Credit Card Verification code on credit card + */ + public String getCreditCardVV () + { + return (String)get_Value(COLUMNNAME_CreditCardVV); + } + + /** Set Account Date. + @param DateAcct + Accounting Date + */ + public void setDateAcct (Timestamp DateAcct) + { + if (DateAcct == null) + throw new IllegalArgumentException ("DateAcct is mandatory."); + set_Value (COLUMNNAME_DateAcct, DateAcct); + } + + /** Get Account Date. + @return Accounting Date + */ + public Timestamp getDateAcct () + { + return (Timestamp)get_Value(COLUMNNAME_DateAcct); + } + + /** Set Transaction Date. + @param DateTrx + Transaction Date + */ + public void setDateTrx (Timestamp DateTrx) + { + if (DateTrx == null) + throw new IllegalArgumentException ("DateTrx is mandatory."); + set_Value (COLUMNNAME_DateTrx, DateTrx); + } + + /** Get Transaction Date. + @return Transaction Date + */ + public Timestamp getDateTrx () + { + return (Timestamp)get_Value(COLUMNNAME_DateTrx); + } + + /** Set Description. + @param Description + Optional short description of the record + */ + public void setDescription (String Description) + { + + if (Description != null && Description.length() > 255) + { + log.warning("Length > 255 - truncated"); + Description = Description.substring(0, 255); + } + set_Value (COLUMNNAME_Description, Description); + } + + /** Get Description. + @return Optional short description of the record + */ + public String getDescription () + { + return (String)get_Value(COLUMNNAME_Description); + } + + /** Set Discount Amount. + @param DiscountAmt + Calculated amount of discount + */ + public void setDiscountAmt (BigDecimal DiscountAmt) + { + set_Value (COLUMNNAME_DiscountAmt, DiscountAmt); + } + + /** Get Discount Amount. + @return Calculated amount of discount + */ + public BigDecimal getDiscountAmt () + { + BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_DiscountAmt); + if (bd == null) + return Env.ZERO; + return bd; + } + + /** DocAction AD_Reference_ID=135 */ + public static final int DOCACTION_AD_Reference_ID=135; + /** Complete = CO */ + public static final String DOCACTION_Complete = "CO"; + /** Approve = AP */ + public static final String DOCACTION_Approve = "AP"; + /** Reject = RJ */ + public static final String DOCACTION_Reject = "RJ"; + /** Post = PO */ + public static final String DOCACTION_Post = "PO"; + /** Void = VO */ + public static final String DOCACTION_Void = "VO"; + /** Close = CL */ + public static final String DOCACTION_Close = "CL"; + /** Reverse - Correct = RC */ + public static final String DOCACTION_Reverse_Correct = "RC"; + /** Reverse - Accrual = RA */ + public static final String DOCACTION_Reverse_Accrual = "RA"; + /** Invalidate = IN */ + public static final String DOCACTION_Invalidate = "IN"; + /** Re-activate = RE */ + public static final String DOCACTION_Re_Activate = "RE"; + /** = -- */ + public static final String DOCACTION_None = "--"; + /** Prepare = PR */ + public static final String DOCACTION_Prepare = "PR"; + /** Unlock = XL */ + public static final String DOCACTION_Unlock = "XL"; + /** Wait Complete = WC */ + public static final String DOCACTION_WaitComplete = "WC"; + /** Set Document Action. + @param DocAction + The targeted status of the document + */ + public void setDocAction (String DocAction) + { + if (DocAction == null) throw new IllegalArgumentException ("DocAction is mandatory"); + if (DocAction.equals("CO") || DocAction.equals("AP") || DocAction.equals("RJ") || DocAction.equals("PO") || DocAction.equals("VO") || DocAction.equals("CL") || DocAction.equals("RC") || DocAction.equals("RA") || DocAction.equals("IN") || DocAction.equals("RE") || DocAction.equals("--") || DocAction.equals("PR") || DocAction.equals("XL") || DocAction.equals("WC")); else throw new IllegalArgumentException ("DocAction Invalid value - " + DocAction + " - Reference_ID=135 - CO - AP - RJ - PO - VO - CL - RC - RA - IN - RE - -- - PR - XL - WC"); + if (DocAction.length() > 2) + { + log.warning("Length > 2 - truncated"); + DocAction = DocAction.substring(0, 2); + } + set_Value (COLUMNNAME_DocAction, DocAction); + } + + /** Get Document Action. + @return The targeted status of the document + */ + public String getDocAction () + { + return (String)get_Value(COLUMNNAME_DocAction); + } + + /** DocStatus AD_Reference_ID=131 */ + public static final int DOCSTATUS_AD_Reference_ID=131; + /** Drafted = DR */ + public static final String DOCSTATUS_Drafted = "DR"; + /** Completed = CO */ + public static final String DOCSTATUS_Completed = "CO"; + /** Approved = AP */ + public static final String DOCSTATUS_Approved = "AP"; + /** Not Approved = NA */ + public static final String DOCSTATUS_NotApproved = "NA"; + /** Voided = VO */ + public static final String DOCSTATUS_Voided = "VO"; + /** Invalid = IN */ + public static final String DOCSTATUS_Invalid = "IN"; + /** Reversed = RE */ + public static final String DOCSTATUS_Reversed = "RE"; + /** Closed = CL */ + public static final String DOCSTATUS_Closed = "CL"; + /** Unknown = ?? */ + public static final String DOCSTATUS_Unknown = "??"; + /** In Progress = IP */ + public static final String DOCSTATUS_InProgress = "IP"; + /** Waiting Payment = WP */ + public static final String DOCSTATUS_WaitingPayment = "WP"; + /** Waiting Confirmation = WC */ + public static final String DOCSTATUS_WaitingConfirmation = "WC"; + /** Set Document Status. + @param DocStatus + The current status of the document + */ + public void setDocStatus (String DocStatus) + { + if (DocStatus == null) throw new IllegalArgumentException ("DocStatus is mandatory"); + if (DocStatus.equals("DR") || DocStatus.equals("CO") || DocStatus.equals("AP") || DocStatus.equals("NA") || DocStatus.equals("VO") || DocStatus.equals("IN") || DocStatus.equals("RE") || DocStatus.equals("CL") || DocStatus.equals("??") || DocStatus.equals("IP") || DocStatus.equals("WP") || DocStatus.equals("WC")); else throw new IllegalArgumentException ("DocStatus Invalid value - " + DocStatus + " - Reference_ID=131 - DR - CO - AP - NA - VO - IN - RE - CL - ?? - IP - WP - WC"); + if (DocStatus.length() > 2) + { + log.warning("Length > 2 - truncated"); + DocStatus = DocStatus.substring(0, 2); + } + set_Value (COLUMNNAME_DocStatus, DocStatus); + } + + /** Get Document Status. + @return The current status of the document + */ + public String getDocStatus () + { + return (String)get_Value(COLUMNNAME_DocStatus); + } + + /** Set Document No. + @param DocumentNo + Document sequence number of the document + */ + public void setDocumentNo (String DocumentNo) + { + if (DocumentNo == null) + throw new IllegalArgumentException ("DocumentNo is mandatory."); + + if (DocumentNo.length() > 30) + { + log.warning("Length > 30 - truncated"); + DocumentNo = DocumentNo.substring(0, 30); + } + set_Value (COLUMNNAME_DocumentNo, DocumentNo); + } + + /** Get Document No. + @return Document sequence number of the document + */ + public String getDocumentNo () + { + return (String)get_Value(COLUMNNAME_DocumentNo); + } + + /** Get Record ID/ColumnName + @return ID/ColumnName pair + */ + public KeyNamePair getKeyNamePair() + { + return new KeyNamePair(get_ID(), getDocumentNo()); + } + + /** Set Allocated. + @param IsAllocated + Indicates if the payment has been allocated + */ + public void setIsAllocated (boolean IsAllocated) + { + set_Value (COLUMNNAME_IsAllocated, Boolean.valueOf(IsAllocated)); + } + + /** Get Allocated. + @return Indicates if the payment has been allocated + */ + public boolean isAllocated () + { + Object oo = get_Value(COLUMNNAME_IsAllocated); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Approved. + @param IsApproved + Indicates if this document requires approval + */ + public void setIsApproved (boolean IsApproved) + { + set_ValueNoCheck (COLUMNNAME_IsApproved, Boolean.valueOf(IsApproved)); + } + + /** Get Approved. + @return Indicates if this document requires approval + */ + public boolean isApproved () + { + Object oo = get_Value(COLUMNNAME_IsApproved); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Delayed Capture. + @param IsDelayedCapture + Charge after Shipment + */ + public void setIsDelayedCapture (boolean IsDelayedCapture) + { + set_Value (COLUMNNAME_IsDelayedCapture, Boolean.valueOf(IsDelayedCapture)); + } + + /** Get Delayed Capture. + @return Charge after Shipment + */ + public boolean isDelayedCapture () + { + Object oo = get_Value(COLUMNNAME_IsDelayedCapture); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Online Access. + @param IsOnline + Can be accessed online + */ + public void setIsOnline (boolean IsOnline) + { + set_Value (COLUMNNAME_IsOnline, Boolean.valueOf(IsOnline)); + } + + /** Get Online Access. + @return Can be accessed online + */ + public boolean isOnline () + { + Object oo = get_Value(COLUMNNAME_IsOnline); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Over/Under Payment. + @param IsOverUnderPayment + Over-Payment (unallocated) or Under-Payment (partial payment) + */ + public void setIsOverUnderPayment (boolean IsOverUnderPayment) + { + set_Value (COLUMNNAME_IsOverUnderPayment, Boolean.valueOf(IsOverUnderPayment)); + } + + /** Get Over/Under Payment. + @return Over-Payment (unallocated) or Under-Payment (partial payment) + */ + public boolean isOverUnderPayment () + { + Object oo = get_Value(COLUMNNAME_IsOverUnderPayment); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Prepayment. + @param IsPrepayment + The Payment/Receipt is a Prepayment + */ + public void setIsPrepayment (boolean IsPrepayment) + { + set_Value (COLUMNNAME_IsPrepayment, Boolean.valueOf(IsPrepayment)); + } + + /** Get Prepayment. + @return The Payment/Receipt is a Prepayment + */ + public boolean isPrepayment () + { + Object oo = get_Value(COLUMNNAME_IsPrepayment); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Receipt. + @param IsReceipt + This is a sales transaction (receipt) + */ + public void setIsReceipt (boolean IsReceipt) + { + set_Value (COLUMNNAME_IsReceipt, Boolean.valueOf(IsReceipt)); + } + + /** Get Receipt. + @return This is a sales transaction (receipt) + */ + public boolean isReceipt () + { + Object oo = get_Value(COLUMNNAME_IsReceipt); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Reconciled. + @param IsReconciled + Payment is reconciled with bank statement + */ + public void setIsReconciled (boolean IsReconciled) + { + set_Value (COLUMNNAME_IsReconciled, Boolean.valueOf(IsReconciled)); + } + + /** Get Reconciled. + @return Payment is reconciled with bank statement + */ + public boolean isReconciled () + { + Object oo = get_Value(COLUMNNAME_IsReconciled); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Self-Service. + @param IsSelfService + This is a Self-Service entry or this entry can be changed via Self-Service + */ + public void setIsSelfService (boolean IsSelfService) + { + set_Value (COLUMNNAME_IsSelfService, Boolean.valueOf(IsSelfService)); + } + + /** Get Self-Service. + @return This is a Self-Service entry or this entry can be changed via Self-Service + */ + public boolean isSelfService () + { + Object oo = get_Value(COLUMNNAME_IsSelfService); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Micr. + @param Micr + Combination of routing no, account and check no + */ + public void setMicr (String Micr) + { + + if (Micr != null && Micr.length() > 20) + { + log.warning("Length > 20 - truncated"); + Micr = Micr.substring(0, 20); + } + set_Value (COLUMNNAME_Micr, Micr); + } + + /** Get Micr. + @return Combination of routing no, account and check no + */ + public String getMicr () + { + return (String)get_Value(COLUMNNAME_Micr); + } + + /** Set Online Processing. + @param OProcessing + This payment can be processed online + */ + public void setOProcessing (String OProcessing) + { + + if (OProcessing != null && OProcessing.length() > 1) + { + log.warning("Length > 1 - truncated"); + OProcessing = OProcessing.substring(0, 1); + } + set_Value (COLUMNNAME_OProcessing, OProcessing); + } + + /** Get Online Processing. + @return This payment can be processed online + */ + public String getOProcessing () + { + return (String)get_Value(COLUMNNAME_OProcessing); + } + + /** Set Original Transaction ID. + @param Orig_TrxID + Original Transaction ID + */ + public void setOrig_TrxID (String Orig_TrxID) + { + + if (Orig_TrxID != null && Orig_TrxID.length() > 20) + { + log.warning("Length > 20 - truncated"); + Orig_TrxID = Orig_TrxID.substring(0, 20); + } + set_Value (COLUMNNAME_Orig_TrxID, Orig_TrxID); + } + + /** Get Original Transaction ID. + @return Original Transaction ID + */ + public String getOrig_TrxID () + { + return (String)get_Value(COLUMNNAME_Orig_TrxID); + } + + /** Set Over/Under Payment. + @param OverUnderAmt + Over-Payment (unallocated) or Under-Payment (partial payment) Amount + */ + public void setOverUnderAmt (BigDecimal OverUnderAmt) + { + set_Value (COLUMNNAME_OverUnderAmt, OverUnderAmt); + } + + /** Get Over/Under Payment. + @return Over-Payment (unallocated) or Under-Payment (partial payment) Amount + */ + public BigDecimal getOverUnderAmt () + { + BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_OverUnderAmt); + if (bd == null) + return Env.ZERO; + return bd; + } + + /** Set PO Number. + @param PONum + Purchase Order Number + */ + public void setPONum (String PONum) + { + + if (PONum != null && PONum.length() > 60) + { + log.warning("Length > 60 - truncated"); + PONum = PONum.substring(0, 60); + } + set_Value (COLUMNNAME_PONum, PONum); + } + + /** Get PO Number. + @return Purchase Order Number + */ + public String getPONum () + { + return (String)get_Value(COLUMNNAME_PONum); + } + + /** Set Payment amount. + @param PayAmt + Amount being paid + */ + public void setPayAmt (BigDecimal PayAmt) + { + if (PayAmt == null) + throw new IllegalArgumentException ("PayAmt is mandatory."); + set_Value (COLUMNNAME_PayAmt, PayAmt); + } + + /** Get Payment amount. + @return Amount being paid + */ + public BigDecimal getPayAmt () + { + BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_PayAmt); + if (bd == null) + return Env.ZERO; + return bd; + } + + /** Set Posted. + @param Posted + Posting status + */ + public void setPosted (boolean Posted) + { + set_Value (COLUMNNAME_Posted, Boolean.valueOf(Posted)); + } + + /** Get Posted. + @return Posting status + */ + public boolean isPosted () + { + Object oo = get_Value(COLUMNNAME_Posted); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Processed. + @param Processed + The document has been processed + */ + public void setProcessed (boolean Processed) + { + set_Value (COLUMNNAME_Processed, Boolean.valueOf(Processed)); + } + + /** Get Processed. + @return The document has been processed + */ + public boolean isProcessed () + { + Object oo = get_Value(COLUMNNAME_Processed); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Process Now. + @param Processing Process Now */ + public void setProcessing (boolean Processing) + { + set_Value (COLUMNNAME_Processing, Boolean.valueOf(Processing)); + } + + /** Get Process Now. + @return Process Now */ + public boolean isProcessing () + { + Object oo = get_Value(COLUMNNAME_Processing); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Authorization Code. + @param R_AuthCode + Authorization Code returned + */ + public void setR_AuthCode (String R_AuthCode) + { + + if (R_AuthCode != null && R_AuthCode.length() > 20) + { + log.warning("Length > 20 - truncated"); + R_AuthCode = R_AuthCode.substring(0, 20); + } + set_ValueNoCheck (COLUMNNAME_R_AuthCode, R_AuthCode); + } + + /** Get Authorization Code. + @return Authorization Code returned + */ + public String getR_AuthCode () + { + return (String)get_Value(COLUMNNAME_R_AuthCode); + } + + /** Set Authorization Code (DC). + @param R_AuthCode_DC + Authorization Code Delayed Capture returned + */ + public void setR_AuthCode_DC (String R_AuthCode_DC) + { + + if (R_AuthCode_DC != null && R_AuthCode_DC.length() > 20) + { + log.warning("Length > 20 - truncated"); + R_AuthCode_DC = R_AuthCode_DC.substring(0, 20); + } + set_ValueNoCheck (COLUMNNAME_R_AuthCode_DC, R_AuthCode_DC); + } + + /** Get Authorization Code (DC). + @return Authorization Code Delayed Capture returned + */ + public String getR_AuthCode_DC () + { + return (String)get_Value(COLUMNNAME_R_AuthCode_DC); + } + + /** R_AvsAddr AD_Reference_ID=213 */ + public static final int R_AVSADDR_AD_Reference_ID=213; + /** Match = Y */ + public static final String R_AVSADDR_Match = "Y"; + /** No Match = N */ + public static final String R_AVSADDR_NoMatch = "N"; + /** Unavailable = X */ + public static final String R_AVSADDR_Unavailable = "X"; + /** Set Address verified. + @param R_AvsAddr + This address has been verified + */ + public void setR_AvsAddr (String R_AvsAddr) + { + + if (R_AvsAddr == null || R_AvsAddr.equals("Y") || R_AvsAddr.equals("N") || R_AvsAddr.equals("X")); else throw new IllegalArgumentException ("R_AvsAddr Invalid value - " + R_AvsAddr + " - Reference_ID=213 - Y - N - X"); + if (R_AvsAddr != null && R_AvsAddr.length() > 1) + { + log.warning("Length > 1 - truncated"); + R_AvsAddr = R_AvsAddr.substring(0, 1); + } + set_ValueNoCheck (COLUMNNAME_R_AvsAddr, R_AvsAddr); + } + + /** Get Address verified. + @return This address has been verified + */ + public String getR_AvsAddr () + { + return (String)get_Value(COLUMNNAME_R_AvsAddr); + } + + /** R_AvsZip AD_Reference_ID=213 */ + public static final int R_AVSZIP_AD_Reference_ID=213; + /** Match = Y */ + public static final String R_AVSZIP_Match = "Y"; + /** No Match = N */ + public static final String R_AVSZIP_NoMatch = "N"; + /** Unavailable = X */ + public static final String R_AVSZIP_Unavailable = "X"; + /** Set Zip verified. + @param R_AvsZip + The Zip Code has been verified + */ + public void setR_AvsZip (String R_AvsZip) + { + + if (R_AvsZip == null || R_AvsZip.equals("Y") || R_AvsZip.equals("N") || R_AvsZip.equals("X")); else throw new IllegalArgumentException ("R_AvsZip Invalid value - " + R_AvsZip + " - Reference_ID=213 - Y - N - X"); + if (R_AvsZip != null && R_AvsZip.length() > 1) + { + log.warning("Length > 1 - truncated"); + R_AvsZip = R_AvsZip.substring(0, 1); + } + set_ValueNoCheck (COLUMNNAME_R_AvsZip, R_AvsZip); + } + + /** Get Zip verified. + @return The Zip Code has been verified + */ + public String getR_AvsZip () + { + return (String)get_Value(COLUMNNAME_R_AvsZip); + } + + /** Set CVV Match. + @param R_CVV2Match + Credit Card Verification Code Match + */ + public void setR_CVV2Match (boolean R_CVV2Match) + { + set_ValueNoCheck (COLUMNNAME_R_CVV2Match, Boolean.valueOf(R_CVV2Match)); + } + + /** Get CVV Match. + @return Credit Card Verification Code Match + */ + public boolean isR_CVV2Match () + { + Object oo = get_Value(COLUMNNAME_R_CVV2Match); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Info. + @param R_Info + Response info + */ + public void setR_Info (String R_Info) + { + + if (R_Info != null && R_Info.length() > 2000) + { + log.warning("Length > 2000 - truncated"); + R_Info = R_Info.substring(0, 2000); + } + set_ValueNoCheck (COLUMNNAME_R_Info, R_Info); + } + + /** Get Info. + @return Response info + */ + public String getR_Info () + { + return (String)get_Value(COLUMNNAME_R_Info); + } + + /** Set Reference. + @param R_PnRef + Payment reference + */ + public void setR_PnRef (String R_PnRef) + { + + if (R_PnRef != null && R_PnRef.length() > 20) + { + log.warning("Length > 20 - truncated"); + R_PnRef = R_PnRef.substring(0, 20); + } + set_ValueNoCheck (COLUMNNAME_R_PnRef, R_PnRef); + } + + /** Get Reference. + @return Payment reference + */ + public String getR_PnRef () + { + return (String)get_Value(COLUMNNAME_R_PnRef); + } + + /** Set Reference (DC). + @param R_PnRef_DC + Payment Reference Delayed Capture + */ + public void setR_PnRef_DC (String R_PnRef_DC) + { + + if (R_PnRef_DC != null && R_PnRef_DC.length() > 20) + { + log.warning("Length > 20 - truncated"); + R_PnRef_DC = R_PnRef_DC.substring(0, 20); + } + set_ValueNoCheck (COLUMNNAME_R_PnRef_DC, R_PnRef_DC); + } + + /** Get Reference (DC). + @return Payment Reference Delayed Capture + */ + public String getR_PnRef_DC () + { + return (String)get_Value(COLUMNNAME_R_PnRef_DC); + } + + /** Set Response Message. + @param R_RespMsg + Response message + */ + public void setR_RespMsg (String R_RespMsg) + { + + if (R_RespMsg != null && R_RespMsg.length() > 60) + { + log.warning("Length > 60 - truncated"); + R_RespMsg = R_RespMsg.substring(0, 60); + } + set_ValueNoCheck (COLUMNNAME_R_RespMsg, R_RespMsg); + } + + /** Get Response Message. + @return Response message + */ + public String getR_RespMsg () + { + return (String)get_Value(COLUMNNAME_R_RespMsg); + } + + /** Set Result. + @param R_Result + Result of transmission + */ + public void setR_Result (String R_Result) + { + + if (R_Result != null && R_Result.length() > 20) + { + log.warning("Length > 20 - truncated"); + R_Result = R_Result.substring(0, 20); + } + set_ValueNoCheck (COLUMNNAME_R_Result, R_Result); + } + + /** Get Result. + @return Result of transmission + */ + public String getR_Result () + { + return (String)get_Value(COLUMNNAME_R_Result); + } + + /** Ref_Payment_ID AD_Reference_ID=343 */ + public static final int REF_PAYMENT_ID_AD_Reference_ID=343; + /** Set Referenced Payment. + @param Ref_Payment_ID Referenced Payment */ + public void setRef_Payment_ID (int Ref_Payment_ID) + { + if (Ref_Payment_ID < 1) + set_ValueNoCheck (COLUMNNAME_Ref_Payment_ID, null); + else + set_ValueNoCheck (COLUMNNAME_Ref_Payment_ID, Integer.valueOf(Ref_Payment_ID)); + } + + /** Get Referenced Payment. + @return Referenced Payment */ + public int getRef_Payment_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_Ref_Payment_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set Routing No. + @param RoutingNo + Bank Routing Number + */ + public void setRoutingNo (String RoutingNo) + { + + if (RoutingNo != null && RoutingNo.length() > 20) + { + log.warning("Length > 20 - truncated"); + RoutingNo = RoutingNo.substring(0, 20); + } + set_Value (COLUMNNAME_RoutingNo, RoutingNo); + } + + /** Get Routing No. + @return Bank Routing Number + */ + public String getRoutingNo () + { + return (String)get_Value(COLUMNNAME_RoutingNo); + } + + /** Set Swipe. + @param Swipe + Track 1 and 2 of the Credit Card + */ + public void setSwipe (String Swipe) + { + + if (Swipe != null && Swipe.length() > 80) + { + log.warning("Length > 80 - truncated"); + Swipe = Swipe.substring(0, 80); + } + set_ValueNoCheck (COLUMNNAME_Swipe, Swipe); + } + + /** Get Swipe. + @return Track 1 and 2 of the Credit Card + */ + public String getSwipe () + { + return (String)get_Value(COLUMNNAME_Swipe); + } + + /** Set Tax Amount. + @param TaxAmt + Tax Amount for a document + */ + public void setTaxAmt (BigDecimal TaxAmt) + { + set_Value (COLUMNNAME_TaxAmt, TaxAmt); + } + + /** Get Tax Amount. + @return Tax Amount for a document + */ + public BigDecimal getTaxAmt () + { + BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_TaxAmt); + if (bd == null) + return Env.ZERO; + return bd; + } + + /** TenderType AD_Reference_ID=214 */ + public static final int TENDERTYPE_AD_Reference_ID=214; + /** Credit Card = C */ + public static final String TENDERTYPE_CreditCard = "C"; + /** Check = K */ + public static final String TENDERTYPE_Check = "K"; + /** Direct Deposit = A */ + public static final String TENDERTYPE_DirectDeposit = "A"; + /** Direct Debit = D */ + public static final String TENDERTYPE_DirectDebit = "D"; + /** Account = T */ + public static final String TENDERTYPE_Account = "T"; + /** Cash = X */ + public static final String TENDERTYPE_Cash = "X"; + /** Set Tender type. + @param TenderType + Method of Payment + */ + public void setTenderType (String TenderType) + { + if (TenderType == null) throw new IllegalArgumentException ("TenderType is mandatory"); + if (TenderType.equals("C") || TenderType.equals("K") || TenderType.equals("A") || TenderType.equals("D") || TenderType.equals("T") || TenderType.equals("X")); else throw new IllegalArgumentException ("TenderType Invalid value - " + TenderType + " - Reference_ID=214 - C - K - A - D - T - X"); + if (TenderType.length() > 1) + { + log.warning("Length > 1 - truncated"); + TenderType = TenderType.substring(0, 1); + } + set_Value (COLUMNNAME_TenderType, TenderType); + } + + /** Get Tender type. + @return Method of Payment + */ + public String getTenderType () + { + return (String)get_Value(COLUMNNAME_TenderType); + } + + /** TrxType AD_Reference_ID=215 */ + public static final int TRXTYPE_AD_Reference_ID=215; + /** Sales = S */ + public static final String TRXTYPE_Sales = "S"; + /** Delayed Capture = D */ + public static final String TRXTYPE_DelayedCapture = "D"; + /** Credit (Payment) = C */ + public static final String TRXTYPE_CreditPayment = "C"; + /** Voice Authorization = F */ + public static final String TRXTYPE_VoiceAuthorization = "F"; + /** Authorization = A */ + public static final String TRXTYPE_Authorization = "A"; + /** Void = V */ + public static final String TRXTYPE_Void = "V"; + /** Set Transaction Type. + @param TrxType + Type of credit card transaction + */ + public void setTrxType (String TrxType) + { + if (TrxType == null) throw new IllegalArgumentException ("TrxType is mandatory"); + if (TrxType.equals("S") || TrxType.equals("D") || TrxType.equals("C") || TrxType.equals("F") || TrxType.equals("A") || TrxType.equals("V")); else throw new IllegalArgumentException ("TrxType Invalid value - " + TrxType + " - Reference_ID=215 - S - D - C - F - A - V"); + if (TrxType.length() > 1) + { + log.warning("Length > 1 - truncated"); + TrxType = TrxType.substring(0, 1); + } + set_Value (COLUMNNAME_TrxType, TrxType); + } + + /** Get Transaction Type. + @return Type of credit card transaction + */ + public String getTrxType () + { + return (String)get_Value(COLUMNNAME_TrxType); + } + + /** User1_ID AD_Reference_ID=134 */ + public static final int USER1_ID_AD_Reference_ID=134; + /** Set User List 1. + @param User1_ID + User defined list element #1 + */ + public void setUser1_ID (int User1_ID) + { + if (User1_ID < 1) + set_Value (COLUMNNAME_User1_ID, null); + else + set_Value (COLUMNNAME_User1_ID, Integer.valueOf(User1_ID)); + } + + /** Get User List 1. + @return User defined list element #1 + */ + public int getUser1_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_User1_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** User2_ID AD_Reference_ID=137 */ + public static final int USER2_ID_AD_Reference_ID=137; + /** Set User List 2. + @param User2_ID + User defined list element #2 + */ + public void setUser2_ID (int User2_ID) + { + if (User2_ID < 1) + set_Value (COLUMNNAME_User2_ID, null); + else + set_Value (COLUMNNAME_User2_ID, Integer.valueOf(User2_ID)); + } + + /** Get User List 2. + @return User defined list element #2 + */ + public int getUser2_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_User2_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set Voice authorization code. + @param VoiceAuthCode + Voice Authorization Code from credit card company + */ + public void setVoiceAuthCode (String VoiceAuthCode) + { + + if (VoiceAuthCode != null && VoiceAuthCode.length() > 20) + { + log.warning("Length > 20 - truncated"); + VoiceAuthCode = VoiceAuthCode.substring(0, 20); + } + set_Value (COLUMNNAME_VoiceAuthCode, VoiceAuthCode); + } + + /** Get Voice authorization code. + @return Voice Authorization Code from credit card company + */ + public String getVoiceAuthCode () + { + return (String)get_Value(COLUMNNAME_VoiceAuthCode); + } + + /** Set Write-off Amount. + @param WriteOffAmt + Amount to write-off + */ + public void setWriteOffAmt (BigDecimal WriteOffAmt) + { + set_Value (COLUMNNAME_WriteOffAmt, WriteOffAmt); + } + + /** Get Write-off Amount. + @return Amount to write-off + */ + public BigDecimal getWriteOffAmt () + { + BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_WriteOffAmt); + if (bd == null) + return Env.ZERO; + return bd; + } +} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/compiere/model/X_M_InventoryLine.java b/posterita/posterita/src/main/org/compiere/model/X_M_InventoryLine.java new file mode 100644 index 0000000000..88a85e30e9 --- /dev/null +++ b/posterita/posterita/src/main/org/compiere/model/X_M_InventoryLine.java @@ -0,0 +1,477 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2007 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program 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 General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +/** Generated Model - DO NOT CHANGE */ +package org.compiere.model; + +import java.lang.reflect.Constructor; +import java.math.BigDecimal; +import java.sql.ResultSet; +import java.util.Properties; +import java.util.logging.Level; +import org.compiere.util.Env; +import org.compiere.util.KeyNamePair; + +/** Generated Model for M_InventoryLine + * @author Adempiere (generated) + * @version Release 3.4.0s - $Id$ */ +public class X_M_InventoryLine extends PO implements I_M_InventoryLine, I_Persistent +{ + + /** + * + */ + private static final long serialVersionUID = 1L; + + /** Standard Constructor */ + public X_M_InventoryLine (Properties ctx, int M_InventoryLine_ID, String trxName) + { + super (ctx, M_InventoryLine_ID, trxName); + /** if (M_InventoryLine_ID == 0) + { + setInventoryType (null); +// D + setM_AttributeSetInstance_ID (0); + setM_Inventory_ID (0); + setM_InventoryLine_ID (0); + setM_Locator_ID (0); +// @M_Locator_ID@ + setM_Product_ID (0); + setProcessed (false); + setQtyBook (Env.ZERO); + setQtyCount (Env.ZERO); + setqtycsv (Env.ZERO); + } */ + } + + /** Load Constructor */ + public X_M_InventoryLine (Properties ctx, ResultSet rs, String trxName) + { + super (ctx, rs, trxName); + } + + /** AccessLevel + * @return 1 - Org + */ + protected int get_AccessLevel() + { + return accessLevel.intValue(); + } + + /** Load Meta Data */ + protected POInfo initPO (Properties ctx) + { + POInfo poi = POInfo.getPOInfo (ctx, Table_ID, get_TrxName()); + return poi; + } + + public String toString() + { + StringBuffer sb = new StringBuffer ("X_M_InventoryLine[") + .append(get_ID()).append("]"); + return sb.toString(); + } + + public I_C_Charge getC_Charge() throws Exception + { + Class clazz = MTable.getClass(I_C_Charge.Table_Name); + I_C_Charge result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_C_Charge)constructor.newInstance(new Object[] {getCtx(), new Integer(getC_Charge_ID()), get_TrxName()}); + } catch (Exception e) { + log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); + log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); + throw e; + } + return result; + } + + /** Set Charge. + @param C_Charge_ID + Additional document charges + */ + public void setC_Charge_ID (int C_Charge_ID) + { + if (C_Charge_ID < 1) + set_Value (COLUMNNAME_C_Charge_ID, null); + else + set_Value (COLUMNNAME_C_Charge_ID, Integer.valueOf(C_Charge_ID)); + } + + /** Get Charge. + @return Additional document charges + */ + public int getC_Charge_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_Charge_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set Description. + @param Description + Optional short description of the record + */ + public void setDescription (String Description) + { + + if (Description != null && Description.length() > 255) + { + log.warning("Length > 255 - truncated"); + Description = Description.substring(0, 255); + } + set_Value (COLUMNNAME_Description, Description); + } + + /** Get Description. + @return Optional short description of the record + */ + public String getDescription () + { + return (String)get_Value(COLUMNNAME_Description); + } + + /** InventoryType AD_Reference_ID=292 */ + public static final int INVENTORYTYPE_AD_Reference_ID=292; + /** Inventory Difference = D */ + public static final String INVENTORYTYPE_InventoryDifference = "D"; + /** Charge Account = C */ + public static final String INVENTORYTYPE_ChargeAccount = "C"; + /** Set Inventory Type. + @param InventoryType + Type of inventory difference + */ + public void setInventoryType (String InventoryType) + { + if (InventoryType == null) throw new IllegalArgumentException ("InventoryType is mandatory"); + if (InventoryType.equals("D") || InventoryType.equals("C")); else throw new IllegalArgumentException ("InventoryType Invalid value - " + InventoryType + " - Reference_ID=292 - D - C"); + if (InventoryType.length() > 1) + { + log.warning("Length > 1 - truncated"); + InventoryType = InventoryType.substring(0, 1); + } + set_Value (COLUMNNAME_InventoryType, InventoryType); + } + + /** Get Inventory Type. + @return Type of inventory difference + */ + public String getInventoryType () + { + return (String)get_Value(COLUMNNAME_InventoryType); + } + + /** Set Line No. + @param Line + Unique line for this document + */ + public void setLine (int Line) + { + set_Value (COLUMNNAME_Line, Integer.valueOf(Line)); + } + + /** Get Line No. + @return Unique line for this document + */ + public int getLine () + { + Integer ii = (Integer)get_Value(COLUMNNAME_Line); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Get Record ID/ColumnName + @return ID/ColumnName pair + */ + public KeyNamePair getKeyNamePair() + { + return new KeyNamePair(get_ID(), String.valueOf(getLine())); + } + + /** Set Attribute Set Instance. + @param M_AttributeSetInstance_ID + Product Attribute Set Instance + */ + public void setM_AttributeSetInstance_ID (int M_AttributeSetInstance_ID) + { + if (M_AttributeSetInstance_ID < 0) + throw new IllegalArgumentException ("M_AttributeSetInstance_ID is mandatory."); + set_Value (COLUMNNAME_M_AttributeSetInstance_ID, Integer.valueOf(M_AttributeSetInstance_ID)); + } + + /** Get Attribute Set Instance. + @return Product Attribute Set Instance + */ + public int getM_AttributeSetInstance_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_M_AttributeSetInstance_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + public I_M_Inventory getM_Inventory() throws Exception + { + Class clazz = MTable.getClass(I_M_Inventory.Table_Name); + I_M_Inventory result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_M_Inventory)constructor.newInstance(new Object[] {getCtx(), new Integer(getM_Inventory_ID()), get_TrxName()}); + } catch (Exception e) { + log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); + log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); + throw e; + } + return result; + } + + /** Set Phys.Inventory. + @param M_Inventory_ID + Parameters for a Physical Inventory + */ + public void setM_Inventory_ID (int M_Inventory_ID) + { + if (M_Inventory_ID < 1) + throw new IllegalArgumentException ("M_Inventory_ID is mandatory."); + set_ValueNoCheck (COLUMNNAME_M_Inventory_ID, Integer.valueOf(M_Inventory_ID)); + } + + /** Get Phys.Inventory. + @return Parameters for a Physical Inventory + */ + public int getM_Inventory_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_M_Inventory_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set Phys.Inventory Line. + @param M_InventoryLine_ID + Unique line in an Inventory document + */ + public void setM_InventoryLine_ID (int M_InventoryLine_ID) + { + if (M_InventoryLine_ID < 1) + throw new IllegalArgumentException ("M_InventoryLine_ID is mandatory."); + set_ValueNoCheck (COLUMNNAME_M_InventoryLine_ID, Integer.valueOf(M_InventoryLine_ID)); + } + + /** Get Phys.Inventory Line. + @return Unique line in an Inventory document + */ + public int getM_InventoryLine_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_M_InventoryLine_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set Locator. + @param M_Locator_ID + Warehouse Locator + */ + public void setM_Locator_ID (int M_Locator_ID) + { + if (M_Locator_ID < 1) + throw new IllegalArgumentException ("M_Locator_ID is mandatory."); + set_Value (COLUMNNAME_M_Locator_ID, Integer.valueOf(M_Locator_ID)); + } + + /** Get Locator. + @return Warehouse Locator + */ + public int getM_Locator_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_M_Locator_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** M_Product_ID AD_Reference_ID=171 */ + public static final int M_PRODUCT_ID_AD_Reference_ID=171; + /** Set Product. + @param M_Product_ID + Product, Service, Item + */ + public void setM_Product_ID (int M_Product_ID) + { + if (M_Product_ID < 1) + throw new IllegalArgumentException ("M_Product_ID is mandatory."); + set_Value (COLUMNNAME_M_Product_ID, Integer.valueOf(M_Product_ID)); + } + + /** Get Product. + @return Product, Service, Item + */ + public int getM_Product_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_M_Product_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set Processed. + @param Processed + The document has been processed + */ + public void setProcessed (boolean Processed) + { + set_Value (COLUMNNAME_Processed, Boolean.valueOf(Processed)); + } + + /** Get Processed. + @return The document has been processed + */ + public boolean isProcessed () + { + Object oo = get_Value(COLUMNNAME_Processed); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Quantity book. + @param QtyBook + Book Quantity + */ + public void setQtyBook (BigDecimal QtyBook) + { + if (QtyBook == null) + throw new IllegalArgumentException ("QtyBook is mandatory."); + set_ValueNoCheck (COLUMNNAME_QtyBook, QtyBook); + } + + /** Get Quantity book. + @return Book Quantity + */ + public BigDecimal getQtyBook () + { + BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_QtyBook); + if (bd == null) + return Env.ZERO; + return bd; + } + + /** Set Quantity count. + @param QtyCount + Counted Quantity + */ + public void setQtyCount (BigDecimal QtyCount) + { + if (QtyCount == null) + throw new IllegalArgumentException ("QtyCount is mandatory."); + set_Value (COLUMNNAME_QtyCount, QtyCount); + } + + /** Get Quantity count. + @return Counted Quantity + */ + public BigDecimal getQtyCount () + { + BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_QtyCount); + if (bd == null) + return Env.ZERO; + return bd; + } + + /** Set Quantity CSV. + @param Quantity CSV + Quantity CSV + */ + public void setQtyCsv (BigDecimal QtyCsv) + { + if (QtyCsv == null) + throw new IllegalArgumentException ("qtycsv is mandatory."); + set_Value (COLUMNNAME_QtyCsv, QtyCsv); + } + + /** Get Quantity CSV. + @return Quantity CSV + */ + public BigDecimal getQtyCsv () + { + BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_QtyCsv); + if (bd == null) + return Env.ZERO; + return bd; + } + + /** Set Internal Use Qty. + @param QtyInternalUse + Internal Use Quantity removed from Inventory + */ + public void setQtyInternalUse (BigDecimal QtyInternalUse) + { + set_Value (COLUMNNAME_QtyInternalUse, QtyInternalUse); + } + + /** Get Internal Use Qty. + @return Internal Use Quantity removed from Inventory + */ + public BigDecimal getQtyInternalUse () + { + BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_QtyInternalUse); + if (bd == null) + return Env.ZERO; + return bd; + } + + /** Set UPC/EAN. + @param UPC + Bar Code (Universal Product Code or its superset European Article Number) + */ + public void setUPC (String UPC) + { + throw new IllegalArgumentException ("UPC is virtual column"); } + + /** Get UPC/EAN. + @return Bar Code (Universal Product Code or its superset European Article Number) + */ + public String getUPC () + { + return (String)get_Value(COLUMNNAME_UPC); + } + + /** Set Search Key. + @param Value + Search key for the record in the format required - must be unique + */ + public void setValue (String Value) + { + throw new IllegalArgumentException ("Value is virtual column"); } + + /** Get Search Key. + @return Search key for the record in the format required - must be unique + */ + public String getValue () + { + return (String)get_Value(COLUMNNAME_Value); + } +} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/compiere/model/X_M_PriceList.java b/posterita/posterita/src/main/org/compiere/model/X_M_PriceList.java new file mode 100644 index 0000000000..56e1fd22bf --- /dev/null +++ b/posterita/posterita/src/main/org/compiere/model/X_M_PriceList.java @@ -0,0 +1,388 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2007 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program 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 General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +/** Generated Model - DO NOT CHANGE */ +package org.compiere.model; + +import java.lang.reflect.Constructor; +import java.math.BigDecimal; +import java.sql.ResultSet; +import java.util.Properties; +import java.util.logging.Level; +import org.compiere.util.Env; +import org.compiere.util.KeyNamePair; + +/** Generated Model for M_PriceList + * @author Adempiere (generated) + * @version Release 3.3.1b - $Id$ */ +public class X_M_PriceList extends PO implements I_M_PriceList, I_Persistent +{ + + /** + * + */ + private static final long serialVersionUID = 1L; + + /** Standard Constructor */ + public X_M_PriceList (Properties ctx, int M_PriceList_ID, String trxName) + { + super (ctx, M_PriceList_ID, trxName); + /** if (M_PriceList_ID == 0) + { + setC_Currency_ID (0); + setEnforcePriceLimit (false); + setIsDefault (false); + setIsSOPriceList (false); + setIsTaxIncluded (false); + setM_PriceList_ID (0); + setName (null); + setPricePrecision (Env.ZERO); +// 2 + } */ + } + + /** Load Constructor */ + public X_M_PriceList (Properties ctx, ResultSet rs, String trxName) + { + super (ctx, rs, trxName); + } + + /** AccessLevel + * @return 3 - Client - Org + */ + protected int get_AccessLevel() + { + return accessLevel.intValue(); + } + + /** Load Meta Data */ + protected POInfo initPO (Properties ctx) + { + POInfo poi = POInfo.getPOInfo (ctx, Table_ID); + return poi; + } + + public String toString() + { + StringBuffer sb = new StringBuffer ("X_M_PriceList[") + .append(get_ID()).append("]"); + return sb.toString(); + } + + /** BasePriceList_ID AD_Reference_ID=166 */ + public static final int BASEPRICELIST_ID_AD_Reference_ID=166; + /** Set Base Pricelist. + @param BasePriceList_ID + Pricelist to be used, if product not found on this pricelist + */ + public void setBasePriceList_ID (int BasePriceList_ID) + { + if (BasePriceList_ID <= 0) + set_Value (COLUMNNAME_BasePriceList_ID, null); + else + set_Value (COLUMNNAME_BasePriceList_ID, Integer.valueOf(BasePriceList_ID)); + } + + /** Get Base Pricelist. + @return Pricelist to be used, if product not found on this pricelist + */ + public int getBasePriceList_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_BasePriceList_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + public I_C_Currency getC_Currency() throws Exception + { + Class clazz = MTable.getClass(I_C_Currency.Table_Name); + I_C_Currency result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_C_Currency)constructor.newInstance(new Object[] {getCtx(), new Integer(getC_Currency_ID()), get_TrxName()}); + } catch (Exception e) { + log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); + log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); + throw e; + } + return result; + } + + /** Set Currency. + @param C_Currency_ID + The Currency for this record + */ + public void setC_Currency_ID (int C_Currency_ID) + { + if (C_Currency_ID < 1) + throw new IllegalArgumentException ("C_Currency_ID is mandatory."); + set_Value (COLUMNNAME_C_Currency_ID, Integer.valueOf(C_Currency_ID)); + } + + /** Get Currency. + @return The Currency for this record + */ + public int getC_Currency_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_Currency_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set Description. + @param Description + Optional short description of the record + */ + public void setDescription (String Description) + { + + if (Description != null && Description.length() > 255) + { + log.warning("Length > 255 - truncated"); + Description = Description.substring(0, 255); + } + set_Value (COLUMNNAME_Description, Description); + } + + /** Get Description. + @return Optional short description of the record + */ + public String getDescription () + { + return (String)get_Value(COLUMNNAME_Description); + } + + /** Set Enforce price limit. + @param EnforcePriceLimit + Do not allow prices below the limit price + */ + public void setEnforcePriceLimit (boolean EnforcePriceLimit) + { + set_Value (COLUMNNAME_EnforcePriceLimit, Boolean.valueOf(EnforcePriceLimit)); + } + + /** Get Enforce price limit. + @return Do not allow prices below the limit price + */ + public boolean isEnforcePriceLimit () + { + Object oo = get_Value(COLUMNNAME_EnforcePriceLimit); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Default. + @param IsDefault + Default value + */ + public void setIsDefault (boolean IsDefault) + { + set_Value (COLUMNNAME_IsDefault, Boolean.valueOf(IsDefault)); + } + + /** Get Default. + @return Default value + */ + public boolean isDefault () + { + Object oo = get_Value(COLUMNNAME_IsDefault); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Mandatory. + @param IsMandatory + Data entry is required in this column + */ + public void setIsMandatory (boolean IsMandatory) + { + set_Value (COLUMNNAME_IsMandatory, Boolean.valueOf(IsMandatory)); + } + + /** Get Mandatory. + @return Data entry is required in this column + */ + public boolean isMandatory () + { + Object oo = get_Value(COLUMNNAME_IsMandatory); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set isPresentForProduct. + @param isPresentForProduct isPresentForProduct */ + public void setisPresentForProduct (boolean isPresentForProduct) + { + set_Value (COLUMNNAME_isPresentForProduct, Boolean.valueOf(isPresentForProduct)); + } + + /** Get isPresentForProduct. + @return isPresentForProduct */ + public boolean isPresentForProduct () + { + Object oo = get_Value(COLUMNNAME_isPresentForProduct); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Sales Price list. + @param IsSOPriceList + This is a Sales Price List + */ + public void setIsSOPriceList (boolean IsSOPriceList) + { + set_Value (COLUMNNAME_IsSOPriceList, Boolean.valueOf(IsSOPriceList)); + } + + /** Get Sales Price list. + @return This is a Sales Price List + */ + public boolean isSOPriceList () + { + Object oo = get_Value(COLUMNNAME_IsSOPriceList); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Price includes Tax. + @param IsTaxIncluded + Tax is included in the price + */ + public void setIsTaxIncluded (boolean IsTaxIncluded) + { + set_Value (COLUMNNAME_IsTaxIncluded, Boolean.valueOf(IsTaxIncluded)); + } + + /** Get Price includes Tax. + @return Tax is included in the price + */ + public boolean isTaxIncluded () + { + Object oo = get_Value(COLUMNNAME_IsTaxIncluded); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Price List. + @param M_PriceList_ID + Unique identifier of a Price List + */ + public void setM_PriceList_ID (int M_PriceList_ID) + { + if (M_PriceList_ID < 1) + throw new IllegalArgumentException ("M_PriceList_ID is mandatory."); + set_ValueNoCheck (COLUMNNAME_M_PriceList_ID, Integer.valueOf(M_PriceList_ID)); + } + + /** Get Price List. + @return Unique identifier of a Price List + */ + public int getM_PriceList_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_M_PriceList_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set Name. + @param Name + Alphanumeric identifier of the entity + */ + public void setName (String Name) + { + if (Name == null) + throw new IllegalArgumentException ("Name is mandatory."); + + if (Name.length() > 60) + { + log.warning("Length > 60 - truncated"); + Name = Name.substring(0, 60); + } + set_Value (COLUMNNAME_Name, Name); + } + + /** Get Name. + @return Alphanumeric identifier of the entity + */ + public String getName () + { + return (String)get_Value(COLUMNNAME_Name); + } + + /** Get Record ID/ColumnName + @return ID/ColumnName pair + */ + public KeyNamePair getKeyNamePair() + { + return new KeyNamePair(get_ID(), getName()); + } + + /** Set Price Precision. + @param PricePrecision + Precision (number of decimals) for the Price + */ + public void setPricePrecision (BigDecimal PricePrecision) + { + if (PricePrecision == null) + throw new IllegalArgumentException ("PricePrecision is mandatory."); + set_Value (COLUMNNAME_PricePrecision, PricePrecision); + } + + /** Get Price Precision. + @return Precision (number of decimals) for the Price + */ + public BigDecimal getPricePrecision () + { + BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_PricePrecision); + if (bd == null) + return Env.ZERO; + return bd; + } +} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/compiere/model/X_M_Product.java b/posterita/posterita/src/main/org/compiere/model/X_M_Product.java new file mode 100644 index 0000000000..df11c39fed --- /dev/null +++ b/posterita/posterita/src/main/org/compiere/model/X_M_Product.java @@ -0,0 +1,1440 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2007 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program 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 General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +/** Generated Model - DO NOT CHANGE */ +package org.compiere.model; + +import java.lang.reflect.Constructor; +import java.math.BigDecimal; +import java.sql.ResultSet; +import java.sql.Timestamp; +import java.util.Properties; +import java.util.logging.Level; +import org.compiere.util.Env; +import org.compiere.util.KeyNamePair; + +/** Generated Model for M_Product + * @author Adempiere (generated) + * @version Release 3.4.0s - $Id$ */ +public class X_M_Product extends PO implements I_M_Product, I_Persistent +{ + + /** + * + */ + private static final long serialVersionUID = 1L; + + /** Standard Constructor */ + public X_M_Product (Properties ctx, int M_Product_ID, String trxName) + { + super (ctx, M_Product_ID, trxName); + /** if (M_Product_ID == 0) + { + setC_TaxCategory_ID (0); + setC_UOM_ID (0); + setIsBOM (false); +// N + setIsDropShip (false); + setIsExcludeAutoDelivery (false); +// N + setIsInvoicePrintDetails (false); + setIsPickListPrintDetails (false); + setIsPurchased (true); +// Y + setIsSelfService (true); +// Y + setIsSold (true); +// Y + setIsStocked (true); +// Y + setIsSummary (false); + setIsVerified (false); +// N + setIsWebStoreFeatured (false); + setM_AttributeSetInstance_ID (0); + setM_Product_Category_ID (0); + setM_Product_ID (0); + setName (null); + setProductType (null); +// I + setValue (null); + } */ + } + + /** Load Constructor */ + public X_M_Product (Properties ctx, ResultSet rs, String trxName) + { + super (ctx, rs, trxName); + } + + /** AccessLevel + * @return 3 - Client - Org + */ + protected int get_AccessLevel() + { + return accessLevel.intValue(); + } + + /** Load Meta Data */ + protected POInfo initPO (Properties ctx) + { + POInfo poi = POInfo.getPOInfo (ctx, Table_ID, get_TrxName()); + return poi; + } + + public String toString() + { + StringBuffer sb = new StringBuffer ("X_M_Product[") + .append(get_ID()).append("]"); + return sb.toString(); + } + + /** Set Classification. + @param Classification + Classification for grouping + */ + public void setClassification (String Classification) + { + + if (Classification != null && Classification.length() > 1) + { + log.warning("Length > 1 - truncated"); + Classification = Classification.substring(0, 1); + } + set_Value (COLUMNNAME_Classification, Classification); + } + + /** Get Classification. + @return Classification for grouping + */ + public String getClassification () + { + return (String)get_Value(COLUMNNAME_Classification); + } + + public I_C_RevenueRecognition getC_RevenueRecognition() throws Exception + { + Class clazz = MTable.getClass(I_C_RevenueRecognition.Table_Name); + I_C_RevenueRecognition result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_C_RevenueRecognition)constructor.newInstance(new Object[] {getCtx(), new Integer(getC_RevenueRecognition_ID()), get_TrxName()}); + } catch (Exception e) { + log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); + log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); + throw e; + } + return result; + } + + /** Set Revenue Recognition. + @param C_RevenueRecognition_ID + Method for recording revenue + */ + public void setC_RevenueRecognition_ID (int C_RevenueRecognition_ID) + { + if (C_RevenueRecognition_ID < 1) + set_Value (COLUMNNAME_C_RevenueRecognition_ID, null); + else + set_Value (COLUMNNAME_C_RevenueRecognition_ID, Integer.valueOf(C_RevenueRecognition_ID)); + } + + /** Get Revenue Recognition. + @return Method for recording revenue + */ + public int getC_RevenueRecognition_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_RevenueRecognition_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set Subscription Type. + @param C_SubscriptionType_ID + Type of subscription + */ + public void setC_SubscriptionType_ID (int C_SubscriptionType_ID) + { + if (C_SubscriptionType_ID < 1) + set_Value (COLUMNNAME_C_SubscriptionType_ID, null); + else + set_Value (COLUMNNAME_C_SubscriptionType_ID, Integer.valueOf(C_SubscriptionType_ID)); + } + + /** Get Subscription Type. + @return Type of subscription + */ + public int getC_SubscriptionType_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_SubscriptionType_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + public I_C_TaxCategory getC_TaxCategory() throws Exception + { + Class clazz = MTable.getClass(I_C_TaxCategory.Table_Name); + I_C_TaxCategory result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_C_TaxCategory)constructor.newInstance(new Object[] {getCtx(), new Integer(getC_TaxCategory_ID()), get_TrxName()}); + } catch (Exception e) { + log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); + log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); + throw e; + } + return result; + } + + /** Set Tax Category. + @param C_TaxCategory_ID + Tax Category + */ + public void setC_TaxCategory_ID (int C_TaxCategory_ID) + { + if (C_TaxCategory_ID < 1) + throw new IllegalArgumentException ("C_TaxCategory_ID is mandatory."); + set_Value (COLUMNNAME_C_TaxCategory_ID, Integer.valueOf(C_TaxCategory_ID)); + } + + /** Get Tax Category. + @return Tax Category + */ + public int getC_TaxCategory_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_TaxCategory_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + public I_C_UOM getC_UOM() throws Exception + { + Class clazz = MTable.getClass(I_C_UOM.Table_Name); + I_C_UOM result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_C_UOM)constructor.newInstance(new Object[] {getCtx(), new Integer(getC_UOM_ID()), get_TrxName()}); + } catch (Exception e) { + log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); + log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); + throw e; + } + return result; + } + + /** Set UOM. + @param C_UOM_ID + Unit of Measure + */ + public void setC_UOM_ID (int C_UOM_ID) + { + if (C_UOM_ID < 1) + throw new IllegalArgumentException ("C_UOM_ID is mandatory."); + set_Value (COLUMNNAME_C_UOM_ID, Integer.valueOf(C_UOM_ID)); + } + + /** Get UOM. + @return Unit of Measure + */ + public int getC_UOM_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_UOM_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set Description. + @param Description + Optional short description of the record + */ + public void setDescription (String Description) + { + + if (Description != null && Description.length() > 255) + { + log.warning("Length > 255 - truncated"); + Description = Description.substring(0, 255); + } + set_Value (COLUMNNAME_Description, Description); + } + + /** Get Description. + @return Optional short description of the record + */ + public String getDescription () + { + return (String)get_Value(COLUMNNAME_Description); + } + + /** Set Description URL. + @param DescriptionURL + URL for the description + */ + public void setDescriptionURL (String DescriptionURL) + { + + if (DescriptionURL != null && DescriptionURL.length() > 120) + { + log.warning("Length > 120 - truncated"); + DescriptionURL = DescriptionURL.substring(0, 120); + } + set_Value (COLUMNNAME_DescriptionURL, DescriptionURL); + } + + /** Get Description URL. + @return URL for the description + */ + public String getDescriptionURL () + { + return (String)get_Value(COLUMNNAME_DescriptionURL); + } + + /** Set Discontinued. + @param Discontinued + This product is no longer available + */ + public void setDiscontinued (boolean Discontinued) + { + set_Value (COLUMNNAME_Discontinued, Boolean.valueOf(Discontinued)); + } + + /** Get Discontinued. + @return This product is no longer available + */ + public boolean isDiscontinued () + { + Object oo = get_Value(COLUMNNAME_Discontinued); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Discontinued by. + @param DiscontinuedBy + Discontinued By + */ + public void setDiscontinuedBy (Timestamp DiscontinuedBy) + { + set_Value (COLUMNNAME_DiscontinuedBy, DiscontinuedBy); + } + + /** Get Discontinued by. + @return Discontinued By + */ + public Timestamp getDiscontinuedBy () + { + return (Timestamp)get_Value(COLUMNNAME_DiscontinuedBy); + } + + /** Set Document Note. + @param DocumentNote + Additional information for a Document + */ + public void setDocumentNote (String DocumentNote) + { + + if (DocumentNote != null && DocumentNote.length() > 2000) + { + log.warning("Length > 2000 - truncated"); + DocumentNote = DocumentNote.substring(0, 2000); + } + set_Value (COLUMNNAME_DocumentNote, DocumentNote); + } + + /** Get Document Note. + @return Additional information for a Document + */ + public String getDocumentNote () + { + return (String)get_Value(COLUMNNAME_DocumentNote); + } + + /** Set Group1. + @param Group1 Group1 */ + public void setGroup1 (String Group1) + { + + if (Group1 != null && Group1.length() > 255) + { + log.warning("Length > 255 - truncated"); + Group1 = Group1.substring(0, 255); + } + set_Value (COLUMNNAME_Group1, Group1); + } + + /** Get Group1. + @return Group1 */ + public String getGroup1 () + { + return (String)get_Value(COLUMNNAME_Group1); + } + + /** Set Group2. + @param Group2 Group2 */ + public void setGroup2 (String Group2) + { + + if (Group2 != null && Group2.length() > 255) + { + log.warning("Length > 255 - truncated"); + Group2 = Group2.substring(0, 255); + } + set_Value (COLUMNNAME_Group2, Group2); + } + + /** Get Group2. + @return Group2 */ + public String getGroup2 () + { + return (String)get_Value(COLUMNNAME_Group2); + } + + /** Set Guarantee Days. + @param GuaranteeDays + Number of days the product is guaranteed or available + */ + public void setGuaranteeDays (int GuaranteeDays) + { + set_Value (COLUMNNAME_GuaranteeDays, Integer.valueOf(GuaranteeDays)); + } + + /** Get Guarantee Days. + @return Number of days the product is guaranteed or available + */ + public int getGuaranteeDays () + { + Integer ii = (Integer)get_Value(COLUMNNAME_GuaranteeDays); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set Min Guarantee Days. + @param GuaranteeDaysMin + Minumum number of guarantee days + */ + public void setGuaranteeDaysMin (int GuaranteeDaysMin) + { + set_Value (COLUMNNAME_GuaranteeDaysMin, Integer.valueOf(GuaranteeDaysMin)); + } + + /** Get Min Guarantee Days. + @return Minumum number of guarantee days + */ + public int getGuaranteeDaysMin () + { + Integer ii = (Integer)get_Value(COLUMNNAME_GuaranteeDaysMin); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set Comment/Help. + @param Help + Comment or Hint + */ + public void setHelp (String Help) + { + + if (Help != null && Help.length() > 2000) + { + log.warning("Length > 2000 - truncated"); + Help = Help.substring(0, 2000); + } + set_Value (COLUMNNAME_Help, Help); + } + + /** Get Comment/Help. + @return Comment or Hint + */ + public String getHelp () + { + return (String)get_Value(COLUMNNAME_Help); + } + + /** Set Image URL. + @param ImageURL + URL of image + */ + public void setImageURL (String ImageURL) + { + + if (ImageURL != null && ImageURL.length() > 120) + { + log.warning("Length > 120 - truncated"); + ImageURL = ImageURL.substring(0, 120); + } + set_Value (COLUMNNAME_ImageURL, ImageURL); + } + + /** Get Image URL. + @return URL of image + */ + public String getImageURL () + { + return (String)get_Value(COLUMNNAME_ImageURL); + } + + /** Set Bill of Materials. + @param IsBOM + Bill of Materials + */ + public void setIsBOM (boolean IsBOM) + { + set_Value (COLUMNNAME_IsBOM, Boolean.valueOf(IsBOM)); + } + + /** Get Bill of Materials. + @return Bill of Materials + */ + public boolean isBOM () + { + Object oo = get_Value(COLUMNNAME_IsBOM); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Drop Shipment. + @param IsDropShip + Drop Shipments are sent from the Vendor directly to the Customer + */ + public void setIsDropShip (boolean IsDropShip) + { + set_Value (COLUMNNAME_IsDropShip, Boolean.valueOf(IsDropShip)); + } + + /** Get Drop Shipment. + @return Drop Shipments are sent from the Vendor directly to the Customer + */ + public boolean isDropShip () + { + Object oo = get_Value(COLUMNNAME_IsDropShip); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Exclude Auto Delivery. + @param IsExcludeAutoDelivery + Exclude from automatic Delivery + */ + public void setIsExcludeAutoDelivery (boolean IsExcludeAutoDelivery) + { + set_Value (COLUMNNAME_IsExcludeAutoDelivery, Boolean.valueOf(IsExcludeAutoDelivery)); + } + + /** Get Exclude Auto Delivery. + @return Exclude from automatic Delivery + */ + public boolean isExcludeAutoDelivery () + { + Object oo = get_Value(COLUMNNAME_IsExcludeAutoDelivery); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Print detail records on invoice . + @param IsInvoicePrintDetails + Print detail BOM elements on the invoice + */ + public void setIsInvoicePrintDetails (boolean IsInvoicePrintDetails) + { + set_Value (COLUMNNAME_IsInvoicePrintDetails, Boolean.valueOf(IsInvoicePrintDetails)); + } + + /** Get Print detail records on invoice . + @return Print detail BOM elements on the invoice + */ + public boolean isInvoicePrintDetails () + { + Object oo = get_Value(COLUMNNAME_IsInvoicePrintDetails); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Print detail records on pick list. + @param IsPickListPrintDetails + Print detail BOM elements on the pick list + */ + public void setIsPickListPrintDetails (boolean IsPickListPrintDetails) + { + set_Value (COLUMNNAME_IsPickListPrintDetails, Boolean.valueOf(IsPickListPrintDetails)); + } + + /** Get Print detail records on pick list. + @return Print detail BOM elements on the pick list + */ + public boolean isPickListPrintDetails () + { + Object oo = get_Value(COLUMNNAME_IsPickListPrintDetails); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Purchased. + @param IsPurchased + Organization purchases this product + */ + public void setIsPurchased (boolean IsPurchased) + { + set_Value (COLUMNNAME_IsPurchased, Boolean.valueOf(IsPurchased)); + } + + /** Get Purchased. + @return Organization purchases this product + */ + public boolean isPurchased () + { + Object oo = get_Value(COLUMNNAME_IsPurchased); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Self-Service. + @param IsSelfService + This is a Self-Service entry or this entry can be changed via Self-Service + */ + public void setIsSelfService (boolean IsSelfService) + { + set_Value (COLUMNNAME_IsSelfService, Boolean.valueOf(IsSelfService)); + } + + /** Get Self-Service. + @return This is a Self-Service entry or this entry can be changed via Self-Service + */ + public boolean isSelfService () + { + Object oo = get_Value(COLUMNNAME_IsSelfService); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Sold. + @param IsSold + Organization sells this product + */ + public void setIsSold (boolean IsSold) + { + set_Value (COLUMNNAME_IsSold, Boolean.valueOf(IsSold)); + } + + /** Get Sold. + @return Organization sells this product + */ + public boolean isSold () + { + Object oo = get_Value(COLUMNNAME_IsSold); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Stocked. + @param IsStocked + Organization stocks this product + */ + public void setIsStocked (boolean IsStocked) + { + set_Value (COLUMNNAME_IsStocked, Boolean.valueOf(IsStocked)); + } + + /** Get Stocked. + @return Organization stocks this product + */ + public boolean isStocked () + { + Object oo = get_Value(COLUMNNAME_IsStocked); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Summary Level. + @param IsSummary + This is a summary entity + */ + public void setIsSummary (boolean IsSummary) + { + set_Value (COLUMNNAME_IsSummary, Boolean.valueOf(IsSummary)); + } + + /** Get Summary Level. + @return This is a summary entity + */ + public boolean isSummary () + { + Object oo = get_Value(COLUMNNAME_IsSummary); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Verified. + @param IsVerified + The BOM configuration has been verified + */ + public void setIsVerified (boolean IsVerified) + { + set_ValueNoCheck (COLUMNNAME_IsVerified, Boolean.valueOf(IsVerified)); + } + + /** Get Verified. + @return The BOM configuration has been verified + */ + public boolean isVerified () + { + Object oo = get_Value(COLUMNNAME_IsVerified); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Featured in Web Store. + @param IsWebStoreFeatured + If selected, the product is displayed in the inital or any empy search + */ + public void setIsWebStoreFeatured (boolean IsWebStoreFeatured) + { + set_Value (COLUMNNAME_IsWebStoreFeatured, Boolean.valueOf(IsWebStoreFeatured)); + } + + /** Get Featured in Web Store. + @return If selected, the product is displayed in the inital or any empy search + */ + public boolean isWebStoreFeatured () + { + Object oo = get_Value(COLUMNNAME_IsWebStoreFeatured); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + public I_M_AttributeSet getM_AttributeSet() throws Exception + { + Class clazz = MTable.getClass(I_M_AttributeSet.Table_Name); + I_M_AttributeSet result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_M_AttributeSet)constructor.newInstance(new Object[] {getCtx(), new Integer(getM_AttributeSet_ID()), get_TrxName()}); + } catch (Exception e) { + log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); + log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); + throw e; + } + return result; + } + + /** Set Attribute Set. + @param M_AttributeSet_ID + Product Attribute Set + */ + public void setM_AttributeSet_ID (int M_AttributeSet_ID) + { + if (M_AttributeSet_ID < 0) + set_Value (COLUMNNAME_M_AttributeSet_ID, null); + else + set_Value (COLUMNNAME_M_AttributeSet_ID, Integer.valueOf(M_AttributeSet_ID)); + } + + /** Get Attribute Set. + @return Product Attribute Set + */ + public int getM_AttributeSet_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_M_AttributeSet_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set Attribute Set Instance. + @param M_AttributeSetInstance_ID + Product Attribute Set Instance + */ + public void setM_AttributeSetInstance_ID (int M_AttributeSetInstance_ID) + { + if (M_AttributeSetInstance_ID < 0) + throw new IllegalArgumentException ("M_AttributeSetInstance_ID is mandatory."); + set_Value (COLUMNNAME_M_AttributeSetInstance_ID, Integer.valueOf(M_AttributeSetInstance_ID)); + } + + /** Get Attribute Set Instance. + @return Product Attribute Set Instance + */ + public int getM_AttributeSetInstance_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_M_AttributeSetInstance_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + public I_M_FreightCategory getM_FreightCategory() throws Exception + { + Class clazz = MTable.getClass(I_M_FreightCategory.Table_Name); + I_M_FreightCategory result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_M_FreightCategory)constructor.newInstance(new Object[] {getCtx(), new Integer(getM_FreightCategory_ID()), get_TrxName()}); + } catch (Exception e) { + log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); + log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); + throw e; + } + return result; + } + + /** Set Freight Category. + @param M_FreightCategory_ID + Category of the Freight + */ + public void setM_FreightCategory_ID (int M_FreightCategory_ID) + { + if (M_FreightCategory_ID < 1) + set_Value (COLUMNNAME_M_FreightCategory_ID, null); + else + set_Value (COLUMNNAME_M_FreightCategory_ID, Integer.valueOf(M_FreightCategory_ID)); + } + + /** Get Freight Category. + @return Category of the Freight + */ + public int getM_FreightCategory_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_M_FreightCategory_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set Locator. + @param M_Locator_ID + Warehouse Locator + */ + public void setM_Locator_ID (int M_Locator_ID) + { + if (M_Locator_ID < 1) + set_Value (COLUMNNAME_M_Locator_ID, null); + else + set_Value (COLUMNNAME_M_Locator_ID, Integer.valueOf(M_Locator_ID)); + } + + /** Get Locator. + @return Warehouse Locator + */ + public int getM_Locator_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_M_Locator_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** M_Product_Category_ID AD_Reference_ID=163 */ + public static final int M_PRODUCT_CATEGORY_ID_AD_Reference_ID=163; + public I_M_Product_Category getM_Product_Category() throws Exception + { + Class clazz = MTable.getClass(I_M_Product_Category.Table_Name); + I_M_Product_Category result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_M_Product_Category)constructor.newInstance(new Object[] {getCtx(), new Integer(getM_Product_Category_ID()), get_TrxName()}); + } catch (Exception e) { + log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); + log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); + throw e; + } + return result; + } + + /** Set Product Category. + @param M_Product_Category_ID + Category of a Product + */ + public void setM_Product_Category_ID (int M_Product_Category_ID) + { + if (M_Product_Category_ID < 1) + throw new IllegalArgumentException ("M_Product_Category_ID is mandatory."); + set_Value (COLUMNNAME_M_Product_Category_ID, Integer.valueOf(M_Product_Category_ID)); + } + + /** Get Product Category. + @return Category of a Product + */ + public int getM_Product_Category_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_M_Product_Category_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set Product. + @param M_Product_ID + Product, Service, Item + */ + public void setM_Product_ID (int M_Product_ID) + { + if (M_Product_ID < 1) + throw new IllegalArgumentException ("M_Product_ID is mandatory."); + set_ValueNoCheck (COLUMNNAME_M_Product_ID, Integer.valueOf(M_Product_ID)); + } + + /** Get Product. + @return Product, Service, Item + */ + public int getM_Product_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_M_Product_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set Name. + @param Name + Alphanumeric identifier of the entity + */ + public void setName (String Name) + { + if (Name == null) + throw new IllegalArgumentException ("Name is mandatory."); + + if (Name.length() > 60) + { + log.warning("Length > 60 - truncated"); + Name = Name.substring(0, 60); + } + set_Value (COLUMNNAME_Name, Name); + } + + /** Get Name. + @return Alphanumeric identifier of the entity + */ + public String getName () + { + return (String)get_Value(COLUMNNAME_Name); + } + + /** Get Record ID/ColumnName + @return ID/ColumnName pair + */ + public KeyNamePair getKeyNamePair() + { + return new KeyNamePair(get_ID(), getName()); + } + + /** Set Process Now. + @param Processing Process Now */ + public void setProcessing (boolean Processing) + { + set_Value (COLUMNNAME_Processing, Boolean.valueOf(Processing)); + } + + /** Get Process Now. + @return Process Now */ + public boolean isProcessing () + { + Object oo = get_Value(COLUMNNAME_Processing); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** ProductType AD_Reference_ID=270 */ + public static final int PRODUCTTYPE_AD_Reference_ID=270; + /** Item = I */ + public static final String PRODUCTTYPE_Item = "I"; + /** Service = S */ + public static final String PRODUCTTYPE_Service = "S"; + /** Resource = R */ + public static final String PRODUCTTYPE_Resource = "R"; + /** Expense type = E */ + public static final String PRODUCTTYPE_ExpenseType = "E"; + /** Online = O */ + public static final String PRODUCTTYPE_Online = "O"; + /** Set Product Type. + @param ProductType + Type of product + */ + public void setProductType (String ProductType) + { + if (ProductType == null) throw new IllegalArgumentException ("ProductType is mandatory"); + if (ProductType.equals("I") || ProductType.equals("S") || ProductType.equals("R") || ProductType.equals("E") || ProductType.equals("O")); else throw new IllegalArgumentException ("ProductType Invalid value - " + ProductType + " - Reference_ID=270 - I - S - R - E - O"); + if (ProductType.length() > 1) + { + log.warning("Length > 1 - truncated"); + ProductType = ProductType.substring(0, 1); + } + set_Value (COLUMNNAME_ProductType, ProductType); + } + + /** Get Product Type. + @return Type of product + */ + public String getProductType () + { + return (String)get_Value(COLUMNNAME_ProductType); + } + + public I_R_MailText getR_MailText() throws Exception + { + Class clazz = MTable.getClass(I_R_MailText.Table_Name); + I_R_MailText result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_R_MailText)constructor.newInstance(new Object[] {getCtx(), new Integer(getR_MailText_ID()), get_TrxName()}); + } catch (Exception e) { + log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); + log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); + throw e; + } + return result; + } + + /** Set Mail Template. + @param R_MailText_ID + Text templates for mailings + */ + public void setR_MailText_ID (int R_MailText_ID) + { + if (R_MailText_ID < 1) + set_Value (COLUMNNAME_R_MailText_ID, null); + else + set_Value (COLUMNNAME_R_MailText_ID, Integer.valueOf(R_MailText_ID)); + } + + /** Get Mail Template. + @return Text templates for mailings + */ + public int getR_MailText_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_R_MailText_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** SalesRep_ID AD_Reference_ID=190 */ + public static final int SALESREP_ID_AD_Reference_ID=190; + /** Set Sales Representative. + @param SalesRep_ID + Sales Representative or Company Agent + */ + public void setSalesRep_ID (int SalesRep_ID) + { + if (SalesRep_ID < 1) + set_Value (COLUMNNAME_SalesRep_ID, null); + else + set_Value (COLUMNNAME_SalesRep_ID, Integer.valueOf(SalesRep_ID)); + } + + /** Get Sales Representative. + @return Sales Representative or Company Agent + */ + public int getSalesRep_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_SalesRep_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + public I_S_ExpenseType getS_ExpenseType() throws Exception + { + Class clazz = MTable.getClass(I_S_ExpenseType.Table_Name); + I_S_ExpenseType result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_S_ExpenseType)constructor.newInstance(new Object[] {getCtx(), new Integer(getS_ExpenseType_ID()), get_TrxName()}); + } catch (Exception e) { + log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); + log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); + throw e; + } + return result; + } + + /** Set Expense Type. + @param S_ExpenseType_ID + Expense report type + */ + public void setS_ExpenseType_ID (int S_ExpenseType_ID) + { + if (S_ExpenseType_ID < 1) + set_ValueNoCheck (COLUMNNAME_S_ExpenseType_ID, null); + else + set_ValueNoCheck (COLUMNNAME_S_ExpenseType_ID, Integer.valueOf(S_ExpenseType_ID)); + } + + /** Get Expense Type. + @return Expense report type + */ + public int getS_ExpenseType_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_S_ExpenseType_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set Shelf Depth. + @param ShelfDepth + Shelf depth required + */ + public void setShelfDepth (int ShelfDepth) + { + set_Value (COLUMNNAME_ShelfDepth, Integer.valueOf(ShelfDepth)); + } + + /** Get Shelf Depth. + @return Shelf depth required + */ + public int getShelfDepth () + { + Integer ii = (Integer)get_Value(COLUMNNAME_ShelfDepth); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set Shelf Height. + @param ShelfHeight + Shelf height required + */ + public void setShelfHeight (int ShelfHeight) + { + set_Value (COLUMNNAME_ShelfHeight, Integer.valueOf(ShelfHeight)); + } + + /** Get Shelf Height. + @return Shelf height required + */ + public int getShelfHeight () + { + Integer ii = (Integer)get_Value(COLUMNNAME_ShelfHeight); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set Shelf Width. + @param ShelfWidth + Shelf width required + */ + public void setShelfWidth (int ShelfWidth) + { + set_Value (COLUMNNAME_ShelfWidth, Integer.valueOf(ShelfWidth)); + } + + /** Get Shelf Width. + @return Shelf width required + */ + public int getShelfWidth () + { + Integer ii = (Integer)get_Value(COLUMNNAME_ShelfWidth); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set SKU. + @param SKU + Stock Keeping Unit + */ + public void setSKU (String SKU) + { + + if (SKU != null && SKU.length() > 30) + { + log.warning("Length > 30 - truncated"); + SKU = SKU.substring(0, 30); + } + set_Value (COLUMNNAME_SKU, SKU); + } + + /** Get SKU. + @return Stock Keeping Unit + */ + public String getSKU () + { + return (String)get_Value(COLUMNNAME_SKU); + } + + public I_S_Resource getS_Resource() throws Exception + { + Class clazz = MTable.getClass(I_S_Resource.Table_Name); + I_S_Resource result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_S_Resource)constructor.newInstance(new Object[] {getCtx(), new Integer(getS_Resource_ID()), get_TrxName()}); + } catch (Exception e) { + log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); + log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); + throw e; + } + return result; + } + + /** Set Resource. + @param S_Resource_ID + Resource + */ + public void setS_Resource_ID (int S_Resource_ID) + { + if (S_Resource_ID < 1) + set_ValueNoCheck (COLUMNNAME_S_Resource_ID, null); + else + set_ValueNoCheck (COLUMNNAME_S_Resource_ID, Integer.valueOf(S_Resource_ID)); + } + + /** Get Resource. + @return Resource + */ + public int getS_Resource_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_S_Resource_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set UnitsPerPack. + @param UnitsPerPack + The Units Per Pack indicates the no of units of a product packed together. + */ + public void setUnitsPerPack (int UnitsPerPack) + { + set_Value (COLUMNNAME_UnitsPerPack, Integer.valueOf(UnitsPerPack)); + } + + /** Get UnitsPerPack. + @return The Units Per Pack indicates the no of units of a product packed together. + */ + public int getUnitsPerPack () + { + Integer ii = (Integer)get_Value(COLUMNNAME_UnitsPerPack); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set Units Per Pallet. + @param UnitsPerPallet + Units Per Pallet + */ + public void setUnitsPerPallet (int UnitsPerPallet) + { + set_Value (COLUMNNAME_UnitsPerPallet, Integer.valueOf(UnitsPerPallet)); + } + + /** Get Units Per Pallet. + @return Units Per Pallet + */ + public int getUnitsPerPallet () + { + Integer ii = (Integer)get_Value(COLUMNNAME_UnitsPerPallet); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set UPC/EAN. + @param UPC + Bar Code (Universal Product Code or its superset European Article Number) + */ + public void setUPC (String UPC) + { + + if (UPC != null && UPC.length() > 30) + { + log.warning("Length > 30 - truncated"); + UPC = UPC.substring(0, 30); + } + set_Value (COLUMNNAME_UPC, UPC); + } + + /** Get UPC/EAN. + @return Bar Code (Universal Product Code or its superset European Article Number) + */ + public String getUPC () + { + return (String)get_Value(COLUMNNAME_UPC); + } + + /** Set Search Key. + @param Value + Search key for the record in the format required - must be unique + */ + public void setValue (String Value) + { + if (Value == null) + throw new IllegalArgumentException ("Value is mandatory."); + + if (Value.length() > 40) + { + log.warning("Length > 40 - truncated"); + Value = Value.substring(0, 40); + } + set_Value (COLUMNNAME_Value, Value); + } + + /** Get Search Key. + @return Search key for the record in the format required - must be unique + */ + public String getValue () + { + return (String)get_Value(COLUMNNAME_Value); + } + + /** Set Version No. + @param VersionNo + Version Number + */ + public void setVersionNo (String VersionNo) + { + + if (VersionNo != null && VersionNo.length() > 20) + { + log.warning("Length > 20 - truncated"); + VersionNo = VersionNo.substring(0, 20); + } + set_Value (COLUMNNAME_VersionNo, VersionNo); + } + + /** Get Version No. + @return Version Number + */ + public String getVersionNo () + { + return (String)get_Value(COLUMNNAME_VersionNo); + } + + /** Set Volume. + @param Volume + Volume of a product + */ + public void setVolume (BigDecimal Volume) + { + set_Value (COLUMNNAME_Volume, Volume); + } + + /** Get Volume. + @return Volume of a product + */ + public BigDecimal getVolume () + { + BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_Volume); + if (bd == null) + return Env.ZERO; + return bd; + } + + /** Set Weight. + @param Weight + Weight of a product + */ + public void setWeight (BigDecimal Weight) + { + set_Value (COLUMNNAME_Weight, Weight); + } + + /** Get Weight. + @return Weight of a product + */ + public BigDecimal getWeight () + { + BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_Weight); + if (bd == null) + return Env.ZERO; + return bd; + } +} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/compiere/model/X_U_POSTerminal.java b/posterita/posterita/src/main/org/compiere/model/X_U_POSTerminal.java new file mode 100644 index 0000000000..b7b411bd85 --- /dev/null +++ b/posterita/posterita/src/main/org/compiere/model/X_U_POSTerminal.java @@ -0,0 +1,774 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2007 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program 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 General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +/** Generated Model - DO NOT CHANGE */ +package org.compiere.model; + +import java.lang.reflect.Constructor; +import java.sql.ResultSet; +import java.sql.Timestamp; +import java.util.Properties; +import java.util.logging.Level; + +/** Generated Model for U_POSTerminal + * @author Adempiere (generated) + * @version Release 3.4.0s - $Id$ */ +public class X_U_POSTerminal extends PO implements I_U_POSTerminal, I_Persistent +{ + + /** + * + */ + private static final long serialVersionUID = 1L; + + /** Standard Constructor */ + public X_U_POSTerminal (Properties ctx, int U_POSTerminal_ID, String trxName) + { + super (ctx, U_POSTerminal_ID, trxName); + /** if (U_POSTerminal_ID == 0) + { + setAutoLock (false); +// N + setCashBookTransferType (null); + setC_CashBook_ID (0); + setC_CashBPartner_ID (0); + setU_POSTerminal_ID (0); + } */ + } + + /** Load Constructor */ + public X_U_POSTerminal (Properties ctx, ResultSet rs, String trxName) + { + super (ctx, rs, trxName); + } + + /** AccessLevel + * @return 1 - Org + */ + protected int get_AccessLevel() + { + return accessLevel.intValue(); + } + + /** Load Meta Data */ + protected POInfo initPO (Properties ctx) + { + POInfo poi = POInfo.getPOInfo (ctx, Table_ID, get_TrxName()); + return poi; + } + + public String toString() + { + StringBuffer sb = new StringBuffer ("X_U_POSTerminal[") + .append(get_ID()).append("]"); + return sb.toString(); + } + + /** Set Auto Lock. + @param AutoLock + Whether to automatically lock the terminal when till is closed + */ + public void setAutoLock (boolean AutoLock) + { + set_Value (COLUMNNAME_AutoLock, Boolean.valueOf(AutoLock)); + } + + /** Get Auto Lock. + @return Whether to automatically lock the terminal when till is closed + */ + public boolean isAutoLock () + { + Object oo = get_Value(COLUMNNAME_AutoLock); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Card_BankAccount_ID AD_Reference_ID=52003 */ + public static final int CARD_BANKACCOUNT_ID_AD_Reference_ID=52003; + /** Set Card Bank Account. + @param Card_BankAccount_ID + Bank Account on which card transactions will be processed + */ + public void setCard_BankAccount_ID (int Card_BankAccount_ID) + { + if (Card_BankAccount_ID < 1) + set_Value (COLUMNNAME_Card_BankAccount_ID, null); + else + set_Value (COLUMNNAME_Card_BankAccount_ID, Integer.valueOf(Card_BankAccount_ID)); + } + + /** Get Card Bank Account. + @return Bank Account on which card transactions will be processed + */ + public int getCard_BankAccount_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_Card_BankAccount_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** CardTransferBankAccount_ID AD_Reference_ID=52003 */ + public static final int CARDTRANSFERBANKACCOUNT_ID_AD_Reference_ID=52003; + /** Set Transfer Card trx to. + @param CardTransferBankAccount_ID + Bank account on which to transfer Card transactions + */ + public void setCardTransferBankAccount_ID (int CardTransferBankAccount_ID) + { + if (CardTransferBankAccount_ID < 1) + set_Value (COLUMNNAME_CardTransferBankAccount_ID, null); + else + set_Value (COLUMNNAME_CardTransferBankAccount_ID, Integer.valueOf(CardTransferBankAccount_ID)); + } + + /** Get Transfer Card trx to. + @return Bank account on which to transfer Card transactions + */ + public int getCardTransferBankAccount_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_CardTransferBankAccount_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** CardTransferCashBook_ID AD_Reference_ID=52004 */ + public static final int CARDTRANSFERCASHBOOK_ID_AD_Reference_ID=52004; + /** Set Transfer Card trx to. + @param CardTransferCashBook_ID + Cash Book on which to transfer all Card transactions + */ + public void setCardTransferCashBook_ID (int CardTransferCashBook_ID) + { + if (CardTransferCashBook_ID < 1) + set_Value (COLUMNNAME_CardTransferCashBook_ID, null); + else + set_Value (COLUMNNAME_CardTransferCashBook_ID, Integer.valueOf(CardTransferCashBook_ID)); + } + + /** Get Transfer Card trx to. + @return Cash Book on which to transfer all Card transactions + */ + public int getCardTransferCashBook_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_CardTransferCashBook_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** CardTransferType AD_Reference_ID=52002 */ + public static final int CARDTRANSFERTYPE_AD_Reference_ID=52002; + /** Bank Account = B */ + public static final String CARDTRANSFERTYPE_BankAccount = "B"; + /** CashBook = C */ + public static final String CARDTRANSFERTYPE_CashBook = "C"; + /** Set Card Transfer Type. + @param CardTransferType Card Transfer Type */ + public void setCardTransferType (String CardTransferType) + { + + if (CardTransferType == null || CardTransferType.equals("B") || CardTransferType.equals("C")); else throw new IllegalArgumentException ("CardTransferType Invalid value - " + CardTransferType + " - Reference_ID=52002 - B - C"); + if (CardTransferType != null && CardTransferType.length() > 1) + { + log.warning("Length > 1 - truncated"); + CardTransferType = CardTransferType.substring(0, 1); + } + set_Value (COLUMNNAME_CardTransferType, CardTransferType); + } + + /** Get Card Transfer Type. + @return Card Transfer Type */ + public String getCardTransferType () + { + return (String)get_Value(COLUMNNAME_CardTransferType); + } + + /** CashBookTransferType AD_Reference_ID=52002 */ + public static final int CASHBOOKTRANSFERTYPE_AD_Reference_ID=52002; + /** Bank Account = B */ + public static final String CASHBOOKTRANSFERTYPE_BankAccount = "B"; + /** CashBook = C */ + public static final String CASHBOOKTRANSFERTYPE_CashBook = "C"; + /** Set Cash Book Transfer Type. + @param CashBookTransferType + Where the money in the cash book should be transfered to. Either a Bank Account or another Cash Book + */ + public void setCashBookTransferType (String CashBookTransferType) + { + if (CashBookTransferType == null) throw new IllegalArgumentException ("CashBookTransferType is mandatory"); + if (CashBookTransferType.equals("B") || CashBookTransferType.equals("C")); else throw new IllegalArgumentException ("CashBookTransferType Invalid value - " + CashBookTransferType + " - Reference_ID=52002 - B - C"); + if (CashBookTransferType.length() > 1) + { + log.warning("Length > 1 - truncated"); + CashBookTransferType = CashBookTransferType.substring(0, 1); + } + set_Value (COLUMNNAME_CashBookTransferType, CashBookTransferType); + } + + /** Get Cash Book Transfer Type. + @return Where the money in the cash book should be transfered to. Either a Bank Account or another Cash Book + */ + public String getCashBookTransferType () + { + return (String)get_Value(COLUMNNAME_CashBookTransferType); + } + + /** CashTransferBankAccount_ID AD_Reference_ID=52003 */ + public static final int CASHTRANSFERBANKACCOUNT_ID_AD_Reference_ID=52003; + /** Set Transfer Cash trx to. + @param CashTransferBankAccount_ID + Bank Account on which to transfer all Cash transactions + */ + public void setCashTransferBankAccount_ID (int CashTransferBankAccount_ID) + { + if (CashTransferBankAccount_ID < 1) + set_Value (COLUMNNAME_CashTransferBankAccount_ID, null); + else + set_Value (COLUMNNAME_CashTransferBankAccount_ID, Integer.valueOf(CashTransferBankAccount_ID)); + } + + /** Get Transfer Cash trx to. + @return Bank Account on which to transfer all Cash transactions + */ + public int getCashTransferBankAccount_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_CashTransferBankAccount_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** CashTransferCashBook_ID AD_Reference_ID=52004 */ + public static final int CASHTRANSFERCASHBOOK_ID_AD_Reference_ID=52004; + /** Set Transfer Cash trx to. + @param CashTransferCashBook_ID + Cash Book on which to transfer all Cash transactions + */ + public void setCashTransferCashBook_ID (int CashTransferCashBook_ID) + { + if (CashTransferCashBook_ID < 1) + set_Value (COLUMNNAME_CashTransferCashBook_ID, null); + else + set_Value (COLUMNNAME_CashTransferCashBook_ID, Integer.valueOf(CashTransferCashBook_ID)); + } + + /** Get Transfer Cash trx to. + @return Cash Book on which to transfer all Cash transactions + */ + public int getCashTransferCashBook_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_CashTransferCashBook_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + public I_C_CashBook getC_CashBook() throws Exception + { + Class clazz = MTable.getClass(I_C_CashBook.Table_Name); + I_C_CashBook result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_C_CashBook)constructor.newInstance(new Object[] {getCtx(), new Integer(getC_CashBook_ID()), get_TrxName()}); + } catch (Exception e) { + log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); + log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); + throw e; + } + return result; + } + + /** Set Cash Book. + @param C_CashBook_ID + Cash Book for recording petty cash transactions + */ + public void setC_CashBook_ID (int C_CashBook_ID) + { + if (C_CashBook_ID < 1) + throw new IllegalArgumentException ("C_CashBook_ID is mandatory."); + set_Value (COLUMNNAME_C_CashBook_ID, Integer.valueOf(C_CashBook_ID)); + } + + /** Get Cash Book. + @return Cash Book for recording petty cash transactions + */ + public int getC_CashBook_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_CashBook_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** C_CashBPartner_ID AD_Reference_ID=173 */ + public static final int C_CASHBPARTNER_ID_AD_Reference_ID=173; + /** Set Cash BPartner. + @param C_CashBPartner_ID + BPartner to be used for Cash transactions + */ + public void setC_CashBPartner_ID (int C_CashBPartner_ID) + { + if (C_CashBPartner_ID < 1) + throw new IllegalArgumentException ("C_CashBPartner_ID is mandatory."); + set_Value (COLUMNNAME_C_CashBPartner_ID, Integer.valueOf(C_CashBPartner_ID)); + } + + /** Get Cash BPartner. + @return BPartner to be used for Cash transactions + */ + public int getC_CashBPartner_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_CashBPartner_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Check_BankAccount_ID AD_Reference_ID=52003 */ + public static final int CHECK_BANKACCOUNT_ID_AD_Reference_ID=52003; + /** Set Check Bank Account. + @param Check_BankAccount_ID + Bank Account to be used for processing Check transactions + */ + public void setCheck_BankAccount_ID (int Check_BankAccount_ID) + { + if (Check_BankAccount_ID < 1) + set_Value (COLUMNNAME_Check_BankAccount_ID, null); + else + set_Value (COLUMNNAME_Check_BankAccount_ID, Integer.valueOf(Check_BankAccount_ID)); + } + + /** Get Check Bank Account. + @return Bank Account to be used for processing Check transactions + */ + public int getCheck_BankAccount_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_Check_BankAccount_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** CheckTransferBankAccount_ID AD_Reference_ID=52003 */ + public static final int CHECKTRANSFERBANKACCOUNT_ID_AD_Reference_ID=52003; + /** Set Tranfer Check trx to. + @param CheckTransferBankAccount_ID + Bank account on which to transfer Check transactions + */ + public void setCheckTransferBankAccount_ID (int CheckTransferBankAccount_ID) + { + if (CheckTransferBankAccount_ID < 1) + set_Value (COLUMNNAME_CheckTransferBankAccount_ID, null); + else + set_Value (COLUMNNAME_CheckTransferBankAccount_ID, Integer.valueOf(CheckTransferBankAccount_ID)); + } + + /** Get Tranfer Check trx to. + @return Bank account on which to transfer Check transactions + */ + public int getCheckTransferBankAccount_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_CheckTransferBankAccount_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** CheckTransferCashBook_ID AD_Reference_ID=52004 */ + public static final int CHECKTRANSFERCASHBOOK_ID_AD_Reference_ID=52004; + /** Set Transfer Check trx to. + @param CheckTransferCashBook_ID + Cash Book on which to transfer all Check transactions + */ + public void setCheckTransferCashBook_ID (int CheckTransferCashBook_ID) + { + if (CheckTransferCashBook_ID < 1) + set_Value (COLUMNNAME_CheckTransferCashBook_ID, null); + else + set_Value (COLUMNNAME_CheckTransferCashBook_ID, Integer.valueOf(CheckTransferCashBook_ID)); + } + + /** Get Transfer Check trx to. + @return Cash Book on which to transfer all Check transactions + */ + public int getCheckTransferCashBook_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_CheckTransferCashBook_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** CheckTransferType AD_Reference_ID=52002 */ + public static final int CHECKTRANSFERTYPE_AD_Reference_ID=52002; + /** Bank Account = B */ + public static final String CHECKTRANSFERTYPE_BankAccount = "B"; + /** CashBook = C */ + public static final String CHECKTRANSFERTYPE_CashBook = "C"; + /** Set Check Transfer Type. + @param CheckTransferType Check Transfer Type */ + public void setCheckTransferType (String CheckTransferType) + { + + if (CheckTransferType == null || CheckTransferType.equals("B") || CheckTransferType.equals("C")); else throw new IllegalArgumentException ("CheckTransferType Invalid value - " + CheckTransferType + " - Reference_ID=52002 - B - C"); + if (CheckTransferType != null && CheckTransferType.length() > 1) + { + log.warning("Length > 1 - truncated"); + CheckTransferType = CheckTransferType.substring(0, 1); + } + set_Value (COLUMNNAME_CheckTransferType, CheckTransferType); + } + + /** Get Check Transfer Type. + @return Check Transfer Type */ + public String getCheckTransferType () + { + return (String)get_Value(COLUMNNAME_CheckTransferType); + } + + /** C_TemplateBPartner_ID AD_Reference_ID=173 */ + public static final int C_TEMPLATEBPARTNER_ID_AD_Reference_ID=173; + /** Set Template BPartner. + @param C_TemplateBPartner_ID + BPartner that is to be used as template when new customers are created + */ + public void setC_TemplateBPartner_ID (int C_TemplateBPartner_ID) + { + if (C_TemplateBPartner_ID < 1) + set_Value (COLUMNNAME_C_TemplateBPartner_ID, null); + else + set_Value (COLUMNNAME_C_TemplateBPartner_ID, Integer.valueOf(C_TemplateBPartner_ID)); + } + + /** Get Template BPartner. + @return BPartner that is to be used as template when new customers are created + */ + public int getC_TemplateBPartner_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_TemplateBPartner_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set Description. + @param Description + Optional short description of the record + */ + public void setDescription (String Description) + { + + if (Description != null && Description.length() > 255) + { + log.warning("Length > 255 - truncated"); + Description = Description.substring(0, 255); + } + set_Value (COLUMNNAME_Description, Description); + } + + /** Get Description. + @return Optional short description of the record + */ + public String getDescription () + { + return (String)get_Value(COLUMNNAME_Description); + } + + /** Set Comment/Help. + @param Help + Comment or Hint + */ + public void setHelp (String Help) + { + + if (Help != null && Help.length() > 2000) + { + log.warning("Length > 2000 - truncated"); + Help = Help.substring(0, 2000); + } + set_Value (COLUMNNAME_Help, Help); + } + + /** Get Comment/Help. + @return Comment or Hint + */ + public String getHelp () + { + return (String)get_Value(COLUMNNAME_Help); + } + + /** Set Last Lock Time. + @param LastLockTime + Last time at which the terminal was locked + */ + public void setLastLockTime (Timestamp LastLockTime) + { + set_Value (COLUMNNAME_LastLockTime, LastLockTime); + } + + /** Get Last Lock Time. + @return Last time at which the terminal was locked + */ + public Timestamp getLastLockTime () + { + return (Timestamp)get_Value(COLUMNNAME_LastLockTime); + } + + /** Set Locked. + @param Locked + Whether the terminal is locked + */ + public void setLocked (boolean Locked) + { + set_Value (COLUMNNAME_Locked, Boolean.valueOf(Locked)); + } + + /** Get Locked. + @return Whether the terminal is locked + */ + public boolean isLocked () + { + Object oo = get_Value(COLUMNNAME_Locked); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Lock Time. + @param LockTime + Time in minutes the terminal should be kept in a locked state. + */ + public void setLockTime (int LockTime) + { + set_Value (COLUMNNAME_LockTime, Integer.valueOf(LockTime)); + } + + /** Get Lock Time. + @return Time in minutes the terminal should be kept in a locked state. + */ + public int getLockTime () + { + Integer ii = (Integer)get_Value(COLUMNNAME_LockTime); + if (ii == null) + return 0; + return ii.intValue(); + } + + public I_M_Warehouse getM_Warehouse() throws Exception + { + Class clazz = MTable.getClass(I_M_Warehouse.Table_Name); + I_M_Warehouse result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_M_Warehouse)constructor.newInstance(new Object[] {getCtx(), new Integer(getM_Warehouse_ID()), get_TrxName()}); + } catch (Exception e) { + log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); + log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); + throw e; + } + return result; + } + + /** Set Warehouse. + @param M_Warehouse_ID + Storage Warehouse and Service Point + */ + public void setM_Warehouse_ID (int M_Warehouse_ID) + { + if (M_Warehouse_ID < 1) + set_Value (COLUMNNAME_M_Warehouse_ID, null); + else + set_Value (COLUMNNAME_M_Warehouse_ID, Integer.valueOf(M_Warehouse_ID)); + } + + /** Get Warehouse. + @return Storage Warehouse and Service Point + */ + public int getM_Warehouse_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_M_Warehouse_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set Name. + @param Name + Alphanumeric identifier of the entity + */ + public void setName (String Name) + { + + if (Name != null && Name.length() > 60) + { + log.warning("Length > 60 - truncated"); + Name = Name.substring(0, 60); + } + set_Value (COLUMNNAME_Name, Name); + } + + /** Get Name. + @return Alphanumeric identifier of the entity + */ + public String getName () + { + return (String)get_Value(COLUMNNAME_Name); + } + + /** PO_PriceList_ID AD_Reference_ID=166 */ + public static final int PO_PRICELIST_ID_AD_Reference_ID=166; + /** Set Purchase Pricelist. + @param PO_PriceList_ID + Price List used by this Business Partner + */ + public void setPO_PriceList_ID (int PO_PriceList_ID) + { + if (PO_PriceList_ID < 1) + set_Value (COLUMNNAME_PO_PriceList_ID, null); + else + set_Value (COLUMNNAME_PO_PriceList_ID, Integer.valueOf(PO_PriceList_ID)); + } + + /** Get Purchase Pricelist. + @return Price List used by this Business Partner + */ + public int getPO_PriceList_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_PO_PriceList_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set Printer Name. + @param PrinterName + Name of the Printer + */ + public void setPrinterName (String PrinterName) + { + + if (PrinterName != null && PrinterName.length() > 60) + { + log.warning("Length > 60 - truncated"); + PrinterName = PrinterName.substring(0, 60); + } + set_Value (COLUMNNAME_PrinterName, PrinterName); + } + + /** Get Printer Name. + @return Name of the Printer + */ + public String getPrinterName () + { + return (String)get_Value(COLUMNNAME_PrinterName); + } + + /** SalesRep_ID AD_Reference_ID=316 */ + public static final int SALESREP_ID_AD_Reference_ID=316; + /** Set Sales Representative. + @param SalesRep_ID + Sales Representative or Company Agent + */ + public void setSalesRep_ID (int SalesRep_ID) + { + if (SalesRep_ID < 1) + set_Value (COLUMNNAME_SalesRep_ID, null); + else + set_Value (COLUMNNAME_SalesRep_ID, Integer.valueOf(SalesRep_ID)); + } + + /** Get Sales Representative. + @return Sales Representative or Company Agent + */ + public int getSalesRep_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_SalesRep_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** SO_PriceList_ID AD_Reference_ID=166 */ + public static final int SO_PRICELIST_ID_AD_Reference_ID=166; + /** Set Sales Pricelist. + @param SO_PriceList_ID Sales Pricelist */ + public void setSO_PriceList_ID (int SO_PriceList_ID) + { + if (SO_PriceList_ID < 1) + set_Value (COLUMNNAME_SO_PriceList_ID, null); + else + set_Value (COLUMNNAME_SO_PriceList_ID, Integer.valueOf(SO_PriceList_ID)); + } + + /** Get Sales Pricelist. + @return Sales Pricelist */ + public int getSO_PriceList_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_SO_PriceList_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set UnlockingTime. + @param UnlockingTime + Time at which the terminal should be unlocked + */ + public void setUnlockingTime (Timestamp UnlockingTime) + { + set_Value (COLUMNNAME_UnlockingTime, UnlockingTime); + } + + /** Get UnlockingTime. + @return Time at which the terminal should be unlocked + */ + public Timestamp getUnlockingTime () + { + return (Timestamp)get_Value(COLUMNNAME_UnlockingTime); + } + + /** Set POS Terminal. + @param U_POSTerminal_ID POS Terminal */ + public void setU_POSTerminal_ID (int U_POSTerminal_ID) + { + if (U_POSTerminal_ID < 1) + throw new IllegalArgumentException ("U_POSTerminal_ID is mandatory."); + set_ValueNoCheck (COLUMNNAME_U_POSTerminal_ID, Integer.valueOf(U_POSTerminal_ID)); + } + + /** Get POS Terminal. + @return POS Terminal */ + public int getU_POSTerminal_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_U_POSTerminal_ID); + if (ii == null) + return 0; + return ii.intValue(); + } +} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/compiere/report/ReportStarter.java b/posterita/posterita/src/main/org/compiere/report/ReportStarter.java new file mode 100644 index 0000000000..d6896b52e0 --- /dev/null +++ b/posterita/posterita/src/main/org/compiere/report/ReportStarter.java @@ -0,0 +1,1123 @@ +/* + */ +package org.compiere.report; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.FilenameFilter; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.math.BigDecimal; +import java.net.InetAddress; +import java.net.MalformedURLException; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URL; +import java.net.UnknownHostException; +import java.rmi.RemoteException; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Hashtable; +import java.util.Map; +import java.util.Properties; +import java.util.PropertyResourceBundle; + +import javax.ejb.CreateException; +import javax.ejb.RemoveException; +import javax.naming.InitialContext; +import javax.naming.NamingException; + +import net.sf.jasperreports.engine.JRException; +import net.sf.jasperreports.engine.JasperCompileManager; +import net.sf.jasperreports.engine.JasperFillManager; +import net.sf.jasperreports.engine.JasperPrint; +import net.sf.jasperreports.engine.JasperReport; +import net.sf.jasperreports.engine.util.JRLoader; + +import org.compiere.db.CConnection; +import org.compiere.db.ServerConnection; +import org.compiere.interfaces.MD5; +import org.compiere.interfaces.MD5Home; +import org.compiere.model.MAttachment; +import org.compiere.model.MAttachmentEntry; +import org.compiere.model.MProcess; +import org.compiere.process.ClientProcess; +import org.compiere.process.ProcessCall; +import org.compiere.process.ProcessInfo; +import org.compiere.process.ProcessInfoParameter; +import org.compiere.util.CLogger; +import org.compiere.util.DB; +import org.compiere.util.Env; +import org.compiere.util.Ini; +import org.compiere.util.Language; +import org.compiere.util.Trx; +import org.compiere.utils.DBUtils; +import org.compiere.utils.DigestOfFile; + +/** + * @author rlemeill + * originaly coming from an application note from compiere.co.uk + * --- + * Modifications: Allow Jasper Reports to be able to be run on VPN profile (i.e: no direct connection to DB). + * Implemented ClientProcess for it to run on client. + * @author Ashley Ramdass + */ +public class ReportStarter implements ProcessCall, ClientProcess { +//logger + private static CLogger log = CLogger.getCLogger(ReportStarter.class); + private static File REPORT_HOME = null; + + private static JRViewerProvider viewerProvider = new SwingJRViewerProvider(); + private static JasperPrint jasperPrint; + + static { + System.setProperty( "javax.xml.parsers.SAXParserFactory", "org.apache.xerces.jaxp.SAXParserFactoryImpl"); + System.setProperty( "org.xml.sax.driver", "org.apache.xerces.parsers.SAXParser"); + + String reportPath = System.getProperty("org.compiere.report.path"); + if (reportPath == null) { + REPORT_HOME = new File(Ini.getAdempiereHome() + File.separator + "reports"); + } else { + REPORT_HOME = new File(reportPath); + } + } + + private ProcessInfo processInfo; + private MAttachment attachment; + + + /** + * @param requestURL + * @return true if the report is on the same ip address than Application Server + */ + private boolean isRequestedonAS(URL requestURL) + { + boolean tBool = false; + try{ + InetAddress[] request_iaddrs = InetAddress.getAllByName(requestURL.getHost()); + InetAddress as_iaddr = InetAddress.getByName(CConnection.get().getAppsHost()); + for(int i=0;i 0) + fout.write(buf, 0, s); + + in.close(); + fout.flush(); + fout.close(); + return downloadedFile; + } catch (FileNotFoundException e) { + if(reportLocation.indexOf("Subreport") == -1) // Only show the warning if it is not a subreport + log.warning("404 not found: Report cannot be found on server "+ e.getMessage()); + return null; + } catch (IOException e) { + log.severe("I/O error when trying to download (sub)report from server "+ e.getMessage()); + return null; + } + } + + /** + * Search for additional subreports deployed to a webcontext if + * the parent report is located there + * @author deathmeat + * @param reportName The original reportname + * @param reportPath The full path to the parent report + * @param fileExtension The file extension of the parent report + * @return An Array of File objects referencing to the downloaded subreports + */ + private File[] getHttpSubreports(String reportName, String reportPath, String fileExtension) + { + ArrayList subreports = new ArrayList(); + String remoteDir = reportPath.substring(0, reportPath.lastIndexOf("/")); + + // Currently check hardcoded for max. 10 subreports + for(int i=1; i<10; i++) + { + // Check if subreport number i exists + File subreport = httpDownloadedReport(remoteDir + "/" + reportName + i + fileExtension); + if(subreport == null) // Subreport doesn't exist, abort further approaches + break; + + subreports.add(subreport); + } + + File[] subreportsTemp = new File[0]; + subreportsTemp = subreports.toArray(subreportsTemp); + return subreportsTemp; + } + + /** + * @author rlemeill + * @param reportLocation http string url ex: http://adempiereserver.domain.com/webApp/standalone.jrxml + * @return downloaded File (or already existing one) + */ + private File httpDownloadedReport(String reportLocation) + { + File reportFile = null; + File downloadedFile = null; + log.info(" report deployed to " + reportLocation); + try { + + + String[] tmps = reportLocation.split("/"); + String cleanFile = tmps[tmps.length-1]; + String localFile = System.getProperty("java.io.tmpdir") + System.getProperty("file.separator") + cleanFile; + String downloadedLocalFile = System.getProperty("java.io.tmpdir") + System.getProperty("file.separator")+"TMP" + cleanFile; + + reportFile = new File(localFile); + + + if (reportFile.exists()) + { + String localMD5hash = DigestOfFile.GetLocalMD5Hash(reportFile); + String remoteMD5Hash = ejbGetRemoteMD5(reportLocation); + log.info("MD5 for local file is "+localMD5hash ); + if ( remoteMD5Hash != null) + { + if (localMD5hash.equals(remoteMD5Hash)) + { + log.info(" no need to download: local report is up-to-date"); + } + else + { + log.info(" report on server is different that local one, download and replace"); + downloadedFile = getRemoteFile(reportLocation, downloadedLocalFile); + reportFile.delete(); + downloadedFile.renameTo(reportFile); + } + } + else + { + log.warning("Remote hashing is not available did you deployed webApp.ear?"); + downloadedFile = getRemoteFile(reportLocation, downloadedLocalFile); + // compare hash of existing and downloaded + if ( DigestOfFile.md5localHashCompare(reportFile,downloadedFile) ) + { + //nothing file are identic + log.info(" no need to replace your existing report"); + } + else + { + log.info(" report on server is different that local one, replacing"); + reportFile.delete(); + downloadedFile.renameTo(reportFile); + } + } + } + else + { + reportFile = getRemoteFile(reportLocation,localFile); + } + + } + catch (Exception e) { + log.severe("Unknown exception: "+ e.getMessage()); + return null; + } + return reportFile; + } + + /** + * Returns the Server Connection if direct connection is not available + * (VPN, WAN, Terminal) and thus query has to be run on server only else return + * a direct connection to DB. + * + * Notes: Need to refactor and integrate in DB if confirmed to be working as + * expected. + * + * @author Ashley Ramdass + * @return Connection DB Connection + */ + protected Connection getConnection() + { + if (DB.isRemoteObjects()) + { + return new ServerConnection(); + } + else + { + return DB.getConnectionRW(); + } + } + + /** + * Start the process. + * Called then pressing the Process button in R_Request. + * It should only return false, if the function could not be performed + * as this causes the process to abort. + * @author rlemeill + * @param ctx context + * @param pi Compiere standard process info + * @param trx + * @return true if success + */ + public boolean startProcess(Properties ctx, ProcessInfo pi, Trx trx) { + + processInfo = pi; + String Name=pi.getTitle(); + int AD_PInstance_ID=pi.getAD_PInstance_ID(); + int Record_ID=pi.getRecord_ID(); + log.info( "Name="+Name+" AD_PInstance_ID="+AD_PInstance_ID+" Record_ID="+Record_ID); + String trxName = null; + if (trx != null) { + trxName = trx.getTrxName(); + } + ReportData reportData = getReportData( pi, trxName); + if (reportData==null) { + reportResult( AD_PInstance_ID, "Can not find report data", trxName); + return false; + } + + String reportPath = reportData.getReportFilePath(); + if ((reportPath==null)||(reportPath.length()==0)) { + reportResult( AD_PInstance_ID, "Can not find report", trxName); + return false; + } + + JasperData data = null; + File reportFile = null; + String fileExtension = ""; + HashMap params = new HashMap( ctx); + + addProcessParameters( AD_PInstance_ID, params, trxName); + + addProcessInfoParameters(params, pi.getParameter()); + + reportFile = getReportFile(reportPath, (String)params.get("ReportType")); + + if (reportFile == null || reportFile.exists() == false) + { + log.severe("No report file found for given type, falling back to " + reportPath); + reportFile = getReportFile(reportPath); + } + + if (reportFile == null || reportFile.exists() == false) { + String tmp = "Can not find report file at path - " + reportPath; + log.severe(tmp); + reportResult(AD_PInstance_ID, tmp, trxName); + } + + if (reportFile != null) + { + data = processReport(reportFile); + fileExtension = reportFile.getName().substring(reportFile.getName().lastIndexOf("."), + reportFile.getName().length()); + } + else + { + return false; + } + + JasperReport jasperReport = data.getJasperReport(); + String jasperName = data.getJasperName(); + File reportDir = data.getReportDir(); + + if (jasperReport != null) { + File[] subreports; + + // Subreports + if(reportPath.startsWith("http://") || reportPath.startsWith("https://")) + { + // Locate and download subreports from remote webcontext + subreports = getHttpSubreports(jasperName + "Subreport", reportPath, fileExtension); + } + else if (reportPath.startsWith("attachment:")) + { + subreports = getAttachmentSubreports(reportPath); + } + else if (reportPath.startsWith("resource:")) + { + subreports = getResourceSubreports(jasperName + "Subreport", reportPath, fileExtension); + } + // TODO: Implement file:/ lookup for subreports + else + { + // Locate subreports from local/remote filesystem + subreports = reportDir.listFiles( new FileFilter( jasperName+"Subreport", reportDir, fileExtension)); + } + + for( int i=0; i 0) + params.put("RECORD_ID", new Integer( Record_ID)); + + // contribution from Ricardo (ralexsander) + // in iReports you can 'SELECT' AD_Client_ID, AD_Org_ID and AD_User_ID using only AD_PINSTANCE_ID + params.put("AD_PINSTANCE_ID", new Integer( AD_PInstance_ID)); + + Language currLang = Env.getLanguage(Env.getCtx()); + params.put("CURRENT_LANG", currLang.getAD_Language()); + // Resources + File resFile = null; + if (reportPath.startsWith("attachment:") && attachment != null) { + resFile = getAttachmentResourceFile(jasperName, currLang); + } else if (reportPath.startsWith("resource:")) { + resFile = getResourcesForResourceFile(jasperName, currLang); + // TODO: Implement file:/ for resources + } else { + File[] resources = reportDir.listFiles( new FileFilter( jasperName, reportDir, ".properties")); + // try baseName + "_" + language + for( int i=0; i subreports = new ArrayList(); + MAttachmentEntry[] entries = attachment.getEntries(); + for(int i = 0; i < entries.length; i++) { + if (!entries[i].getName().equals(name) && + (entries[i].getName().endsWith(".jrxml") || entries[i].getName().endsWith(".jasper"))) { + File reportFile = getAttachmentEntryFile(entries[i]); + if (reportFile != null) + subreports.add(reportFile); + } + } + File[] files = new File[subreports.size()]; + File[] subreportsTemp = new File[0]; + subreportsTemp = subreports.toArray(subreportsTemp); + return subreportsTemp; + } + + /** + * Search for additional subreports deployed as resources + * @param reportName The original reportname + * @param reportPath The full path to the parent report + * @param fileExtension The file extension of the parent report + * @return An Array of File objects referencing to the downloaded subreports + */ + private File[] getResourceSubreports(String reportName, String reportPath, String fileExtension) + { + ArrayList subreports = new ArrayList(); + String remoteDir = reportPath.substring(0, reportPath.lastIndexOf("/")); + + // Currently check hardcoded for max. 10 subreports + for(int i=1; i<10; i++) + { + // Check if subreport number i exists + File subreport = null; + try { + subreport = getFileAsResource(remoteDir + "/" + reportName + i + fileExtension); + } catch (Exception e) { + // just ignore it + } + if(subreport == null) // Subreport doesn't exist, abort further approaches + break; + + subreports.add(subreport); + } + + File[] subreportsTemp = new File[0]; + subreportsTemp = subreports.toArray(subreportsTemp); + return subreportsTemp; + } + + /** + * @author alinv + * @param reportPath + * @param reportType + * @return the abstract file corresponding to typed report + */ + protected File getReportFile(String reportPath, String reportType) { + + if (reportType != null) + { + int cpos = reportPath.lastIndexOf('.'); + reportPath = reportPath.substring(0, cpos) + "_" + reportType + reportPath.substring(cpos, reportPath.length()); + } + + return getReportFile(reportPath); + } + + /** + * @author alinv + * @param reportPath + * @return the abstract file corresponding to report + */ + protected File getReportFile(String reportPath) { + File reportFile = null; + + // Reports deployement on web server Thanks to Alin Vaida + if (reportPath.startsWith("http://") || reportPath.startsWith("https://")) { + reportFile = httpDownloadedReport(reportPath); + } else if (reportPath.startsWith("attachment:")) { + //report file from process attachment + reportFile = downloadAttachment(reportPath); + } else if(reportPath.startsWith("/")) { + reportFile = new File(reportPath); + } else if (reportPath.startsWith("file:/")) { + try { + reportFile = new File(new URI(reportPath)); + } catch (URISyntaxException e) { + log.warning(e.getLocalizedMessage()); + reportFile = null; + } + } else if (reportPath.startsWith("resource:")) { + try { + reportFile = getFileAsResource(reportPath); + } catch (Exception e) { + log.warning(e.getLocalizedMessage()); + reportFile = null; + } + } else { + reportFile = new File(REPORT_HOME, reportPath); + } + + // Set org.compiere.report.path because it is used in reports which refer to subreports + System.setProperty("org.compiere.report.path", reportFile.getParentFile().getAbsolutePath()); + return reportFile; + } + + /** + * @param reportPath + * @return + * @throws Exception + */ + private File getFileAsResource(String reportPath) throws Exception { + File reportFile; + String name = reportPath.substring("resource:".length()).trim(); + String localName = name.replace('/', '_'); + log.info("reportPath = " + reportPath); + log.info("getting resource from = " + getClass().getClassLoader().getResource(name)); + InputStream inputStream = getClass().getClassLoader().getResourceAsStream(name); + String localFile = System.getProperty("java.io.tmpdir") + System.getProperty("file.separator") + localName; + log.info("localFile = " + localFile); + reportFile = new File(localFile); + + OutputStream out = null; + out = new FileOutputStream(reportFile); + if (out != null){ + byte buf[]=new byte[1024]; + int len; + while((len=inputStream.read(buf))>0) + out.write(buf,0,len); + out.close(); + inputStream.close(); + } + + return reportFile; + } + + /** + * Download db attachment + * @param reportPath must of syntax attachment:filename + * @return File + */ + private File downloadAttachment(String reportPath) { + File reportFile = null; + String name = reportPath.substring("attachment:".length()).trim(); + MProcess process = new MProcess(Env.getCtx(), processInfo.getAD_Process_ID(), processInfo.getTransactionName()); + attachment = process.getAttachment(); + if (attachment != null) { + MAttachmentEntry[] entries = attachment.getEntries(); + MAttachmentEntry entry = null; + for (int i = 0; i < entries.length; i++) { + if (entries[i].getName().equals(name)) { + entry = entries[i]; + break; + } + } + if (entry != null) { + reportFile = getAttachmentEntryFile(entry); + } + } + return reportFile; + } + + /** + * Download db attachment to local file + * @param entry + * @return File + */ + private File getAttachmentEntryFile(MAttachmentEntry entry) { + String localFile = System.getProperty("java.io.tmpdir") + System.getProperty("file.separator") + entry.getName(); + String downloadedLocalFile = System.getProperty("java.io.tmpdir") + System.getProperty("file.separator")+"TMP" + entry.getName(); + File reportFile = new File(localFile); + if (reportFile.exists()) { + String localMD5hash = DigestOfFile.GetLocalMD5Hash(reportFile); + String entryMD5hash = DigestOfFile.getMD5Hash(entry.getData()); + if (localMD5hash.equals(entryMD5hash)) + { + log.info(" no need to download: local report is up-to-date"); + } + else + { + log.info(" report on server is different that local one, download and replace"); + File downloadedFile = new File(downloadedLocalFile); + entry.getFile(downloadedFile); + reportFile.delete(); + downloadedFile.renameTo(reportFile); + } + } else { + entry.getFile(reportFile); + } + return reportFile; + } + + /** + * @author rlemeill + * @param AD_PInstance_ID + * @param errMsg + */ + protected void reportResult( int AD_PInstance_ID, String errMsg, String trxName) { + int result = (errMsg==null)?1:0; + errMsg = (errMsg==null)?"":errMsg; + String sql = "UPDATE AD_PInstance SET result="+result+", errormsg='"+errMsg+"' "+ + "WHERE AD_PInstance_ID="+AD_PInstance_ID; + Statement pstmt = null; + try { + pstmt = DB.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE, trxName); + pstmt.executeUpdate(sql); + pstmt.close(); + } catch (SQLException e) { + log.severe(sql+e.getMessage()); + } finally { + DBUtils.close( pstmt); + } + } + + /** + * @author rlemeill + * @param reportFile + * @return + */ + protected JasperData processReport( File reportFile) { + log.info( "reportFile.getAbsolutePath() = "+reportFile.getAbsolutePath()); + JasperReport jasperReport = null; + + String jasperName = reportFile.getName(); + int pos = jasperName.indexOf('.'); + if (pos!=-1) jasperName = jasperName.substring(0, pos); + File reportDir = reportFile.getParentFile(); + + //test if the compiled report exists + File jasperFile = new File( reportDir.getAbsolutePath(), jasperName+".jasper"); + if (jasperFile.exists()) { // test time + if (reportFile.lastModified() == jasperFile.lastModified()) { + log.info(" no need to compile use "+jasperFile.getAbsolutePath()); + try { + jasperReport = (JasperReport)JRLoader.loadObject(jasperFile.getAbsolutePath()); + } catch (JRException e) { + jasperReport = null; + log.severe("Can not load report - "+ e.getMessage()); + } + } else { + jasperReport = compileReport( reportFile, jasperFile); + } + } else { // create new jasper file + jasperReport = compileReport( reportFile, jasperFile); + } + + return new JasperData( jasperReport, reportDir, jasperName, jasperFile); + } + + + protected void addProcessParameters( int AD_PInstance_ID, Map params, String trxName) { + log.info(""); + String sql = "SELECT ParameterName, "+ + "P_String, "+ + "P_String_To, "+ + "P_Number, "+ + "P_Number_To, "+ + "P_Date, "+ + "P_Date_To "+ + "FROM AD_PInstance_Para "+ + "WHERE AD_PInstance_ID=?"; + PreparedStatement pstmt = null; + ResultSet rs = null; + try { + pstmt = DB.prepareStatement(sql, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY, trxName); + pstmt.setInt(1, AD_PInstance_ID); + rs = pstmt.executeQuery(); + while (rs.next()) { + String name = rs.getString(1); + String pStr = rs.getString(2); + String pStrTo = rs.getString(3); + //Double pNum = new Double( rs.getDouble(4)); + //Double pNumTo = new Double( rs.getDouble(5)); + BigDecimal pNum = rs.getBigDecimal(4); + BigDecimal pNumTo = rs.getBigDecimal(5); + + Timestamp pDate = rs.getTimestamp(6); + Timestamp pDateTo = rs.getTimestamp(7); + if (pStr != null) { + if (pStrTo!=null) { + params.put( name+"1", pStr); + params.put( name+"2", pStrTo); + } else { + params.put( name, pStr); + } + } else if (pDate != null) { + if (pDateTo!=null) { + params.put( name+"1", pDate); + params.put( name+"2", pDateTo); + } else { + params.put( name, pDate); + } + } else if (pNum != null) { + if (rs.getBigDecimal(5)!=null) { + params.put( name+"1", pNum); + params.put( name+"2", pNumTo); + } else { + params.put( name, pNum); + } + } + } + } catch (SQLException e) { + log.severe("Execption; sql = "+sql+"; e.getMessage() = " +e.getMessage()); + } finally { + DBUtils.close( rs); + DBUtils.close( pstmt); + } + } + + private void addProcessInfoParameters(Map params, ProcessInfoParameter[] para) { + if (para != null) { + for (int i = 0; i < para.length; i++) { + if (para[i].getParameter_To() == null) { + params.put(para[i].getParameterName(), para[i].getParameter()); + } else { + params.put( para[i].getParameterName()+"1", para[i].getParameter()); + params.put( para[i].getParameterName()+"2", para[i].getParameter_To()); + } + } + } + } + + /** + * @author rlemeill + * Correct the class path if loaded from java web start + */ + private void JWScorrectClassPath() + { + URL jasperreportsAbsoluteURL = Thread.currentThread().getContextClassLoader().getResource("net/sf/jasperreports/engine"); + String jasperreportsAbsolutePath = ""; + + if(jasperreportsAbsoluteURL.toString().startsWith("jar:http:") || jasperreportsAbsoluteURL.toString().startsWith("jar:https:")) + { + // Jasper classes are deployed to a webserver (Java Webstart) + jasperreportsAbsolutePath = jasperreportsAbsoluteURL.toString().split("!")[0].split("jar:")[1]; + + // Download the required jasper libraries if they are not already existing + File reqLib = new File(System.getProperty("java.io.tmpdir"), "CompiereJasperReqs.jar"); + if(!reqLib.exists() && !(reqLib.length() > 0)) + { + try{ + URL reqLibURL = new URL(jasperreportsAbsolutePath); + InputStream in = reqLibURL.openStream(); + + FileOutputStream fout = new FileOutputStream(reqLib); + + byte buf[] = new byte[1024]; + int s = 0; + long tl = 0; + + while((s = in.read(buf, 0, 1024)) > 0) + fout.write(buf, 0, s); + + in.close(); + fout.flush(); + fout.close(); + } catch (FileNotFoundException e) { + log.warning("Required library not found "+ e.getMessage()); + reqLib.delete(); + reqLib = null; + } catch (IOException e) { + log.severe("I/O error downloading required library from server "+ e.getMessage()); + reqLib.delete(); + reqLib = null; + } + } + + jasperreportsAbsolutePath = reqLib.getAbsolutePath(); + } + else + { + // Jasper classes are locally available (Local client) + jasperreportsAbsolutePath = jasperreportsAbsoluteURL.toString().split("!")[0].split("file:")[1]; + } + + if(jasperreportsAbsolutePath != null && !jasperreportsAbsolutePath.trim().equals("")) + { + // Check whether the current CLASSPATH already contains our + // jasper libraries and dependencies or not. + if(System.getProperty("java.class.path").indexOf(jasperreportsAbsolutePath) < 0) + { + System.setProperty("java.class.path", + System.getProperty("java.class.path") + + System.getProperty("path.separator") + + jasperreportsAbsolutePath); + log.info("Classpath has been corrected to " + System.getProperty("java.class.path")); + } + } + } + + /** + * @author rlemeill + * @param reportFile + * @param jasperFile + * @return compiled JasperReport + */ + private JasperReport compileReport( File reportFile, File jasperFile) { + JWScorrectClassPath(); + JasperReport compiledJasperReport = null; + try { + JasperCompileManager.compileReportToFile ( reportFile.getAbsolutePath(), jasperFile.getAbsolutePath() ); + jasperFile.setLastModified( reportFile.lastModified()); //Synchronize Dates + compiledJasperReport = (JasperReport)JRLoader.loadObject(jasperFile); + } catch (JRException e) { + log.severe("JRException; e.getMessage()= "+ e.getMessage()); + } + return compiledJasperReport; + } + + /** + * @author rlemeill + * @param ProcessInfo + * @return ReportData + */ + public ReportData getReportData( ProcessInfo pi, String trxName) { + log.info(""); + String sql = "SELECT pr.JasperReport, pr.IsDirectPrint " + + "FROM AD_Process pr, AD_PInstance pi " + + "WHERE pr.AD_Process_ID = pi.AD_Process_ID " + + " AND pi.AD_PInstance_ID=?"; + PreparedStatement pstmt = null; + ResultSet rs = null; + try { + pstmt = DB.prepareStatement(sql, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY, trxName); + pstmt.setInt(1, pi.getAD_PInstance_ID()); + rs = pstmt.executeQuery(); + String path = null; + boolean directPrint = false; + boolean isPrintPreview = pi.isPrintPreview(); + if (rs.next()) { + path = rs.getString(1); + + if ("Y".equalsIgnoreCase(rs.getString(2)) && !Ini.isPropertyBool(Ini.P_PRINTPREVIEW) + && !isPrintPreview ) + directPrint = true; + } else { + log.severe("data not found; sql = "+sql); + return null; + } + + return new ReportData( path, directPrint); + } catch (SQLException e) { + log.severe("sql = "+sql+"; e.getMessage() = "+ e.getMessage()); + return null; + } finally { + DBUtils.close( rs); + DBUtils.close( pstmt); + } + } + + /** + * Set jasper report viewer provider. + * @param provider + */ + public static void setReportViewerProvider(JRViewerProvider provider) { + if (provider == null) + throw new IllegalArgumentException("Cannot set report viewer provider to null"); + viewerProvider = provider; + } + + /** + * Get the current jasper report viewer provider + * @return JRViewerProvider + */ + public static JRViewerProvider getReportViewerProvider() { + return viewerProvider; + } + + class ReportData { + private String reportFilePath; + private boolean directPrint; + + public ReportData(String reportFilePath, boolean directPrint) { + this.reportFilePath = reportFilePath; + this.directPrint = directPrint; + } + + public String getReportFilePath() { + return reportFilePath; + } + + public boolean isDirectPrint() { + return directPrint; + } + } + + class JasperData { + private JasperReport jasperReport; + private File reportDir; + private String jasperName; + private File jasperFile; + + public JasperData(JasperReport jasperReport, File reportDir, String jasperName, File jasperFile) { + this.jasperReport = jasperReport; + this.reportDir = reportDir; + this.jasperName = jasperName; + this.jasperFile = jasperFile; + } + + public JasperReport getJasperReport() { + return jasperReport; + } + + public File getReportDir() { + return reportDir; + } + + public String getJasperName() { + return jasperName; + } + + public File getJasperFile() { + return jasperFile; + } + } + + class FileFilter implements FilenameFilter { + private String reportStart; + private File directory; + private String extension; + + public FileFilter(String reportStart, File directory, String extension) { + this.reportStart = reportStart; + this.directory = directory; + this.extension = extension; + } + + public boolean accept(File file, String name) { + if (file.equals( directory)) { + if (name.startsWith( reportStart)) { + int pos = name.lastIndexOf( extension); + if ( (pos!=-1) && (pos==(name.length()-extension.length()))) return true; + } + } + return false; + } + } + +} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/Constants.java b/posterita/posterita/src/main/org/posterita/Constants.java new file mode 100644 index 0000000000..9a58bbab99 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/Constants.java @@ -0,0 +1,825 @@ +/* + * + * Copyright (c) 2005 UDI Ltd. All Rights Reserved. + * + * This software is the confidential and proprietary information of + * UDI Ltd. ("Confidential Information"). You shall not + * disclose such Confidential Information and shall use it only in + * accordance with the terms of the license agreement you entered into + * with UDI. + * + * UDI MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE + * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT + * NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR + * A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. UDI SHALL NOT + * BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, + * MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. + * + * Created on Jul 6, 2005 by vishee + */ + +package org.posterita; + +import org.compiere.model.MPayment; + +public class Constants +{ + public static final String ACCESSIBLE_ORGS = "accessibleOrgs"; + public static final String ACTION = "action"; + public static final String ADD_ORDERLINE_ID = "addOrderLineId"; + public static final String ADMIN = "admin"; + public static final String ADMIN_USER_ID = "adminUserId"; + public static final String ALL_BANKS = "allBanks"; + public static final String ALL_CUSTOMERS = "allCustomers"; + public static final String ALL_ORDERS = "allOrders"; + public static final String ALL_ORGS = "allOrgs"; + public static final String ALL_ROLES = "allRoles"; + public static final String ALL_STOCK_REPORT = "allStockReport"; + public static final String ALL_USERS = "allUsers"; + public static final String ALL_WAREHOUSES="allwarehouses"; + public static final String ALL_WEEKS = "allWeeks"; + public static final String ALLBUSINESSPARTNERS = "allBp"; + public static final String ALLOCATION = "allocation"; + public static final String ALLOCATION_DATE = "allocationDate"; + public static final String ALLOCATION_ID = "allocationId"; + public static final String ALLOCATION_LINES="allocationsLines"; + public static final String ALLOCATION_LIST = "allocationList"; + public static final String ALLOCATION_ORDERS = "allocationOrders"; + + + public static final String ALLOCATION_REPORT = "allocationReport"; + public static final String ALLOCATION_STOCK = "Allocation Stock"; + public static final String ALLWAREHOUSES="allwarehouses"; + + public static final String APP_CRM = "crm"; + public static final String APP_DCS = "dcs"; + public static final String APP_IMMOBILIER_WEBSTORE = "ImmobilierWebstore"; + public static final String APP_NAME = "appName"; + //APPLICATION NAME + public static final String APP_POS = "pos"; + public static final String APP_WEBSTORE = "webstore"; + public static final String APP_WEBSTORE_ADMIN = "webstoreadmin"; + public static final String APPROVE = "APPROVE"; + public static final String ASSIGNED_ROLES = "assignedRoles"; + public static final String ATTRIBUTE_LIST = "attributeList"; + public static final String ATTRIBUTE_NAME = "atttributeName"; + public static final String ATTRIBUTE_SET = "attributeSet"; + public static final String ATTRIBUTE_SET_ID = "attributeSetId"; + public static final String ATTRIBUTE_VALUES = "attributeValues"; + public static final String ATTRIBUTE_VALUES_LIST = "attributeValuesList"; + + + public static final int ATTRIBUTE_YEAR_MIN_VALUE = 2000; + public static final String ATTRIBUTESET = "AttributeSet"; + public static final String ATTRIBUTESETINSTANCE_ID = "attributeSetInstanceId"; + public static final String AUCTION_MODULE="Auction Module"; + public static final String AVAILABLE_COLOURS = "availableColours"; + public static final String AVAILABLE_COLOURS_SIZES = "availableColoursSizes"; + public static final String AVAILABLE_SIZES = "availableSizes"; + + + public static final String AVAILABLE_VIN = "availableVin"; + public static final String B_PARTNER_ID = "bPartnerId"; + public static final String BACK_ORDER = "backOrder"; + public static final String BANK = "bank"; + public static final String BANKS = "banks"; + public static final String BANK_ACCOUNTS = "bankAccounts"; + public static final String BASIC_DETAILS = "basicDetails"; + public static final String BARCODE_CART = "barcodeCart"; + public static final String BARCODE_CART_ITEMS = "barcodeCartItems"; + public static final String MMOVEMENT_CART = "mmovementCart"; + public static final String MMOVEMENT_CART_ITEMS = "mmovementCartItems"; + public static final String BP_LIST = "bpList"; + public static final String BPARTNER = "bPartner"; + public static final String BRAND_ATTRIBUTE_VALUES="brandAttributeValues"; + public static final String BREADCRUMB = "breadcrumb"; + public static final String BUSINESSPARTNER = "businessPartner"; + public static final String BUSINESSPARTNER_ORDER_DETAILS ="bPartnerOrderDetails"; + public static final String BUSINESSPARTNER_TRX_DETAILS = "businessPartnerTrxdetails"; + public static final String BUSINESSPARTNERSDETAILS = "bPartnerDetails"; + public static final String CAN_TRADE_IN = "canTradeIn"; + public static final String CANCEL_DO = "cancelDO"; + public static final String CANCEL_DT = "cancelDT"; + public static final String CANCEL_INVOICE = "cancelInvoice"; + public static final String CANCEL_SCO = "cancelSCO"; + public static final String CARD = "card"; + public static final String CASH = "cash"; + public static final String CASH_BOOK = "cashBook"; + public static final String CASH_DETAILS = "cashDetails"; + + public static final String CASH_LINE_DETAILS = "cashLineDetails"; + public static final String CASH_SUMMARY = "cashSummary"; + public static final String CERTIFICATE = "certificate"; + public static final String CHANGE = "change"; + public static final String CHECKED_PRODUCTS = "checkedProducts"; + public static final String CHECKING_ACCOUNT_TYPE = "C"; + public static final String CHECKOUT_ACTION = "/CheckoutAction"; + public static final String CHOOSE = "Choose"; + public static final String CHOOSE_SHIPPING_ADDRESS = "chooseShippingAddress"; + + public static final String CHOOSE_USER = "chooseUser"; + public static final String CHOOSE_VIN = "chooseVin"; + public static final String CLIENT_ID="client"; + public static final String CLIENT_NAME="clientName"; + public static final Integer COGS = Integer.valueOf(51100); + public static final String COLOUR_ATTRIBUTE_VALUE_ID = "colourAttributeValueId"; + public static final String COLOUR_ATTRIBUTE_VALUES = "colourAttributeValues"; + public static final String COLOURCODE_MATCHING = "colourCodeMatching"; + public static final String COMPLETED_INVOICE = "completedInvoice"; + public static final String COMPLETED_POS_ORDER = "completedPOSOrder"; + public static final String COMPLEX_COMMAND = "complexCommand"; + public static final String CONTENT = "content"; + public static final String SUBCLASSIFICATION = "subClassification"; + public static final String COUNTRY_CLASSIFICATION = "countryClassification"; + public static final String BRAND_CLASSIFICATION = "brandClassification"; + public static final String COUNTRIES = "countries"; + public static final String CREATE = "create"; + public static final String CREATE_BANKACCOUNT = "createBankAccount"; + public static final String CREATE_DRAFTED_ORDER = "createDraftedOrder"; + public static final String CREATE_NEW_CAR = "createNewCar"; + public static final String CREATE_PRODUCT_ATTRIBUTE_VALUE_ACTION = "/CreateProductAttributeValueAction"; + public static final String CREATE_PRODUCT_ATTRIBUTE_VALUE_FORM = "CreateProductAttributeValueForm"; + public static final String CREATE_USED_CAR = "createUsedCar"; + public static final String CREATE_WEBSTORE_CUSTOMER_ACTION = "/CreateWebstoreCustomerAction"; + public static final String CREATEPRODUCTS = "createProducts"; + public static final String CREATING_FROM_ORDER = "creatingFromOrder"; + public static final String CREDITCARDTYPE_AMEX = "Amex"; + public static final String CREDITCARDTYPE_DISCOVER = "Discover"; + public static final String CREDITCARDTYPE_MASTERCARD = "MasterCard"; + public static final String CREDITCARDTYPE_VISA = "Visa"; + public static final String CRM_REQUEST_USERS = "crmUsers"; + public static final String CSV = "csv"; + public static final String CSV_FILE = "csvFile"; + public static final String CSV_FILE2 = "csvFile2"; + public static final String PDF_FILE = "pdfFile"; + + public static final String CURRENCIES = "currencies"; + public static final String CURRENCY_SYMBOLE = "currencySymbole"; + public static final String CURRENT_PARTIAL_POS_ORDER_ID = "currentPartialPOSOrderId"; + public static final String CURRENT_POS_ORDER="currentPOSOrder"; + public static final String CURRENT_POS_ORDER_ID = "currentPOSOrderId"; + public static final String CURRENT_PRODUCT = "currentProduct"; + public static final String CURRENT_REQUEST = "currentRequest"; + public static final String CURRENT_TILL_AMOUNT = "currentTillAmount"; + public static final String CURRENT_TILL_AMOUNT_POS = "currentTillAmountPOS"; + public static final String CURRENT_YEAR = "currentYear"; + public static final String CUSTOM_DATE_RANGE = "customDateRange"; + public static final String CUSTOMER = "customer"; + public static final String CUSTOMER_CREATED="CustomerCreated"; + public static final String CUSTOMER_DETAILS = "customerDetails"; + + public static final String CUSTOMER_ID = "customerId"; + public static final String CUSTOMER_RETURN_ORDER = "customerReturnOrder"; + public static final String CUSTOMER_RETURN_ORDER_ID = "customerReturnOrderId"; + + public static final String CUSTOMER_RETURN_ORDER_LINES = "customerReturnOrderLine"; + public static final String CUSTOMER_RETURN_ORDER_SHOPPING_CART = "customerReturnOrderShoppingCart"; + public static final String CUSTOMER_RETURN_ORDER_SHOPPING_CART_ITEMS = "customerReturnOrderShoppingCartItems"; + public static final String DEALER_COUNTER_REF = "dealerCounterRef"; + public static final String DEALER_DETAILS = "dealerDetails"; + public static final String DEALER_REF = "dealerRef"; + + public static final String DEALERCODE_LIST = "dealerCodeList"; + public static final String DEALERS = "dealers"; + public static final String DEALERS_DETAIL = "dealersDetail"; + + + public static final String DELETE_ORDER_TYPE = "deleteOrderType"; + public static final String DELIVERY = "Delivery"; + public static final String DESCRIPTION ="description"; + public static final String DESIGN_ATTRIBUTE_VALUES="designAttributeValues"; + public static final String DISPLAY_REPORT = "displayReport"; + public static final String DMS = "DMS"; + public static final String DOC_STATUS = "docStatus"; + public static final String DOC_NO = "docNo"; + + public static final String DOCUMENT_HISTORY = "documentHistory"; + public static final String DOCUMENT_PDF = "documentPDF"; + public static final String DRAFT_INVOICE = "draftInvoice"; + + public static final String EDITWAREHOUSE="editWarehouse"; + public static final String EMAIL = "email"; + + //Email specific + public static final String EMAIL_FOOTER= "email.footer"; + public static final String EMAIL_REGARDS = "emailRegards"; + public static final String EMAIL_SIGNIN_INFO = "signin.info"; + public static final String END_OF_THE_DAY_DETAILS = "endOfTheDayDetails"; + public static final String ERROR_TITLE = "errorTitle"; + public static final String ERRORS = "errors"; + public static final String ETA_LIST = "ETAList"; + //public static final String EURO_SIGN = "€"; + public static final String EXISTING_BAR_CODE = "existingBarCode"; + public static final String FILE_FOR_UPDATE = "fileForUpdate"; + public static final String FINISHED_AL ="finishedAL"; + public static final String FINISHED_DO = "finishedDO"; + public static final String FINISHED_DT ="finishedDT"; + + public static final String FINISHED_MRO = "finishedMRO"; + + public static final String FINISHED_NR = "finishedNR"; + public static final String FINISHED_SCO = "finishedSCO"; + public static final String FIXED_DATE_RANGE = "fixedDateRange"; + public static final String FREE_STOCK = "Free Stock"; + public static final String FROM_DATE = "fromDate"; + public static final String FULL_DETAILS = "fullDetails"; + public static final String FULL_IMAGE = "fullImage"; + public static final String FULLIMAGE = "fullImage"; + public static final String GENERATE_INVOICE = "generateInvoice"; + public static final String GENERATE_INVOICE_ACTION = "Invoice"; + public static final String GENERATE_INVOICE_PAYMENT_ACTION = "InvoicePayment"; + public static final String GENERATE_WEBSTORE_INVOICE = "generateWebstoreInvoice"; + public static final String GET_CREDIT_CARD_DETAILS = "getCreditCardDetails"; + public static final String GET_LOGO="getLogo"; + + public static final String GET_PRODUCT_CATEGORY_ACTION = "/GetProductCategory"; + public static final String GOING_RATE_REPORT = "goingRateReport"; + public static final String GOODS_RECEIVE_NOTE = "goodsReceiveNote"; + public static final String GOODS_RECEIVE_NOTE_ID = "goodsReceiveNoteId"; + public static final String GOODS_RECEIVE_NOTE_LINES = "goodsReceiveNoteLines"; + public static final String GOODS_RECEIVE_NOTE_SHOPPING_CART = "goodsReceiveNoteShoppingCart"; + public static final String GOODS_RECEIVE_NOTE_SHOPPING_CART_ITEMS = "goodsReceiveNoteShoppingCartItems"; + public static final String GOODS_RETURN_NOTE = "goodsReturnNote"; + public static final String GOODS_RETURN_NOTE_ID = "goodsReturnNoteId"; + + public static final String GOODS_RETURN_NOTE_LINES = "goodsReturnNoteLines"; + public static final String GOODS_RETURN_NOTE_SHOPPING_CART = "goodsReturnNoteShoppingCart"; + public static final String GOODS_RETURN_NOTE_SHOPPING_CART_ITEMS = "goodsReturnNoteShoppingCartItems"; + public static final String GRAND_TOTAL = "grandTotal"; + public static final String HIDDEN_STOCK = "Hidden Stock"; + public static final String HOMEPAGE_PRODUCTS = "homePageProducts"; + public static final String HTML = "html"; + public static final String IMAGE_NAME = "ImageName"; + public static final String IMAGES_DIRECTORY = "images/"; + public static final String IMPORTED_VEHICLES = "importedVehicles"; + public static final String InitPriceListAction = "/InitPriceListAction"; + public static final String INSERT_VIN = "insertVin"; + public static final String INVOICE_ACTION_CANCEL = "Cancel"; + public static final String INVOICE_ACTION_COMPLETE = "Complete"; + public static final String INVOICE_ACTION_DELETE = "Delete"; + public static final String INVOICE_ACTION_PAID = "Paid"; + public static final String INVOICE_ACTION_PAID_AND_SHIP = "Paid and Ship"; + public static final String INVOICE_HISTORY = "invoiceHistory"; + public static final String INVOICE_ID = "invoiceId"; + public static final String INVENTORY_CART = "inventoryCart"; + public static final String INVENTORY_CART_ITEMS = "inventoryCartItems"; + + public static final String INVOICE_PAID = "Invoice & Pay"; + public static final String INVOICE_PAID_SHIP = "Inv/Paid/Ship"; + public static final String INVOICE_TAX = "invoiceTax"; + public static final String IS_PAID = "isPaid"; + public static final String KEYWORD1_LINK_LIST = "keyword1LinkList"; + public static final String KEYWORD2_LINK_LIST = "keyword2LinkList"; + + public static final String KIA = "kia"; + public static final String LEFT_MENUS = "leftMenus"; + public static final String LICENSING_AREA="licensingAreas"; + public static final String LICENSING_INFORMATION = "licensingInformation"; + public static final String APP_LICENSING_INFORMATION = "appLicensingInformation"; + public static final String LOCATORS = "locators"; + public static final String LOGIN = "login"; + + public static final String LOGIN_LINK = "link"; + public static final String MAKE_ATTRIBUTE_VALUES = "makeAttributeValues"; + public static final String MAX_SOLD_ITEMS = "maxSoldItems"; + public static final String ME = "me"; + public static final String ME_LOCATION = "meLocation"; + public static final String MENU = "menu"; + public static final String MENU_ITEMS = "menuItems"; + + public static final String MENU_LIST = "menuList"; + public static final String MENUS = "menus"; + public static final String MESSAGE = "message"; + public static final String MESSAGE_LOG_BEAN = "messageLogBean"; + public static final String MESSAGE_LOGS = "messageLogs"; + public static final String MIN_SOLD_ITEMS = "minSoldItems"; + public static final String MINOUT = "minout"; + public static final String MINOUT_ACTION_CANCEL = "Cancel"; + public static final String MINOUT_ACTION_COMPLETE = "Complete"; + public static final String MINOUT_ACTION_DELETE = "Delete"; + + public static final String MINOUT_ACTION_RECEIVE = "Receive"; + public static final String MINOUT_ACTION_SHIP = "Ship"; + public static final String MINOUT_LINES_COLLECTION = "minOutLinesCollection"; + public static final String MINVOICE = "minvoice"; + public static final String MINVOICE_LINES_COLLECTION = "invoiceLinesCollection"; + public static final String MMOVEMENT_LOCATOR = "toLocator"; + public static final String MMOVEMENT_LOCATORS = "organisationLocators"; + + public static final String MMOVEMENT_PRODUCT = "materialMovementProduct"; + public static final String MMOVEMENT_PRODUCTS = "organisationProducts"; + public static final String MMOVEMENT_WAREHOUSES = "organisationWarehouses"; + + public static final String MODEL_ATTRIBUTE_VALUE_ID = "modelAttributeValueId"; + public static final String MODEL_ATTRIBUTE_VALUES="modelAttributeValues"; + public static final String MODEL_MATCHING_MODELS = "modelMatchingModels"; + public static final String MODEL_MATCHING_YEARS = "modelMatchingYears"; + public static final String MODELCODE_LIST = "modelCodeList"; + public static final String MODELGROUP_ATTRIBUTE_VALUES = "modelGroupAttributeValues"; + public static final String MODELMATCH = "modelmatch"; + public static final String MONTH_SALES = "monthSales"; + public static final String MORDER = "morder"; + public static final String MORDER_LINES_COLLECTION = "orderLinesCollection"; + public static final String MPAYMENT = "payment"; + public static final String MY_RECEIVED_MESSAGE = "myReceivedMessage"; + public static final String MY_RECEIVED_MESSAGES = "myReceivedMessages"; + public static final String MY_SENT_MESSAGES = "mySentMessages"; + public static final String MY_STOCKS = "myStocks"; + public static final String NAAMSA_REPORT = "Naamsa Report"; + public static final String NAAMSAINFO = "naamsaInfo"; + public static final String NATIS_RELEASE_INFO = "natisReleaseInfo"; + public static final String NATIS_XML_ENCODING = "ISO-8859-1"; + public static final String NEW_PRODUCT = "newProduct"; + public static final String NO_CHAR = "N"; + public static final String NO_OF_VEHICLES_SOLD = "noOfVehicleSold"; + public static final String OLD_MODELMATCH = "oldmodelmatch"; + public static final String OPEN_CASH_BOOK = "openCashBook"; + public static final String OPENED_CASH_BOOK = "openedCashBook"; + public static final String ORDER_ACTION_ACCEPT = "Accept"; + public static final String ORDER_ACTION_ACCEPT_WO="Create"; + public static final String ORDER_ACTION_CANCEL = "Cancel"; + public static final String ORDER_ACTION_CLOSE = "Close"; + public static final String ORDER_ACTION_COMPLETE = "Complete"; + public static final String ORDER_ACTION_CONFIRM = "Confirm"; + public static final String ORDER_ACTION_DELETE = "Delete"; + public static final String ORDER_ACTION_GENERATE_ORDER = "Generate Order"; + public static final String ORDER_ACTION_PREPARE = "Reserve Stock"; + + public static final String ORDER_ACTION_PREPARE_SCO = "Prepare"; + public static final String ORDER_ACTION_PREPARE_SCO_ORDER="Prepare Order"; + public static final String ORDER_ACTION_REJECT = "Reject"; + public static final String ORDER_ACTION_SAVE = "Save"; + public static final String ORDER_ACTION_SPLIT = "Split"; + + public static final String ORDER_ACTION_SUBMIT = "Submit"; + public static final String ORDER_BEAN = "orderBean"; + public static final String ORDER_COLLECTION = "orderCollection"; + public static final String ORDER_DETAILS = "orderDetails"; + public static final String ORDER_HISTORY = "orderHistory"; + public static final String ORDER_ID = "orderId"; + public static final String ORDER_INFO = "orderInfo"; + public static final String ORDER_LINE_BEAN = "orderLineBean"; + public static final String ORDER_LINE_ID = "orderLineId"; + public static final String ORDER_LINES = "orderLines"; + public static final String ORDER_LINES_FOR_ORDER = "orderLinesForOrder"; + public static final String ORDER_TAX = "orderTax"; + public static final String ORDER_TYPE = "orderType"; + public static final String ORDER_TYPE_BULK = "bulk"; + + public static final String ORDER_TYPE_SIMPLE = "simple"; + + public static final String ORDER_TYPES = "orderTypes"; + public static final String ORG_FOR_RESERVED_PRODUCTS="orgForReservedProducts"; + public static final String ORG_ID = "orgId"; + public static final String ORG_USERS = "orgUsers"; + public static final String ORGANISATION = "organisation"; + public static final String ORGANISATION_VALUES="organisationValues"; + public static final String ORGS = "orgs"; + public static final String ORGTYPE = "orgType"; + + public static final String PAID_INVOICE = "paidInvoice"; + public static final String PAIR_VIN_NUMBERS = "pairVinNos"; + + public static final String PARTIAL_ORDER_SHOPPING_CART = "partialOrderShoppingCart"; + public static final String PARTIAL_ORDER_SHOPPING_CART_ITEMS = "partialOrderShoppingCartItems"; + public static final String PARTIAL_POS_ORDER = "partialPosOrder"; + + public static final String PARTIAL_POS_ORDER_LINES = "partialPOSOrderlines"; + public static final String PASSWORD = "password"; + public static final String PATH_CREATE_TAMAK_ORDER_ACTION = "/CreateTamakOrderAction"; + public static final String PATH_VIEW_ORDER_ACTION = "/ViewOrderAction"; + public static final String PAYMENT_ACTION_CANCEL = "Cancel"; + public static final String PAYMENT_ACTION_COMPLETE = "Complete"; + public static final String PAYMENT_BY_CARD = "paymentByCard"; + + public static final String PAYMENT_BY_CASH = "paymentByCash"; + public static final String PAYMENT_BY_CHEQUE = "paymentByCheque"; + + public static final String PAYMENT_HISTORY = "paymentHistory"; + public static final String PAYMENT_RULE_CARD="Card"; + public static final String PAYMENT_RULE_CASH="Cash"; + public static final String PAYMENT_RULE_CHEQUE="Cheque"; + public static final String PAYMENT_RULE_CREDIT="Credit"; + public static final String PAYMENT_RULE_MIXED="Mixed"; + public static final String PAYMENT_RULES = "paymentRules"; + public static final String PAYMENT_TYPE = "paymentType"; + public static final String PDF = "pdf"; + public static final String POOL_ORDERLINES = "poolOrderLines"; + public static final String POS_GENERAL_STOCK = "posGeneralStock"; + public static final String CARD_AMT_TENDERED = "cardAmtTendered"; + public static final String CHEQUE_AMT_TENDERED = "chequeAmtTendered"; + + public static final String POS_HISTORY = "posHistory"; + + public static final String POS_INFO = "posInfo"; + + public static final String POS_ORDER = "posOrder"; + public static final String POS_ORDER_CUSTOMER_COMPULSORY = "posOrderCustomerCompulsory"; + public static final String POS_ORDER_DOC_NUMBER = "POSOrderDocumentNumber"; + public static final String POS_ORDER_ID = "posOrderId"; + public static final String POS_ORDER_LINES = "posOrderLines"; + public static final String POS_ORDER_WITHOUT_ADVANCED = "posOrderWithoutAdvanced"; + public static final String POS_PRODUCTS_FOR_UPDATE = "posProductsForUpdate"; + public static final String POS_SALES_PRICE_LIST = "posSalesPriceList"; + + public static final String POS_STOCK = "posStock"; + public static final String POSTERMINAL = "POSTerminal"; + public static final String POSTERMINALS = "POSTerminals"; + public static final String PRICE = "price"; + + public static final String PRICE_LIST = "priceList"; + public static final String PRICE_LIST_VERSION = "priceListVersion"; + public static final String PRICE_LIST_VERSION_ID = "priceListVersionId"; + public static final String PriceListForm = "PriceListForm"; + + public static final String PRICEQTY_FILTER = "priceQtyFilter"; + public static final String PROCESS_CLASS = "process.class"; + public static final String PROCESS_NAME = "process.name"; + + public static final String PRODUCT = "product"; + public static final String PRODUCT_ATTRIBUTE_LIST = "productAttributeList"; + public static final String PRODUCT_ATTRIBUTE_SET = "productAttributeSet"; + public static final String PRODUCT_BRANDS = "productBrands"; + public static final String PRODUCT_CART = "productCart"; + public static final String PRODUCT_CART_ITEMS = "productCartItems"; + public static final String PRODUCT_CATEGORY_ID = "productCategoryId"; + //public static final String WEBSTORE_SHIPPING_ADDR = "webstoreShippingAddr"; + //public static final String WEBSTORE_BILLING_ADDR = "webstoreBillingAddr"; + public static final String PRODUCT_CLASSIFICATION ="productClassification"; + public static final String PRODUCT_CREATED = "productsCreated"; + public static final String PRODUCT_DETAIL_INFO = "productDetailInfo"; + public static final String PRODUCT_DETAILS = "productDetails"; + + public static final String PRODUCT_FILTER_BEAN = "productFilterBean"; + + public static final String PRODUCT_ID = "productId"; + + public static final String PRODUCT_IDS = "productIds"; + public static final String PRODUCT_IMAGE = "productImage"; + public static final String PRODUCT_IMAGE_BEAN = "productImageBean"; + public static final String PRODUCT_INFO = "productInfo"; + public static final String PRODUCT_KEYWORDS = "productKeywords"; + + public static final String PRODUCT_LINES = "productLines"; + public static final String PRODUCT_LIST = "productList"; + public static final String PRODUCT_SALES_DETAILS = "productSalesDetails"; + public static final String PRODUCT_SALES_SUMMARY = "productSalesSummary"; + public static final String PRODUCTS = "products"; + public static final String PRODUCTS_IN_STOCK = "productsInStock"; + public static final Integer PROFIT_MARGIN = Integer.valueOf(99999); + public static final String PROGRESS_DO = "progressDO"; + public static final String PROGRESS_DT = "progressDT"; + public static final String PROGRESS_NR = "progressNR"; + public static final String PROGRESS_SCO = "progressSCO"; + public static final String PROGRESS_TI = "progressTI"; + public static final String PROJECT_NAME = "project.name"; + public static final String PURCHASE_PRICELISTS = "purchase.pricelists"; + public static final String QUANTITY = "quantity"; + public static final String QUICK_POS_ORDER = "quickPosOrder"; + public static final String RECEIPT_HISTORY = "receiptHistory"; + public static final String RECEIVED_MESSAGE = "receivedMessage"; + public static final String REGION_VALUES = "regionValues"; + public static final String REGIONS = "regions"; + + public static final String RELATED_PRODUCT_IMAGES = "relatedProductImages"; + public static final String REPORT_URL = "reportURL"; + public static final String REPRICE_ORDER_TYPE ="repriceOrderType"; + + public static final String REQUEST_PRIORITIES = "requestPriorities"; + public static final String REQUEST_STATUS = "requestStatus"; + // --> CRM + public static final String REQUESTS_SUMMARY = "requestsSummary"; + public static final String RESERVE_STATUS_VALUES = "reserveStatusValues"; + public static final String RETAIL_REPORT = "retailReport"; + public static final String REVENUE_RECOGNITION = "Revenue Recognition"; + public static final String ROLE = "role"; + public static final String ROLE_MENUS = "roleMenus"; + public static final String ROLES = "roles"; + + public static final String SALES_ANALYSIS = "salesAnalysis"; + public static final String SALES_REP = "salesRep"; + public static final String SALES_REPORT = "salesReport"; + public static final String SALESGROUP_LIST = "salesGroupList"; + public static final String SALES_PRICELISTS = "sales.pricelists"; + public static final String SAVING_ACCOUNT_TYPE = "S"; + public static final String SCO_FILTER_BEAN = "SCOFilterBean"; + public static final String SCO_PRODUCT_LIST = "SCO Product List"; + public static final String SEARCH_VIN_NUMBERS="searchVinNumbers"; + public static final String SEARCH_VIN_NUMBERS_INQUIRY="searchVinNumberForInquiry"; + public static final String SELECTED_PRODUCTS_FOR_BULK_ORDER = "selectedProductsForBulkOrder"; + public static final String SELECTED_PRODUCTS_FOR_SIMPLE_ORDER = "selectedProductsForSimpleOrder"; + public static final String SENT_MESSAGE = "sentMessage"; + public static final String SHIPMENT_HISTORY = "shipmentHistory"; + public static final String SHIPPER_LIST = "shipperList"; + public static final String SHOPPING_CART = "shoppingCart"; + public static final String SHOPPING_CART_ITEMS = "shoppingCartItems"; + public static final String CHECKOUT_BEAN = "checkoutBean"; + public static final String SHOPPING_GRN_CART = "shoppingGRNCart"; + public static final String SHOPPING_GRN_CART_ITEMS = "shoppingGRNCartItems"; + public static final String SHOPPING_ORDER_CART = "shoppingOrderCart"; + public static final String SHOPPING_ORDER_CART_ITEMS = "shoppingOrderCartItems"; + public static final String SIMPLE_COMMAND = "simpleCommand"; + + public static final String SIMPLE_PRODUCT_CART = "simpleProductCart"; + public static final String SIZE_ATTRIBUTE_VALUES="sizeAttributeValues"; + public static final String SPLIT_ORDER_PROCESS = "splitOrderProcess"; + public static final String STATUS = "status"; + public static final String STATUS_OFF = "OFF"; + + public static final String STATUS_ON = "ON"; + public static final String STATUS_VALUES = "statusValues"; + public static final String STOCK_HISTORY_REPORT = "stockHistoryReport"; + + public static final String STOCK_MOVEMENT = "stockMovement"; + public static final String SUB_MENU_ITEMS = "subMenuItems"; + public static final String SUB_MENU_NAME = "subMenuName"; + public static final String SUBJECT = "subject"; + public static final String SUB_TOTAL = "subTotal"; + public static final String SUCCESS = "success"; + public static final String SUCCESS_CREATE_CUSTOMER = "successCreateCustomer"; + public static final String SUPERUSER = "superUser"; + public static final String SWAP_PRODUCT_ID = "swapProductId"; + public static final String SWAP_VIN = "swapVin"; + public static final String SWAP_VIN_NOS_ACTION = "Save"; + public static final String SWAP_VIN_NUMBER_BEAN = "swapVinNumberBean"; + public static final String TABULAR_REPORT_DATA = "tabularReportData"; + + public static final String TABULAR_REPORT_DATA2 = "tabularReport2"; + public static final String TABULAR_REPORT_SUBTITLE = "tabularReportSubtitle"; + public static final String TABULAR_REPORT_TITLE = "tabularReportTitle"; + public static final String TARGET_SALES = "targetSales"; + public static final String TAX_CATEGORY_ID = "taxCategoryId"; + + public static final Integer TAX_CREDIT = Integer.valueOf(12610); + public static final Integer TAX_DUE = Integer.valueOf(21610); + public static final String THUMBNAIL = "thumbnail"; + public static final String TIME_REMAINING = "timeRemaining"; + public static final String TO_DATE = "toDate"; + public static final String TOP_MENUS = "topMenus"; + public static final String MAIN_MENUS = "mainMenus"; + public static final String TOTAL_LINES = "totalLines"; + public static final String TRADE_IN_LIST = "tradeInList"; + public static final String TRADE_IN_PRODUCT_ID = "tradeInProductId"; + public static final Integer TRADE_REVENUE = Integer.valueOf(41000); + public static final String TRAFFIC_LIST = "trafficList"; + public static final String TRX_ATTRIBUTE_VALUE_ID = "trxAttributeValueId"; + public static final String TRX_ATTRIBUTE_VALUES="trxAttributeValues"; + public static final String [] TSHIRT_SIZE={"S","M","XL"}; + public static final String UDIADMIN = "udiadmin"; + public static final String UDIADMINAUTO = "udiadminauto"; + public static final String UDIADMINBIKE = "udiadminbike"; + public static final String UNFINISHED_AL = "unfinishedAL"; + + public static final String UNFINISHED_DO = "unfinishedDO"; + public static final String UNFINISHED_DT = "unfinishedDT"; + public static final String UNFINISHED_INV = "unfinishedInvoice"; + public static final String UNFINISHED_NR = "unfinishedNR"; + public static final String UNFINISHED_SCO = "unfinishedSCO"; + public static final String UNFINISHED_WO = "unfinishedWO"; + public static final String UNIMPORTED_VEHICLES = "unimportedVehicles"; + public static final String UNPAID_INVOICE = "unPaidInvoice"; + public static final String UPDATE_PRODUCT_DETAILS = "updateProductDetails"; + public static final String USED_CAR_PURCHASE_ORDER = "usedCarPurchaseOrder"; + public static final String USER_DETAILS = "userDetails"; + public static final String VEHICLE_DETAILS = "vehicleDetails"; + public static final String VEHICLES = "vehicles"; + public static final String VENDOR_DETAILS = "vendorDetails"; + public static final String BLACKLISTED_DETAILS = "blackListedDetails"; + public static final String BLACKLISTED_LISTS="blackListedList"; + + + public static final String VENDOR_LIST = "vendorList"; + public static final String VIEW_ALL_ALLOCATIONS = "viewAllAllocations"; + public static final String VIEW_INVOICE_DETAILS="view.invoice.detail"; + public static final String VIEW_MINOUT = "viewMinOut"; + public static final String VIEW_MY_SENT_MESSAGES="viewMySentMessages"; + public static final String VIEW_PAYMENT = "viewPayment"; + public static final String VIEW_POS_ORDER_ACTION = "/ViewPOSOrderAction"; + + public static final String VIEW_POS_PRODUCTS = "viewPOSProducts"; + + public static final String VIEW_SHOPPING_CART = "viewShoppingCart"; + public static final String VIEW_VIN_NUMBER_DETAILS = "viewVinNumberDetails"; + public static final String VIN_NOS = "vinNos"; + + public static final String VIN_NUMBER_FROM = "vinNumberFrom"; + public static final String WAREHOUSE="warehouse"; + public static final String WAREHOUSE_NAMES = "warehouseNames"; + public static final String WAREHOUSE_TYPES = "warehouseTypes"; + public static final String WAREHOUSEDETAILS="warehouseDetails"; + + public static final String WAREHOUSES = "warehouses"; + public static final String WEB_APPLICATIONS = "WebApplications"; + public static final String WEB_DOCUMENT_HEADER_BEAN = "webDocumentHeaderBean"; + public static final String WEB_INVOICE_BEAN = "webInvoiceBean"; + + + + public static final String WEB_MINOUT_BEAN = "webMinOutBean"; + public static final String WEB_ORDER_BEAN = "webOrderBean"; + public static final String WEB_ORDER_LINE_BEAN = "webOrderLineBean"; + public static final String WEB_PAYMENT_BEAN = "webPaymentBean"; + + + public static final String WEBSTORE_CREATE_CUSTOMER = "webstoreCreateCustomer"; + public static final String WEBSTORE_CREDITCARD_BEAN = "creditCardBean"; + public static final String WEBSTORE_CUSTOMER = "Webstore Customer"; + public static final String WEBSTORE_INVOICE = "webstoreInvoice"; + /*public static final String WEBSTORE_LINK = UDIFilePropertiesManager.getProperty().get(new Properties(), "webstore.url");*/ + public static final String WEBSTORE_LOGIN_ACTION = "/WebstoreLoginAction"; + public static final String WEBSTORE_PROGRESS_DO = "webstoreProgressDO"; + /*public static final String WEBSTORE_SHIPPING_PROMOTION_PRICE = UDIFilePropertiesManager.getProperty().get(new Properties(), "webstore.shipping.promotion.price"); + public static final String WEBSTORE_SHIPPING_PROMOTION_STATUS = UDIFilePropertiesManager.getProperty().get(new Properties(), "webstore.shipping.promotion.status"); +*/ + public static final String WEBSTORE_USER_BEAN = "webstoreUserBean"; + public static final String WEBSTORE_USER_DETAILS = "webstoreUserDetails"; + public static final String WESBANK = "wesbank"; + public static final String WESBANK_RESPONSE = "WesbankResponse"; + public static final String WESBANK_STATUS = "wesbank.status"; + public static final String WHOLESALE_REPORT = "wholesaleReport"; + public static final String YEAR_ATTRIBUTE_VALUE_ID = "yearAttributeValueId"; + public static final String YEAR_ATTRIBUTE_VALUES="yearAttribueValues"; + + + public static final String YES_CHAR = "Y"; + public static final String YOU = "you"; + public static final String YOU_BP_LOCATION = "youbpLocation"; + public static final String YOU_LOCATION = "youLocation"; + public static final String CURRENCY_SYMBOLE_PURCHASE = "currencySymbolePurchase"; + public static final String CREDIT_ORDER = "creditOrder"; + public static final String CREDIT_ORDER_SHOPPING_CART = "creditOrderShoppingCart"; + public static final String CREDIT_ORDER_SHOPPING_CART_ITEMS = "creditOrderShoppingCartItems"; + public static final String OPEN_ITEMS = "openItems"; + public static final String AGING_ITEMS = "agingItems"; + public static final String CREDIT_INVOICE_INFO = "creditInvoiceInfo"; + public static final String DISCOUNT_ALLOWED = "discountAllowed"; + public static final String PRODUCT_SALES_BUCKET = "productSalesBucket"; + public static final String BPARTNERS = "bPartners"; + public static final String CASH_PAYMENT_MADE = "cashPaymentMade"; + public static final String CASH_PAYMENT_LIST = "cashPaymentList"; + public static final String CARD_CHQ_PAYMENT_LIST = "cardChqPaymentList"; + public static final String INVOICE_GRAND_TOTAL = "invoiceGrandTotal"; + public static final String NO_IMAGE_CSV_REPORT = "noImageCSVReport"; + public static final String MCASHLINE = "cashLine"; + public static final String DEBTORS = "debtors"; + public static final String PAYMENT_ALLOCATIONS = "paymentAllocations"; + public static final String PAYMENT_TERM = "paymentTerm"; + public static final String PAYMENT_TERM_ID = "paymentTermId"; + public static final String ALL_PAYMENT_TERMS = "allPaymentsTerms"; + public static final String EDIT_PAYMENT_TERM = "editPaymentTerm"; + public static final String NO_CREDIT_CHECK="No Credit Check"; + public static final String CREDIT_OK="Credit OK"; + public static final String CREDIT_STOP="Credit Stop"; + public static final String BUSINESSPARTNERINFO = "bPartnerInfo"; + public static final String ORDER_NAME = "orderName"; + public static final String COMMISSION_AMT = "commissionAmt"; + public static final String COMMISSION_AMT_DETAILS = "commissionAmtDetails"; + public static final String CREDIT_HOLD = "creditHold"; + public static final String CREDIT_WATCH = "creditWatch"; + public static final String CREDIT_PAYMENT_TERM_ID = "creditPaymentTermId"; + public static final String PRESENT_POS_ORDER = "presentPOSOrder"; + public static final String PRESENT_CREDIT_ORDER = "presentCreditOrder"; + public static final String PRESENT_POS_ORDER_ID = "presentPOSOrderId"; + public static final String PRESENT_GRN_ORDER_ID = "presentGRNOrderId"; + public static final String PRESENT_GRN_ORDER = "presentGRNOrder"; + public static final String PRESENT_GOODS_RET_ORDER = "presentGoodsReturnOrder"; + public static final String PRESENT_GOODS_RET_ORDER_ID = "presentGoodsReturnOrderId"; + public static final String PRESENT_CREDIT_ORDER_ID ="presentCreditOrderId"; + public static final String PRESENT_CUSTOMER_RET_ORDER = "presentCustomerReturnOrder"; + public static final String PRESENT_CUSTOMER_RET_ORDER_ID = "presentCustomerReturnOrderId"; + public static final String CUSTOMER_CART = "customerCart"; + public static final String ALL_CART_CUSTOMERS = "allCartCustomers"; + public static final String ALL_TAX_RATE ="allTaxRates"; + public static final String EDIT_TAX = "editTax"; + public static final String INVENTORY_LINE_LIST = "inventoryLineList"; + public static final String CREDITORDER_BPARTNER = "creditOrderBPartner"; + public static final String ORDER_TITLE = "orderTitle"; + public static final String UNALLOCATED_PAYMENTS = "unallocatedPayments"; + public static final String COMPLETED_INVENTORY_LINE_LIST = "completedInventoryLineList"; + public static final String INVENTORY_HISTORY_LIST = "inventoryHistoryList"; + public static final String WHOLE_INVENTORY_LINE_LIST = "wholeInventoryLineList"; + public static final String SHIPMENT_REQUIRED = "shipmentRequired"; + public static final String INVOICE_FOR_ALLOCATION = "invoiceForAllocation"; + public static final String TO_BE_SHIPPED = "toBeShipped"; + public static final String POS_HISTORY_ORDER_TYPE = "posHistoryOrderType"; + public static final String GROUP1 = "group1"; + public static final String GROUP2 = "group2"; + public static final Object CREATE_PAYMENT = "createPayment"; + public static final String INVENTORY_ID = "inventoryId"; + public static final String PAID="Paid"; + public static final String UNPAID="UnPaid"; + public static final String PARTIALLY_PAID="Partially Paid"; + public static final String OVER_PAID = "overPaid"; + public static final String INVENTORY_DESCRIPTION ="inventoryDescription"; + public static final String PARTIAL_POS_OREDR = "partialPOSOrder"; + public static final String ALL_ORDER_HISTORY = "allOrderHistory"; + + public static final String CLOSE_TILL_PRINT_DATA="closeTillPrintData"; + public static final String SHOPPING_CART_NAME = "shoppingCartName"; + + public static final String PREFERENCE_PRINTER_TYPE = "preference.printerType"; + public static final String UOM_LIST = "uomList"; + public static final String USER_ORGS = "userOrgs"; + public static final String ALL_ORGANISATIONS = "*"; + public static final String ROLE_ORG_ACCESS_LIST = "roleOrgAccessList"; + public static final String DETAILED_SALES_REPORT = "detailedSalesReport"; + // Constants related to Material Movement + public static final String ORG_FROM_ID = "orgFromId"; + public static final String ORG_TO_ID = "orgToId"; + public static final String USER_ORGS_STOCK = "userOrgsStockMovement"; + + public static final String STOCK_LIST = "stockList"; + public static final String MOVE_CONFIRM = "moveConfirm"; + public static final String MATERIAL_MOVEMENT_ITEMS = "materialMovementItems"; + public static final String MATERIAL_MOVEMENT = "materialMovement"; + public static final String MATERIAL_MOVEMENT_LIST = "materialMovementList"; + public static final String MATERIAL_MOVEMENT_LINES = "materialMovementLines"; + public static final String MATERIAL_MOVEMENT_DETAILS = "materialMovementDetails"; + public static final String MATERIAL_MOVEMENT_ID = "materialMovementId"; + public static final String MOVE_CONFIRM_LINES = "moveConfirmLines"; + public static final String MMOVEMENT = "movement"; + public static final String MMOVEMENT_ID = "movementId"; + + public static final String PAYMENT_RULE_CASH_MSG = "payment.rule.cash"; + public static final String PAYMENT_RULE_CARD_MSG = "payment.rule.card"; + public static final String PAYMENT_RULE_CHEQUE_MSG = "payment.rule.cheque"; + public static final String PAYMENT_RULE_MIXED_MSG = "payment.rule.mixed"; + public static final String PAYMENT_RULE_CREDIT_MSG = "payment.rule.credit"; + + + public static final String DOC_STATUS_DRAFTED = "document.status.drafted"; + public static final String DOC_STATUS_INPROGRESS = "document.status.inprogress"; + public static final String DOC_STATUS_COMPLETED = "document.status.completed"; + public static final String DOC_STATUS_INVALID = "document.status.invalid"; + public static final String DOC_STATUS_VOID = "document.status.void"; + public static final String DOC_STATUS_CLOSED = "document.status.closed"; + public static final String STOCK_SALES_REPORT_LIST = "stock.sales.report.list"; + public static final String STOCK_SALES_REPORT_DATA = "stockSalesReportData"; + public static final String SALES_REPORT_LIST = "salesReportList"; + public static final String STOCK_REPORT_LIST = "stockReportList"; + public static final String SALES_REPORT_LIST_COMPLETE = "salesReportListComplete"; + public static final String STOCK_REPORT_LIST_COMPLETE = "stockReportListComplete"; + public static final String PRODUCT_SALES_COMPLETE_SET = "productSalesCompleteSet"; + public static final String PRODUCT_STOCK_COMPLETE_SET = "productStockCompleteSet"; + public static final String PRODUCT_ORG_STOCK_MAP = "productOrgStockMap"; + public static final String PRODUCT_ORG_SALES_MAP = "productOrgSalesMap"; + public static final String STOCK_PRODUCT_LIST = "stockProductList"; + public static final String MMOVEMENT_LINES = "movementLines"; + public static final String STOCKMOVEMENT_MAP = "stockMovementMap"; + public static final String PRE_ORG_FROM_ID = "preOrgFromId"; + public static final int SALES_TYPE = 1; + public static final int STOCK_TYPE = 2; + public static final String STOCK_SALES_REPORT_ORGS = "stockSalesReportOrgs"; + public static final String MONTHLY_SALES_REPORT_DATA = "monthlySalesReportData"; + public static final String DETAILED_SALES_REPORT_PER_PRODUCT = "detailedSalesReportPerProduct"; + public static final String DETAILED_GRN_REPORT_PER_PRODUCT = "detailedGRNReportPerProduct"; + public static final String STOCK_ADJUSTMENTS_REPORT_DATA = "stockAdjustmentsReportData"; + public static final String INVENTORY_MOVE_HISTORY = "viewInventoryMoveHistory"; + public static final String LIST_PRICE_LISTS = "list.price.lists"; + public static final String CREATE_PRICE_LIST = "create.price.list"; + public static final String PRODUCT_PRICE_LISTS = "product.price.lists"; + public static final String PRICE_LIST_HEADERS = "price.list.headers"; + public static final String USER_PRICE_LISTS = "user.price.lists"; + public static final String REGISTER_USERS = "RegisterUser"; + public static final String USER_BEAN = "userBean"; + public static final String USER_PURCHASE_PRICE_LISTS = "user.purchase.price.lists"; + public static final String USER_SALES_PRICE_LISTS = "user.sales.price.lists"; + public static final String CONFIGURATION = "configuration"; + public static final String WEB_COMPONENTS = "web.components"; + public static final String REPORT_DESCRIPTION = "report.description"; + public static final String PROCESS_ID = "process.id"; + public static final String IMPORT_FAIL_CSV_FILE = "import.fail.csv.file"; + + public static final String CURRENCY_LIST = "currencyList"; + public static final String CURRENCY = "currency"; + public static final String IS_FROM_DELETE_PRODUCT_PRICE = "is.from.delete.product.price"; + public static final String REPORT_COMMENT = "report.comment"; + public static final String SHOPPING_CART_TOTAL = "shoppingcartTotal"; + public static final String SHOPPING_CART_DISCOUNTED_TOTAL = "shoppingcartDiscountedTotal"; + public static final String SHOPPING_CART_DISCOUNT_PERCENTAGE = "shoppingcartDiscountPercentage"; + public static final String BPARTNER_ID = "bpartner.id"; + public static final String BPARTNER_NAME = "bpartner.name"; + public static final String BPARTNER_CREDIT = "bpartner.credit"; + public static final String ORDER_PRICE_LIST = "order.price.list"; + public static final String IS_SOTRX = "isSOTrx"; + + public static final String ACCESSIBLE_BANKACCOUNTS = "accessible.bankaccounts"; + public static final String ACCESSIBLE_CASHBOOKS = "accessible.cashbooks"; + public static final String CASHBOOKS = "cashbooks"; + public static final String TERMINALS = "terminals"; + public static final String TERMINAL_TRANSFER_TYPE = "terminalTransferType"; + public static final String DISPLAYTAG_TABLE_ID = "displayTagTableId"; + public static final String ORDER_PAYMENT = "orderPayment"; + public static final String ORDER_WRITE_OFF = "orderWriteOff"; + public static final String ORDER_DICOUNT = "orderDiscount"; + public static final String ORDER_CARD_AMOUNT = MPayment.TENDERTYPE_CreditCard; + public static final String ORDER_CHECK_AMOUNT = MPayment.TENDERTYPE_Check; + public static final String ORDER_CASH_AMOUNT = "cashAmount"; + public static final String DISCOUNT_ON_ORDER_TOTAL = "discountOnOrderTotal"; + public static final String DISCOUNT_ON_ORDER_TOTAL_PERCENT = "discountOnOrderTotalPercent"; + + public static final String CREDITORS = "creditors"; + //public static final String DEBTORS = ""; + public static final String CREDITOR_HISTORY = "creditorHistory"; + public static final String DEBTOR_HISTORY = "debtorHistory"; +} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/TangoColors.java b/posterita/posterita/src/main/org/posterita/TangoColors.java new file mode 100644 index 0000000000..fbf1dbc018 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/TangoColors.java @@ -0,0 +1,37 @@ +/****************************************************************************** + * Product: Posterita Web-Based POS and Adempiere Plugin * + * Copyright (C) 2008 Posterita Ltd * + * This file is part of POSterita * + * * + * POSterita is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * + *****************************************************************************/ +package org.posterita; + +/** + * @author servansingh + * May 29, 2008 + */ +public class TangoColors +{ + public static final String ALUMINIUM_1 = "#EEEEEC"; + public static final String ALUMINIUM_2 = "#D3D7CF"; + public static final String BLUE_1 = "#D1E0EF"; + public static final String BLUE_2 = "#98B9DC"; + public static final String GREEN_1 = "#DAF5BC"; + public static final String GREEN_2 = "#ABEA6C"; + public static final String PLUM_1 = "#E9DDE8"; + public static final String PLUM_2 = "#CBAEC9"; + +} diff --git a/posterita/posterita/src/main/org/posterita/beans/AddressBean.java b/posterita/posterita/src/main/org/posterita/beans/AddressBean.java new file mode 100644 index 0000000000..d552782ef7 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/AddressBean.java @@ -0,0 +1,157 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + **/ +package org.posterita.beans; + +import org.posterita.beans.UDIBean; + +public class AddressBean extends UDIBean +{ + + public Integer getBpartnerId() + { + return bpartnerId; + } + + public void setBpartnerId(Integer bpartnerId) + { + this.bpartnerId = bpartnerId; + } + + public String getAddress1() + { + return address1; + } + + public void setAddress1(String address1) + { + this.address1 = address1; + } + + public String getAddress2() + { + return address2; + } + public void setAddress2(String address2) + { + this.address2 = address2; + } + + public Boolean getBillTo() + { + return billTo; + } + + public void setBillTo(Boolean billTo) + { + this.billTo = billTo; + } + public String getCity() + { + return city; + } + + public void setCity(String city) + { + this.city = city; + } + + public Integer getCountryId() + { + return countryId; + } + public void setCountryId(Integer countryId) + { + this.countryId = countryId; + } + + public String getPostalAddress() + { + return postalAddress; + } + + public void setPostalAddress(String postalAddress) + { + this.postalAddress = postalAddress; + } + + public Boolean getShipTo() + { + return shipTo; + } + + public void setShipTo(Boolean shipTo) + { + this.shipTo = shipTo; + } + + public String getCountryName() + { + return countryName; + } + + public void setCountryName(String countryName) + { + this.countryName = countryName; + } + + public String getUserSurname() + { + return userSurname; + } + + public void setUserSurname(String userSurname) + { + this.userSurname = userSurname; + } + + public String getUsername() + { + return username; + } + + public void setUsername(String username) + { + this.username = username; + } + + + public String getCountryCode() + { + return countryCode; + } + + public void setCountryCode(String countryCode) + { + this.countryCode = countryCode; + } + + public Integer getRegionId() + { + return regionId; + } + + public void setRegionId(Integer regionId) + { + this.regionId = regionId; + } + + +} diff --git a/posterita/posterita/src/main/org/posterita/beans/AgingBean.java b/posterita/posterita/src/main/org/posterita/beans/AgingBean.java new file mode 100644 index 0000000000..637a2e95ea --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/AgingBean.java @@ -0,0 +1,232 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Oct 17, 2006 + */ + + +package org.posterita.beans; + +import java.math.BigDecimal; +import java.sql.Timestamp; + + +public class AgingBean extends UDIBean +{ + + public Integer getCurrencyId() + { + return currencyId; + } + + public void setCurrencyId(Integer currencyId) + { + this.currencyId = currencyId; + } + + public BigDecimal getDue0() + { + return due0; + } + + public void setDue0(BigDecimal due0) + { + this.due0 = due0; + } + + public BigDecimal getDue0_30() + { + return due0_30; + } + + public void setDue0_30(BigDecimal due0_30) + { + this.due0_30 = due0_30; + } + + public BigDecimal getDue1_7() + { + return due1_7; + } + + public void setDue1_7(BigDecimal due1_7) + { + this.due1_7 = due1_7; + } + + public BigDecimal getDue31_60() + { + return due31_60; + } + + public void setDue31_60(BigDecimal due31_60) + { + this.due31_60 = due31_60; + } + + public BigDecimal getDue61_90() + { + return due61_90; + } + + public void setDue61_90(BigDecimal due61_90) + { + this.due61_90 = due61_90; + } + + public BigDecimal getDue8_30() + { + return due8_30; + } + + public void setDue8_30(BigDecimal due8_30) + { + this.due8_30 = due8_30; + } + + public BigDecimal getDue91_PLUS() + { + return due91_PLUS; + } + + public void setDue91_PLUS(BigDecimal due91_PLUS) + { + this.due91_PLUS = due91_PLUS; + } + + public BigDecimal getDueAmt() + { + return dueAmt; + } + + public void setDueAmt(BigDecimal dueAmt) + { + this.dueAmt = dueAmt; + } + + public Timestamp getDueDate() + { + return dueDate; + } + + public void setDueDate(Timestamp dueDate) + { + this.dueDate = dueDate; + } + + public BigDecimal getInvoicedAmt() + { + return invoicedAmt; + } + + public void setInvoicedAmt(BigDecimal invoicedAmt) + { + this.invoicedAmt = invoicedAmt; + } + + public Integer getInvoiceId() + { + return invoiceId; + } + + public void setInvoiceId(Integer invoiceId) + { + this.invoiceId = invoiceId; + } + + public BigDecimal getOpenAmt() + { + return openAmt; + } + + public void setOpenAmt(BigDecimal openAmt) + { + this.openAmt = openAmt; + } + + public BigDecimal getPastDue1_30() + { + return pastDue1_30; + } + + public void setPastDue1_30(BigDecimal pastDue1_30) + { + this.pastDue1_30 = pastDue1_30; + } + + public BigDecimal getPastDue1_7() + { + return pastDue1_7; + } + + public void setPastDue1_7(BigDecimal pastDue1_7) + { + this.pastDue1_7 = pastDue1_7; + } + + public BigDecimal getPastDue31_60() + { + return pastDue31_60; + } + + public void setPastDue31_60(BigDecimal pastDue31_60) + { + this.pastDue31_60 = pastDue31_60; + } + + public BigDecimal getPastDue61_90() + { + return pastDue61_90; + } + + public void setPastDue61_90(BigDecimal pastDue61_90) + { + this.pastDue61_90 = pastDue61_90; + } + + public BigDecimal getPastDue8_30() + { + return pastDue8_30; + } + + public void setPastDue8_30(BigDecimal pastDue8_30) + { + this.pastDue8_30 = pastDue8_30; + } + + public BigDecimal getPastDue91_plus() + { + return pastDue91_plus; + } + + public void setPastDue91_plus(BigDecimal pastDue91_plus) + { + this.pastDue91_plus = pastDue91_plus; + } + + public BigDecimal getPastDueAmt() + { + return pastDueAmt; + } + + public void setPastDueAmt(BigDecimal pastDueAmt) + { + this.pastDueAmt = pastDueAmt; + } + +} diff --git a/posterita/posterita/src/main/org/posterita/beans/ApplicationParametersBean.java b/posterita/posterita/src/main/org/posterita/beans/ApplicationParametersBean.java new file mode 100644 index 0000000000..5951222de0 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/ApplicationParametersBean.java @@ -0,0 +1,54 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * */ +package org.posterita.beans; + + +public class ApplicationParametersBean extends UDIBean +{ + public String getApplicationName() + { + return applicationName; + } + + public void setApplicationName(String applicationName) + { + this.applicationName = applicationName; + } + + public String getApplicationWebContext() + { + return applicationWebContext; + } + + public void setApplicationWebContext(String applicationWebContext) + { + this.applicationWebContext = applicationWebContext; + } + + public Integer getStoreId() + { + return storeId; + } + + public void setStoreId(Integer storeId) + { + this.storeId = storeId; + } +} diff --git a/posterita/posterita/src/main/org/posterita/beans/AttachmentBean.java b/posterita/posterita/src/main/org/posterita/beans/AttachmentBean.java new file mode 100644 index 0000000000..e888a7b19e --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/AttachmentBean.java @@ -0,0 +1,35 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 26-Aug-2005 by alok + * + */ +package org.posterita.beans; + + +public class AttachmentBean extends UDIBean +{ + public String getLogoName() + { + return logoName; + } + public void setLogoName(String logoName) + { + this.logoName = logoName; + } +} diff --git a/posterita/posterita/src/main/org/posterita/beans/AttributeBean.java b/posterita/posterita/src/main/org/posterita/beans/AttributeBean.java new file mode 100644 index 0000000000..ee17bc3ac9 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/AttributeBean.java @@ -0,0 +1,227 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Jun 15, 2006 + */ + + +package org.posterita.beans; + +import java.math.BigDecimal; +import java.util.ArrayList; + + +public class AttributeBean extends UDIBean +{ + public BigDecimal getUnitPrice() + { + return unitPrice; + } + + public void setUnitPrice(BigDecimal unitPrice) + { + this.unitPrice = unitPrice; + } + + public BigDecimal getPrice() + { + return price; + } + + public void setPrice(BigDecimal price) + { + this.price = price; + } + + public String getBarCode() + { + return barCode; + } + + public void setBarCode(String barCode) + { + this.barCode = barCode; + } + + public Integer[] getProductIds() + { + return productIds; + } + + public void setProductIds(Integer[] productIds) + { + this.productIds = productIds; + } + + public String getQtyNumberFilter() + { + return qtyNumberFilter; + } + + public void setQtyNumberFilter(String qtyNumberFilter) + { + this.qtyNumberFilter = qtyNumberFilter; + } + + public String getQtyFilter() + { + return qtyFilter; + } + + public void setQtyFilter(String qtyFilter) + { + this.qtyFilter = qtyFilter; + } + + public Integer getAttributeSetInstanceId() + { + return attributeSetInstanceId; + } + + public void setAttributeSetInstanceId(Integer attributeSetInstanceId) + { + this.attributeSetInstanceId = attributeSetInstanceId; + } + + public Integer getProductId() + { + return productId; + } + public void setProductId(Integer productId) { + this.productId = productId; + } + + public String getProductName() + { + return productName; + } + + public void setProductName(String productName) + { + this.productName = productName; + } + + public BigDecimal getQuantity() + { + return quantity; + } + + public void setQuantity(BigDecimal quantity) + { + this.quantity = quantity; + } + + public Integer getAttributeValueId() + { + return attributeValueId; + } + + public void setAttributeValueId(Integer attributeValueId) + { + this.attributeValueId = attributeValueId; + } + + public String getAttributeValue() + { + return attributeValue; + } + + public void setAttributeValue(String attributeValue) + { + this.attributeValue = attributeValue; + } + + public String getAttributeName() + { + return attributeName; + } + + public void setAttributeName(String attributeName) + { + this.attributeName = attributeName; + } + + public Integer getAttributeId() + { + return attributeId; + } + + public void setAttributeId(Integer attributeId) + { + this.attributeId = attributeId; + } + + public Integer getAttributeSetId() + { + return attributeSetId; + } + + public void setAttributeSetId(Integer attributeSetId) + { + this.attributeSetId = attributeSetId; + } + + public String getAttributeSetName() + { + return attributeSetName; + } + + public void setAttributeSetName(String attributeSetName) + { + this.attributeSetName = attributeSetName; + } + + public ArrayList getAttributeValueList() + { + return attributeValueList; + } + + public void setAttributeValueList(ArrayList attributeValueList) + { + this.attributeValueList = attributeValueList; + } + + public String[] getAttributeValueIds() + { + return attributeValueIds; + } + + public void setAttributeValueIds(String[] attributeValueIds) + { + this.attributeValueIds = attributeValueIds; + } + public void setUom(String uom) + { + this.uom = uom; + } + public String getUom() + { + return this.uom; + } + + public String getDescription() + { + return description; + } + + public void setDescription(String description) + { + this.description = description; + } + +} diff --git a/posterita/posterita/src/main/org/posterita/beans/AttributeInstanceBean.java b/posterita/posterita/src/main/org/posterita/beans/AttributeInstanceBean.java new file mode 100644 index 0000000000..5e435055a3 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/AttributeInstanceBean.java @@ -0,0 +1,93 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ +package org.posterita.beans; + + +public class AttributeInstanceBean +{ + private int attributeSetInstanceId; + private int attributeId; + private String attributeValue; + private String attribute; + private int attributeValueId; + + + public int getAttributeId() + { + + return attributeId; + } + + public void setAttributeId(int attributeId) + { + this.attributeId = attributeId; + } + + public int getAttributeSetInstanceId() + { + return attributeSetInstanceId; + } + + public void setAttributeSetInstanceId(int attributeSetInstanceId) + { + this.attributeSetInstanceId = attributeSetInstanceId; + } + + public String getAttribute() + { + return attribute; + } + + public void setAttribute(String attribute) + { + this.attribute = attribute; + } + + public String getAttributeValue() + { + return attributeValue; + } + public void setAttributeValue(String attributeValue) + { + this.attributeValue = attributeValue; + } + public int getAttributeValueId() + { + return attributeValueId; + } + + public void setAttributeValueId(int attributeValueId) + { + this.attributeValueId = attributeValueId; + } + + public boolean equals(Object o) + { + if (o == null) + return false; + + AttributeInstanceBean bean = (AttributeInstanceBean) o; + + if (bean.getAttributeSetInstanceId() == this.getAttributeSetInstanceId()) + return true; + + return false; + } +} diff --git a/posterita/posterita/src/main/org/posterita/beans/AttributeValueDetailBean.java b/posterita/posterita/src/main/org/posterita/beans/AttributeValueDetailBean.java new file mode 100644 index 0000000000..b3286e7663 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/AttributeValueDetailBean.java @@ -0,0 +1,95 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Feb 3, 2006 by praveen + * + */ +package org.posterita.beans; + +public class AttributeValueDetailBean extends UDIBean +{ + public String getDescription() + { + return description; + } + + public void setDescription(String description) + { + this.description = description; + } + + public Integer getId() + { + return id; + } + + public void setId(Integer id) + { + this.id = id; + } + + public String getName() + { + return name; + } + + public void setName(String name) + { + this.name = name; + } + + public Boolean getIsActive() + { + return isActive; + } + + public void setActive(Boolean isActive) + { + this.isActive = isActive; + } + + public Integer getAttributeId() + { + return attributeId; + } + + public void setAttributeId(Integer attributeId) + { + this.attributeId = attributeId; + } + + public Integer getAttributeValueId() + { + return attributeValueId; + } + + public void setAttributeValueId(Integer attributeValueId) + { + this.attributeValueId = attributeValueId; + } + + public String getNewName() + { + return newName; + } + + public void setNewName(String newName) + { + this.newName = newName; + } +} diff --git a/posterita/posterita/src/main/org/posterita/beans/AttributeValuesBean.java b/posterita/posterita/src/main/org/posterita/beans/AttributeValuesBean.java new file mode 100644 index 0000000000..82293a4373 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/AttributeValuesBean.java @@ -0,0 +1,155 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ +package org.posterita.beans; + + +import java.util.ArrayList; + +import org.compiere.util.KeyNamePair; + +public class AttributeValuesBean extends UDIBean +{ + private ArrayList brand = new ArrayList(); + private ArrayList model = new ArrayList(); + private ArrayList design = new ArrayList(); + private ArrayList colour = new ArrayList(); + private ArrayList size = new ArrayList(); + private ArrayList trx = new ArrayList(); + private ArrayList years = new ArrayList(); + private ArrayList ETAList = new ArrayList(); + private ArrayList make = new ArrayList(); + private ArrayList modelGroup = new ArrayList(); + + public void setAttributeId(Integer attributeId) + { + this.attributeId = attributeId; + } + + public Integer getAttributeSetId() + { + return attributeSetId; + } + + public ArrayList getAttributeSet() + { + return attributeSet; + } + public void setAttributeSet(ArrayList attributeSet) + { + this.attributeSet = attributeSet; + } + private ArrayList attributeSet; + + public ArrayList getColour() + { + return colour; + } + + public void setColour(ArrayList colour) + { + this.colour = colour; + } + + public ArrayList getModel() + { + return model; + } + + public void setModel(ArrayList model) + { + this.model = model; + } + + public ArrayList getTrx() + { + return trx; + } + + public void setTrx(ArrayList trx) + { + this.trx = trx; + } + + public ArrayList getYears() + { + return years; + } + + public void setYears(ArrayList years) + { + this.years = years; + } + + public ArrayList getMake() + { + return make; + } + + public void setMake(ArrayList make) + { + this.make = make; + } + + public ArrayList getModelGroup() + { + return modelGroup; + } + + public void setModelGroup(ArrayList modelGroup) + { + this.modelGroup = modelGroup; + } + + public ArrayList getETAList() + { + return ETAList; + } + + public void setETAList(ArrayList list) + { + ETAList = list; + } + + public ArrayList getBrand() { + return brand; + } + + public void setBrand(ArrayList brand) { + this.brand = brand; + } + + public ArrayList getDesign() { + return design; + } + + public void setDesign(ArrayList design) { + this.design = design; + } + + public ArrayList getSize() { + return size; + } + + public void setSize(ArrayList size) { + this.size = size; + } + + +} diff --git a/posterita/posterita/src/main/org/posterita/beans/AttributeValuesPair.java b/posterita/posterita/src/main/org/posterita/beans/AttributeValuesPair.java new file mode 100644 index 0000000000..5af78d5c87 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/AttributeValuesPair.java @@ -0,0 +1,139 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ +package org.posterita.beans; + +import org.compiere.util.KeyNamePair; + + +public class AttributeValuesPair +{ + private KeyNamePair makeAttributeValue; + private KeyNamePair modelAttributeValue; + private KeyNamePair modelGroupAttributeValue; + private KeyNamePair colourAttributeValue; + private KeyNamePair transmissionAttributeValue; + private KeyNamePair yearAttributeValue; + private KeyNamePair styleAttributeValue; + private KeyNamePair sizeAttributeValue; + private KeyNamePair designAttributeValue; + private KeyNamePair brandAttributeValue; + + + public KeyNamePair getBrandAttributeValue() + { + return brandAttributeValue; + } + + public void setBrandAttributeValue(KeyNamePair brandAttributeValue) + { + this.brandAttributeValue = brandAttributeValue; + } + + public KeyNamePair getColourAttributeValue() + { + return colourAttributeValue; + } + + public void setColourAttributeValue(KeyNamePair colourAttributeValue) + { + this.colourAttributeValue = colourAttributeValue; + } + + public KeyNamePair getModelAttributeValue() + { + return modelAttributeValue; + } + + public void setModelAttributeValue(KeyNamePair modelAttributeValue) + { + this.modelAttributeValue = modelAttributeValue; + } + + + public KeyNamePair getTransmissionAttributeValue() + { + return transmissionAttributeValue; + } + + public void setTransmissionAttributeValue(KeyNamePair transmissionAttributeValue) + { + this.transmissionAttributeValue = transmissionAttributeValue; + } + + public KeyNamePair getYearAttributeValue() + { + return yearAttributeValue; + } + + public void setYearAttributeValue(KeyNamePair yearAttributeValue) + { + this.yearAttributeValue = yearAttributeValue; + } + + public KeyNamePair getMakeAttributeValue() + { + return makeAttributeValue; + } + + public void setMakeAttributeValue(KeyNamePair makeAttributeValue) + { + this.makeAttributeValue = makeAttributeValue; + } + + public KeyNamePair getModelGroupAttributeValue() + { + return modelGroupAttributeValue; + } + + public void setModelGroupAttributeValue(KeyNamePair modelGroupAttributeValue) + { + this.modelGroupAttributeValue = modelGroupAttributeValue; + } + + public KeyNamePair getDesignAttributeValue() + { + return designAttributeValue; + } + + public void setDesignAttributeValue(KeyNamePair designAttributeValue) + { + this.designAttributeValue = designAttributeValue; + } + + public KeyNamePair getSizeAttributeValue() + { + return sizeAttributeValue; + } + + public void setSizeAttributeValue(KeyNamePair sizeAttributeValue) + { + this.sizeAttributeValue = sizeAttributeValue; + } + + public KeyNamePair getStyleAttributeValue() + { + return styleAttributeValue; + } + + public void setStyleAttributeValue(KeyNamePair styleAttributeValue) + { + this.styleAttributeValue = styleAttributeValue; + } +} diff --git a/posterita/posterita/src/main/org/posterita/beans/AvailableProductSizeBean.java b/posterita/posterita/src/main/org/posterita/beans/AvailableProductSizeBean.java new file mode 100644 index 0000000000..812291f8bd --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/AvailableProductSizeBean.java @@ -0,0 +1,69 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + **/ +package org.posterita.beans; + + +public class AvailableProductSizeBean extends UDIBean +{ + private Boolean existsInSmall = Boolean.valueOf(false); + private Boolean existsInMedium = Boolean.valueOf(false); + private Boolean existsInLarge = Boolean.valueOf(false); + private Boolean existsInXLarge = Boolean.valueOf(false); + + public Boolean getExistsInLarge() + { + return existsInLarge; + } + + public void setExistsInLarge(Boolean existsInLarge) + { + this.existsInLarge = existsInLarge; + } + + public Boolean getExistsInMedium() + { + return existsInMedium; + } + + public void setExistsInMedium(Boolean existsInMedium) + { + this.existsInMedium = existsInMedium; + } + + public Boolean getExistsInSmall() + { + return existsInSmall; + } + + public void setExistsInSmall(Boolean existsInSmall) + { + this.existsInSmall = existsInSmall; + } + + public Boolean getExistsInXLarge() + { + return existsInXLarge; + } + + public void setExistsInXLarge(Boolean existsInXLarge) + { + this.existsInXLarge = existsInXLarge; + } +} diff --git a/posterita/posterita/src/main/org/posterita/beans/BPartnerBean.java b/posterita/posterita/src/main/org/posterita/beans/BPartnerBean.java new file mode 100644 index 0000000000..5a9fcc9542 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/BPartnerBean.java @@ -0,0 +1,256 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 25-Jul-2005 by alok + * + */ +package org.posterita.beans; + +import java.math.BigDecimal; + +public class BPartnerBean +{ + protected String postalCode; + protected Integer orgId; + protected String countryName; + protected Integer countryId; + protected String name2; + protected Integer bpartnerId; + protected String partnerName; + protected Boolean isCustomer; + protected Boolean isEmployee; + protected Boolean isSalesRep; + protected Boolean isVendor; + protected String phone; + protected String address1; + protected String city; + protected String postalAddress; + protected Integer regionId; + protected Boolean isActive; + protected Integer locationId; + protected String address2; + protected String fax; + protected BigDecimal openBalance; + protected BigDecimal actualLifetimeValue; + protected BigDecimal creditLimit; + protected BigDecimal creditUsed; + + public String getPostalCode() + { + return postalCode; + } + + public void setPostalCode(String postalCode) + { + this.postalCode = postalCode; + } + + public Integer getOrgId() { + return orgId; + } + + public void setOrgId(Integer orgId) { + this.orgId = orgId; + } + + public String getCountryName() + { + return countryName; + } + + public void setCountryName(String countryName) + { + this.countryName = countryName; + } + + public Integer getCountryId() + { + return countryId; + } + + public void setCountryId(Integer countryId) + { + this.countryId = countryId; + } + + public String getName2() + { + return name2; + } + public void setName2(String name2) + { + this.name2 = name2; + } + public Integer getBpartnerId() + { + return bpartnerId; + } + public void setBpartnerId(Integer bpartnerId) + { + this.bpartnerId = bpartnerId; + } + + public String getPartnerName() + { + return partnerName; + } + public void setPartnerName(String partnerName) + { + this.partnerName = partnerName; + } + public Boolean getIsCustomer() + { + return isCustomer; + } + public void setIsCustomer(Boolean isCustomer) + { + this.isCustomer = isCustomer; + } + public Boolean getIsEmployee() + { + return isEmployee; + } + public void setIsEmployee(Boolean isEmployee) + { + this.isEmployee = isEmployee; + } + public Boolean getIsSalesRep() + { + return isSalesRep; + } + public void setIsSalesRep(Boolean isSalesRep) + { + this.isSalesRep = isSalesRep; + } + public Boolean getIsVendor() + { + return isVendor; + } + public void setIsVendor(Boolean isVendor) + { + this.isVendor = isVendor; + } + public String getPhone() + { + return phone; + } + public void setPhone(String phone) + { + this.phone = phone; + } + + public String getAddress1() + { + return address1; + } + public void setAddress1(String address1) + { + this.address1 = address1; + } + public String getCity() + { + return city; + } + public void setCity(String city) + { + this.city = city; + } + + public String getPostalAddress() + { + return postalAddress; + } + public void setPostalAddress(String postalAddress) + { + this.postalAddress = postalAddress; + } + + public Integer getRegionId() + { + return regionId; + } + public void setRegionId(Integer regionId) + { + this.regionId = regionId; + } + + public Boolean getIsActive() + { + return isActive; + } + public void setIsActive(Boolean isActive) + { + this.isActive = isActive; + } + public Integer getLocationId() + { + return locationId; + } + public void setLocationId(Integer locationId) + { + this.locationId = locationId; + } + public String getAddress2() + { + return address2; + } + public void setAddress2(String address2) + { + this.address2 = address2; + } + public String getFax() + { + return fax; + } + public void setFax(String fax) + { + this.fax = fax; + } + + public BigDecimal getOpenBalance() { + return openBalance; + } + + public void setOpenBalance(BigDecimal openBalance) { + this.openBalance = openBalance; + } + + public BigDecimal getActualLifetimeValue() { + return actualLifetimeValue; + } + + public void setActualLifetimeValue(BigDecimal actualLifetimeValue) { + this.actualLifetimeValue = actualLifetimeValue; + } + + public BigDecimal getCreditLimit() { + return creditLimit; + } + + public void setCreditLimit(BigDecimal creditLimit) { + this.creditLimit = creditLimit; + } + + public BigDecimal getCreditUsed() { + return creditUsed; + } + + public void setCreditUsed(BigDecimal creditUsed) { + this.creditUsed = creditUsed; + } +} diff --git a/posterita/posterita/src/main/org/posterita/beans/BPartnerInfoBean.java b/posterita/posterita/src/main/org/posterita/beans/BPartnerInfoBean.java new file mode 100644 index 0000000000..3cdc47da78 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/BPartnerInfoBean.java @@ -0,0 +1,264 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Jul 26, 2006 + */ + + +package org.posterita.beans; + +import java.math.BigDecimal; + + +public class BPartnerInfoBean extends UDIBean +{ + + protected String soCreditStatus; + protected String forward; + + public String getForward() + { + return forward; + } + + public void setForward(String forward) + { + this.forward = forward; + } + + public String getBpfirstSale() + { + return bpfirstSale; + } + + public void setBpfirstSale(String bpfirstSale) + { + this.bpfirstSale = bpfirstSale; + } + + public String getSoCreditStatus() + { + return soCreditStatus; + } + + public void setSoCreditStatus(String soCreditStatus) + { + this.soCreditStatus = soCreditStatus; + } + + public Integer getDunningId() + { + return dunningId; + } + + public void setDunningId(Integer dunningId) + { + this.dunningId = dunningId; + } + + public Integer[] getBpartnerIds() + { + return bpartnerIds; + } + + public void setBpartnerIds(Integer[] bpartnerIds) + { + this.bpartnerIds = bpartnerIds; + } + + public BigDecimal getCreditLimit() + { + return creditLimit; + } + + public void setCreditLimit(BigDecimal creditLimit) + { + this.creditLimit = creditLimit; + } + + public BigDecimal getCreditUsed() + { + return creditUsed; + } + + public void setCreditUsed(BigDecimal creditUsed) + { + this.creditUsed = creditUsed; + } + + public BigDecimal getOpenAmt() + { + return openAmt; + } + + public void setOpenAmt(BigDecimal openAmt) + { + this.openAmt = openAmt; + } + + public BigDecimal getRevenue() + { + return revenue; + } + + public void setRevenue(BigDecimal revenue) + { + this.revenue = revenue; + } + + public BigDecimal getAmount() + { + return amount; + } + + public void setAmount(BigDecimal amount) + { + this.amount = amount; + } + + public Integer getProductId() + { + return productId; + } + + public void setProductId(Integer productId) + { + this.productId = productId; + } + + public String getProductName() + { + return productName; + } + + public void setProductName(String productName) + { + this.productName = productName; + } + + public String getAddress1() + { + return address1; + } + + public void setAddress1(String address1) + { + this.address1 = address1; + } + + public String getAddress2() + { + return address2; + } + + public void setAddress2(String address2) + { + this.address2 = address2; + } + + public String getCity() + { + return city; + } + + public void setCity(String city) + { + this.city = city; + } + + public Boolean getIsCustomer() + { + return isCustomer; + } + + public void setIsCustomer(Boolean isCustomer) + { + this.isCustomer = isCustomer; + } + + public Integer getBpartnerId() + { + return bpartnerId; + } + + public void setBpartnerId(Integer bpartnerId) + { + this.bpartnerId = bpartnerId; + } + + public String getEmail() + { + return email; + } + + public void setEmail(String email) + { + this.email = email; + } + + public String getFax() + { + return fax; + } + + public void setFax(String fax) + { + this.fax = fax; + } + + public String getPartnerName() + { + return partnerName; + } + + public void setPartnerName(String partnerName) + { + this.partnerName = partnerName; + } + + public String getPhone2() + { + return phone2; + } + + public void setPhone2(String phone2) + { + this.phone2 = phone2; + } + + public String getPhone() + { + return phone; + } + + public void setPhone(String phone) + { + this.phone = phone; + } + + public BigDecimal getQuantity() + { + return quantity; + } + + public void setQuantity(BigDecimal quantity) + { + this.quantity = quantity; + } + +} diff --git a/posterita/posterita/src/main/org/posterita/beans/BankAccountBean.java b/posterita/posterita/src/main/org/posterita/beans/BankAccountBean.java new file mode 100644 index 0000000000..30d004557e --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/BankAccountBean.java @@ -0,0 +1,96 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Jul 26, 2005 by praveen + * + */ +package org.posterita.beans; + +public class BankAccountBean extends UDIBean +{ + public String getAccountNo() + { + return accountNo; + } + + public void setAccountNo(String accountNo) + { + this.accountNo = accountNo; + } + + public String getAccountType() + { + return accountType; + } + + public void setAccountType(String accountType) + { + this.accountType = accountType; + } + + public Integer getBankId() + { + return bankId; + } + + public void setBankId(Integer bankId) + { + this.bankId = bankId; + } + + public Double getCurrentBalance() + { + return currentBalance; + } + + public void setCurrentBalance(Double currentBalance) + { + this.currentBalance = currentBalance; + } + + public String getBankName() + { + return bankName; + } + + public void setBankName(String bankName) + { + this.bankName = bankName; + } + + public String getSummary() + { + return bankName + " - " + accountNo; + } + + /** + * @return the bankAccountId + */ + public Integer getBankAccountId() + { + return bankAccountId; + } + + /** + * @param bankAccountId the bankAccountId to set + */ + public void setBankAccountId(Integer bankAccountId) + { + this.bankAccountId = bankAccountId; + } +} diff --git a/posterita/posterita/src/main/org/posterita/beans/BankBean.java b/posterita/posterita/src/main/org/posterita/beans/BankBean.java new file mode 100644 index 0000000000..127791ac04 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/BankBean.java @@ -0,0 +1,84 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 26-Jul-2005 by alok + * + */ +package org.posterita.beans; + + +public class BankBean extends UDIBean +{ + public String getAddress1() + { + return address1; + } + public void setAddress1(String address1) + { + this.address1 = address1; + } + + public Integer getBankId() + { + return bankId; + } + public void setBankId(Integer bankId) + { + this.bankId = bankId; + } + public String getBankName() + { + return bankName; + } + public void setBankName(String bankName) + { + this.bankName = bankName; + } + public String getCity() + { + return city; + } + public void setCity(String city) + { + this.city = city; + } + public String getPostalAddress() + { + return postalAddress; + } + public void setPostalAddress(String postalAddress) + { + this.postalAddress = postalAddress; + } + public String getRoutingNumber() + { + return routingNumber; + } + public void setRoutingNumber(String routingNumber) + { + this.routingNumber = routingNumber; + } + public Integer getLocationId() + { + return locationId; + } + public void setLocationId(Integer locationId) + { + this.locationId = locationId; + } +} diff --git a/posterita/posterita/src/main/org/posterita/beans/BankStatementLineBean.java b/posterita/posterita/src/main/org/posterita/beans/BankStatementLineBean.java new file mode 100644 index 0000000000..11b0769599 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/BankStatementLineBean.java @@ -0,0 +1,114 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ +package org.posterita.beans; + +import java.math.BigDecimal; +import java.sql.Timestamp; + + +public class BankStatementLineBean +{ + private Timestamp dateTrx; + private String documentNo; + private int paymentId; + private int currencyId; + private String isoCode; + private BigDecimal payAmt; + private BigDecimal currencyConvert; + private String bpName; + + + public String getBpName() + { + return bpName; + } + + public void setBpName(String bpName) + { + this.bpName = bpName; + } + + public BigDecimal getCurrencyConvert() + { + return currencyConvert; + } + + public void setCurrencyConvert(BigDecimal currencyConvert) + { + this.currencyConvert = currencyConvert; + } + + public int getCurrencyId() + { + return currencyId; + } + + public void setCurrencyId(int currencyId) + { + this.currencyId = currencyId; + } + public Timestamp getDateTrx() + { + return dateTrx; + } + + public void setDateTrx(Timestamp dateTrx) + { + this.dateTrx = dateTrx; + } + + public String getDocumentNo() + { + return documentNo; + } + + public void setDocumentNo(String documentNo) { + this.documentNo = documentNo; + } + + public String getIsoCode() + { + return isoCode; + } + + + public void setIsoCode(String isoCode) + { + this.isoCode = isoCode; + } + public BigDecimal getPayAmt() { + return payAmt; + } + + public void setPayAmt(BigDecimal payAmt) + { + this.payAmt = payAmt; + } + + public int getPaymentId() + { + return paymentId; + } + + public void setPaymentId(int paymentId) + { + this.paymentId = paymentId; + } +} diff --git a/posterita/posterita/src/main/org/posterita/beans/BlackListedBean.java b/posterita/posterita/src/main/org/posterita/beans/BlackListedBean.java new file mode 100644 index 0000000000..71a2b0c169 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/BlackListedBean.java @@ -0,0 +1,53 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + **/ +package org.posterita.beans; + +public class BlackListedBean extends UDIBean +{ + + public String getBlackListedBankName() + { + return blackListedBankName; + } + public void setBlackListedBankName(String blackListedBankName) + { + this.blackListedBankName = blackListedBankName; + } + public String getBlackListedChequeNo() + { + return blackListedChequeNo; + } + public void setBlackListedChequeNo(String blackListedChequeNo) + { + this.blackListedChequeNo = blackListedChequeNo; + } + public Integer getBlackListedId() + { + return blackListedId; + } + public void setBlackListedId(Integer blackListedId) + { + this.blackListedId = blackListedId; + } + + + + +} diff --git a/posterita/posterita/src/main/org/posterita/beans/CashBean.java b/posterita/posterita/src/main/org/posterita/beans/CashBean.java new file mode 100644 index 0000000000..f1cd43f794 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/CashBean.java @@ -0,0 +1,141 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Created on May 3, 2006 + */ + + +package org.posterita.beans; + +import java.math.BigDecimal; +import java.sql.Timestamp; + + +public class CashBean extends UDIBean +{ + + public Integer getCashId() + { + return cashId; + } + public void setCashId(Integer cashId) + { + this.cashId = cashId; + } + public Timestamp getDateAcct() + { + return dateAcct; + } + public void setDateAcct(Timestamp dateAcct) + { + this.dateAcct = dateAcct; + } + public Timestamp getDateCreated() + { + return dateCreated; + } + public void setDateCreated(Timestamp dateCreated) + { + this.dateCreated = dateCreated; + } + public Timestamp getDateUpdated() + { + return dateUpdated; + } + public void setDateUpdated(Timestamp dateUpdated) + { + this.dateUpdated = dateUpdated; + } + public String getName() + { + return name; + } + public void setName(String name) + { + this.name = name; + } + public String getStatmentDate() + { + return statmentDate; + } + public void setStatmentDate(String statmentDate) + { + this.statmentDate = statmentDate; + } + public String getCashJournalDisc() + { + return cashJournalDisc; + } + public void setCashJournalDisc(String cashJournalDisc) + { + this.cashJournalDisc = cashJournalDisc; + } + public Integer getCashJournalId() + { + return cashJournalId; + } + public void setCashJournalId(Integer cashJournalId) + { + this.cashJournalId = cashJournalId; + } + public String getCashJournalName() + { + return cashJournalName; + } + public void setCashJournalName(String cashJournalName) + { + this.cashJournalName = cashJournalName; + } + public BigDecimal getBeginingBalance() + { + return beginingBalance; + } + + public void setBeginingBalance(BigDecimal beginingBalance) + { + this.beginingBalance = beginingBalance; + } + + public BigDecimal getEndingBalance() + { + return endingBalance; + } + + public void setEndingBalance(BigDecimal endingBalance) + { + this.endingBalance = endingBalance; + } + public String getDocStatus() + { + return docStatus; + } + public void setDocStatus(String docStatus) + { + this.docStatus = docStatus; + } + public String toString() + { + StringBuffer buffer = new StringBuffer(); + buffer.append("\n The Begining Balance = "+getBeginingBalance()); + buffer.append("\n The Ending Balance = "+getEndingBalance()); + + return buffer.toString(); + } +} + diff --git a/posterita/posterita/src/main/org/posterita/beans/CashBookBean.java b/posterita/posterita/src/main/org/posterita/beans/CashBookBean.java new file mode 100644 index 0000000000..09034c35fe --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/CashBookBean.java @@ -0,0 +1,155 @@ +/****************************************************************************** + * Product: Posterita Web-Based POS and Adempiere Plugin * + * Copyright (C) 2008 Posterita Ltd * + * This file is part of POSterita * + * * + * POSterita is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * + *****************************************************************************/ +package org.posterita.beans; + +/** + * @author Ashley G Ramdass + * May 2, 2008 + */ +public class CashBookBean extends UDIBean +{ + /** + * @return the cashBookId + */ + public Integer getCashBookId() + { + return (cashBookId == null ? 0 : cashBookId); + } + + /** + * @param cashBookId the cashBookId to set + */ + public void setCashBookId(Integer cashBookId) + { + this.cashBookId = cashBookId; + } + + /** + * @return the cashBookName + */ + public String getCashBookName() + { + return cashBookName; + } + + /** + * @param cashBookName the cashBookName to set + */ + public void setCashBookName(String cashBookName) + { + this.cashBookName = cashBookName; + } + + /** + * @return the description + */ + public String getDescription() + { + return description; + } + + /** + * @param description the description to set + */ + public void setDescription(String description) + { + this.description = description; + } + + /** + * @return the isActive + */ + public Boolean getIsActive() + { + return isActive; + } + + /** + * @param isActive the isActive to set + */ + public void setIsActive(Boolean isActive) + { + this.isActive = isActive; + } + + /** + * @return the isDefault + */ + public Boolean getIsDefault() + { + return isDefault; + } + + /** + * @param isDefault the isDefault to set + */ + public void setIsDefault(Boolean isDefault) + { + this.isDefault = isDefault; + } + + /** + * @return the orgId + */ + public Integer getOrgId() + { + return orgId; + } + + /** + * @param orgId the orgId to set + */ + public void setOrgId(Integer orgId) + { + this.orgId = orgId; + } + + /** + * @return The currencyId + */ + public Integer getCurrencyId() + { + return (currencyId == null ? 0 : currencyId); + } + + /** + * @param currencyId The currencyId to set + */ + public void setCurrencyId(Integer currencyId) + { + this.currencyId = currencyId; + } + + /** + * @return The currency + */ + public String getCurrency() + { + return currency; + } + + /** + * @param currency The currency to set + */ + public void setCurrency(String currency) + { + this.currency = currency; + } +} diff --git a/posterita/posterita/src/main/org/posterita/beans/CashBookDetailBean.java b/posterita/posterita/src/main/org/posterita/beans/CashBookDetailBean.java new file mode 100644 index 0000000000..cf4b10ccce --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/CashBookDetailBean.java @@ -0,0 +1,247 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Created on May 3, 2006 + */ + + +package org.posterita.beans; + +import java.math.BigDecimal; +import java.sql.Timestamp; + + +public class CashBookDetailBean extends UDIBean +{ + public String getTransferType() + { + return transferType; + } + + public void setTransferType(String transferType) + { + this.transferType = transferType; + } + + public BigDecimal getDifferenceAmt() + { + return differenceAmt; + } + + public void setDifferenceAmt(BigDecimal differenceAmt) + { + this.differenceAmt = differenceAmt; + } + + public BigDecimal getAdjustmentAmount() + { + return adjustmentAmount; + } + + public void setAdjustmentAmount(BigDecimal adjustmentAmount) + { + this.adjustmentAmount = adjustmentAmount; + } + + public Boolean getTransferAllAmount() + { + return transferAllAmount; + } + public void setTransferAllAmount(Boolean transferAllAmount) + { + this.transferAllAmount = transferAllAmount; + } + public String getBeginingBalanceAsString() + { + return beginingBalanceAsString; + } + public void setBeginingBalanceAsString(String beginingBalanceAsString) + { + this.beginingBalanceAsString = beginingBalanceAsString; + } + public String getEndingBalanceAsString() + { + return endingBalanceAsString; + } + public void setEndingBalanceAsString(String endingBalanceAsString) + { + this.endingBalanceAsString = endingBalanceAsString; + } + public BigDecimal getTransferAmount() + { + return transferAmount; + } + public void setTransferAmount(BigDecimal transferAmount) + { + this.transferAmount = transferAmount; + } + public Integer getCashJournalId() + { + return cashJournalId; + } + public void setCashJournalId(Integer cashJournalId) + { + this.cashJournalId = cashJournalId; + } + public Integer getCashBookId() + { + return cashBookId; + } + + public void setCashBookId(Integer cashBookId) + { + this.cashBookId = cashBookId; + } + public String getCashJournalName() + { + return cashJournalName; + } + public void setCashJournalName(String cashJournalName) + { + this.cashJournalName = cashJournalName; + } + public String getCashJournalDisc() + { + return cashJournalDisc; + } + public void setCashJournalDisc(String cashJournalDisc) + { + this.cashJournalDisc = cashJournalDisc; + } + public void setDateAcct(Timestamp dateAcct) + { + this.dateAcct = dateAcct; + } + public BigDecimal getBeginingBalance() + { + return beginingBalance; + } + + public void setBeginingBalance(BigDecimal beginingBalance) + { + this.beginingBalance = beginingBalance; + } + public BigDecimal getEndingBalance() + { + return endingBalance; + } + + public void setEndingBalance(BigDecimal endingBalance) + { + this.endingBalance = endingBalance; + } + public BigDecimal getStatementDifference() + { + return statementDifference; + } + + public void setStatementDifference(BigDecimal statementDifference) + { + this.statementDifference = statementDifference; + } + public String getDocStatus() { + return docStatus; + } + public void setDocStatus(String docStatus) { + this.docStatus = docStatus; + } + public String getCashBookName() + { + return cashBookName; + } + + public void setCashBookName(String cashBookName) + { + this.cashBookName = cashBookName; + } + + public BigDecimal getCardTotal() + { + return cardTotal; + } + + public void setCardTotal(BigDecimal cardTotal) + { + this.cardTotal=cardTotal; + } + + public BigDecimal getChequeTotal() + { + return chequeTotal; + } + + public void setChequeTotal(BigDecimal chequeTotal) + { + this.chequeTotal=chequeTotal; + } + + public BigDecimal getCardDifference() + { + return cardDifference; + } + public void setCardDifference(BigDecimal cardDifference) + { + this.cardDifference = cardDifference; + } + public BigDecimal getChequeDifference() + { + return chequeDifference; + } + public void setChequeDifference(BigDecimal chequeDifference) + { + this.chequeDifference = chequeDifference; + } + public String toString() + { + StringBuffer buffer = new StringBuffer(); + buffer.append("\n The Begining Balance = "+getBeginingBalance()); + buffer.append("\n The Ending Balance = "+getEndingBalance()); + + return buffer.toString(); + + } + + /** + * @return The description + */ + public String getDescription() + { + return description; + } + + /** + * @param description + * The description to set + */ + public void setDescription(String description) + { + this.description = description; + } + + private int cash_id; + + public int getCash_id() { + return cash_id; + } + + public void setCash_id(int cash_id) { + this.cash_id = cash_id; + } + +} diff --git a/posterita/posterita/src/main/org/posterita/beans/CashLineBean.java b/posterita/posterita/src/main/org/posterita/beans/CashLineBean.java new file mode 100644 index 0000000000..21c41d9ced --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/CashLineBean.java @@ -0,0 +1,130 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +* +* Created on Sep 11, 2006 by ashley +* +*/ + +/** + @author ashley + */ + +package org.posterita.beans; + +import java.math.BigDecimal; +import java.sql.Timestamp; + +public class CashLineBean extends UDIBean +{ + public Integer getCashId() + { + return cashId; + } + + public void setCashId(Integer cashId) + { + this.cashId = cashId; + } + + public BigDecimal getAmount() + { + return amount; + } + + public void setAmount(BigDecimal amount) + { + this.amount = amount; + } + + public Integer getCashLineId() + { + return cashLineId; + } + + public void setCashLineId(Integer cashLineId) + { + this.cashLineId = cashLineId; + } + + public String getCashType() + { + return cashType; + } + + public void setCashType(String cashType) + { + this.cashType = cashType; + } + + public String getCurrency() + { + return currency; + } + + public void setCurrency(String currency) + { + this.currency = currency; + } + + public Timestamp getDateCreated() + { + return dateCreated; + } + + public void setDateCreated(Timestamp dateCreated) + { + this.dateCreated = dateCreated; + } + + public Integer getInvoiceId() + { + return invoiceId; + } + + public void setInvoiceId(Integer invoiceId) + { + this.invoiceId = invoiceId; + } + + public String getCashTypeName() + { + return cashTypeName; + } + + public void setCashTypeName(String cashTypeName) + { + this.cashTypeName = cashTypeName; + } + + /** + * @return The description + */ + public String getDescription() + { + return description; + } + + /** + * @param description The description to set + */ + public void setDescription(String description) + { + this.description = description; + } +} diff --git a/posterita/posterita/src/main/org/posterita/beans/CashSummaryBean.java b/posterita/posterita/src/main/org/posterita/beans/CashSummaryBean.java new file mode 100644 index 0000000000..1384866487 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/CashSummaryBean.java @@ -0,0 +1,148 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +* +* Created on Sep 11, 2006 by ashley +* +*/ + +/** + @author ashley + */ + +package org.posterita.beans; + +import java.math.BigDecimal; + +import org.compiere.util.Env; + +public class CashSummaryBean extends UDIBean +{ + public CashSummaryBean() + { + this.setBankAcctTransferAmount(Env.ZERO); + this.setChargeAmount(Env.ZERO); + this.setDifferenceAmount(Env.ZERO); + this.setGeneralExpenseAmount(Env.ZERO); + this.setGeneralReceiptsAmount(Env.ZERO); + this.setInvoiceAmount(Env.ZERO); + } + + public Integer getCashId() + { + return cashId; + } + + public void setCashId(Integer cashId) + { + this.cashId = cashId; + } + + public BigDecimal getBankAcctTransferAmount() + { + return bankAcctTransferAmount; + } + + public void setBankAcctTransferAmount(BigDecimal bankAcctTransferAmount) + { + this.bankAcctTransferAmount = bankAcctTransferAmount; + } + + public BigDecimal getChargeAmount() + { + return chargeAmount; + } + + public void setChargeAmount(BigDecimal chargeAmount) + { + this.chargeAmount = chargeAmount; + } + + public BigDecimal getDifferenceAmount() + { + return differenceAmount; + } + + public void setDifferenceAmount(BigDecimal differenceAmount) + { + this.differenceAmount = differenceAmount; + } + + public BigDecimal getGeneralExpenseAmount() + { + return generalExpenseAmount; + } + + public void setGeneralExpenseAmount(BigDecimal generalExpenseAmount) + { + this.generalExpenseAmount = generalExpenseAmount; + } + + public BigDecimal getGeneralReceiptsAmount() + { + return generalReceiptsAmount; + } + + public void setGeneralReceiptsAmount(BigDecimal generalReceiptsAmount) + { + this.generalReceiptsAmount = generalReceiptsAmount; + } + + public BigDecimal getInvoiceAmount() + { + return invoiceAmount; + } + + public void setInvoiceAmount(BigDecimal invoiceAmount) + { + this.invoiceAmount = invoiceAmount; + } + + /** + * @return The beginingBalance + */ + public BigDecimal getBeginingBalance() + { + return beginingBalance; + } + + /** + * @param beginingBalance The beginingBalance to set + */ + public void setBeginingBalance(BigDecimal beginingBalance) + { + this.beginingBalance = beginingBalance; + } + + /** + * @return The endingBalance + */ + public BigDecimal getEndingBalance() + { + return endingBalance; + } + + /** + * @param endingBalance The endingBalance to set + */ + public void setEndingBalance(BigDecimal endingBalance) + { + this.endingBalance = endingBalance; + } + +} diff --git a/posterita/posterita/src/main/org/posterita/beans/ChangeDocumentStatusBean.java b/posterita/posterita/src/main/org/posterita/beans/ChangeDocumentStatusBean.java new file mode 100644 index 0000000000..1d049fbf32 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/ChangeDocumentStatusBean.java @@ -0,0 +1,83 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ +package org.posterita.beans; + + +public class ChangeDocumentStatusBean extends DocumentBean +{ + + public String getTrackingNo() + { + return trackingNo; + } + public void setTrackingNo(String trackingNo) + { + this.trackingNo = trackingNo; + } + public Integer getAllocationId() + { + return allocationId; + } + public void setAllocationId(Integer allocationId) + { + this.allocationId = allocationId; + } + public String getPoReference() + { + return poReference; + } + + public void setPoReference(String poReference) + { + this.poReference = poReference; + } + + public void setAgreement(Boolean agreement) + { + this.agreement = agreement; + } + + public Boolean getAgreement() + { + return agreement; + } + + public String getSubmit() + { + return submit; + } + + public void setSubmit(String submit) + { + this.submit = submit; + } + + public Integer getTradeInOrderlineId() + { + return tradeInOrderlineId; + } + + public void setTradeInOrderlineId(Integer tradeInOrderlineId) + { + this.tradeInOrderlineId = tradeInOrderlineId; + } + + +} diff --git a/posterita/posterita/src/main/org/posterita/beans/ChangePasswordBean.java b/posterita/posterita/src/main/org/posterita/beans/ChangePasswordBean.java new file mode 100644 index 0000000000..747ae4b146 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/ChangePasswordBean.java @@ -0,0 +1,64 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Aug 29, 2005 by din + */ + +package org.posterita.beans; + +public class ChangePasswordBean extends UDIBean +{ + + public String getPassword() + { + return password; + } + public void setPassword(String password) + { + this.password = password; + } + + public String getNewPassword() + { + return newPassword; + } + public void setNewPassword(String newPassword) + { + this.newPassword = newPassword; + } + + public String getConfirmPassword() + { + return confirmPassword; + } + + public void setConfirmPassword(String confirmPassword) + { + this.confirmPassword = confirmPassword; + } + + public String getOldPassword() + { + return oldPassword; + } + public void setOldPassword(String oldPassword) + { + this.oldPassword = oldPassword; + } + +} diff --git a/posterita/posterita/src/main/org/posterita/beans/CheckoutBean.java b/posterita/posterita/src/main/org/posterita/beans/CheckoutBean.java new file mode 100644 index 0000000000..4c27dbb4ed --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/CheckoutBean.java @@ -0,0 +1,375 @@ +/** + * + * Copyright (c) 2008 Posterita. All Rights Reserved. + * + * This software is the confidential and proprietary information of + * Posterita. ("Confidential Information"). You shall not + * disclose such Confidential Information and shall use it only in + * accordance with the terms of the license agreement you entered into + * with Posterita. + * + * POSTERITA MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE + * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT + * NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR + * A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. TAMAK ICT SHALL NOT + * BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, + * MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. + * + * Mar 21, 2008 10:31:54 AM by praveen + * + */ + +package org.posterita.beans; + +import java.math.BigDecimal; + +import org.compiere.model.MOrder; +import org.posterita.Constants; +import org.posterita.exceptions.OperationException; +import org.posterita.lib.UdiConstants; + +public class CheckoutBean +{ + private BigDecimal amountTendered; + private BigDecimal amountRefunded; + private String cardType; + private String cardNo; + private String chequeNo; + private BigDecimal cashAmt; + private BigDecimal chequeAmt; + private BigDecimal cardAmt; + private Integer bpartnerId; + private String tenderType; + private String paymentRule; + private BigDecimal discount[]; + private BigDecimal discountedPrice[]; + private Boolean[] isDiscOnInclUnitPrice; + private BigDecimal[] discInclUnitPrice; + private String orderType; + private BigDecimal discountLimit; + private Integer priceListId; + private Integer m_productId; + private Boolean toBeShipped; + private BigDecimal discountedTotal; + private Boolean discountOnTotal; + private Boolean discountOnTotalPercent; + private Boolean overridePriceLimit; + private Boolean isDiscountUptoLimitPrice; + private BigDecimal totalDiscount; + private BigDecimal writeOffAmt; + private BigDecimal discountAmt; + private BigDecimal totalAmount; + private Boolean isOverridePinOk; + private Boolean[] isDiscOnPerc; + private Boolean[] isDiscOnTotal; + private BigDecimal[] qtyPerLine; + private BigDecimal grandTotal; + protected Integer roleId; + + public BigDecimal[] getQtyPerLine() + { + return qtyPerLine; + } + public void setQtyPerLine(BigDecimal[] qtyPerLine) + { + this.qtyPerLine = qtyPerLine; + } + public Boolean[] getIsDiscOnPerc() + { + return isDiscOnPerc; + } + public void setIsDiscOnPerc(Boolean[] isDiscOnPerc) + { + this.isDiscOnPerc = isDiscOnPerc; + } + public Boolean[] getIsDiscOnTotal() + { + return isDiscOnTotal; + } + public void setIsDiscOnTotal(Boolean[] isDiscOnTotal) + { + this.isDiscOnTotal = isDiscOnTotal; + } + public Boolean getIsOverridePinOk() { + return isOverridePinOk; + } + public void setIsOverridePinOk(Boolean isOverridePinOk) { + this.isOverridePinOk = isOverridePinOk; + } + public BigDecimal getAmountTendered() { + return amountTendered; + } + public void setAmountTendered(BigDecimal amountTendered) { + this.amountTendered = amountTendered; + } + public String getCardNo() { + return cardNo; + } + public void setCardNo(String cardNo) { + this.cardNo = cardNo; + } + public String getChequeNo() { + return chequeNo; + } + public void setChequeNo(String chequeNo) { + this.chequeNo = chequeNo; + } + public BigDecimal getCashAmt() { + return cashAmt; + } + public void setCashAmt(BigDecimal cashAmt) { + this.cashAmt = cashAmt; + } + public BigDecimal getChequeAmt() { + return chequeAmt; + } + public void setChequeAmt(BigDecimal chequeAmt) { + this.chequeAmt = chequeAmt; + } + public Integer getBpartnerId() { + return bpartnerId; + } + public void setBpartnerId(Integer bpartnerId) { + this.bpartnerId = bpartnerId; + } + public String getTenderType() { + return tenderType; + } + public void setTenderType(String tenderType) throws OperationException { + this.tenderType = tenderType; + + //set payment rule + if(tenderType == null) return; + + if (Constants.PAYMENT_RULE_CASH.equalsIgnoreCase(tenderType)) + { + paymentRule=MOrder.PAYMENTRULE_Cash; + } + else if(Constants.PAYMENT_RULE_CARD.equalsIgnoreCase(tenderType)) + { + paymentRule=MOrder.PAYMENTRULE_CreditCard; + } + else if(Constants.PAYMENT_RULE_CHEQUE.equalsIgnoreCase(tenderType)) + { + paymentRule=MOrder.PAYMENTRULE_Check; + } + else if(Constants.PAYMENT_RULE_MIXED.equalsIgnoreCase(tenderType)) + { + paymentRule=UdiConstants.PAYMENTRULE_MIXED; + } + else if(Constants.PAYMENT_RULE_CREDIT.equalsIgnoreCase(tenderType)) + { + paymentRule=MOrder.PAYMENTRULE_OnCredit; + } + else + { + throw new OperationException("Invalid Payment Rule :" + tenderType); + } + } + public BigDecimal[] getDiscount() { + return discount; + } + public void setDiscount(BigDecimal[] discount) { + this.discount = discount; + } + public String getOrderType() { + return orderType; + } + public void setOrderType(String orderType) { + this.orderType = orderType; + } + public BigDecimal getDiscountLimit() { + return discountLimit; + } + public void setDiscountLimit(BigDecimal discountLimit) { + this.discountLimit = discountLimit; + } + public BigDecimal getAmountRefunded() { + return amountRefunded; + } + public void setAmountRefunded(BigDecimal amountRefunded) { + this.amountRefunded = amountRefunded; + } + public BigDecimal getCardAmt() { + return cardAmt; + } + public void setCardAmt(BigDecimal cardAmt) { + this.cardAmt = cardAmt; + } + public BigDecimal[] getDiscountedPrice() { + return discountedPrice; + } + public void setDiscountedPrice(BigDecimal[] discountedPrice) { + this.discountedPrice = discountedPrice; + } + public Integer getPriceListId() { + return priceListId; + } + public void setPriceListId(Integer priceListId) { + this.priceListId = priceListId; + } + public Boolean getToBeShipped() { + return toBeShipped; + } + public void setToBeShipped(Boolean toBeShipped) { + this.toBeShipped = toBeShipped; + } + public BigDecimal getDiscountedTotal() { + return discountedTotal; + } + public void setDiscountedTotal(BigDecimal discountedTotal) { + this.discountedTotal = discountedTotal; + } + public Boolean getDiscountOnTotal() { + return discountOnTotal; + } + public void setDiscountOnTotal(Boolean discountOnTotal) { + this.discountOnTotal = discountOnTotal; + } + public Boolean getOverridePriceLimit() { + return overridePriceLimit; + } + public void setOverridePriceLimit(Boolean overridePriceLimit) { + this.overridePriceLimit = overridePriceLimit; + } + public BigDecimal getTotalDiscount() { + return totalDiscount; + } + public void setTotalDiscount(BigDecimal totalDiscount) { + this.totalDiscount = totalDiscount; + } + /** + * @return the cardType + */ + public String getCardType() + { + return cardType; + } + /** + * @param cardType the cardType to set + */ + public void setCardType(String cardType) + { + this.cardType = cardType; + } + /** + * @return the writeOffAmt + */ + public BigDecimal getWriteOffAmt() + { + return writeOffAmt; + } + /** + * @param writeOffAmt the writeOffAmt to set + */ + public void setWriteOffAmt(BigDecimal writeOffAmt) + { + this.writeOffAmt = writeOffAmt; + } + /** + * @return the discountAmt + */ + public BigDecimal getDiscountAmt() + { + return discountAmt; + } + /** + * @param discountAmt the discountAmt to set + */ + public void setDiscountAmt(BigDecimal discountAmt) + { + this.discountAmt = discountAmt; + } + public Boolean[] getIsDiscOnInclUnitPrice() { + return isDiscOnInclUnitPrice; + } + public void setIsDiscOnInclUnitPrice(Boolean[] isDiscOnInclUnitPrice) { + this.isDiscOnInclUnitPrice = isDiscOnInclUnitPrice; + } + public BigDecimal[] getDiscInclUnitPrice() { + return discInclUnitPrice; + } + public void setDiscInclUnitPrice(BigDecimal[] discInclUnitPrice) { + this.discInclUnitPrice = discInclUnitPrice; + } + public Boolean getDiscountOnTotalPercent() { + return discountOnTotalPercent; + } + public void setDiscountOnTotalPercent(Boolean discountOnTotalPercent) { + this.discountOnTotalPercent = discountOnTotalPercent; + } + public String getPaymentRule() { + return paymentRule; + } + public void setPaymentRule(String paymentRule) { + this.paymentRule = paymentRule; + } + + public String getPaymentRuleFromTenderType() + { + if (Constants.PAYMENT_RULE_CASH.equalsIgnoreCase(tenderType)) + { + paymentRule=MOrder.PAYMENTRULE_Cash; + } + else if(Constants.PAYMENT_RULE_CARD.equalsIgnoreCase(tenderType)) + { + paymentRule=MOrder.PAYMENTRULE_CreditCard; + } + else if(Constants.PAYMENT_RULE_CHEQUE.equalsIgnoreCase(tenderType)) + { + paymentRule=MOrder.PAYMENTRULE_Check; + } + else if(Constants.PAYMENT_RULE_MIXED.equalsIgnoreCase(tenderType)) + { + paymentRule=UdiConstants.PAYMENTRULE_MIXED; + } + else if(Constants.PAYMENT_RULE_CREDIT.equalsIgnoreCase(tenderType)) + { + paymentRule=MOrder.PAYMENTRULE_OnCredit; + } + + return paymentRule; + + } + public BigDecimal getTotalAmount() + { + return totalAmount; + } + public void setTotalAmount(BigDecimal totalAmount) + { + this.totalAmount = totalAmount; + } + public Integer getM_productId() + { + return m_productId; + } + public void setM_productId(Integer id) + { + m_productId = id; + } + public Boolean getIsDiscountUptoLimitPrice() + { + return isDiscountUptoLimitPrice; + } + public void setIsDiscountUptoLimitPrice(Boolean isDiscountUptoLimitPrice) + { + this.isDiscountUptoLimitPrice = isDiscountUptoLimitPrice; + } + public BigDecimal getGrandTotal() + { + return grandTotal; + } + public void setGrandTotal(BigDecimal grandTotal) + { + this.grandTotal = grandTotal; + } + public Integer getRoleId() + { + return roleId; + } + public void setRoleId(Integer roleId) + { + this.roleId = roleId; + } + +} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/beans/CloseTillBean.java b/posterita/posterita/src/main/org/posterita/beans/CloseTillBean.java new file mode 100644 index 0000000000..738213682e --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/CloseTillBean.java @@ -0,0 +1,142 @@ +/** + * + * Copyright (c) 2008 Posterita. All Rights Reserved. + * + * This software is the confidential and proprietary information of + * Posterita. ("Confidential Information"). You shall not + * disclose such Confidential Information and shall use it only in + * accordance with the terms of the license agreement you entered into + * with Posterita. + * + * POSTERITA MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE + * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT + * NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR + * A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. TAMAK ICT SHALL NOT + * BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, + * MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. + * + * Aug 4, 2008 3:02:32 AM by praveen + * + */ + +package org.posterita.beans; + +import java.io.Serializable; +import java.math.BigDecimal; + +public class CloseTillBean implements Serializable +{ + private String currency; + private String tillNo; + private String tillName; + private BigDecimal beginningBalance; + private BigDecimal netCashTrx; + private BigDecimal balanceEntered; + private BigDecimal difference; + private BigDecimal endingBalance; + private BigDecimal cashTotal; + private BigDecimal cardTotal; + private BigDecimal chequeTotal; + private BigDecimal grandTotal; + private BigDecimal cardAmtEntered; + private BigDecimal cardDifference; + private BigDecimal chequeAmtEntered; + private BigDecimal chequeDifference; + + public String getTillNo() { + return tillNo; + } + public void setTillNo(String tillNo) { + this.tillNo = tillNo; + } + public String getTillName() { + return tillName; + } + public void setTillName(String tillName) { + this.tillName = tillName; + } + public BigDecimal getBeginningBalance() { + return beginningBalance; + } + public void setBeginningBalance(BigDecimal beginningBalance) { + this.beginningBalance = beginningBalance; + } + public BigDecimal getNetCashTrx() { + return netCashTrx; + } + public void setNetCashTrx(BigDecimal netCashTrx) { + this.netCashTrx = netCashTrx; + } + public BigDecimal getBalanceEntered() { + return balanceEntered; + } + public void setBalanceEntered(BigDecimal balanceEntered) { + this.balanceEntered = balanceEntered; + } + public BigDecimal getDifference() { + return difference; + } + public void setDifference(BigDecimal difference) { + this.difference = difference; + } + public BigDecimal getEndingBalance() { + return endingBalance; + } + public void setEndingBalance(BigDecimal endingBalance) { + this.endingBalance = endingBalance; + } + public BigDecimal getCashTotal() { + return cashTotal; + } + public void setCashTotal(BigDecimal cashTotal) { + this.cashTotal = cashTotal; + } + public BigDecimal getCardTotal() { + return cardTotal; + } + public void setCardTotal(BigDecimal cardTotal) { + this.cardTotal = cardTotal; + } + public BigDecimal getChequeTotal() { + return chequeTotal; + } + public void setChequeTotal(BigDecimal chequeTotal) { + this.chequeTotal = chequeTotal; + } + public BigDecimal getGrandTotal() { + return grandTotal; + } + public void setGrandTotal(BigDecimal grandTotal) { + this.grandTotal = grandTotal; + } + public BigDecimal getCardAmtEntered() { + return cardAmtEntered; + } + public void setCardAmtEntered(BigDecimal cardAmtEntered) { + this.cardAmtEntered = cardAmtEntered; + } + public BigDecimal getCardDifference() { + return cardDifference; + } + public void setCardDifference(BigDecimal cardDifference) { + this.cardDifference = cardDifference; + } + public BigDecimal getChequeAmtEntered() { + return chequeAmtEntered; + } + public void setChequeAmtEntered(BigDecimal chequeAmtEntered) { + this.chequeAmtEntered = chequeAmtEntered; + } + public BigDecimal getChequeDifference() { + return chequeDifference; + } + public void setChequeDifference(BigDecimal chequeDifference) { + this.chequeDifference = chequeDifference; + } + public String getCurrency() { + return currency; + } + public void setCurrency(String currency) { + this.currency = currency; + } +} diff --git a/posterita/posterita/src/main/org/posterita/beans/CommandBean.java b/posterita/posterita/src/main/org/posterita/beans/CommandBean.java new file mode 100644 index 0000000000..c2c6826385 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/CommandBean.java @@ -0,0 +1,53 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 26-Jul-2005 by alok + * + */ +package org.posterita.beans; + + +public class CommandBean extends UDIBean +{ + + private String[] simpleCommand; + private String[] complexCommand; + + + public void setSimpleCommand(String[] simpleCommand) + { + this.simpleCommand = simpleCommand; + } + + public String[] getSimpleCommand() + { + return simpleCommand; + } + + + public void setComplexCommand(String[] complexCommand) + { + this.complexCommand = complexCommand; + } + + public String[] getComplexCommand() + { + return complexCommand; + } + +} diff --git a/posterita/posterita/src/main/org/posterita/beans/CommissionBean.java b/posterita/posterita/src/main/org/posterita/beans/CommissionBean.java new file mode 100644 index 0000000000..b40d206c83 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/CommissionBean.java @@ -0,0 +1,160 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Nov 6, 2006 + */ + + +package org.posterita.beans; + +import java.math.BigDecimal; + + + +public class CommissionBean extends UDIBean +{ + + public BigDecimal getSubtractAmt() { + return subtractAmt; + } + public void setSubtractAmt(BigDecimal subtractAmt) { + this.subtractAmt = subtractAmt; + } + public Integer getInvoiceId() { + return invoiceId; + } + public void setInvoiceId(Integer invoiceId) { + this.invoiceId = invoiceId; + } + public Integer getOrderId() { + return orderId; + } + public void setOrderId(Integer orderId) { + this.orderId = orderId; + } + public String getPeriodAndCurrencyDesc() { + return periodAndCurrencyDesc; + } + public void setPeriodAndCurrencyDesc(String periodAndCurrencyDesc) { + this.periodAndCurrencyDesc = periodAndCurrencyDesc; + } + public BigDecimal getAmtMultiplier() { + return amtMultiplier; + } + public void setAmtMultiplier(BigDecimal amtMultiplier) { + this.amtMultiplier = amtMultiplier; + } + public String getDocBasisType() { + return docBasisType; + } + public void setDocBasisType(String docBasisType) { + this.docBasisType = docBasisType; + } + public String getFrequencyType() { + return frequencyType; + } + public void setFrequencyType(String frequencyType) { + this.frequencyType = frequencyType; + } + public BigDecimal getActualAmt() { + return actualAmt; + } + public void setActualAmt(BigDecimal actualAmt) { + this.actualAmt = actualAmt; + } + public BigDecimal getActualQty() { + return actualQty; + } + public void setActualQty(BigDecimal actualQty) { + this.actualQty = actualQty; + } + public BigDecimal getCommissionAmt() { + return commissionAmt; + } + public void setCommissionAmt(BigDecimal commissionAmt) { + this.commissionAmt = commissionAmt; + } + public Integer getCommissionAmtId() { + return commissionAmtId; + } + public void setCommissionAmtId(Integer commissionAmtId) { + this.commissionAmtId = commissionAmtId; + } + public Integer getCommissionDetailId() { + return commissionDetailId; + } + public void setCommissionDetailId(Integer commissionDetailId) { + this.commissionDetailId = commissionDetailId; + } + public Integer getCommissionLineId() { + return commissionLineId; + } + public void setCommissionLineId(Integer commissionLineId) { + this.commissionLineId = commissionLineId; + } + public String getCommissionLineName() { + return commissionLineName; + } + public void setCommissionLineName(String commissionLineName) { + this.commissionLineName = commissionLineName; + } + public Integer getCommissionRunId() { + return commissionRunId; + } + public void setCommissionRunId(Integer commissionRunId) { + this.commissionRunId = commissionRunId; + } + public BigDecimal getConvertedAmt() { + return convertedAmt; + } + public void setConvertedAmt(BigDecimal convertedAmt) { + this.convertedAmt = convertedAmt; + } + public Integer getCurrencyId() { + return currencyId; + } + public void setCurrencyId(Integer currencyId) { + this.currencyId = currencyId; + } + public String getInfo() { + return info; + } + public void setInfo(String info) { + this.info = info; + } + public Integer getInvoiceLineId() { + return invoiceLineId; + } + public void setInvoiceLineId(Integer invoiceLineId) { + this.invoiceLineId = invoiceLineId; + } + public Integer getOrderLineId() { + return orderLineId; + } + public void setOrderLineId(Integer orderLineId) { + this.orderLineId = orderLineId; + } + public String getReference() { + return reference; + } + public void setReference(String reference) { + this.reference = reference; + } + + +} diff --git a/posterita/posterita/src/main/org/posterita/beans/CreditCardBean.java b/posterita/posterita/src/main/org/posterita/beans/CreditCardBean.java new file mode 100644 index 0000000000..7a4a2fe9a3 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/CreditCardBean.java @@ -0,0 +1,108 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + **/ +package org.posterita.beans; + +public class CreditCardBean extends UDIBean +{ + + + public String getPaymentMethod() + { + return paymentMethod; + } + public void setPaymentMethod(String paymentMethod) + { + this.paymentMethod = paymentMethod; + } + public String getCreditCardNumberEncrypted() + { + return creditCardNumberEncrypted; + } + public void setCreditCardNumberEncrypted(String creditCardNumberEncrypted) + { + this.creditCardNumberEncrypted = creditCardNumberEncrypted; + } + public String getCreditCardExpMonthName() + { + return creditCardExpMonthName; + } + public void setCreditCardExpMonthName(String creditCardExpMonthName) + { + this.creditCardExpMonthName = creditCardExpMonthName; + } + public String getAccountName() + { + return accountName; + } + public void setAccountName(String accountName) + { + this.accountName = accountName; + } + public String getCreditCardNumber() + { + return creditCardNumber; + } + + public void setCreditCardNumber(String creditCardNumber) + { + this.creditCardNumber = creditCardNumber; + } + + public String getCvv() + { + return cvv; + } + + public void setCvv(String cvv) + { + this.cvv = cvv; + } + + public Integer getCreditCardExpMonth() + { + return creditCardExpMonth; + } + + public void setCreditCardExpMonth(Integer creditCardExpMonth) + { + this.creditCardExpMonth = creditCardExpMonth; + } + + public Integer getCreditCardExpYear() + { + return creditCardExpYear; + } + + public void setCreditCardExpYear(Integer creditCardExpYear) + { + this.creditCardExpYear = creditCardExpYear; + } + public String getCreditCardType() + { + return creditCardType; + } + public void setCreditCardType(String creditCardType) + { + this.creditCardType = creditCardType; + } + + +} diff --git a/posterita/posterita/src/main/org/posterita/beans/CreditCheckBean.java b/posterita/posterita/src/main/org/posterita/beans/CreditCheckBean.java new file mode 100644 index 0000000000..5ae045eaf2 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/CreditCheckBean.java @@ -0,0 +1,53 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Nov 1, 2006 + */ + + +package org.posterita.beans; + + + + +public class CreditCheckBean +{ + protected String msg; + protected Boolean valid; + + public String getMsg() { + return msg; + } + public void setMsg(String msg) { + this.msg = msg; + } + public Boolean getValid() { + return valid; + } + public void setValid(Boolean valid) { + this.valid = valid; + } + + + + + + + + +} diff --git a/posterita/posterita/src/main/org/posterita/beans/CreditPaymentDetailsBean.java b/posterita/posterita/src/main/org/posterita/beans/CreditPaymentDetailsBean.java new file mode 100644 index 0000000000..d48ead320c --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/CreditPaymentDetailsBean.java @@ -0,0 +1,160 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Oct 25, 2006 + */ + + +package org.posterita.beans; + +import java.math.BigDecimal; +import java.sql.Timestamp; + + +public class CreditPaymentDetailsBean extends UDIBean +{ + + + public Integer getCurrencyId() { + return currencyId; + } + public void setCurrencyId(Integer currencyId) { + this.currencyId = currencyId; + } + public String getCashBookName() { + return cashBookName; + } + public void setCashBookName(String cashBookName) { + this.cashBookName = cashBookName; + } + public Integer getCashId() { + return cashId; + } + public void setCashId(Integer cashId) { + this.cashId = cashId; + } + public Integer getCashLineId() { + return cashLineId; + } + public void setCashLineId(Integer cashLineId) { + this.cashLineId = cashLineId; + } + public String getCashType() { + return cashType; + } + public void setCashType(String cashType) { + this.cashType = cashType; + } + public String getCashTypeName() { + return cashTypeName; + } + public void setCashTypeName(String cashTypeName) { + this.cashTypeName = cashTypeName; + } + public String getChequeNo() { + return chequeNo; + } + public void setChequeNo(String chequeNo) { + this.chequeNo = chequeNo; + } + public String getCreditCardNumber() { + return creditCardNumber; + } + public void setCreditCardNumber(String creditCardNumber) { + this.creditCardNumber = creditCardNumber; + } + public Timestamp getDateCreated() { + return dateCreated; + } + public void setDateCreated(Timestamp dateCreated) { + this.dateCreated = dateCreated; + } + public String getDescription() { + return description; + } + public void setDescription(String description) { + this.description = description; + } + public BigDecimal getDiscountAmt() { + return discountAmt; + } + public void setDiscountAmt(BigDecimal discountAmt) { + this.discountAmt = discountAmt; + } + public String getDocumentNo() { + return documentNo; + } + public void setDocumentNo(String documentNo) { + this.documentNo = documentNo; + } + public BigDecimal getInvoiceGrandTotal() { + return invoiceGrandTotal; + } + public void setInvoiceGrandTotal(BigDecimal invoiceGrandTotal) { + this.invoiceGrandTotal = invoiceGrandTotal; + } + public Integer getInvoiceId() { + return invoiceId; + } + public void setInvoiceId(Integer invoiceId) { + this.invoiceId = invoiceId; + } + public BigDecimal getPaidAmt() { + return paidAmt; + } + public void setPaidAmt(BigDecimal paidAmt) { + this.paidAmt = paidAmt; + } + public Integer getPaymentId() { + return paymentId; + } + public void setPaymentId(Integer paymentId) { + this.paymentId = paymentId; + } + public String getTenderType() { + return tenderType; + } + public void setTenderType(String tenderType) { + this.tenderType = tenderType; + } + public Integer getUserID() { + return userID; + } + public void setUserID(Integer userID) { + this.userID = userID; + } + public String getUsername() { + return username; + } + public void setUsername(String username) { + this.username = username; + } + public BigDecimal getWriteOffAmt() { + return writeOffAmt; + } + public void setWriteOffAmt(BigDecimal writeOffAmt) { + this.writeOffAmt = writeOffAmt; + } + + + + + + + +} diff --git a/posterita/posterita/src/main/org/posterita/beans/CurrencyBean.java b/posterita/posterita/src/main/org/posterita/beans/CurrencyBean.java new file mode 100644 index 0000000000..c12ab4aa36 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/CurrencyBean.java @@ -0,0 +1,66 @@ +package org.posterita.beans; + +import java.math.BigDecimal; + +public class CurrencyBean extends UDIBean +{ + private Integer currencyId; + private BigDecimal roundOffFactor; + private Integer stdPrecision; + private String isoCode; + private String curSymbol; + private String description; + private boolean isActive; + + + public String getDescription() + { + return description; + } + public void setDescription(String description) + { + this.description = description; + } + public String getIsoCode() + { + return isoCode; + } + public void setIsoCode(String isoCode) + { + this.isoCode = isoCode; + } + public Integer getStdPrecision() + { + return stdPrecision; + } + public void setStdPrecision(Integer stdPrecision) + { + this.stdPrecision = stdPrecision; + } + public Integer getCurrencyId() + { + return currencyId; + } + public void setCurrencyId(Integer currencyId) + { + this.currencyId = currencyId; + } + + public BigDecimal getRoundOffFactor() + { + return roundOffFactor; + } + + public void setRoundOffFactor(BigDecimal roundOffFactor) + { + this.roundOffFactor = roundOffFactor; + } + public String getCurSymbol() + { + return curSymbol; + } + public void setCurSymbol(String curSymbol) + { + this.curSymbol = curSymbol; + } +} diff --git a/posterita/posterita/src/main/org/posterita/beans/CurrentTillAmountBean.java b/posterita/posterita/src/main/org/posterita/beans/CurrentTillAmountBean.java new file mode 100644 index 0000000000..46c8fe3087 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/CurrentTillAmountBean.java @@ -0,0 +1,88 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Created on May 5, 2006 + */ + + +package org.posterita.beans; + +import java.math.BigDecimal; + + +public class CurrentTillAmountBean extends UDIBean +{ + + + + public BigDecimal getBeginingBalance() { + return beginingBalance; + } + public void setBeginingBalance(BigDecimal beginingBalance) { + this.beginingBalance = beginingBalance; + } + public BigDecimal getStatementDifference() { + return statementDifference; + } + public void setStatementDifference(BigDecimal statementDifference) { + this.statementDifference = statementDifference; + } + public BigDecimal getTillGrandTotal() + { + return tillGrandTotal; + } + public void setTillGrandTotal(BigDecimal tillGrandTotal) + { + this.tillGrandTotal = tillGrandTotal; + } + public BigDecimal getCashTotal() + { + return cashTotal; + } + + public void setCashTotal(BigDecimal cashTotal) + { + this.cashTotal = cashTotal; + } + + public BigDecimal getCardTotal() + { + return cardTotal; + } + public void setCardTotal(BigDecimal cardTotal) + { + this.cardTotal = cardTotal; + } + public BigDecimal getChequeTotal() + { + return chequeTotal; + } + public void setChequeTotal(BigDecimal chequeTotal) + { + this.chequeTotal = chequeTotal; + } + + + public String getPosName() { + return posName; + } + public void setPosName(String posName) { + this.posName = posName; + } +} diff --git a/posterita/posterita/src/main/org/posterita/beans/CustomerBean.java b/posterita/posterita/src/main/org/posterita/beans/CustomerBean.java new file mode 100644 index 0000000000..0e5f885f61 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/CustomerBean.java @@ -0,0 +1,584 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Created on 02-Sep-2005 + */ + + +package org.posterita.beans; + +import java.math.BigDecimal; + +public class CustomerBean extends DocumentBean +{ + public Boolean isEditable; + + + + public Boolean getIsEditable() { + return isEditable; + } + + public void setIsEditable(Boolean isEditable) { + this.isEditable = isEditable; + } + + public Integer getOrgId() + { + return orgId; + } + + public void setOrgId(Integer orgId) + { + this.orgId = orgId; + } + + public String getPaymentTermName() { + return paymentTermName; + } + public void setPaymentTermName(String paymentTermName) { + this.paymentTermName = paymentTermName; + } + public Integer getPaymentTermId() { + return paymentTermId; + } + public void setPaymentTermId(Integer paymentTermId) { + this.paymentTermId = paymentTermId; + } + public String getCreditStatus() { + return creditStatus; + } + public void setCreditStatus(String creditStatus) { + this.creditStatus = creditStatus; + } + public BigDecimal getCreditLimit() { + return creditLimit; + } + public void setCreditLimit(BigDecimal creditLimit) { + this.creditLimit = creditLimit; + } + public Integer getDunningId() { + return dunningId; + } + public void setDunningId(Integer dunningId) { + this.dunningId = dunningId; + } + public Boolean getCreatingFromOrder() { + return creatingFromOrder; + } + public void setCreatingFromOrder(Boolean creatingFromOrder) { + this.creatingFromOrder = creatingFromOrder; + } + public Integer getAttributeSetInstanceId() + { + return attributeSetInstanceId; + } + public void setAttributeSetInstanceId(Integer attributeSetInstanceId) + { + this.attributeSetInstanceId = attributeSetInstanceId; + } + public Integer getProductId() + { + return productId; + } + public void setProductId(Integer productId) + { + this.productId = productId; + } + public Integer getLicensingDistrictId() { + return licensingDistrictId; + } + public void setLicensingDistrictId(Integer licensingDistrictId) { + this.licensingDistrictId = licensingDistrictId; + } + public String getSurname() { + return surname; + } + public void setSurname(String surname) { + this.surname = surname; + } + public String getAaCardnumber() { + return aaCardnumber; + } + public String getAddress1() { + return address1; + } + public String getAddress2() { + return address2; + } + public String getCity() { + return city; + } + + public String getCustIdNumber() { + return custIdNumber; + } + + public String getMaintenanceContractNumber() { + return maintenanceContractNumber; + } + public String getMobile() { + return mobile; + } + public String getPartnerName() { + return partnerName; + } + + public String getPhone2() { + return phone2; + } + public String getPhone() { + return phone; + } + public String getPostalAddress1() { + return postalAddress1; + } + public String getPostalCity() { + return postalCity; + } + public String getPostalCode() { + return postalCode; + } + public String getPostalPostalCode() { + return postalPostalCode; + } + + + public Integer getRegionId() { + return regionId; + } + + public void setAaCardnumber(String aaCardnumber) { + this.aaCardnumber = aaCardnumber; + } + public void setAddress1(String address1) { + this.address1 = address1; + } + public void setAddress2(String address2) { + this.address2 = address2; + } + public void setCity(String city) { + this.city = city; + } + public void setCustIdNumber(String custIdNumber) { + this.custIdNumber = custIdNumber; + } + public void setMaintenanceContractNumber(String maintenanceContractNumber) { + this.maintenanceContractNumber = maintenanceContractNumber; + } + public void setMobile(String mobile) { + this.mobile = mobile; + } + public void setPartnerName(String partnerName) { + this.partnerName = partnerName; + } + public void setPhone2(String phone2) { + this.phone2 = phone2; + } + public void setPhone(String phone) { + this.phone = phone; + } + public void setPostalAddress1(String postalAddress1) { + this.postalAddress1 = postalAddress1; + } + public void setPostalCity(String postalCity) { + this.postalCity = postalCity; + } + public void setPostalCode(String postalCode) { + this.postalCode = postalCode; + } + public void setPostalPostalCode(String postalPostalCode) { + this.postalPostalCode = postalPostalCode; + } + public void setRegionId(Integer regionId) { + this.regionId = regionId; + } + + public Integer getBpartnerId() + { + return bpartnerId; + } + + public void setBpartnerId(Integer bpartnerId) + { + this.bpartnerId = bpartnerId; + } + + public String getLicensingDistrict() + { + return licensingDistrict; + } + + public void setLicensingDistrict(String licensingDistrict) + { + this.licensingDistrict = licensingDistrict; + } + + public String getRegion() + { + return region; + } + + public void setRegion(String region) + { + this.region = region; + } + + public String getCompanyRegNo() + { + return companyRegNo; + } + + public void setCompanyRegNo(String companyRegNo) + { + this.companyRegNo = companyRegNo; + } + + public String getPassportNo() + { + return passportNo; + } + + public void setPassportNo(String passportNo) + { + this.passportNo = passportNo; + } + + public String getEmail() + { + return email; + } + + public void setEmail(String email) + { + this.email = email; + } + + public Integer getSalesRepId() + { + return salesRepId; + } + + public void setSalesRepId(Integer salesRepId) + { + this.salesRepId = salesRepId; + } + + public String getMakeName() + { + return makeName; + } + + public void setMakeName(String makeName) + { + this.makeName = makeName; + } + + public String getModelName() + { + return modelName; + } + + public void setModelName(String modelName) + { + this.modelName = modelName; + } + + public String getYearName() + { + return yearName; + } + + public void setYearName(String yearName) + { + this.yearName = yearName; + } + + public Integer getCreditCardExpMonth() + { + return creditCardExpMonth; + } + + public void setCreditCardExpMonth(Integer creditCardExpMonth) + { + this.creditCardExpMonth = creditCardExpMonth; + } + + public Integer getCreditCardExpYear() + { + return creditCardExpYear; + } + + public void setCreditCardExpYear(Integer creditCardExpYear) + { + this.creditCardExpYear = creditCardExpYear; + } + + public String getCreditCardNumber() + { + return creditCardNumber; + } + + public void setCreditCardNumber(String creditCardNumber) + { + this.creditCardNumber = creditCardNumber; + } + + public String getPassword() + { + return password; + } + + public void setPassword(String password) + { + this.password = password; + } + + public String getConfirmPassword() + { + return confirmPassword; + } + + public void setConfirmPassword(String confirmPassword) + { + this.confirmPassword = confirmPassword; + } + + public String getCountryName() + { + return countryName; + } + + public void setCountryName(String countryName) + { + this.countryName = countryName; + } + + public String getPostalAddress() + { + return postalAddress; + } + + public void setPostalAddress(String postalAddress) + { + this.postalAddress = postalAddress; + } + + public String getUsername() + { + return username; + } + public void setUsername(String username) + { + this.username = username; + } + + public String getUserSurname() + { + return userSurname; + } + + public void setUserSurname(String userSurname) + { + this.userSurname = userSurname; + } + + public String getFax() + { + return fax; + } + + public void setFax(String fax) + { + this.fax = fax; + } + + public Integer getCountryId() + { + return countryId; + } + + public void setCountryId(Integer countryId) + { + this.countryId = countryId; + } + +/* public Integer getCvv() + { + return cvv; + } + + public void setCvv(Integer cvv) + { + this.cvv = cvv; + } +*/ + public String getCreditCardPayment() + { + return creditCardPayment; + } + + public void setCreditCardPayment(String creditCardPayment) + { + this.creditCardPayment = creditCardPayment; + } + + public String getShipmentMethod() + { + return shipmentMethod; + } + + public void setShipmentMethod(String shipmentMethod) + { + this.shipmentMethod = shipmentMethod; + } + + public String getBirthdate() + { + return birthdate; + } + public void setBirthdate(String birthdate) + { + this.birthdate = birthdate; + } + public String getStartDay() { + return startDay; + } + public void setStartDay(String startDay) { + this.startDay = startDay; + } + public String getStartMonth() { + return startMonth; + } + public void setStartMonth(String startMonth) { + this.startMonth = startMonth; + } + public String getStartYear() { + return startYear; + } + public void setStartYear(String startYear) { + this.startYear = startYear; + } + public Integer getUserId() { + return userId; + } + public void setUserId(Integer userId) { + this.userId = userId; + } + public Integer getPriceListId() + { + return priceListId; + } + + public void setPriceListId(Integer priceListId) + { + this.priceListId = priceListId; + } + + //---------------------------------------------- + private BigDecimal totalOpenBalance; + private BigDecimal creditLimit; + private BigDecimal creditUsed; + private BigDecimal creditAvailable; + + public BigDecimal getTotalOpenBalance() { + return totalOpenBalance; + } + + public void setTotalOpenBalance(BigDecimal totalOpenBalance) { + this.totalOpenBalance = totalOpenBalance; + } + + public BigDecimal getCreditUsed() { + return creditUsed; + } + + public void setCreditUsed(BigDecimal creditUsed) { + this.creditUsed = creditUsed; + } + + public BigDecimal getCreditAvailable() { + return creditAvailable; + } + + public void setCreditAvailable(BigDecimal creditAvailable) { + this.creditAvailable = creditAvailable; + } + + public String getBankName() + { + return bankName; + } + + public void setBankName(String bankName) + { + this.bankName = bankName; + } + + public String getAccountNo() + { + return accountNo; + } + + public void setAccountNo(String accountNo) + { + this.accountNo = accountNo; + } + + public String getBranch() + { + return branch; + } + + public void setBranch(String branch) + { + this.branch = branch; + } + + public String getPriceListName() + { + return priceListName; + } + + public void setPriceListName(String priceListName) + { + this.priceListName = priceListName; + } + + public String getSaleRepName() + { + return saleRepName; + } + + public void setSaleRepName(String saleRepName) + { + this.saleRepName = saleRepName; + } + + public String getTaxNo() + { + return taxNo; + } + + public void setTaxNo(String taxNo) + { + this.taxNo = taxNo; + } + +} diff --git a/posterita/posterita/src/main/org/posterita/beans/DateFilterBean.java b/posterita/posterita/src/main/org/posterita/beans/DateFilterBean.java new file mode 100644 index 0000000000..94ab651d80 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/DateFilterBean.java @@ -0,0 +1,151 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +* +* Created on Sep 11, 2006 by ashley +* +*/ + +/** + @author ashley + */ + +package org.posterita.beans; + +public class DateFilterBean extends UDIBean +{ + public String getFromDate() + { + return fromDate; + } + + public void setFromDate(String fromDate) + { + this.fromDate = fromDate; + } + + public String getToDate() + { + return toDate; + } + + public void setToDate(String toDate) + { + this.toDate = toDate; + } + + public String getStartDay() + { + return startDay; + } + + public void setStartDay(String startDay) + { + this.startDay = startDay; + } + + public String getStartMonth() + { + return startMonth; + } + + public void setStartMonth(String startMonth) + { + this.startMonth = startMonth; + } + + public String getStartYear() + { + return startYear; + } + + public void setStartYear(String startYear) + { + this.startYear = startYear; + } + + public String getEndDay() + { + return endDay; + } + + public void setEndDay(String endDay) + { + this.endDay = endDay; + } + + public String getEndMonth() + { + return endMonth; + } + + public void setEndMonth(String endMonth) + { + this.endMonth = endMonth; + } + + public String getEndYear() + { + return endYear; + } + + public void setEndYear(String endYear) + { + this.endYear = endYear; + } + + public String getStartHour() + { + return startHour; + } + + public void setStartHour(String startHour) + { + this.startHour = startHour; + } + + public String getStartMinute() + { + return startMinute; + } + + public void setStartMinute(String startMinute) + { + this.startMinute = startMinute; + } + + public String getEndHour() + { + return endHour; + } + + public void setEndHour(String endHour) + { + this.endHour = endHour; + } + + public String getEndMinute() + { + return endMinute; + } + + public void setEndMinute(String endMinute) + { + this.endMinute = endMinute; + } +} diff --git a/posterita/posterita/src/main/org/posterita/beans/DisplayMessageLogBean.java b/posterita/posterita/src/main/org/posterita/beans/DisplayMessageLogBean.java new file mode 100644 index 0000000000..ce4c6afc89 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/DisplayMessageLogBean.java @@ -0,0 +1,115 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ +package org.posterita.beans; + +import java.sql.Timestamp; + + +public class DisplayMessageLogBean +{ + private String input; + private String output; + private String status; + private String type; + private String documentType; + private Timestamp date; + private Integer documentId; + private String reasonDescription; + + public Timestamp getDate() + { + return date; + } + + public void setDate(Timestamp date) + { + this.date = date; + } + + public String getDocumentType() + { + return documentType; + } + + public void setDocumentType(String documentType) + { + this.documentType = documentType; + } + + public String getInput() + { + return input; + } + + public void setInput(String input) + { + this.input = input; + } + + public String getOutput() + { + return output; + } + + public void setOutput(String output) + { + this.output = output; + } + + public String getStatus() + { + return status; + } + + public void setStatus(String status) + { + this.status = status; + } + + public String getType() + { + return type; + } + + public void setType(String type) + { + this.type = type; + } + + public Integer getDocumentId() + { + return documentId; + } + + public void setDocumentId(Integer documentId) + { + this.documentId = documentId; + } + + public String getReasonDescription() + { + return reasonDescription; + } + + public void setReasonDescription(String reasonDescription) + { + this.reasonDescription = reasonDescription; + } +} diff --git a/posterita/posterita/src/main/org/posterita/beans/DocumentBean.java b/posterita/posterita/src/main/org/posterita/beans/DocumentBean.java new file mode 100644 index 0000000000..ff146ccc8c --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/DocumentBean.java @@ -0,0 +1,84 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ +package org.posterita.beans; + + + +public class DocumentBean extends UDIBean +{ + public Integer getDocumentId() + { + return documentId; + } + + public void setDocumentId(Integer documentId) + { + this.documentId = documentId; + } + + + public String getDocumentType() + { + return documentType; + } + + public void setDocumentType(String documentType) + { + this.documentType = documentType; + } + + public Integer[] getCheckBox() + { + return checkBox; + } + + public void setCheckBox(Integer[] checkBox) + { + this.checkBox = checkBox; + } + + public Integer getBpartnerId() + { + return bpartnerId; + } + + public void setBpartnerId(Integer bpartnerId) + { + this.bpartnerId = bpartnerId; + } + + public String getSubmit() + { + return submit; + } + + public void setSubmit(String submit) + { + this.submit = submit; + } + + public String getOrderType() { + return orderType; + } + + public void setOrderType(String orderType) { + this.orderType = orderType; + } +} diff --git a/posterita/posterita/src/main/org/posterita/beans/DocumentHistortFilterBean.java b/posterita/posterita/src/main/org/posterita/beans/DocumentHistortFilterBean.java new file mode 100644 index 0000000000..b870d5e162 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/DocumentHistortFilterBean.java @@ -0,0 +1,80 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + */ +package org.posterita.beans; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.TreeSet; + + + +/** + * @author alok + */ + +public class DocumentHistortFilterBean +{ + + private TreeSet bPartnerList = new TreeSet(); + private TreeSet docStatusList = new TreeSet(); + + public DocumentHistortFilterBean(ArrayList beans) + { + + if(beans!=null) + { + Iterator iter = beans.iterator(); + + while(iter.hasNext()) + { + DocumentHistoryBean bean = (DocumentHistoryBean) iter.next(); + + if(bean.getBpartnerId()!=null) + { + UDIPair pair = new UDIPair(bean.getBpartnerId(),bean.getPartnerName()); + bPartnerList.add(pair); + } + + if(bean.getDocStatus()!= null) + { + UDIPair docStatusPair = new UDIPair(bean.getDocStatusCode(), bean.getDocStatus()); + docStatusList.add(docStatusPair); + } + } + } + + } + + + public TreeSet getBPartnerList() + { + return bPartnerList; + } + + public TreeSet getDocStatusList() + { + return docStatusList; + } + + + + +} diff --git a/posterita/posterita/src/main/org/posterita/beans/DocumentHistoryBean.java b/posterita/posterita/src/main/org/posterita/beans/DocumentHistoryBean.java new file mode 100644 index 0000000000..84af7801b2 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/DocumentHistoryBean.java @@ -0,0 +1,248 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + **/ +package org.posterita.beans; + +import java.sql.Timestamp; +import java.util.ArrayList; + +import org.posterita.beans.UDIBean; + +public class DocumentHistoryBean extends UDIBean +{ +/* + protected Integer orderId; + protected Integer paymentId; + protected Integer invoiceId; + protected Integer minOutId; + protected String docStatus; //Shipment DocStatus + protected Integer month; + protected Integer year; + protected Integer bpartnerId; + protected String partnerName; + protected Timestamp dateOrdered; + protected String docStatusCode; +*/ + protected String paymentStatus; + protected String shipmentStatus; + + protected String invoiceNo; + protected String paymentNo; + protected String shipmentNo; + protected ArrayList documentHistoryList; + + + + + + + + + public ArrayList getDocumentHistoryList() { + return documentHistoryList; + } + + public void setDocumentHistoryList(ArrayList documentHistoryList) { + this.documentHistoryList = documentHistoryList; + } + + public Integer getCashLineId() { + return cashLineId; + } + + public void setCashLineId(Integer cashLineId) { + this.cashLineId = cashLineId; + } + + public String getDocumentNo() + { + return documentNo; + } + + public void setDocumentNo(String documentNo) + { + this.documentNo=documentNo; + } + public String getOrderType() + { + return orderType; + } + + public void setOrderType(String orderType) + { + this.orderType=orderType; + } + + + public String getDocStatus() + { + return docStatus; + } + public void setDocStatus(String docStatus) + { + this.docStatus = docStatus; + } + public Integer getInvoiceId() + { + return invoiceId; + } + public void setInvoiceId(Integer invoiceId) + { + this.invoiceId = invoiceId; + } + public Integer getMinOutId() + { + return minOutId; + } + public void setMinOutId(Integer minOutId) + { + this.minOutId = minOutId; + } + public Integer getMonth() + { + return month; + } + public void setMonth(Integer month) + { + this.month = month; + } + public Integer getOrderId() + { + return orderId; + } + public void setOrderId(Integer orderId) + { + this.orderId = orderId; + } + public Integer getPaymentId() + { + return paymentId; + } + public void setPaymentId(Integer paymentId) + { + this.paymentId = paymentId; + } + public Integer getYear() + { + return year; + } + public void setYear(Integer year) + { + this.year = year; + } + public Integer getBpartnerId() + { + return bpartnerId; + } + public void setBpartnerId(Integer bpartnerId) + { + this.bpartnerId = bpartnerId; + } + public String getPartnerName() + { + return partnerName; + } + public void setPartnerName(String partnerName) + { + this.partnerName = partnerName; + } + public Timestamp getDateOrdered() + { + return dateOrdered; + } + public void setDateOrdered(Timestamp dateOrdered) + { + this.dateOrdered = dateOrdered; + } + public String getDocStatusCode() + { + return docStatusCode; + } + public void setDocStatusCode(String docStatusCode) + { + this.docStatusCode = docStatusCode; + } + public String getPaymentStatus() + { + return paymentStatus; + } + public void setPaymentStatus(String paymentStatus) + { + this.paymentStatus = paymentStatus; + } + public String getShipmentStatus() + { + return shipmentStatus; + } + public void setShipmentStatus(String shipmentStatus) + { + this.shipmentStatus = shipmentStatus; + } + + public String getInvoiceNo() + { + return invoiceNo; + } + + public void setInvoiceNo(String invoiceNo) + { + this.invoiceNo = invoiceNo; + } + + public String getPaymentNo() + { + return paymentNo; + } + + public void setPaymentNo(String paymentNo) + { + this.paymentNo = paymentNo; + } + + public String getShipmentNo() + { + return shipmentNo; + } + + public void setShipmentNo(String shipmentNo) + { + this.shipmentNo = shipmentNo; + } + + public Boolean getIsCustomer() { + return isCustomer; + } + + public void setIsCustomer(Boolean isCustomer) { + this.isCustomer = isCustomer; + } + + public Boolean getIsVendor() { + return isVendor; + } + + public void setIsVendor(Boolean isVendor) { + this.isVendor = isVendor; + } + + + + +} diff --git a/posterita/posterita/src/main/org/posterita/beans/DunningBean.java b/posterita/posterita/src/main/org/posterita/beans/DunningBean.java new file mode 100644 index 0000000000..c3f0660196 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/DunningBean.java @@ -0,0 +1,105 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Oct 27, 2006 + */ + + +package org.posterita.beans; + + +public class DunningBean extends UDIBean +{ + + + + + public String getDescription() { + return description; + } + public void setDescription(String description) { + this.description = description; + } + public Integer getDunningId() { + return dunningId; + } + public void setDunningId(Integer dunningId) { + this.dunningId = dunningId; + } + public String getDunningLevelName() { + return dunningLevelName; + } + public void setDunningLevelName(String dunningLevelName) { + this.dunningLevelName = dunningLevelName; + } + public String getDunningName() { + return dunningName; + } + public void setDunningName(String dunningName) { + this.dunningName = dunningName; + } + public Integer getDunningLevelId() { + return dunningLevelId; + } + public void setDunningLevelId(Integer dunningLevelId) { + this.dunningLevelId = dunningLevelId; + } + public String getDunningPrintNote() { + return dunningPrintNote; + } + public void setDunningPrintNote(String dunningPrintNote) { + this.dunningPrintNote = dunningPrintNote; + } + public String getDunningPrintText() { + return dunningPrintText; + } + public void setDunningPrintText(String dunningPrintText) { + this.dunningPrintText = dunningPrintText; + } + public Integer getBP_Group_ID() { + return BP_Group_ID; + } + public void setBP_Group_ID(Integer group_ID) { + BP_Group_ID = group_ID; + } + public Integer getBpartnerId() { + return bpartnerId; + } + public void setBpartnerId(Integer bpartnerId) { + this.bpartnerId = bpartnerId; + } + public Integer getCurrencyId() { + return currencyId; + } + public void setCurrencyId(Integer currencyId) { + this.currencyId = currencyId; + } + + + + + public Integer[] getBpartnerIds() { + return bpartnerIds; + } + public void setBpartnerIds(Integer[] bpartnerIds) { + this.bpartnerIds = bpartnerIds; + } + + + +} diff --git a/posterita/posterita/src/main/org/posterita/beans/EditPriceBean.java b/posterita/posterita/src/main/org/posterita/beans/EditPriceBean.java new file mode 100644 index 0000000000..5d76d0d0db --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/EditPriceBean.java @@ -0,0 +1,62 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Oct 20, 2005 by praveen + * + */ +package org.posterita.beans; + +import java.math.BigDecimal; + + +public class EditPriceBean extends UDIBean +{ + public BigDecimal getPrice() + { + return price; + } + + public void setPrice(BigDecimal price) + { + this.price = price; + } + + public Integer getPriceListVersionId() + { + return priceListVersionId; + } + + public void setPriceListVersionId(Integer priceListVersionId) + { + this.priceListVersionId = priceListVersionId; + } + + public Integer getProductId() + { + return productId; + } + + public void setProductId(Integer productId) + { + this.productId = productId; + } + + + + +} diff --git a/posterita/posterita/src/main/org/posterita/beans/FilterBean.java b/posterita/posterita/src/main/org/posterita/beans/FilterBean.java new file mode 100644 index 0000000000..e9bab97232 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/FilterBean.java @@ -0,0 +1,137 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Aug 19, 2005 by praveen + * + */ +package org.posterita.beans; + +import java.util.ArrayList; + +public class FilterBean extends UDIBean +{ + private ArrayList bpList; + private ArrayList docStatusList; + public Integer getRefToQuote() + { + return refToQuote; + } + public void setRefToQuote(Integer refToQuote) + { + this.refToQuote = refToQuote; + } + + public String getOrderType() + { + return orderType; + } + public void setOrderType(String orderType) + { + this.orderType = orderType; + } + + public String getDocStatus() + { + return docStatus; + } + + public String getDocStatusCode() + { + return docStatusCode; + } + + public String getDocumentNo() + { + return documentNo; + } + + public Integer getMonth() + { + return month; + } + + + public Integer getPartnerId() + { + return this.partnerId; + } + + public String getPartnerName() + { + return partnerName; + } + + public Integer getYear() + { + return year; + } + public void setDocStatus(String docStatus) + { + this.docStatus = docStatus; + } + + public void setDocStatusCode(String docStatusCode) + { + this.docStatusCode = docStatusCode; + } + + public void setDocumentNo(String documentNo) + { + this.documentNo = documentNo; + } + + public void setMonth(Integer month) + { + this.month = month; + } + + public void setPartnerId(Integer partnerId) + { + this.partnerId = partnerId; + } + public void setPartnerName(String partnerName) + { + this.partnerName = partnerName; + } + + public void setYear(Integer year) + { + this.year = year; + } + + public ArrayList getBpList() + { + return bpList; + } + + public void setBpList(ArrayList bpList) + { + this.bpList = bpList; + } + + public ArrayList getDocStatusList() + { + return docStatusList; + } + + public void setDocStatusList(ArrayList docStatusList) + { + this.docStatusList = docStatusList; + } + +} diff --git a/posterita/posterita/src/main/org/posterita/beans/GenericProductBean.java b/posterita/posterita/src/main/org/posterita/beans/GenericProductBean.java new file mode 100644 index 0000000000..af28427bb5 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/GenericProductBean.java @@ -0,0 +1,167 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +package org.posterita.beans; + + +public class GenericProductBean +{ + private String name; + private Integer qtyOnHand; + private Integer productId; + private String description; + private ProductImageInfo imageInfo; + private Boolean isSmall; + private Boolean isMedium; + private Boolean isLarge; + private Boolean isXLarge; + private Integer qtySmall; + private Integer qtyMedium; + private Integer qtyLarge; + private Integer qtyXLarge; + + public String getName() + { + return name; + } + + public void setName(String name) + { + this.name = name; + } + + public Integer getQtyOnHand() + { + return qtyOnHand; + } + + public void setQtyOnHand(Integer qtyOnHand) + { + this.qtyOnHand = qtyOnHand; + } + + + public Integer getProductId() + { + return productId; + } + public void setProductId(Integer productId) + { + this.productId = productId; + } + + + public String getDescription() + { + return description; + } + public void setDescription(String description) + { + this.description = description; + } + + public ProductImageInfo getImageInfo() + { + return imageInfo; + } + public void setImageInfo(ProductImageInfo imageInfo) + { + this.imageInfo = imageInfo; + } + + public Boolean getIsLarge() + { + return isLarge; + } + + public void setIsLarge(Boolean isLarge) + { + this.isLarge = isLarge; + } + + public Boolean getIsMedium() + { + return isMedium; + } + + public void setIsMedium(Boolean isMedium) + { + this.isMedium = isMedium; + } + + public Boolean getIsSmall() + { + return isSmall; + } + + public void setIsSmall(Boolean isSmall) + { + this.isSmall = isSmall; + } + + public Boolean getIsXLarge() + { + return isXLarge; + } + + public void setIsXLarge(Boolean isXLarge) + { + this.isXLarge = isXLarge; + } + + public Integer getQtyLarge() + { + return qtyLarge; + } + + public void setQtyLarge(Integer qtyLarge) + { + this.qtyLarge = qtyLarge; + } + + public Integer getQtyMedium() + { + return qtyMedium; + } + + public void setQtyMedium(Integer qtyMedium) + { + this.qtyMedium = qtyMedium; + } + + public Integer getQtySmall() + { + return qtySmall; + } + + public void setQtySmall(Integer qtySmall) + { + this.qtySmall = qtySmall; + } + + public Integer getQtyXLarge() + { + return qtyXLarge; + } + + public void setQtyXLarge(Integer qtyXLarge) + { + this.qtyXLarge = qtyXLarge; + } +} diff --git a/posterita/posterita/src/main/org/posterita/beans/InOutHistoryBean.java b/posterita/posterita/src/main/org/posterita/beans/InOutHistoryBean.java new file mode 100644 index 0000000000..84b1f1da54 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/InOutHistoryBean.java @@ -0,0 +1,113 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 08-Aug-2005 by alok + * + */ +package org.posterita.beans; + +import java.sql.Timestamp; + + +public class InOutHistoryBean extends FilterBean +{ + + public String getPartnerName() + { + return partnerName; + } + public void setPartnerName(String partnerName) + { + this.partnerName = partnerName; + } + + public Integer getInOutId() + { + return inOutId; + } + + public void setInOutId(Integer inOutId) + { + this.inOutId = inOutId; + } + + public Timestamp getDateMovement() + { + return dateMovement; + } + public void setDateMovement(Timestamp dateMovement) + { + this.dateMovement = dateMovement; + } + public Timestamp getDateOrdered() + { + return dateOrdered; + } + public void setDateOrdered(Timestamp dateOrdered) + { + this.dateOrdered = dateOrdered; + } + public Integer getInvoiceId() + { + return invoiceId; + } + public void setInvoiceId(Integer invoiceId) + { + this.invoiceId = invoiceId; + } + public Boolean getIsSotrx() + { + return isSoTrx; + } + public void setIsSotrx(Boolean isSotrx) + { + this.isSoTrx = isSotrx; + } + public Integer getOrderId() + { + return orderId; + } + public void setOrderId(Integer orderId) + { + this.orderId = orderId; + } + public String getPoReference() + { + return poReference; + } + public void setPoReference(String poReference) + { + this.poReference = poReference; + } + public Integer getRefInOutId() + { + return refInOutId; + } + public void setRefInOutId(Integer refInOutId) + { + this.refInOutId = refInOutId; + } + public Integer getWarehouseId() + { + return warehouseId; + } + public void setWarehouseId(Integer warehouseId) + { + this.warehouseId = warehouseId; + } +} diff --git a/posterita/posterita/src/main/org/posterita/beans/InventoryBean.java b/posterita/posterita/src/main/org/posterita/beans/InventoryBean.java new file mode 100644 index 0000000000..5be1d7280c --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/InventoryBean.java @@ -0,0 +1,166 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Dec 4, 2006 + */ + + +package org.posterita.beans; + +import java.math.BigDecimal; + + +public class InventoryBean extends UDIBean +{ + + public Integer[] getInventoryIds() + { + return inventoryIds; + } + public void setInventoryIds(Integer[] inventoryIds) + { + this.inventoryIds = inventoryIds; + } + public BigDecimal getBookQtyValue() { + return bookQtyValue; + } + public void setBookQtyValue(BigDecimal bookQtyValue) { + this.bookQtyValue = bookQtyValue; + } + public BigDecimal getCountQtyValue() { + return countQtyValue; + } + public void setCountQtyValue(BigDecimal countQtyValue) { + this.countQtyValue = countQtyValue; + } + public String getBarCode() { + return barCode; + } + public void setBarCode(String barCode) { + this.barCode = barCode; + } + public String getDocStatus() { + return docStatus; + } + public void setDocStatus(String docStatus) { + this.docStatus = docStatus; + } + public String getInventoryNo() { + return inventoryNo; + } + public void setInventoryNo(String inventoryNo) { + this.inventoryNo = inventoryNo; + } + public String getMovementDate() { + return movementDate; + } + public void setMovementDate(String movementDate) { + this.movementDate = movementDate; + } + public String getProductName() { + return productName; + } + public void setProductName(String productName) { + this.productName = productName; + } + public Integer getProductId() { + return productId; + } + public void setProductId(Integer productId) { + this.productId = productId; + } + public String getDescription() { + return description; + } + public void setDescription(String description) { + this.description = description; + } + public Integer getInventoryId() { + return inventoryId; + } + public void setInventoryId(Integer inventoryId) { + this.inventoryId = inventoryId; + } + public Integer getInventoryLineId() { + return inventoryLineId; + } + public void setInventoryLineId(Integer inventoryLineId) { + this.inventoryLineId = inventoryLineId; + } + public BigDecimal getQtyBook() { + return qtyBook; + } + public void setQtyBook(BigDecimal qtyBook) { + this.qtyBook = qtyBook; + } + public BigDecimal getQtyCount() { + return qtyCount; + } + public void setQtyCount(BigDecimal qtyCount) { + this.qtyCount = qtyCount; + } + public void setUom(String uom) + { + this.uom = uom; + } + public String getUom() + { + return this.uom; + } + + public String getIfAdd() { + return ifAdd; + } + public void setIfAdd(String ifAdd) { + this.ifAdd = ifAdd; + } + + public Integer getPriceListId() { + return priceListId; + } + public void setPriceListId(Integer priceListId) { + this.priceListId = priceListId; + } + + public BigDecimal getQtyCsv() + { + return qtyCsv; + } + public void setQtyCsv(BigDecimal qtyCsv) + { + this.qtyCsv = qtyCsv; + } + + public Integer getMonth() + { + return month; + } + public void setMonth(Integer month) + { + this.month = month; + } + public Integer getYear() + { + return year; + } + public void setYear(Integer year) + { + this.year = year; + } + +} diff --git a/posterita/posterita/src/main/org/posterita/beans/InventoryCartBean.java b/posterita/posterita/src/main/org/posterita/beans/InventoryCartBean.java new file mode 100644 index 0000000000..c9afd2d08a --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/InventoryCartBean.java @@ -0,0 +1,177 @@ +/** + * + * Copyright (c) 2008 Posterita. All Rights Reserved. + * + * This software is the confidential and proprietary information of + * Posterita. ("Confidential Information"). You shall not + * disclose such Confidential Information and shall use it only in + * accordance with the terms of the license agreement you entered into + * with Posterita. + * + * POSTERITA MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE + * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT + * NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR + * A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. TAMAK ICT SHALL NOT + * BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, + * MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. + * + * 27 May 2008 12:27:14 by shameem + * + */ + +package org.posterita.beans; + +import java.math.BigDecimal; +import java.util.ArrayList; + +import org.compiere.util.Env; + +public class InventoryCartBean extends UDIBean +{ + private ArrayList items; + private String currency; + private BigDecimal totalPrice; + private int pricelistId; + + public String getCurrency() + { + return currency; + } + + public void setCurrency(String currency) + { + this.currency = currency; + } + + public ArrayList getItems() + { + return items; + } + + public void setItems(ArrayList items) + { + this.items = items; + } + + public BigDecimal getTotalPrice() + { + return totalPrice; + } + + public void setTotalPrice(BigDecimal totalPrice) + { + this.totalPrice = totalPrice; + } + + public int getPricelistId() { + return pricelistId; + } + + public void setPricelistId(int pricelistId) { + this.pricelistId = pricelistId; + } + + public BigDecimal getQtyCount() { + return qtyCount; + } + public void setQtyCount(BigDecimal qtyCount) { + this.qtyCount = qtyCount; + } + + public String getBarCode() { + return barCode; + } + + public void setBarCode(String barCode) { + this.barCode = barCode; + } + + public Integer getPriceListId() { + return priceListId; + } + + public void setPriceListId(Integer priceListId) { + this.priceListId = priceListId; + } + + public BigDecimal getQtyBook() { + return qtyBook; + } + public void setQtyBook(BigDecimal qtyBook) { + this.qtyBook = qtyBook; + } + + public BigDecimal getQtyCsv() + { + return qtyCsv; + } + + public void setQtyCsv(BigDecimal qtyCsv) + { + this.qtyCsv = qtyCsv; + } + + public void setInventoryId(Integer inventoryId) + { + this.inventoryId = inventoryId; + } + + public String getDescription() { + return description; + } + public void setDescription(String description) { + this.description = description; + } + public Integer getInventoryId() + { + return inventoryId; + } + public String getUom() + { + return uom; + } + public void setUom(String uom) + { + this.uom = uom; + } + public Integer getInventoryLineId() + { + return inventoryLineId; + } + public void setInventoryLineId(Integer inventoryLineId) + { + this.inventoryLineId = inventoryLineId; + } + + public BigDecimal getCountQtyValue() + { + return countQtyValue; + } + public void setCountQtyValue(BigDecimal countQtyValue) + { + this.countQtyValue = countQtyValue; + } + + public Integer getProductId() + { + return productId; + } + public void setProductId(Integer productId) + { + this.productId = productId; + } + public String getProductName() + { + return productName; + } + public void setProductName(String productName) + { + this.productName = productName; + } + public BigDecimal getBookQtyValue() { + return bookQtyValue; + } + public void setBookQtyValue(BigDecimal bookQtyValue) { + this.bookQtyValue = bookQtyValue; + } +} diff --git a/posterita/posterita/src/main/org/posterita/beans/InventoryLineBean.java b/posterita/posterita/src/main/org/posterita/beans/InventoryLineBean.java new file mode 100644 index 0000000000..4825ceedf6 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/InventoryLineBean.java @@ -0,0 +1,475 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +package org.posterita.beans; + +import java.math.BigDecimal; +import java.util.ArrayList; + + +public class InventoryLineBean extends DocumentBean implements Comparable +{ + public String getDescription() { + return description; + } + public void setDescription(String description) { + this.description = description; + } + public Double getTotalActualPrice() { + return totalActualPrice; + } + public void setTotalActualPrice(Double totalActualPrice) { + this.totalActualPrice = totalActualPrice; + } + public Double getPaymentByCard() { + return paymentByCard; + } + public void setPaymentByCard(Double paymentByCard) { + this.paymentByCard = paymentByCard; + } + public Double getPaymentByCash() { + return paymentByCash; + } + public void setPaymentByCash(Double paymentByCash) { + this.paymentByCash = paymentByCash; + } + public Double getPaymentByChq() { + return paymentByChq; + } + public void setPaymentByChq(Double paymentByChq) { + this.paymentByChq = paymentByChq; + } + public String[] getActualPrice() { + return actualPrice; + } + public void setActualPrice(String[] actualPrice) { + this.actualPrice = actualPrice; + } + + public String[] getDiscountPercent() { + return discountPercent; + } + public void setDiscountPercent(String[] discountPercent) { + this.discountPercent = discountPercent; + } + public String getQtyAndItem() { + return qtyAndItem; + } + public void setQtyAndItem(String qtyAndItem) { + this.qtyAndItem = qtyAndItem; + } + public String getBarCode() { + return barCode; + } + public void setBarCode(String barCode) { + this.barCode = barCode; + } + + public String getPartnerName() { + return partnerName; + } + public void setPartnerName(String partnerName) { + this.partnerName = partnerName; + } + public Integer[] getInventoryLineIds() + { + return inventoryLineIds; + } + public void setInventoryLineIds(Integer[] inventoryLineIds) + { + this.inventoryLineIds = inventoryLineIds; + } + public String getChequeNo() + { + return chequeNo; + } + + public void setChequeNo(String chequeNo) + { + this.chequeNo = chequeNo; + } + + public Integer getCreditCardExpMonth() + { + return creditCardExpMonth; + } + + public void setCreditCardExpMonth(Integer creditCardExpMonth) + { + this.creditCardExpMonth = creditCardExpMonth; + } + + public Integer getCreditCardExpYear() + { + return creditCardExpYear; + } + + public void setCreditCardExpYear(Integer creditCardExpYear) + { + this.creditCardExpYear = creditCardExpYear; + } + + public String getCreditCardNumber() + { + return creditCardNumber; + } + + public void setCreditCardNumber(String creditCardNumber) + { + this.creditCardNumber = creditCardNumber; + } + + public String getCreditCardType() + { + return creditCardType; + } + + public void setCreditCardType(String creditCardType) + { + this.creditCardType = creditCardType; + } + public Integer getInventoryId() + { + return inventoryId; + } + public void setInventoryId(Integer inventoryId) + { + this.inventoryId = inventoryId; + } + public String getSurname() { + return surname; + } + public void setSurname(String surname) { + this.surname = surname; + } + + public Integer getBpartnerId() + { + return bpartnerId; + } + + public void setBpartnerId(Integer bpartnerId) + { + this.bpartnerId = bpartnerId; + } + public Boolean getIsQtyReserved() + { + return isQtyReserved; + } + + public void setIsQtyReserved(Boolean isQtyReserved) + { + this.isQtyReserved = isQtyReserved; + } + public String getEngineNo() { + return engineNo; + } + public void setEngineNo(String engineNo) { + this.engineNo = engineNo; + } + public BigDecimal getQuantity() + { + return quantity; + } + + public void setQuantity(BigDecimal quantity) + { + this.quantity = quantity; + } + + public Integer getProductId() + { + return productId; + } + + public void setProductId(Integer productId) + { + this.productId = productId; + } + + + public Integer[] getCheckBox() + { + return checkBox; + } + public void setCheckBox(Integer [] checkBox) + { + this.checkBox = checkBox; + } + + public Integer getAttributeSetInstanceId() + { + return attributeSetInstanceId; + } + + public void setAttributeSetInstanceId(Integer attributeSetInstanceId) + { + this.attributeSetInstanceId = attributeSetInstanceId; + } + + public ArrayList getInventoryLineList() + { + return InventoryLineList; + } + public void setInventoryLineList(ArrayList inventoryLineList) + { + InventoryLineList = inventoryLineList; + } + + public Integer getInventoryLineId() + { + return inventoryLineId; + } + public void setInventoryLineId(Integer inventoryLineId) + { + this.inventoryLineId = inventoryLineId; + } + + public Integer getOrgId() + { + return orgId; + } + + public void setOrgId(Integer orgId) + { + this.orgId = orgId; + } + + public Integer getAllocationId() + { + return allocationId; + } + + public void setAllocationId(Integer allocationId) + { + this.allocationId = allocationId; + } + + public boolean equals(Object obj) + { + OrderLineBean target = (OrderLineBean) obj; + + if ( obj == null) + return false; + + if (this.getAttributeSetInstanceId().equals(target.getAttributeSetInstanceId())) + return true; + + return false; + } + + public String getSubmit() + { + return submit; + } + + public void setSubmit(String submit) + { + this.submit = submit; + } + + + public int compareTo(Object o) + { + InventoryLineBean src = (InventoryLineBean) o; + + if (src.getAttributeSetInstanceId().intValue() == this.getAttributeSetInstanceId().intValue()) + return 0; + + + return -1; + } + + + + + + + public BigDecimal getAmountGiven() + { + return amountGiven; + } + + public void setAmountGiven(BigDecimal amountGiven) + { + this.amountGiven = amountGiven; + } + + public BigDecimal getAmountRefunded() + { + return amountRefunded; + } + + public void setAmountRefunded(BigDecimal amountRefunded) + { + this.amountRefunded = amountRefunded; + } + public String getTrxType() + { + return trxType; + } + + public void setTrxType(String trxType) + { + this.trxType = trxType; + } + + public BigDecimal getTransferAmount() { + return transferAmount; + } + public void setTransferAmount(BigDecimal transferAmount) { + this.transferAmount = transferAmount; + } + + public Integer getCashBookIds() { + return cashBookIds; + } + public void setCashBookIds(Integer cashBookIds) { + this.cashBookIds = cashBookIds; + } + public String getIsSales() { + return isSales; + } + public void setIsSales(String isSales) { + this.isSales = isSales; + } + public String getIfAdd() { + return ifAdd; + } + public void setIfAdd(String ifAdd) { + this.ifAdd = ifAdd; + } + + public String getVendorName() { + return vendorName; + } + public void setVendorName(String vendorName) { + this.vendorName = vendorName; + } + + public String getDocumentNo() { + return documentNo; + } + public void setDocumentNo(String documentNo) { + this.documentNo = documentNo; + } + + public BigDecimal getUserDiscount() { + return userDiscount; + } + public void setUserDiscount(BigDecimal userDiscount) { + this.userDiscount = userDiscount; + } + + public Integer getPaymentTermId() { + return paymentTermId; + } + public void setPaymentTermId(Integer paymentTermId) { + this.paymentTermId = paymentTermId; + } + + public String getPaymentTermName() { + return paymentTermName; + } + public void setPaymentTermName(String paymentTermName) { + this.paymentTermName = paymentTermName; + } + public String getToBeShipped() { + return toBeShipped; + } + public void setToBeShipped(String toBeShipped) { + this.toBeShipped = toBeShipped; + } + + public Boolean getOpenDrawer() { + return openDrawer; + } + public void setOpenDrawer(Boolean openDrawer) { + this.openDrawer = openDrawer; + } + + public void setUom(String uom) + { + this.uom = uom; + } + + public String getUom() + { + return this.uom; + } + public Integer getPriceListId() { + return priceListId; + } + public void setPriceListId(Integer priceListId) { + this.priceListId = priceListId; + } + + public BigDecimal getQtyBook() + { + return qtyBook; + } + public void setQtyBook(BigDecimal qtyBook) + { + this.qtyBook = qtyBook; + } + public BigDecimal getQtyCount() + { + return qtyCount; + } + public void setQtyCount(BigDecimal qtyCount) + { + this.qtyCount = qtyCount; + } + public BigDecimal getQtyCsv() + { + return qtyCsv; + } + public void setQtyCsv(BigDecimal qtyCsv) + { + this.qtyCsv = qtyCsv; + } + public String getProductName() + { + return productName; + } + public void setProductName(String productName) + { + this.productName = productName; + } + public BigDecimal getBookQtyValue() { + return bookQtyValue; + } + public void setBookQtyValue(BigDecimal bookQtyValue) { + this.bookQtyValue = bookQtyValue; + } + public BigDecimal getCountQtyValue() + { + return countQtyValue; + } + public void setCountQtyValue(BigDecimal countQtyValue) + { + this.countQtyValue = countQtyValue; + } + public String getDocStatus() { + return docStatus; + } + public void setDocStatus(String docStatus) { + this.docStatus = docStatus; + } +} diff --git a/posterita/posterita/src/main/org/posterita/beans/InvoiceHistoryBean.java b/posterita/posterita/src/main/org/posterita/beans/InvoiceHistoryBean.java new file mode 100644 index 0000000000..4114b182d1 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/InvoiceHistoryBean.java @@ -0,0 +1,101 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 04-Aug-2005 by alok + * + */ +package org.posterita.beans; + +import java.sql.Timestamp; + + +public class InvoiceHistoryBean extends FilterBean +{ + private PaymentHistoryBean paymentHistoryBean; + + public PaymentHistoryBean getPaymentHistoryBean() + { + return paymentHistoryBean; + } + + public void setPaymentHistoryBean(PaymentHistoryBean paymentHistoryBean) + { + this.paymentHistoryBean = paymentHistoryBean; + } + + public Integer getInvoiceId() + { + return invoiceId; + } + public void setInvoiceId(Integer invoiceId) + { + this.invoiceId = invoiceId; + } + public Timestamp getDateInvoiced() + { + return dateInvoiced; + } + public void setDateInvoiced(Timestamp dateInvoiced) + { + this.dateInvoiced = dateInvoiced; + } + + public Integer getGrandTotal() + { + return grandTotal; + } + public void setGrandTotal(Integer grandTotal) + { + this.grandTotal = grandTotal; + } + public String getIsPaid() + { + return isPaid; + } + public void setIsPaid(String isPaid) + { + this.isPaid = isPaid; + } + public Boolean getIsSotrx() + { + return isSoTrx; + } + public void setIsSotrx(Boolean isSotrx) + { + this.isSoTrx = isSotrx; + } + public Integer getOrderId() + { + return orderId; + } + public void setOrderId(Integer orderId) + { + this.orderId = orderId; + } + + public Integer[] getCheckBox() + { + return checkBox; + } + + public void setCheckBox(Integer[] checkBox) + { + this.checkBox = checkBox; + } + +} diff --git a/posterita/posterita/src/main/org/posterita/beans/ItemBean.java b/posterita/posterita/src/main/org/posterita/beans/ItemBean.java new file mode 100644 index 0000000000..7ad2e2cb7d --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/ItemBean.java @@ -0,0 +1,531 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +package org.posterita.beans; + +import java.math.BigDecimal; + +import org.compiere.util.Env; + + +public class ItemBean +{ + + private Integer productId; + private Integer priceListId; + private Integer inventoryId; + private Integer inventoryLineId; + private String description; + private String barCode; + private BigDecimal price; + private BigDecimal qty = Env.ONE; + private BigDecimal grandTotal = Env.ZERO; + private BigDecimal discountPercent = Env.ZERO; + private BigDecimal actualPrice; + private BigDecimal taxAmt; + private BigDecimal standardPrice; + private BigDecimal priceLimit; + private BigDecimal priceLimitTotal; + private BigDecimal priceTotal; + private BigDecimal taxTotal; + private BigDecimal qtyTotal = Env.ZERO; + private BigDecimal unitPrice; + private String productName; + private BigDecimal inclPrice; + private BigDecimal taxRate; + private String uom; + private String backOrder; + private BigDecimal discountedLinePrice; + private BigDecimal discountedInclUnitPrice; + private Boolean isDiscountOnInclUnitPrice; + private BigDecimal qtyCsv; + private BigDecimal qtyBook; + private BigDecimal qtyCount; + private BigDecimal bookQtyValue; + private BigDecimal countQtyValue; + private BigDecimal listPrice; + + private Boolean isDiscountOnPercentage; + private Boolean isDiscountOnTotal; + private Boolean isTaxIncluded; + + private BigDecimal stockValue; + private BigDecimal qtyToMove; + private BigDecimal qtyOnHand; + private Integer unitsPerPack; + private Integer noOfPack; + + public Boolean getIsTaxIncluded() { + return isTaxIncluded; + } + + public void setIsTaxIncluded(Boolean isTaxIncluded) { + this.isTaxIncluded = isTaxIncluded; + } + + public Boolean getIsDiscountOnInclUnitPrice() { + return isDiscountOnInclUnitPrice; + } + + public void setIsDiscountOnInclUnitPrice(Boolean isDiscountOnInclUnitPrice) { + this.isDiscountOnInclUnitPrice = isDiscountOnInclUnitPrice; + } + + public BigDecimal getDiscountedLinePrice() { + return discountedLinePrice; + } + + public void setDiscountedLinePrice(BigDecimal discountedLinePrice) { + this.discountedLinePrice = discountedLinePrice; + } + + public BigDecimal getTaxRate() { + return taxRate; + } + + public void setTaxRate(BigDecimal taxRate) { + this.taxRate = taxRate; + } + + public BigDecimal getInclPrice() { + return inclPrice; + } + + public void setInclPrice(BigDecimal inclPrice) { + this.inclPrice = inclPrice; + } + + public String getProductName() + { + return productName; + } + + public void setProductName(String productName) + { + this.productName = productName; + } + + public String getUom() { + return uom; + } + + public void setUom(String uom) { + this.uom = uom; + } + + public BigDecimal getUnitPrice() { + return unitPrice; + } + + public void setUnitPrice(BigDecimal unitPrice) { + this.unitPrice = unitPrice; + } + + public BigDecimal getQtyTotal() { + return qtyTotal; + } + + public void setQtyTotal(BigDecimal qtyTotal) { + this.qtyTotal = qtyTotal; + } + + public BigDecimal getPriceTotal() { + return priceTotal; + } + + public void setPriceTotal(BigDecimal priceTotal) { + this.priceTotal = priceTotal; + } + + public BigDecimal getTaxTotal() { + return taxTotal; + } + + public void setTaxTotal(BigDecimal taxTotal) { + this.taxTotal = taxTotal; + } + + public BigDecimal getStandardPrice() { + return standardPrice; + } + + public void setStandardPrice(BigDecimal standardPrice) { + this.standardPrice = standardPrice; + } + + public BigDecimal getTaxAmt() { + return taxAmt; + } + + public void setTaxAmt(BigDecimal taxAmt) { + this.taxAmt = taxAmt; + } + + public void setGrandTotal(BigDecimal grandTotal) { + this.grandTotal = grandTotal; + } + + public String getBackOrder() + { + return backOrder; + } + + public void setBackOrder(String backOrder) + { + this.backOrder = backOrder; + } + + public BigDecimal getActualPrice() { + return actualPrice; + } + + public void setActualPrice(BigDecimal actualPrice) { + this.actualPrice = actualPrice; + } + public BigDecimal getDiscountPercent() { + return discountPercent; + } + public void setDiscountPercent(BigDecimal discountPercent) { + this.discountPercent = discountPercent; + } + public void setgrandTotal(BigDecimal grandTotal) + { + this.grandTotal=grandTotal; + } + + public BigDecimal getGrandTotal() + { + return grandTotal; + } + + public String getDescription() + { + return description; + } + + public void setDescription(String description) + { + this.description = description; + } + + public BigDecimal getPrice() + { + return price; + } + + public void setPrice(BigDecimal price) + { + this.price = price; + } + + public Integer getProductId() + { + return productId; + } + + public void setProductId(Integer productId) + { + this.productId = productId; + } + + public BigDecimal getQty() + { + return qty; + } + + public void setQty(BigDecimal qty) + { + this.qty = qty; + } + + /** + * Update Quantity in order + * @param original + * @param itemToAdd + * @param add + */ + public void updateQuantity(ItemBean original, ItemBean itemToAdd,boolean add) + { + BigDecimal originalQuantity = original.getQty(); + + BigDecimal quantityToAdd = itemToAdd.getQty(); + + BigDecimal finalQuantity = null; + + if(!add) + finalQuantity= originalQuantity.subtract(quantityToAdd); + else + finalQuantity= originalQuantity.add(quantityToAdd); + + + original.setQty(finalQuantity); + } + + /** + * Update Quantity count in inventory + * @param original + * @param itemToAdd + * @param add + */ + public void updateQuantityCount(ItemBean original, ItemBean itemToAdd,boolean add) + { + BigDecimal originalQuantity = original.getQtyCount(); + + BigDecimal quantityToAdd = itemToAdd.getQtyCount(); + + BigDecimal finalQuantity = null; + + if(!add) + finalQuantity= originalQuantity.subtract(quantityToAdd); + else + finalQuantity= originalQuantity.add(quantityToAdd); + + + original.setQtyCount(finalQuantity); + } + + /** + * Update Quantity CSV in inventory + * @param original + * @param itemToAdd + * @param add + */ + public void updateQuantityCsv(ItemBean original, ItemBean itemToAdd,boolean add) + { + BigDecimal originalQuantity = original.getQtyCsv(); + + BigDecimal quantityToAdd = itemToAdd.getQtyCsv(); + + BigDecimal finalQuantity = null; + + if(!add) + finalQuantity= originalQuantity.subtract(quantityToAdd); + else + finalQuantity= originalQuantity.add(quantityToAdd); + + + original.setQtyCsv(finalQuantity); + } + + /** + * Update Quantity to move in Stock Transfer + * @param original + * @param itemToAdd + * @param add + */ + public void updateQuantityToMove(ItemBean original, ItemBean itemToAdd,boolean add) + { + BigDecimal originalQuantity = original.getQtyToMove(); + + BigDecimal quantityToAdd = itemToAdd.getQtyToMove(); + + BigDecimal finalQuantity = null; + + if(!add) + finalQuantity= originalQuantity.subtract(quantityToAdd); + else + finalQuantity= originalQuantity.add(quantityToAdd); + + original.setQtyToMove(finalQuantity); + } + + public boolean equals(Object o) + { + if (o == null) + return false; + + ItemBean bean1 = (ItemBean) o; + if (bean1.getProductId().intValue() == this.getProductId().intValue()) + return true; + + return false; + + } + public String getBarCode() { + return barCode; + } + public void setBarCode(String barCode) { + this.barCode = barCode; + } + + public Integer getPriceListId() { + return priceListId; + } + + public void setPriceListId(Integer priceListId) { + this.priceListId = priceListId; + } + + public BigDecimal getPriceLimit() { + return priceLimit; + } + + public void setPriceLimit(BigDecimal priceLimit) { + this.priceLimit = priceLimit; + } + + public BigDecimal getPriceLimitTotal() { + return priceLimitTotal; + } + + public void setPriceLimitTotal(BigDecimal priceLimitTotal) { + this.priceLimitTotal = priceLimitTotal; + } + + public BigDecimal getDiscountedInclUnitPrice() { + return discountedInclUnitPrice; + } + + public void setDiscountedInclUnitPrice(BigDecimal discountedInclUnitPrice) { + this.discountedInclUnitPrice = discountedInclUnitPrice; + } + + public Boolean getIsDiscountOnPercentage() + { + return isDiscountOnPercentage; + } + + public void setIsDiscountOnPercentage(Boolean isDiscountOnPercentage) + { + this.isDiscountOnPercentage = isDiscountOnPercentage; + } + + public BigDecimal getQtyBook() + { + return qtyBook; + } + public void setQtyBook(BigDecimal qtyBook) + { + this.qtyBook = qtyBook; + } + public BigDecimal getQtyCount() + { + return qtyCount; + } + public void setQtyCount(BigDecimal qtyCount) + { + this.qtyCount = qtyCount; + } + public BigDecimal getQtyCsv() + { + return qtyCsv; + } + public void setQtyCsv(BigDecimal qtyCsv) + { + this.qtyCsv = qtyCsv; + } + public BigDecimal getBookQtyValue() { + return bookQtyValue; + } + public void setBookQtyValue(BigDecimal bookQtyValue) { + this.bookQtyValue = bookQtyValue; + } + public Integer getInventoryLineId() + { + return inventoryLineId; + } + public void setInventoryLineId(Integer inventoryLineId) + { + this.inventoryLineId = inventoryLineId; + } + public Boolean getIsDiscountOnTotal() + { + return isDiscountOnTotal; + } + + public BigDecimal getCountQtyValue() + { + return countQtyValue; + } + public void setCountQtyValue(BigDecimal countQtyValue) + { + this.countQtyValue = countQtyValue; + } + public Integer getInventoryId() + { + return inventoryId; + } + public void setInventoryId(Integer inventoryId) + { + this.inventoryId = inventoryId; + } + + public void setIsDiscountOnTotal(Boolean isDiscountOnTotal) + { + this.isDiscountOnTotal = isDiscountOnTotal; + } + + public BigDecimal getListPrice() { + return listPrice; + } + + public void setListPrice(BigDecimal listPrice) { + this.listPrice = listPrice; + } + + public BigDecimal getStockValue() + { + return stockValue; + } + + public void setStockValue(BigDecimal stockValue) + { + this.stockValue = stockValue; + } + + public BigDecimal getQtyToMove() + { + return qtyToMove; + } + + public void setQtyToMove(BigDecimal qtyToMove) + { + this.qtyToMove = qtyToMove; + } + + public BigDecimal getQtyOnHand() + { + return qtyOnHand; + } + + public void setQtyOnHand(BigDecimal qtyOnHand) + { + this.qtyOnHand = qtyOnHand; + } + + public Integer getUnitsPerPack() + { + return unitsPerPack; + } + + public void setUnitsPerPack(Integer unitsPerPack) + { + this.unitsPerPack = unitsPerPack; + } + + public Integer getNoOfPack() + { + return noOfPack; + } + + public void setNoOfPack(Integer noOfPack) + { + this.noOfPack = noOfPack; + } +} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/beans/LocatorBean.java b/posterita/posterita/src/main/org/posterita/beans/LocatorBean.java new file mode 100644 index 0000000000..bf65c7f46e --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/LocatorBean.java @@ -0,0 +1,116 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 26-Jul-2005 by alok + * + */ +package org.posterita.beans; + + +public class LocatorBean extends UDIBean +{ + + public String getAisle() + { + return aisle; + } + public void setAisle(String aisle) + { + this.aisle = aisle; + } + public String getBin() + { + return bin; + } + public void setBin(String bin) + { + this.bin = bin; + } + public Boolean getIsDefault() + { + return isDefault; + } + public void setIsDefault(Boolean isDefault) + { + this.isDefault = isDefault; + } + public String getLevel() + { + return level; + } + public void setLevel(String level) + { + this.level = level; + } + public Integer getWarehouseId() + { + return warehouseId; + } + public void setWarehouseId(Integer warehouseId) + { + this.warehouseId = warehouseId; + } + + public String getWarehouseName() + { + return warehouseName; + } + + public void setWarehouseName(String warehouseName) + { + this.warehouseName = warehouseName; + } + + + + public Integer getAttributeSetInstance() + { + return attributeSetInstance; + } + public void setAttributeSetInstance(Integer attributeSetInstance) + { + this.attributeSetInstance = attributeSetInstance; + } + public String getSernoAttributeSetInstance() + { + return sernoAttributeSetInstance; + } + public void setSernoAttributeSetInstance(String sernoAttributeSetInstance) + { + this.sernoAttributeSetInstance = sernoAttributeSetInstance; + } + + + public Integer getAttributeSetInstanceId() + { + return attributeSetInstanceId; + } + public void setAttributeSetInstanceId(Integer attributeSetInstanceId) + { + this.attributeSetInstanceId = attributeSetInstanceId; + } + + public Integer getLocatorId() + { + return locatorId; + } + public void setLocatorId(Integer locatorId) + { + this.locatorId = locatorId; + } +} diff --git a/posterita/posterita/src/main/org/posterita/beans/LoginBean.java b/posterita/posterita/src/main/org/posterita/beans/LoginBean.java new file mode 100644 index 0000000000..d010de9612 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/LoginBean.java @@ -0,0 +1,76 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 25-Jul-2005 by alok + * + */ +package org.posterita.beans; + + +public class LoginBean extends UDIBean +{ + + public Integer getRoleId() { + return roleId; + } + public void setRoleId(Integer roleId) { + this.roleId = roleId; + } + public String getUserPIN() + { + return userPIN; + } + public void setUserPIN(String userPIN) + { + this.userPIN = userPIN; + } + public String getPassword() + { + return password; + } + public void setPassword(String password) + { + this.password = password; + } + public String getUsername() + { + return username; + } + public void setUsername(String username) + { + this.username = username; + } + + public Integer getId() + { + return id; + } + public void setId(Integer id) + { + this.id = id; + } + + public Integer getUserId() + { + return userId; + } + public void setUserId(Integer userId) + { + this.userId = userId; + } +} diff --git a/posterita/posterita/src/main/org/posterita/beans/MMovementCartBean.java b/posterita/posterita/src/main/org/posterita/beans/MMovementCartBean.java new file mode 100644 index 0000000000..2c4b9b2240 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/MMovementCartBean.java @@ -0,0 +1,84 @@ +package org.posterita.beans; + +import java.math.BigDecimal; +import java.util.ArrayList; + +public class MMovementCartBean extends UDIBean +{ + private ArrayList items; + private String currency; + private BigDecimal totalPrice; + private int pricelistId; + private BigDecimal stockValue; + private BigDecimal qtyToMove; + private BigDecimal qtyOnHand; + + public String getCurrency() + { + return currency; + } + + public void setCurrency(String currency) + { + this.currency = currency; + } + + public ArrayList getItems() + { + return items; + } + + public void setItems(ArrayList items) + { + this.items = items; + } + + public BigDecimal getTotalPrice() + { + return totalPrice; + } + + public void setTotalPrice(BigDecimal totalPrice) + { + this.totalPrice = totalPrice; + } + + public int getPricelistId() { + return pricelistId; + } + + public void setPricelistId(int pricelistId) { + this.pricelistId = pricelistId; + } + + public BigDecimal getStockValue() + { + return stockValue; + } + + public void setStockValue(BigDecimal stockValue) + { + this.stockValue = stockValue; + } + + public BigDecimal getQtyToMove() + { + return qtyToMove; + } + + public void setQtyToMove(BigDecimal qtyToMove) + { + this.qtyToMove = qtyToMove; + } + + public BigDecimal getQtyOnHand() + { + return qtyOnHand; + } + + public void setQtyOnHand(BigDecimal qtyOnHand) + { + this.qtyOnHand = qtyOnHand; + } + +} diff --git a/posterita/posterita/src/main/org/posterita/beans/MenuItemBean.java b/posterita/posterita/src/main/org/posterita/beans/MenuItemBean.java new file mode 100644 index 0000000000..19a8c57bd5 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/MenuItemBean.java @@ -0,0 +1,102 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +package org.posterita.beans; + + +public class MenuItemBean extends UDIBean +{ + + + public Integer getMenuId() + { + return menuId; + } + public void setMenuId(Integer menuId) + { + this.menuId = menuId; + } + public String getMenuItemName() + { + return menuItemName; + } + public void setMenuItemName(String menuItemName) + { + this.menuItemName = menuItemName; + } + public String getMenuLink() + { + return menuLink; + } + public void setMenuLink(String menuLink) + { + this.menuLink = menuLink; + } + public Integer getParentMenuId() + { + return parentMenuId; + } + public void setParentMenuId(Integer parentMenuId) + { + this.parentMenuId = parentMenuId; + } + + public Integer getId() + { + return id; + } + public void setId(Integer id) + { + this.id = id; + } + + public Boolean getIsActive() + { + return isActive; + } + public void setIsActive(Boolean isActive) + { + this.isActive = isActive; + } + public String getName() + { + return name; + } + public void setName(String name) + { + this.name = name; + } + public Boolean getIsClosable() + { + return isClosable; + } + public void setIsClosable(Boolean isClosable) + { + this.isClosable = isClosable; + } + + public String getDescription() + { + return description; + } + public void setDescription(String description) + { + this.description = description; + } +} diff --git a/posterita/posterita/src/main/org/posterita/beans/MessageBean.java b/posterita/posterita/src/main/org/posterita/beans/MessageBean.java new file mode 100644 index 0000000000..4850a2d410 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/MessageBean.java @@ -0,0 +1,126 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Aug 1, 2005 by din + */ + +package org.posterita.beans; + +import java.sql.Timestamp; + +public class MessageBean extends UDIBean +{ + public String getMessage() + { + return message; + } + public void setMessage(String message) + { + this.message = message; + } + public Integer getMessageID() + { + return messageID; + } + public void setMessageID(Integer messageID) + { + this.messageID = messageID; + } + public String getSubject() + { + return subject; + } + public void setSubject(String subject) + { + this.subject = subject; + } + public Integer getCounterOrgID() + { + return counterOrgID; + } + public void setCounterOrgID(Integer counterOrgID) + { + this.counterOrgID = counterOrgID; + } + public String getCounterOrgName() + { + return counterOrgName; + } + public void setCounterOrgName(String counterOrgName) + { + this.counterOrgName = counterOrgName; + } + public Integer getOrgId() + { + return orgId; + } + public void setOrgID(Integer orgId) + { + this.orgId = orgId; + } + public String getRead() + { + return read; + } + public void setRead(String read) + { + this.read = read; + } + public Timestamp getDateCreated() + { + return dateCreated; + } + public void setDateCreated(Timestamp dateCreated) + { + this.dateCreated = dateCreated; + } + public String getCounterOrderStatusInfo() + { + return counterOrderStatusInfo; + } + public void setCounterOrderStatusInfo(String counterOrderStatusInfo) + { + this.counterOrderStatusInfo = counterOrderStatusInfo; + } + public String getOrderStatusInfo() + { + return orderStatusInfo; + } + public void setOrderStatusInfo(String orderStatusInfo) + { + this.orderStatusInfo = orderStatusInfo; + } + public Boolean getIsActive() + { + return isActive; + } + public void setIsActive(Boolean isActive) + { + this.isActive = isActive; + } + + public Integer[] getCheckBox() + { + return checkBox; + } + + public void setCheckBox(Integer[] checkBox) + { + this.checkBox = checkBox; + } +} diff --git a/posterita/posterita/src/main/org/posterita/beans/MessageLoggerBean.java b/posterita/posterita/src/main/org/posterita/beans/MessageLoggerBean.java new file mode 100644 index 0000000000..fa0eebe47c --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/MessageLoggerBean.java @@ -0,0 +1,58 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * */ +package org.posterita.beans; + + +public class MessageLoggerBean +{ + private String cause; + private String error; + private String description; + + public String getCause() + { + return cause; + } + + public void setCause(String cause) + { + this.cause = cause; + } + + public String getDescription() + { + return description; + } + + public void setDescription(String description) + { + this.description = description; + } + + public String getError() + { + return error; + } + + public void setError(String error) + { + this.error = error; + } +} diff --git a/posterita/posterita/src/main/org/posterita/beans/MinOutHistoryBean.java b/posterita/posterita/src/main/org/posterita/beans/MinOutHistoryBean.java new file mode 100644 index 0000000000..7790d84f93 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/MinOutHistoryBean.java @@ -0,0 +1,44 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ +package org.posterita.beans; + + +public class MinOutHistoryBean extends UDIBean +{ + public Integer getMinOutId() + { + return minOutId; + } + + public void setMinOutId(Integer minOutId) + { + this.minOutId = minOutId; + } + + public Integer getInvoiceId() + { + return invoiceId; + } + + public void setInvoiceId(Integer invoiceId) + { + this.invoiceId = invoiceId; + } +} diff --git a/posterita/posterita/src/main/org/posterita/beans/OpenItemBean.java b/posterita/posterita/src/main/org/posterita/beans/OpenItemBean.java new file mode 100644 index 0000000000..db1f697866 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/OpenItemBean.java @@ -0,0 +1,284 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Oct 17, 2006 + */ + + +package org.posterita.beans; + +import java.math.BigDecimal; +import java.sql.Timestamp; + + +public class OpenItemBean extends UDIBean +{ + + + public BigDecimal getAvailableAmt() + { + return AvailableAmt; + } + public void setAvailableAmt(BigDecimal availableAmt) + { + AvailableAmt = availableAmt; + } + public BigDecimal getPaymentAllocatedAmt() + { + return paymentAllocatedAmt; + } + public void setPaymentAllocatedAmt(BigDecimal paymentAllocatedAmt) + { + this.paymentAllocatedAmt = paymentAllocatedAmt; + } + public String getAllocationStatus() + { + return allocationStatus; + } + public void setAllocationStatus(String allocationStatus) + { + this.allocationStatus = allocationStatus; + } + public BigDecimal getAllocatedAmount() { + return allocatedAmount; + } + public void setAllocatedAmount(BigDecimal allocatedAmount) { + this.allocatedAmount = allocatedAmount; + } + + public Integer[] getPaymentIds() { + return paymentIds; + } + public void setPaymentIds(Integer[] paymentIds) { + this.paymentIds = paymentIds; + } + public String getTrxDate() { + return trxDate; + } + public void setTrxDate(String trxDate) { + this.trxDate = trxDate; + } + public BigDecimal getTaxedAmt() { + return taxedAmt; + } + public void setTaxedAmt(BigDecimal taxedAmt) { + this.taxedAmt = taxedAmt; + } + public Integer getPaymentId() { + return paymentId; + } + public void setPaymentId(Integer paymentId) { + this.paymentId = paymentId; + } + public String getPaymentNo() { + return paymentNo; + } + public void setPaymentNo(String paymentNo) { + this.paymentNo = paymentNo; + } + + + public String getTenderType() { + return tenderType; + } + public void setTenderType(String tenderType) { + this.tenderType = tenderType; + } + public String getForward() { + return forward; + } + public void setForward(String forward) { + this.forward = forward; + } + public String getPartnerName() { + return partnerName; + } + public void setPartnerName(String partnerName) { + this.partnerName = partnerName; + } + public String getPaymentTermName() { + return paymentTermName; + } + public void setPaymentTermName(String paymentTermName) { + this.paymentTermName = paymentTermName; + } + public String getInvoiceNo() { + return invoiceNo; + } + public void setInvoiceNo(String invoiceNo) { + this.invoiceNo = invoiceNo; + } + public String getChequeNo() { + return chequeNo; + } + public void setChequeNo(String chequeNo) { + this.chequeNo = chequeNo; + } + public String getCreditCardNumber() { + return creditCardNumber; + } + public void setCreditCardNumber(String creditCardNumber) { + this.creditCardNumber = creditCardNumber; + } + public String getInvoiceDate() { + return invoiceDate; + } + public void setInvoiceDate(String invoiceDate) { + this.invoiceDate = invoiceDate; + } + public Integer getBpartnerId() { + return bpartnerId; + } + public void setBpartnerId(Integer bpartnerId) { + this.bpartnerId = bpartnerId; + } + public Integer getPaymentTermId() { + return paymentTermId; + } + public Integer getCurrencyId() { + return currencyId; + } + public void setCurrencyId(Integer currencyId) { + this.currencyId = currencyId; + } + + public Integer getDaysDue() { + return daysDue; + } + public void setDaysDue(Integer daysDue) { + this.daysDue = daysDue; + } + public BigDecimal getDiscountAmt() { + return discountAmt; + } + public void setDiscountAmt(BigDecimal discountAmt) { + this.discountAmt = discountAmt; + } + public String getDiscountDate() { + return discountDate; + } + public void setDiscountDate(String discountDate) { + this.discountDate = discountDate; + } + public String getDocumentNo() { + return documentNo; + } + public void setDocumentNo(String documentNo) { + this.documentNo = documentNo; + } + public Timestamp getDueDate() { + return dueDate; + } + public void setDueDate(Timestamp dueDate) { + this.dueDate = dueDate; + } + + public Integer getInvoiceId() { + return invoiceId; + } + public void setInvoiceId(Integer invoiceId) { + this.invoiceId = invoiceId; + } + public Integer getInvoiceScheduleId() { + return invoiceScheduleId; + } + public void setInvoiceScheduleId(Integer invoiceScheduleId) { + this.invoiceScheduleId = invoiceScheduleId; + } + public Boolean getIsSoTrx() { + return isSoTrx; + } + public void setIsSoTrx(Boolean isSoTrx) { + this.isSoTrx = isSoTrx; + } + public Integer getNetDays() { + return netDays; + } + public void setNetDays(Integer netDays) { + this.netDays = netDays; + } + public BigDecimal getOpenAmt() { + return openAmt; + } + public void setOpenAmt(BigDecimal openAmt) { + this.openAmt = openAmt; + } + public Integer getOrderId() { + return orderId; + } + public void setOrderId(Integer orderId) { + this.orderId = orderId; + } + public BigDecimal getPaidAmt() { + return paidAmt; + } + public void setPaidAmt(BigDecimal paidAmt) { + this.paidAmt = paidAmt; + } + public Integer getPaumentTermId() { + return paymentTermId; + } + public void setPaymentTermId(Integer paymentTermId) { + this.paymentTermId = paymentTermId; + } + public BigDecimal getInvoiceGrandTotal() { + return invoiceGrandTotal; + } + public void setInvoiceGrandTotal(BigDecimal invoiceGrandTotal) { + this.invoiceGrandTotal = invoiceGrandTotal; + } + + public BigDecimal getOverUnderPayment() { + return overUnderPayment; + } + public void setOverUnderPayment(BigDecimal overUnderPayment) { + this.overUnderPayment = overUnderPayment; + } + + public BigDecimal getPaymentAmt() { + return paymentAmt; + } + public void setPaymentAmt(BigDecimal paymentAmt) { + this.paymentAmt = paymentAmt; + } + public String getTrxType() { + return trxType; + } + public void setTrxType(String trxType) { + this.trxType = trxType; + } + public BigDecimal getWriteOffAmt() { + return writeOffAmt; + } + public void setWriteOffAmt(BigDecimal writeOffAmt) { + this.writeOffAmt = writeOffAmt; + } + public String getCurrencySymbole() { + return currencySymbole; + } + public void setCurrencySymbole(String currencySymbole) { + this.currencySymbole = currencySymbole; + } + public Integer[] getInvoiceIds() { + return invoiceIds; + } + public void setInvoiceIds(Integer[] invoiceIds) { + this.invoiceIds = invoiceIds; + } + +} diff --git a/posterita/posterita/src/main/org/posterita/beans/OrderBean.java b/posterita/posterita/src/main/org/posterita/beans/OrderBean.java new file mode 100644 index 0000000000..3ea7d69e09 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/OrderBean.java @@ -0,0 +1,172 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + **/ + +/** + @author ashley + */ + +package org.posterita.beans; + +import java.math.BigDecimal; + +public class OrderBean +{ + private String orderType; + private String docStatus; + private String paymentRule; + private Integer orderId; + private Integer paymentTermId; + private Integer bpartnerId; + private Integer salesRepId; + private Integer priceListId; + private Integer warehouseId; + + //payment details + private BigDecimal amountTendered; + private BigDecimal amountRefunded; + private String cardType; + private String cardNo; + private String chequeNo; + private BigDecimal cashAmt; + private BigDecimal chequeAmt; + private BigDecimal cardAmt; + + private BigDecimal writeOffAmt; + private BigDecimal discountAmt; + + //getters and setters + + public String getOrderType() { + return orderType; + } + public void setOrderType(String orderType) { + this.orderType = orderType; + } + public String getDocStatus() { + return docStatus; + } + public void setDocStatus(String docStatus) { + this.docStatus = docStatus; + } + public String getPaymentRule() { + return paymentRule; + } + public void setPaymentRule(String paymentRule) { + this.paymentRule = paymentRule; + } + public Integer getOrderId() { + return orderId; + } + public void setOrderId(Integer orderId) { + this.orderId = orderId; + } + public Integer getPaymentTermId() { + return paymentTermId; + } + public void setPaymentTermId(Integer paymentTermId) { + this.paymentTermId = paymentTermId; + } + public Integer getBpartnerId() { + return bpartnerId; + } + public void setBpartnerId(Integer bpartnerId) { + this.bpartnerId = bpartnerId; + } + public Integer getSalesRepId() { + return salesRepId; + } + public void setSalesRepId(Integer salesRepId) { + this.salesRepId = salesRepId; + } + public Integer getPriceListId() { + return priceListId; + } + public void setPriceListId(Integer priceListId) { + this.priceListId = priceListId; + } + public Integer getWarehouseId() { + return warehouseId; + } + public void setWarehouseId(Integer warehouseId) { + this.warehouseId = warehouseId; + } + public BigDecimal getAmountTendered() { + return amountTendered; + } + public void setAmountTendered(BigDecimal amountTendered) { + this.amountTendered = amountTendered; + } + public BigDecimal getAmountRefunded() { + return amountRefunded; + } + public void setAmountRefunded(BigDecimal amountRefunded) { + this.amountRefunded = amountRefunded; + } + public String getCardType() { + return cardType; + } + public void setCardType(String cardType) { + this.cardType = cardType; + } + public String getCardNo() { + return cardNo; + } + public void setCardNo(String cardNo) { + this.cardNo = cardNo; + } + public String getChequeNo() { + return chequeNo; + } + public void setChequeNo(String chequeNo) { + this.chequeNo = chequeNo; + } + public BigDecimal getCashAmt() { + return cashAmt; + } + public void setCashAmt(BigDecimal cashAmt) { + this.cashAmt = cashAmt; + } + public BigDecimal getChequeAmt() { + return chequeAmt; + } + public void setChequeAmt(BigDecimal chequeAmt) { + this.chequeAmt = chequeAmt; + } + public BigDecimal getCardAmt() { + return cardAmt; + } + public void setCardAmt(BigDecimal cardAmt) { + this.cardAmt = cardAmt; + } + public BigDecimal getWriteOffAmt() { + return writeOffAmt; + } + public void setWriteOffAmt(BigDecimal writeOffAmt) { + this.writeOffAmt = writeOffAmt; + } + public BigDecimal getDiscountAmt() { + return discountAmt; + } + public void setDiscountAmt(BigDecimal discountAmt) { + this.discountAmt = discountAmt; + } + +} diff --git a/posterita/posterita/src/main/org/posterita/beans/OrderHistoryBean.java b/posterita/posterita/src/main/org/posterita/beans/OrderHistoryBean.java new file mode 100644 index 0000000000..e67ff4799d --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/OrderHistoryBean.java @@ -0,0 +1,339 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 04-Aug-2005 by alok + * + */ +package org.posterita.beans; + +import java.math.BigDecimal; +import java.sql.Timestamp; +import java.util.ArrayList; + + +public class OrderHistoryBean extends FilterBean +{ + public ArrayList orderHistoryBean; + private ArrayList invoiceHistoryList; + private ArrayList orderHistoryList; + + protected Integer refOrderId; + private FilterBean filterBean; + private String serno; + + + + + + public Integer getDocumentId() { + return documentId; + } + public void setDocumentId(Integer documentId) { + this.documentId = documentId; + } + public Integer[] getOrderIds() { + return orderIds; + } + public void setOrderIds(Integer[] orderIds) { + this.orderIds = orderIds; + } + public String getSerno() { + return serno; + } + + public void setSerno(String serno) { + this.serno = serno; + } + + public Integer getRefOrderId() + { + return refOrderId; + } + + public void setRefOrderId(Integer refOrderId) + { + this.refOrderId = refOrderId; + } + + public Integer getRefToQuote() + { + return refToQuote; + } + public void setRefToQuote(Integer refToQuote) + { + this.refToQuote = refToQuote; + } + public String getOrderType() + { + return orderType; + } + public void setOrderType(String orderType) + { + this.orderType = orderType; + } + public ArrayList getOrderHistoryBean() + { + return orderHistoryBean; + } + + public void setOrderHistoryBean(ArrayList orderHistoryBean) + { + this.orderHistoryBean = orderHistoryBean; + } + + public Integer getInOutId() + { + return inOutId; + } + + public void setInOutId(Integer inOutId) + { + this.inOutId = inOutId; + } + + public Integer getInvoiceId() + { + return invoiceId; + } + + public void setInvoiceId(Integer invoiceId) + { + this.invoiceId = invoiceId; + } + + public Integer getPaymentId() + { + return paymentId; + } + + public void setPaymentId(Integer paymentId) + { + this.paymentId = paymentId; + } + + public String getPartnerName() + { + return partnerName; + } + + public void setPartnerName(String partnerName) + { + this.partnerName = partnerName; + } + public Integer getBpartnerId() + { + return bpartnerId; + } + public void setBpartnerId(Integer bpartnerId) + { + this.bpartnerId = bpartnerId; + } + + public Timestamp getDateOrdered() + { + return dateOrdered; + } + public void setDateOrdered(Timestamp dateOrdered) + { + this.dateOrdered = dateOrdered; + } + public String getDatePromised() + { + return datePromised; + } + public void setDatePromised(String datePromised) + { + this.datePromised = datePromised; + } + public BigDecimal getOrderGrandTotal() + { + return orderGrandTotal; + } + public void setOrderGrandTotal(BigDecimal orderGrandTotal) + { + this.orderGrandTotal = orderGrandTotal; + } + public String getIsApproved() + { + return isApproved; + } + public void setIsApproved(String isApproved) + { + this.isApproved = isApproved; + } + public String getIsDelivered() + { + return isDelivered; + } + public void setIsDelivered(String isDelivered) + { + this.isDelivered = isDelivered; + } + public String getIsInvoiced() + { + return isInvoiced; + } + public void setIsInvoiced(String isInvoiced) + { + this.isInvoiced = isInvoiced; + } + public Boolean getIsSotrx() + { + return isSoTrx; + } + public void setIsSotrx(Boolean isSotrx) + { + this.isSoTrx = isSotrx; + } + public Integer getOrderId() + { + return orderId; + } + public void setOrderId(Integer orderId) + { + this.orderId = orderId; + } + public String getPoReference() + { + return poReference; + } + public void setPoReference(String poReference) + { + this.poReference = poReference; + } + + public Boolean getIsSoTrx() + { + return isSoTrx; + } + + public void setIsSoTrx(Boolean isSoTrx) + { + this.isSoTrx = isSoTrx; + } + + public ArrayList getInvoiceHistoryList() + { + return invoiceHistoryList; + } + + public void setInvoiceHistoryList(ArrayList list) + { + this.invoiceHistoryList = list; + } + + public String getSotrxFlag() + { + return sotrxFlag; + } + + public void setSotrxFlag(String sotrxFlag) + { + this.sotrxFlag = sotrxFlag; + } + + public FilterBean getFilterBean() + { + return filterBean; + } + + public void setFilterBean(FilterBean filterBean) + { + this.filterBean = filterBean; + } + + public String getBpName() + { + return bpName; + } + + public void setBpName(String bpName) + { + this.bpName = bpName; + } + + public String getDocStatus() + { + return docStatus; + } + + public void setDocStatus(String docStatus) + { + this.docStatus = docStatus; + } + + public ArrayList getOrderHistoryList() + { + return orderHistoryList; + } + + public void setOrderHistoryList(ArrayList orderHistoryList) + { + this.orderHistoryList = orderHistoryList; + } + + public String getCompiereDocStatus() + { + return compiereDocStatus; + } + + public void setCompiereDocStatus(String compiereDocStatus) + { + this.compiereDocStatus = compiereDocStatus; + } + + public Integer getOrderlineCount() + { + return orderlineCount; + } + + public void setOrderlineCount(Integer orderlineCount) + { + this.orderlineCount = orderlineCount; + } + + public Integer getOrderlineInvoicedCount() + { + return orderlineInvoicedCount; + } + + public void setOrderlineInvoicedCount(Integer orderlineInvoicedCount) + { + this.orderlineInvoicedCount = orderlineInvoicedCount; + } + + public Integer getAttributeSetInstanceId() + { + return attributeSetInstanceId; + } + + public void setAttributeSetInstanceId(Integer attributeSetInstanceId) + { + this.attributeSetInstanceId = attributeSetInstanceId; + } + + public Timestamp getDateInvoiced() + { + return dateInvoiced; + } + + public void setDateInvoiced(Timestamp dateInvoiced) + { + this.dateInvoiced = dateInvoiced; + } +} diff --git a/posterita/posterita/src/main/org/posterita/beans/OrderInfoBean.java b/posterita/posterita/src/main/org/posterita/beans/OrderInfoBean.java new file mode 100644 index 0000000000..14c2ebd399 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/OrderInfoBean.java @@ -0,0 +1,149 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Nov 8, 2005 by praveen + * + */ +package org.posterita.beans; + +import java.sql.Timestamp; + +public class OrderInfoBean +{ + private Integer orderId; + private Integer poReference; + private Timestamp dateOrdered; + private String docStatus; + private String orderedFrom; + private String vinNumber; + private String reserved; + private String assetStatus; + private String orderBy; + private String docType; + private Integer attributeSetInstanceId; + + public Timestamp getDateOrdered() + { + return dateOrdered; + } + + public void setDateOrdered(Timestamp dateOrdered) + { + this.dateOrdered = dateOrdered; + } + + public String getDocStatus() + { + return docStatus; + } + + public void setDocStatus(String docStatus) + { + this.docStatus = docStatus; + } + + public String getOrderedFrom() + { + return orderedFrom; + } + + public void setOrderedFrom(String orderedFrom) + { + this.orderedFrom = orderedFrom; + } + + public Integer getPoReference() + { + return poReference; + } + + public void setPoReference(Integer poReference) + { + this.poReference = poReference; + } + + public Integer getOrderId() + { + return orderId; + } + + public void setOrderId(Integer orderId) + { + this.orderId = orderId; + } + + public String getAssetStatus() + { + return assetStatus; + } + + public void setAssetStatus(String assetStatus) + { + this.assetStatus = assetStatus; + } + + public String getDocType() + { + return docType; + } + + public void setDocType(String docType) + { + this.docType = docType; + } + + public String getOrderBy() + { + return orderBy; + } + + public void setOrderBy(String orderBy) + { + this.orderBy = orderBy; + } + + public String getReserved() + { + return reserved; + } + + public void setReserved(String reserved) + { + this.reserved = reserved; + } + + public String getVinNumber() + { + return vinNumber; + } + + public void setVinNumber(String vinNumber) + { + this.vinNumber = vinNumber; + } + + public Integer getAttributeSetInstanceId() + { + return attributeSetInstanceId; + } + + public void setAttributeSetInstanceId(Integer attributeSetInstanceId) + { + this.attributeSetInstanceId = attributeSetInstanceId; + } +} diff --git a/posterita/posterita/src/main/org/posterita/beans/OrderLineAttributeSetInstanceBean.java b/posterita/posterita/src/main/org/posterita/beans/OrderLineAttributeSetInstanceBean.java new file mode 100644 index 0000000000..0bea792765 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/OrderLineAttributeSetInstanceBean.java @@ -0,0 +1,47 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ +package org.posterita.beans; + + +public class OrderLineAttributeSetInstanceBean +{ + private int orderLineId; + private int attributeSetInstanceId; + + public int getOrderLineId() + { + return orderLineId; + } + + public void setOrderLineId(int orderLineId) + { + this.orderLineId = orderLineId; + } + + public int getAttributeSetInstanceId() + { + return attributeSetInstanceId; + } + + public void setAttributeSetInstanceId(int attributeSetInstanceId) + { + this.attributeSetInstanceId = attributeSetInstanceId; + } +} diff --git a/posterita/posterita/src/main/org/posterita/beans/OrderLineBean.java b/posterita/posterita/src/main/org/posterita/beans/OrderLineBean.java new file mode 100644 index 0000000000..d9edbe6f86 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/OrderLineBean.java @@ -0,0 +1,476 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 09-Aug-2005 by alok + * + */ +package org.posterita.beans; + +import java.math.BigDecimal; +import java.util.ArrayList; + +public class OrderLineBean extends DocumentBean implements Comparable +{ + public String getDescription() { + return description; + } + public void setDescription(String description) { + this.description = description; + } + public Double getTotalActualPrice() { + return totalActualPrice; + } + public void setTotalActualPrice(Double totalActualPrice) { + this.totalActualPrice = totalActualPrice; + } + public Double getPaymentByCard() { + return paymentByCard; + } + public void setPaymentByCard(Double paymentByCard) { + this.paymentByCard = paymentByCard; + } + public Double getPaymentByCash() { + return paymentByCash; + } + public void setPaymentByCash(Double paymentByCash) { + this.paymentByCash = paymentByCash; + } + public Double getPaymentByChq() { + return paymentByChq; + } + public void setPaymentByChq(Double paymentByChq) { + this.paymentByChq = paymentByChq; + } + public String[] getActualPrice() { + return actualPrice; + } + public void setActualPrice(String[] actualPrice) { + this.actualPrice = actualPrice; + } + + public String[] getDiscountPercent() { + return discountPercent; + } + public void setDiscountPercent(String[] discountPercent) { + this.discountPercent = discountPercent; + } + public String getQtyAndItem() { + return qtyAndItem; + } + public void setQtyAndItem(String qtyAndItem) { + this.qtyAndItem = qtyAndItem; + } + public String getBarCode() { + return barCode; + } + public void setBarCode(String barCode) { + this.barCode = barCode; + } + + public String getPartnerName() { + return partnerName; + } + public void setPartnerName(String partnerName) { + this.partnerName = partnerName; + } + public Integer[] getPosOrderLineIds() + { + return posOrderLineIds; + } + + public void setPosOrderLineIds(Integer[] posOrderLineIds) + { + this.posOrderLineIds = posOrderLineIds; + } + public String getChequeNo() + { + return chequeNo; + } + + public void setChequeNo(String chequeNo) + { + this.chequeNo = chequeNo; + } + + public Integer getCreditCardExpMonth() + { + return creditCardExpMonth; + } + + public void setCreditCardExpMonth(Integer creditCardExpMonth) + { + this.creditCardExpMonth = creditCardExpMonth; + } + + public Integer getCreditCardExpYear() + { + return creditCardExpYear; + } + + public void setCreditCardExpYear(Integer creditCardExpYear) + { + this.creditCardExpYear = creditCardExpYear; + } + + public String getCreditCardNumber() + { + return creditCardNumber; + } + + public void setCreditCardNumber(String creditCardNumber) + { + this.creditCardNumber = creditCardNumber; + } + + public String getCreditCardType() + { + return creditCardType; + } + + public void setCreditCardType(String creditCardType) + { + this.creditCardType = creditCardType; + } + public Integer getOrderId() + { + return orderId; + } + + public void setOrderId(Integer orderId) + { + this.orderId = orderId; + } + public String getSurname() { + return surname; + } + public void setSurname(String surname) { + this.surname = surname; + } + + public Integer getBpartnerId() + { + return bpartnerId; + } + + public void setBpartnerId(Integer bpartnerId) + { + this.bpartnerId = bpartnerId; + } + public Boolean getIsQtyReserved() + { + return isQtyReserved; + } + + public void setIsQtyReserved(Boolean isQtyReserved) + { + this.isQtyReserved = isQtyReserved; + } + public String getEngineNo() { + return engineNo; + } + public void setEngineNo(String engineNo) { + this.engineNo = engineNo; + } + public BigDecimal getQuantity() + { + return quantity; + } + + public void setQuantity(BigDecimal quantity) + { + this.quantity = quantity; + } + + public Integer getProductId() + { + return productId; + } + + public void setProductId(Integer productId) + { + this.productId = productId; + } + + + public Integer[] getCheckBox() + { + return checkBox; + } + public void setCheckBox(Integer [] checkBox) + { + this.checkBox = checkBox; + } + + public Integer getAttributeSetInstanceId() + { + return attributeSetInstanceId; + } + + public void setAttributeSetInstanceId(Integer attributeSetInstanceId) + { + this.attributeSetInstanceId = attributeSetInstanceId; + } + + public ArrayList getOrderLineList() + { + return orderLineList; + } + public void setOrderLineList(ArrayList orderLineList) + { + this.orderLineList = orderLineList; + } + + public Integer getOrderLineId() + { + return orderLineId; + } + + public void setOrderLineId(Integer orderLineId) + { + this.orderLineId = orderLineId; + } + + public Integer getOrgId() + { + return orgId; + } + + public void setOrgId(Integer orgId) + { + this.orgId = orgId; + } + + public Integer getAllocationId() + { + return allocationId; + } + + public void setAllocationId(Integer allocationId) + { + this.allocationId = allocationId; + } + + public boolean equals(Object obj) + { + OrderLineBean target = (OrderLineBean) obj; + + if ( obj == null) + return false; + + if (this.getAttributeSetInstanceId().equals(target.getAttributeSetInstanceId())) + return true; + + return false; + } + + public String getSubmit() + { + return submit; + } + + public void setSubmit(String submit) + { + this.submit = submit; + } + + + public int compareTo(Object o) + { + OrderLineBean src = (OrderLineBean) o; + + if (src.getAttributeSetInstanceId().intValue() == this.getAttributeSetInstanceId().intValue()) + return 0; + + + return -1; + } + + + + + + + public BigDecimal getAmountGiven() + { + return amountGiven; + } + + public void setAmountGiven(BigDecimal amountGiven) + { + this.amountGiven = amountGiven; + } + + public BigDecimal getAmountRefunded() + { + return amountRefunded; + } + + public void setAmountRefunded(BigDecimal amountRefunded) + { + this.amountRefunded = amountRefunded; + } + public String getTrxType() + { + return trxType; + } + + public void setTrxType(String trxType) + { + this.trxType = trxType; + } + + public BigDecimal getTransferAmount() { + return transferAmount; + } + public void setTransferAmount(BigDecimal transferAmount) { + this.transferAmount = transferAmount; + } + + public Integer getCashBookIds() { + return cashBookIds; + } + public void setCashBookIds(Integer cashBookIds) { + this.cashBookIds = cashBookIds; + } + public String getIsSales() { + return isSales; + } + public void setIsSales(String isSales) { + this.isSales = isSales; + } + public String getIfAdd() { + return ifAdd; + } + public void setIfAdd(String ifAdd) { + this.ifAdd = ifAdd; + } + + public String getVendorName() { + return vendorName; + } + public void setVendorName(String vendorName) { + this.vendorName = vendorName; + } + + public String getDocumentNo() { + return documentNo; + } + public void setDocumentNo(String documentNo) { + this.documentNo = documentNo; + } + + public BigDecimal getUserDiscount() { + return userDiscount; + } + public void setUserDiscount(BigDecimal userDiscount) { + this.userDiscount = userDiscount; + } + + public Integer getPaymentTermId() { + return paymentTermId; + } + public void setPaymentTermId(Integer paymentTermId) { + this.paymentTermId = paymentTermId; + } + + public String getPaymentTermName() { + return paymentTermName; + } + public void setPaymentTermName(String paymentTermName) { + this.paymentTermName = paymentTermName; + } + public String getToBeShipped() { + return toBeShipped; + } + public void setToBeShipped(String toBeShipped) { + this.toBeShipped = toBeShipped; + } + + public Boolean getOpenDrawer() { + return openDrawer; + } + public void setOpenDrawer(Boolean openDrawer) { + this.openDrawer = openDrawer; + } + + public void setUom(String uom) + { + this.uom = uom; + } + + public String getUom() + { + return this.uom; + } + public Integer getPriceListId() { + return priceListId; + } + public void setPriceListId(Integer priceListId) { + this.priceListId = priceListId; + } + + public BigDecimal getUnitPurchasePrice() + { + return unitPurchasePrice; + } + + public void setUnitPurchasePrice(BigDecimal unitPurchasePrice) + { + this.unitPurchasePrice = unitPurchasePrice; + } + + public BigDecimal getGrossProfit() + { + return grossProfit; + } + + public void setGrossProfit(BigDecimal grossProfit) + { + this.grossProfit = grossProfit; + } + + public BigDecimal getTotalGrossProfit() + { + return totalGrossProfit; + } + + public void setTotalGrossProfit(BigDecimal totalGrossProfit) + { + this.totalGrossProfit = totalGrossProfit; + } + + protected String paymentRule; + + public String getPaymentRule() { + return paymentRule; + } + + public void setPaymentRule(String paymentRule) { + this.paymentRule = paymentRule; + } + public Integer getRoleId() + { + return roleId; + } + public void setRoleId(Integer roleId) + { + this.roleId = roleId; + } + + +} diff --git a/posterita/posterita/src/main/org/posterita/beans/OrderLineImporterBean.java b/posterita/posterita/src/main/org/posterita/beans/OrderLineImporterBean.java new file mode 100644 index 0000000000..c7643bab34 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/OrderLineImporterBean.java @@ -0,0 +1,28 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +* Created on Nov 4, 2005 by ashley +* +*/ + +package org.posterita.beans; + +public class OrderLineImporterBean extends UDIBean +{ + +} diff --git a/posterita/posterita/src/main/org/posterita/beans/OrgBean.java b/posterita/posterita/src/main/org/posterita/beans/OrgBean.java new file mode 100644 index 0000000000..85002ae5f7 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/OrgBean.java @@ -0,0 +1,170 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +package org.posterita.beans; + +public class OrgBean extends UDIBean +{ + public String getDescription() + { + return description; + } + + public void setDescription(String description) + { + this.description = description; + } + + public String getAddress2() { + return address2; + } + + public void setAddress2(String address2) { + this.address2 = address2; + } + + public Integer getOrgId() + { + return orgId; + } + + public void setOrgId(Integer orgId) + { + this.orgId = orgId; + } + public String getAddress1() + { + return address1; + } + public void setAddress1(String address1) + { + this.address1 = address1; + } + + public String getCity() + { + return city; + } + + public void setCity(String city) + { + this.city = city; + } + + public String getOrgName() + { + return orgName; + } + + public void setOrgName(String orgName) + { + this.orgName = orgName; + } + + public String getPostalAddress() + { + return postalAddress; + } + + public void setPostalAddress(String postalAddress1) + { + this.postalAddress = postalAddress1; + } + + public Integer getRegionId() + { + return regionId; + } + + public void setRegionId(Integer regionId) + { + this.regionId = regionId; + } + + public String getRegion() + { + return region; + } + + public void setRegion(String region) + { + this.region = region; + } + + + public String getFax() + { + return fax; + } + + public void setFax(String fax) + { + this.fax = fax; + } + + public String getPhone() + { + return phone; + } + + public void setPhone(String phone) + { + this.phone = phone; + } + + public Boolean getIsActive() + { + return isActive; + } + + public void setIsActive(Boolean isActive) + { + this.isActive = isActive; + } + + public String getActive() + { + return active; + } + + public void setActive(String active) + { + this.active = active; + } + + public void setCountryId(Integer countryId) + { + this.countryId = countryId; + } + + public Integer getCountryId() + { + return this.countryId; + } + + public String getReceiptFooterMsg() + { + return receiptFooterMsg; + } + + public void setReceiptFooterMsg(String receiptFooterMsg) + { + this.receiptFooterMsg = receiptFooterMsg; + } +} diff --git a/posterita/posterita/src/main/org/posterita/beans/OrgUsersBean.java b/posterita/posterita/src/main/org/posterita/beans/OrgUsersBean.java new file mode 100644 index 0000000000..073d4e3375 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/OrgUsersBean.java @@ -0,0 +1,60 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Aug 2, 2005 by din + */ + +package org.posterita.beans; + +import java.util.Vector; + + + + +public class OrgUsersBean extends UDIBean +{ + + + public String getOrgName() + { + return orgName; + } + + public void setOrgName(String orgName) + { + this.orgName = orgName; + } + + public Integer getOrgId() + { + return orgId; + } + public void setOrgId(Integer orgId) + { + this.orgId = orgId; + } + + public Vector getOrgUsers() + { + return orgUsers; + } + public void setOrgUsers(Vector orgUsers) + { + this.orgUsers = orgUsers; + } +} diff --git a/posterita/posterita/src/main/org/posterita/beans/POSBean.java b/posterita/posterita/src/main/org/posterita/beans/POSBean.java new file mode 100644 index 0000000000..2db5f71783 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/POSBean.java @@ -0,0 +1,234 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Created on 17-Mar-2006 + */ + + +package org.posterita.beans; + +import java.math.BigDecimal; +import java.sql.Timestamp; + + +public class POSBean extends OrderLineBean +{ + public Timestamp getDateCreated() { + return dateCreated; + } + public void setDateCreated(Timestamp dateCreated) { + this.dateCreated = dateCreated; + } + public String getCashJournalDisc() { + return cashJournalDisc; + } + public void setCashJournalDisc(String cashJournalDisc) { + this.cashJournalDisc = cashJournalDisc; + } + public Integer getCashJournalId() { + return cashJournalId; + } + public void setCashJournalId(Integer cashJournalId) { + this.cashJournalId = cashJournalId; + } + public String getCashJournalName() { + return cashJournalName; + } + public void setCashJournalName(String cashJournalName) { + this.cashJournalName = cashJournalName; + } + public Timestamp getDateAcct() { + return dateAcct; + } + public void setDateAcct(Timestamp dateAcct) { + this.dateAcct = dateAcct; + } + public String getDocStatus() { + return docStatus; + } + public void setDocStatus(String docStatus) { + this.docStatus = docStatus; + } + public Integer getGrandTotal() { + return grandTotal; + } + public void setGrandTotal(Integer grandTotal) { + this.grandTotal = grandTotal; + } + public String getPaymentRule() { + return paymentRule; + } + public void setPaymentRule(String paymentRule) { + this.paymentRule = paymentRule; + } + public Integer getPriceListId() { + return priceListId; + } + public void setPriceListId(Integer priceListId) { + this.priceListId = priceListId; + } + public String getPriceListName() { + return priceListName; + } + public void setPriceListName(String priceListName) { + this.priceListName = priceListName; + } + public String getWarehouseName() { + return warehouseName; + } + public void setWarehouseName(String warehouseName) { + this.warehouseName = warehouseName; + } + public String getPosDesc() + { + return posDesc; + } + public void setPosDesc(String posDesc) + { + this.posDesc = posDesc; + } + public Integer getPosId() + { + return posId; + } + public void setPosId(Integer posId) + { + this.posId = posId; + } + public String getPosName() + { + return posName; + } + public void setPosName(String posName) + { + this.posName = posName; + } + public String getSaleRepName() + { + return saleRepName; + } + public void setSaleRepName(String saleRepName) + { + this.saleRepName = saleRepName; + } + public Integer getSalesRepId() + { + return salesRepId; + } + public void setSalesRepId(Integer salesRepId) + { + this.salesRepId = salesRepId; + } + public Integer getWarehouseId() + { + return warehouseId; + } + public void setWarehouseId(Integer warehouseId) + { + this.warehouseId = warehouseId; + } + public Integer getCashBookId() + { + return cashBookId; + } + + public void setCashBookId(Integer cashBookId) + { + this.cashBookId = cashBookId; + } + + public String getCashBookName() + { + return cashBookName; + } + + public void setCashBookName(String cashBookName) + { + this.cashBookName = cashBookName; + } + public String getTrxType() + { + return trxType; + } + + + public void setTrxType(String trxType) + { + this.trxType = trxType; + } + public BigDecimal getAmount() + { + return amount; + } + + public void setAmount(BigDecimal amount) { + this.amount = amount; + } + public String getDescription() + { + return description; + } + + public void setDescription(String description) + { + this.description = description; + } + public BigDecimal getBeginingBalance() + { + return beginingBalance; + } + + public void setBeginingBalance(BigDecimal beginingBalance) + { + this.beginingBalance = beginingBalance; + } + + public BigDecimal getEndingBalance() + { + return endingBalance; + } + + public void setEndingBalance(BigDecimal endingBalance) + { + this.endingBalance = endingBalance; + } + + public BigDecimal getStatementDifference() + { + return statementDifference; + } + + public void setStatementDifference(BigDecimal statementDifference) + { + this.statementDifference = statementDifference; + } + + public String toString() + { + StringBuffer buffer = new StringBuffer(); + buffer.append("\n POS NAME= "+ getPosName()); + buffer.append("\n PAYMENT RULE = " + getPaymentRule()); + buffer.append("\n TOTAL = "+getGrandTotal()); + buffer.append("\n The Begining Balance = "+getBeginingBalance()); + buffer.append("\n The Ending Balance = "+getEndingBalance()); + + return buffer.toString(); + + } +} diff --git a/posterita/posterita/src/main/org/posterita/beans/POSDescriptionBean.java b/posterita/posterita/src/main/org/posterita/beans/POSDescriptionBean.java new file mode 100644 index 0000000000..adff505990 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/POSDescriptionBean.java @@ -0,0 +1,55 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Created on May 4, 2006 + */ + + +package org.posterita.beans; + + +public class POSDescriptionBean extends UDIBean +{ + + + public String getPosName() { + return posName; + } + public void setPosName(String posName) { + this.posName = posName; + } + public Integer getPosId() { + return posId; + } + public void setPosId(Integer posId) { + this.posId = posId; + } + public Integer getWareHouseId() { + return wareHouseId; + } + public void setWareHouseId(Integer wareHouseId) { + this.wareHouseId = wareHouseId; + } + public String getWarehouseName() { + return warehouseName; + } + public void setWarehouseName(String warehouseName) { + this.warehouseName = warehouseName; + } +} diff --git a/posterita/posterita/src/main/org/posterita/beans/POSHelpBean.java b/posterita/posterita/src/main/org/posterita/beans/POSHelpBean.java new file mode 100644 index 0000000000..95f3c7a22d --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/POSHelpBean.java @@ -0,0 +1,51 @@ +/** + * + * Copyright (c) 2008 Posterita. All Rights Reserved. + * + * This software is the confidential and proprietary information of + * Posterita. ("Confidential Information"). You shall not + * disclose such Confidential Information and shall use it only in + * accordance with the terms of the license agreement you entered into + * with Posterita. + * + * POSTERITA MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE + * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT + * NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR + * A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. TAMAK ICT SHALL NOT + * BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, + * MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. + * + * 6 Feb 2008 18:03:33 by shameem + * + */ + +package org.posterita.beans; + +public class POSHelpBean extends UDIBean +{ + public String getSubject() { + return subject; + } + public void setSubject(String subject) { + this.subject = subject; + } + public String getFromAddress() { + return fromAddress; + } + public void setFromAddress(String fromAddress) { + this.fromAddress = fromAddress; + } + public String getToAddresses() { + return toAddresses; + } + public void setToAddresses(String toAddresses) { + this.toAddresses = toAddresses; + } + public String getTextMessage() { + return textMessage; + } + public void setTextMessage(String textMessage) { + this.textMessage = textMessage; + } + +} diff --git a/posterita/posterita/src/main/org/posterita/beans/POSHistoryBean.java b/posterita/posterita/src/main/org/posterita/beans/POSHistoryBean.java new file mode 100644 index 0000000000..3727a209a5 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/POSHistoryBean.java @@ -0,0 +1,214 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on May 15, 2006 + */ + + +package org.posterita.beans; + +import java.math.BigDecimal; +import java.sql.Timestamp; + + +public class POSHistoryBean extends UDIBean +{ + public Boolean isCustomer; + private Integer invoiceRefNo; + private String invoiceDocumentNo; + private BigDecimal amountPaid; + + public BigDecimal getGrossProfit() + { + return grossProfit; + } + public void setGrossProfit(BigDecimal grossProfit) + { + this.grossProfit = grossProfit; + } + public String getHistoryType() + { + return historyType; + } + public void setHistoryType(String historyType) + { + this.historyType = historyType; + } + public Integer getBpartnerId() + { + return bpartnerId; + } + public void setBpartnerId(Integer bpartnerId) + { + this.bpartnerId = bpartnerId; + } + public String getPaymentRule() { + return paymentRule; + } + public void setPaymentRule(String paymentRule) { + this.paymentRule = paymentRule; + } + public String getOrderType() { + return orderType; + } + public void setOrderType(String orderType) { + this.orderType = orderType; + } + public Integer getMonth() { + return month; + } + public void setMonth(Integer month) { + this.month = month; + } + public Integer getYear() { + return year; + } + public void setYear(Integer year) { + this.year = year; + } + public Timestamp getDateAcct() { + return dateAcct; + } + public void setDateAcct(Timestamp dateAcct) { + this.dateAcct = dateAcct; + } + public String getDocumentNo() { + return documentNo; + } + public void setDocumentNo(String documentNo) { + this.documentNo = documentNo; + } + public BigDecimal getOrderGrandTotal() { + return orderGrandTotal; + } + public void setOrderGrandTotal(BigDecimal orderGrandTotal) { + this.orderGrandTotal = orderGrandTotal; + } + public Integer getInvoiceId() { + return invoiceId; + } + public void setInvoiceId(Integer invoiceId) { + this.invoiceId = invoiceId; + } + public Integer getOrderId() { + return orderId; + } + public void setOrderId(Integer orderId) { + this.orderId = orderId; + } + public String getPartnerName() { + return partnerName; + } + public void setPartnerName(String partnerName) { + this.partnerName = partnerName; + } + public String getDocStatus() + { + return docStatus; + } + public void setDocStatus(String docStatus) + { + this.docStatus = docStatus; + } + public Boolean getIsCustomer() + { + return isCustomer; + } + public void setIsCustomer(Boolean isCustomer) + { + this.isCustomer = isCustomer; + } + + public Integer getInvoiceRefNo() + { + return invoiceRefNo; + } + + public void setInvoiceRefNo(Integer invoiceRefNo) + { + this.invoiceRefNo = invoiceRefNo; + } + public Integer getOrgId() { + return orgId; + } + public void setOrgId(Integer orgId) { + this.orgId = orgId; + } + + /** + * @return The cashBookId + */ + public Integer getCashBookId() + { + return cashBookId; + } + + /** + * @param cashBookId The cashBookId to set + */ + public void setCashBookId(Integer cashBookId) + { + this.cashBookId = cashBookId; + } + + /** + * @return The invoiceDocumentNo + */ + public String getInvoiceDocumentNo() + { + return invoiceDocumentNo; + } + + /** + * @param invoiceDocumentNo The invoiceDocumentNo to set + */ + public void setInvoiceDocumentNo(String invoiceDocumentNo) + { + this.invoiceDocumentNo = invoiceDocumentNo; + } + + /** + * @return The amountPaid + */ + public BigDecimal getAmountPaid() + { + return amountPaid; + } + + /** + * @param amountPaid The amountPaid to set + */ + public void setAmountPaid(BigDecimal amountPaid) + { + this.amountPaid = amountPaid; + } + /** + * @return The dateOrdered + */ + public Timestamp getDateOrdered() + { + return dateOrdered; + } + /** + * @param dateOrdered The dateOrdered to set + */ + public void setDateOrdered(Timestamp dateOrdered) + { + this.dateOrdered = dateOrdered; + } +} diff --git a/posterita/posterita/src/main/org/posterita/beans/POSInfoBean.java b/posterita/posterita/src/main/org/posterita/beans/POSInfoBean.java new file mode 100644 index 0000000000..04a878b9f2 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/POSInfoBean.java @@ -0,0 +1,107 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Created on May 3, 2006 + */ + + +package org.posterita.beans; + +import java.math.BigDecimal; + + +public class POSInfoBean extends UDIBean +{ + public String getOrgName() + { + return orgName; + } + public void setOrgName(String orgName) + { + this.orgName = orgName; + } + public String getPosName() + { + return posName; + } + public void setPosName(String posName) + { + this.posName = posName; + } + + public String getPaymentRule() { + return paymentRule; + } + public void setPaymentRule(String paymentRule) { + this.paymentRule = paymentRule; + } + public BigDecimal getOrderGrandTotal() { + return orderGrandTotal; + } + public void setOrderGrandTotal(BigDecimal orderGrandTotal) { + this.orderGrandTotal = orderGrandTotal; + } + + public BigDecimal getTillGrandTotal() + { + return tillGrandTotal; + } + public void setTillGrandTotal(BigDecimal tillGrandTotal) + { + this.tillGrandTotal = tillGrandTotal; + } + public BigDecimal getCashTotal() + { + return cashTotal; + } + + public void setCashTotal(BigDecimal cashTotal) + { + this.cashTotal = cashTotal; + } + + public BigDecimal getCardTotal() + { + return cardTotal; + } + public void setCardTotal(BigDecimal cardTotal) + { + this.cardTotal = cardTotal; + } + public BigDecimal getChequeTotal() + { + return chequeTotal; + } + public void setChequeTotal(BigDecimal chequeTotal) + { + this.chequeTotal = chequeTotal; + } + public String toString() + { + StringBuffer buffer = new StringBuffer(); + buffer.append("\n POS NAME= "+ getPosName()); + buffer.append("\n PAYMENT RULE = " + getPaymentRule()); + buffer.append("\n TOTAL = "+getOrderGrandTotal()); + + + return buffer.toString(); + + } + +} diff --git a/posterita/posterita/src/main/org/posterita/beans/POSReportBean.java b/posterita/posterita/src/main/org/posterita/beans/POSReportBean.java new file mode 100644 index 0000000000..c9f2918795 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/POSReportBean.java @@ -0,0 +1,163 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Created on May 11, 2006 + */ + + +package org.posterita.beans; + +import java.math.BigDecimal; + + +public class POSReportBean extends UDIBean +{ + + + + + + + + public Integer getProductId() { + return productId; + } + public void setProductId(Integer productId) { + this.productId = productId; + } + public BigDecimal getQtyInventoryIn() { + return qtyInventoryIn; + } + public void setQtyInventoryIn(BigDecimal qtyInventoryIn) { + this.qtyInventoryIn = qtyInventoryIn; + } + public BigDecimal getQtyInventoryOut() { + return qtyInventoryOut; + } + public void setQtyInventoryOut(BigDecimal qtyInventoryOut) { + this.qtyInventoryOut = qtyInventoryOut; + } + public String getProductCategory() { + return productCategory; + } + public void setProductCategory(String productCategory) { + this.productCategory = productCategory; + } + public String getBrandName() { + return brandName; + } + public void setBrandName(String brandName) { + this.brandName = brandName; + } + public String getColourName() { + return colourName; + } + public void setColourName(String colourName) { + this.colourName = colourName; + } + public String getDesignName() { + return designName; + } + public void setDesignName(String designName) { + this.designName = designName; + } + public BigDecimal getEndingBalance() + { + return endingBalance; + } + + public void setEndingBalance(BigDecimal endingBalance) + { + this.endingBalance = endingBalance; + } + public String getModelName() { + return modelName; + } + public void setModelName(String modelName) { + this.modelName = modelName; + } + public String getPartnerName() { + return partnerName; + } + public void setPartnerName(String partnerName) { + this.partnerName = partnerName; + } + public BigDecimal getQuantity() { + return quantity; + } + public void setQuantity(BigDecimal quantity) { + this.quantity= quantity; + } + public String getSizeName() { + return sizeName; + } + public void setSizeName(String sizeName) { + this.sizeName = sizeName; + } + public BigDecimal getCloseingBalanceQty() { + return closeingBalanceQty; + } + public void setCloseingBalanceQty(BigDecimal closeingBalanceQty) { + this.closeingBalanceQty = closeingBalanceQty; + } + public String getProductName() { + return productName; + } + public void setProductName(String productName) { + this.productName = productName; + } + public BigDecimal getOpeningBalanceQty() { + return openingBalanceQty; + } + public void setOpeningBalanceQty(BigDecimal openingBalanceQty) { + this.openingBalanceQty = openingBalanceQty; + } + public BigDecimal getQtyOfGoodsReceived() { + return qtyOfGoodsReceived; + } + public void setQtyOfGoodsReceived(BigDecimal qtyOfGoodsReceived) { + this.qtyOfGoodsReceived = qtyOfGoodsReceived; + } + public BigDecimal getQtyOfGoodsReturned() { + return qtyOfGoodsReturned; + } + public void setQtyOfGoodsReturned(BigDecimal qtyOfGoodsReturned) { + this.qtyOfGoodsReturned = qtyOfGoodsReturned; + } + public BigDecimal getQtyOfGoodsSold() { + return qtyOfGoodsSold; + } + public void setQtyOfGoodsSold(BigDecimal qtyOfGoodsSold) { + this.qtyOfGoodsSold = qtyOfGoodsSold; + } + public BigDecimal getQtyReturnedByCustomer() { + return qtyReturnedByCustomer; + } + public void setQtyReturnedByCustomer(BigDecimal qtyReturnedByCustomer) { + this.qtyReturnedByCustomer = qtyReturnedByCustomer; + } + public void setUom(String uom) + { + this.uom = uom; + } + public String getUom() + { + return this.uom; + } +} diff --git a/posterita/posterita/src/main/org/posterita/beans/POSStockBean.java b/posterita/posterita/src/main/org/posterita/beans/POSStockBean.java new file mode 100644 index 0000000000..de9546a608 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/POSStockBean.java @@ -0,0 +1,154 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Created on May 8, 2006 + */ + + +package org.posterita.beans; + +import java.math.BigDecimal; +import java.util.HashMap; + + +public class POSStockBean extends UDIBean +{ + + public Integer getOrgId() + { + return orgId; + } + + public void setOrgId(Integer orgId) + { + this.orgId = orgId; + } + + public String getUom() + { + return uom; + } + + public void setUom(String uom) + { + this.uom = uom; + } + + + public String getQtyFilter() { + return qtyFilter; + } + + public void setQtyFilter(String qtyFilter) { + this.qtyFilter = qtyFilter; + } + + public Boolean getIsTextileProduct() { + return isTextileProduct; + } + + public void setIsTextileProduct(Boolean isTextileProduct) { + this.isTextileProduct = isTextileProduct; + } + + public Integer getAttributeSetInstanceId() + { + return attributeSetInstanceId; + } + + public void setAttributeSetInstanceId(Integer attributeSetInstanceId) + { + this.attributeSetInstanceId = attributeSetInstanceId; + } + + public HashMap getAttributeValuesMap() { + return attributeValuesMap; + } + public void setAttributeValuesMap(HashMap attributeValuesMap) { + this.attributeValuesMap = attributeValuesMap; + } + public Integer getProductId() { + return productId; + } + public void setProductId(Integer productId) { + this.productId = productId; + } + public String getProductName() { + return productName; + } + public void setProductName(String productName) { + this.productName = productName; + } + public BigDecimal getQuantity() { + return quantity; + } + public void setQuantity(BigDecimal quantity) { + this.quantity = quantity; + } + public String getBrandName() { + return brandName; + } + public void setBrandName(String brandName) { + this.brandName = brandName; + } + public String getColourName() { + return colourName; + } + public void setColourName(String colourName) { + this.colourName = colourName; + } + public String getDesignName() { + return designName; + } + public void setDesignName(String designName) { + this.designName = designName; + } + public String getModelName() { + return modelName; + } + public void setModelName(String modelName) { + this.modelName = modelName; + } + public String getSizeName() { + return sizeName; + } + public void setSizeName(String sizeName) { + this.sizeName = sizeName; + } + + public AttributeValuesPair getAttributeValuesPair() + { + return attributeValuesPair; + } + + public void setAttributeValuesPair(AttributeValuesPair attributeValuesPair) + { + this.attributeValuesPair = attributeValuesPair; + } + + public void setQtyOnHand(BigDecimal qtyAvailable) + { + // TODO Auto-generated method stub + + } + + + + +} diff --git a/posterita/posterita/src/main/org/posterita/beans/POSSupplierBean.java b/posterita/posterita/src/main/org/posterita/beans/POSSupplierBean.java new file mode 100644 index 0000000000..1e926e7f31 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/POSSupplierBean.java @@ -0,0 +1,43 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Created on May 8, 2006 + */ + + +package org.posterita.beans; + + +public class POSSupplierBean extends UDIBean +{ + + + public Integer getBpartnerId() { + return bpartnerId; + } + public void setBpartnerId(Integer bpartnerId) { + this.bpartnerId = bpartnerId; + } + public String getPartnerName() { + return partnerName; + } + public void setPartnerName(String partnerName) { + this.partnerName = partnerName; + } +} diff --git a/posterita/posterita/src/main/org/posterita/beans/PaymentAllocationBean.java b/posterita/posterita/src/main/org/posterita/beans/PaymentAllocationBean.java new file mode 100644 index 0000000000..b1741aee47 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/PaymentAllocationBean.java @@ -0,0 +1,156 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Oct 30, 2006 + */ + +package org.posterita.beans; + +import java.math.BigDecimal; + +public class PaymentAllocationBean extends UDIBean { + + public Integer getCreditMemoId() { + return creditMemoId; + } + + public void setCreditMemoId(Integer creditMemoId) { + this.creditMemoId = creditMemoId; + } + + public String getCreditMemoNumber() { + return creditMemoNumber; + } + + public void setCreditMemoNumber(String creditMemoNumber) { + this.creditMemoNumber = creditMemoNumber; + } + + public BigDecimal getAmount() { + return amount; + } + + public void setAmount(BigDecimal amount) { + this.amount = amount; + } + + public Integer getBpartnerId() { + return bpartnerId; + } + + public void setBpartnerId(Integer bpartnerId) { + this.bpartnerId = bpartnerId; + } + + public Integer getCashLineId() { + return cashLineId; + } + + public void setCashLineId(Integer cashLineId) { + this.cashLineId = cashLineId; + } + + public BigDecimal getDiscountAmt() { + return discountAmt; + } + + public void setDiscountAmt(BigDecimal discountAmt) { + this.discountAmt = discountAmt; + } + + public String getDocumentNo() { + return documentNo; + } + + public void setDocumentNo(String documentNo) { + this.documentNo = documentNo; + } + + public Integer getInvoiceId() { + return invoiceId; + } + + public void setInvoiceId(Integer invoiceId) { + this.invoiceId = invoiceId; + } + + public String getInvoiceNo() { + return invoiceNo; + } + + public void setInvoiceNo(String invoiceNo) { + this.invoiceNo = invoiceNo; + } + + public Integer getOrderId() { + return orderId; + } + + public void setOrderId(Integer orderId) { + this.orderId = orderId; + } + + public BigDecimal getOverUnderPayment() { + return overUnderPayment; + } + + public void setOverUnderPayment(BigDecimal overUnderPayment) { + this.overUnderPayment = overUnderPayment; + } + + public String getPartnerName() { + return partnerName; + } + + public void setPartnerName(String partnerName) { + this.partnerName = partnerName; + } + + public Integer getPaymentId() { + return paymentId; + } + + public void setPaymentId(Integer paymentId) { + this.paymentId = paymentId; + } + + public BigDecimal getWriteOffAmt() { + return writeOffAmt; + } + + public void setWriteOffAmt(BigDecimal writeOffAmt) { + this.writeOffAmt = writeOffAmt; + } + + public Boolean getIsCustomer() { + return isCustomer; + } + + public void setIsCustomer(Boolean isCustomer) { + this.isCustomer = isCustomer; + } + + public Boolean getIsVendor() { + return isVendor; + } + + public void setIsVendor(Boolean isVendor) { + this.isVendor = isVendor; + } + +} diff --git a/posterita/posterita/src/main/org/posterita/beans/PaymentBean.java b/posterita/posterita/src/main/org/posterita/beans/PaymentBean.java new file mode 100644 index 0000000000..aeb94b6e41 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/PaymentBean.java @@ -0,0 +1,117 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +package org.posterita.beans; + +import java.math.BigDecimal; + +public class PaymentBean extends PaymentHistoryBean { + private AttributeValuesPair attributeValuesPair; + private String serno; + + public Integer[] getInvoiceIds() { + return invoiceIds; + } + + public void setInvoiceIds(Integer[] invoiceIds) { + this.invoiceIds = invoiceIds; + } + + public BigDecimal[] getAllocateAmount() { + return allocateAmount; + } + + public void setAllocateAmount(BigDecimal[] allocateAmount) { + this.allocateAmount = allocateAmount; + } + + + public BigDecimal getAllocatedAmount() { + return allocatedAmount; + } + + public void setAllocatedAmount(BigDecimal allocatedAmount) { + this.allocatedAmount = allocatedAmount; + } + + public Integer getBpartnerId() { + return bpartnerId; + } + + public void setBpartnerId(Integer bpartnerId) { + this.bpartnerId = bpartnerId; + } + + public AttributeValuesPair getAttributeValuesPair() { + return attributeValuesPair; + } + + public void setAttributeValuesPair(AttributeValuesPair attributeValuesPair) { + this.attributeValuesPair = attributeValuesPair; + } + + public String getSerno() { + return serno; + } + + public void setSerno(String serno) { + this.serno = serno; + } + + public String getTrxType() { + return trxType; + } + + public void setTrxType(String trxType) { + this.trxType = trxType; + } + + public String getChequeNo() { + return chequeNo; + } + + public void setChequeNo(String chequeNo) { + this.chequeNo = chequeNo; + } + + public String getCreditCardNumber() { + return creditCardNumber; + } + + public void setCreditCardNumber(String creditCardNumber) { + this.creditCardNumber = creditCardNumber; + } + + public BigDecimal getAmount() { + return amount; + } + + public void setAmount(BigDecimal amount) { + this.amount = amount; + } + + public Boolean getIsSoTrx() { + return isSoTrx; + } + + public void setIsSoTrx(Boolean isSoTrx) { + this.isSoTrx = isSoTrx; + } + +} diff --git a/posterita/posterita/src/main/org/posterita/beans/PaymentDetailsBean.java b/posterita/posterita/src/main/org/posterita/beans/PaymentDetailsBean.java new file mode 100644 index 0000000000..6d5df4bf28 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/PaymentDetailsBean.java @@ -0,0 +1,87 @@ +/** + * + * Copyright (c) 2008 Posterita. All Rights Reserved. + * + * This software is the confidential and proprietary information of + * Posterita. ("Confidential Information"). You shall not + * disclose such Confidential Information and shall use it only in + * accordance with the terms of the license agreement you entered into + * with Posterita. + * + * POSTERITA MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE + * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT + * NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR + * A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. TAMAK ICT SHALL NOT + * BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, + * MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. + * + * May 21, 2008 1:11:53 PM by praveen + * + */ + +package org.posterita.beans; + +import java.math.BigDecimal; + +import org.compiere.util.Env; + +public class PaymentDetailsBean +{ + private BigDecimal cashAmt = Env.ZERO; + private BigDecimal cardAmt = Env.ZERO; + private BigDecimal chequeAmt = Env.ZERO; + private BigDecimal writeOffAmt = Env.ZERO; + private BigDecimal discountAmt = Env.ZERO; + private BigDecimal tenderedAmt = Env.ZERO; + private BigDecimal refundedAmt = Env.ZERO; + private BigDecimal payAmt = Env.ZERO; + + public BigDecimal getCashAmt() { + return cashAmt; + } + public void setCashAmt(BigDecimal cashAmt) { + this.cashAmt = cashAmt; + } + public BigDecimal getCardAmt() { + return cardAmt; + } + public void setCardAmt(BigDecimal cardAmt) { + this.cardAmt = cardAmt; + } + public BigDecimal getChequeAmt() { + return chequeAmt; + } + public void setChequeAmt(BigDecimal chequeAmt) { + this.chequeAmt = chequeAmt; + } + public BigDecimal getWriteOffAmt() { + return writeOffAmt; + } + public void setWriteOffAmt(BigDecimal writeOffAmt) { + this.writeOffAmt = writeOffAmt; + } + public BigDecimal getDiscountAmt() { + return discountAmt; + } + public void setDiscountAmt(BigDecimal discountAmt) { + this.discountAmt = discountAmt; + } + public BigDecimal getTenderedAmt() { + return tenderedAmt; + } + public void setTenderedAmt(BigDecimal tenderedAmt) { + this.tenderedAmt = tenderedAmt; + } + public BigDecimal getRefundedAmt() { + return refundedAmt; + } + public void setRefundedAmt(BigDecimal refundedAmt) { + this.refundedAmt = refundedAmt; + } + public BigDecimal getPayAmt() { + return payAmt; + } + public void setPayAmt(BigDecimal payAmt) { + this.payAmt = payAmt; + } +} diff --git a/posterita/posterita/src/main/org/posterita/beans/PaymentHistoryBean.java b/posterita/posterita/src/main/org/posterita/beans/PaymentHistoryBean.java new file mode 100644 index 0000000000..46c3e292ad --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/PaymentHistoryBean.java @@ -0,0 +1,101 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 05-Aug-2005 by alok + * + */ +package org.posterita.beans; + +import java.sql.Timestamp; + + +public class PaymentHistoryBean extends FilterBean +{ + private MinOutHistoryBean minoutHistoryBean; + + public MinOutHistoryBean getMinoutHistoryBean() + { + return minoutHistoryBean; + } + + public void setMinoutHistoryBean(MinOutHistoryBean bean) + { + this.minoutHistoryBean = bean; + } + + public String getCheckNo() + { + return checkNo; + } + public void setCheckNo(String checkNo) + { + this.checkNo = checkNo; + } + public Timestamp getDateTrx() + { + return dateTrx; + } + public void setDateTrx(Timestamp dateTrx) + { + this.dateTrx = dateTrx; + } + + public Integer getInvoiceId() + { + return invoiceId; + } + public void setInvoiceId(Integer invoiceId) + { + this.invoiceId = invoiceId; + } + public String getIsReceipt() + { + return isReceipt; + } + public void setIsReceipt(String isReceipt) + { + this.isReceipt = isReceipt; + } + public Integer getOrderId() + { + return orderId; + } + public void setOrderId(Integer orderId) + { + this.orderId = orderId; + } + + public Integer getPayAmt() + { + return payAmt; + } + public void setPayAmt(Integer payAmt) + { + this.payAmt = payAmt; + } + public Integer getPaymentId() + { + return paymentId; + } + public void setPaymentId(Integer paymentId) + { + this.paymentId = paymentId; + } + + +} diff --git a/posterita/posterita/src/main/org/posterita/beans/PaymentTermBean.java b/posterita/posterita/src/main/org/posterita/beans/PaymentTermBean.java new file mode 100644 index 0000000000..11932bef0f --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/PaymentTermBean.java @@ -0,0 +1,120 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Oct 31, 2006 + */ + + +package org.posterita.beans; + +import java.math.BigDecimal; + + +public class PaymentTermBean extends UDIBean +{ + + + + + + + + + public BigDecimal getDiscountAmt1() { + return discountAmt1; + } + public void setDiscountAmt1(BigDecimal discountAmt1) { + this.discountAmt1 = discountAmt1; + } + public BigDecimal getDiscountAmt2() { + return discountAmt2; + } + public void setDiscountAmt2(BigDecimal discountAmt2) { + this.discountAmt2 = discountAmt2; + } + public Integer getDiscountDay1() { + return discountDay1; + } + public void setDiscountDay1(Integer discountDay1) { + this.discountDay1 = discountDay1; + } + public Integer getDiscountDay2() { + return discountDay2; + } + public void setDiscountDay2(Integer discountDay2) { + this.discountDay2 = discountDay2; + } + public Boolean getAfterDelivery() { + return afterDelivery; + } + public void setAfterDelivery(Boolean afterDelivery) { + this.afterDelivery = afterDelivery; + } + public Integer getFiedMonthCutoff() { + return fiedMonthCutoff; + } + public void setFiedMonthCutoff(Integer fiedMonthCutoff) { + this.fiedMonthCutoff = fiedMonthCutoff; + } + public Boolean getFixedDueDate() { + return fixedDueDate; + } + public void setFixedDueDate(Boolean fixedDueDate) { + this.fixedDueDate = fixedDueDate; + } + public Integer getFixedMonthDay() { + return fixedMonthDay; + } + public void setFixedMonthDay(Integer fixedMonthDay) { + this.fixedMonthDay = fixedMonthDay; + } + public Integer getFixedMonthOffset() { + return fixedMonthOffset; + } + public void setFixedMonthOffset(Integer fixedMonthOffset) { + this.fixedMonthOffset = fixedMonthOffset; + } + public Boolean getNextBusinessday() { + return nextBusinessday; + } + public void setNextBusinessday(Boolean nextBusinessday) { + this.nextBusinessday = nextBusinessday; + } + public Integer getPaymentTermId() { + return paymentTermId; + } + public void setPaymentTermId(Integer paymentTermId) { + this.paymentTermId = paymentTermId; + } + + public String getPaymentTermName() { + return paymentTermName; + } + public void setPaymentTermName(String paymentTermName) { + this.paymentTermName = paymentTermName; + } + public Integer getNetDays() { + return netDays; + } + public void setNetDays(Integer netDays) { + this.netDays = netDays; + } + + + +} diff --git a/posterita/posterita/src/main/org/posterita/beans/PaymentTypeBean.java b/posterita/posterita/src/main/org/posterita/beans/PaymentTypeBean.java new file mode 100644 index 0000000000..9ed016c96b --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/PaymentTypeBean.java @@ -0,0 +1,47 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Oct 25, 2006 + */ + + +package org.posterita.beans; + + +public class PaymentTypeBean +{ + protected String paymentType; + + protected Integer id; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getPaymentType() { + return paymentType; + } + + public void setPaymentType(String paymentType) { + this.paymentType = paymentType; + } +} diff --git a/posterita/posterita/src/main/org/posterita/beans/PopulateHistoryBean.java b/posterita/posterita/src/main/org/posterita/beans/PopulateHistoryBean.java new file mode 100644 index 0000000000..0aec697136 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/PopulateHistoryBean.java @@ -0,0 +1,37 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 09-Aug-2005 by alok + * + */ +package org.posterita.beans; + + +public class PopulateHistoryBean extends UDIBean +{ + + protected String partnerName; + protected String DocStatus; + protected String isDelivered; + protected String isInvoiced; + protected String isPaid; + protected String isReceipt; + protected String isSotrx; + + +} diff --git a/posterita/posterita/src/main/org/posterita/beans/PriceListBean.java b/posterita/posterita/src/main/org/posterita/beans/PriceListBean.java new file mode 100644 index 0000000000..03a7e2506d --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/PriceListBean.java @@ -0,0 +1,280 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Aug 19, 2005 by praveen + * + */ +package org.posterita.beans; + +import java.math.BigDecimal; +import java.util.ArrayList; + +public class PriceListBean +{ + protected Boolean isDeleteOldRecords; + protected PriceListBean priceListBean; + protected ArrayList priceListBeanList; + protected Integer index; + protected BigDecimal stdPrice; + protected BigDecimal listPrice; + protected BigDecimal limitPrice; + protected Boolean isDefault; + protected Boolean isPresentForProduct; + protected Boolean isMandatory; + protected String orgName; + protected Boolean isSOPriceList; + protected Integer priceListVersionId; + protected Integer productId; + protected BigDecimal priceList; + protected Integer[] productIds; + protected String name; + protected Integer orgId; + protected Integer priceListId; + protected Boolean isActive; + protected Integer basePriceListId; + protected Boolean isCreatePriceList; + protected Boolean isTaxIncluded; + + public Boolean getIsTaxIncluded() + { + return isTaxIncluded; + } + + public void setIsTaxIncluded(Boolean isTaxIncluded) + { + this.isTaxIncluded = isTaxIncluded; + } + + public Boolean getIsCreatePriceList() + { + return isCreatePriceList; + } + + public void setIsCreatePriceList(Boolean isCreatePriceList) + { + this.isCreatePriceList = isCreatePriceList; + } + + public Boolean getIsDeleteOldRecords() + { + return isDeleteOldRecords; + } + + public void setIsDeleteOldRecords(Boolean isDeleteOldRecords) + { + this.isDeleteOldRecords = isDeleteOldRecords; + } + + public PriceListBean getPriceListBean() + { + return priceListBean; + } + + public void setPriceListBean(PriceListBean priceListBean) + { + this.priceListBean = priceListBean; + } + + public ArrayList getPriceListBeanList() + { + return priceListBeanList; + } + + public void setPriceListBeanList(ArrayList priceListBeanList) + { + this.priceListBeanList = priceListBeanList; + } + + public Integer getIndex() + { + return index; + } + + public void setIndex(Integer index) + { + this.index = index; + } + + public BigDecimal getStdPrice() + { + return stdPrice; + } + + public void setStdPrice(BigDecimal stdPrice) + { + this.stdPrice = stdPrice; + } + + public BigDecimal getListPrice() + { + return listPrice; + } + + public void setListPrice(BigDecimal listPrice) + { + this.listPrice = listPrice; + } + + public BigDecimal getLimitPrice() + { + return limitPrice; + } + + public void setLimitPrice(BigDecimal limitPrice) + { + this.limitPrice = limitPrice; + } + + public Boolean getIsDefault() + { + return isDefault; + } + + public void setIsDefault(Boolean isDefault) + { + this.isDefault = isDefault; + } + + public Boolean getIsPresentForProduct() + { + return isPresentForProduct; + } + + public void setIsPresentForProduct(Boolean isPresentForProduct) + { + this.isPresentForProduct = isPresentForProduct; + } + + public Boolean getIsMandatory() + { + return isMandatory; + } + + public void setIsMandatory(Boolean isMandatory) + { + this.isMandatory = isMandatory; + } + + public String getOrgName() + { + return orgName; + } + + public void setOrgName(String orgName) + { + this.orgName = orgName; + } + + public Boolean getIsSOPriceList() + { + return isSOPriceList; + } + + public void setIsSOPriceList(Boolean isSOPriceList) + { + this.isSOPriceList = isSOPriceList; + } + + public Integer getPriceListVersionId() + { + return priceListVersionId; + } + + public void setPriceListVersionId(Integer priceListVersionId) + { + this.priceListVersionId = priceListVersionId; + } + + public Integer getProductId() + { + return productId; + } + + public void setProductId(Integer productId) + { + this.productId = productId; + } + + public BigDecimal getPriceList() + { + return priceList; + } + + public void setPriceList(BigDecimal priceList) + { + this.priceList = priceList; + } + + public Integer[] getProductIds() + { + return productIds; + } + public void setProductIds(Integer[] productIds) + { + this.productIds = productIds; + } + + public String getName() + { + return name; + } + + public void setName(String name) + { + this.name = name; + } + + public Integer getOrgId() + { + return orgId; + } + + public void setOrgId(Integer orgId) + { + this.orgId = orgId; + } + + public Integer getPriceListId() + { + return priceListId; + } + + public void setPriceListId(Integer priceListId) + { + this.priceListId = priceListId; + } + + public Boolean getIsActive() { + return isActive; + } + + public void setIsActive(Boolean isActive) + { + this.isActive = isActive; + } + + public Integer getBasePriceListId() + { + return basePriceListId; + } + + public void setBasePriceListId(Integer basePriceListId) + { + this.basePriceListId = basePriceListId; + } +} diff --git a/posterita/posterita/src/main/org/posterita/beans/PrintBarcodeBean.java b/posterita/posterita/src/main/org/posterita/beans/PrintBarcodeBean.java new file mode 100644 index 0000000000..0d77237e72 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/PrintBarcodeBean.java @@ -0,0 +1,64 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * 04-Oct-2006 10:41:05 by praveen + * + */ + +package org.posterita.beans; + +public class PrintBarcodeBean +{ + private int qty; + private String title; + private String subtitle; + private String barcode; + private String price; + + public String getBarcode() { + return barcode; + } + public void setBarcode(String barcode) { + this.barcode = barcode; + } + public String getPrice() { + return price; + } + public void setPrice(String price) { + this.price = price; + } + public int getQty() { + return qty; + } + public void setQty(int qty) { + this.qty = qty; + } + public String getSubtitle() { + return subtitle; + } + public void setSubtitle(String subtitle) { + this.subtitle = subtitle; + } + public String getTitle() { + return title; + } + public void setTitle(String title) { + this.title = title; + } + +} diff --git a/posterita/posterita/src/main/org/posterita/beans/ProductAttributeBean.java b/posterita/posterita/src/main/org/posterita/beans/ProductAttributeBean.java new file mode 100644 index 0000000000..66f1ede656 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/ProductAttributeBean.java @@ -0,0 +1,141 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Jul 28, 2005 by praveen + * + */ +package org.posterita.beans; + +import java.util.ArrayList; + +public class ProductAttributeBean extends UDIBean +{ + private ArrayList attributeSets; + private ArrayList attributes; + private ArrayList attributeValues; + + public String getAttribute() + { + return attribute; + } + + public void setAttribute(String attribute) + { + this.attribute = attribute; + } + + public Integer getAttributeId() + { + return attributeId; + } + + public void setAttributeId(Integer attributeId) + { + this.attributeId = attributeId; + } + + public Integer getAttributeSetId() + { + return attributeSetId; + } + + public void setAttributeSetId(Integer attributeSetId) + { + this.attributeSetId = attributeSetId; + } + + public String getAttributeValue() + { + return attributeValue; + } + + public void setAttributeValue(String attributeValue) + { + this.attributeValue = attributeValue; + } + + public ArrayList getAttributes() + { + return attributes; + } + + public void setAttributes(ArrayList attributes) + { + this.attributes = attributes; + } + + public ArrayList getAttributeSets() + { + return attributeSets; + } + + public void setAttributeSets(ArrayList attributeSets) + { + this.attributeSets = attributeSets; + } + + public ArrayList getAttributeValues() + { + return attributeValues; + } + + public void setAttributeValues(ArrayList attributeValues) + { + this.attributeValues = attributeValues; + } + + public String getDescription() + { + return description; + } + + public void setDescription(String description) + { + this.description = description; + } + + public Integer getProductCategoryId() + { + return productCategoryId; + } + + public void setProductCategoryId(Integer productCategoryId) + { + this.productCategoryId = productCategoryId; + } + + + public Integer getAttributeValueId() { + return attributeValueId; + } + public void setAttributeValueId(Integer attributeValueId) { + this.attributeValueId = attributeValueId; + } + public Boolean getShowActiveOnly() { + return showActiveOnly; + } + public void setShowActiveOnly(Boolean showActiveOnly) { + this.showActiveOnly = showActiveOnly; + } + public Integer getUpdateAttrValueId() { + return updateAttrValueId; + } + public void setUpdateAttrValueId(Integer updateAttrValueId) { + this.updateAttrValueId = updateAttrValueId; + } +} diff --git a/posterita/posterita/src/main/org/posterita/beans/ProductAttributeValueBean.java b/posterita/posterita/src/main/org/posterita/beans/ProductAttributeValueBean.java new file mode 100644 index 0000000000..3fb1ea95db --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/ProductAttributeValueBean.java @@ -0,0 +1,69 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Aug 31, 2005 by praveen + * + */ +package org.posterita.beans; + +public class ProductAttributeValueBean extends UDIBean +{ + + protected String attrColour; + protected String attrModel; + protected String attrTrx; + protected String attrYear; + + public String getAttrColour() { + return attrColour; + } + public void setAttrColour(String attrColour) { + this.attrColour = attrColour; + } + public String getAttrModel() { + return attrModel; + } + public void setAttrModel(String attrModel) { + this.attrModel = attrModel; + } + public String getAttrTrx() { + return attrTrx; + } + public void setAttrTrx(String attrTrx) { + this.attrTrx = attrTrx; + } + public String getAttrYear() { + return attrYear; + } + public void setAttrYear(String attrYear) { + this.attrYear = attrYear; + } + public Integer getProductId() { + return productId; + } + public void setProductId(Integer productId) { + this.productId = productId; + } + public String getProductName() { + return productName; + } + public void setProductName(String productName) { + this.productName = productName; + } + +} diff --git a/posterita/posterita/src/main/org/posterita/beans/ProductBean.java b/posterita/posterita/src/main/org/posterita/beans/ProductBean.java new file mode 100644 index 0000000000..f18371ffc7 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/ProductBean.java @@ -0,0 +1,935 @@ +/* + * + * Copyright (c) 2005 UDI Ltd. All Rights Reserved. + * + * This software is the confidential and proprietary information of UDI Ltd. + * ("Confidential Information"). You shall not disclose such Confidential + * Information and shall use it only in accordance with the terms of the license + * agreement you entered into with UDI. + * + * UDI MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE + * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED + * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR + * NON-INFRINGEMENT. UDI SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY + * LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS + * DERIVATIVES. + * + */ + +package org.posterita.beans; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.HashMap; + +import org.apache.struts.upload.FormFile; +import org.compiere.util.Env; + +public class ProductBean extends UDIBean implements Comparable +{ + + protected Integer attributeSetId; + protected Integer mAttrSetInstanceId; + protected Boolean isEditable; + protected Boolean isTaxIncluded; + private String productName; + private BigDecimal qtyOnHand = Env.ZERO; + private BigDecimal qtyReserved = Env.ZERO; + private BigDecimal qtyOrdered = Env.ZERO; + private BigDecimal qtyToMove; + private Integer productId; + private BigDecimal priceList; + private BigDecimal priceLimit; + private BigDecimal priceStandard; + private Integer orgId; + + //this is the attributeSetInstance corresponding to the serial number + private Integer sernoAttributeSetInstance; + + //attributeSetInstance for model/colour/transmission/year + private Integer attributeSetInstanceId; + + private Integer priceListVersionId; + + private Integer locatorId; + + private String regionName; + + private ArrayList orderLineList; + + private ArrayList productInstances; + + private String priceListName; + + private String orgName; + + private String serno; + + private AttributeValuesPair attributeValuesPair; + + private Integer productCategoryId; + +// Y/N +private String isOwnedByWholesaler; + +private String isNatisReleased; + +private String reserveStatus; + +private String warehouseName; + +private String ETA; + +private ProductImageInfo imageInfo; + +private HashMap attributeValuesMap; + +private String description; + +private String imageLink; +private String textLink; + +private String customSize; + +private String group1; + +private String group2; + +private Integer uomId; + +private String productCategoryName; + +private String taxCategoryName; + + public Integer getTaxCategoryId() { + return taxCategoryId; + } + public void setTaxCategoryId(Integer taxCategoryId) { + this.taxCategoryId = taxCategoryId; + } + public String getTaxCategoryName() { + return taxCategoryName; + } + public void setTaxCategoryName(String taxCategoryName) { + this.taxCategoryName = taxCategoryName; + } + public String getPartnerName() { + return partnerName; + } + public void setPartnerName(String partnerName) { + this.partnerName = partnerName; + } + public Integer getBpartnerId() { + return bpartnerId; + } + public void setBpartnerId(Integer bpartnerId) { + this.bpartnerId = bpartnerId; + } + public String getBarCode() { + return barCode; + } + public void setBarCode(String barCode) { + this.barCode = barCode; + } + //TODO refactor this + private ArrayList availableColours; + + private ArrayList availableSizes; + + + public Integer getLicensingDistrictId() + { + return licensingDistrictId; + } + public void setLicensingDistrictId(Integer licensingDistrictId) { + this.licensingDistrictId = licensingDistrictId; + } + + public String getReserveStatus() + { + return reserveStatus; + } + + public void setReserveStatus(String reserveStatus) + { + this.reserveStatus = reserveStatus; + } + + public String getIsOwnedByWholesaler() + { + return isOwnedByWholesaler; + } + + public void setIsOwnedByWholesaler(String isOwnedByWholesaler) + { + this.isOwnedByWholesaler = isOwnedByWholesaler; + } + + + public BigDecimal getQuantity() + { + return quantity; + } + public void setQuantity(BigDecimal quantity) + { + this.quantity = quantity; + } + public ArrayList getOrderLineList() + { + return orderLineList; + } + + public void setOrderLineList(ArrayList orderLineList) + { + this.orderLineList = orderLineList; + } + + public String getProductName() + { + return productName; + } + + public void setProductName(String productName) + { + this.productName = productName; + } + + public BigDecimal getQtyOnHand() + { + return qtyOnHand; + } + + public void setQtyOnHand(BigDecimal qtyOnHand) + { + this.qtyOnHand = qtyOnHand; + } + + public Integer getProductId() + { + return productId; + } + + public void setProductId(Integer productId) + { + this.productId = productId; + } + + public BigDecimal getPriceList() + { + return priceList; + } + + public void setPriceList(BigDecimal priceList) + { + this.priceList = priceList; + } + + public BigDecimal getPriceLimit() + { + return priceLimit; + } + + public void setPriceLimit(BigDecimal priceLimit) + { + this.priceLimit = priceLimit; + } + + public BigDecimal getPriceStandard() + { + return priceStandard; + } + + public void setPriceStandard(BigDecimal priceStandard) + { + this.priceStandard = priceStandard; + } + + public ArrayList getProductInstances() + { + return productInstances; + } + + public void setProductInstances(ArrayList productInstances) + { + this.productInstances = productInstances; + } + + public Integer getAttributeSetInstanceId() + { + return attributeSetInstanceId; + } + + public void setAttributeSetInstanceId(Integer attributeSetInstanceId) + { + this.attributeSetInstanceId = attributeSetInstanceId; + } + + public Integer getLocatorId() + { + return locatorId; + } + + public void setLocatorId(Integer locatorId) + { + this.locatorId = locatorId; + } + + public Integer getOrgId() + { + return orgId; + } + + public void setOrgId(Integer orgId) + { + this.orgId = orgId; + } + + public BigDecimal getQtyReserved() + { + return qtyReserved; + } + + public void setQtyReserved(BigDecimal qtyReserved) + { + this.qtyReserved = qtyReserved; + } + + public BigDecimal getQtyOrdered() + { + return qtyOrdered; + } + + public void setQtyOrdered(BigDecimal qtyOrdered) + { + this.qtyOrdered = qtyOrdered; + } + + public String getOrgName() + { + return orgName; + } + + public void setOrgName(String orgName) + { + this.orgName = orgName; + } + + + public int compareTo(Object o) + { + if (o == null && this.getProductId() == null) + return -1; + + ProductBean bean = (ProductBean) o; + + return (bean.getProductId().compareTo(this.getProductId())); + } + + public boolean equals(Object obj) + { + ProductBean bean = (ProductBean) obj; + + if ( obj == null) + return false; + + if (bean.getProductId().intValue() == this.getProductId().intValue()) + return true; + + return false; + } + + public Integer getSernoAttributeSetInstance() + { + return sernoAttributeSetInstance; + } + + public void setSernoAttributeSetInstance(Integer sernoAttributeSetInstance) + { + this.sernoAttributeSetInstance = sernoAttributeSetInstance; + } + + public String getRegionName() + { + return regionName; + } + + public void setRegionName(String regionName) + { + this.regionName = regionName; + } + + public void setSerno(String serno) + { + this.serno = serno; + } + + public String getSerno() + { + return serno; + } + + + public String getIsNatisReleased() + { + return isNatisReleased; + } + + public void setIsNatisReleased(String isNatisReleased) + { + this.isNatisReleased = isNatisReleased; + } + + public String getPriceListName() + { + return priceListName; + } + + public void setPriceListName(String priceListName) + { + this.priceListName = priceListName; + } + + public Integer getPriceListVersionId() + { + return priceListVersionId; + } + + public void setPriceListVersionId(Integer priceListVersionId) + { + this.priceListVersionId = priceListVersionId; + } + + public Integer[] getCheckBox() + { + return checkBox; + } + public void setCheckBox(Integer [] checkBox) + { + this.checkBox = checkBox; + } + + + public AttributeValuesPair getAttributeValuesPair() + { + return attributeValuesPair; + } + + public void setAttributeValuesPair(AttributeValuesPair attributeValuesPair) + { + this.attributeValuesPair = attributeValuesPair; + } + + + public String getEngineNo() { + return engineNo; + } + public void setEngineNo(String engineNo) { + this.engineNo = engineNo; + } + + public Integer getProductCategoryId() + { + return productCategoryId; + } + + public void setProductCategoryId(Integer productCategoryId) + { + this.productCategoryId = productCategoryId; + } + + public String getWarehouseType() + { + return warehouseType; + } + + public void setWarehouseType(String warehouseType) + { + this.warehouseType = warehouseType; + } + + public String toString() + { + return this.getProductName(); + } + + public String getWarehouseName() + { + return warehouseName; + } + + public void setWarehouseName(String warehouseName) + { + this.warehouseName = warehouseName; + } + + public Integer getWarehouseId() + { + return warehouseId; + } + + public void setWarehouseId(Integer warehouseId) + { + this.warehouseId = warehouseId; + } + + public String getETA() + { + return ETA; + } + public void setETA(String eta) + { + ETA = eta; + } + + public Integer[] getProductIds() + { + return productIds; + } + + public void setProductIds(Integer[] productIds) + { + this.productIds = productIds; + } + + public ProductImageInfo getImageInfo() + { + return imageInfo; + } + public void setImageInfo(ProductImageInfo imageInfo) + { + this.imageInfo = imageInfo; + } + + public HashMap getAttributeValuesMap() + { + return attributeValuesMap; + } + + public void setAttributeValuesMap(HashMap attributeValuesMap) + { + this.attributeValuesMap = attributeValuesMap; + } + + + public String getDescription() + { + return description; + } + public void setDescription(String description) + { + this.description = description; + } + + public ArrayList getAvailableColours() + { + return availableColours; + } + public void setAvailableColours(ArrayList availableColours) + { + this.availableColours = availableColours; + } + public ArrayList getAvailableSizes() + { + return availableSizes; + } + public void setAvailableSizes(ArrayList availableSizes) + { + this.availableSizes = availableSizes; + } + + public Integer getAttributeId() + { + return attributeId; + } + + public void setAttributeId(Integer attributeId) + { + this.attributeId = attributeId; + } + + + public String getImageLink() + { + return imageLink; + } + + public void setImageLink(String imageLink) + { + this.imageLink = imageLink; + } + + public String getTextLink() + { + return textLink; + } + + public void setTextLink(String textLink) + { + this.textLink = textLink; + } + public String getCurrency() + { + return currency; + } + public void setCurrency(String currency) + { + this.currency = currency; + } + + public String getSalesPriceLimit() { + return salesPriceLimit; + } + public void setSalesPriceLimit(String salesPriceLimit) { + this.salesPriceLimit = salesPriceLimit; + } + public String getSalesPriceList() { + return salesPriceList; + } + public void setSalesPriceList(String salesPriceList) { + this.salesPriceList = salesPriceList; + } + public String getSalesPriceStandard() { + return salesPriceStandard; + } + public void setSalesPriceStandard(String salesPriceStandard) { + this.salesPriceStandard = salesPriceStandard; + } + + + public String getBrandName() { + return brandName; + } + public void setBrandName(String brandName) { + this.brandName = brandName; + } + public String getColourName() { + return colourName; + } + public void setColourName(String colourName) { + this.colourName = colourName; + } + public String getDesignName() { + return designName; + } + public void setDesignName(String designName) { + this.designName = designName; + } + public String getSizeName() { + return sizeName; + } + public void setSizeName(String sizeName) { + this.sizeName = sizeName; + } + public String[] getSizes() + { + return sizes; + } + public void setSizes(String[] sizes) + { + this.sizes = sizes; + } + + + + public String getPurchasePriceLimit() { + return purchasePriceLimit; + } + public void setPurchasePriceLimit(String purchasePriceLimit) { + this.purchasePriceLimit = purchasePriceLimit; + } + public String getPurchasePriceList() { + return purchasePriceList; + } + public void setPurchasePriceList(String purchasePriceList) { + this.purchasePriceList = purchasePriceList; + } + public String getPurchasePriceStandard() { + return purchasePriceStandard; + } + public void setPurchasePriceStandard(String purchasePriceStandard) { + this.purchasePriceStandard = purchasePriceStandard; + } + public String getModelName() { + return modelName; + } + public void setModelName(String modelName) { + this.modelName = modelName; + } + public String getRevenueRecognition() { + return revenueRecognition; + } + public void setRevenueRecognition(String revenueRecognition) { + this.revenueRecognition = revenueRecognition; + } + public Integer getAttributeSetId() { + return attributeSetId; + } + public void setAttributeSetId(Integer attributeSetId) { + this.attributeSetId = attributeSetId; + } + public Integer getMAttrSetInstanceId() { + return mAttrSetInstanceId; + } + public void setMAttrSetInstanceId(Integer attrSetInstanceId) { + mAttrSetInstanceId = attrSetInstanceId; + } + public Integer getRevenueRecoId() { + return revenueRecoId; + } + public void setRevenueRecoId(Integer revenueRecoId) { + this.revenueRecoId = revenueRecoId; + } + + public String getProductType() { + return productType; + } + public void setProductType(String productType) { + this.productType = productType; + } + + public Boolean getIsActive() { + return isActive; + } + public void setIsActive(Boolean isActive) { + this.isActive = isActive; + } + public BigDecimal getTaxRate() { + return taxRate; + } + public void setTaxRate(BigDecimal taxRate) { + this.taxRate = taxRate; + } + public String getCustomSize() { + return customSize; + } + public void setCustomSize(String customSize) { + this.customSize = customSize; + } + public String getProductClassification() + { + return productClassification; + } + public void setProductClassification(String productClassification) + { + this.productClassification = productClassification; + } + public String getKeyword2() + { + return keyword2; + } + public void setKeyword2(String keyword2) + { + this.keyword2 = keyword2; + } + + public Boolean getIsSelfService() + { + return isSelfService; + } + + public void setIsSelfService(Boolean isSelfService) + { + this.isSelfService = isSelfService; + } + + public FormFile getFile() { + return file; + } + public void setFile(FormFile file) { + this.file = file; + } + public String getGroup1() { + return group1; + } + public void setGroup1(String group1) { + this.group1 = group1; + } + public String getGroup2() { + return group2; + } + public void setGroup2(String group2) { + this.group2 = group2; + } + public Integer getUomId() { + return uomId; + } + public void setUomId(Integer uomId) { + this.uomId = uomId; + + } + public Boolean getIsEditable() { + return isEditable; + } + public void setIsEditable(Boolean isEditable) { + this.isEditable = isEditable; + } + public String getUom() + { + return uom; + } + public void setUom(String uom) + { + this.uom = uom; + } + public BigDecimal getQtyToMove() + { + return qtyToMove; + } + public void setQtyToMove(BigDecimal qtyToMove) + { + this.qtyToMove = qtyToMove; + } + public Integer getOrgFromId() + { + return this.orgFromId; + } + public void setOrgFromId(Integer orgFromId) + { + this.orgFromId = orgFromId; + } + public Integer getOrgToId() + { + return orgToId; + } + public void setOrgToId(Integer orgToId) + { + this.orgToId = orgToId; + } + // + public BigDecimal getStdPrice() + { + return stdPrice; + } + + public void setStdPrice(BigDecimal stdPrice) + { + this.stdPrice = stdPrice; + } + + public BigDecimal getListPrice() + { + return listPrice; + } + + public void setListPrice(BigDecimal listPrice) + { + this.listPrice = listPrice; + } + + public BigDecimal getLimitPrice() + { + return limitPrice; + } + + public void setLimitPrice(BigDecimal limitPrice) + { + this.limitPrice = limitPrice; + } + + public Boolean getIsDefault() + { + return isDefault; + } + + public void setIsDefault(Boolean isDefault) + { + this.isDefault = isDefault; + } + + public Boolean getIsPresentForProduct() + { + return isPresentForProduct; + } + + public void setIsPresentForProduct(Boolean isPresentForProduct) + { + this.isPresentForProduct = isPresentForProduct; + } + + public Boolean getIsMandatory() + { + return isMandatory; + } + + public void setIsMandatory(Boolean isMandatory) + { + this.isMandatory = isMandatory; + } + + public Boolean getIsSOPriceList() + { + return isSOPriceList; + } + + public void setIsSOPriceList(Boolean isSOPriceList) + { + this.isSOPriceList = isSOPriceList; + } + public Integer getPriceListId() + { + return priceListId; + } + + public void setPriceListId(Integer priceListId) + { + this.priceListId = priceListId; + } + public ProductBean getProductBean() + { + return productBean; + } + + public void setProductBean(ProductBean productBean) + { + this.productBean = productBean; + } + + public ArrayList getProductBeanList() + { + return productBeanList; + } + + public void setProductBeanList(ArrayList productBeanList) + { + this.productBeanList = productBeanList; + } + public String getProductCategoryName() { + return productCategoryName; + } + public void setProductCategoryName(String productCategoryName) { + this.productCategoryName = productCategoryName; + } + public BigDecimal getListPriceIncl() { + return listPriceIncl; + } + public void setListPriceIncl(BigDecimal listPriceIncl) { + this.listPriceIncl = listPriceIncl; + } + public BigDecimal getStdPriceIncl() { + return stdPriceIncl; + } + public void setStdPriceIncl(BigDecimal stdPriceIncl) { + this.stdPriceIncl = stdPriceIncl; + } + public BigDecimal getLimitPriceIncl() { + return limitPriceIncl; + } + public void setLimitPriceIncl(BigDecimal limitPriceIncl) { + this.limitPriceIncl = limitPriceIncl; + } + public Boolean getIsTaxIncluded() { + return isTaxIncluded; + } + public void setIsTaxIncluded(Boolean isTaxIncluded) { + this.isTaxIncluded = isTaxIncluded; + } + public Integer getUnitsPerPack() + { + return unitsPerPack; + } + public void setUnitsPerPack(Integer unitsPerPack) + { + this.unitsPerPack = unitsPerPack; + } + +} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/beans/ProductCategoryBean.java b/posterita/posterita/src/main/org/posterita/beans/ProductCategoryBean.java new file mode 100644 index 0000000000..bd6eed6b3e --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/ProductCategoryBean.java @@ -0,0 +1,42 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Created on May 9, 2006 + */ + + +package org.posterita.beans; + + +public class ProductCategoryBean extends UDIBean +{ + + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + public Integer getProductCategoryId() { + return productCategoryId; + } + public void setProductCategoryId(Integer productCategoryId) { + this.productCategoryId = productCategoryId; + } +} diff --git a/posterita/posterita/src/main/org/posterita/beans/ProductDetailsBean.java b/posterita/posterita/src/main/org/posterita/beans/ProductDetailsBean.java new file mode 100644 index 0000000000..608caf241d --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/ProductDetailsBean.java @@ -0,0 +1,130 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + **/ + +/** + @author ashley + */ + +package org.posterita.beans; + +import java.math.BigDecimal; + +public class ProductDetailsBean extends UDIBean +{ + + public Integer getProductId() + { + return productId; + } + + public void setProductId(Integer productId) + { + this.productId = productId; + } + + public String getBarCode() + { + return barCode; + } + + public void setBarCode(String barCode) + { + this.barCode = barCode; + } + + public String getDescription() + { + return description; + } + + public void setDescription(String description) + { + this.description = description; + } + + public Boolean getHasImage() + { + return hasImage; + } + + public void setHasImage(Boolean hasImage) + { + this.hasImage = hasImage; + } + + public String getProductName() + { + return productName; + } + + public void setProductName(String productName) + { + this.productName = productName; + } + + public String getRevenueRecognition() + { + return revenueRecognition; + } + + public void setRevenueRecognition(String revenueRecognition) + { + this.revenueRecognition = revenueRecognition; + } + + public Double getStdPurchasePrice() + { + return stdPurchasePrice; + } + + public void setStdPurchasePrice(Double stdPurchasePrice) + { + this.stdPurchasePrice = stdPurchasePrice; + } + + public Double getStdSalesPrice() + { + return stdSalesPrice; + } + + public void setStdSalesPrice(Double stdSalesPrice) + { + this.stdSalesPrice = stdSalesPrice; + } + + public String getTaxCategoryName() + { + return taxCategoryName; + } + + public void setTaxCategoryName(String taxCategoryName) + { + this.taxCategoryName = taxCategoryName; + } + + public BigDecimal getQuantity() { + return quantity; + } + + public void setQuantity(BigDecimal quantity) { + this.quantity = quantity; + } +} diff --git a/posterita/posterita/src/main/org/posterita/beans/ProductImageBean.java b/posterita/posterita/src/main/org/posterita/beans/ProductImageBean.java new file mode 100644 index 0000000000..ed9c2a1421 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/ProductImageBean.java @@ -0,0 +1,158 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Mar 14, 2006 by praveen + * + */ +package org.posterita.beans; + +import java.util.ArrayList; + +import org.apache.struts.upload.FormFile; + +import org.posterita.businesslogic.administration.ProductManager; + + +public class ProductImageBean extends UDIBean +{ + public Integer getProductId() { + return productId; + } + public void setProductId(Integer productId) { + this.productId = productId; + } + public FormFile getFile() { + return file; + } + public void setFile(FormFile file) { + this.file = file; + } + public Integer[] getProductIds() { + return productIds; + } + public void setProductIds(Integer[] productIds) { + this.productIds = productIds; + } + public String getBrandName() + { + return brandName; + } + public void setBrandName(String brandName) + { + this.brandName = brandName; + } + public String getColourName() + { + return colourName; + } + public void setColourName(String colourName) + { + this.colourName = colourName; + } + public String getDesignName() + { + return designName; + } + public void setDesignName(String designName) + { + this.designName = designName; + } + public String getModelName() + { + return modelName; + } + public void setModelName(String modelName) + { + this.modelName = modelName; + } + public String getKeyword1() + { + return keyword1; + } + public void setKeyword1(String keyword1) + { + this.keyword1 = keyword1; + } + public String getKeyword2() + { + return keyword2; + } + public void setKeyword2(String keyword2) + { + this.keyword2 = keyword2; + } + public String[] getSizes() + { + return sizes; + } + public void setSizes(String[] sizes) + { + this.sizes = sizes; + } + + public String toString() + { + StringBuffer productName = new StringBuffer(); + productName.append(brandName + ProductManager.PRODUCT_ATTRIBUTES_DELIMETER); + productName.append(designName + ProductManager.PRODUCT_ATTRIBUTES_DELIMETER); + productName.append(modelName + ProductManager.PRODUCT_ATTRIBUTES_DELIMETER); + productName.append(colourName + ProductManager.PRODUCT_ATTRIBUTES_DELIMETER); + + return productName.toString(); + } + public String getKeyword3() + { + return keyword3; + } + public void setKeyword3(String keyword3) + { + this.keyword3 = keyword3; + } + public String getKeyword4() + { + return keyword4; + } + public void setKeyword4(String keyword4) + { + this.keyword4 = keyword4; + } + public String getImageName() + { + return imageName; + } + public void setImageName(String imageName) + { + this.imageName = imageName; + } + public ArrayList getProductsList() + { + return productsList; + } + public void setProductsList(ArrayList productsList) + { + this.productsList = productsList; + } + public String getBarCode() + { + return barCode; + } + public void setBarCode(String barCode) + { + this.barCode = barCode; + } +} diff --git a/posterita/posterita/src/main/org/posterita/beans/ProductImageInfo.java b/posterita/posterita/src/main/org/posterita/beans/ProductImageInfo.java new file mode 100644 index 0000000000..1069e34348 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/ProductImageInfo.java @@ -0,0 +1,59 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Mar 15, 2006 by praveen + * + */ +package org.posterita.beans; + +public class ProductImageInfo +{ + private Integer productId; + private Boolean hasAttachment; + private String model; + + public Boolean getHasAttachment() { + return hasAttachment; + } + public void setHasAttachment(Boolean hasAttachment) { + this.hasAttachment = hasAttachment; + } + public String getModel() { + return model; + } + public void setModel(String model) { + this.model = model; + } + public Integer getProductId() { + return productId; + } + public void setProductId(Integer productId) { + this.productId = productId; + } + private String productName; + + + public String getProductName() + { + return productName; + } + public void setProductName(String productName) + { + this.productName = productName; + } +} diff --git a/posterita/posterita/src/main/org/posterita/beans/ProductInfo.java b/posterita/posterita/src/main/org/posterita/beans/ProductInfo.java new file mode 100644 index 0000000000..b393f07e28 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/ProductInfo.java @@ -0,0 +1,131 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ +package org.posterita.beans; + +import java.sql.Timestamp; +import java.util.ArrayList; + + +public class ProductInfo implements Comparable +{ + private AttributeValuesBean attributeValuesBean = new AttributeValuesBean(); + private ArrayList products = new ArrayList(); + private ArrayList regions = new ArrayList(); + private ArrayList reservedStatusValues = new ArrayList(); + private ArrayList warehouseTypes = new ArrayList(); + private ArrayList organisations = new ArrayList(); + private ArrayList warehouseNames = new ArrayList(); + private Integer productCategoryId; + private Timestamp ETA; + + public ArrayList getOrganisations() + { + return organisations; + } + public void setOrganisations(ArrayList organisations) + { + this.organisations = organisations; + } + + + public AttributeValuesBean getAttributeValuesBean() + { + return attributeValuesBean; + } + + public void setAttributeValuesBean(AttributeValuesBean attributeValuesBean) + { + this.attributeValuesBean = attributeValuesBean; + } + + public ArrayList getProducts() + { + return products; + } + + public void setProducts(ArrayList products) + { + this.products = products; + } + + public void setRegions(ArrayList regions) + { + this.regions = regions; + } + + public ArrayList getRegions() + { + return regions; + } + + public ArrayList getReservedStatusValues() + { + return reservedStatusValues; + } + + public void setReservedStatusValues(ArrayList reservedStatusValues) + { + this.reservedStatusValues = reservedStatusValues; + } + + public Integer getProductCategoryId() + { + return productCategoryId; + } + + public void setProductCategoryId(Integer productCategoryId) + { + this.productCategoryId = productCategoryId; + } + + public ArrayList getWarehouseTypes() + { + return warehouseTypes; + } + + public void setWarehouseTypes(ArrayList warehouseTypes) + { + this.warehouseTypes = warehouseTypes; + } + + public ArrayList getWarehouseNames() + { + return warehouseNames; + } + + public void setWarehouseNames(ArrayList warehouseNames) + { + this.warehouseNames = warehouseNames; + } + + public int compareTo(Object o) + { + return 0; + } + + public Timestamp getETA() + { + return ETA; + } + public void setETA(Timestamp eta) + { + ETA = eta; + } +} diff --git a/posterita/posterita/src/main/org/posterita/beans/ProductInfoBean.java b/posterita/posterita/src/main/org/posterita/beans/ProductInfoBean.java new file mode 100644 index 0000000000..63652fd231 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/ProductInfoBean.java @@ -0,0 +1,27 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Aug 31, 2005 by praveen + * + */ +package org.posterita.beans; + +public class ProductInfoBean extends StockBean +{ + +} diff --git a/posterita/posterita/src/main/org/posterita/beans/ProductInstanceBean.java b/posterita/posterita/src/main/org/posterita/beans/ProductInstanceBean.java new file mode 100644 index 0000000000..1e0c564b4d --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/ProductInstanceBean.java @@ -0,0 +1,81 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ +package org.posterita.beans; + +public class ProductInstanceBean +{ + private int attributeSetInstanceId; + private int attributeId; + private String serNo; + private String description; + private int qtyOnHand; + + public int getAttributeSetInstanceId() + { + return attributeSetInstanceId; + } + + public void setAttributeSetInstanceId(int attributeSetInstanceId) + { + this.attributeSetInstanceId = attributeSetInstanceId; + } + + public int getAttributeId() + { + return attributeId; + } + + public void setAttributeId(int attributeId) + { + this.attributeId = attributeId; + } + + public String getSerno() + { + return serNo; + } + + public void setSerno(String serno) + { + this.serNo = serno; + } + + public String getDescription() + { + return description; + } + + public void setDescription(String description) + { + this.description = description; + } + + //this should return only on because a serial number(vin number) + // must be unique + public int getQtyOnHand() + { + return qtyOnHand; + } + + public void setQtyOnHand(int qtyOnHand) + { + this.qtyOnHand = qtyOnHand; + } +} diff --git a/posterita/posterita/src/main/org/posterita/beans/ProductKeywordsBean.java b/posterita/posterita/src/main/org/posterita/beans/ProductKeywordsBean.java new file mode 100644 index 0000000000..2a15fbd891 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/ProductKeywordsBean.java @@ -0,0 +1,116 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +* Created on May 12, 2006 by ashley +* +*/ + +package org.posterita.beans; + +import org.apache.struts.upload.FormFile; + +public class ProductKeywordsBean extends UDIBean +{ + + public String getProductClassification() + { + return productClassification; + } + public void setProductClassification(String productClassification) + { + this.productClassification = productClassification; + } + public String getKeyword1() + { + return keyword1; + } + public void setKeyword1(String keyword1) + { + this.keyword1 = keyword1; + } + public String getKeyword2() + { + return keyword2; + } + public void setKeyword2(String keyword2) + { + this.keyword2 = keyword2; + } + public String getKeyword3() + { + return keyword3; + } + public void setKeyword3(String keyword3) + { + this.keyword3 = keyword3; + } + public String getKeyword4() + { + return keyword4; + } + public void setKeyword4(String keyword4) + { + this.keyword4 = keyword4; + } + public Integer[] getProductIds() + { + return productIds; + } + public void setProductIds(Integer[] productIds) + { + this.productIds = productIds; + } + + public String getImageName() + { + return imageName; + } + public void setImageName(String imageName) + { + this.imageName = imageName; + } + public FormFile getFile() + { + return file; + } + public void setFile(FormFile file) + { + this.file = file; + } + + public Boolean getIsSelfService() + { + return isSelfService; + } + + public void setIsSelfService(Boolean isSelfService) + { + this.isSelfService = isSelfService; + } + + public String getDocumentNote() + { + return documentNote; + } + public void setDocumentNote(String documentNote) + { + this.documentNote = documentNote; + } + + +} diff --git a/posterita/posterita/src/main/org/posterita/beans/ProductPriceBean.java b/posterita/posterita/src/main/org/posterita/beans/ProductPriceBean.java new file mode 100644 index 0000000000..2ef43bd140 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/ProductPriceBean.java @@ -0,0 +1,76 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Aug 30, 2005 by praveen + * + */ +package org.posterita.beans; + +import java.math.BigDecimal; + + +public class ProductPriceBean extends ProductAttributeValueBean +{ + protected BigDecimal priceList; + protected String priceListName; + protected BigDecimal priceStandard; + + public Integer getPriceListVersionId() + { + return priceListVersionId; + } + + public void setPriceListVersionId(Integer priceListVersionId) + { + this.priceListVersionId = priceListVersionId; + } + + + + public String getPriceListName() + { + return priceListName; + } + + public void setPriceListName(String priceListName) + { + this.priceListName = priceListName; + } + + + + public BigDecimal getPriceList() + { + return priceList; + } + + public void setPriceList(BigDecimal priceList) + { + this.priceList = priceList; + } + + public BigDecimal getPriceStandard() + { + return priceStandard; + } + + public void setPriceStandard(BigDecimal priceStandard) + { + this.priceStandard = priceStandard; + } +} diff --git a/posterita/posterita/src/main/org/posterita/beans/ProductQuery.java b/posterita/posterita/src/main/org/posterita/beans/ProductQuery.java new file mode 100644 index 0000000000..eab21ab4d5 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/ProductQuery.java @@ -0,0 +1,204 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ + +package org.posterita.beans; + + + +public class ProductQuery +{ + + private int locatorId; + private int attributeSetId; + private int attributeValueIds[]; + private int productId; + private String fromLocatorSQL; + private String regionFilterSQL; + private int hondaOrgId; + private int priceListId; + private int priceListVersionId; + private int warehouseId; + private String reserveStatusFilter; + private String availableForBackOrderFilter; + private int productCategoryId; + private Integer ad_Org_ID; + private String ETAFilter; + private String backOrder; + + + public String getAvailableForBackOrderFilter() { + return availableForBackOrderFilter; + } + public void setAvailableForBackOrderFilter( + String availableForBackOrderFilter) { + this.availableForBackOrderFilter = availableForBackOrderFilter; + } + public String getReserveStatusFilter() + { + return reserveStatusFilter; + } + + public void setReserveStatusFilter(String reserveStatusFilter) + { + this.reserveStatusFilter = reserveStatusFilter; + } + + public int getWarehouseId() + { + return warehouseId; + } + + public void setWarehouseId(int warehouseId) + { + this.warehouseId = warehouseId; + } + + public int getPriceListVersionId() + { + return priceListVersionId; + } + + public void setPriceListVersionId(int priceListVersionId) + { + this.priceListVersionId = priceListVersionId; + } + + public int getPriceListId() + { + return priceListId; + } + + public void setPriceListId(int priceListId) + { + this.priceListId = priceListId; + } + + public int getHondaOrgId() + { + return hondaOrgId; + } + public void setHondaOrgId(int hondaOrgId) + { + this.hondaOrgId = hondaOrgId; + } + + public int getProductId() + { + return productId; + } + + public void setProductId(int productId) + { + this.productId = productId; + } + + + public int getLocatorId() + { + return locatorId; + } + + public void setLocatorId(int locatorId) + { + this.locatorId = locatorId; + } + + + + + public int[] getAttributeValueIds() + { + return attributeValueIds; + } + public void setAttributeValueIds(int[] attributeValueIds) + { + this.attributeValueIds = attributeValueIds; + } + + + public int getAttributeSetId() + { + return attributeSetId; + } + + public void setAttributeSetId(int attributeSetid) + { + this.attributeSetId = attributeSetid; + } + + public String getFromLocatorSQL() + { + return fromLocatorSQL; + } + + public void setFromLocatorSQL(String fromLocatorSQL) + { + this.fromLocatorSQL = fromLocatorSQL; + } + + public String getRegionFilterSQL() + { + return regionFilterSQL; + } + + public void setRegionFilterSQL(String regionFilterSQL) + { + this.regionFilterSQL = regionFilterSQL; + } + + public int getProductCategoryId() + { + return productCategoryId; + } + + public void setProductCategoryId(int productCategoryId) + { + this.productCategoryId = productCategoryId; + } + + public Integer getAd_Org_ID() + { + return ad_Org_ID; + } + + public void setAd_Org_ID(Integer ad_Org_ID) + { + this.ad_Org_ID = ad_Org_ID; + } + + public String getETAFilter() + { + return ETAFilter; + } + public void setETAFilter(String filter) + { + ETAFilter = filter; + } + + public String getBackOrder() + { + return backOrder; + } + + public void setBackOrder(String backOrder) + { + this.backOrder = backOrder; + } +} diff --git a/posterita/posterita/src/main/org/posterita/beans/ProductRestrictionBean.java b/posterita/posterita/src/main/org/posterita/beans/ProductRestrictionBean.java new file mode 100644 index 0000000000..451de68469 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/ProductRestrictionBean.java @@ -0,0 +1,96 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Aug 30, 2005 by praveen + * + */ +package org.posterita.beans; + +public class ProductRestrictionBean extends StockBean +{ + public Integer getProductCategoryId() + { + return productCategoryId; + } + + public void setProductCategoryId(Integer productCategoryId) + { + this.productCategoryId = productCategoryId; + } + + public Integer[] getCheckBox() + { + return checkBox; + } + public Integer getColour() + { + return colour; + } + + public Integer getModel() + { + return model; + } + + public Integer getOrgId() + { + return orgId; + } + + public Integer getTransmission() + { + return transmission; + } + + public Integer getYear() + { + return year; + } + + public void setCheckBox(Integer[] checkBox) + { + this.checkBox = checkBox; + } + + public void setColour(Integer colour) + { + this.colour = colour; + } + + public void setModel(Integer model) + { + this.model = model; + } + + public void setOrgId(Integer orgId) + { + this.orgId = orgId; + } + + public void setTransmission(Integer transmission) + { + this.transmission = transmission; + } + + public void setYear(Integer year) + { + this.year = year; + } + + +} diff --git a/posterita/posterita/src/main/org/posterita/beans/ProductSalesInfoBean.java b/posterita/posterita/src/main/org/posterita/beans/ProductSalesInfoBean.java new file mode 100644 index 0000000000..52a9fe7505 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/ProductSalesInfoBean.java @@ -0,0 +1,82 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * 10-Oct-2006 12:34:54 by praveen + * + */ + +package org.posterita.beans; + +import java.math.BigDecimal; +import java.util.Date; + +public class ProductSalesInfoBean { + private String DocumentNo; + private Date dateOrdered; + private String bpartnerName; + private String orderType; + private BigDecimal qtyOrderded; + private Integer orderId; + private BigDecimal lineAmount; + + public String getBpartnerName() { + return bpartnerName; + } + public void setBpartnerName(String bpartnerName) { + this.bpartnerName = bpartnerName; + } + public Date getDateOrdered() { + return dateOrdered; + } + public void setDateOrdered(Date dateOrdered) { + this.dateOrdered = dateOrdered; + } + public String getDocumentNo() { + return DocumentNo; + } + public void setDocumentNo(String documentNo) { + DocumentNo = documentNo; + } + public String getOrderType() { + return orderType; + } + public void setOrderType(String orderType) { + this.orderType = orderType; + } + public BigDecimal getQtyOrderded() { + return qtyOrderded; + } + public void setQtyOrderded(BigDecimal qtyOrderded) { + this.qtyOrderded = qtyOrderded; + } + public Integer getOrderId() { + return orderId; + } + public void setOrderId(Integer orderId) { + this.orderId = orderId; + } + public BigDecimal getLineAmount() { + return lineAmount; + } + public void setLineAmount(BigDecimal lineAmount) { + this.lineAmount = lineAmount; + } + + + +} diff --git a/posterita/posterita/src/main/org/posterita/beans/ProductSalesSummaryBean.java b/posterita/posterita/src/main/org/posterita/beans/ProductSalesSummaryBean.java new file mode 100644 index 0000000000..80b6870660 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/ProductSalesSummaryBean.java @@ -0,0 +1,67 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * 10-Oct-2006 12:25:01 by praveen + * + */ + +package org.posterita.beans; + +import java.math.BigDecimal; + +public class ProductSalesSummaryBean { + private Integer productId; + private String productName; + private BigDecimal qtySold; + private BigDecimal totalAmount; + private BigDecimal qtyOnHand; + + public Integer getProductId() { + return productId; + } + public void setProductId(Integer productId) { + this.productId = productId; + } + public String getProductName() { + return productName; + } + public void setProductName(String productName) { + this.productName = productName; + } + public BigDecimal getQtyOnHand() { + return qtyOnHand; + } + public void setQtyOnHand(BigDecimal qtyOnHand) { + this.qtyOnHand = qtyOnHand; + } + public BigDecimal getQtySold() { + return qtySold; + } + public void setQtySold(BigDecimal qtySold) { + this.qtySold = qtySold; + } + public BigDecimal getTotalAmount() { + return totalAmount; + } + public void setTotalAmount(BigDecimal totalAmount) { + this.totalAmount = totalAmount; + } + + + +} diff --git a/posterita/posterita/src/main/org/posterita/beans/ProductSearchBean.java b/posterita/posterita/src/main/org/posterita/beans/ProductSearchBean.java new file mode 100644 index 0000000000..13889256ff --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/ProductSearchBean.java @@ -0,0 +1,43 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +* Created on May 17, 2006 by ashley +* +*/ + +package org.posterita.beans; + +public class ProductSearchBean extends UDIBean +{ + public Boolean getIsActive() + { + return isActive; + } + public void setIsActive(Boolean isActive) + { + this.isActive = isActive; + } + public Boolean getIsWebstoreFeatured() + { + return isWebstoreFeatured; + } + public void setIsWebstoreFeatured(Boolean isWebstoreFeatured) + { + this.isWebstoreFeatured = isWebstoreFeatured; + } +} diff --git a/posterita/posterita/src/main/org/posterita/beans/ProductSpecsBean.java b/posterita/posterita/src/main/org/posterita/beans/ProductSpecsBean.java new file mode 100644 index 0000000000..ca858f8598 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/ProductSpecsBean.java @@ -0,0 +1,86 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +package org.posterita.beans; + +import java.math.BigDecimal; + + +public class ProductSpecsBean +{ + private String model; + private String colour; + private String year; + private String transmission; + private BigDecimal priceStd; + + + public BigDecimal getPriceStd() { + return priceStd; + } + public void setPriceStd(BigDecimal priceStd) { + this.priceStd = priceStd; + } + public String getColour() { + return colour; + } + public void setColour(String colour) { + this.colour = colour; + } + public String getModel() { + return model; + } + public void setModel(String model) { + this.model = model; + } + public String getTransmission() { + return transmission; + } + public void setTransmission(String transmission) { + this.transmission = transmission; + } + public String getYear() { + return year; + } + public void setYear(String year) { + this.year = year; + } + + public boolean equals(Object obj) + { + ProductSpecsBean bean = (ProductSpecsBean) obj; + + if ( obj == null) + return false; + + if (this.getModel().equalsIgnoreCase(bean.getModel()) == false) + return false; + + if (this.getColour().equalsIgnoreCase(bean.getColour()) == false) + return false; + + if (this.getTransmission().equalsIgnoreCase(bean.getTransmission()) == false) + return false; + + if (this.getYear().equalsIgnoreCase(bean.getYear()) == false) + return false; + + return true; + } +} diff --git a/posterita/posterita/src/main/org/posterita/beans/ProductStatusBean.java b/posterita/posterita/src/main/org/posterita/beans/ProductStatusBean.java new file mode 100644 index 0000000000..8597bc9592 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/ProductStatusBean.java @@ -0,0 +1,253 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Jan 18, 2006 by praveen + * + */ +package org.posterita.beans; + +import java.math.BigDecimal; + +public class ProductStatusBean extends UDIBean +{ + private Boolean availability = Boolean.valueOf(true); + private ProductImageInfo imageInfo; + private Boolean hasAttachment; + + public String getProductClassification() + { + return productClassification; + } + public void setProductClassification(String productClassification) + { + this.productClassification = productClassification; + } + + public Integer[] getCheckBox() + { + return checkBox; + } + + public void setCheckBox(Integer[] checkBox) + { + this.checkBox = checkBox; + } + + public Boolean getAvailability() + { + return availability; + } + + public void setAvailability(Boolean availability) + { + this.availability = availability; + } + + private String colour,model,transmission,year; + + public Integer getProductId() + { + return productId; + } + + public void setProductId(Integer productId) + { + this.productId = productId; + } + + public String getColour() + { + return colour; + } + + public void setColour(String colour) + { + this.colour = colour; + } + + public String getModel() + { + return model; + } + + public void setModel(String model) + { + this.model = model; + } + + public String getTransmission() + { + return transmission; + } + + public void setTransmission(String transmission) + { + this.transmission = transmission; + } + + public String getYear() + { + return year; + } + + public void setYear(String year) + { + this.year = year; + } + + public Boolean getIsActive() + { + return isActive; + } + + public void setIsActive(Boolean isActive) + { + this.isActive = isActive; + } + + private String productName; + + public String getProductName() + { + return productName; + } + public void setProductName(String productName) + { + this.productName = productName; + } + + public ProductImageInfo getImageInfo() + { + return imageInfo; + } + + public void setImageInfo(ProductImageInfo imageInfo) + { + this.imageInfo = imageInfo; + } + + public Boolean getHasAttachment() + { + return hasAttachment; + } + public void setHasAttachment(Boolean hasAttachment) + { + this.hasAttachment = hasAttachment; + } + public Boolean getIsWebstoreFeatured() + { + return isWebstoreFeatured; + } + + public void setIsWebstoreFeatured(Boolean isWebstoreFeatured) + { + this.isWebstoreFeatured = isWebstoreFeatured; + } + + public String getProductNameComplete() + { + String retVal = ""; + if(productName != null) + retVal = productName.replaceAll("_", " "); + return retVal; + } + + public String getKeyword1() + { + return keyword1; + } + + public void setKeyword1(String keyword1) + { + this.keyword1 = keyword1; + } + + public String getKeyword2() + { + return keyword2; + } + + public void setKeyword2(String keyword2) + { + this.keyword2 = keyword2; + } + + public String getKeyword3() + { + return keyword3; + } + + public void setKeyword3(String keyword3) + { + this.keyword3 = keyword3; + } + + public String getKeyword4() + { + return keyword4; + } + + public void setKeyword4(String keyword4) + { + this.keyword4 = keyword4; + } + + public String getBarCode() + { + return barCode; + } + + public void setBarCode(String barCode) + { + this.barCode = barCode; + } + + public Boolean getIsSelfService() + { + return isSelfService; + } + + public void setIsSelfService(Boolean isSelfService) + { + this.isSelfService = isSelfService; + } + + private String description; + + public String getDescription() { + return description; + } + public void setDescription(String description) { + this.description = description; + } + public BigDecimal getQtyOnHand() { + return qtyOnHand; + } + public void setQtyOnHand(BigDecimal qtyOnHand) { + this.qtyOnHand = qtyOnHand; + } + public BigDecimal getPriceStandard() { + return priceStandard; + } + public void setPriceStandard(BigDecimal priceStandard) { + this.priceStandard = priceStandard; + } + + + +} diff --git a/posterita/posterita/src/main/org/posterita/beans/ProductSupplierBean.java b/posterita/posterita/src/main/org/posterita/beans/ProductSupplierBean.java new file mode 100644 index 0000000000..6a3733974a --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/ProductSupplierBean.java @@ -0,0 +1,52 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Jun 20, 2006 + */ + + +package org.posterita.beans; + + +public class ProductSupplierBean extends UDIBean +{ + protected Integer bPartnerId; + protected String partnerName; + protected Integer quantity; + + public Integer getBPartnerId() { + return bPartnerId; + } + public void setBPartnerId(Integer partnerId) { + bPartnerId = partnerId; + } + public String getPartnerName() { + return partnerName; + } + public void setPartnerName(String partnerName) { + this.partnerName = partnerName; + } + public Integer getQuantity() { + return quantity; + } + public void setQuantity(Integer quantity) { + this.quantity = quantity; + } + + +} diff --git a/posterita/posterita/src/main/org/posterita/beans/RemoveSessionBean.java b/posterita/posterita/src/main/org/posterita/beans/RemoveSessionBean.java new file mode 100644 index 0000000000..3aad81c53a --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/RemoveSessionBean.java @@ -0,0 +1,39 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Jan 26, 2007 + */ + + +package org.posterita.beans; + + +public class RemoveSessionBean extends UDIBean +{ + + + public String getOrderType() + { + return orderType; + } + + public void setOrderType(String orderType) + { + this.orderType = orderType; + } +} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/beans/ReportBean.java b/posterita/posterita/src/main/org/posterita/beans/ReportBean.java new file mode 100644 index 0000000000..6fe738904c --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/ReportBean.java @@ -0,0 +1,293 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +package org.posterita.beans; + +import java.util.ArrayList; + + +public class ReportBean extends UDIBean +{ + + public ReportBean getReport() + { + return report; + } + + public void setReport(ReportBean report) + { + this.report = report; + } + + public ArrayList getReportList() + { + return reportList; + } + + public void setStockList(ArrayList reportList) + { + this.reportList = reportList; + } + + public Integer getProductId() + { + return productId; + } + + public void setProductId(Integer productId) + { + this.productId = productId; + } + + public String getProductName() + { + return productName; + } + + public void setProductName(String productName) + { + this.productName = productName; + } + + public String getBarCode() + { + return barCode; + } + public void setBarCode(String barCode) + { + this.barCode = barCode; + } + + public String getDescription() + { + return description; + } + public void setDescription(String description) + { + this.description = description; + } + + public Integer getOrgId() + { + return orgId; + } + public void setOrgId(Integer orgId) + { + this.orgId = orgId; + } + + public Integer getNoOfProductsRequired() { + return noOfProductsRequired; + } + public void setNoOfProductsRequired(Integer noOfProductsRequired) { + this.noOfProductsRequired = noOfProductsRequired; + } + public String getReportType() { + return reportType; + } + public void setReportType(String reportType) { + this.reportType = reportType; + } + public String getFromDate() + { + return fromDate; + } + + public void setFromDate(String fromDate) + { + this.fromDate = fromDate; + } + + public String getToDate() + { + return toDate; + } + + public void setToDate(String toDate) + { + this.toDate = toDate; + } + + public String getStartDay() + { + return startDay; + } + + public void setStartDay(String startDay) + { + this.startDay = startDay; + } + + public String getStartMonth() + { + return startMonth; + } + + public void setStartMonth(String startMonth) + { + this.startMonth = startMonth; + } + + public String getStartYear() + { + return startYear; + } + + public void setStartYear(String startYear) + { + this.startYear = startYear; + } + + public String getEndDay() + { + return endDay; + } + + public void setEndDay(String endDay) + { + this.endDay = endDay; + } + + public String getEndMonth() + { + return endMonth; + } + + public void setEndMonth(String endMonth) + { + this.endMonth = endMonth; + } + + public String getEndYear() + { + return endYear; + } + + public void setEndYear(String endYear) + { + this.endYear = endYear; + } + + public String getStartHour() + { + return startHour; + } + + public void setStartHour(String startHour) + { + this.startHour = startHour; + } + + public String getStartMinute() + { + return startMinute; + } + + public void setStartMinute(String startMinute) + { + this.startMinute = startMinute; + } + + public String getEndHour() + { + return endHour; + } + + public void setEndHour(String endHour) + { + this.endHour = endHour; + } + + public String getEndMinute() + { + return endMinute; + } + + public void setEndMinute(String endMinute) + { + this.endMinute = endMinute; + } + public String getAttribute() { + return attribute; + } + public void setAttribute(String attribute) { + this.attribute = attribute; + } + + public String getTimePeriod() { + return timePeriod; + } + public void setTimePeriod(String timePeriod) { + this.timePeriod = timePeriod; + } + + public String getChartType() { + return chartType; + } + public void setChartType(String chartType) { + this.chartType = chartType; + } + + public String getSalesGroup() { + return salesGroup; + } + public void setSalesGroup(String salesGroup) { + this.salesGroup = salesGroup; + } + + public Integer getAccountId() { + return accountId; + } + public void setAccountId(Integer accountId) { + this.accountId = accountId; + } + + public String getDateRange() { + return dateRange; + } + public void setDateRange(String dateRange) { + this.dateRange = dateRange; + } + + public String getPriceQtyFilter() { + return priceQtyFilter; + } + public void setPriceQtyFilter(String priceQtyFilter) { + this.priceQtyFilter = priceQtyFilter; + } + + public String getFullDetails() + { + return fullDetails; + } + + public void setFullDetails(String fullDetails) + { + this.fullDetails = fullDetails; + } + public String getIsSalesReport() + { + return isSalesReport; + } + public void setIsSalesReport(String isSalesReport) + { + this.isSalesReport = isSalesReport; + } + +} diff --git a/posterita/posterita/src/main/org/posterita/beans/ReportDataBean.java b/posterita/posterita/src/main/org/posterita/beans/ReportDataBean.java new file mode 100644 index 0000000000..ac3f3f4350 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/ReportDataBean.java @@ -0,0 +1,102 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Nov 21, 2005 by praveen + * + */ +package org.posterita.beans; + + +public class ReportDataBean +{ + private String model; + private int count; + private int automatic; + private int manual; + private int sale; + private int target; + + public ReportDataBean() + { + model = ""; + count = 0; + automatic = 0; + manual = 0; + sale = 0; + target = 0; + } + + public int getAutomatic() + { + return automatic; + } + + public void setAutomatic(int automatic) + { + this.automatic = automatic; + } + + public int getCount() + { + return count; + } + + public void setCount(int count) + { + this.count = count; + } + + public int getManual() + { + return manual; + } + + public void setManual(int manual) + { + this.manual = manual; + } + + public String getModel() + { + return model; + } + + public void setModel(String model) + { + this.model = model; + } + + public int getSale() + { + return sale; + } + + public void setSale(int sale) { + this.sale = sale; + } + + public int getTarget() + { + return target; + } + + public void setTarget(int target) + { + this.target = target; + } +} diff --git a/posterita/posterita/src/main/org/posterita/beans/ReportImageBean.java b/posterita/posterita/src/main/org/posterita/beans/ReportImageBean.java new file mode 100644 index 0000000000..ba84e11b8d --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/ReportImageBean.java @@ -0,0 +1,151 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Nov 17, 2005 by praveen + * + */ +package org.posterita.beans; + +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.GregorianCalendar; + +import org.posterita.core.TimestampConvertor; + + +public class ReportImageBean +{ + private String imagePath; + private String imageTitle; + private String altText; + private String requestParams; + private String dateFrom; + private String dateTo; + + public ReportImageBean() + { + initDateFrom(); + initDateTo(); + } + + private void initDateFrom() + { + SimpleDateFormat df = new SimpleDateFormat(TimestampConvertor.DEFAULT_DATE_PATTERN1); + + Calendar calendar = GregorianCalendar.getInstance(); + + if(calendar.get(Calendar.MONTH) == Calendar.JANUARY) + { + calendar.set(Calendar.DATE,9); + } + else + { + calendar.set(Calendar.DATE,1); + } + + calendar.set(Calendar.HOUR_OF_DAY,9); + calendar.set(Calendar.MINUTE,15); + calendar.set(Calendar.SECOND,0); + dateFrom = df.format(calendar.getTime()); + } + + private void initDateTo() + { + SimpleDateFormat df = new SimpleDateFormat(TimestampConvertor.DEFAULT_DATE_PATTERN1); + + Calendar calendar = GregorianCalendar.getInstance(); + //int maxNoOfDays = calendar.getActualMaximum(Calendar.DAY_OF_MONTH); + //calendar.set(Calendar.DATE,maxNoOfDays); + dateTo = df.format(calendar.getTime()); + } + + public String getAltText() + { + return altText; + } + + public void setAltText(String altText) + { + this.altText = altText; + } + + public String getImagePath() + { + return imagePath; + } + + public void setImagePath(String imagePath) + { + this.imagePath = imagePath; + } + + public String getImageTitle() + { + return imageTitle; + } + + public void setImageTitle(String imageTitle) + { + this.imageTitle = imageTitle; + } + + public void setRequestParams(String requestParams) + { + this.requestParams = requestParams; + } + + public String getDateFrom() + { + return dateFrom; + } + + public void setDateFrom(String dateFrom) + { + this.dateFrom = dateFrom; + } + + public String getDateTo() + { + return dateTo; + } + + public void setDateTo(String dateTo) + { + this.dateTo = dateTo; + } + + public String getRequestParams() + { + requestParams = null; + + try + { + requestParams = "dateFrom=" + URLEncoder.encode(dateFrom,"UTF-8") + + "&dateTo=" + URLEncoder.encode(dateTo,"UTF-8") + + "&imagePath=" + URLEncoder.encode(imagePath,"UTF-8") + + "&imageTitle=" + URLEncoder.encode(imageTitle,"UTF-8"); + } + catch (UnsupportedEncodingException e) + { + + } + return requestParams; + } +} diff --git a/posterita/posterita/src/main/org/posterita/beans/RoleBean.java b/posterita/posterita/src/main/org/posterita/beans/RoleBean.java new file mode 100644 index 0000000000..484a1f1166 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/RoleBean.java @@ -0,0 +1,203 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Aug 16, 2005 by praveen + * + */ +package org.posterita.beans; + +import java.math.BigDecimal; +import java.util.ArrayList; + +public class RoleBean extends UDIBean +{ + protected Boolean isDiscountUptoLimitPrice; + protected Boolean isDiscountAllowedOnTotal; + + + public ArrayList getRoleBeanList() { + return roleBeanList; + } + + public void setRoleBeanList(ArrayList roleBeanList) { + this.roleBeanList = roleBeanList; + } + + public Boolean getIsChecked() { + return isChecked; + } + + public void setIsChecked(Boolean isChecked) { + this.isChecked = isChecked; + } + + public Boolean getIsOverwritePriceLimit() { + return isOverwritePriceLimit; + } + + public void setIsOverwritePriceLimit(Boolean isOverwritePriceLimit) { + this.isOverwritePriceLimit = isOverwritePriceLimit; + } + + public BigDecimal getUserDiscount() { + return userDiscount; + } + + public void setUserDiscount(BigDecimal userDiscount) { + this.userDiscount = userDiscount; + } + + public Integer[] getCheckBox() + { + return checkBox; + } + + public void setCheckBox(Integer[] checkBox) + { + this.checkBox = checkBox; + } + + public String getName() + { + return name; + } + + public void setName(String name) + { + this.name = name; + } + + public Boolean getIsActive() + { + return isActive; + } + + public void setIsActive(Boolean isActive) + { + this.isActive = isActive; + } + + public Integer getRoleId() + { + return roleId; + } + + public void setRoleId(Integer roleId) + { + this.roleId = roleId; + } + + public Boolean getIsAccessAllOrgs() + { + return isAccessAllOrgs; + + } + + public void setIsAccessAllOrgs(Boolean isAccessAllOrgs) + { + this.isAccessAllOrgs = isAccessAllOrgs; + } + + + + public Boolean getCanAlterOrder() + { + return canAlterOrder; + } + + public void setCanAlterOrder(Boolean canAlterOrder) + { + this.canAlterOrder = canAlterOrder; + } + + protected Boolean canCreateOrder; + protected Boolean canViewOrder; + + + public Boolean getCanCreateOrder() + { + return canCreateOrder; + } + + public void setCanCreateOrder(Boolean canCreateOrder) + { + this.canCreateOrder = canCreateOrder; + } + + public Boolean getCanViewOrder() + { + return canViewOrder; + } + + public void setCanViewOrder(Boolean canViewOrder) + { + this.canViewOrder = canViewOrder; + } + + public Integer getOrgId() + { + return orgId; + } + + public void setOrgId(Integer orgId) + { + this.orgId = orgId; + } + + public String getOrgName() + { + return orgName; + } + + public void setOrgName(String orgName) + { + this.orgName = orgName; + } + + public Boolean getIsDiscountUptoLimitPrice() + { + return isDiscountUptoLimitPrice; + } + + public void setIsDiscountUptoLimitPrice(Boolean isDiscountUptoLimitPrice) + { + this.isDiscountUptoLimitPrice = isDiscountUptoLimitPrice; + } + + public Boolean getIsDiscountAllowedOnTotal() + { + return isDiscountAllowedOnTotal; + } + + public void setIsDiscountAllowedOnTotal(Boolean isDiscountAllowedOnTotal) + { + this.isDiscountAllowedOnTotal = isDiscountAllowedOnTotal; + } + + public Integer getWebMenuId() + { + return webMenuId; + } + + public void setWebMenuId(Integer webMenuId) + { + this.webMenuId = webMenuId; + } + + +} diff --git a/posterita/posterita/src/main/org/posterita/beans/SalesAnalysisReportBean.java b/posterita/posterita/src/main/org/posterita/beans/SalesAnalysisReportBean.java new file mode 100644 index 0000000000..8559560809 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/SalesAnalysisReportBean.java @@ -0,0 +1,86 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * 14-Jul-2006 14:00:21 by praveen + * + */ + +package org.posterita.beans; + +public class SalesAnalysisReportBean extends ReportBean +{ + private String supplier,category,brand,model,design,colour,size; + + public String getBrand() { + return brand; + } + + public void setBrand(String brand) { + this.brand = brand; + } + + public String getCategory() { + return category; + } + + public void setCategory(String category) { + this.category = category; + } + + public String getColour() { + return colour; + } + + public void setColour(String colour) { + this.colour = colour; + } + + public String getDesign() { + return design; + } + + public void setDesign(String design) { + this.design = design; + } + + public String getModel() { + return model; + } + + public void setModel(String model) { + this.model = model; + } + + public String getSize() { + return size; + } + + public void setSize(String size) { + this.size = size; + } + + public String getSupplier() { + return supplier; + } + + public void setSupplier(String supplier) { + this.supplier = supplier; + } + + +} diff --git a/posterita/posterita/src/main/org/posterita/beans/SalesAnalysisReportDataBean.java b/posterita/posterita/src/main/org/posterita/beans/SalesAnalysisReportDataBean.java new file mode 100644 index 0000000000..573242e971 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/SalesAnalysisReportDataBean.java @@ -0,0 +1,86 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * 05-Jul-2006 12:32:38 by praveen + * + */ + +package org.posterita.beans; + +import java.math.BigDecimal; + +public class SalesAnalysisReportDataBean +{ + private String supplier,category,brand,model,design,colour,size; + private BigDecimal quantity,amount; + + public BigDecimal getAmount() { + return amount; + } + public void setAmount(BigDecimal amount) { + this.amount = amount; + } + public String getBrand() { + return brand; + } + public void setBrand(String brand) { + this.brand = brand; + } + public String getCategory() { + return category; + } + public void setCategory(String category) { + this.category = category; + } + public String getColour() { + return colour; + } + public void setColour(String colour) { + this.colour = colour; + } + public String getDesign() { + return design; + } + public void setDesign(String design) { + this.design = design; + } + public String getModel() { + return model; + } + public void setModel(String model) { + this.model = model; + } + public BigDecimal getQuantity() { + return quantity; + } + public void setQuantity(BigDecimal quantity) { + this.quantity = quantity; + } + public String getSize() { + return size; + } + public void setSize(String size) { + this.size = size; + } + public String getSupplier() { + return supplier; + } + public void setSupplier(String supplier) { + this.supplier = supplier; + } +} diff --git a/posterita/posterita/src/main/org/posterita/beans/SalesDetailsBean.java b/posterita/posterita/src/main/org/posterita/beans/SalesDetailsBean.java new file mode 100644 index 0000000000..6ebaafaa03 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/SalesDetailsBean.java @@ -0,0 +1,209 @@ +package org.posterita.beans; + +import java.math.BigDecimal; +import java.sql.Date; +import java.sql.Timestamp; + +public class SalesDetailsBean +{ + private int orderId; + private int[] orderLineId; + private int[] productId; + private int bPartnerId; + private BigDecimal linesTotals; + private BigDecimal grandTotals; + private BigDecimal totalTaxAmount; + private BigDecimal cardAmount; + private BigDecimal cashAmount; + private BigDecimal chequeAmount; + private BigDecimal totalCosts; + private BigDecimal salesExcVat; + private BigDecimal salesExempt; + private BigDecimal purchasesExcVat; + private BigDecimal purchasesExempt; + private BigDecimal creditNoteExcVat; + private BigDecimal creditNoteExempt; + private BigDecimal debitNoteExcVat; + private BigDecimal debitNoteExempt; + private BigDecimal total; + private String orderType; + private Timestamp date; + + public int getOrderId() + { + return orderId; + } + public void setOrderId(int orderId) + { + this.orderId = orderId; + } + public int[] getOrderLineId() + { + return orderLineId; + } + public void setOrderLineId(int[] orderLineId) + { + this.orderLineId = orderLineId; + } + public int[] getProductId() + { + return productId; + } + public void setProductId(int[] productId) + { + this.productId = productId; + } + public int getBPartnerId() + { + return bPartnerId; + } + public void setBPartnerId(int partnerId) + { + bPartnerId = partnerId; + } + public BigDecimal getLinesTotals() + { + return linesTotals; + } + public void setLinesTotals(BigDecimal linesTotals) + { + this.linesTotals = linesTotals; + } + public BigDecimal getGrandTotals() + { + return grandTotals; + } + public void setGrandTotals(BigDecimal grandTotals) + { + this.grandTotals = grandTotals; + } + public BigDecimal getTotalTaxAmount() + { + return totalTaxAmount; + } + public void setTotalTaxAmount(BigDecimal totalTaxAmount) + { + this.totalTaxAmount = totalTaxAmount; + } + public BigDecimal getCardAmount() + { + return cardAmount; + } + public void setCardAmount(BigDecimal cardAmount) + { + this.cardAmount = cardAmount; + } + public BigDecimal getCashAmount() + { + return cashAmount; + } + public void setCashAmount(BigDecimal cashAmount) + { + this.cashAmount = cashAmount; + } + public BigDecimal getChequeAmount() + { + return chequeAmount; + } + public void setChequeAmount(BigDecimal chequeAmount) + { + this.chequeAmount = chequeAmount; + } + public BigDecimal getTotalCosts() + { + return totalCosts; + } + public void setTotalCosts(BigDecimal totalCosts) + { + this.totalCosts = totalCosts; + } + public BigDecimal getSalesExcVat() + { + return salesExcVat; + } + public void setSalesExcVat(BigDecimal salesExcVat) + { + this.salesExcVat = salesExcVat; + } + public BigDecimal getSalesExempt() + { + return salesExempt; + } + public void setSalesExempt(BigDecimal salesExempt) + { + this.salesExempt = salesExempt; + } + public BigDecimal getCreditNoteExcVat() + { + return creditNoteExcVat; + } + public void setCreditNoteExcVat(BigDecimal creditNoteExcVat) + { + this.creditNoteExcVat = creditNoteExcVat; + } + public BigDecimal getCreditNoteExempt() + { + return creditNoteExempt; + } + public void setCreditNoteExempt(BigDecimal creditNoteExempt) + { + this.creditNoteExempt = creditNoteExempt; + } + public BigDecimal getTotal() + { + return total; + } + public void setTotal(BigDecimal total) + { + this.total = total; + } + public String getOrderType() + { + return orderType; + } + public void setOrderType(String orderType) + { + this.orderType = orderType; + } + public Timestamp getDate() + { + return date; + } + public void setDate(Timestamp date) + { + this.date = date; + } + public BigDecimal getDebitNoteExcVat() + { + return debitNoteExcVat; + } + public void setDebitNoteExcVat(BigDecimal debitNoteExcVat) + { + this.debitNoteExcVat = debitNoteExcVat; + } + public BigDecimal getDebitNoteExempt() + { + return debitNoteExempt; + } + public void setDebitNoteExempt(BigDecimal debitNoteExempt) + { + this.debitNoteExempt = debitNoteExempt; + } + public BigDecimal getPurchasesExcVat() + { + return purchasesExcVat; + } + public void setPurchasesExcVat(BigDecimal purchasesExcVat) + { + this.purchasesExcVat = purchasesExcVat; + } + public BigDecimal getPurchasesExempt() + { + return purchasesExempt; + } + public void setPurchasesExempt(BigDecimal purchasesExempt) + { + this.purchasesExempt = purchasesExempt; + } + +} diff --git a/posterita/posterita/src/main/org/posterita/beans/SearchBean.java b/posterita/posterita/src/main/org/posterita/beans/SearchBean.java new file mode 100644 index 0000000000..bc990d6916 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/SearchBean.java @@ -0,0 +1,82 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +* Created on May 15, 2006 by ashley +* +*/ + +package org.posterita.beans; + +import java.util.ArrayList; + +public class SearchBean +{ + + protected String searchText; + protected ArrayList andCriteriasList; + protected ArrayList orCriteriasList; + protected ArrayList notCriteriasList; + + public SearchBean(String searchText) + { + this.searchText = searchText; + andCriteriasList = new ArrayList(); + orCriteriasList = new ArrayList(); + notCriteriasList = new ArrayList(); + } + + public ArrayList getAndCriteriasList() + { + return andCriteriasList; + } + + public void setAndCriteriasList(ArrayList andCriteriasList) + { + this.andCriteriasList = andCriteriasList; + } + + public ArrayList getNotCriteriasList() + { + return notCriteriasList; + } + + public void setNotCriteriasList(ArrayList notCriteriasList) + { + this.notCriteriasList = notCriteriasList; + } + + public ArrayList getOrCriteriasList() + { + return orCriteriasList; + } + + public void setOrCriteriasList(ArrayList orCriteriasList) + { + this.orCriteriasList = orCriteriasList; + } + + public String getSearchText() + { + return searchText; + } + + public void setSearchText(String searchText) + { + this.searchText = searchText; + } +} diff --git a/posterita/posterita/src/main/org/posterita/beans/SearchOrderBean.java b/posterita/posterita/src/main/org/posterita/beans/SearchOrderBean.java new file mode 100644 index 0000000000..02a2f4c8a2 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/SearchOrderBean.java @@ -0,0 +1,51 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Nov 8, 2005 by praveen + * + */ +package org.posterita.beans; + +public class SearchOrderBean extends UDIBean +{ + + public Integer getOrderId() + { + return orderId; + } + + public void setOrderId(Integer orderId) + { + this.orderId = orderId; + } + + public Integer getFirst() + { + return first; + } + + public void setFirst(Integer first) + { + this.first = first; + } + + + + + +} diff --git a/posterita/posterita/src/main/org/posterita/beans/ShipperBean.java b/posterita/posterita/src/main/org/posterita/beans/ShipperBean.java new file mode 100644 index 0000000000..eab92da52f --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/ShipperBean.java @@ -0,0 +1,45 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +package org.posterita.beans; + + +public class ShipperBean extends UDIBean +{ + public String getName() + { + return name; + } + + public void setName(String name) + { + this.name = name; + } + + public String getDescription() + { + return description; + } + + public void setDescription(String description) + { + this.description = description; + } + +} diff --git a/posterita/posterita/src/main/org/posterita/beans/ShoppingCartBean.java b/posterita/posterita/src/main/org/posterita/beans/ShoppingCartBean.java new file mode 100644 index 0000000000..36fa13aa98 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/ShoppingCartBean.java @@ -0,0 +1,71 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +package org.posterita.beans; + +import java.math.BigDecimal; +import java.util.ArrayList; + + +public class ShoppingCartBean extends UDIBean +{ + private ArrayList items; + private String currency; + private BigDecimal totalPrice; + private int pricelistId; + + public String getCurrency() + { + return currency; + } + + public void setCurrency(String currency) + { + this.currency = currency; + } + + public ArrayList getItems() + { + return items; + } + + public void setItems(ArrayList items) + { + this.items = items; + } + + public BigDecimal getTotalPrice() + { + return totalPrice; + } + + public void setTotalPrice(BigDecimal totalPrice) + { + this.totalPrice = totalPrice; + } + + public int getPricelistId() { + return pricelistId; + } + + public void setPricelistId(int pricelistId) { + this.pricelistId = pricelistId; + } + +} diff --git a/posterita/posterita/src/main/org/posterita/beans/StatementOfAccountBean.java b/posterita/posterita/src/main/org/posterita/beans/StatementOfAccountBean.java new file mode 100644 index 0000000000..d683a280e5 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/StatementOfAccountBean.java @@ -0,0 +1,87 @@ +/** + * + * Copyright (c) 2008 Posterita. All Rights Reserved. + * + * This software is the confidential and proprietary information of + * Posterita. ("Confidential Information"). You shall not + * disclose such Confidential Information and shall use it only in + * accordance with the terms of the license agreement you entered into + * with Posterita. + * + * POSTERITA MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE + * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT + * NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR + * A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. POSTERITA SHALL NOT + * BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, + * MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. + * + * Aug 12, 2008 10:39:24 PM by praveen + * + */ + +package org.posterita.beans; + +import java.math.BigDecimal; +import java.sql.Timestamp; + +public class StatementOfAccountBean +{ + private Timestamp date; + private String reference; + private String docType; + private int docId; + private String details; + private BigDecimal credit; + private BigDecimal debit; + private BigDecimal balance; + + public Timestamp getDate() { + return date; + } + public void setDate(Timestamp date) { + this.date = date; + } + public String getReference() { + return reference; + } + public void setReference(String reference) { + this.reference = reference; + } + public String getDocType() { + return docType; + } + public void setDocType(String docType) { + this.docType = docType; + } + public String getDetails() { + return details; + } + public void setDetails(String details) { + this.details = details; + } + public BigDecimal getCredit() { + return credit; + } + public void setCredit(BigDecimal credit) { + this.credit = credit; + } + public BigDecimal getDebit() { + return debit; + } + public void setDebit(BigDecimal debit) { + this.debit = debit; + } + public BigDecimal getBalance() { + return balance; + } + public void setBalance(BigDecimal balance) { + this.balance = balance; + } + public int getDocId() { + return docId; + } + public void setDocId(int docId) { + this.docId = docId; + } + +} diff --git a/posterita/posterita/src/main/org/posterita/beans/StockBean.java b/posterita/posterita/src/main/org/posterita/beans/StockBean.java new file mode 100644 index 0000000000..17fee5e726 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/StockBean.java @@ -0,0 +1,347 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +package org.posterita.beans; + + + +public class StockBean extends UDIBean +{ + public String getKeyword2() + { + return keyword2; + } + + public void setKeyword2(String keyword2) + { + this.keyword2 = keyword2; + } + + public Integer getProductCategoryId() + { + return productCategoryId; + } + + public void setProductCategoryId(Integer productCategoryId) + { + this.productCategoryId = productCategoryId; + } + + public Integer getMake() + { + return make; + } + public void setMake(Integer make) + { + this.make = make; + } + + public String getAvailableForBackOrderFilter() { + + return availableForBackOrderFilter; + } + + public void setAvailableForBackOrderFilter(String availableForBackOrderFilter) + { + this.availableForBackOrderFilter = availableForBackOrderFilter; + } + + public Integer getModel() + { + return model; + } + + public void setModel(Integer model) + { + this.model = model; + } + + public Integer getColour() + { + return colour; + } + + public void setColour(Integer colour) + { + this.colour = colour; + } + + public Integer getTransmission() + { + return transmission; + } + + public void setTransmission(Integer transmission) + { + this.transmission = transmission; + } + + public Integer getYear() + { + return year; + } + + public void setYear(Integer year) + { + this.year = year; + } + + public Boolean getIsWholesaler() + { + return isWholesaler; + } + + public void setIsWholesaler(Boolean isWholesaler) + { + this.isWholesaler = isWholesaler; + } + + public Integer getRegionId() + { + return regionId; + } + + public void setRegionId(Integer regionId) + { + this.regionId = regionId; + } + + + + public Integer[] getCheckBox() + { + return checkBox; + } + public void setCheckBox(Integer [] checkBox) + { + this.checkBox = checkBox; + } + + public Integer getReserveStatus() + { + return reserveStatus; + } + + public void setReserveStatus(Integer reserveStatus) + { + this.reserveStatus = reserveStatus; + } + + + public Integer getOrgId() + { + return orgId; + } + + public void setOrgId(Integer orgId) + { + this.orgId = orgId; + } + + public Integer getAllocationId() + { + return allocationId; + } + + public void setAllocationId(Integer allocationId) + { + this.allocationId = allocationId; + } + + public String getWarehouseType() + { + return warehouseType; + } + + public void setWarehouseType(String warehouseType) + { + this.warehouseType = warehouseType; + } + + public Integer getFirst() + { + return first; + } + + public void setFirst(Integer first) + { + this.first = first; + } + + public Integer getWarehouseId() + { + return warehouseId; + } + + public void setWarehouseId(Integer warehouseId) + { + this.warehouseId = warehouseId; + } + public Integer getDocumentId() { + return documentId; + } + public void setDocumentId(Integer documentId) { + this.documentId = documentId; + } + + public String getETAFilter() + { + return ETAFilter; + } + + public void setETAFilter(String filter) + { + ETAFilter = filter; + } + + public Integer getDesign() + { + return design; + } + public void setDesign(Integer design) + { + this.design = design; + } + public Integer getSize() + { + return size; + } + public void setSize(Integer size) + { + this.size = size; + } + public Integer getStyle() + { + return style; + } + public void setStyle(Integer style) + { + this.style = style; + } + + public Integer getColourAttributeValueId() + { + return colourAttributeValueId; + } + + public void setColourAttributeValueId(Integer colourAttributeValueId) + { + this.colourAttributeValueId = colourAttributeValueId; + } + + public Integer getDesignAttributeValueId() + { + return designAttributeValueId; + } + + public void setDesignAttributeValueId(Integer designAttributeValueId) + { + this.designAttributeValueId = designAttributeValueId; + } + + public Integer getModelAttributeValueId() + { + return modelAttributeValueId; + } + + public void setModelAttributeValueId(Integer modelAttributeValueId) + { + this.modelAttributeValueId = modelAttributeValueId; + } + + public Integer getSizeAttributeValueId() + { + return sizeAttributeValueId; + } + + public void setSizeAttributeValueId(Integer sizeAttributeValueId) + { + this.sizeAttributeValueId = sizeAttributeValueId; + } + + public String getDescription() + { + return description; + } + + public void setDescription(String description) + { + this.description = description; + } + + public String getOrderType() + { + return orderType; + } + + public void setOrderType(String orderType) + { + this.orderType = orderType; + } + + public Integer getAttributeId() + { + return attributeId; + } + + public void setAttributeId(Integer attributeId) + { + this.attributeId = attributeId; + } + + public String getKeyword() + { + return keyword; + } + + public void setKeyword(String keyword) + { + this.keyword = keyword; + } + + public String getBackOrder() + { + return backOrder; + } + + public void setBackOrder(String backOrder) + { + this.backOrder = backOrder; + } + + public String getFieldName() + { + return fieldName; + } + + public void setFieldName(String fieldName) + { + this.fieldName = fieldName; + } + + public Integer getProductId() + { + return productId; + } + + public void setProductId(Integer productId) + { + this.productId = productId; + } +} diff --git a/posterita/posterita/src/main/org/posterita/beans/StockMovementBean.java b/posterita/posterita/src/main/org/posterita/beans/StockMovementBean.java new file mode 100644 index 0000000000..4fd1f1dcf3 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/StockMovementBean.java @@ -0,0 +1,459 @@ +package org.posterita.beans; + +import java.math.BigDecimal; +import java.util.ArrayList; + +public class StockMovementBean +{ + private String isApproved; + private String address1; + private String address2; + private Integer movementLineId; + private Integer lineNo; + private Integer moveConfirmId; + private String orgFromName; + private String orgToName; + private Integer index; + private String movementDate; + private String documentNo; + private String documentType; + private String docStatus; + private Integer movementId; + private Integer refNo; + private StockMovementBean stock; + private ArrayList stockList; + private Boolean isActive; + private Integer orgFromId; + private Integer orgToId; + private BigDecimal qtyToMove; + private BigDecimal qtyOnHand; + private Integer orgId; + private String uom; + private Integer productId; + private String productName; + private String description; + private String barCode; + private BigDecimal quantity; + private String orgName; + private String fromDate; + private String toDate; + private Integer salesPriceListId; + private BigDecimal stockValue; + private String ifAdd; + private Integer priceListId; + private Integer noOfPack; + private String reference; + private Integer month; + private Integer year; + + public BigDecimal getStockValue() + { + return stockValue; + } + + public void setStockValue(BigDecimal stockValue) + { + this.stockValue = stockValue; + } + + public Integer getSalesPriceListId() + { + return salesPriceListId; + } + + public void setSalesPriceListId(Integer salesPriceListId) + { + this.salesPriceListId = salesPriceListId; + } + + public String getIsApproved() + { + return isApproved; + } + + public void setIsApproved(String isApproved) + { + this.isApproved = isApproved; + } + + public String getAddress1() + { + return address1; + } + + public void setAddress1(String address1) + { + this.address1 = address1; + } + + public String getAddress2() + { + return address2; + } + + public void setAddress2(String address2) + { + this.address2 = address2; + } + + public Integer getMovementLineId() + { + return movementLineId; + } + + public void setMovementLineId(Integer movementLineId) + { + this.movementLineId = movementLineId; + } + + public Integer getLineNo() + { + return lineNo; + } + + public void setLineNo(Integer lineNo) + { + this.lineNo = lineNo; + } + + public Integer getMoveConfirmId() + { + return moveConfirmId; + } + + public void setMoveConfirmId(Integer moveConfirmId) + { + this.moveConfirmId = moveConfirmId; + } + + public String getOrgFromName() + { + return orgFromName; + } + + public void setOrgFromName(String orgFromName) + { + this.orgFromName = orgFromName; + } + + public String getOrgToName() + { + return orgToName; + } + + public void setOrgToName(String orgToName) + { + this.orgToName = orgToName; + } + + public Integer getIndex() + { + return index; + } + + public void setIndex(Integer index) + { + this.index = index; + } + + public String getMovementDate() + { + return movementDate; + } + + public void setMovementDate(String movementDate) + { + this.movementDate = movementDate; + } + + public String getDocumentNo() + { + return documentNo; + } + + public void setDocumentNo(String documentNo) + { + this.documentNo = documentNo; + } + + public String getDocumentType() + { + return documentType; + } + + public void setDocumentType(String documentType) + { + this.documentType = documentType; + } + + public String getDocStatus() + { + return docStatus; + } + + public void setDocStatus(String docStatus) + { + this.docStatus = docStatus; + } + + public Integer getMovementId() + { + return movementId; + } + + public void setMovementId(Integer movementId) + { + this.movementId = movementId; + } + + public Integer getRefNo() + { + return refNo; + } + + public void setRefNo(Integer refNo) + { + this.refNo = refNo; + } + + public StockMovementBean getStock() + { + return stock; + } + + public void setStock(StockMovementBean stock) + { + this.stock = stock; + } + + public ArrayList getStockList() + { + return stockList; + } + + public void setStockList(ArrayList stockList) + { + this.stockList = stockList; + } + + public Boolean getIsActive() + { + return isActive; + } + + public void setIsActive(Boolean isActive) + { + this.isActive = isActive; + } + + public Integer getOrgFromId() + { + return orgFromId; + } + + public void setOrgFromId(Integer orgFromId) + { + this.orgFromId = orgFromId; + } + + public Integer getOrgToId() + { + return orgToId; + } + + public void setOrgToId(Integer orgToId) + { + this.orgToId = orgToId; + } + + public BigDecimal getQtyToMove() + { + return qtyToMove; + } + + public void setQtyToMove(BigDecimal qtyToMove) + { + this.qtyToMove = qtyToMove; + } + + public BigDecimal getQtyOnHand() + { + return qtyOnHand; + } + + public void setQtyOnHand(BigDecimal qtyOnHand) + { + this.qtyOnHand = qtyOnHand; + } + + public Integer getOrgId() + { + return orgId; + } + + public void setOrgId(Integer orgId) + { + this.orgId = orgId; + } + + public String getUom() + { + return uom; + } + + public void setUom(String uom) + { + this.uom = uom; + } + + public Integer getProductId() + { + return productId; + } + + public void setProductId(Integer productId) + { + this.productId = productId; + } + + public String getProductName() + { + return productName; + } + + public void setProductName(String productName) + { + this.productName = productName; + } + + public String getDescription() + { + return description; + } + + public void setDescription(String description) + { + this.description = description; + } + + public String getBarCode() + { + return barCode; + } + + public void setBarCode(String barCode) + { + this.barCode = barCode; + } + + public void setQuantity(BigDecimal quantity) + { + this.quantity = quantity; + } + + public BigDecimal getQuantity() + { + return this.quantity; + } + + public String getOrgName() + { + return orgName; + } + + public void setOrgName(String orgName) + { + this.orgName = orgName; + } + + public String getFromDate() + { + return fromDate; + } + + public void setFromDate(String fromDate) + { + this.fromDate = fromDate; + } + + public String getToDate() + { + return toDate; + } + + public void setToDate(String toDate) + { + this.toDate = toDate; + } + + public String getIfAdd() { + return ifAdd; + } + public void setIfAdd(String ifAdd) { + this.ifAdd = ifAdd; + } + + public void updateQuantity(StockMovementBean original, StockMovementBean itemToAdd, boolean add) + { + BigDecimal originalQuantity = original.getQtyToMove(); + + BigDecimal quantityToAdd = itemToAdd.getQtyToMove(); + + BigDecimal finalQuantity = null; + + if(!add) + finalQuantity= originalQuantity.subtract(quantityToAdd); + else + finalQuantity= originalQuantity.add(quantityToAdd); + + + original.setQtyToMove(finalQuantity); + } + + public Integer getPriceListId() + { + return priceListId; + } + + public void setPriceListId(Integer priceListId) + { + this.priceListId = priceListId; + } + + public Integer getNoOfPack() + { + return noOfPack; + } + + public void setNoOfPack(Integer noOfPack) + { + this.noOfPack = noOfPack; + } + + public String getReference() + { + return reference; + } + + public void setReference(String reference) + { + this.reference = reference; + } + + public Integer getMonth() + { + return month; + } + public void setMonth(Integer month) + { + this.month = month; + } + public Integer getYear() + { + return year; + } + public void setYear(Integer year) + { + this.year = year; + } +} diff --git a/posterita/posterita/src/main/org/posterita/beans/SynchronizationBean.java b/posterita/posterita/src/main/org/posterita/beans/SynchronizationBean.java new file mode 100644 index 0000000000..80e22b9ba8 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/SynchronizationBean.java @@ -0,0 +1,75 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + **/ + +/** + @author ashley + */ + +package org.posterita.beans; + +import java.util.ArrayList; + +public class SynchronizationBean +{ + private ArrayList productNotInactivatedList; + private int productsInactivated; + private int errorsProductInactivate; + + public SynchronizationBean() + { + productNotInactivatedList = new ArrayList(); + } + + public int getErrorsProductInactivate() + { + return errorsProductInactivate; + } + + public void setErrorsProductInactivate(int errorsProductInactivate) + { + this.errorsProductInactivate = errorsProductInactivate; + } + + public ArrayList getProductNotInactivatedList() + { + return productNotInactivatedList; + } + + public void setProductNotInactivatedList(ArrayList productNotInactivatedList) + { + this.productNotInactivatedList = productNotInactivatedList; + } + + public int getProductsInactivated() + { + return productsInactivated; + } + + public void setProductsInactivated(int productsInactivated) + { + this.productsInactivated = productsInactivated; + } + + public void addNotInactivatedProduct(String productName) + { + this.productNotInactivatedList.add(productName); + } +} diff --git a/posterita/posterita/src/main/org/posterita/beans/SynchronizeCollectionBean.java b/posterita/posterita/src/main/org/posterita/beans/SynchronizeCollectionBean.java new file mode 100644 index 0000000000..833c8c5af2 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/SynchronizeCollectionBean.java @@ -0,0 +1,89 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + **/ + +/** + @author ashley + */ + +package org.posterita.beans; + +public class SynchronizeCollectionBean extends UDIBean +{ + public String getStartDay() + { + return startDay; + } + + public void setStartDay(String startDay) + { + this.startDay = startDay; + } + + public String getStartHour() + { + return startHour; + } + + public void setStartHour(String startHour) + { + this.startHour = startHour; + } + + public String getStartMinute() + { + return startMinute; + } + + public void setStartMinute(String startMinute) + { + this.startMinute = startMinute; + } + + public String getStartMonth() + { + return startMonth; + } + + public void setStartMonth(String startMonth) + { + this.startMonth = startMonth; + } + + public String getStartYear() + { + return startYear; + } + + public void setStartYear(String startYear) + { + this.startYear = startYear; + } + + public String getFromDate() + { + return fromDate; + } + + public void setFromDate(String fromDate) + { + this.fromDate = fromDate; + } +} diff --git a/posterita/posterita/src/main/org/posterita/beans/TShirtProductDetailsBean.java b/posterita/posterita/src/main/org/posterita/beans/TShirtProductDetailsBean.java new file mode 100644 index 0000000000..9b05ce4651 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/TShirtProductDetailsBean.java @@ -0,0 +1,61 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +* Created on May 5, 2006 by ashley +* +*/ + +package org.posterita.beans; + +public class TShirtProductDetailsBean extends UDIBean +{ + + + public String[] getColours() + { + return colours; + } + public void setColours(String[] colours) + { + this.colours = colours; + } + public String[] getSizes() + { + return sizes; + } + public void setSizes(String[] sizes) + { + this.sizes = sizes; + } + public Integer getProductId() + { + return productId; + } + public void setProductId(Integer productId) + { + this.productId = productId; + } + public String getImageLink() + { + return imageLink; + } + public void setImageLink(String imageLink) + { + this.imageLink = imageLink; + } +} diff --git a/posterita/posterita/src/main/org/posterita/beans/TabularReportRecordBean.java b/posterita/posterita/src/main/org/posterita/beans/TabularReportRecordBean.java new file mode 100644 index 0000000000..9c488c5f36 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/TabularReportRecordBean.java @@ -0,0 +1,68 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * 06-Oct-2006 10:51:52 by praveen + * + */ + +package org.posterita.beans; + +import java.math.BigDecimal; + +public class TabularReportRecordBean +{ + private String productName; + private String date; + private BigDecimal price; + private BigDecimal qty; + + public String getDate() { + return date; + } + + public void setDate(String date) { + this.date = date; + } + + public BigDecimal getPrice() { + return price; + } + + public void setPrice(BigDecimal price) { + this.price = price; + } + + public String getProductName() { + return productName; + } + + public void setProductName(String productName) { + this.productName = productName; + } + + public BigDecimal getQty() { + return qty; + } + + public void setQty(BigDecimal qty) { + this.qty = qty; + } + + + +} diff --git a/posterita/posterita/src/main/org/posterita/beans/TaxBean.java b/posterita/posterita/src/main/org/posterita/beans/TaxBean.java new file mode 100644 index 0000000000..144239c96d --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/TaxBean.java @@ -0,0 +1,81 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Nov 28, 2006 + */ + + +package org.posterita.beans; + +import java.math.BigDecimal; + + +public class TaxBean extends UDIBean +{ + + public Integer getOrgId() { + return orgId; + } + public void setOrgId(Integer orgId) { + this.orgId = orgId; + } + public Boolean getIsActive() { + return isActive; + } + public void setIsActive(Boolean isActive) { + this.isActive = isActive; + } + public String getDescription() { + return description; + } + public void setDescription(String description) { + this.description = description; + } + public Boolean getIsTaxExempted() { + return isTaxExempted; + } + public void setIsTaxExempted(Boolean isTaxExempted) { + this.isTaxExempted = isTaxExempted; + } + public Integer getTaxCategoryId() { + return taxCategoryId; + } + public void setTaxCategoryId(Integer taxCategoryId) { + this.taxCategoryId = taxCategoryId; + } + public Integer getTaxId() { + return taxId; + } + public void setTaxId(Integer taxId) { + this.taxId = taxId; + } + public String getTaxName() { + return taxName; + } + public void setTaxName(String taxName) { + this.taxName = taxName; + } + public BigDecimal getTaxRate() { + return taxRate; + } + public void setTaxRate(BigDecimal taxRate) { + this.taxRate = taxRate; + } + + +} diff --git a/posterita/posterita/src/main/org/posterita/beans/TerminalBean.java b/posterita/posterita/src/main/org/posterita/beans/TerminalBean.java new file mode 100644 index 0000000000..b50d366e9c --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/TerminalBean.java @@ -0,0 +1,398 @@ +/****************************************************************************** + * Product: Posterita Web-Based POS and Adempiere Plugin * + * Copyright (C) 2008 Posterita Ltd * + * This file is part of POSterita * + * * + * POSterita is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * + *****************************************************************************/ +package org.posterita.beans; + +import java.sql.Timestamp; + +/** + * @author Ashley G Ramdass Apr 14, 2008 + */ +public class TerminalBean extends UDIBean +{ + protected Integer terminalId; + protected Integer purchasePriceListId; + protected Integer salesPriceListId; + + protected String cashbookTransferType; + protected String checkTransferType; + protected String cardTransferType; + protected Integer cardBankAccountId; + protected Integer checkBankAccountId; + protected Integer templateBPartnerId; + protected Integer cashbookTransferCashbookId; + protected Integer cashbookTransferBankAccountId; + protected Integer checkTransferCashbookId; + protected Integer checkTransferBankAccountId; + protected Integer cardTransferCashbookId; + protected Integer cardTransferBankAccountId; + protected Boolean autoLock; + protected Boolean locked; + protected Integer lockingTime; + protected Timestamp lastLockTime; + protected Timestamp unlockingTime; + + private String orgName; + private String poPriceList; + private String soPriceList; + private Boolean isCurrentTerminal = false; + + public Integer getTerminalId() + { + return (terminalId == null ? 0 : terminalId) ; + } + + public void setTerminalId(Integer terminalId) + { + this.terminalId = terminalId; + } + + public String getName() + { + return this.name; + } + + public void setName(String name) + { + this.name = name; + } + + public Integer getOrgId() + { + return (orgId == null ? 0 : orgId); + } + + public void setOrgId(Integer orgId) + { + this.orgId = orgId; + } + + public Integer getBpartnerId() + { + return (bpartnerId == null ? 0 : bpartnerId); + } + + public void setBpartnerId(Integer bpartnerId) + { + this.bpartnerId = bpartnerId; + } + + public Integer getWarehouseId() + { + return (warehouseId == null ? 0 : warehouseId); + } + + public void setWarehouseId(Integer warehouseId) + { + this.warehouseId = warehouseId; + } + + public Integer getPurchasePriceListId() + { + return (purchasePriceListId == null ? 0 : purchasePriceListId); + } + + public void setPurchasePriceListId(Integer purchasePriceListId) + { + this.purchasePriceListId = purchasePriceListId; + } + + public Integer getSalesPriceListId() + { + return (salesPriceListId == null ? 0 : salesPriceListId); + } + + public void setSalesPriceListId(Integer salesPriceListId) + { + this.salesPriceListId = salesPriceListId; + } + + public Integer getCashBookId() + { + return (cashBookId == null ? 0 : cashBookId); + } + + public void setCashBookId(Integer cashBookId) + { + this.cashBookId = cashBookId; + } + + public Integer getCheckBankAccountId() + { + return (checkBankAccountId == null ? 0 : checkBankAccountId); + } + + public void setCheckBankAccountId(Integer checkBankAccountId) + { + this.checkBankAccountId = checkBankAccountId; + } + + public Boolean getAutoLock() + { + return autoLock; + } + + public void setAutoLock(Boolean autoLock) + { + this.autoLock = autoLock; + } + + public String getDescription() + { + return description; + } + + public void setDescription(String description) + { + this.description = description; + } + + public Integer getTemplateBPartnerId() + { + return (templateBPartnerId == null ? 0 : templateBPartnerId); + } + + public void setTemplateBPartnerId(Integer templateBPartnerId) + { + this.templateBPartnerId = templateBPartnerId; + } + + public Integer getCashbookTransferCashbookId() + { + return (cashbookTransferCashbookId == null ? 0 : cashbookTransferCashbookId); + } + + public void setCashbookTransferCashbookId(Integer cashTransferCashbookId) + { + this.cashbookTransferCashbookId = cashTransferCashbookId; + } + + public Integer getCashbookTransferBankAccountId() + { + return cashbookTransferBankAccountId; + } + + public void setCashbookTransferBankAccountId(Integer cashTransferBankAccountId) + { + this.cashbookTransferBankAccountId = cashTransferBankAccountId; + } + + public Integer getCheckTransferCashbookId() + { + return checkTransferCashbookId; + } + + public void setCheckTransferCashbookId(Integer checkTransferCashbookId) + { + this.checkTransferCashbookId = checkTransferCashbookId; + } + + public Integer getCheckTransferBankAccountId() + { + return checkTransferBankAccountId; + } + + public void setCheckTransferBankAccountId(Integer checkTransferBankAccountId) + { + this.checkTransferBankAccountId = checkTransferBankAccountId; + } + + public Integer getCardTransferCashbookId() + { + return cardTransferCashbookId; + } + + public void setCardTransferCashbookId(Integer cardTransferCashbookId) + { + this.cardTransferCashbookId = cardTransferCashbookId; + } + + public Integer getCardTransferBankAccountId() + { + return (cardTransferBankAccountId == null ? 0 : cardTransferBankAccountId); + } + + public void setCardTransferBankAccountId( + Integer cardTransferBankAccountId) + { + this.cardTransferBankAccountId = cardTransferBankAccountId; + } + + public Boolean getLocked() + { + return locked; + } + + public void setLocked(Boolean locked) + { + this.locked = locked; + } + + public Integer getCardBankAccountId() + { + return (cardBankAccountId == null ? 0 : cardBankAccountId); + } + + public void setCardBankAccountId(Integer cardBankAccountId) + { + this.cardBankAccountId = cardBankAccountId; + } + + public String getCashbookTransferType() + { + return cashbookTransferType; + } + + public void setCashbookTransferType(String cashbookTransferType) + { + this.cashbookTransferType = cashbookTransferType; + } + + public String getCheckTransferType() + { + return checkTransferType; + } + + public void setCheckTransferType(String checkTransferType) + { + this.checkTransferType = checkTransferType; + } + + public String getCardTransferType() + { + return cardTransferType; + } + + public void setCardTransferType(String cardTransferType) + { + this.cardTransferType = cardTransferType; + } + + /** + * @return the lockingTime + */ + public Integer getLockingTime() + { + return lockingTime; + } + + /** + * @param lockingTime the lockingTime to set + */ + public void setLockingTime(Integer lockingTime) + { + this.lockingTime = lockingTime; + } + + /** + * @return the orgName + */ + public String getOrgName() + { + return orgName; + } + + /** + * @param orgName the orgName to set + */ + public void setOrgName(String orgName) + { + this.orgName = orgName; + } + + /** + * @return the poPriceList + */ + public String getPoPriceList() + { + return poPriceList; + } + + /** + * @param poPriceList the poPriceList to set + */ + public void setPoPriceList(String poPriceList) + { + this.poPriceList = poPriceList; + } + + /** + * @return the soPriceList + */ + public String getSoPriceList() + { + return soPriceList; + } + + /** + * @param soPriceList the soPriceList to set + */ + public void setSoPriceList(String soPriceList) + { + this.soPriceList = soPriceList; + } + + /** + * @return the lastLockTime + */ + public Timestamp getLastLockTime() + { + return lastLockTime; + } + + /** + * @param lastLockTime the lastLockTime to set + */ + public void setLastLockTime(Timestamp lastLockTime) + { + this.lastLockTime = lastLockTime; + } + + /** + * @return the unlockingTime + */ + public Timestamp getUnlockingTime() + { + return unlockingTime; + } + + /** + * @param unlockingTime the unlockingTime to set + */ + public void setUnlockingTime(Timestamp unlockingTime) + { + this.unlockingTime = unlockingTime; + } + + /** + * @return The isCurrentTerminal + */ + public Boolean getIsCurrentTerminal() + { + return isCurrentTerminal; + } + + /** + * @param isCurrentTerminal The isCurrentTerminal to set + */ + public void setIsCurrentTerminal(Boolean isCurrentTerminal) + { + this.isCurrentTerminal = isCurrentTerminal; + } +} diff --git a/posterita/posterita/src/main/org/posterita/beans/TestMod.java b/posterita/posterita/src/main/org/posterita/beans/TestMod.java new file mode 100644 index 0000000000..aedc1ea9ca --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/TestMod.java @@ -0,0 +1,17 @@ +package org.posterita.beans; + +import java.math.BigDecimal; + +public class TestMod +{ + public static void main(String args[]) + { + BigDecimal qtyOnHand = new BigDecimal(100); + BigDecimal qtyEntered = new BigDecimal(50); + BigDecimal qtyOrdered = new BigDecimal(25); + + BigDecimal qty = qtyOnHand.multiply(qtyEntered).divide(qtyOrdered, 12, BigDecimal.ROUND_HALF_UP); + + System.out.println(qty); + } +} diff --git a/posterita/posterita/src/main/org/posterita/beans/TradeInBean.java b/posterita/posterita/src/main/org/posterita/beans/TradeInBean.java new file mode 100644 index 0000000000..4f1f3c36a2 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/TradeInBean.java @@ -0,0 +1,56 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +package org.posterita.beans; + + +public class TradeInBean extends CustomerBean +{ + + public Integer getBpartnerId() + { + return bpartnerId; + } + + public void setBpartnerId(Integer bpartnerId) + { + this.bpartnerId = bpartnerId; + } + + public Double getPriceEntered() + { + return priceEntered; + } + + public void setPriceEntered(Double priceEntered) + { + this.priceEntered = priceEntered; + } + + public String getVinNumber() + { + return vinNumber; + } + + public void setVinNumber(String vinNumber) + { + this.vinNumber = vinNumber; + } + +} diff --git a/posterita/posterita/src/main/org/posterita/beans/TrendsBean.java b/posterita/posterita/src/main/org/posterita/beans/TrendsBean.java new file mode 100644 index 0000000000..d6b82b7077 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/TrendsBean.java @@ -0,0 +1,121 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Dec 15, 2005 by praveen + * + */ +package org.posterita.beans; + +public class TrendsBean +{ + private String model; + private String colour; + private int a1,m1; + private int a2,m2; + private int a3,m3; + private int sA1,sA2,sA3; + private int sM1,sM2,sM3; + + public TrendsBean(){} + + + public int getA1() { + return a1; + } + public void setA1(int a1) { + this.a1 = a1; + } + public int getA2() { + return a2; + } + public void setA2(int a2) { + this.a2 = a2; + } + public int getA3() { + return a3; + } + public void setA3(int a3) { + this.a3 = a3; + } + public String getColour() { + return colour; + } + public void setColour(String colour) { + this.colour = colour; + } + public int getM1() { + return m1; + } + public void setM1(int m1) { + this.m1 = m1; + } + public int getM2() { + return m2; + } + public void setM2(int m2) { + this.m2 = m2; + } + public int getM3() { + return m3; + } + public void setM3(int m3) { + this.m3 = m3; + } + public String getModel() { + return model; + } + public void setModel(String model) { + this.model = model; + } + public int getSA1() { + return sA1; + } + public void setSA1(int sa1) { + sA1 = sa1; + } + public int getSA2() { + return sA2; + } + public void setSA2(int sa2) { + sA2 = sa2; + } + public int getSA3() { + return sA3; + } + public void setSA3(int sa3) { + sA3 = sa3; + } + public int getSM1() { + return sM1; + } + public void setSM1(int sm1) { + sM1 = sm1; + } + public int getSM2() { + return sM2; + } + public void setSM2(int sm2) { + sM2 = sm2; + } + public int getSM3() { + return sM3; + } + public void setSM3(int sm3) { + sM3 = sm3; + } +} diff --git a/posterita/posterita/src/main/org/posterita/beans/UDIBean.java b/posterita/posterita/src/main/org/posterita/beans/UDIBean.java new file mode 100644 index 0000000000..f8428a597e --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/UDIBean.java @@ -0,0 +1,816 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +package org.posterita.beans; + +import java.math.BigDecimal; +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Stack; +import java.util.Vector; + +import org.apache.struts.upload.FormFile; +import org.posterita.core.JulianDate; + +public class UDIBean +{ + protected String bpAddress2; + protected String aaCardnumber; + protected String accountNo; + protected String accountType; + protected String accountName; + protected String address1; + protected String address2; + protected Boolean agreement; + protected String aisle; + protected Integer allocationId; + protected String allocationStatus; + protected String area; + protected String attribute; + protected Integer attributeId; + protected Integer attributeSetId; + protected Integer attributeSetInstanceId; + protected Integer [] sernoAttributeSetInstanceIds; + protected String attributeValue; + protected String availableForBackOrderFilter ="availableForBackOrder in ('Y', 'N')"; + protected Integer bankId; + protected Integer bankAccountId; + protected String bankName; + protected Integer basePriceListId; + protected String bin; + protected Integer bpartnerId; + protected Integer bPartnerLocationId; + protected Integer [] checkBox; + protected Boolean isChecked; + protected String checkNo; + protected String city; + protected Timestamp closingDate; + protected Integer colour; + protected String confirmEmail; + protected String confirmPassword; + protected Integer cost; + protected String counterOrderStatusInfo; + protected Integer counterOrgID; + protected String counterOrgName; + protected Double currentBalance; + protected String custIdNumber; + protected Timestamp dateCreated; + protected Timestamp dateUpdated; + protected Timestamp dateInvoiced; + protected Timestamp dateMovement; + protected Timestamp dateOrdered; + protected String datePromised; + protected Timestamp dateTrx; + protected String dealerName; + protected String description; + protected String district; + protected String docStatus; + protected Integer tradeInOrderlineId; + protected Integer attributeValueId; + protected String forward; + protected String birthdate; + + protected Boolean isFullAccess; + protected Boolean isOverwritePriceLimit; + + protected Boolean openDrawer = Boolean.TRUE; + + + + protected String docStatusCode; + + //1 is reserved -0 not reserved + + protected Integer documentId; + protected String documentNo; + + protected String documentType; + protected String email; + protected String endDay; + + protected String endHour; + protected String endMinute; + protected String endMonth; + protected String endYear; + protected String engineNo; + protected String engineNumber; + protected String fax; + protected String fromDate; + protected Integer fromOrderLineId; + protected Integer grandTotal; + protected BigDecimal grossProfit; + protected BigDecimal grossProfitPercentage; + protected BigDecimal totalGrossProfit; + protected BigDecimal totalGrossProfitPercentage; + protected Integer id; + protected Integer index; + protected Integer inOutId; + protected Integer invoiceId; + protected Boolean isAccessAllOrgs; + protected Boolean a; + protected String isApproved; + protected Boolean isAutomobile; + protected Boolean isAvailableForBackOrder = Boolean.valueOf("True"); + protected Boolean isClosable; + protected Boolean isCustomer; + protected Boolean isDefault = false; + protected String isDelivered; + protected Boolean isEmployee; + + protected String isInvoiced; + protected Boolean isMandatory = false; + protected Boolean isMotorcycle; + protected Boolean isNatisReleased; + protected String isPaid; + protected Boolean isPresentForProduct; + protected Boolean isPublic; + protected Boolean isQtyReserved; + protected String isReceipt; + protected Boolean isRetailer; + protected Boolean isSalesRep; + protected Boolean isActive = false; + protected Boolean isSoTrx; + protected Boolean isVendor; + protected Boolean isVisible; + protected Boolean isWholesaler; + protected String level; + protected BigDecimal limitPrice; + protected BigDecimal limitPriceIncl; + protected BigDecimal lineAmt; + protected Integer lineNetAmt; + protected Integer lineNo; + protected Integer lineTotalAmt; + protected ArrayList list; + protected BigDecimal listPrice; + protected BigDecimal listPriceIncl; + protected String location; + protected Integer locationId; + protected Integer locatorId; + protected String locatorName; + protected String logoName; + protected Integer m_attributesetinstance_id; + protected String maintenanceContractNumber; + protected Integer make; + protected Integer menuId; + protected String menuItemName; + protected String menuLink; + protected String message; + protected Integer messageID; + protected Integer minOutId; + protected String mobile; + protected Integer model; + protected Integer modelGroup; + protected Integer month; + protected Integer movementId; + protected Integer moveConfirmId; + protected Integer movementLineId; + protected String name; + + + protected Integer natisReleaseId; + protected String newEmail; + protected String newPassword; + protected Integer nextAvailableLocatorId; + protected String oldPassword; + protected Integer orderId; + protected ArrayList orderLineBean; + protected ArrayList roleBeanList = new ArrayList(); + protected Integer orderLineId; + protected int [] orderLineIds; + protected ArrayList orderLineList = new ArrayList(); + protected ArrayList InventoryLineList = new ArrayList(); + protected String orderStatusInfo; + protected String orderType; + protected Integer orgFromId; + protected String orgFromName; + protected Integer orgToId; + protected String orgToName; + protected String orgName; + protected String orgType; + protected Vector orgUsers; + protected Integer parentMenuId; + protected Integer partnerId; + protected Integer partnerLocationId; + protected String partnerName; + protected String password; + protected Stack path; + protected Integer payAmt; + protected Integer paymentId; + protected String phone; + protected String phone2; + protected String poReference; + protected String POReference; + protected String postalAddress; + protected String postalAddress1; + protected String postalCity; + protected String postalCode; + protected String postalPostalCode; + protected Integer prefOrderLineId; + protected BigDecimal priceActual; + protected Double priceEntered; + protected BigDecimal priceLimit; + protected BigDecimal priceList; + protected PriceListBean priceListBean; + protected ArrayList priceListBeanList; + protected Integer priceListVersionId; + protected ProductBean productBean; + protected ArrayList productBeanList = new ArrayList(); + protected Integer productCategoryId; + protected BigDecimal price; + + protected String productDetails; + protected Integer productId; + protected String productName; + protected Integer productQuantity; + protected Integer qtyInvoiced; + protected String qtyReserved; + protected BigDecimal quantity; + protected BigDecimal qtyOnHand; + protected BigDecimal qtyToMove; + protected String read; + protected Integer refInOutId; + protected Integer refNo; + protected Integer refOrderId; + protected Integer refOrderLineid; + protected Integer refToQuote; + protected ReportBean report; + ArrayList reportList = new ArrayList();; + protected String region; + protected Integer regionId; + protected String regionName; + protected String registerNumber; + + protected Integer reserveStatus; + + protected Integer roleId; + protected String roleName; + protected String routingNumber; + protected String sernoAttributeSetInstance; + protected String startDay; + protected String startHour; + protected String startMinute; + protected String startMonth; + protected String startYear; + protected Boolean status; + protected BigDecimal stdPrice; + protected BigDecimal stdPriceIncl; + protected Double stdPurchasePrice; + protected Double stdSalesPrice; + protected StockMovementBean stock; + protected ArrayList stockList = new ArrayList(); + protected String subject; + protected String submit; + + protected String surname; + protected Integer taxAmt; + protected Integer[] targetId; + protected String termsAgreement; + protected String toDate; + protected Integer toOrderLineId; + protected Integer totalLines; + protected Integer transmission; + protected Integer transmissionAttributeValueId; + protected String uom; + protected Integer userId; + protected Integer userID; + protected String username; + protected String vinNumber; + protected Integer warehouseId; + + protected Integer wareHouseId; + protected String warehouseName; + protected String warehouseType; + protected Integer year; + protected Integer yearAttributeValueId; + protected Integer makeAttributeValueId; + protected String[] qtyTargeted; + protected String sotrxFlag; + protected String bpName; + protected String compiereDocStatus; + protected String hondaDocStatus; + protected Integer first; + protected Integer licensingDistrictId; + protected String licensingDistrict; + + protected String passportNo; + protected String companyRegNo; + + protected String unitNumber; + protected Integer unitsPerPack; + protected String productCode; + protected Integer vehicleSpecsId; + protected String natisApplicationDate; + protected Timestamp processedDate; + + protected Timestamp natisRegistrationDate; + protected Timestamp wholesaleDate; + protected String natisControlNumber; + protected String natisRegisterNumber; + protected Integer natisModelNo; + protected String natisModelDescription; + + protected Integer enginePower; + protected Integer engineCapacity; + protected Integer tare; + protected Integer noOfWheels; + + protected Integer colourCodeMatchId; + protected String colourName; + protected String transmissionName; + protected String yearName; + + protected String mainColourCode; + protected String countryOfImpCode; + protected String shippingInvNo; + protected String estimatedTimeOfArrival; + protected String colourCodeHES; + + protected String licensingDistrictDescription; + protected String licensingDistrictCode; + + protected String bpAddress; + protected String bpPostalAddress; + + protected String bpPostalCode; + protected String bpCity; + protected String bpRegionName; + protected Integer bpRegionId; + + protected String releaseStatus; + protected String releasedBy; + protected String reservedStatus; + protected Timestamp natisreleaseDate; + + protected String uAddress1; + protected String uAddress2; + protected String uPostalAddress; + protected String uPostalCd; + protected String uCity; + protected String uRegion; + + protected String colourGroup; + + protected String modelMatching; + + protected boolean isCar; + protected ArrayList showroomTrafficBean; + + protected ArrayList showroomTrafficList = new ArrayList(); + protected Integer sales; + protected Integer traffic; + protected Integer prospects; + protected String modelName; + protected Integer modelId; + protected Integer trxId; + protected Integer modelCode; + protected Integer modelCodeId; + protected String dealerCode; + protected Integer dealerCodeId; + protected Integer salesRepId; + protected Boolean isAllocationWarehouse; + protected String name2; + protected Boolean canAlterOrder; + protected Boolean canCreateOrder; + protected Boolean canViewOrder; + protected Timestamp wholeSaleDate; + protected Integer orderlineCount; + protected Integer orderlineInvoicedCount; + protected JulianDate startDate; + protected JulianDate endDate; + protected Integer weekNo; + protected Integer attributeSetInstance; + protected String makeName; + protected String financeOption; + + protected String newVinNumber; + protected Integer attributesetinstanceIdFrom; + protected Integer attributesetinstanceIdTo; + protected ArrayList vinNumberList; + protected Integer productIds[]; + protected String reservedBy; + protected Boolean isTradeIn = Boolean.valueOf("true"); + protected String ETAFilter; + protected BigDecimal orderGrandTotal; + protected Integer orderIds[]; + + + protected Integer mImportVehiclesId; + protected String natisModelNumber; + protected Timestamp vehEstimateTimeOfArrival; + protected String vehTare; + protected String vehEngineCapacity; + protected String vehNoOfWheels; + protected String vehEnginePower; + protected Boolean colourMatchingPresent; + protected Boolean modelMatchingPresent; + protected Boolean productPresent; + protected String vehImportErrDesc; + + protected Integer modelMatchID; + protected String natisModelDesc; + protected String modelDesc; + protected String trans; + protected Boolean showActiveOnly; + protected Integer updateAttrValueId; + protected String active; + protected String visible; + protected Integer style; + protected Integer design; + protected Integer size; + protected String clientName; + + protected Integer designAttributeValueId; + protected Integer modelAttributeValueId; + protected Integer sizeAttributeValueId; + protected Integer colourAttributeValueId; + + + protected BigDecimal endingBalance; + protected String endingBalanceAsString; + protected BigDecimal amount; + protected String trxType; + protected BigDecimal amountGiven; + protected BigDecimal amountRefunded; + protected Integer cashBookId; + protected Integer cashId; + protected Integer cashLineId; + protected String cashType; + protected String cashTypeName; + protected String cashBookName; + protected String chequeNo; + protected String creditCardType; + protected String creditCardNumber; + protected String creditCardNumberEncrypted; + protected Integer creditCardExpMonth; + protected String creditCardExpMonthName; + protected Integer creditCardExpYear; + protected Integer [] posOrderLineIds; + protected Integer posId; + protected String posName; + protected String posDesc; + protected String saleRepName; + protected Integer priceListId; + protected String priceListName; + protected String paymentRule; + protected Integer cashJournalId; + protected String cashJournalName; + protected String cashJournalDisc; + protected String statmentDate; + protected Timestamp dateAcct; + protected BigDecimal invoiceAmount; + protected BigDecimal differenceAmount; + protected BigDecimal generalExpenseAmount; + protected BigDecimal generalReceiptsAmount; + protected BigDecimal bankAcctTransferAmount; + protected BigDecimal transferAmount; + protected Integer cashBookIds; + protected BigDecimal beginingBalance; + protected String beginingBalanceAsString; + protected BigDecimal statementDifference; + protected String keyword; + protected String backOrder; + protected String fieldName; + protected String applicationName; + protected String applicationWebContext; + protected Integer storeId; + protected Boolean isWebstoreFeatured; + protected String brandName; + protected String designName; + protected String sizeName; + protected String keyword1; + protected String keyword2; + protected String keyword3; + protected String keyword4; + protected String[] sizes; + protected String[] colours; + protected String imageLink; + + protected BigDecimal priceStandard; + protected String currency;// + + protected BigDecimal cashTotal; + protected BigDecimal chequeTotal; + protected BigDecimal cardTotal; + protected BigDecimal tillGrandTotal; + protected String purchasePriceList; + protected String purchasePriceLimit; + protected String purchasePriceStandard; + protected String barCode; + protected String salesPriceList; + protected String salesPriceLimit; + protected String salesPriceStandard; + protected String reportType; + protected Integer noOfProductsRequired; + protected BigDecimal openingBalanceQty; + protected BigDecimal qtyOfGoodsSold; + protected BigDecimal qtyOfGoodsReceived; + protected BigDecimal qtyOfGoodsReturned; + protected BigDecimal closeingBalanceQty; + protected BigDecimal qtyReturnedByCustomer; + protected String qtyAndItem; + protected String[] discountPercent; + protected String [] actualPrice; + protected FormFile file; + protected FormFile logo; + protected FormFile image; + + protected String userSurname; + protected Integer countryId; + protected String countryName; + protected String countryCode; + + protected String newName; + protected String imageName; + protected ArrayList productsList; + protected Double paymentByCash; + protected String paymentMethod; + protected Double paymentByCard; + protected Double paymentByChq; + protected Boolean isDeleteOldRecords=false; + protected String isSales; + protected Boolean isSOPriceList = false; + protected String ifAdd; + protected String productCategory; + protected String productClassification; + protected String trackingNo; + protected String revenueRecognition; + protected String cvv; + protected String creditCardPayment; + protected String shipmentMethod; + protected Boolean shipTo; + protected Boolean billTo; + protected Integer chargeId; + protected String chargeName; + protected BigDecimal chargeAmount; + + protected Integer revenueRecoId; + + protected int numberOfRequests; + protected String userName; + protected Integer requestId; + protected Integer toUserId; + protected String fromAddress; + protected String toAddresses; + protected String ccAddresses; + protected String bccAddresses; + protected String textMessage; + protected String hostAddress; + protected String priority; + protected String title; + protected Integer statusId; + + protected AttributeValuesPair attributeValuesPair; + protected HashMap attributeValuesMap; + protected Boolean isTextileProduct; + protected String qtyFilter; + protected String productType; + + + protected String attributeSetName; + + protected String attributeName; + protected ArrayList attributeValueList; + protected String [] attributeValueIds; + protected Double totalActualPrice; + protected String qtyNumberFilter; + protected Integer taxCategoryId; + protected String taxCategoryName; + protected String vendorName; + protected String timePeriod; + protected String chartType; + protected String salesGroup; + protected BigDecimal taxRate; + protected Integer accountId; + protected String dateRange; + protected Boolean transferAllAmount; + protected BigDecimal adjustmentAmount; + protected BigDecimal differenceAmt; + protected Boolean creatingFromOrder; + protected String transferType; + protected String priceQtyFilter; + protected Boolean hasImage; + protected String userPIN; + protected Boolean isSelfService; + protected BigDecimal cardDifference; + protected BigDecimal chequeDifference; + protected String documentNote; + protected String currencySymbole; + protected String invoiceDate; + protected Integer netDays; + protected Integer daysDue; + protected Timestamp dueDate; + protected String discountDate; + protected BigDecimal discountAmt; + protected BigDecimal invoiceGrandTotal; + protected BigDecimal paidAmt; + protected BigDecimal openAmt; + protected Integer currencyId; + protected Integer paymentTermId; + protected Integer invoiceScheduleId; + protected BigDecimal userDiscount; + + protected BigDecimal invoicedAmt; + protected BigDecimal pastDue91_plus; + protected BigDecimal pastDue61_90; + protected BigDecimal pastDue31_60; + protected BigDecimal pastDue1_30; + protected BigDecimal pastDue8_30; + protected BigDecimal pastDue1_7; + protected BigDecimal pastDueAmt; + protected BigDecimal dueAmt; + protected BigDecimal due0; + protected BigDecimal due1_7; + protected BigDecimal due8_30; + protected BigDecimal due0_30; + protected BigDecimal due31_60; + protected BigDecimal due61_90; + protected BigDecimal due91_PLUS; + + + protected BigDecimal paymentAmt; + protected BigDecimal overUnderPayment; + protected BigDecimal writeOffAmt; + protected String tenderType; + protected String invoiceNo; + protected BigDecimal creditUsed; + protected BigDecimal creditLimit; + protected BigDecimal revenue; + protected String paymentTermName; + protected Integer [] bpartnerIds; + + protected Integer blackListedId; + protected String blackListedBankName; + protected String blackListedChequeNo; + + protected Integer dunningId; + protected String dunningName; + + protected Integer dunningLevelId; + protected String dunningLevelName; + protected String dunningPrintText; + protected String dunningPrintNote; + protected Integer BP_Group_ID ; + protected String soCreditStatus; + protected String bpfirstSale; + protected String creditStatus; + public String docBasisType; + + //protected String applicationType; + protected BigDecimal amtMultiplier; + + + protected Integer commissionAmtId; + protected Integer commissionRunId; + protected Integer commissionLineId; + protected BigDecimal convertedAmt; + protected BigDecimal actualQty; + protected BigDecimal commissionAmt; + protected String commissionLineName; + protected Integer commissionDetailId; + protected String reference; + protected Integer invoiceLineId; + protected String info; + protected BigDecimal actualAmt; + protected String frequencyType; + protected String periodAndCurrencyDesc; + protected BigDecimal subtractAmt; + protected BigDecimal qtyInventoryIn; + protected BigDecimal qtyInventoryOut; + + protected String taxName; + protected Integer taxId; + protected Boolean isTaxExempted; + protected Integer [] invoiceIds; + protected Integer [] paymentIds; + protected String paymentNo; + protected BigDecimal taxedAmt; + protected String trxDate; + + protected Integer creditMemoId; + protected String creditMemoNumber; + + + protected Integer inventoryLineId; + protected Integer inventoryId; + protected BigDecimal qtyBook; + protected BigDecimal qtyCount; + protected BigDecimal qtyCsv; + + protected String inventoryNo; + protected String movementDate; + + protected Boolean afterDelivery; + protected Boolean fixedDueDate; + protected Boolean nextBusinessday; + protected Integer fixedMonthDay; + protected Integer fixedMonthOffset; + protected Integer fiedMonthCutoff; + protected String toBeShipped; + protected Integer discountDay1; + protected Integer discountDay2; + protected BigDecimal discountAmt1; + protected BigDecimal discountAmt2; + protected BigDecimal allocatedAmount; + protected BigDecimal bookQtyValue; + protected BigDecimal countQtyValue; + + protected PaymentBean paymentBeanIndex; + + protected BigDecimal [] allocateAmount; + + protected BigDecimal paymentAllocatedAmt; + protected BigDecimal AvailableAmt; + protected Integer [] inventoryIds; + protected Integer [] inventoryLineIds; + protected String historyType; + + protected String accountingValues; + + protected String fullDetails; + protected BigDecimal unitPrice; + protected BigDecimal unitPurchasePrice; + + // Additional fields required for user registration + protected String company; + protected String industry; + protected String comments; + + protected BigDecimal roundOffFactor; + protected Integer stdPrecision; + protected String isoCode; + protected String curSymbol; + protected String isSalesReport; + protected String receiptFooterMsg; + protected String branch; + protected String taxNo; + + /** Organisation **/ + protected Integer orgId; + + /** Common field used for searching **/ + protected String searchText; + + protected Integer webMenuId; + + public Boolean getIsActive() + { + return isActive; + } + public void setIsActive(Boolean isActive) + { + this.isActive = isActive; + } + + /** + * @param searchText search term + */ + public void setSearchText(String searchText) + { + this.searchText = searchText; + } + + /** + * @return search term + */ + public String getSearchText() + { + return this.searchText; + } + + /** + * @return Organisation + */ + public Integer getOrgId() + { + return orgId; + } + + /** + * @param orgId Organisation + */ + public void setOrgId(Integer orgId) + { + this.orgId = orgId; + } + +} + + + diff --git a/posterita/posterita/src/main/org/posterita/beans/UDIPair.java b/posterita/posterita/src/main/org/posterita/beans/UDIPair.java new file mode 100644 index 0000000000..437f9277f0 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/UDIPair.java @@ -0,0 +1,128 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 28-Jun-2005 by alok + * + */ +package org.posterita.beans; + +import java.util.ArrayList; + + +public class UDIPair implements Comparable +{ + + private Integer ID; + private String key; + private String value; + + private UDIPair pair; + private ArrayList arr; + + public UDIPair(Integer ID, String value) + { + this.ID = ID; + this.value = value; + } + + public UDIPair(String key, String value) + { + this.key = key; + this.value = value; + } + + + public UDIPair(UDIPair pair, ArrayList arr) + { + this.pair = pair; + this.arr = arr; + } + + + + public ArrayList getArr() { + return arr; + } + + + public void setArr(ArrayList arr) { + this.arr = arr; + } + + + public UDIPair getPair() { + return pair; + } + + + public void setPair(UDIPair pair) { + this.pair = pair; + } + + + /** + * @return Returns the iD. + */ + public Integer getID() { + return ID; + } + /** + * @param id The iD to set. + */ + public void setID(Integer id) { + ID = id; + } + /** + * @return Returns the value. + */ + public String getValue() { + return value; + } + /** + * @param value The value to set. + */ + public void setValue(String value) { + this.value = value; + } + /* (non-Javadoc) + * @see java.lang.Comparable#compareTo(java.lang.Object) + */ + public int compareTo(Object o) + { + UDIPair pair = (UDIPair) o; + + return this.getValue().compareTo(pair.getValue()); + } + + public String getKey() + { + return key; + } + + public void setKey(String key) + { + this.key = key; + } + + public String toString() + { + String str ="ID:" +getID() + " Value:" +getValue(); + return str; + } + } + diff --git a/posterita/posterita/src/main/org/posterita/beans/UserBean.java b/posterita/posterita/src/main/org/posterita/beans/UserBean.java new file mode 100644 index 0000000000..8e8999676a --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/UserBean.java @@ -0,0 +1,355 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Jul 29, 2005 by din + */ + +package org.posterita.beans; + +import java.math.BigDecimal; + +public class UserBean extends UDIBean +{ + public Integer getOrgId() { + return orgId; + } + + public void setOrgId(Integer orgId) { + this.orgId = orgId; + } + + public Boolean getIsFullAccess() { + return isFullAccess; +} + +public void setIsFullAccess(Boolean isFullAccess) { + this.isFullAccess = isFullAccess; +} + + public BigDecimal getSubtractAmt() { + return subtractAmt; +} + +public void setSubtractAmt(BigDecimal subtractAmt) { + this.subtractAmt = subtractAmt; +} + public String getFrequencyType() { + return frequencyType; + } + public void setFrequencyType(String frequencyType) { + this.frequencyType = frequencyType; + } + public BigDecimal getAmtMultiplier() { + return amtMultiplier; +} +public void setAmtMultiplier(BigDecimal amtMultiplier) { + this.amtMultiplier = amtMultiplier; +} + public String getDocBasisType() { + return docBasisType; + } + public void setDocBasisType(String docBasisType) { + this.docBasisType = docBasisType; + } + public String getUserPIN() + { + return userPIN; + } + public void setUserPIN(String userPIN) + { + this.userPIN = userPIN; + } + public Integer getPartnerId() + { + return partnerId; + } + + public void setPartnerId(Integer partnerId) + { + this.partnerId = partnerId; + } + + public String getCountryName() { + return countryName; +} + +public void setCountryName(String countryName) { + this.countryName = countryName; +} + + public Integer getCountryId() { + return countryId; + } + + public void setCountryId(Integer countryId) { + this.countryId = countryId; + } + + public String getUserSurname() { + return userSurname; + } + + public void setUserSurname(String userSurname) { + this.userSurname = userSurname; + } + + public Integer getLocationId() + { + return locationId; + } + + public void setLocationId(Integer locationId) + { + this.locationId = locationId; + } + + public String getAddress1() + { + return address1; + } + + public void setAddress1(String address1) + { + this.address1 = address1; + } + + public String getAddress2() + { + return address2; + } + + public void setAddress2(String address2) + { + this.address2 = address2; + } + + public String getCity() + { + return city; + } + + public void setCity(String city) + { + this.city = city; + } + + public String getDescription() + { + return description; + } + + public void setDescription(String description) + { + this.description = description; + } + public Boolean getIsActive() + { + return isActive; + } + + public void setIsActive(Boolean isActive) + { + this.isActive = isActive; + } + + public String getPassword() + { + return password; + } + + public void setPassword(String password) + { + this.password = password; + } + + public String getConfirmPassword() + { + return confirmPassword; + } + + public void setConfirmPassword(String confirmPassword) + { + this.confirmPassword = confirmPassword; + } + + public String getPhone() + { + return phone; + } + + public void setPhone(String phone) + { + this.phone = phone; + } + + public String getPostalAddress() + { + return postalAddress; + } + + public void setPostalAddress(String postalAddress) + { + this.postalAddress = postalAddress; + } + + public String getUsername() + { + return username; + } + public void setUsername(String username) + { + this.username = username; + } + + public String getEmail() + { + return email; + } + + public void setEmail(String email) + { + this.email = email; + } + public String getFax() + { + return fax; + } + + public void setFax(String fax) + { + this.fax = fax; + } + + public Integer getRoleId() + { + return roleId; + } + + public void setRoleId(Integer roleId) + { + this.roleId = roleId; + } + public String getRoleName() + { + return roleName; + } + public void setRoleName(String roleName) + { + this.roleName = roleName; + } + public Boolean getIsSalesRep() + { + return isSalesRep; + } + + public void setIsSalesRep(Boolean isSalesRep) + { + this.isSalesRep = isSalesRep; + } + + public Integer getRegionId() + { + return regionId; + } + + public void setRegionId(Integer regionId) + { + this.regionId = regionId; + } + + public Integer getUserId() + { + return userId; + } + + public void setUserId(Integer userId) + { + this.userId = userId; + } + + public String getRegion() + { + return region; + } + public void setRegion(String region) + { + this.region = region; + } + + public String getName() + { + return name; + } + public void setName(String name) + { + this.name = name; + } + public String getCountryCode() + { + return countryCode; + } + public void setCountryCode(String countryCode) + { + this.countryCode = countryCode; + } + + public BigDecimal getUserDiscount() { + return userDiscount; + } + public void setUserDiscount(BigDecimal userDiscount) { + this.userDiscount = userDiscount; + } + + public String getPhone2() { + return phone2; + } + public void setPhone2(String phone2) { + this.phone2 = phone2; + } + + public String getComments() { + return comments; + } + + public void setComments(String comments) { + this.comments = comments; + } + + public String getIndustry() { + return industry; + } + + public void setIndustry(String industry) { + this.industry = industry; + } + + public String getCompany() { + return company; + } + + public void setCompany(String company) { + this.company = company; + } + /*public String getUserSurname() { + return userSurname; + } + + public void setUserSurname(String userSurname) { + this.userSurname = userSurname; + }*/ +} diff --git a/posterita/posterita/src/main/org/posterita/beans/VendorBean.java b/posterita/posterita/src/main/org/posterita/beans/VendorBean.java new file mode 100644 index 0000000000..faa3c22bae --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/VendorBean.java @@ -0,0 +1,122 @@ +package org.posterita.beans; + +public class VendorBean extends UDIBean +{ + + public Integer getOrgId() + { + return orgId; + } + + public void setOrgId(Integer orgId) + { + this.orgId = orgId; + } + + public Integer getCountryId() { + return countryId; + } + + public void setCountryId(Integer countryId) { + this.countryId = countryId; + } + + public String getPartnerName() + { + return partnerName; + } + + public void setPartnerName(String partnerName) + { + this.partnerName = partnerName; + } + + public String getAddress1() { + return address1; + } + + public void setAddress1(String address1) { + this.address1 = address1; + } + + public String getAddress2() { + return address2; + } + + public void setAddress2(String address2) { + this.address2 = address2; + } + + public String getCity() { + return city; + } + + public void setCity(String city) { + this.city = city; + } + + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone; + } + + public String getPhone2() { + return phone2; + } + + public void setPhone2(String phone2) { + this.phone2 = phone2; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public String getFax() { + return fax; + } + + public void setFax(String fax) { + this.fax = fax; + } + + public String getSurname() { + return surname; + } + + public void setSurname(String surname) { + this.surname = surname; + } + public Boolean getIsActive() { + return isActive; + } + + public void setIsActive(Boolean isActive) { + this.isActive = isActive; + } + + public Integer getBpartnerId() { + return bpartnerId; + } + + public void setBpartnerId(Integer bpartnerId) { + this.bpartnerId = bpartnerId; + } + public Integer getPriceListId() + { + return priceListId; + } + + public void setPriceListId(Integer priceListId) + { + this.priceListId = priceListId; + } +} + diff --git a/posterita/posterita/src/main/org/posterita/beans/WarehouseBean.java b/posterita/posterita/src/main/org/posterita/beans/WarehouseBean.java new file mode 100644 index 0000000000..15d401f728 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/WarehouseBean.java @@ -0,0 +1,187 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Jul 26, 2005 by din + */ + +package org.posterita.beans; + +public class WarehouseBean extends UDIBean +{ + + + public String getDescription() + { + return description; + } + + public void setDescription(String description) + { + this.description = description; + } + + public String getWarehouseType() + { + return warehouseType; + } + + public void setWarehouseType(String warehouseType) + { + this.warehouseType = warehouseType; + } + + public Boolean getIsAllocationWarehouse() + { + return isAllocationWarehouse; + } + + public void setIsAllocationWarehouse(Boolean isAllocationWarehouse) + { + this.isAllocationWarehouse = isAllocationWarehouse; + } + + public Integer getWarehouseId() + { + return warehouseId; + } + + public void setWarehouseId(Integer warehouseId) + { + this.warehouseId = warehouseId; + } + + public String getWarehouseName() + { + return warehouseName; + } + + public void setWarehouseName(String warehouseName) + { + this.warehouseName = warehouseName; + } + + public String getAddress1() + { + return address1; + } + + public void setAddress1(String address1) + { + this.address1 = address1; + } + + public String getCity() + { + return city; + } + + public void setCity(String city) + { + this.city = city; + } + + public String getPostalAddress() + { + return postalAddress; + } + + public void setPostalAddress(String postalAddress) + { + this.postalAddress = postalAddress; + } + + public Integer getRegionId() + { + return regionId; + } + + public void setRegionId(Integer regionId) + { + this.regionId = regionId; + } + + public Boolean getIsPublic() + { + return isPublic; + } + + public void setIsPublic(Boolean isPublic) + { + this.isPublic = isPublic; + } + + public String getAisle() + { + return aisle; + } + + public void setAisle(String aisle) + { + this.aisle = aisle; + } + + public String getBin() + { + return bin; + } + + public void setBin(String bin) + { + this.bin = bin; + } + + public Boolean getIsDefault() + { + return isDefault; + } + + public void setIsDefault(Boolean isDefault) + { + this.isDefault = isDefault; + } + + public String getLevel() + { + return level; + } + + public void setLevel(String level) + { + this.level = level; + } + + public String getRegionName() + { + return regionName; + } + + public void setRegionName(String regionName) + { + this.regionName = regionName; + } + + public Boolean getIsActive() + { + return isActive; + } + + public void setIsActive(Boolean isActive) + { + this.isActive = isActive; + } +} diff --git a/posterita/posterita/src/main/org/posterita/beans/WebDocumentBean.java b/posterita/posterita/src/main/org/posterita/beans/WebDocumentBean.java new file mode 100644 index 0000000000..011fa944e9 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/WebDocumentBean.java @@ -0,0 +1,609 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +* Created on Jul 26, 2005 by din +*/ + +package org.posterita.beans; + +import java.math.BigDecimal; +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.Properties; + +import org.compiere.model.MBPartner; +import org.compiere.model.MBPartnerLocation; +import org.compiere.model.MCashLine; +import org.compiere.model.MInOut; +import org.compiere.model.MInvoice; +import org.compiere.model.MLocation; +import org.compiere.model.MOrder; +import org.compiere.model.MPayment; + + +public class WebDocumentBean extends UDIBean +{ + String[] simpleCommand = new String[0]; + String[] complexCommand = new String[0]; + MBPartner me; + MBPartnerLocation mebpLocation; + MLocation meLocation; + + + + MBPartner you; + MBPartnerLocation youbpLocation; + MLocation youLocation; + String daysRemaining; + String month; + String year; + String displayCheckBox = null; + private String salesRep; + private String description; + + private ArrayList lines = new ArrayList(); + + private MOrder order; + private MInvoice invoice; + private MInOut minOut; + private MPayment payment; + private String tenderType; + private WebDocumentHeaderBean headerBean; + + private Properties ctx; + private ArrayList allocations; + + private BigDecimal totalLines; + private BigDecimal totalTax; + private BigDecimal grandTotal; + private String isPaid; + private String isShipped; + private Double paymentByCash; + private Double paymentByCard; + private Double paymentbyCheque; + private BigDecimal totalQty; + private MCashLine cashLine; + private BigDecimal subTotal; + + public BigDecimal getSubTotal() { + return subTotal; + } + + public void setSubTotal(BigDecimal subTotal) { + this.subTotal = subTotal; + } + + public String getCurrencySymbole() { + return currencySymbole; + } + public void setCurrencySymbole(String currencySymbole) { + this.currencySymbole = currencySymbole; + } + public BigDecimal getTotalQty() { + return totalQty; + } + public void setTotalQty(BigDecimal totalQty) { + this.totalQty = totalQty; + } + public String getIsPaid() + { + return isPaid; + } + public void setIsPaid(String isPaid) + { + this.isPaid = isPaid; + } + public String getIsShipped() + { + return isShipped; + } + public void setIsShipped(String isShipped) + { + this.isShipped = isShipped; + } + public String getTrackingNo() + { + return trackingNo; + } + public void setTrackingNo(String trackingNo) + { + this.trackingNo = trackingNo; + } + + + + public String getSalesRep() { + return salesRep; + } + public void setSalesRep(String salesRep) { + this.salesRep = salesRep; + } + public BigDecimal getGrandTotal() { + return grandTotal; + } + public void setGrandTotal(BigDecimal grandTotal) { + this.grandTotal = grandTotal; + } + public BigDecimal getTotalLines() { + return totalLines; + } + public void setTotalLines(BigDecimal totalLines) { + this.totalLines = totalLines; + } + public BigDecimal getTotalTax() { + return totalTax; + } + public void setTotalTax(BigDecimal totalTax) { + this.totalTax = totalTax; + } + + + public ArrayList getAllocations() { + return allocations; + } + public void setAllocations(ArrayList allocations) { + this.allocations = allocations; + } + + public WebDocumentHeaderBean getHeaderBean() + { + return headerBean; + } + + public void setHeaderBean(WebDocumentHeaderBean headerBean) + { + this.headerBean = headerBean; + } + + + public MOrder getOrder() + { + return order; + } + + public void setOrder(MOrder order) + { + this.order = order; + } + + public MInvoice getInvoice() + { + return invoice; + } + + public void setInvoice(MInvoice invoice) + { + this.invoice = invoice; + } + + + + public String[] getSimpleCommand() { + return simpleCommand; + } + + + public void setSimpleCommand(String[] simpleCommand) + { + this.simpleCommand = simpleCommand; + } + + + public MBPartner getMe() + { + return me; + } + + + public void setMe(MBPartner me) + { + this.me = me; + } + + + public MBPartnerLocation getMebpLocation() + { + return mebpLocation; + } + + + public void setMebpLocation(MBPartnerLocation mebpLocation) + { + this.mebpLocation = mebpLocation; + } + + + public MLocation getMeLocation() + { + return meLocation; + } + + + public void setMeLocation(MLocation meLocation) + { + this.meLocation = meLocation; + } + + + public MBPartner getYou() + { + return you; + } + + + public void setYou(MBPartner you) + { + this.you = you; + } + + + public MBPartnerLocation getYoubpLocation() + { + return youbpLocation; + } + + + public void setYoubpLocation(MBPartnerLocation youbpLocation) + { + this.youbpLocation = youbpLocation; + } + + + public MLocation getYouLocation() + { + return youLocation; + } + + + public void setYouLocation(MLocation youLocation) + { + this.youLocation = youLocation; + } + + + public ArrayList getLines() + { + return lines; + } + + public void setLines(ArrayList lines) + { + this.lines = lines; + } + + + public String[] getComplexCommand() + { + return complexCommand; + } + + + public void setComplexCommand(String[] complexCommand) + { + this.complexCommand = complexCommand; + } + + public String getDaysRemaining() + { + return daysRemaining; + } + + public void setDaysRemaining(String daysRemaining) + { + this.daysRemaining = daysRemaining; + } + + + + public String getMonth() + { + return month; + } + + public void setMonth(String month) + { + this.month = month; + } + + public String getYear() + { + return year; + } + + public void setYear(String year) + { + this.year = year; + } + + public String getDisplayCheckBox() + { + return displayCheckBox; + } + + public void setDisplayCheckBox(String displayCheckBox) + { + this.displayCheckBox = displayCheckBox; + } + + public String getSubmit() + { + return submit; + } + + public void setSubmit(String submit) + { + this.submit = submit; + } + + public Integer getOrderId() + { + return orderId; + } + + public void setOrderId(Integer orderId) + { + this.orderId = orderId; + } + + public String getPoReference() + { + return poReference; + } + + public void setPoReference(String poReference) + { + this.poReference = poReference; + } + + public String getTermsAgreement() + { + return termsAgreement; + } + + public void setTermsAgreement(String termsAgreement) + { + this.termsAgreement = termsAgreement; + } + + public ArrayList getOrderLineBean() + { + return orderLineBean; + } + public void setOrderLineBean(ArrayList orderLineBean) + { + this.orderLineBean = orderLineBean; + } + + public String getAddress1() + { + return address1; + } + + public void setAddress1(String address1) + { + this.address1 = address1; + } + + public String getCity() + { + return city; + } + + public void setCity(String city) + { + this.city = city; + } + + public String getDocStatus() + { + return docStatus; + } + + public void setDocStatus(String docStatus) + { + this.docStatus = docStatus; + } + + + public String getPartnerName() + { + return partnerName; + } + + public void setPartnerName(String partnerName) + { + this.partnerName = partnerName; + } + + + public Timestamp getDateOrdered() + { + return dateOrdered; + } + + public void setDateOrdered(Timestamp dateOrdered) + { + this.dateOrdered = dateOrdered; + } + + + public Integer getBpartnerId() + { + return bpartnerId; + } + public void setBpartnerId(Integer bpartnerId) + { + this.bpartnerId = bpartnerId; + } + + + public String getDatePromised() + { + return datePromised; + } + + public void setDatePromised(String datePromised) + { + this.datePromised = datePromised; + } + + public String getIsApproved() + { + return isApproved; + } + + public void setIsApproved(String isApproved) + { + this.isApproved = isApproved; + } + public String getIsDelivered() + { + return isDelivered; + } + public void setIsDelivered(String isDelivered) + { + this.isDelivered = isDelivered; + } + public String getIsInvoiced() + { + return isInvoiced; + } + public void setIsInvoiced(String isInvoiced) + { + this.isInvoiced = isInvoiced; + } + + public String getDocumentNo() + { + return documentNo; + } + + public void setDocumentNo(String documentNo) + { + this.documentNo = documentNo; + } + + public Boolean isSoTrx() + { + return isSoTrx; + } + + public void setIsSoTrx(Boolean isSoTrx) + { + this.isSoTrx = isSoTrx; + } + + public void setInvoiceId(Integer invoiceId) + { + this.invoiceId = invoiceId; + } + + public Integer getInvoiceId() + { + return invoiceId; + } + + + public MInOut getMinOut() + { + return minOut; + } + + public void setMinOut(MInOut minOut) + { + this.minOut = minOut; + } + + public Integer getPaymentId() + { + return paymentId; + } + + public void setPaymentId(Integer paymentId) + { + this.paymentId = paymentId; + } + + public MPayment getPayment() + { + return payment; + } + + public void setPayment(MPayment payment) + { + this.payment = payment; + } + + public Integer getMinOutId() + { + return minOutId; + } + + public void setMinOutId(Integer minOutId) + { + this.minOutId = minOutId; + } + + + public Properties getCtx() { + return ctx; + } + public void setCtx(Properties ctx) { + this.ctx = ctx; + } + public String getDescription() { + return description; + } + public void setDescription(String description) { + this.description = description; + } + public Double getPaymentByCard() { + return paymentByCard; + } + public void setPaymentByCard(Double paymentByCard) { + this.paymentByCard = paymentByCard; + } + public Double getPaymentByCash() { + return paymentByCash; + } + public void setPaymentByCash(Double paymentByCash) { + this.paymentByCash = paymentByCash; + } + public Double getPaymentbyCheque() { + return paymentbyCheque; + } + public void setPaymentbyCheque(Double paymentbyCheque) { + this.paymentbyCheque = paymentbyCheque; + } + public String getTenderType() + { + return tenderType; + } + public void setTenderType(String tenderType) + { + this.tenderType = tenderType; + } + public MCashLine getCashLine() { + return cashLine; + } + public void setCashLine(MCashLine cashLine) { + this.cashLine = cashLine; + } + + +} diff --git a/posterita/posterita/src/main/org/posterita/beans/WebDocumentHeaderBean.java b/posterita/posterita/src/main/org/posterita/beans/WebDocumentHeaderBean.java new file mode 100644 index 0000000000..f6ece97bdb --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/WebDocumentHeaderBean.java @@ -0,0 +1,194 @@ +/* + * Created on Mar 13, 2005 + * + * To change the template for this generated file go to + * Window - Preferences - Java - Code Style - Code Templates + */ +package org.posterita.beans; + +import java.sql.Timestamp; + +public class WebDocumentHeaderBean +{ + private String dcsRef; + private String dcsCounterRef; + private String documentStatus; + private String dealerRef; + private String dealerCounterRef; + private String documentTitle; + private String documentName; + private String from; + private String to; + private String date; + private String counterDate; + private String youName; + private String poReference; + private Timestamp dateOrdered; + private String documentHeader; + private String shipped; + private String paymentType; + private String paymentByCash; + private String paymentByCard; + private String paymentbyCheque; + private String bpartnerId; + + + + + + public String getPaymentType() { + return paymentType; + } + + public void setPaymentType(String paymentType) { + this.paymentType = paymentType; + } + + public String getShipped() + { + return shipped; + } + + public void setShipped(String shipped) + { + this.shipped = shipped; + } + + public String getDocumentHeader() + { + return documentHeader; + } + + public void setDocumentHeader(String documentHeader) + { + this.documentHeader = documentHeader; + } + + public String getYouName() { + return youName; + } + public void setYouName(String youName) { + this.youName = youName; + } + public String getCounterDate() { + return counterDate; + } + public void setCounterDate(String counterDate) { + this.counterDate = counterDate; + } + public String getDate() { + return date; + } + public void setDate(String date) { + this.date = date; + } + public String getDcsCounterRef() { + return dcsCounterRef; + } + public void setDcsCounterRef(String dcsCounterRef) { + this.dcsCounterRef = dcsCounterRef; + } + public String getDcsRef() { + return dcsRef; + } + public void setDcsRef(String dcsRef) { + this.dcsRef = dcsRef; + } + public String getDealerCounterRef() { + return dealerCounterRef; + } + public void setDealerCounterRef(String dealerCounterRef) { + this.dealerCounterRef = dealerCounterRef; + } + public String getDealerRef() { + return dealerRef; + } + public void setDealerRef(String dealerRef) { + this.dealerRef = dealerRef; + } + public String getDocumentName() { + return documentName; + } + public void setDocumentName(String documentName) { + this.documentName = documentName; + } + public String getDocumentStatus() { + return documentStatus; + } + public void setDocumentStatus(String documentStatus) { + this.documentStatus = documentStatus; + } + public String getDocumentTitle() { + return documentTitle; + } + public void setDocumentTitle(String documentTitle) { + this.documentTitle = documentTitle; + } + public String getFrom() { + return from; + } + public void setFrom(String from) { + this.from = from; + } + public String getTo() { + return to; + } + public void setTo(String to) { + this.to = to; + } + + public String getPoReference() + { + return poReference; + } + + public void setPoReference(String poReference) + { + this.poReference = poReference; + } + + public Timestamp getDateOrdered() + { + return dateOrdered; + } + + public void setDateOrdered(Timestamp dateOrdered) + { + this.dateOrdered = dateOrdered; + } + + public String getPaymentByCard() { + return paymentByCard; + } + + public void setPaymentByCard(String paymentByCard) { + this.paymentByCard = paymentByCard; + } + + public String getPaymentByCash() { + return paymentByCash; + } + + public void setPaymentByCash(String paymentByCash) { + this.paymentByCash = paymentByCash; + } + + public String getPaymentbyCheque() { + return paymentbyCheque; + } + + public void setPaymentbyCheque(String paymentbyCheque) { + this.paymentbyCheque = paymentbyCheque; + } + + public String getBpartnerId() + { + return bpartnerId; + } + + public void setBpartnerId(String bpartnerId) + { + this.bpartnerId = bpartnerId; + } + +} diff --git a/posterita/posterita/src/main/org/posterita/beans/WebInvoiceLineBean.java b/posterita/posterita/src/main/org/posterita/beans/WebInvoiceLineBean.java new file mode 100644 index 0000000000..2ebf1a89f4 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/WebInvoiceLineBean.java @@ -0,0 +1,63 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ +package org.posterita.beans; + +import java.math.BigDecimal; + + +public class WebInvoiceLineBean extends WebOrderLineBean +{ + private Integer invoiceId; + private Integer qtyInvoiced; + //amount including tax + private BigDecimal lineTotalAmount; + + public BigDecimal getLineTotalAmt() + { + return lineTotalAmount; + } + + public void setLineTotalAmt(BigDecimal lineTotalAmt) + { + this.lineTotalAmount = lineTotalAmt; + } + + + + public Integer getInvoiceId() + { + return invoiceId; + } + + public void setInvoiceId(Integer invoiceId) + { + this.invoiceId = invoiceId; + } + + public Integer getQtyInvoiced() + { + return qtyInvoiced; + } + + public void setQtyInvoiced(Integer qtyInvoiced) + { + this.qtyInvoiced = qtyInvoiced; + } +} diff --git a/posterita/posterita/src/main/org/posterita/beans/WebMinOutLineBean.java b/posterita/posterita/src/main/org/posterita/beans/WebMinOutLineBean.java new file mode 100644 index 0000000000..2273eb5dda --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/WebMinOutLineBean.java @@ -0,0 +1,26 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ +package org.posterita.beans; + + +public class WebMinOutLineBean extends WebOrderLineBean +{ + +} diff --git a/posterita/posterita/src/main/org/posterita/beans/WebOrderLineBean.java b/posterita/posterita/src/main/org/posterita/beans/WebOrderLineBean.java new file mode 100644 index 0000000000..f8ba1a220d --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/WebOrderLineBean.java @@ -0,0 +1,489 @@ +/* + * Created on Mar 3, 2005 + * + * To change the template for this generated file go to + * Window - Preferences - Java - Code Style - Code Templates + */ +package org.posterita.beans; + +import java.math.BigDecimal; +import java.util.ArrayList; + + +public class WebOrderLineBean +{ + private AttributeValuesPair attributeValuesPair; + private UDIPair[] actions; + private WebOrderLineBean myPref; + private WebOrderLineBean[] myChoices; + private BigDecimal discountPercentage; + private BigDecimal qtyTotal; + private BigDecimal taxRate; + + + //amount excluding tax + private BigDecimal lineNetAmt; + private BigDecimal taxAmt; + private BigDecimal priceActual; + private Integer orderLineId; + private Integer productId; + private ArrayList vinNumberPairs; + private Integer attributeSetInstanceId; + private String serno; + private Boolean isInvoiced; + private String engineNo; + private Boolean isQtyReserved; + private Integer partnerId; + private BigDecimal totalAmt; + private Integer tradeInOrderlineId; + private BigDecimal lineTotalAmt; + private String tradeInVin; + + private String productName; + private Integer count; + private BigDecimal qtyOrdered; + private BigDecimal grandTotal; + private String trxType; + private BigDecimal amountGiven; + private BigDecimal amountRefunded; + private Boolean isRejectable; + private String currency; + private String description; + private BigDecimal unitPrice; + private String uom; + + private BigDecimal discountAmt; + private BigDecimal writeOffAmt; + private BigDecimal subTotal; + + private BigDecimal unitPurchasePrice; + private BigDecimal grossProfit; + private BigDecimal totalGrossProfit; + private BigDecimal grossProfitPercentage; + private BigDecimal totalGrossProfitPercentage; + + public BigDecimal getGrossProfitPercentage() + { + return grossProfitPercentage; + } + + public void setGrossProfitPercentage(BigDecimal grossProfitPercentage) + { + this.grossProfitPercentage = grossProfitPercentage; + } + + public BigDecimal getTotalGrossProfitPercentage() + { + return totalGrossProfitPercentage; + } + + public void setTotalGrossProfitPercentage(BigDecimal totalGrossProfitPercentage) + { + this.totalGrossProfitPercentage = totalGrossProfitPercentage; + } + + public BigDecimal getSubTotal() { + return subTotal; + } + + public void setSubTotal(BigDecimal subTotal) { + this.subTotal = subTotal; + } + + public BigDecimal getDiscountAmt() { + return discountAmt; + } + + public void setDiscountAmt(BigDecimal discountAmt) { + this.discountAmt = discountAmt; + } + + public BigDecimal getWriteOffAmt() { + return writeOffAmt; + } + + public void setWriteOffAmt(BigDecimal writeOffAmt) { + this.writeOffAmt = writeOffAmt; + } + + public BigDecimal getUnitPrice() { + return unitPrice; + } + + public void setUnitPrice(BigDecimal unitPrice) { + this.unitPrice = unitPrice; + } + + public String getCurrency() + { + return currency; + } + + public void setCurrency(String currency) + { + this.currency = currency; + } + + /** + * @return Returns the amountGiven. + */ + public BigDecimal getAmountGiven() { + return amountGiven; + } + /** + * @param amountGiven The amountGiven to set. + */ + public void setAmountGiven(BigDecimal amountGiven) { + this.amountGiven = amountGiven; + } + /** + * @return Returns the amountRefunded. + */ + public BigDecimal getAmountRefunded() { + return amountRefunded; + } + /** + * @param amountRefunded The amountRefunded to set. + */ + public void setAmountRefunded(BigDecimal amountRefunded) { + this.amountRefunded = amountRefunded; + } + public String getTrxType() + { + return trxType; + } + + public void setTrxType(String trxType) + { + this.trxType = trxType; + } + public BigDecimal getGrandTotal() + { + return grandTotal; + } + + public void setGrandTotal(BigDecimal grandTotal) + { + this.grandTotal = grandTotal; + } + public BigDecimal getQtyOrdered() + { + return qtyOrdered; + } + + public void setQtyOrdered(BigDecimal qtyOrdered) + { + this.qtyOrdered=qtyOrdered; + } + + public Integer getCount() + { + return count; + } + + public void setCount(Integer count) + { + this.count=count; + } + + public String getProductName() + { + return productName; + } + + public void setProductName(String productName) + { + this.productName=productName; + } + + public Boolean getIsQtyReserved() + { + return isQtyReserved; + } + + public void setIsQtyReserved(Boolean isQtyReserved) + { + this.isQtyReserved = isQtyReserved; + } + + public String getEngineNo() { + return engineNo; + } + public void setEngineNo(String engineNo) { + this.engineNo = engineNo; + } + public Boolean getIsInvoiced() + { + return isInvoiced; + } + + public void setIsinvoiced(Boolean isInvoiced) + { + this.isInvoiced = isInvoiced; + } + + + public BigDecimal getPriceActual() + { + return priceActual; + } + + public void setPriceActual(BigDecimal priceActual) + { + this.priceActual = priceActual; + } + public BigDecimal getTaxAmt() + { + return taxAmt; + } + + public void setTaxAmt(BigDecimal taxAmt) + { + this.taxAmt = taxAmt; + } + + + public UDIPair[] getActions() + { + return actions; + } + public void setActions(UDIPair[] actions) + { + this.actions = actions; + } + public WebOrderLineBean[] getMyChoices() + { + return myChoices; + } + public void setMyChoices(WebOrderLineBean[] myChoices) + { + this.myChoices = myChoices; + } + public WebOrderLineBean getMyPref() + { + return myPref; + } + public void setMyPref(WebOrderLineBean myPref) + { + this.myPref = myPref; + } + + public void setLineNetAmt(BigDecimal lineNetAmt) + { + this.lineNetAmt = lineNetAmt; + } + + public BigDecimal getLineNetAmt() + { + return lineNetAmt; + } + + public AttributeValuesPair getAttributeValuesPair() + { + return attributeValuesPair; + } + + public void setAttributeValuesPair(AttributeValuesPair attributeValuesPair) + { + this.attributeValuesPair = attributeValuesPair; + } + + public void setOrderLineId(Integer orderLineId) + { + this.orderLineId = orderLineId; + } + + public Integer getOrderLineId() + { + return orderLineId; + } + + public void setProductId(Integer productId) + { + this.productId = productId; + } + + public Integer getProductId() + { + return productId; + } + + public void setAttributeSetInstanceid(Integer attributeSetInstanceId) + { + this.attributeSetInstanceId = attributeSetInstanceId; + } + + public Integer getAttributeSetInstanceId() + { + return attributeSetInstanceId; + } + + + public ArrayList getVinNumberPairs() + { + return vinNumberPairs; + } + + public void setVinNumberPairs(ArrayList vinNumberPairs) + { + this.vinNumberPairs = vinNumberPairs; + } + + public String getSerno() + { + return serno; + } + + public void setSerno(String serno) + { + this.serno = serno; + } + + public Integer getPartnerId() + { + return partnerId; + } + + public void setPartnerId(Integer partnerId) + { + this.partnerId = partnerId; + } + + public BigDecimal getTotalAmt() + { + return totalAmt; + } + + public void setTotalAmt(BigDecimal totalAmt) + { + this.totalAmt = totalAmt; + } + + public Integer getTradeInOrderlineId() + { + return tradeInOrderlineId; + } + + public void setTradeInOrderlineId(Integer tradeInOrderlineId) + { + this.tradeInOrderlineId = tradeInOrderlineId; + } + + public BigDecimal getLineTotalAmt() + { + return lineTotalAmt; + } + + public void setLineTotalAmt(BigDecimal lineTotalAmt) + { + this.lineTotalAmt = lineTotalAmt; + } + + public String getTradeInVin() + { + return tradeInVin; + } + + public void setTradeInVin(String tradeInVin) + { + this.tradeInVin = tradeInVin; + } + + + + public Boolean getIsRejectable() + { + return isRejectable; + } + + public void setIsRejectable(Boolean isRejectable) + { + this.isRejectable = isRejectable; + } + + public String getDescription() + { + return description; + } + + public void setDescription(String description) + { + this.description = description; + } + + public BigDecimal getDiscountPercentage() { + return discountPercentage; + } + + public void setDiscountPercentage(BigDecimal discountPercentage) { + this.discountPercentage = discountPercentage; + } + + public BigDecimal getQtyTotal() { + return qtyTotal; + } + + public void setQtyTotal(BigDecimal qtyTotal) { + this.qtyTotal = qtyTotal; + } + + public String getUom() { + return uom; + } + + public void setUom(String uom) { + this.uom = uom; + } + + public BigDecimal getTaxRate() { + return taxRate; + } + + public void setTaxRate(BigDecimal taxRate) { + this.taxRate = taxRate; + } + + public BigDecimal getPurchasePriceList() + { + return unitPurchasePrice; + } + + public void setPurchasePriceList(BigDecimal purchasePriceList) + { + this.unitPurchasePrice = purchasePriceList; + } + + public BigDecimal getGrossProfit() + { + return grossProfit; + } + + public void setGrossProfit(BigDecimal grossProfit) + { + this.grossProfit = grossProfit; + } + + public BigDecimal getUnitPurchasePrice() + { + return unitPurchasePrice; + } + + public void setUnitPurchasePrice(BigDecimal unitPurchasePrice) + { + this.unitPurchasePrice = unitPurchasePrice; + } + + public BigDecimal getTotalGrossProfit() + { + return totalGrossProfit; + } + + public void setTotalGrossProfit(BigDecimal totalGrossProfit) + { + this.totalGrossProfit = totalGrossProfit; + } + + + + +} diff --git a/posterita/posterita/src/main/org/posterita/beans/WebStockBean.java b/posterita/posterita/src/main/org/posterita/beans/WebStockBean.java new file mode 100644 index 0000000000..7b379e0277 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/WebStockBean.java @@ -0,0 +1,49 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ +package org.posterita.beans; + +import java.util.ArrayList; + + +public class WebStockBean +{ + private AttributeValuesBean attributeValuesBean; + private ArrayList regions; + + public AttributeValuesBean getAttributeValuesBean() + { + return attributeValuesBean; + } + + public void setAttributeValuesBean(AttributeValuesBean attributeValuesBean) + { + this.attributeValuesBean = attributeValuesBean; + } + + public ArrayList getRegions() + { + return regions; + } + + public void setRegions(ArrayList regions) + { + this.regions = regions; + } +} diff --git a/posterita/posterita/src/main/org/posterita/beans/WebstoreProductImageFileBean.java b/posterita/posterita/src/main/org/posterita/beans/WebstoreProductImageFileBean.java new file mode 100644 index 0000000000..8ff2977a1a --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/WebstoreProductImageFileBean.java @@ -0,0 +1,104 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + **/ + +/** + @author ashley + */ + +package org.posterita.beans; + +import java.util.ArrayList; +import java.util.Iterator; + +public class WebstoreProductImageFileBean +{ + + private String fileName; + private String brandDesignModelColourAttr; + + private ArrayList sizeList; + + public WebstoreProductImageFileBean() + { + sizeList = new ArrayList(); + } + + public String getBrandDesignModelColourAttr() + { + return brandDesignModelColourAttr; + } + + public void setBrandDesignModelColourAttr(String brandDesignModelColourAttr) + { + this.brandDesignModelColourAttr = brandDesignModelColourAttr; + } + + public String getFileName() + { + return fileName; + } + + public void setFileName(String fileName) + { + this.fileName = fileName; + } + + public ArrayList getSizeList() + { + return sizeList; + } + + public void setSizeList(ArrayList sizeList) + { + this.sizeList = sizeList; + } + + public void addSize(String size) + { + sizeList.add(size); + } + + @Override + public boolean equals(Object obj) + { + boolean equals = false; + + if(obj instanceof WebstoreProductImageFileBean) + { + if(((WebstoreProductImageFileBean)obj).brandDesignModelColourAttr.equalsIgnoreCase(this.brandDesignModelColourAttr)) + { + WebstoreProductImageFileBean tWProductImageFileBean = (WebstoreProductImageFileBean)obj; + Iterator sizeIter = tWProductImageFileBean.getSizeList().iterator(); + while(sizeIter.hasNext()) + { + String s = sizeIter.next(); + if(this.sizeList.contains(s)) + { + equals = true; + break; + } + } + } + } + + return equals; + } +} diff --git a/posterita/posterita/src/main/org/posterita/beans/WebstoreUserBean.java b/posterita/posterita/src/main/org/posterita/beans/WebstoreUserBean.java new file mode 100644 index 0000000000..ea428e8fa2 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/beans/WebstoreUserBean.java @@ -0,0 +1,127 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + **/ +package org.posterita.beans; + +import java.math.BigDecimal; + +public class WebstoreUserBean +{ + + protected UserBean userBean; + protected AddressBean shipToAddrBean; + protected CreditCardBean creditCardBean; + protected Integer chargeId; // not in udibean yet + protected String tenderType; //i.e. Payment Method: by card, cash (not in udibean yet) + protected String deliveryViaRule; // MInOut.DELIVERYVIARULE_Shipper etc + protected String chargeName; + protected BigDecimal chargeAmount; + /* + * Will be used only in session. + * Step 1: Delivery Information + * Step 2: Payment Information + * Step 3: Order Confirmation + * Step 4: Finished + */ + protected String step; + + + + public String getStep() + { + return step; + } + public void setStep(String step) + { + this.step = step; + } + + public CreditCardBean getCreditCardBean() + { + return creditCardBean; + } + public void setCreditCardBean(CreditCardBean creditCardBean) + { + this.creditCardBean = creditCardBean; + } + public AddressBean getShipToAddrBean() + { + return shipToAddrBean; + } + public void setShipToAddrBean(AddressBean shipToAddrBean) + { + this.shipToAddrBean = shipToAddrBean; + } + public UserBean getUserBean() + { + return userBean; + } + public void setUserBean(UserBean userBean) + { + this.userBean = userBean; + } + + public String getTenderType() + { + return tenderType; + } + public void setTenderType(String tenderType) + { + this.tenderType = tenderType; + } + public Integer getChargeId() + { + return chargeId; + } + public void setChargeId(Integer chargeId) + { + this.chargeId = chargeId; + } + public String getChargeName() + { + return chargeName; + } + public void setChargeName(String chargeName) + { + this.chargeName = chargeName; + } + public BigDecimal getChargeAmount() + { + return chargeAmount; + } + public void setChargeAmount(BigDecimal chargeAmount) + { + this.chargeAmount = chargeAmount; + } + public String getDeliveryViaRule() + { + return deliveryViaRule; + } + public void setDeliveryViaRule(String deliveryViaRule) + { + this.deliveryViaRule = deliveryViaRule; + } + + + + + + +} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/AbstractDocumentManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/AbstractDocumentManager.java new file mode 100644 index 0000000000..320f8abc03 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/businesslogic/AbstractDocumentManager.java @@ -0,0 +1,142 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +/** + @author vishee + */ + +package org.posterita.businesslogic; + +import java.math.BigDecimal; +import java.util.Properties; + +import org.compiere.model.MAttributeSetInstance; +import org.compiere.model.MBPartner; +import org.compiere.model.MTax; +import org.compiere.util.Env; + +import org.posterita.beans.WebDocumentHeaderBean; + + +public class AbstractDocumentManager +{ + public static final String REF_PO = "Ref PO No:"; + public static final String COUNTER_REF_SO = "Ref SO No:"; + + public static final String DEALER_REF = "Dealer Purchase Order No:"; + public static final String DEALER_COUNTER_REF = "Dealer Purchase Order No:"; + + + + public static final String FROM = "From:"; + public static final String TO = "To:"; + + + protected static BigDecimal getLineTaxAmt(Properties ctx, BigDecimal lineNetAmt, int taxId, int lineId) + { + BigDecimal baseAmt = Env.ZERO; + + baseAmt = baseAmt.add(lineNetAmt); + + MTax tax = new MTax(ctx, taxId, null); + + return (tax.calculateTax(baseAmt, false, 4)); + } + + protected static String getSerno(Properties ctx, int attributeSetInstanceId) + { + if (attributeSetInstanceId == 0) + return ""; + + MAttributeSetInstance attributeSetInstance = new MAttributeSetInstance(ctx, attributeSetInstanceId, null); + + return attributeSetInstance.getSerNo(); + } + + protected static WebDocumentHeaderBean createWebDocumentHeader(Properties ctx, int orgId, int bpartnerID, String docStatus, boolean isSoTrx,String paymentType) + { + if (isSoTrx) + return getSalesOrderHeader(ctx, orgId, bpartnerID, docStatus,paymentType); + else + return getPurchaseOrderHeader(ctx, orgId, bpartnerID, docStatus); + } + + protected static WebDocumentHeaderBean getSalesOrderHeader(Properties ctx, int orgId, int bpartnerID, String docStatus,String paymentType) + { + WebDocumentHeaderBean headerBean = new WebDocumentHeaderBean(); + + headerBean.setDcsRef(COUNTER_REF_SO); + headerBean.setDcsCounterRef(REF_PO); + headerBean.setDealerRef(null); + headerBean.setPaymentType(paymentType); + + //set to null because SOReference is not currently available in system + headerBean.setDealerCounterRef(DEALER_COUNTER_REF); + //headerBean.setDocumentStatus(order.getZZ_HondaDocStatus()); + headerBean.setDate("Date Ordered:"); + headerBean.setDocumentName("Sales Order"); + + + String youName = null; + MBPartner youPartner = new MBPartner(ctx, bpartnerID, null); + + youName = youPartner.getName(); + + + headerBean.setYouName(youName); + + headerBean.setFrom(TO); + + headerBean.setTo(FROM); + + return headerBean; + } + + + + + private static WebDocumentHeaderBean getPurchaseOrderHeader(Properties ctx, int orgId, int bpartnerID, String docStatus) + { + WebDocumentHeaderBean headerBean = new WebDocumentHeaderBean(); + + headerBean.setDcsRef(REF_PO); + headerBean.setDcsCounterRef(COUNTER_REF_SO); + headerBean.setDealerRef(DEALER_REF); + //set to null because SOReference is not currently available in system + headerBean.setDealerCounterRef(null); + headerBean.setDocumentStatus(docStatus); + headerBean.setDate("Date Ordered:"); + headerBean.setDocumentName("Purchase order"); + + + MBPartner youBP = new MBPartner(ctx, bpartnerID, null); + String youName = youBP.getName(); + + headerBean.setYouName(youName); + + headerBean.setFrom(TO); + + headerBean.setTo(FROM); + + + return headerBean; + } + +} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/AttributeValuesManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/AttributeValuesManager.java new file mode 100644 index 0000000000..b0b28ee5ff --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/businesslogic/AttributeValuesManager.java @@ -0,0 +1,326 @@ +/** + * Product: Posterita Web-Based POS (an Adempiere Plugin) + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +/** + @author ashley + */ + +package org.posterita.businesslogic; + +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Properties; + +import org.compiere.model.MAttribute; +import org.compiere.model.MAttributeValue; +import org.compiere.util.DB; +import org.compiere.util.Env; +import org.compiere.util.KeyNamePair; +import org.posterita.beans.AttributeInstanceBean; +import org.posterita.beans.AttributeValuesPair; +import org.posterita.core.KeyNamePairUtil; +import org.posterita.exceptions.OperationException; +import org.posterita.keyname.ProductAttributeValueKeyNamePair; +import org.posterita.util.PoManager; + +public class AttributeValuesManager +{ + private static ArrayList getAttributeValues(Properties ctx, int attributeId, int productCategoryId ) throws OperationException + { + ArrayList attributeValues = ProductAttributeValueKeyNamePair.getKeyNamePairs(ctx, attributeId, productCategoryId); + + return attributeValues; + + } + + //retrieve the colour, model, transmission, year from an attributesetinstanceID + //returns a bean containing a colour, model, year, transmission keynamepair + + public static AttributeValuesPair retrieveAttributeValues(Properties ctx,int attributeSetInstanceId) throws OperationException + { + if (attributeSetInstanceId == 0) + return new AttributeValuesPair(); + + ArrayList attributeInstances = getMAttributeInstances(ctx); + + return retrieveAttributeValues(ctx, attributeSetInstanceId, attributeInstances); + } + + public static AttributeValuesPair retrieveAttributeValues(Properties ctx,int attributeSetInstanceId, ArrayList attributeInstances) throws OperationException + { + HashMap attributeValuesMap = getAttributeValues(ctx, attributeSetInstanceId, attributeInstances); + + AttributeValuesPair pair = new AttributeValuesPair(); + pair.setBrandAttributeValue((KeyNamePair)attributeValuesMap.get("Brand")); + pair.setModelAttributeValue((KeyNamePair) attributeValuesMap.get("Model")); + pair.setColourAttributeValue((KeyNamePair) attributeValuesMap.get("Colour")); + pair.setTransmissionAttributeValue((KeyNamePair) attributeValuesMap.get("Transmission")); + pair.setYearAttributeValue((KeyNamePair) attributeValuesMap.get("Year")); + pair.setDesignAttributeValue((KeyNamePair) attributeValuesMap.get("Design")); + pair.setSizeAttributeValue((KeyNamePair) attributeValuesMap.get("Size")); + pair.setStyleAttributeValue((KeyNamePair) attributeValuesMap.get("Style")); + + return pair; + } + + private static HashMap getAttributeValues(Properties ctx, int attributeSetInstanceId, ArrayList attributeInstances) throws OperationException + { + ArrayList sameAttributeSetInstances = getAttributeInstancesByAttributeSetInstance(attributeSetInstanceId, attributeInstances); + + Iterator iter = sameAttributeSetInstances.iterator(); + + HashMap attributeValuesMap = new HashMap(); + + AttributeInstanceBean attributeInstanceBean; + while (iter.hasNext()) + { + attributeInstanceBean = (AttributeInstanceBean) iter.next(); + attributeValuesMap = getAttributeValue(ctx,attributeInstanceBean, attributeValuesMap); + + } + + return attributeValuesMap; + + } + + @SuppressWarnings("unchecked") + private static HashMap getAttributeValue(Properties ctx, AttributeInstanceBean attributeInstanceBean, HashMap attributeValuesMap) throws OperationException + { + KeyNamePair pair = new KeyNamePair(attributeInstanceBean.getAttributeValueId(), attributeInstanceBean.getAttributeValue()); + attributeValuesMap.put(attributeInstanceBean.getAttribute(), pair); + + return attributeValuesMap; + } + + public static ArrayList getMAttributeInstances(Properties ctx) throws OperationException + { +// MOrg org = OrganisationManager.getHsafOrg(ctx); // Honda customised stuff + + int adOrgID = Env.getAD_Org_ID(ctx); + String sql = "select ai.m_attributeSetInstance_id," + + " ai.m_attributevalue_id," + + " ai.value," + + " attr.name," + + " attr.M_Attribute_ID" + + " from m_attributeInstance ai, M_Attribute attr " + + " where ai.m_attribute_id=attr.m_attribute_id" + + " and ai.AD_CLIENT_ID=" + Env.getAD_Client_ID(ctx) + + " and ai.AD_ORG_ID="+adOrgID; + + PreparedStatement pstmt =null; + + ArrayList attributeInstances = new ArrayList(); + try + { + pstmt = DB.prepareStatement(sql, null); + ResultSet rs = pstmt.executeQuery(); + + AttributeInstanceBean bean; + while (rs.next()) + { + bean = new AttributeInstanceBean(); + bean.setAttributeSetInstanceId(rs.getInt(1)); + bean.setAttributeValueId(rs.getInt(2)); + bean.setAttributeValue(rs.getString(3)); + bean.setAttribute(rs.getString(4)); + bean.setAttributeId(rs.getInt(5)); + attributeInstances.add(bean); + } + + rs.close(); + + } + catch (SQLException e) + { + throw new OperationException(e.getMessage()); + } + finally + { + try + { + pstmt.close(); + } + catch (Exception ex) + { + } + pstmt = null; + } + + return attributeInstances; + } + + private static ArrayList getAttributeInstancesByAttributeSetInstance(int attributeSetInstanceId, ArrayList allAttributeInstances) + { + Iterator iter = allAttributeInstances.iterator(); + + AttributeInstanceBean bean; + ArrayList sameInstances = new ArrayList(); + while (iter.hasNext()) + { + bean = (AttributeInstanceBean) iter.next(); + if (bean.getAttributeSetInstanceId() == attributeSetInstanceId) + sameInstances.add(bean); + } + + + return sameInstances; + } + + public static MAttributeValue createAttributeValue(Properties ctx, String value, int attributeId, int productCategoryId, String trxName) throws OperationException + { + + MAttributeValue attributeValue = new MAttributeValue(ctx, 0, trxName); + attributeValue.setName(value); + attributeValue.setValue(value); +// attributeValue.setM_Product_Category_ID(productCategoryId); + attributeValue.setM_Attribute_ID(attributeId); + PoManager.save(attributeValue); + return attributeValue; + + } + + public static MAttributeValue getOrCreateAttributeValue(Properties ctx, int attributeId, String value, int productCategoryId, String trxName) throws OperationException + { + //check is attribute value exist before creating new one + int attributeValueIds[] = MAttributeValue.getAllIDs(MAttributeValue.Table_Name, "ad_client_id=" + Env.getAD_Client_ID(ctx) + " and Upper(name)=Upper('" + value + "')", trxName); + + MAttributeValue attributeValue; + if (attributeValueIds.length!= 0) + attributeValue = new MAttributeValue(ctx, attributeValueIds[0], trxName); + else + attributeValue = AttributeValuesManager.createAttributeValue(ctx, value, attributeId, productCategoryId, trxName); + + return attributeValue; + } + + public static MAttributeValue getAttributeValue(Properties ctx, int attributeId, int attributeSetInstanceId, String trxName) throws OperationException + { + String selStmt = "Select M_AttributeValue_ID from M_AttributeInstance where "; + selStmt += " AD_Client_ID=" + Env.getAD_Client_ID(ctx); + selStmt += " and M_AttributeSetInstance_ID=" + attributeSetInstanceId; + selStmt += " and M_Attribute_ID=" + attributeId; + + PreparedStatement pstmt = null; + + try + { + pstmt = DB.prepareStatement(selStmt, trxName); + ResultSet rs = pstmt.executeQuery(); + + if(!rs.next()) + throw new OperationException("Could not find Attribute Value id for Attribute id: " + attributeId + " and Attribute Set Instance Id: " + attributeSetInstanceId); + + int attributeValueId = rs.getInt(1); + rs.close(); + MAttributeValue attrValue = new MAttributeValue(ctx, attributeValueId, trxName); + return attrValue; + } + catch(SQLException sqlEx) + { + throw new OperationException("Could not execute query for getting attribute value: " + selStmt); + } + finally + { + try + { + pstmt.close(); + } + catch(Exception ex) + {} + } + } + + public static ArrayList getAttributeValues(Properties ctx, int AttributeId) throws OperationException + { + StringBuffer whereClause = new StringBuffer(); + whereClause.append("M_AttributeValue_ID in ( "); + whereClause.append("select distinct M_AttributeValue_ID from M_AttributeInstance "); + whereClause.append("where AD_Client_ID=" + Env.getAD_Client_ID(ctx) + " "); + whereClause.append(" and AD_Org_ID=" + Env.getAD_Org_ID(ctx) + " "); + whereClause.append("and M_Attribute_ID=" + AttributeId + " "); + whereClause.append(")"); + try + { + return KeyNamePairUtil.getData(ctx, MAttributeValue.Table_Name, whereClause.toString()); + } + catch(SQLException ex) + { + throw new OperationException("Could not retrieve Attribute Values with WhereClause: " + whereClause, ex); + } + } + + @SuppressWarnings("unchecked") + public static ArrayList getAttributes(Properties ctx) throws OperationException + { + String whereClause = "AD_Client_ID=" + Env.getAD_Client_ID(ctx) + " and IsActive='Y'"; + + try + { + return KeyNamePairUtil.getData(ctx, MAttribute.Table_Name, whereClause); + } + catch(SQLException ex) + { + throw new OperationException("Could not retrieve attributes with WhereClause: " + whereClause, ex); + } + } + + public static int changeAttributeValue(Properties ctx, int attributeValueId, String newValue, String trxName) throws OperationException + { + int retAttributeValueId; + String whereClause = "AD_Client_ID=" + Env.getAD_Client_ID(ctx); + whereClause += " and AD_Org_ID=" + Env.getAD_Org_ID(ctx) + " and Upper(Name)=Upper('" + newValue + "')"; + + int attrValueIds[] = MAttributeValue.getAllIDs(MAttributeValue.Table_Name, whereClause, trxName); + + if(attrValueIds.length > 1) + throw new OperationException("Duplicate name found in Attribute Value: " + newValue); + + MAttributeValue attributeValue = new MAttributeValue(ctx, attributeValueId, trxName); + if(attributeValue.get_ID() == 0) + throw new OperationException("Could not load Attribute Value with ID: " + attributeValueId); + + if(attrValueIds.length == 0) + { + attributeValue.setName(newValue); + attributeValue.setValue(newValue); + retAttributeValueId = attributeValue.get_ID(); + } + else if(attributeValueId == attrValueIds[0]) + { + attributeValue.setIsActive(true); + attributeValue.setName(newValue); + attributeValue.setValue(newValue); + retAttributeValueId = attributeValue.get_ID(); + } + else + { + attributeValue.setIsActive(false); + retAttributeValueId = attrValueIds[0]; + } + + PoManager.save(attributeValue); + + return retAttributeValueId; + } +} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/BankManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/BankManager.java new file mode 100644 index 0000000000..56071d09d5 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/businesslogic/BankManager.java @@ -0,0 +1,333 @@ +/** + * Product: Posterita Web-Based POS (an Adempiere Plugin) + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +/** + @author Alok Pathak + */ + +package org.posterita.businesslogic; + +import java.math.BigDecimal; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.util.ArrayList; +import java.util.Properties; +import java.util.logging.Level; + +import org.compiere.model.MBankAccount; +import org.compiere.model.MClient; +import org.compiere.model.MLocation; +import org.compiere.util.CLogger; +import org.compiere.util.DB; +import org.compiere.util.Env; +import org.posterita.beans.BankAccountBean; +import org.posterita.beans.BankBean; +import org.posterita.core.CheckDuplicateEntities; +import org.posterita.exceptions.BankAlreadyExistException; +import org.posterita.exceptions.OperationException; +import org.posterita.lib.UdiConstants; +import org.posterita.model.MBank; +import org.posterita.util.PoManager; + + +public class BankManager +{ + private static final CLogger log = CLogger.getCLogger(BankManager.class); + private static final String ROUTING_NUMBER="12345"; + + public static MBank createBank(Properties ctx, String bankName,String address1,String postalAddress1,String city,String routingNumber, String trxName) throws OperationException + { + + MBank bank = new MBank(ctx,0,trxName); + + if(CheckDuplicateEntities.checkDuplicateName(ctx,bankName,MBank.Table_Name)) + throw new BankAlreadyExistException("Bank already exists"); + + try + { + bank.setName(bankName); + bank.setRoutingNo(ROUTING_NUMBER); + + MLocation location = new MLocation(ctx,bank.getC_Location_ID(),trxName); + location.setAddress1(address1); + location.setPostal_Add(postalAddress1); + location.setCity(city); + location.setC_Country_ID(UdiConstants.COUNTRY_MAURITIUS); + + PoManager.save(location); + + bank.setC_Location_ID(location.get_ID()); + + PoManager.save(bank); + + } + catch(OperationException e) + { + throw new OperationException("Cannot create bank!!"); + } + + return bank; + + } + + public static MBankAccount createBankAccount(Properties ctx,int bankId,String accountNo,String accountType,double currentBalance, String trxName) throws OperationException + { + MBankAccount account; + + try + { + account = new MBankAccount(ctx,0,trxName); + account.setC_Bank_ID(bankId); + account.setAccountNo(accountNo); + account.setBankAccountType(accountType); + account.setC_Currency_ID(MClient.get(ctx).getC_Currency_ID()); + account.setIsDefault(true); + account.setCurrentBalance(new BigDecimal(currentBalance)); + + + PoManager.save(account); + } + catch(OperationException e) + { + throw new OperationException("Cannot create bank account!!"); + } + + return account; + + } + + + public static ArrayList getAllBanks(Properties ctx) throws OperationException + { + ArrayList list = new ArrayList(); + + //load all banks + int clientId = Env.getAD_Client_ID(ctx); + int orgId = Env.getAD_Org_ID(ctx); + + int id[] = MBank.getAllIDs(MBank.Table_Name," ad_client_id = "+clientId+" and ad_org_id = "+orgId +" and isactive = 'Y'" ,null); + BankBean bean; + + for(int i=0; i1) + throw new OperationException("Too many banks, not currently supported"); + + BankBean bean = (BankBean)allBanks.get(0); + bankId = bean.getBankId(); + } + + return bankId.intValue(); + } + + public static int getDefaultBankAccountId(Properties ctx, int adOrgId, String trxName) throws OperationException + { + String whereClause = "AD_Client_ID=" + Env.getAD_Client_ID(ctx) + " AND AD_Org_ID=" + adOrgId + " AND IsDefault='Y'"; + + int bankAccountIds[] = MBankAccount.getAllIDs(MBankAccount.Table_Name, whereClause, trxName); + + if (bankAccountIds.length == 0) + { + throw new OperationException("No default bank account found"); + } + else + { + return bankAccountIds[0]; + } + } + + + /** + * Retrieves all the active bank accounts that the user present in the application context can + * have access to + * @param ctx Context + * @param trxName Transaction + * @return List of Bank Account model data + * @throws OperationException If the data cannot be retrieved + */ + public static ArrayList getBankAccounts(Properties ctx, String trxName) throws OperationException + { + StringBuffer sqlStmt = new StringBuffer(); + sqlStmt.append("SELECT b.C_Bank_ID, b.Name, ba.C_BankAccount_ID, ba.bankAccountType, ba.AccountNo, ba.Description "); + sqlStmt.append("FROM C_Bank b INNER JOIN C_BankAccount ba ON b.C_Bank_ID=ba.C_Bank_ID "); + sqlStmt.append("WHERE b.AD_Client_ID=? AND b.IsActive='Y' AND ba.IsActive='Y' AND b.AD_Org_ID IN ("); + sqlStmt.append(Env.getContext(ctx, UdiConstants.ROLE_EDITABLE_ORGS_CTX_PARAM)); + sqlStmt.append(")"); + sqlStmt.append(" AND NOT EXISTS (SELECT * FROM AD_OrgInfo oi WHERE oi.TransferBank_ID=b.C_Bank_ID)"); + + ArrayList paramList = new ArrayList(); + paramList.add(new Integer(Env.getAD_Client_ID(ctx))); + + return getBankAccounts(ctx, sqlStmt.toString(), paramList, trxName); + } + + /** + * Retrieves all the active bank accounts present for an organisation + * @param ctx Context + * @param trxName Transaction + * @return List of Bank Account model data + * @throws OperationException If the data cannot be retrieved + */ + public static ArrayList getBankAccounts (Properties ctx, int adOrgId, String trxName) throws OperationException + { + StringBuffer sqlStmt = new StringBuffer(); + sqlStmt.append("SELECT b.C_Bank_ID, b.Name, ba.C_BankAccount_ID, ba.bankAccountType, ba.AccountNo, ba.Description "); + sqlStmt.append("FROM C_Bank b INNER JOIN C_BankAccount ba ON b.C_Bank_ID=ba.C_Bank_ID "); + sqlStmt.append("WHERE b.AD_Client_ID=? AND b.IsActive='Y' AND ba.IsActive='Y' AND ba.AD_Org_ID=?"); + sqlStmt.append(" AND NOT EXISTS (SELECT * FROM AD_OrgInfo oi WHERE oi.TransferBank_ID=b.C_Bank_ID)"); + + ArrayList paramList = new ArrayList(); + paramList.add(new Integer(Env.getAD_Client_ID(ctx))); + paramList.add(new Integer(adOrgId)); + + return getBankAccounts(ctx, sqlStmt.toString(), paramList, trxName); + } + + /** + * Retrieves list of bank accounts based on the criteria defined in the SQL Statement + * @param ctx Context + * @param sqlSmt SQL Statement + * @param params Parameters to be used to build the SQL + * @param trxName Transaction + * @return List of Bank Account + * @throws OperationException If data cannot be retrieved + */ + private static ArrayList getBankAccounts(Properties ctx, String sqlSmt, ArrayList params, String trxName) throws OperationException + { + ArrayList list = new ArrayList(); + + PreparedStatement pstmt = null; + ResultSet rs = null; + + try + { + int paramIndex = 1; + pstmt = DB.prepareStatement(sqlSmt, trxName); + if (params != null) + { + for (int i = 0; i < params.size(); i++) + { + pstmt.setObject(paramIndex++, params.get(i)); + } + } + rs = pstmt.executeQuery(); + + while (rs.next()) + { + BankAccountBean bean = new BankAccountBean(); + bean.setBankId(rs.getInt(1)); + bean.setBankName(rs.getString(2)); + bean.setBankAccountId(rs.getInt(3)); + bean.setAccountType(rs.getString(4)); + bean.setAccountNo(rs.getString(5)); + list.add(bean); + } + } + catch (Exception ex) + { + log.log(Level.SEVERE, "Could not get bank account information", ex); + throw new OperationException("Could not get bank account information", ex); + } + finally + { + DB.close(rs, pstmt); + } + + return list; + } +} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/CashManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/CashManager.java new file mode 100644 index 0000000000..808959159c --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/businesslogic/CashManager.java @@ -0,0 +1,1409 @@ +/* + * Product: Posterita Web-Based POS (an Adempiere Plugin) + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +/** + @author Alok Pathak + */ + +package org.posterita.businesslogic; + + +import java.math.BigDecimal; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.Properties; +import java.util.logging.Level; + +import org.compiere.model.MAttachment; +import org.compiere.model.MAttachmentEntry; +import org.compiere.model.MBPartner; +import org.compiere.model.MBPartnerLocation; +import org.compiere.model.MBankAccount; +import org.compiere.model.MCash; +import org.compiere.model.MCashBook; +import org.compiere.model.MCashLine; +import org.compiere.model.MCurrency; +import org.compiere.model.MDocType; +import org.compiere.model.MInvoice; +import org.compiere.model.MLocation; +import org.compiere.model.MOrg; +import org.compiere.model.MPayment; +import org.compiere.process.DocumentEngine; +import org.compiere.util.CLogger; +import org.compiere.util.DB; +import org.compiere.util.Env; +import org.compiere.util.TimeUtil; +import org.posterita.beans.CashBean; +import org.posterita.beans.CashBookBean; +import org.posterita.beans.CashBookDetailBean; +import org.posterita.beans.CashLineBean; +import org.posterita.beans.CashSummaryBean; +import org.posterita.beans.CurrentTillAmountBean; +import org.posterita.beans.OpenItemBean; +import org.posterita.beans.WebDocumentBean; +import org.posterita.beans.WebDocumentHeaderBean; +import org.posterita.businesslogic.performanceanalysis.POSReportManager; +import org.posterita.core.JulianDate; +import org.posterita.core.utils.FormatBigDecimal; +import org.posterita.exceptions.CanNotCloseTillException; +import org.posterita.exceptions.CashBookAlreadyAssignedException; +import org.posterita.exceptions.DataException; +import org.posterita.exceptions.NoCashJournalPresentException; +import org.posterita.exceptions.NullTransferAmountException; +import org.posterita.exceptions.OperationException; +import org.posterita.exceptions.TransferAmountExceedsTotalAmountException; +import org.posterita.lib.UdiConstants; +import org.posterita.util.PoManager; + +public class CashManager +{ + private static final CLogger log = CLogger.getCLogger(CashManager.class); + + /** + * Adjust cash book (i.e: Expense, Receipts or Bank Transfer) + * @param ctx Context + * @param bean Transaction Details + * @param trxName Transaction + * @return Cash Journal Entry created + * @throws OperationException If entries could not be created or invalid transfer type + */ + public static MCashLine adjustCashBook(Properties ctx, CashBookDetailBean bean, String trxName) throws OperationException + { + MCash cash = getCashJournal(ctx,trxName); + + if(bean.getAdjustmentAmount() == null) + { + throw new NullTransferAmountException("Amount can not be null"); + } + + MCashLine cashLine = null; + + if(bean.getTransferType().equalsIgnoreCase(MCashLine.CASHTYPE_GeneralReceipts)) + { + cashLine = createCashLine(ctx, cash, bean.getAdjustmentAmount(), + MCashLine.CASHTYPE_GeneralReceipts, bean.getDescription(), trxName); + } + + else if(bean.getTransferType().equalsIgnoreCase(MCashLine.CASHTYPE_GeneralExpense)) + { + if(bean.getAdjustmentAmount().compareTo(cash.getEndingBalance()) > 0) + { + throw new TransferAmountExceedsTotalAmountException("cannot transfer amount more than the ending balance"); + } + cashLine = createCashLine(ctx, cash, bean.getAdjustmentAmount().negate(), + MCashLine.CASHTYPE_GeneralExpense, bean.getDescription(), trxName); + } + else if(bean.getTransferType().equalsIgnoreCase(MCashLine.CASHTYPE_BankAccountTransfer)) + { + if(bean.getAdjustmentAmount().compareTo(cash.getEndingBalance()) > 0) + { + throw new TransferAmountExceedsTotalAmountException("cannot transfer amount more than the ending balance"); + } + // @ashley TODO Refactor should be able to chose bank account on which to transfer + int bankAccountId = POSTerminalManager.getBankAccountId(ctx, MPayment.TENDERTYPE_Check); + cashLine = createBankTransferCashEntry(ctx, cash, bean.getAdjustmentAmount(), + bankAccountId, bean.getDescription(), trxName); + } + else + { + throw new OperationException("Invalid transfer type: " + bean.getTransferType()); + } + + return cashLine; + } + + /** + * Creates a new Journal entry + * @param ctx Context + * @param cashJournal Cash Journal + * @param amount Amount + * @param cashType Cash Type + * @param trxName Transaction + * @return The created journal entry (Cash Line) + * @throws OperationException If the entry cannot be created + */ + public static MCashLine createCashLine(Properties ctx, MCash cashJournal, BigDecimal amount, + String cashType, String trxName) throws OperationException + { + return createCashLine(ctx, cashJournal, amount, cashType, "", trxName); + } + + /** + * Creates a new Journal entry + * @param ctx Context + * @param cashJournal Cash Journal + * @param amount Amount + * @param cashType Cash Type + * @param description Description of the entry + * @param trxName Transaction + * @return The created journal entry (Cash Line) + * @throws OperationException If the entry cannot be created + */ + public static MCashLine createCashLine(Properties ctx, MCash cashJournal, BigDecimal transferAmount, + String cashType, String description, String trxName) throws OperationException + { + MCashLine cashLine = new MCashLine(ctx, 0, trxName); + cashLine.setC_Cash_ID(cashJournal.get_ID()); + cashLine.setAmount(transferAmount); + cashLine.setCashType(cashType); + cashLine.setDescription(description); + PoManager.save(cashLine); + return cashLine; + } + + /** + * Creates a new Bank Account transfer Journal entry + * @param ctx Context + * @param cashJournal Cash Journal + * @param amount Amount to transfer + * @param bankAccountId Bank Account + * @param trxName Transaction + * @return Cash Line entry + * @throws OperationException If the entry cannot be created + */ + public static MCashLine createBankTransferCashEntry(Properties ctx, MCash cashJournal, + BigDecimal transferAmount, int bankAccountId, String trxName) throws OperationException + { + return createBankTransferCashEntry(ctx, cashJournal, transferAmount, bankAccountId, null, trxName); + } + + /** + * Creates a new Bank Account transfer Journal entry + * @param ctx Context + * @param cashJournal Cash Journal + * @param amount Amount to transfer + * @param bankAccountId Bank Account + * @param description Description of the line + * @param trxName Transaction + * @return Cash Line entry + * @throws OperationException If the entry cannot be created + */ + public static MCashLine createBankTransferCashEntry(Properties ctx, MCash cashJournal, + BigDecimal amount, int bankAccountId, String description, String trxName) throws OperationException + { + MBankAccount bankAccount = new MBankAccount(ctx, bankAccountId, trxName); + + StringBuffer descr = new StringBuffer(); + // +ve/zero indicates transfer to bankAccount + // Though transfer of zero is meaningless + if (amount.signum() >= 0) + { + descr.append(" -> "); + } + else + { + descr.append(" <- "); + } + descr.append(bankAccount.getAccountNo()).append(" (BA)"); + + if (description != null && description.trim().length() > 0) + { + descr.append(" ").append(description); + } + + MCashLine cashLine = new MCashLine(ctx, 0, trxName); + cashLine.setC_Cash_ID(cashJournal.get_ID()); + cashLine.setDescription(descr.toString()); + cashLine.setAmount(amount.negate()); + cashLine.setCashType(MCashLine.CASHTYPE_BankAccountTransfer); + cashLine.setC_BankAccount_ID(bankAccountId); + PoManager.save(cashLine); + return cashLine; + } + + /** + * @param ctx Context + * @return List of Cash Book Details + * @throws OperationException + */ + public static CashBookDetailBean getCashBookDetails(Properties ctx, String trxName) throws OperationException + { + Integer cashBookId = POSTerminalManager.getCashBookId(ctx); + CashManager.getCashJournal(ctx, cashBookId, trxName); + + String sql ="select cash.C_CASH_ID," +//1 + "cash.C_CASHBOOK_ID," +//2 + "cash.NAME," +//3 + "cash.DESCRIPTION," +//4 + "cash.DATEACCT," +//5 + "cash.BEGINNINGBALANCE," +//6 + "cash.ENDINGBALANCE," +//7 + "cash.STATEMENTDIFFERENCE," +//8 + "cash.DOCSTATUS," +//9 + "book.name as bookName" +//10 + " from C_CASH cash,C_CASHBOOK book " + + " where cash.C_CASHBOOK_ID=book.C_CASHBOOK_ID"+ + " and book.C_CashBook_ID = " + cashBookId + + " and book.ad_client_id=" +Env.getAD_Client_ID(ctx)+ + " and book.AD_ORG_ID=" +Env.getAD_Org_ID(ctx) + + " order by cash.created desc"; + + CashBookDetailBean bean = null; + PreparedStatement pstmt = null; + ResultSet rs = null; + try + { + pstmt = DB.prepareStatement(sql, trxName); + rs = pstmt.executeQuery(); + if(rs.next()) + { + bean = new CashBookDetailBean(); + bean.setCashJournalId(Integer.valueOf(rs.getInt(1))); + bean.setCashBookId(Integer.valueOf(rs.getInt(2))); + bean.setCashJournalName(rs.getString(3)); + bean.setCashJournalDisc(rs.getString(4)); + bean.setDateAcct(rs.getTimestamp(5)); + bean.setBeginingBalance( rs.getBigDecimal(6)); + bean.setEndingBalance(rs.getBigDecimal(7)); + bean.setStatementDifference(rs.getBigDecimal(8)); + bean.setDocStatus(rs.getString(9)); + bean.setCashBookName(rs.getString(10)); + } + } + catch (SQLException e) + { + throw new OperationException(e); + } + finally + { + DB.close(rs, pstmt); + } + + if (bean == null) + { + throw new NoCashJournalPresentException("No Cash journal is present"); + } + + return bean; + } + + + public static ArrayList getCashBookDetailsForTill(Properties ctx,int cashBookId, Timestamp fromDate,Timestamp toDate) throws OperationException + { + + + String sql1 ="select c_cash_id from C_CASH where C_CASHBOOK_ID="+cashBookId+ + " and created between "+DB.TO_DATE(fromDate, false) + " AND " + DB.TO_DATE(toDate, false); + + String sql="select nvl(sum(AMOUNT),0)" + + " from C_CASHLINE" + + " where C_CASH_ID in (" +sql1+")"+ + " and AD_CLIENT_ID= " +Env.getAD_Client_ID(ctx)+ + " and CASHTYPE='I'"+ + " and created between " + DB.TO_DATE(fromDate, false) + + " and " + DB.TO_DATE(toDate, false) ; + + + CashBookDetailBean bean; + ArrayList list=new ArrayList(); + PreparedStatement pstmt = DB.prepareStatement(sql,null); + try + { + ResultSet rs=pstmt.executeQuery(); + while(rs.next()) + { + bean=new CashBookDetailBean(); + bean.setStatementDifference(rs.getBigDecimal(1)); + list.add(bean); + } + rs.close(); + } + catch (SQLException e) + { + throw new OperationException(e); + } + finally + { + try + { + if(pstmt != null) + pstmt.close(); + } + catch(Exception ex){} + + pstmt = null; + } + + return list; + } + + + + + public static ArrayList getCashBookDetailsFyracle(Properties ctx) throws OperationException + { + Integer cashBookId=Integer.valueOf(POSTerminalManager.getCashBook(ctx).get_ID()); + String sql ="select cash.C_CASH_ID," +//1 + " cash.C_CASHBOOK_ID," +//2 + " cash.NAME," +//3 + " cash.DESCRIPTION," +//4 + " cash.DATEACCT," +//5 + " cash.BEGINNINGBALANCE," +//6 + " cash.ENDINGBALANCE," +//7 + " cash.STATEMENTDIFFERENCE," +//8 + " cash.DOCSTATUS," +//9 + " book.name bookName," +//10 + " cash.created, " +//11 + " cash.AD_CLIENT_ID," +//12 + " cash.AD_ORG_ID" +//13 + " from C_CASH cash,C_CASHBOOK book " + + " where cash.C_CASHBOOK_ID=book.C_CASHBOOK_ID"+ + " and cash.C_CASHBOOK_ID="+cashBookId+ + " and cash.ad_client_id="+Env.getAD_Client_ID(ctx)+ + " and cash.ad_org_id="+Env.getAD_Org_ID(ctx) + + " order by cash.created desc"; + + CashBookDetailBean bean; + ArrayList list=new ArrayList(); + PreparedStatement pstmt =DB.prepareStatement(sql,null); + try + { + ResultSet rs=pstmt.executeQuery(); + if(rs.next()) + { + bean=new CashBookDetailBean(); + bean.setCashJournalId(Integer.valueOf(rs.getInt(1))); + bean.setCashBookId(Integer.valueOf(rs.getInt(2))); + bean.setCashJournalName(rs.getString(3)); + bean.setCashJournalDisc(rs.getString(4)); + bean.setDateAcct(rs.getTimestamp(5)); + bean.setBeginingBalance(new BigDecimal(rs.getString(6))); + bean.setEndingBalance(new BigDecimal(rs.getString(7))); + bean.setStatementDifference(new BigDecimal(rs.getString(8))); + bean.setDocStatus(rs.getString(9)); + bean.setCashBookName(rs.getString(10)); + list.add(bean); + } + rs.close(); + } + catch (SQLException e) + { + throw new OperationException(e); + } + finally + { + try + { + if(pstmt != null) + pstmt.close(); + } + catch(Exception ex){} + + pstmt = null; + } + + return list; + } + + + /** + * Adjusts the beginning balance on the latest Cash journal available for the Cash Book + * @param ctx Context + * @param terminalId Terminal + * @param trxName Transaction + * @throws OperationException If Cash Journal could not be updated + */ + public static void updateBeginningBalance(Properties ctx, int terminalId, String trxName) throws OperationException + { + int cashBookId = POSTerminalManager.getCashBookId(ctx, terminalId); + + updateCashBookBeginningBalance(ctx, cashBookId, trxName); + } + + + public static void updateCashBookBeginningBalance(Properties ctx, int cashBookId, String trxName) throws OperationException + { + int toJournalId=0; + CashBean bean1 = getData(ctx,cashBookId,true,trxName); + if(bean1!=null) + { + toJournalId = bean1.getCashJournalId().intValue(); + } + + CashBean bean2 = getData(ctx,cashBookId,false,trxName); + + BigDecimal endingBalance=null; + + if (bean2!=null) + endingBalance = bean2.getEndingBalance(); + + if (endingBalance==null) + endingBalance=new BigDecimal(0); + + MCash cash = new MCash(ctx,toJournalId,trxName); + + endingBalance = FormatBigDecimal.currency(endingBalance); + + cash.setBeginningBalance(endingBalance);//ending balance of the previous one is the begining balance of the new one + PoManager.save(cash); + } + + + private static String getDataSQL(Properties ctx, int cashBookId) + { + String sql="select * from " + + " (select cash.C_CASH_ID," +//1 + "cash.C_CASHBOOK_ID," +//2 + "cash.ENDINGBALANCE," +//3 + "cash.DOCSTATUS," + //4 + "cash.AD_CLIENT_ID," +//6 + " cash.AD_ORG_ID," +//7 + " cash.created"+//8 + " from C_CASH cash,C_CASHBOOK book" + + " where cash.C_CASHBOOK_ID=book.C_CASHBOOK_ID" + + "@DOCSTATUS@" + + " and book.C_CashBook_ID="+cashBookId+ + " and cash.ad_client_id=?"+ + " and cash.AD_ORG_ID=? order by cash.Created Desc) cashDetails"; + return sql; + } + + public static CashBean getData(Properties ctx,int cashBookId,boolean isLatest,String trxName) throws OperationException + { + + String sql = getDataSQL(ctx, cashBookId); + + if(isLatest) + sql=sql.replaceAll("@DOCSTATUS@"," and cash.docstatus <> 'CO'"); + else + sql=sql.replaceAll("@DOCSTATUS@"," and cash.docstatus = 'CO'"); + + PreparedStatement pstmt = DB.prepareStatement(sql,trxName); + CashBean bean=null; + + try + { + pstmt.setInt(1, Env.getAD_Client_ID(ctx)); + pstmt.setInt(2, Env.getAD_Org_ID(ctx)); + ResultSet rs=pstmt.executeQuery(); + if(rs.next()) + { + bean=new CashBean(); + bean.setCashJournalId(Integer.valueOf(rs.getInt(1))); + bean.setEndingBalance(rs.getBigDecimal(3)); + bean.setDocStatus(rs.getString(4)); + } + + rs.close(); + } + catch (SQLException e) + { + throw new OperationException(e); + } + finally + { + try + { + if (pstmt != null) + pstmt.close(); + } + catch(Exception ex){} + + pstmt = null; + } + return bean; + } + + public static MCashBook createCashBook(Properties ctx, int orgId, String name, int currencyId, String trxName) throws OperationException + { + MCashBook cashBook = new MCashBook(ctx, 0, trxName); + cashBook.setName(name); + cashBook.setC_Currency_ID(currencyId); + cashBook.setAD_Org_ID(orgId); + PoManager.save(cashBook); + return cashBook; + } + + + private static MCash getCashJournal(Properties ctx, String trxName) throws OperationException + { + int cashBookId = POSTerminalManager.getCashBookId(ctx); + return getCashJournal(ctx, cashBookId, trxName); + } + + public static MCash getCashJournal(Properties ctx, int cashBookId, String trxName) throws OperationException + { + MCash cashJournal = getMcash(ctx, cashBookId, JulianDate.getTodayDateOnly(), trxName); + + if (cashJournal == null) + { + cashJournal = MCash.get(ctx, cashBookId, JulianDate.getTodayDateOnly(), trxName); + CashManager.updateCashBookBeginningBalance(ctx, cashBookId, trxName); + } + + return cashJournal; + } + + + private static MCash getMcash(Properties ctx, int C_CashBook_ID, + Timestamp dateAcct, String trxName) throws OperationException + { + MCash retValue = null; + + String sql; + + sql = "SELECT * FROM C_Cash c " + + "WHERE c.C_CashBook_ID=?" // #1 + //+ " AND TRUNC(c.StatementDate)=?" // #2 + + " AND c.Processed='N'" + + " AND c.docstatus='DR'"; + + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement (sql, trxName); + + pstmt.setInt (1, C_CashBook_ID); + //pstmt.setTimestamp (2, TimeUtil.getDay(dateAcct)); + + ResultSet rs = pstmt.executeQuery (); + if (rs.next ()) + retValue = new MCash (ctx, rs, trxName); + rs.close (); + } + catch (Exception e) + { + throw new OperationException(e); + } + finally + { + try + { + if (pstmt != null) + pstmt.close (); + + } + catch (Exception e) + {} + + pstmt = null; + } + + return retValue; + + + } + + + /** + * @param ctx + * @param bean + * @param trxName + * @return + * @throws NullTransferAmountException + * @throws TransferAmountExceedsTotalAmountException + * @throws OperationException + */ + public static CashBookDetailBean CloseTill(Properties ctx, CashBookDetailBean bean, String trxName) + throws NullTransferAmountException, TransferAmountExceedsTotalAmountException, OperationException + { + int terminalId = POSTerminalManager.getTerminalId(ctx); + MCash cashJournal = getCashJournal(ctx, trxName); + + bean.setCash_id(cashJournal.get_ID()); + + BigDecimal transferAmt = (bean.getTransferAmount() == null ? Env.ZERO : bean.getTransferAmount()); + BigDecimal differenceAmt = (bean.getDifferenceAmt() == null ? Env.ZERO : bean.getDifferenceAmt()); + BigDecimal beginingBalance = bean.getBeginingBalance(); + BigDecimal netTransfer = null; + BigDecimal beginningBalanceDifference = Env.ZERO; + + CashBookDetailBean cbDetailsBean = getCashBookDetails(ctx, trxName); + + CurrentTillAmountBean currentAmountBean = POSManager.getCurrentTillAmount(ctx); + + beginningBalanceDifference = beginingBalance.subtract(cbDetailsBean.getBeginingBalance()); + + bean.setBeginingBalance(cbDetailsBean.getBeginingBalance()); + bean.setEndingBalance(cbDetailsBean.getEndingBalance()); + bean.setStatementDifference(cbDetailsBean.getStatementDifference()); + netTransfer = transferAmt.subtract(cbDetailsBean.getBeginingBalance()); + differenceAmt = (bean.getStatementDifference().subtract(netTransfer)).negate(); + bean.setDifferenceAmt(differenceAmt); + bean.setCashBookName(cbDetailsBean.getCashBookName()); + bean.setDocStatus(cbDetailsBean.getDocStatus()); + + if( bean.getDocStatus().equals(DocumentEngine.STATUS_Completed)) + { + throw new CanNotCloseTillException("Already closed,Cannot close till "); + } + + netTransfer = netTransfer.subtract(beginningBalanceDifference); + + if (differenceAmt.compareTo(Env.ZERO) != 0) + { + createCashLine(ctx, cashJournal, differenceAmt, MCashLine.CASHTYPE_Difference, trxName); + } + + BigDecimal cardTotal = currentAmountBean.getCardTotal(); + BigDecimal chequeTotal = currentAmountBean.getChequeTotal(); + + // Do Transfer for CardTotal and Cheque total here + + BigDecimal notifiedCardTotal = (bean.getCardTotal() == null ? Env.ZERO : bean.getCardTotal()); + BigDecimal notifiedChequeTotal = (bean.getChequeTotal() == null ? Env.ZERO : bean.getChequeTotal()); + bean.setCardDifference(Env.ZERO); + bean.setChequeDifference(Env.ZERO); + + if(cardTotal.compareTo(notifiedCardTotal) != 0) + { + bean.setCardDifference(notifiedCardTotal.subtract(cardTotal)); + } + + if(chequeTotal.compareTo(notifiedChequeTotal) != 0) + { + bean.setChequeDifference(notifiedChequeTotal.subtract(chequeTotal)); + } + + PoManager.save(cashJournal); + + POSTerminalManager.closeTerminal(ctx, terminalId, cashJournal, netTransfer, chequeTotal, cardTotal, trxName); + + PoManager.processIt(cashJournal, DocumentEngine.ACTION_Complete); + + return bean; + } + + + public static void closePreviousDraftedCashjournals(Properties ctx, int cashBookId,String trxName) throws OperationException + { + String sql = "SELECT C_CASH_ID FROM C_Cash c " + + "WHERE c.C_CashBook_ID=?" + + " AND c.Processed='N'" + + " AND c.docstatus='DR'" + + " AND TRUNC(c.StatementDate) getCashDetails(Properties ctx, int cashBookId, Integer month, Integer year, String trxName) throws OperationException + { + ArrayList cashList = new ArrayList(); + + int adClientId = Env.getAD_Client_ID(ctx); + String userOrg = Env.getContext(ctx, UdiConstants.ROLE_EDITABLE_ORGS_CTX_PARAM); + + String sql = "Select C_Cash_ID, Name, Created, Updated, StatementDate, DateAcct, BeginningBalance, EndingBalance, DocStatus " + + " from C_Cash" + + " where AD_Client_ID=" + adClientId + + " and AD_Org_ID in (" + userOrg + ")" + + " and IsActive='Y'" + + " AND C_CashBook_ID=" + cashBookId; + + + if (month != null) + { + String mm = String.valueOf(month); + if (mm.length() == 1) + { + mm = "0" + mm; + } + sql = sql + " and to_char(Created, 'mm') = '" + mm +"'"; + } + + if (year != null) + sql = sql + " and to_char(Created, 'yyyy') = '" + year + "'"; + + sql += " order by created desc"; + + PreparedStatement pstmt = null; + + try + { + pstmt = DB.prepareStatement(sql, trxName); + ResultSet rs = pstmt.executeQuery(); + + while (rs.next()) + { + CashBean cashBean = new CashBean(); + cashBean.setCashId(rs.getInt(1)); + cashBean.setName(rs.getString(2)); + cashBean.setDateCreated(rs.getTimestamp(3)); + cashBean.setDateUpdated(rs.getTimestamp(4)); + cashBean.setStatmentDate(rs.getString(5)); + cashBean.setDateAcct(rs.getTimestamp(6)); + cashBean.setBeginingBalance(rs.getBigDecimal(7)); + cashBean.setEndingBalance(rs.getBigDecimal(8)); + cashBean.setDocStatus(rs.getString(9)); + + cashList.add(cashBean); + } + + rs.close(); + } + catch (Exception ex) + { + throw new OperationException("Cannot retrieve Cash with sql: " + sql, ex); + } + finally + { + try + { + pstmt.close(); + } + catch(Exception e) + {} + + pstmt = null; + } + + return cashList; + } + + + /** + * Loads a cash book + * @param ctx Context + * @param cashBookId Cash Book ID to be loaded + * @param trxName Transaction + * @return Cash Book PO + * @throws OperationException If teh cash book cannot be loaded + */ + public static MCashBook loadCashBook(Properties ctx, int cashBookId, String trxName) throws OperationException + { + MCashBook cashBook = new MCashBook(ctx, cashBookId, trxName); + if (cashBook.get_ID() <= 0) + { + throw new OperationException("Could not load cash book with id: " + cashBookId); + } + return cashBook; + } + + public static MCash loadCash(Properties ctx, int cashId, String trxName) throws OperationException + { + MCash cash = new MCash(ctx, cashId, trxName); + + if(cash.get_ID() == 0) + throw new OperationException("Could not load cash with i12,435.96d: " + cashId); + + return cash; + } + + public static CashSummaryBean getCashSummary(Properties ctx, int cashId, String trxName) throws OperationException + { + String sql = "select ca.CashType, sum(ca.Amount)" + + " from C_CASHLINE ca where C_cash_ID=" + cashId + + " group by ca.cashtype"; + + MCash cashJournal = new MCash(ctx, cashId, trxName); + CashSummaryBean bean = getCashSummary(ctx, sql, trxName); + bean.setBeginingBalance(cashJournal.getBeginningBalance()); + bean.setEndingBalance(cashJournal.getEndingBalance()); + return bean; + } + + public static CashSummaryBean getCashSummary(Properties ctx, String fromDate, String toDate, String trxName) throws OperationException + { + int adClientId = Env.getAD_Client_ID(ctx); + String userOrg = Env.getContext(ctx, UdiConstants.ROLE_EDITABLE_ORGS_CTX_PARAM); + String sql = "select ca.CashType, sum(ca.Amount)" + + " from C_CASHLINE ca where ca.AD_Client_ID=" + adClientId + + " and ca.AD_Org_ID in (" + userOrg + ")" + + " and ca.Created between to_date('" + fromDate + "','DD-MM-YYYY HH24:MI:SS')" + + " and to_date('" + toDate + "','DD-MM-YYYY HH24:MI:SS') " + + " group by ca.cashtype"; + + return getCashSummary(ctx, sql, trxName); + } + + private static CashSummaryBean getCashSummary(Properties ctx, String sql, String trxName) throws OperationException + { + PreparedStatement pstmt = null; + CashSummaryBean cashSummaryBean = new CashSummaryBean(); + try + { + pstmt = DB.prepareStatement(sql, trxName); + ResultSet rs = pstmt.executeQuery(); + + while(rs.next()) + { + String cashType = rs.getString(1); + BigDecimal amount = rs.getBigDecimal(2); + + if(MCashLine.CASHTYPE_BankAccountTransfer.equals(cashType)) + cashSummaryBean.setBankAcctTransferAmount(amount); + else if(MCashLine.CASHTYPE_Charge.equals(cashType)) + cashSummaryBean.setChargeAmount(amount); + else if(MCashLine.CASHTYPE_Difference.equals(cashType)) + cashSummaryBean.setDifferenceAmount(amount); + else if(MCashLine.CASHTYPE_GeneralExpense.equals(cashType)) + cashSummaryBean.setGeneralExpenseAmount(amount); + else if(MCashLine.CASHTYPE_GeneralReceipts.equals(cashType)) + cashSummaryBean.setGeneralReceiptsAmount(amount); + else if(MCashLine.CASHTYPE_Invoice.equals(cashType)) + cashSummaryBean.setInvoiceAmount(amount); + else + throw new OperationException("Unknown CashType: " + cashType); + } + + rs.close(); + } + catch(Exception ex) + { + throw new OperationException("Could not retrieve cash summary with sql: " + sql, ex); + } + finally + { + try + { + pstmt.close(); + } + catch(Exception e) + {} + + pstmt = null; + } + + return cashSummaryBean; + } + + public static ArrayList getCashLineHistory(Properties ctx, String fromDate, String todate, String trxName) throws OperationException + { + int adClientId = Env.getAD_Client_ID(ctx); + String userOrg = Env.getContext(ctx, UdiConstants.ROLE_EDITABLE_ORGS_CTX_PARAM); + + String sql = "select cl.C_CashLine_ID, cl.CashType, rl.name, cl.Created, cl.C_Cash_ID, cl.C_Invoice_ID, cl.Amount, cu.CurSymbol, cl.Description " + + " from C_CashLine cl, AD_Ref_List rl, C_Currency cu " + + " where cl.AD_Client_ID= " + adClientId + + " and cl.AD_Org_ID in (" + userOrg + ") " + + " and rl.AD_Reference_ID = " + MCashLine.CASHTYPE_AD_Reference_ID + + " and cl.CashType = rl.Value" + + " and cu.C_Currency_ID = cl.C_Currency_ID" + + " and cl.Created between to_date('"+ fromDate+"','DD-MM-YYYY HH24:MI:SS') " + + " and to_date('" + todate+"','DD-MM-YYYY HH24:MI:SS') " + + " order by cl.created"; + + return getCashLineHistory(ctx, sql, trxName); + + } + + public static ArrayList getCashLineHistory(Properties ctx, int cashId, String trxName) throws OperationException + { + int adClientId = Env.getAD_Client_ID(ctx); + String userOrg = Env.getContext(ctx, UdiConstants.ROLE_EDITABLE_ORGS_CTX_PARAM); + String sql = "select cl.C_CashLine_ID, cl.CashType, rl.name, cl.Created, cl.C_Cash_ID, cl.C_Invoice_ID, cl.Amount, cu.CurSymbol, cl.Description " + + " from C_CashLine cl, AD_Ref_List rl, C_Currency cu " + + " where cl.AD_Client_ID= " + adClientId + + " and cl.AD_Org_ID in (" + userOrg + ") " + + " and rl.AD_Reference_ID = " + MCashLine.CASHTYPE_AD_Reference_ID + + " and cl.CashType = rl.Value" + + " and cu.C_Currency_ID = cl.C_Currency_ID" + + " and cl.C_Cash_ID=" + cashId + + " order by cl.created"; + + + return getCashLineHistory(ctx, sql, trxName); + } + + private static ArrayList getCashLineHistory(Properties ctx, String sql, String trxName) throws OperationException + { + ArrayList repSummaryList = new ArrayList(); + + PreparedStatement pstmt = null; + + try + { + pstmt = DB.prepareStatement(sql, trxName); + ResultSet rs = pstmt.executeQuery(); + + while(rs.next()) + { + int i = 0; + CashLineBean repSummaryBean = new CashLineBean(); + repSummaryBean.setCashLineId(rs.getInt(++i)); + repSummaryBean.setCashType(rs.getString(++i)); + repSummaryBean.setCashTypeName(rs.getString(++i)); + repSummaryBean.setDateCreated(rs.getTimestamp(++i)); + repSummaryBean.setCashId(rs.getInt(++i)); + repSummaryBean.setInvoiceId(rs.getInt(++i)); + repSummaryBean.setAmount(rs.getBigDecimal(++i)); + repSummaryBean.setCurrency(rs.getString(++i)); + repSummaryBean.setDescription(rs.getString(++i)); + repSummaryList.add(repSummaryBean); + } + + rs.close(); + } + catch(Exception ex) + { + throw new OperationException("Could not retrieve data for report summary with sql: " + sql, ex); + } + finally + { + try + { + pstmt.close(); + } + catch(Exception ex){} + + pstmt = null; + } + + return repSummaryList; + } + + + public static MCashLine createCashLineForInvoice(Properties ctx,OpenItemBean bean,String trxName) throws OperationException + { + int cashBookId = POSTerminalManager.getCashBookId(ctx); + MCash cash = MCash.get(ctx,cashBookId,JulianDate.getTodayDateOnly(),trxName); + + MCashLine [] cashLines = cash.getLines(true); + if(cashLines.length==0) + { + updateCashBookBeginningBalance(ctx, cashBookId, trxName); + } + + //Load invoice + MInvoice invoice = new MInvoice(ctx, bean.getInvoiceId(), trxName); + MDocType dt = MDocType.get(ctx, invoice.getC_DocType_ID()); + + BigDecimal amt = bean.getPaymentAmt(); + BigDecimal discountAmt = bean.getDiscountAmt() == null ? Env.ZERO : bean.getDiscountAmt(); + BigDecimal writeOffAmt = bean.getWriteOffAmt() == null ? Env.ZERO : bean.getWriteOffAmt(); + + + if (MDocType.DOCBASETYPE_APInvoice.equals(dt.getDocBaseType()) + || MDocType.DOCBASETYPE_ARCreditMemo.equals(dt.getDocBaseType()) ) + { + amt = amt.negate(); + discountAmt = discountAmt.negate(); + writeOffAmt = writeOffAmt.negate(); + } + + MCashLine cashLine = new MCashLine(ctx,0,trxName); + cashLine.setC_Cash_ID(cash.get_ID()); + cashLine.setCashType(MCashLine.CASHTYPE_Invoice); + cashLine.setC_Invoice_ID(bean.getInvoiceId()); + cashLine.setC_Currency_ID(invoice.getC_Currency_ID()); + cashLine.setAmount(amt); + cashLine.setDiscountAmt(discountAmt); + cashLine.setWriteOffAmt(writeOffAmt); + + PoManager.save(cashLine); + return cashLine; + } + + /** + * Creates a new Cash Journal entry with the amount specified for the invoice + * @param ctx Context + * @param cashId Cash Journal + * @param invoiceId Invoice + * @param amount Cash Amount + * @param trxName Transaction + * @return Cash Journal Entry + * @throws OperationException If Cash Line creation failed + */ + public static MCashLine createCashLine(Properties ctx, int cashId, int invoiceId, + BigDecimal amount, BigDecimal writeOffAmout, BigDecimal discountAmt, + String trxName) throws OperationException + { + MInvoice invoice = new MInvoice(ctx, invoiceId, trxName); + if (invoice.get_ID() == 0) + { + throw new OperationException("Could not load invoice!!!"); + } + + MCashLine cashLine = new MCashLine(ctx, 0, trxName); + cashLine.setC_Cash_ID(cashId); + cashLine.setInvoice(invoice); + cashLine.setAmount(amount); + cashLine.setWriteOffAmt(writeOffAmout); + cashLine.setDiscountAmt(discountAmt); + PoManager.save(cashLine); + return cashLine; + } + + public static WebDocumentBean getWebCashPaymentBean(Properties ctx, int cashLineId) throws OperationException, DataException + { + MCashLine cashLine = new MCashLine(ctx,cashLineId,null); + MInvoice invoice = new MInvoice(ctx,cashLine.getC_Invoice_ID(),null); + if (cashLine == null) + throw new OperationException("Invalid operation payment is null"); + + if (cashLine.get_ID() == 0) + throw new OperationException("You have deleted this payment. You cannot view this payment."); + + WebDocumentBean bean = new WebDocumentBean(); + + bean.setPaymentId(Integer.valueOf(cashLine.get_ID())); + + int currencyId = cashLine.getC_Currency_ID(); + MCurrency currency = new MCurrency(ctx,currencyId,null); + bean.setCurrencySymbole(currency.getCurSymbol()); + + + MOrg myOrg = OrganisationManager.getMyOrg(ctx); + MBPartner me = new MBPartner(ctx, myOrg.getLinkedC_BPartner_ID(null), null); + bean.setMe(me); + // MOrg orderOrg = new MOrg(ctx, cashLine.getAD_Org_ID(), null); + + /* if (orderOrg.getLinkedC_BPartner_ID() != myOrg.getLinkedC_BPartner_ID()) + throw new DocumentDoesNotBelongToYouException("This payment does not belong to you. You do not have access to it."); + */ + + MBPartnerLocation meLocation[] = MBPartnerLocation.getForBPartner(ctx,me.get_ID()); + if (meLocation.length == 0) + throw new OperationException("No location has been set for your organisation. Please ask your administrator to set one for you"); + + MLocation location = new MLocation(ctx, meLocation[0].getC_Location_ID(), null); + + if (location == null) + throw new OperationException("You must have a location set for your business partner, Please ask your administrator to set one for you"); + + bean.setMeLocation(location); + + MBPartner you = new MBPartner(ctx, invoice.getC_BPartner_ID(), null); + + MBPartnerLocation youBPLocation[] = MBPartnerLocation.getForBPartner(ctx, you.get_ID()); + + if (youBPLocation.length ==0) + throw new OperationException("No location has been set for the dealer organisation. Please ask your administrator to set one for you"); + + MLocation youLocation = new MLocation(ctx, youBPLocation[0].getC_Location_ID(), null); + + bean.setYou(you); + bean.setYoubpLocation(youBPLocation[0]); + bean.setYouLocation(youLocation); + bean.setCashLine(cashLine); + + WebDocumentHeaderBean headerBean = PaymentManager.createWebDocumentHeader(ctx, invoice.getAD_Org_ID(),invoice.getC_BPartner_ID(), "Completed", true,"Cash"); + String tenderTypeName = "Cash"; + + + + headerBean.setPaymentType(tenderTypeName); + + bean.setHeaderBean(headerBean); + bean.setInvoice(invoice); + + return bean; + } + + /** + * Retrieves all the cash books having a name like the search criteria + * @param ctx Context + * @param searchText Search criteria based on the name of cash book + * @param trxName Transaction + * @return List of Cash book data model + * @throws OperationException If data could not retrieved + */ + public static ArrayList getCashBooks(Properties ctx, String searchText, String trxName) throws OperationException + { + String whereClause = "C_CashBook.Name LIKE (?)"; + + if (searchText == null) + { + searchText = ""; + } + + searchText = "%" + searchText.trim() + "%"; + + ArrayList paramsList = new ArrayList(); + paramsList.add(searchText); + + return getCashBooks(ctx, whereClause, null, paramsList, trxName); + } + + /** + * Retrieves all the active Cash books + * @param ctx Context + * @param trxName Transaction + * @return List of Cash book data model + * @throws OperationException If data could not be retrieved + */ + public static ArrayList getCashBooks(Properties ctx, String trxName) throws OperationException + { + return getCashBooks(ctx, "C_CashBook.IsActive='Y'", " ORDER BY C_CashBook.Name", null, trxName); + } + + /** + * Retrives all the cash book for a particular organisation + * @param ctx Context + * @param adOrgId Organisation Id + * @param trxName Transaction + * @return List of Cash book data model + * @throws OperationException If data could not retrieved + */ + public static ArrayList getAllCashbooks(Properties ctx, int adOrgId, String trxName) throws OperationException + { + String whereClause = "C_CashBook.IsActive='Y'AND C_CashBook.AD_Org_ID=?"; + + ArrayList paramsList = new ArrayList(); + paramsList.add(new Integer(adOrgId)); + return getCashBooks(ctx, whereClause, null, paramsList, trxName); + } + + /** + * Retrieves all the cash book that can be assigned on a terminal (i.e: Not already present on another terminal). + * @param ctx Context + * @param adOrgId Organisation + * @param trxName Transaction + * @return List of Cash book data model + * @throws OperationException If data could not be retrieved + */ + public static ArrayList getCashBooksForTerminal(Properties ctx, int adOrgId, int terminalId, String trxName) throws OperationException + { + StringBuffer whereClause = new StringBuffer(); + whereClause.append("C_CashBook.IsActive='Y'AND C_CashBook.AD_Org_ID=? "); + whereClause.append("AND NOT EXISTS (SELECT * FROM U_POSTerminal WHERE U_POSTerminal.U_POSTerminal_ID<>? "); + whereClause.append("AND U_POSTerminal.C_CashBook_ID=C_CashBook.C_CashBook_ID AND U_POSTerminal.IsActive='Y')"); + + ArrayList paramsList = new ArrayList(); + paramsList.add(new Integer(adOrgId)); + paramsList.add(new Integer(terminalId)); + + return getCashBooks(ctx, whereClause.toString(), " ORDER BY C_CashBook.Name", paramsList, trxName); + } + + /** + * Retrieves all the cash books based on the criteria defined in the where clause statement. + * @param ctx Context + * @param whereClause SQL Where clause + * @param orderByClause Order by clause + * @param params Parameters to set for the queries + * @param trxName Transaction + * @return List of Cash Book data model + * @throws OperationException If the data could not be retrieved + */ + private static ArrayList getCashBooks(Properties ctx, String whereClause, + String orderByClause, ArrayList params, String trxName) throws OperationException + { + ArrayList cashBookList = new ArrayList(); + PreparedStatement pstmt = null; + ResultSet rs = null; + + StringBuffer sqlStmt = new StringBuffer(); + sqlStmt.append("SELECT * FROM C_CashBook WHERE C_CashBook.AD_Client_ID=? "); + + if (whereClause != null && whereClause.trim().length() > 0) + { + sqlStmt.append(" AND "); + sqlStmt.append(whereClause); + } + sqlStmt.append(" AND C_CashBook.AD_Org_ID IN (") + .append(Env.getContext(ctx, UdiConstants.ROLE_EDITABLE_ORGS_CTX_PARAM)) + .append(") "); + + if (orderByClause == null || orderByClause.length() == 0) + { + orderByClause = "ORDER BY Name"; + } + sqlStmt.append(orderByClause); + + try + { + int paramIndex = 1; + pstmt = DB.prepareStatement(sqlStmt.toString(), trxName); + pstmt.setInt(paramIndex++, Env.getAD_Client_ID(ctx)); + + if (params != null) + { + for (int i = 0; i < params.size(); i++) + { + pstmt.setObject(paramIndex++, params.get(i)); + } + } + + rs = pstmt.executeQuery(); + + while (rs.next()) + { + MCashBook cashBook = new MCashBook(ctx, rs, trxName); + CashBookBean bean = new CashBookBean(); + bean.setCashBookId(cashBook.get_ID()); + bean.setCashBookName(cashBook.getName()); + bean.setDescription(cashBook.getDescription()); + bean.setOrgId(cashBook.getAD_Org_ID()); + bean.setIsActive(cashBook.isActive()); + bean.setIsDefault(cashBook.isDefault()); + bean.setCurrencyId(cashBook.getC_Currency_ID()); + bean.setCurrency(cashBook.getC_Currency().getISO_Code()); + cashBookList.add(bean); + } + } + catch (Exception ex) + { + log.log(Level.SEVERE, "Could not get cash books", ex); + throw new OperationException("Could not retrieve cash books", ex); + } + finally + { + DB.close(rs, pstmt); + } + + return cashBookList; + } + + /** + * Returns the Cash book data model from its PO + * @param cashBook Cash Book PO + * @return Cash Book data model + */ + public static CashBookBean getBean(MCashBook cashBook) + { + CashBookBean bean = new CashBookBean(); + bean.setOrgId(cashBook.getAD_Org_ID()); + bean.setCashBookId(cashBook.get_ID()); + bean.setCashBookName(cashBook.getName()); + bean.setCurrencyId(cashBook.getC_Currency_ID()); + bean.setDescription(cashBook.getDescription()); + bean.setIsActive(cashBook.isActive()); + bean.setIsDefault(cashBook.isDefault()); + + return bean; + } + + /** + * Returns the PO for the Cash Book from it's data model + * @param ctx Context + * @param bean Cash Book data model + * @param trxName Transaction + * @return Cash Book PO + * @throws OperationException If the Cash Book PO could not be loaded + */ + public static MCashBook getPO(Properties ctx, CashBookBean bean, String trxName) throws OperationException + { + MCashBook cashBook = new MCashBook(ctx, bean.getCashBookId(), trxName); + if (cashBook.get_ID() != bean.getCashBookId()) + { + // Happens only when trying to load a cash book that is not present + // and the PO model resets the Id to 0 + throw new OperationException("Could not load cash book"); + } + cashBook.setAD_Org_ID(bean.getOrgId()); + cashBook.setC_Currency_ID(bean.getCurrencyId()); + cashBook.setDescription(bean.getDescription()); + cashBook.setName(bean.getCashBookName()); + cashBook.setIsActive(bean.getIsActive()); + cashBook.setIsDefault(bean.getIsDefault()); + + return cashBook; + } + + /** + * Returns the data model of the Cash Book PO + * @param ctx Context + * @param cashBookId Cash Book ID + * @param trxName Transaction + * @return Cash Book data model + * @throws OperationException If Cash book PO could not be loaded + */ + public static CashBookBean getCashBook(Properties ctx, int cashBookId, String trxName) throws OperationException + { + MCashBook cashBook = new MCashBook(ctx, cashBookId, trxName); + if (cashBook.get_ID() <= 0) + { + throw new OperationException("Could not load Cash Book with id: " + cashBookId); + } + + return getBean(cashBook); + } + + /** + * Creates or updates a Cash Book. For creation the cash book id in the data model should be 0 + * otherwise it will try to load a cash book with the id provided + * @param ctx Context + * @param bean Data Model of the cash book + * @param trxName Transaction + * @return Cash Book PO + * @throws OperationException If the Cash Book PO could not be loaded or updated + */ + public static MCashBook createUpdateCashBook(Properties ctx, CashBookBean bean, String trxName) throws OperationException + { + MCashBook cashBook = getPO(ctx, bean, trxName); + if (!cashBook.isActive() && POSTerminalManager.isCashbookPresentOnTerminal(ctx, cashBook.get_ID(), trxName)) + { + throw new CashBookAlreadyAssignedException("Cannot deactivate the cash book as it has been assigned to a terminal"); + } + PoManager.save(cashBook); + bean.setCashBookId(cashBook.get_ID()); + return cashBook; + } + + + /** + * Updates the active status of a cash book + * @param ctx Context + * @param cashBookId Cash book ID + * @param active Whether to set the cash book active or not + * @param trxName Transaction + * @throws OperationException If Cash Book could not be loaded or updated + */ + public static void updateCashBookStatus(Properties ctx, int cashBookId, boolean active, String trxName) throws OperationException + { + MCashBook cashBook = loadCashBook(ctx, cashBookId, trxName); + + if (!active && POSTerminalManager.isCashbookPresentOnTerminal(ctx, cashBookId, trxName)) + { + throw new CashBookAlreadyAssignedException("Cannot deactivate the cash book as it has been assigned to a terminal"); + } + + cashBook.setIsActive(active); + PoManager.save(cashBook); + } +} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/CashTransferManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/CashTransferManager.java new file mode 100644 index 0000000000..ec6c4c9d5e --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/businesslogic/CashTransferManager.java @@ -0,0 +1,171 @@ +/****************************************************************************** + * Product: Posterita Web-Based POS and Adempiere Plugin * + * Copyright (C) 2008 Posterita Ltd * + * This file is part of POSterita * + * * + * POSterita is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * + *****************************************************************************/ +package org.posterita.businesslogic; + +import java.math.BigDecimal; +import java.sql.Timestamp; +import java.util.Properties; + +import org.compiere.model.MBankAccount; +import org.compiere.model.MCash; +import org.compiere.model.MCashBook; +import org.compiere.model.MCashLine; +import org.compiere.process.DocumentEngine; +import org.posterita.exceptions.OperationException; +import org.posterita.util.PoManager; + +/** + * @author Ashley G Ramdass + * May 26, 2008 + */ +public class CashTransferManager +{ + /** + * Transfers money from a Bank Account to another one. + * + * @param ctx Context + * @param fromBankAccountId From Bank Account + * @param toBankAccountId To Bank Account + * @param currencyId Currency + * @param amount Amount to Transfer + * @param dateAcct Accounting Date + * @param trxName Transaction + * @throws OperationException if documents can't be created or processed + */ + public static void transferBankToBank(Properties ctx, int fromBankAccountId, int toBankAccountId, + int currencyId, BigDecimal amount, Timestamp dateAcct, String trxName) throws OperationException + { + MBankAccount fromBankAccount = new MBankAccount(ctx, fromBankAccountId, trxName); + MBankAccount toBankAccount = new MBankAccount(ctx, toBankAccountId, trxName); + + int fromCashBookId = OrganisationManager.getCreateTransferCashBook(ctx, fromBankAccount.getAD_Org_ID(), currencyId, trxName); + int toCashBookId = OrganisationManager.getCreateTransferCashBook(ctx, toBankAccount.getAD_Org_ID(), currencyId, trxName); + + MCash fromCashJournal = MCash.get(ctx, fromCashBookId, dateAcct, trxName); + if (fromCashJournal == null) + { + throw new OperationException("Could not create Cash Journal entry"); + } + + MCash toCashJournal = MCash.get(ctx, toCashBookId, dateAcct, trxName); + if (toCashJournal == null) + { + throw new OperationException("Could not create Cash Journal entry"); + } + + String description = fromBankAccount.getAccountNo() + " (BA) -> " + toBankAccount.getAccountNo() + " (BA)"; + + // Transfer from the bank account to the cash journal + MCashLine fromCashLine = new MCashLine(fromCashJournal); + fromCashLine.setC_Currency_ID(currencyId); + fromCashLine.setDescription(description); + fromCashLine.setCashType(MCashLine.CASHTYPE_BankAccountTransfer); + fromCashLine.setC_BankAccount_ID(fromBankAccountId); + fromCashLine.setAmount(amount); + fromCashLine.setIsGenerated(true); + PoManager.save(fromCashLine); + + // Transfer from the cash journal to the bank account + MCashLine toCashLine = new MCashLine(toCashJournal); + toCashLine.setC_Currency_ID(currencyId); + toCashLine.setDescription(description); + toCashLine.setCashType(MCashLine.CASHTYPE_BankAccountTransfer); + toCashLine.setC_BankAccount_ID(toBankAccountId); + toCashLine.setAmount(amount.negate()); + toCashLine.setIsGenerated(true); + PoManager.save(toCashLine); + + PoManager.processIt(fromCashJournal, DocumentEngine.ACTION_Complete); + + if (fromCashJournal.get_ID() != toCashJournal.get_ID()) + { + PoManager.processIt(toCashJournal, DocumentEngine.ACTION_Complete); + } + } + + /** + * Transfer money from a Cash Book to another + * @param ctx Context + * @param fromCashBookId From Cash Book + * @param toCashBookId To Cash Book + * @param currencyId Currency + * @param amount Amount to transfer + * @param dateAcct Accounting Date + * @param trxName Transaction + * @throws OperationException If documents can't be created or processed + */ + public static void transferCashBookToCashBook(Properties ctx, int fromCashBookId, int toCashBookId, + int currencyId, BigDecimal amount, Timestamp dateAcct, String trxName) throws OperationException + { + MCash fromJournal = MCash.get(ctx, fromCashBookId, dateAcct, trxName); + transferFromJournalToCashBook(ctx, fromJournal, toCashBookId, currencyId, amount, dateAcct, trxName); + } + + /** + * Transfer money from a Cash Book to another + * @param ctx Context + * @param fromCashBookId From Cash Book + * @param toCashBookId To Cash Book + * @param currencyId Currency + * @param amount Amount to transfer + * @param dateAcct Accounting Date + * @param trxName Transaction + * @throws OperationException If documents can't be created or processed + */ + public static void transferFromJournalToCashBook(Properties ctx, MCash cashJournal, int toCashBookId, + int currencyId, BigDecimal amount, Timestamp dateAcct, String trxName) throws OperationException + { + MCashBook fromCashBook = new MCashBook(ctx, cashJournal.getC_CashBook_ID(), trxName); + MCashBook toCashBook = new MCashBook(ctx, toCashBookId, trxName); + + int fromBankAccountId = OrganisationManager.getCreateTransferBankAccount(ctx, fromCashBook.getAD_Org_ID(), currencyId, null); + int toBankAccountId = OrganisationManager.getCreateTransferBankAccount(ctx, toCashBook.getAD_Org_ID(), currencyId, null); + + MCash toCash = MCash.get(ctx, toCashBookId, dateAcct, trxName); + + String description = fromCashBook.getName() + " (CB) -> " + toCashBook.getName() + " (CB)"; + + // Transfers the money from the cash book to the dummy bank account + MCashLine fromCashLine = new MCashLine(cashJournal); + fromCashLine.setDescription(description); + fromCashLine.setC_Currency_ID(currencyId); + fromCashLine.setCashType(MCashLine.CASHTYPE_BankAccountTransfer); + fromCashLine.setC_BankAccount_ID(fromBankAccountId); + fromCashLine.setAmount(amount.negate()); + fromCashLine.setIsGenerated(true); + PoManager.save(fromCashLine); + + if (fromBankAccountId != toBankAccountId) + { + // Transfer the amount between the two bank accounts + transferBankToBank(ctx, fromBankAccountId, toBankAccountId, currencyId, amount, dateAcct, trxName); + } + + // Transfers the money from the dummy bank account the cash book + MCashLine toCashLine = new MCashLine(toCash); + toCashLine.setDescription(description); + toCashLine.setC_Currency_ID(currencyId); + toCashLine.setCashType(MCashLine.CASHTYPE_BankAccountTransfer); + toCashLine.setC_BankAccount_ID(toBankAccountId); + toCashLine.setAmount(amount); + toCashLine.setIsGenerated(true); + PoManager.save(toCashLine); + } +} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/ClientManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/ClientManager.java new file mode 100644 index 0000000000..5431f8aec1 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/businesslogic/ClientManager.java @@ -0,0 +1,333 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + **/ + +/** + @author ashley + */ + +package org.posterita.businesslogic; + +import java.io.File; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.Properties; + +import org.compiere.model.MBPartner; +import org.compiere.model.MClient; +import org.compiere.model.MCountry; +import org.compiere.model.MElement; +import org.compiere.model.MLocation; +import org.compiere.model.MOrg; +import org.compiere.model.MOrgInfo; +import org.compiere.model.MPeriodControl; +import org.compiere.model.MSetup; +import org.compiere.model.PO; +import org.compiere.print.PrintUtil; +import org.compiere.util.DB; +import org.compiere.util.Env; +import org.compiere.util.KeyNamePair; +import org.posterita.businesslogic.administration.BPartnerManager; +import org.posterita.core.businesslogic.ImportManager; +import org.posterita.exceptions.NoClientFoundException; +import org.posterita.exceptions.OperationException; +import org.posterita.lib.UdiConstants; +import org.posterita.util.PathInfo; +import org.posterita.util.PoManager; + +public class ClientManager +{ + public static final String ACCOUNTING_FILE_PATH = PathInfo.PROJECT_HOME + + "/config/accounting/AccountingUS.csv"; + public static final String ACCOUNTS_IMPORT_FORMAT = "Accounting - Accounts"; + + // public static String ACCOUNTS_IMPORT_TABLE = "I_ElementValue"; + + private static MClient createClient(Properties nCtx, String clientName, + String orgName, int currencyId, String currencyName, int countryId, + String city, File file) throws OperationException + { + Properties ctx = Env.getCtx(); + + Env.setContext(ctx, "#AD_User_ID", 100); // set user as SuperUser + Env.setContext(ctx, UdiConstants.CLIENT_ID_CTX_PARAM, "11"); // Garden + // World + + MCountry.get(ctx, countryId); + + MSetup setup = new MSetup(ctx, 0); + + // Step 1 + boolean ok = setup.createClient(clientName, orgName, clientName + + " Client User", clientName + " Org User"); + + if (ok) + { + // Generate Accounting + KeyNamePair currency = new KeyNamePair(currencyId, currencyName); + + if (!setup.createAccounting(currency, true, true, false, false, + false, file)) + { + throw new OperationException("Could not create accounting for client"); + } + + // Generate Entities + if (!setup.createEntities(countryId, city, 0, currency.getKey())) + { + throw new OperationException( + "Could not create setup entities"); + } + + // Create Print Documents + PrintUtil.setupPrintForm(setup.getAD_Client_ID()); + } + else + { + throw new OperationException("Could not create client"); + } + int clientId = setup.getAD_Client_ID(); + + MClient client = MClient.get(ctx, clientId); + + return client; + } + + protected static void updateAccountingProcessor(Properties ctx, + int adClientId, String trxName) throws OperationException + { + String updStmt = "Update C_AcctProcessor set FrequencyType='M' where AD_Client_ID=" + + adClientId; + + int updates = DB.executeUpdate(updStmt, trxName); + + if (updates == -1) + throw new OperationException( + "Accounting Processor could not be updated"); + } + + public static void createClientDependencies(Properties ctx, MClient client, + MOrg org, String address, int countryId, String city, + String postalAddress, String smtpHost, File file, String trxName) + throws OperationException { + // Set client smtp host for sending emails + client.setSMTPHost(smtpHost); + // client.setIsPostImmediate(true); + // client.setIsCostImmediate(true); + PoManager.save(client); + + // Create Organisation location + MLocation location = LocationManager.createLocation(ctx, org.get_ID(), address, "", postalAddress, city, 0, countryId, trxName); + + // Create Linked Business Partner + MBPartner bpartner = BPartnerManager.createLinkedBPartner(ctx, org.get_ID(), 0, org + .getName(), " ", false, false, false, false, address, + postalAddress, city, " ", countryId, trxName); + bpartner.setAD_OrgBP_ID(org.get_ID()); + PoManager.save(bpartner); + MOrgInfo orgInfo = org.getInfo(); + orgInfo.set_TrxName(trxName); + orgInfo.setC_Location_ID(location.getC_Location_ID()); + PoManager.save(orgInfo); + + openPeriods(ctx, trxName); + + ImportManager.importFile(ctx, file, ACCOUNTS_IMPORT_FORMAT, trxName); + ImportManager.importAccounting(ctx, Env.getAD_Client_ID(ctx), + getAccoutingElementId(ctx), false, true, true, trxName); + updateAccountingProcessor(ctx, Env.getAD_Client_ID(ctx), trxName); + } + + public static MClient getCreateClient(Properties ctx, String clientName, + String orgName, int currencyId, String currencyName, int countryId, + String city, String address, String postalAddress, String smtpHost, File file) + throws OperationException + { + MClient client; + Properties rctx = (Properties) ctx.clone(); + + if (isClientPresent(clientName)) + { + int clientId = getClientId(clientName); + client = new MClient(ctx, clientId, null); + } + else + { + client = createClient(rctx, clientName, orgName, currencyId, + currencyName, countryId, city, file); + Env.setContext(rctx, UdiConstants.CLIENT_ID_CTX_PARAM, client.get_ID()); + MOrg org = OrganisationManager.getOrgByName(rctx, orgName, null); + createClientDependencies(rctx, client, org, address, countryId, + city, postalAddress, smtpHost, file, null); + } + + return client; + } + + public static Properties getCtx(Properties ctx, String clientName, + String orgName) throws OperationException + { + int clientId = ClientManager.getClientId(clientName); + + // Set AD_Client_ID in the context + Env.setContext(ctx, UdiConstants.CLIENT_ID_CTX_PARAM, clientId); + + MOrg org = OrganisationManager.getOrgByName(ctx, orgName, null); + int orgId = org.get_ID(); + Env.setContext(ctx, UdiConstants.ORG_ID_CTX_PARAM, orgId); + Env.setContext(ctx, UdiConstants.ROLE_EDITABLE_ORGS_CTX_PARAM, orgId); + + return ctx; + } + + public static Properties getCtx(Properties ctx, int clientId, int orgId) { + Env.setContext(ctx, UdiConstants.CLIENT_ID_CTX_PARAM, clientId); + Env.setContext(ctx, UdiConstants.ORG_ID_CTX_PARAM, orgId); + Env.setContext(ctx, UdiConstants.USER_ID_CTX_PARAM, 100); + + return ctx; + } + + public static void openPeriods(Properties ctx, String trxName) + throws OperationException + { + int idPCs[] = PO.getAllIDs(MPeriodControl.Table_Name, " AD_CLIENT_ID =" + + Env.getAD_Client_ID(ctx), trxName); + + for (int i = 0; i < idPCs.length; i++) + { + MPeriodControl period = new MPeriodControl(ctx, idPCs[i], trxName); + period.setPeriodStatus(MPeriodControl.PERIODSTATUS_Open); + PoManager.save(period); + + } + } + + public static MClient loadClient(Properties ctx, int clientId, + String trxName) throws OperationException + { + MClient client = new MClient(ctx, clientId, trxName); + if (client.get_ID() == 0) + { + throw new OperationException("Could not load client with id: " + + + clientId); + } + return client; + } + + public static int getAccoutingElementId(Properties ctx) + throws OperationException { + int adClientId = Env.getAD_Client_ID(ctx); + + String whereClause = "AD_Client_ID=" + adClientId; + + int elementIds[] = MElement.getAllIDs(MElement.Table_Name, whereClause, + null); + + if (elementIds.length == 0) + throw new OperationException( + "No accounting element found for client with id: " + + adClientId); + else if (elementIds.length > 1) + throw new OperationException(elementIds.length + + " account elements found for client with id: " + + adClientId); + else + return elementIds[0]; + } + + public static void changeClientName(Properties ctx, String clientName, + String trxName) throws OperationException { + if (clientName == null || clientName.trim().length() == 0) + throw new OperationException("Client Name cannot be null"); + + int adClientId = Env.getAD_Client_ID(ctx); + + MClient client = loadClient(ctx, adClientId, trxName); + + if (!client.getName().equals(clientName)) { + client.setName(clientName); + + PoManager.save(client); + } + } + + public static void cleanData(Properties ctx, boolean deleteAll) + throws OperationException { + throw new RuntimeException("This operation is no more supported"); + } + + public static int getClientId(String clientName) throws OperationException { + String sql = "select ad_client_id from ad_client where upper(name)=upper('" + + clientName + "')"; + + PreparedStatement pstmt = DB.prepareStatement(sql, null); + ResultSet rs = null; + + int clientID = 0; + try { + rs = pstmt.executeQuery(); + while (rs.next()) { + clientID = rs.getInt(1); + } + + rs.close(); + } catch (SQLException e) { + throw new OperationException(e); + } finally { + try { + pstmt.close(); + } catch (Exception ex) { + } + + pstmt = null; + } + + if (clientID == 0) + throw new NoClientFoundException("no client found for clientName " + + clientName); + + return clientID; + } + + public static boolean isClientPresent(String clientName) + throws OperationException { + try { + getClientId(clientName); + } catch (NoClientFoundException e) { + return false; + } + + return true; + } + + /* + * Retrieve all clients in the system for which POS/Webstore transactions + * are valid + */ + public static int[] getAvailableClientIds() { + int clientIds[] = MClient.getAllIDs(MClient.Table_Name, + "IsActive='Y' and AD_Client_ID not in (0)", null); + + return clientIds; + } + +} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/CurrencyManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/CurrencyManager.java new file mode 100644 index 0000000000..80e6d828e7 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/businesslogic/CurrencyManager.java @@ -0,0 +1,112 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + **/ +package org.posterita.businesslogic; + +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.Properties; + +import org.compiere.model.MCurrency; +import org.compiere.model.MPriceList; +import org.compiere.util.DB; +import org.compiere.util.Env; +import org.compiere.util.KeyNamePair; +import org.posterita.Constants; +import org.posterita.exceptions.OperationException; + +public class CurrencyManager +{ + + /** + * Retrieves the currency symbol for the currency ID specified + * @param currencyId Currency ID + * @return Currency Symbol + */ + public static String getCurrencySymbol(int currencyId) throws OperationException + { + MCurrency cur = new MCurrency(new Properties(), currencyId, null); + + if (cur.get_ID() == 0) + return ""; //Do not throw error here + + return cur.getCurSymbol(); + } + + public static int getCurrencyPrecision(Properties ctx) throws OperationException + { + int pricelistId = Env.getContextAsInt(ctx, Constants.PRICE_LIST); + MPriceList priceList = MPriceList.get(ctx, pricelistId, null); + + if (priceList == null) + { + throw new OperationException("Price list cannot be null!"); + } + + MCurrency mCurrency = new MCurrency(ctx, priceList.getC_Currency_ID(), null); + + return mCurrency.getCostingPrecision(); + } + + public static MCurrency getCurrency(Properties ctx) throws OperationException + { + int pricelistId = POSTerminalManager.getSOPriceListId(ctx); + MPriceList priceList = MPriceList.get(ctx, pricelistId, null); + + if (priceList == null) + { + throw new OperationException("No price list set for POS Terminal"); + } + + MCurrency mCurrency = MCurrency.get(ctx, priceList.getC_Currency_ID()); + + return mCurrency; + } + + public static ArrayList getAllCurrencies() throws OperationException + { + ArrayList knPairList = new ArrayList(); + + String sql = "Select C_Currency_ID, Description from C_Currency order by description"; + + PreparedStatement pstmt = DB.prepareStatement(sql, null); + + try + { + ResultSet rs = pstmt.executeQuery(); + while(rs.next()) + { + int currencyId = rs.getInt(1); + String currencyDescription = rs.getString(2); + + knPairList.add(new KeyNamePair(currencyId, currencyDescription)); + } + } + catch(SQLException ex) + { + throw new OperationException("Could not get currencies with sql: " + sql, ex); + } + + return knPairList; + } + +} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/CustomerCart.java b/posterita/posterita/src/main/org/posterita/businesslogic/CustomerCart.java new file mode 100644 index 0000000000..bb3a1dc5c9 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/businesslogic/CustomerCart.java @@ -0,0 +1,161 @@ +/** + * Product: Posterita Web-Based POS (an Adempiere Plugin) + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +/** + @author Praveen Beekoo + */ +package org.posterita.businesslogic; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; +import java.util.Properties; +import java.util.Set; + +import org.posterita.beans.CustomerBean; +import org.posterita.businesslogic.administration.CustomerManager; +import org.posterita.exceptions.InvalidDateTimeException; +import org.posterita.exceptions.OperationException; + +public class CustomerCart +{ + + private HashMap customers = null; + private int noOfCustomers = 0; + private Properties ctx; + + + public CustomerCart(Properties ctx) + { + this.ctx = ctx; + customers = new HashMap(); + } + + public void addCustomer(int customer_id, int qty) + { + noOfCustomers++; + + Integer previousQty = customers.get(Integer.valueOf(customer_id)); + + if(previousQty == null) + { + customers.put(Integer.valueOf(customer_id),Integer.valueOf(qty)); + } + else + { + int newQty = previousQty.intValue() + qty; + customers.put(Integer.valueOf(customer_id),Integer.valueOf(newQty)); + } + } + + public void addCustomer(int customer_id) + { + addCustomer(customer_id, 1); + } + + public void removeCustomer(int customer_id, int qty) + { + Integer oldQty = customers.get(Integer.valueOf(customer_id)); + + if( oldQty == null ) + { + return; + } + else + { + if( oldQty.intValue() <= qty ) + { + removeCustomer( customer_id ); + noOfCustomers = noOfCustomers - oldQty.intValue(); + } + else + { + int newQty = oldQty.intValue() - qty; + customers.put(Integer.valueOf(customer_id),Integer.valueOf(newQty)); + noOfCustomers = noOfCustomers - qty; + } + } + } + + public void removeCustomer(int customer_id) + { + Integer qty = customers.remove(Integer.valueOf(customer_id)); + + if( qty == null ) + { + return; + } + + noOfCustomers = noOfCustomers - qty.intValue(); + } + + public void clear() + { + customers.clear(); + noOfCustomers = 0; + } + + public int getNoOfCustomers() + { + return noOfCustomers; + } + + public ArrayList getCustomers() throws Exception + { + ArrayList customerList = new ArrayList(); + CustomerBean bean = null; + Integer customerId = null; + + Set> entrySet = customers.entrySet(); + + for (Map.Entry entry : entrySet) + { + customerId = entry.getKey(); + + bean = CustomerManager.getCustomerDetails(ctx, customerId); + + customerList.add(bean); + } + + return customerList; + } + + public Integer[] getCustomerIDs() + { + Set set = customers.keySet(); + + if( set.isEmpty() ) + { + return new Integer[]{}; + } + + Integer[] ids = new Integer[]{}; + ids = set.toArray( ids ); + + return ids; + } + + public boolean hasCustomer( int customer_id ) + { + return customers.containsKey( Integer.valueOf(customer_id) ); + } + + +} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/EditBulkProductFromFileManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/EditBulkProductFromFileManager.java new file mode 100644 index 0000000000..72eb26fb45 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/businesslogic/EditBulkProductFromFileManager.java @@ -0,0 +1,336 @@ +/** + * Product: Posterita Web-Based POS (an Adempiere Plugin) + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +/** + @author Alok Pathak + */ + +package org.posterita.businesslogic; + +import java.io.BufferedInputStream; +import java.io.BufferedReader; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.Properties; +import java.util.StringTokenizer; + +import org.apache.struts.upload.FormFile; +import org.posterita.beans.ItemBean; +import org.posterita.beans.ProductBean; +import org.posterita.beans.ShoppingCartBean; +import org.posterita.businesslogic.performanceanalysis.CSVReportManager; +import org.posterita.businesslogic.stock.StockManager; +import org.posterita.exceptions.BarcodeAlreadyExistsException; +import org.posterita.exceptions.OperationException; +import org.posterita.exceptions.ProductAlreadyExistException; +import org.posterita.exceptions.ProductNotFoundException; +import org.posterita.exceptions.ProductNotOnPriceListException; + + +public class EditBulkProductFromFileManager +{ + /* @SuppressWarnings("unchecked") + public static ShoppingCartBean addToProductCart(Properties ctx,ProductBean bean, ShoppingCartBean cartBean) throws OperationException,ProductNotFoundException,ProductNotOnPriceListException + { + ArrayList oldItems; + if (cartBean == null) + { + cartBean = new ShoppingCartBean(); + oldItems = new ArrayList(); + } + else + { + oldItems = cartBean.getItems(); + } + + ArrayList oldItemsClone = (ArrayList) oldItems.clone(); + ArrayList itemsToBeAdded = getProducts(bean); + oldItems = addToItemList(oldItemsClone, itemsToBeAdded); + + cartBean.setItems(oldItems); + return cartBean; + } + + private static ArrayList getProducts(ProductBean bean) + { + ArrayList list = new ArrayList(); + + Integer [] productIds = bean.getProductIds(); + ItemBean itemBean=null; + for(int i=0;i addToItemList(ArrayList items, ArrayList itemsToBeAdded) throws ProductNotOnPriceListException, OperationException + { + Iterator iter = itemsToBeAdded.iterator(); + ItemBean itemBean; + + ItemBean foundItemBean; + while (iter.hasNext()) + { + itemBean = (ItemBean) iter.next(); + + foundItemBean = StockManager.findItem(itemBean, items); + + if (foundItemBean == null) + items.add(itemBean); + + } + + return items; + } + + public static String createCSVFile(Properties ctx, Integer[] productIds) throws OperationException + { + + ArrayList fileData = new ArrayList(); + + Object[] headers = new Object[]{ + "Product ID", + "Name", + "Barcode", + "Purchase Price", + "Marked Price", + "Discounted Price"}; + + fileData.add(headers); + + Object[] productInfo = null; + + if( productIds != null ) + { + for( int i = 0; i< productIds.length; i++) + { + int productId = productIds[i]; + + ProductBean bean= POSProductManager.viewPOSProduct(ctx,productId, null); + + productInfo = new Object[6]; + + productInfo[0] = productId; + productInfo[1]=bean.getProductName(); + + + if( bean.getBarCode() == null ) + { + productInfo[2]=""; + } + else + { + productInfo[2]=bean.getBarCode(); + } + productInfo[3]=bean.getPurchasePriceStandard(); + productInfo[4]=bean.getSalesPriceList(); + productInfo[5]=bean.getSalesPriceStandard(); + + fileData.add(productInfo); + } + } + + + return CSVReportManager.generateCSVReport(ctx, fileData); + + } + + public static String createCSVFile(Properties ctx,ArrayList cartBeanItems) throws OperationException + { + + Iterator iter = cartBeanItems.iterator(); + ItemBean itemBean=null; + + ArrayList fileData = new ArrayList(); + + Object[] headers = new Object[]{ + "Product ID", + "Name", + "Barcode", + "Purchase Price", + "Marked Price", + "Discounted Price"}; + + fileData.add(headers); + + Object[] productInfo = null; + + while(iter.hasNext()) + { + productInfo = new Object[headers.length]; + + itemBean =(ItemBean)iter.next(); + + //TODO + int productId=itemBean.getProductId(); + + ProductBean bean= POSProductManager.viewPOSProduct(ctx,productId, null); + + productInfo[0] = productId; + productInfo[1]=bean.getProductName(); + productInfo[2]=bean.getBarCode(); + productInfo[3]=bean.getPurchasePriceStandard(); + productInfo[4]=bean.getSalesPriceList(); + productInfo[5]=bean.getSalesPriceStandard(); + fileData.add(productInfo); + } + + return CSVReportManager.generateCSVReport(ctx, fileData); + + } + + public static ArrayList updateAllProducts(Properties ctx, FormFile formFile,String trxName) throws NumberFormatException, ProductAlreadyExistException,BarcodeAlreadyExistsException, OperationException + { + ArrayList list=new ArrayList(); + + InputStream is = null; + BufferedInputStream bis = null; + BufferedReader reader = null; + + try + { + is = formFile.getInputStream(); + + bis = new BufferedInputStream(is); + + reader = new BufferedReader(new InputStreamReader(bis)); + + String s = null; + ProductBean bean=null; + String productId; + String name=null; + String purchasePrice=null; + String salePriceList=null; + String salePriceStd=null; + String barCode=null; + reader.readLine(); + + while((s=reader.readLine()) != null && s.trim().length()>0) + { + StringTokenizer st = new StringTokenizer(s,","); + + bean=new ProductBean(); + + productId=st.nextToken(); + productId=productId.replaceAll("\"",""); + name=st.nextToken(); + name=name.replaceAll("\"",""); + barCode=st.nextToken(); + barCode=barCode.replaceAll("\"",""); + purchasePrice=st.nextToken(); + purchasePrice=purchasePrice.replaceAll("\"",""); + salePriceList=st.nextToken(); + salePriceList=salePriceList.replaceAll("\"",""); + salePriceStd=st.nextToken(); + salePriceStd=salePriceStd.replaceAll("\"",""); + + bean.setProductId(Integer.valueOf(productId)); + bean.setBarCode(barCode); + bean.setProductName(name); + bean.setDescription(name); + bean.setPurchasePriceStandard(purchasePrice); + bean.setSalesPriceList(salePriceList); + bean.setSalesPriceStandard(salePriceStd); + bean.setIsActive(true); + bean.setSalesPriceLimit(salePriceStd); + POSProductManager.editProduct(ctx,bean,null,trxName); + } + } + catch (FileNotFoundException e) + { + throw new OperationException(e); + } + catch (IOException e) + { + throw new OperationException(e); + } + + finally + { + if (is != null) + { + try + { + is.close(); + } + catch(Exception ex) + {} + } + + if (bis != null) + { + try + { + bis.close(); + } + catch(Exception ex) + {} + } + + if (reader != null) + { + try + { + reader.close(); + } + catch(Exception ex) + {} + } + } + + return list; + } + + public static ProductCart addToCart( Properties ctx, ProductCart cart, int productId) + { + if ( ! cart.hasProduct (productId ) ) + { + cart.addProduct( productId ); + } + + return cart; + } + + public static ArrayList getProductList(Properties ctx, Integer[] productIds) throws OperationException + { + ArrayList productList = new ArrayList(); + + if( productIds != null ) + { + for( int i = 0; i< productIds.length; i++) + { + int productId = productIds[i]; + ProductBean bean= POSProductManager.viewPOSProduct(ctx,productId, null); + productList.add( bean ); + + } + } + + return productList; + }*/ +} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/FileAttachmentManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/FileAttachmentManager.java new file mode 100644 index 0000000000..972fcafe29 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/businesslogic/FileAttachmentManager.java @@ -0,0 +1,30 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Mar 13, 2006 by praveen + * + */ +package org.posterita.businesslogic; + +import org.posterita.businesslogic.core.AttachmentManager; + + +public class FileAttachmentManager extends AttachmentManager +{ + +} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/GenericStockManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/GenericStockManager.java new file mode 100644 index 0000000000..f34605faf7 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/businesslogic/GenericStockManager.java @@ -0,0 +1,280 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Nov 6, 2005 by alok + **/ +package org.posterita.businesslogic; + +import java.math.BigDecimal; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.Properties; +import java.util.StringTokenizer; + +import org.compiere.model.MProduct; +import org.compiere.util.DB; +import org.compiere.util.Env; + +import org.posterita.beans.AvailableProductSizeBean; +import org.posterita.beans.GenericProductBean; +import org.posterita.beans.ItemBean; +import org.posterita.beans.ProductImageInfo; +import org.posterita.businesslogic.administration.ProductManager; +import org.posterita.exceptions.OperationException; + + +public class GenericStockManager +{ + public static final String DELIMITER = "_"; + + public static ArrayList getProducts(Properties ctx, int productCategoryId) throws OperationException + { + + ArrayList products = getProductsInStock(ctx, productCategoryId); + products = setImageInfo(ctx, products); + + return products; + } + + public static ArrayList getProductsInStock(Properties ctx, int productCategoryId) throws OperationException + { + String sql = "select p.name," + + " sum(s.qtyonhand)," + + " p.m_product_id," + + " p.description" + + " from m_product p, m_storage s" + + " where p.m_product_id = s.m_product_id" + + " and p.ad_client_id = " + Env.getAD_Client_ID(ctx) + + " and p.m_product_category_id = " + productCategoryId + + " and s.qtyonhand > 0" + + " group by p.name, p.m_product_id, description" + + " order by p.name"; + + PreparedStatement pstmt = null; + + ArrayList stock = new ArrayList(); + + ResultSet rs = null; + try + { + pstmt = DB.prepareStatement(sql, null); + rs = pstmt.executeQuery(); + + GenericProductBean stockBean; + while(rs.next()) + { + stockBean = new GenericProductBean(); + stockBean.setName(rs.getString(1)); + stockBean.setQtyOnHand(Integer.valueOf(rs.getInt(2))); + stockBean.setProductId(Integer.valueOf(rs.getInt(3))); + stockBean.setDescription(rs.getString(4)); + + stock.add(stockBean); + } + + rs.close(); + } + catch(SQLException e) + { + throw new OperationException(e); + } + finally + { + try + { + pstmt.close(); + } + catch (Exception ex) + { + throw new OperationException(ex); + } + pstmt = null; + } + return stock; + } + + public static ArrayList setImageInfo(Properties ctx, ArrayList products) + { + Iterator iter = products.iterator(); + + ProductImageInfo info; + GenericProductBean bean; + while (iter.hasNext()) + { + bean = (GenericProductBean) iter.next(); + info = ProductManager.getProductImageInfo(ctx, bean.getProductId()); + bean.setImageInfo(info); + } + + return products; + } + + public static String getSize(String productName) + { + StringTokenizer tokenizer = new StringTokenizer(productName, DELIMITER); + + String size = tokenizer.nextToken(); + + + return size; + } + + public static AvailableProductSizeBean setSize(String size, AvailableProductSizeBean bean) + { + //TODO create a new sizeType which contains Small, Medium, Large and XLarge + if (size.equalsIgnoreCase("Small")) + bean.setExistsInSmall(Boolean.valueOf(true)); + + if (size.equalsIgnoreCase("Medium")) + bean.setExistsInMedium(Boolean.valueOf(true)); + + if (size.equalsIgnoreCase("Large")) + bean.setExistsInLarge(Boolean.valueOf(true)); + + if (size.equalsIgnoreCase("XLarge")) + bean.setExistsInXLarge(Boolean.valueOf(true)); + + return bean; + } + + public static String getLikeProductQueryString(Properties ctx, String productName) + { + StringTokenizer tokenizer = new StringTokenizer(productName, DELIMITER); + String colour = tokenizer.nextToken(); + String model = tokenizer.nextToken(); + + String likeProductQueryString = "'%" + colour + "%" + model + "'"; + + return likeProductQueryString; + } + + public static AvailableProductSizeBean getAvailableSizesForProduct(Properties ctx, int productId) throws OperationException + { + ArrayList sizes = getAvailableSizes(ctx, productId); + Iterator iter = sizes.iterator(); + AvailableProductSizeBean sizeBean = new AvailableProductSizeBean(); + String size; + + while (iter.hasNext()) + { + GenericProductBean bean = (GenericProductBean) iter.next(); + size = getSize(bean.getName()); + setSize(size, sizeBean); + } + + return sizeBean; + } + + public static ArrayList getAvailableSizes(Properties ctx, int productId) throws OperationException + { + MProduct product = new MProduct(ctx, productId, null); + + String productName = product.getName(); + + String likeQuery = getLikeProductQueryString(ctx, productName); + + String sql = "select p.name," + + " sum(s.qtyonhand)," + + " p.m_product_id," + + " p.description" + + " from m_product p, m_storage s" + + " where p.m_product_id = s.m_product_id" + + " and p.ad_client_id = " + Env.getAD_Client_ID(ctx) + + " and p.name like " + likeQuery + + " and s.qtyonhand > 0" + + " group by p.name, p.m_product_id, description" + + " order by p.name"; + + PreparedStatement pstmt = DB.prepareStatement(sql, null); + ArrayList sizes = new ArrayList(); + ResultSet rs = null; + + try + { + rs = pstmt.executeQuery(); + + GenericProductBean bean; + String name; + + while (rs.next()) + { + bean = new GenericProductBean(); + name = rs.getString(1); + bean.setName(name); + sizes.add(bean); + } + + rs.close(); + } + catch (SQLException e) + { + throw new OperationException(e); + } + finally + { + try + { + pstmt.close(); + } + catch(Exception e) + {} + + pstmt = null; + } + + return sizes; + } + + + + public static int getProduct(String name, String productSize) throws OperationException + { + StringTokenizer tokenizer = new StringTokenizer(name, DELIMITER); + String colour = tokenizer.nextToken(); + String size = tokenizer.nextToken(); + String model = tokenizer.nextToken(); + + size = productSize; + String productName = colour + DELIMITER + size + DELIMITER + model; + + int productIds[] = MProduct.getAllIDs(MProduct.Table_Name, "ad_client_id=1001806" + " and name='" + + productName + "'", null); + + if (productIds.length == 0) + throw new OperationException("Product not found!"); + + if (productIds.length > 1) + throw new OperationException("More than 1 product found for " + productName); + + return productIds[0]; + } + + public static ItemBean setBean(Integer productId, BigDecimal qty) + { + ItemBean itemBean = new ItemBean(); + itemBean.setProductId(productId); + itemBean.setQty(qty); + + return itemBean; + } + + +} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/HistoryFilterBean.java b/posterita/posterita/src/main/org/posterita/businesslogic/HistoryFilterBean.java new file mode 100644 index 0000000000..bf91648e25 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/businesslogic/HistoryFilterBean.java @@ -0,0 +1,76 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Aug 15, 2005 by praveen + * + */ +package org.posterita.businesslogic; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.TreeSet; + +import org.posterita.beans.FilterBean; +import org.posterita.beans.UDIPair; + +public class HistoryFilterBean +{ + private TreeSet bPartnerList = new TreeSet(); + private TreeSet docStatusList = new TreeSet(); + + public HistoryFilterBean(ArrayList beans) + { + + if(beans!=null) + { + Iterator iter = beans.iterator(); + + while(iter.hasNext()) + { + FilterBean bean = (FilterBean) iter.next(); + + if(bean.getPartnerId()!=null) + { + UDIPair pair = new UDIPair(bean.getPartnerId(),bean.getPartnerName()); + bPartnerList.add(pair); + } + + if(bean.getDocStatus()!= null) + { + UDIPair docStatusPair = new UDIPair(bean.getDocStatusCode(), bean.getDocStatus()); + docStatusList.add(docStatusPair); + } + } + } + + } + + + public TreeSet getBPartnerList() + { + return bPartnerList; + } + + public TreeSet getDocStatusList() + { + return docStatusList; + } + + + +} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/ImportPosProductManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/ImportPosProductManager.java new file mode 100644 index 0000000000..922a8a3a7f --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/businesslogic/ImportPosProductManager.java @@ -0,0 +1,338 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on May 16, 2006 by alok + */ + + +package org.posterita.businesslogic; + +import java.io.BufferedInputStream; +import java.io.BufferedReader; +import java.io.FileNotFoundException; +import java.io.FileWriter; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.math.BigDecimal; +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.NoSuchElementException; +import java.util.Properties; +import java.util.StringTokenizer; + +import org.apache.struts.upload.FormFile; +import org.compiere.model.MStorage; +import org.compiere.model.MTax; +import org.compiere.model.MTransaction; +import org.compiere.model.MUOM; +import org.compiere.model.MWarehouse; +import org.compiere.util.Env; +import org.compiere.util.Trx; +import org.posterita.beans.ProductBean; +import org.posterita.businesslogic.administration.PriceListManager; +import org.posterita.businesslogic.administration.ProductManager; +import org.posterita.businesslogic.performanceanalysis.ReportManager; +import org.posterita.businesslogic.stock.StockManager; +import org.posterita.core.RandomStringGenerator; +import org.posterita.core.TrxPrefix; +import org.posterita.exceptions.BarcodeAlreadyExistsException; +import org.posterita.exceptions.DuplicateUOMException; +import org.posterita.exceptions.ImportProductException; +import org.posterita.exceptions.OperationException; +import org.posterita.exceptions.ProductAlreadyExistException; +import org.posterita.exceptions.ProductNotImportedException; +import org.posterita.exceptions.TaxRateNotDefineException; +import org.posterita.exceptions.UOMNotFoundException; +import org.posterita.exceptions.UOMValuePrecisionNotValidException; +import org.posterita.formatter.BigDecimalFormatter; +import org.posterita.util.PoManager; + + +public class ImportPosProductManager +{ + + public static ArrayList importSingleProducts(Properties ctx, FormFile formFile, int salesPriceListId, int purchasePriceListId, String trxName) throws NumberFormatException, ProductAlreadyExistException,BarcodeAlreadyExistsException, OperationException + { + ProductBean pbean = new ProductBean(); + ArrayList list=new ArrayList(); + InputStream is = null; + BufferedInputStream bis = null; + BufferedReader reader = null; + + int orgId = 0; //Import all products under org * so that it may be accessible to all orgs + StringBuffer csv = new StringBuffer(); + StringBuffer importProductEx = new StringBuffer(); + try + { + is = formFile.getInputStream(); + + bis = new BufferedInputStream(is); + + reader = new BufferedReader(new InputStreamReader(bis)); + + String s = null; + ProductBean bean=null; + String revenueRecognition=null; + String name=null; + String description= null; + String uom= null; + String purchasePrice=null; + String salePriceList=null; + String salePriceStd=null; + String salePriceLimit=null; + String barCode=null; + String taxRate=null; + String qty=null; + + Integer uomId = null; + Integer lineNumber = 1; //Skip Header in Import File + ArrayList uomErrorList = new ArrayList(); + BigDecimal qtyDB = new BigDecimal(0); + + boolean isProductImported = true; + String filename = ""; + String header = reader.readLine(); + + csv.append(header).append("\n"); + while((s=reader.readLine())!=null && s.trim().length()>0) + { + lineNumber++; + + StringTokenizer st = new StringTokenizer(s,","); + + bean=new ProductBean(); + Trx trx = Trx.get(TrxPrefix.getPrefix(),true); + try + { + trx.start(); + try + { + revenueRecognition=st.nextToken(); + revenueRecognition=revenueRecognition.replaceAll("\"",""); + barCode=st.nextToken(); + barCode=barCode.replaceAll("\"",""); + name=st.nextToken(); + name=name.replaceAll("\"",""); + description=st.nextToken(); + description=description.replaceAll("\"",""); + uom=st.nextToken(); + uom=uom.replaceAll("\"",""); + purchasePrice=st.nextToken(); + purchasePrice=purchasePrice.replaceAll("\"",""); + salePriceList=st.nextToken(); + salePriceList=salePriceList.replaceAll("\"",""); + salePriceStd=st.nextToken(); + salePriceStd=salePriceStd.replaceAll("\"",""); + salePriceLimit=st.nextToken(); + salePriceLimit=salePriceLimit.replaceAll("\"",""); + taxRate=st.nextToken(); + taxRate=taxRate.replaceAll("\"",""); + qty=st.nextToken(); + qty=qty.replaceAll("\"",""); + + } + catch (NoSuchElementException e) + { + // TODO: handle exception + throw new ImportProductException("An error occurred while passing the data in the file."); + } + + if ((uom != null) || (uom != "")) + { + int[] uomIds = MUOM.getAllIDs(MUOM.Table_Name, "UPPER(name)='" + uom.toUpperCase() + "'" + "AND isActive = 'Y' AND AD_CLient_ID IN (0," + Env.getAD_Client_ID(ctx) +")", trxName); + + if (uomIds.length == 0) + throw new UOMNotFoundException("UOM '" + uom + "' does not exist. "); + else + if (uomIds.length > 1) + throw new DuplicateUOMException("Duplicate UOM name found - " + uom + ". Please make sure that the name is unique as it is not case sensitive."); + + MUOM muom = MUOM.get(ctx, uomIds[0]); + + int uomPrecision = MUOM.getPrecision(ctx, muom.getC_UOM_ID()); + uomId = muom.get_ID(); + qtyDB = new BigDecimal(qty); + + int enteredPrecision = StockManager.getQtyPrecision(qtyDB); + + if (enteredPrecision > uomPrecision) + throw new UOMValuePrecisionNotValidException("The precision entered for the quantity field of the product: '"+ name + + "' should not be greater than '" + uomPrecision); + } + + String whereClause=" AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+" and RATE="+taxRate; + int taxId []= MTax.getAllIDs(MTax.Table_Name,whereClause,trxName); + if(taxId.length==0) + throw new TaxRateNotDefineException(", the tax rate in the file ="+taxRate+" does not exist
    "); + + MTax tax = new MTax(ctx,taxId[0],trxName); + + bean.setRevenueRecognition(revenueRecognition); + bean.setBarCode(barCode); + bean.setProductName(name); + bean.setIsActive(true); + bean.setDescription(description); + bean.setUomId(uomId); + bean.setPurchasePriceStandard(purchasePrice); + bean.setSalesPriceList(salePriceList); + bean.setSalesPriceStandard(salePriceStd); + bean.setSalesPriceLimit(salePriceLimit); + bean.setTaxCategoryId(tax.getC_TaxCategory_ID()); + bean.setOrgId(orgId); + + int productId = ProductManager.getSimilarProduct(ctx,name,trxName); + if (productId == 0) + { + pbean=POSProductManager.createSinglePOSProductForImport(ctx,bean,qtyDB,trxName); + productId = pbean.getProductId(); + } + else + { + pbean = POSProductManager.viewPOSProduct(ctx, productId, trxName); + } + BigDecimalFormatter formatter = new BigDecimalFormatter(); + BigDecimal salesPriceStd = (BigDecimal)formatter.unformat(salePriceStd); + BigDecimal salesPriceList = (BigDecimal)formatter.unformat(salePriceList); + BigDecimal salesPriceLimit = (BigDecimal)formatter.unformat(salePriceLimit); + + BigDecimal purchasePriceStd = (BigDecimal)formatter.unformat(purchasePrice); + PriceListManager.updatePriceLists(ctx, productId, salesPriceListId, salesPriceStd, + salesPriceList, salesPriceLimit, trx.getTrxName()); + PriceListManager.updatePriceLists(ctx, productId, purchasePriceListId, purchasePriceStd, + Env.ZERO, Env.ZERO, trx.getTrxName()); + trx.commit(); + } + catch (OperationException e) + { + trx.rollback(); + importProductEx = importProductEx.append("
    Product "+ name + " at line " + lineNumber + " not imported. ").append(e.getMessage()); + isProductImported = false; + csv.append(s).append("\"\n"); + } + finally + { + trx.close(); + } + list.add(pbean); + + } + if (!isProductImported) + { + filename = RandomStringGenerator.randomstring() + ".csv"; + String filepath = ReportManager.getReportPath(filename); + try + { + FileWriter writer = new FileWriter(filepath); + writer.write(csv.toString()); + writer.flush(); + writer.close(); + } + catch (IOException e1) + { + throw new OperationException(e1); + } + throw new ProductNotImportedException(filename+importProductEx.toString()); + } + } + catch (FileNotFoundException e) + { + e.printStackTrace(); + } + catch (IOException e) + { + e.printStackTrace(); + } + finally + { + if (is != null) + { + try + { + is.close(); + } + catch(Exception ex) + {} + } + + if (bis != null) + { + try + { + bis.close(); + } + catch(Exception ex) + {} + } + + if (reader != null) + { + try + { + reader.close(); + } + catch(Exception ex) + {} + } + } + return list; + } + + public static void importStockMStorage(Properties ctx,int m_product_id,BigDecimal qty,String trxName) throws OperationException + { + + int warehouseId=POSTerminalManager.getWarehouse(ctx).get_ID(); + + if (warehouseId==0) + throw new OperationException("no warehouse for this org"); + + MWarehouse warehouse = new MWarehouse(ctx,warehouseId,null); + int locatorId = warehouse.getDefaultLocator().get_ID(); + + MStorage st = MStorage.getCreate(ctx, locatorId, m_product_id, 0, trxName); + st.setQtyOnHand(st.getQtyOnHand().add(qty)); + st.setQtyReserved(new BigDecimal(0)); + st.setQtyOrdered(new BigDecimal(0)); + + PoManager.save(st); + + } + + public static void importStockMTransaction(Properties ctx,int m_product_id,BigDecimal qty, String trxName) throws OperationException + { + + int warehouseId=POSTerminalManager.getWarehouse(ctx).get_ID(); + + if (warehouseId==0) + throw new OperationException("no warehouse for this org"); + + MWarehouse warehouse = new MWarehouse(ctx,warehouseId,null); + + MTransaction trans = new MTransaction(ctx,0,trxName); + + trans.setM_Product_ID(m_product_id); + trans.setM_Locator_ID(warehouse.getDefaultLocator().get_ID()); + trans.setMovementQty(qty); + trans.setMovementType(MTransaction.MOVEMENTTYPE_InventoryIn); + trans.setMovementDate(new Timestamp(System.currentTimeMillis())); + + PoManager.save(trans); + + } + +} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/InvoiceManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/InvoiceManager.java new file mode 100644 index 0000000000..4f3c41681b --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/businesslogic/InvoiceManager.java @@ -0,0 +1,1124 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Created on 05-Jul-2005 by alok + * + */ +package org.posterita.businesslogic; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.Properties; + +import org.compiere.model.MBPartner; +import org.compiere.model.MBPartnerLocation; +import org.compiere.model.MCharge; +import org.compiere.model.MClient; +import org.compiere.model.MCurrency; +import org.compiere.model.MDocType; +import org.compiere.model.MInOut; +import org.compiere.model.MInvoice; +import org.compiere.model.MInvoiceLine; +import org.compiere.model.MLocation; +import org.compiere.model.MOrder; +import org.compiere.model.MOrderLine; +import org.compiere.model.MOrg; +import org.compiere.model.MPInstance; +import org.compiere.model.MPInstancePara; +import org.compiere.model.MProcess; +import org.compiere.model.MProduct; +import org.compiere.model.MTax; +import org.compiere.print.ReportEngine; +import org.compiere.process.DocumentEngine; +import org.compiere.process.InvoiceGenerate; +import org.compiere.process.ProcessInfo; +import org.compiere.process.ProcessInfoParameter; +import org.compiere.util.DB; +import org.compiere.util.Env; +import org.compiere.util.Trx; +import org.posterita.Constants; +import org.posterita.beans.AttributeValuesPair; +import org.posterita.beans.CommandBean; +import org.posterita.beans.InvoiceHistoryBean; +import org.posterita.beans.WebDocumentBean; +import org.posterita.beans.WebDocumentHeaderBean; +import org.posterita.beans.WebInvoiceLineBean; +import org.posterita.beans.WebOrderLineBean; +import org.posterita.businesslogic.administration.ProductManager; +import org.posterita.businesslogic.core.ChargeManager; +import org.posterita.core.UDIMap; +import org.posterita.exceptions.DataException; +import org.posterita.exceptions.NoOrderLineSelectedException; +import org.posterita.exceptions.OperationException; +import org.posterita.formatter.PrintFormatter; +import org.posterita.order.UDIOrderTypes; +import org.posterita.util.PoManager; + +public class InvoiceManager extends AbstractDocumentManager +{ + + private static final String CUSTOMER_INVOICE = "Customer Invoice"; + private static final String VENDOR_INVOICE = "Vendor Invoice"; + + public static MInvoice createCustomerInvoice(Properties ctx, int salesOrderId, String trxName) throws OperationException + { + MOrder so = new MOrder(ctx, salesOrderId, trxName); + + MOrderLine lines[] = so.getLines(); + + Integer soLinesIds[] = new Integer[lines.length]; + + if (soLinesIds.length == 0) + throw new NoOrderLineSelectedException("No order line selected"); + + MInvoice returnInvoice = null; + + for (int i = 0; i list = new ArrayList(); + + + PreparedStatement pstmt = DB.prepareStatement(sql,null); + + ResultSet rs = null; + + try + { + rs = pstmt.executeQuery(); + InvoiceHistoryBean bean; + while(rs.next()) + { + bean = new InvoiceHistoryBean(); + bean.setInvoiceId(Integer.valueOf(rs.getInt(1))); + bean.setPartnerName(rs.getString(2)); + bean.setPartnerId(Integer.valueOf(rs.getInt(3))); + bean.setDocumentNo(rs.getString(4)); + bean.setDocStatus(UDIMap.docStatusMap.get(rs.getString(5))); + bean.setDocStatusCode(rs.getString(5)); + bean.setOrderId(Integer.valueOf(rs.getInt(6))); + bean.setDateInvoiced(rs.getTimestamp(7)); + bean.setGrandTotal(Integer.valueOf(rs.getInt(8))); + bean.setIsPaid(rs.getString(9)); + list.add(bean); + + } + + rs.close(); + } + catch (SQLException e) + { + throw new SQLException(); + } + finally + { + try + { + pstmt.close(); + } + catch(Exception e) + {} + + pstmt = null; + } + + return list; + + } + + public static ArrayList viewInvoice(Properties ctx, Integer invoiceId) throws OperationException + { + if (invoiceId.intValue() == 0) + throw new OperationException("cannot view invoice with id 0"); + + MInvoice invoice = new MInvoice(ctx, invoiceId.intValue(), null); + + if (invoice.get_ID() == 0) + throw new OperationException("cannot view invoice with id 0"); + + ArrayList invoiceLines = retrieveInvoiceLineValues(ctx, invoice.getLines()); + + return invoiceLines; + + } + public static ArrayList retrieveInvoiceLineValues(Properties ctx, MInvoiceLine[] lines) throws OperationException + { + MInvoiceLine line; + MProduct product; + AttributeValuesPair attributeValuesPair; + WebInvoiceLineBean invoiceLinebean; + ArrayList invoiceLines = new ArrayList(); + for (int i = 0; i < lines.length; i++) + { + line = lines[i]; + product = new MProduct(ctx, line.getM_Product_ID(), null); + attributeValuesPair = AttributeValuesManager.retrieveAttributeValues(ctx, product.getM_AttributeSetInstance_ID()); + invoiceLinebean = new WebInvoiceLineBean(); + invoiceLinebean.setAttributeValuesPair(attributeValuesPair); + invoiceLinebean.setSerno(OrderReferenceManager.getSerno(ctx, line.getM_AttributeSetInstance_ID())); + invoiceLinebean.setLineNetAmt(line.getLineNetAmt()); + invoiceLinebean.setLineTotalAmt(line.getLineTotalAmt()); + invoiceLinebean.setTaxAmt(line.getTaxAmt()); + invoiceLines.add(invoiceLinebean); + } + + return invoiceLines; + + } + + public static WebDocumentBean getWebInvoiceBean(MInvoice invoice) throws OperationException, DataException + { + if (invoice == null) + throw new OperationException("Invalid operation invoice is null"); + + if (invoice.get_ID() == 0) + throw new OperationException("You have deleted this invoice. You cannot view this invoice."); + + WebDocumentBean bean = new WebDocumentBean(); + + bean.setInvoiceId(Integer.valueOf(invoice.get_ID())); + + Properties ctx = invoice.getCtx(); + + MOrg myOrg = OrganisationManager.getMyOrg(ctx); + MBPartner me = new MBPartner(ctx, myOrg.getLinkedC_BPartner_ID(null), null); + bean.setMe(me); + + // MOrg orderOrg = new MOrg(ctx, invoice.getAD_Org_ID(), null); + + int currencyId = invoice.getC_Currency_ID(); + MCurrency currency = new MCurrency(ctx,currencyId,null); + bean.setCurrencySymbole(currency.getCurSymbol()); + + + /*if (orderOrg.getLinkedC_BPartner_ID() != myOrg.getLinkedC_BPartner_ID()) + throw new DocumentDoesNotBelongToYouException("This invoice does not belong to you. You do not have access to it."); + */ + MBPartnerLocation meLocation[] = MBPartnerLocation.getForBPartner(ctx,me.get_ID()); + if (meLocation.length ==0) + throw new OperationException("No location has been set for your organisation. Please ask your administrator to set one for you"); + + + MLocation location = new MLocation(ctx, meLocation[0].getC_Location_ID(), null); + + if (meLocation == null) + throw new OperationException("You must have a location set for your business partner, Please ask your administrator to set one for you"); + + bean.setMeLocation(location); + + MBPartner you = new MBPartner(ctx, invoice.getC_BPartner_ID(), null); + bean.setYou(you); + + MBPartnerLocation youBPLocation[] = MBPartnerLocation.getForBPartner(ctx,you.get_ID()); + MLocation youLocation = new MLocation(ctx, youBPLocation[0].getC_Location_ID(), null); + + bean.setYoubpLocation(youBPLocation[0]); + bean.setYouLocation(youLocation); + + ArrayList lines = populateInvoiceLines(ctx , invoice.getLines()); + bean.setLines(lines); + bean = calculateInvoiceTotals(lines, bean); + + + WebDocumentHeaderBean headerBean = createWebDocumentHeader(ctx, invoice.getAD_Org_ID(), invoice.getC_BPartner_ID(), invoice.getDocStatus(), invoice.isSOTrx(),invoice.getPaymentRule()); + headerBean.setDocumentHeader(getDocumentHeader(invoice)); + + + int invoiceId = invoice.get_ID(); + + int[] shipmentIds = MInOut.getAllIDs(MInOut.Table_Name, "c_invoice_id=" + invoiceId, null); + + if (shipmentIds.length == 0) + headerBean.setShipped("No"); + else + headerBean.setShipped("Yes"); + + bean.setHeaderBean(headerBean); + + bean.setInvoice(invoice); + + MOrder order = new MOrder(ctx, invoice.getC_Order_ID(), null); + bean.setOrder(order); + + CommandBean cmdBean = new CommandBean(); + if (!invoice.isSOTrx()) + cmdBean = getVendorInvoiceWebCommands(invoice); + else + cmdBean = getCustomerInvoiceWebCommands(invoice); + + bean.setSimpleCommand(cmdBean.getSimpleCommand()); + bean.setComplexCommand(cmdBean.getComplexCommand()); + + + return bean; + } + + public static String getDocumentHeader(MInvoice invoice) + { + if (invoice.isSOTrx()) + return CUSTOMER_INVOICE; + + return VENDOR_INVOICE; + } + + + private static WebDocumentBean calculateInvoiceTotals(ArrayList webOrderLineList, WebDocumentBean webInvoiceLineBean) + { + Iterator iter = webOrderLineList.iterator(); + + WebInvoiceLineBean bean; + + BigDecimal totalLines = new BigDecimal(0); + BigDecimal totalTax = new BigDecimal(0); + BigDecimal grandTotal; + + BigDecimal roundedTotalLines; + BigDecimal roundedTotalTax; + BigDecimal roundedGrandTotal; + while(iter.hasNext()) + { + bean = (WebInvoiceLineBean) iter.next(); + totalLines = totalLines.add(bean.getLineNetAmt()); + totalTax = totalTax.add(bean.getTaxAmt()); + } + + grandTotal = totalLines.add(totalTax); + + + roundedTotalLines = round(totalLines, 2); + roundedTotalTax = round(totalTax, 2); + + roundedGrandTotal = round(grandTotal, 2); + + webInvoiceLineBean.setTotalLines(roundedTotalLines); + webInvoiceLineBean.setTotalTax(roundedTotalTax); + webInvoiceLineBean.setGrandTotal(roundedGrandTotal); + + return webInvoiceLineBean; + } + private static BigDecimal round(BigDecimal number, int decimalPlaces) + { + BigDecimal roundedNumber = number.setScale(decimalPlaces, BigDecimal.ROUND_HALF_UP); + + return roundedNumber; + } + + private static ArrayList populateInvoiceLines(Properties ctx, MInvoiceLine[] lines) throws OperationException + { + MInvoiceLine line; + MProduct product; + AttributeValuesPair attributeValuesPair; + ArrayList invoiceLines = new ArrayList(); + for (int i = 0; i < lines.length; i++) + { + line = lines[i]; + product = new MProduct(ctx, line.getM_Product_ID(), null); + attributeValuesPair = AttributeValuesManager.retrieveAttributeValues(ctx, product.getM_AttributeSetInstance_ID()); + WebInvoiceLineBean invoiceLineBean = new WebInvoiceLineBean(); + invoiceLineBean.setAttributeValuesPair(attributeValuesPair); + + BigDecimal roundedLineNetAmount = round(line.getLineNetAmt(), 2); + + //line tax amount + BigDecimal lineTaxAmount = getLineTaxAmt(line.getCtx(), line.getLineNetAmt(), line.getC_Tax_ID(), line.get_ID()); + BigDecimal roundedTaxAmount = round(lineTaxAmount, 2); + invoiceLineBean.setTaxAmt(roundedTaxAmount); + + + //lineTotalAmount = lineNetAmount + lineTaxAmount + BigDecimal lineTotalAmount = line.getLineNetAmt().add(lineTaxAmount); + BigDecimal roundedLineTotalAmount = round(lineTotalAmount, 2); + + invoiceLineBean.setLineTotalAmt(roundedLineTotalAmount); + invoiceLineBean.setQtyOrdered(line.getQtyEntered()); + + invoiceLineBean.setLineNetAmt(roundedLineNetAmount); + invoiceLineBean.setPriceActual(line.getPriceActual()); + + invoiceLineBean.setProductId(Integer.valueOf(line.getM_Product_ID())); + invoiceLineBean.setOrderLineId(Integer.valueOf(line.get_ID())); + + invoiceLineBean.setSerno(getSerno(ctx, line.getM_AttributeSetInstance_ID())); + + if(line.getM_Product_ID() == 0) + { + if(line.getC_Charge_ID() != 0) + { + MCharge charge = ChargeManager.loadCharge(ctx, line.getC_Charge_ID(), null); + invoiceLineBean.setDescription(charge.getName()); + } + else + invoiceLineBean.setDescription("Adjustment product"); + } + else + invoiceLineBean.setDescription(ProductManager.getProductName(ctx, line.getM_Product_ID())); + invoiceLines.add(invoiceLineBean); + } + + return invoiceLines; + } + + private static CommandBean getVendorInvoiceWebCommands(MInvoice invoice) throws OperationException + { + + if (invoice.isSOTrx()) + throw new OperationException("Invoice should be a vendor Invoice"); + + + String[] simpleCommands = new String[0]; + String[] complexCommands = new String[0]; + + CommandBean bean = new CommandBean(); + bean.setSimpleCommand(simpleCommands); + bean.setComplexCommand(complexCommands); + return bean; + } + + private static CommandBean getCustomerInvoiceWebCommands(MInvoice invoice) throws OperationException, DataException + { + + if (!invoice.isSOTrx()) + throw new OperationException("Invoice should be a customer invoice"); + + + String[] simpleCommands = null; + String[] complexCommands = null; + + CommandBean bean = new CommandBean(); + + if (invoice.getDocStatus().equals(DocumentEngine.STATUS_Drafted)) + { + simpleCommands = new String[]{Constants.INVOICE_ACTION_COMPLETE}; + complexCommands = new String[]{Constants.INVOICE_ACTION_CANCEL}; + } + + if (invoice.getDocStatus().equals(DocumentEngine.STATUS_Voided)) + { + complexCommands = new String[]{Constants.INVOICE_ACTION_DELETE}; + } + + if (invoice.getDocStatus().equals(DocumentEngine.STATUS_Completed)) + { + bean = getCIWebCommands(invoice); + return bean; + } + + + bean.setSimpleCommand(simpleCommands); + bean.setComplexCommand(complexCommands); + return bean; + } + + public static CommandBean getCIWebCommands(MInvoice invoice) throws OperationException, DataException + { + MOrder order = new MOrder(invoice.getCtx(), invoice.getC_Order_ID(), null); + + int[] docTypes = MDocType.getAllIDs(MDocType.Table_Name, " ad_client_id="+ Env.getAD_Client_ID(invoice.getCtx()) + " and DOCSUBTYPESO='" + MDocType.DOCSUBTYPESO_POSOrder+ "'", null ); + + String simpleCommands[] = null; + String complexCommands[] = null; + + //POS order + if (order.getC_DocType_ID() == docTypes[0]) + { + simpleCommands = new String[]{}; + complexCommands = new String[]{}; + } + + if (invoice.isPaid() && (!MinOutManager.isShipped(invoice.getCtx(), invoice))) + { + int[] shipmentIds = MInOut.getAllIDs(MInOut.Table_Name, "c_invoice_id=" + invoice.get_ID(), null); + + if (shipmentIds.length == 0) + simpleCommands = new String[]{Constants.MINOUT_ACTION_SHIP}; + else + if (shipmentIds.length > 1) + throw new DataException("This invoice has been shipped more than once!"); + + } + if (!invoice.isPaid() && (!MinOutManager.isShipped(invoice.getCtx(), invoice))) + { + simpleCommands = new String[] {Constants.INVOICE_ACTION_PAID, Constants.INVOICE_ACTION_PAID_AND_SHIP}; + } + + CommandBean bean = new CommandBean(); + bean.setSimpleCommand(simpleCommands); + bean.setComplexCommand(complexCommands); + + return bean; + } + + public static MInvoice deleteInvoice(Properties ctx, MInvoice invoice) throws OperationException + { + invoice.setIsActive(false); + PoManager.save(invoice); + + return invoice; + } + + public static boolean allOrderLinesInvoiced(Properties ctx, MOrder order) + { + MOrderLine[] lines = order.getLines(); + + MOrderLine line; + for (int i = 0; i < lines.length; i ++) + { + line = lines[i]; + + if (!line.getQtyInvoiced().equals(line.getQtyOrdered())) + return false; + + } + + return true; + } + + public static MInvoice voidInvoice(Properties ctx, MInvoice invoice) throws OperationException + { + + if (!invoice.isSOTrx()) + throw new OperationException("Only voiding of customer invoice is currently supported."); + + if (!invoice.getDocStatus().equals(DocumentEngine.STATUS_Drafted)) + throw new OperationException("The system only supports voiding of DRAFTED Invoice."); + + //we need to force void here because invoice has already been processed + //invoice.isProcessed=true + forceVoid(ctx, invoice); + + invoice = new MInvoice(ctx, invoice.get_ID(), invoice.get_TrxName()); + + return invoice; + } + + public static void forceVoid(Properties ctx, MInvoice invoice) throws OperationException + { + PreparedStatement pstmt1 = null; + PreparedStatement pstmt2 = null; + + String sql = "update C_Invoice set DOCSTATUS=" + "'" + + DocumentEngine.STATUS_Voided + "'" + + " where AD_CLIENT_ID=" + Env.getAD_Client_ID(ctx) + + " and C_INVOICE_ID=" + invoice.get_ID(); + + String sql2 = "update C_Invoice set DOCACTION=" + "'" + + DocumentEngine.ACTION_None + "'" + + " where AD_CLIENT_ID=" + Env.getAD_Client_ID(ctx) + + " and C_INVOICE_ID=" + invoice.get_ID(); + + pstmt1 = DB.prepareStatement(sql,invoice.get_TrxName()); + pstmt2 = DB.prepareStatement(sql2,invoice.get_TrxName()); + + try + { + pstmt1.executeUpdate(); + pstmt2.executeUpdate(); + } + catch (SQLException e) + { + throw new OperationException(e.getMessage()); + } + finally + { + try + { + pstmt1.close(); + pstmt2.close(); + } + catch (Exception e) + {} + + pstmt1 = null; + pstmt2 = null; + } + + } + + public static int[] getInvoiceIdsForOrder(Properties ctx, int orderId, String trxName) + { + String whereClause = "isACTIVE='Y' and C_Order_ID=" + orderId; + int invoiceIds[] = MInvoice.getAllIDs(MInvoice.Table_Name, whereClause, trxName); + return invoiceIds; + } + + public static MInvoice loadInvoice(Properties ctx, int invoiceId, String trxName) throws OperationException + { + MInvoice invoice = new MInvoice(ctx, invoiceId, trxName); + if(invoice.get_ID() == 0) + throw new OperationException("Could not load invoice with id: " + invoiceId); + + return invoice; + } + public static ArrayList populateInvoiceLines(Properties ctx, MInvoice invoice,boolean abbr) throws OperationException + { + MInvoiceLine [] lines=invoice.getLines(); + MInvoiceLine line; + MProduct product; + // AttributeValuesPair attributeValuesPair; + WebOrderLineBean orderLineBean; + BigDecimal qty = Env.ZERO; + + + ArrayList orderLines = new ArrayList(); + for (int i = 0; i < lines.length; i++) + { + line = lines[i]; + + product = new MProduct(ctx, line.getM_Product_ID(), null); + + int priceScale = line.getLineNetAmt().scale(); + + orderLineBean = new WebOrderLineBean(); + orderLineBean.setLineNetAmt(line.getLineNetAmt()); + BigDecimal lineTaxAmount = POSManager.getLineTaxAmt(line.getCtx(), line.getLineNetAmt(), line.getC_Tax_ID(),line.getQtyEntered()); + lineTaxAmount = lineTaxAmount.setScale(priceScale, RoundingMode.HALF_UP); + orderLineBean.setTaxAmt(lineTaxAmount); + BigDecimal lineTotalAmount = line.getLineNetAmt().add(orderLineBean.getTaxAmt()); + lineTotalAmount = lineTotalAmount.setScale(priceScale, RoundingMode.HALF_UP); + orderLineBean.setLineTotalAmt(lineTotalAmount); + + orderLineBean.setProductId(Integer.valueOf(line.getM_Product_ID())); + + + if (line.getM_Product_ID() == 0) + { + if(line.getC_Charge_ID() != 0) + { + MCharge charge = ChargeManager.loadCharge(ctx, line.getC_Charge_ID(), null); + orderLineBean.setProductName(charge.getName()); + } + else + throw new OperationException("Unknown Order line type with id: " + line.get_ID()); + } + else + { + if(abbr) + orderLineBean.setProductName(new PrintFormatter().format(product).toString()); + else + orderLineBean.setProductName(product.getName().replaceAll("~"," ")); + orderLineBean.setDescription(product.getDescription()); + } + + orderLineBean.setOrderLineId(Integer.valueOf(line.get_ID())); + orderLineBean.setIsinvoiced(Boolean.valueOf(false)); + orderLineBean.setIsQtyReserved(Boolean.valueOf(true)); + qty= qty.add(line.getQtyEntered()); + orderLineBean.setQtyTotal(qty); + + orderLineBean.setQtyOrdered(line.getQtyEntered()); + orderLineBean.setGrandTotal(invoice.getGrandTotal()); + + + + + orderLines.add(orderLineBean); + + } + + return orderLines; + } + + public static void printInvoice(Properties ctx,MInvoice invoice) throws OperationException + { + PrintManager.print(ctx,ReportEngine.INVOICE,invoice.get_ID()); + } + + /** + * + * @param ctx + * @param dateInvoiced + * @param orgId + * @param bPartnerId + * @param orderId + * @param consolidateDoc + * @param docAction + * @param trx + * @throws InstantiationException + * @throws IllegalAccessException + * @throws ClassNotFoundException + */ + public static void generateInvoices(Properties ctx, Timestamp dateInvoiced, int orgId, + int bPartnerId, int orderId, boolean isConsolidateDoc, String docAction, Trx trx) + throws InstantiationException, IllegalAccessException, ClassNotFoundException + { + String trxName = trx.getTrxName(); + int processId = MProcess.getProcess_ID("C_Invoice_Generate", trxName); + MProcess process = new MProcess(ctx, processId, trxName); + + MPInstance processInstance = new MPInstance(ctx, processId, 0); + processInstance.save(trxName); + + MPInstancePara paramDateInvoiced = new MPInstancePara(processInstance, 10); + paramDateInvoiced.setParameterName("DateInvoiced"); + paramDateInvoiced.setP_Date(dateInvoiced); + paramDateInvoiced.save(trxName); + + MPInstancePara paramOrgId = new MPInstancePara(processInstance, 20); + paramOrgId.setParameterName("AD_Org_ID"); + paramOrgId.setP_Number(orgId); + paramOrgId.save(trxName); + + MPInstancePara paramBPartnerId = new MPInstancePara(processInstance, 30); + paramBPartnerId.setParameterName("C_BPartner_ID"); + paramBPartnerId.setP_Number(bPartnerId); + paramBPartnerId.save(trxName); + + MPInstancePara paramOrderId = new MPInstancePara(processInstance, 40); + paramOrderId.setParameterName("C_Order_ID"); + paramOrderId.setP_Number(orderId); + paramOrderId.save(trxName); + + MPInstancePara paramConsolidateDoc = new MPInstancePara(processInstance, 50); + paramConsolidateDoc.setParameterName("ConsolidateDocument"); + paramConsolidateDoc.setP_String(isConsolidateDoc?"Y":"N"); + paramConsolidateDoc.save(trxName); + + MPInstancePara paramDocAction = new MPInstancePara(processInstance, 60); + paramDocAction.setParameterName("DocAction"); + paramDocAction.setP_String(docAction); + paramDocAction.save(trxName); + + ProcessInfo pi = new ProcessInfo(process.getDescription(), processId); + ProcessInfoParameter piDateInvoiced = new ProcessInfoParameter("DateInvoiced", dateInvoiced, null, null, null); + ProcessInfoParameter piOrgId = new ProcessInfoParameter("AD_Org_ID", orgId, null, null, null); + ProcessInfoParameter piBPartnerId = new ProcessInfoParameter("C_BPartner_ID", bPartnerId, null, null, null); + ProcessInfoParameter piOrderId = new ProcessInfoParameter("C_Order_ID", orderId, null, null, null); + ProcessInfoParameter piConsolidateDoc = new ProcessInfoParameter("ConsolidateDocument", isConsolidateDoc?"Y":"N", null, null, null); + ProcessInfoParameter piDocAction = new ProcessInfoParameter("DocAction", docAction, null, null, null); + + ProcessInfoParameter[] piParameters = new ProcessInfoParameter[]{piDateInvoiced, piOrgId, piBPartnerId, piOrderId, piConsolidateDoc, piDocAction}; + pi.setParameter(piParameters); + pi.setAD_PInstance_ID(processInstance.getAD_PInstance_ID()); + pi.setAD_Process_ID(processInstance.getAD_Process_ID()); + + ProcessManager.startProcess(ctx, InvoiceGenerate.class.getName(), pi, trx); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/LocationManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/LocationManager.java new file mode 100644 index 0000000000..e348fefa1b --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/businesslogic/LocationManager.java @@ -0,0 +1,133 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 22-Jul-2005 by alok + * + */ +package org.posterita.businesslogic; + +import java.util.Properties; + +import org.compiere.model.MBPartner; +import org.compiere.model.MBPartnerLocation; +import org.compiere.model.MLocation; +import org.posterita.exceptions.OperationException; +import org.posterita.lib.UdiConstants; +import org.posterita.util.PoManager; + + +public class LocationManager +{ + + + public static MLocation saveLocation(Properties ctx, int orgId, int locationId, String address1,String address2, String postalAddress1, Integer regionId, String city,int countryId, String trxName) throws OperationException + { + MLocation location = null; + + if (locationId == 0) + location = new MLocation(ctx,locationId,trxName); + else + location = loadLocation(ctx, locationId, trxName); + + location.setAddress1(address1); + location.setAddress2(address2); + location.setCity(city); + location.setPostal_Add(postalAddress1); + location.setC_Country_ID(countryId); + location.setAD_Org_ID(orgId); + PoManager.save(location); + + return location; + } + + + public static MLocation createLocation(Properties ctx, int orgId, String address1,String address2, String postalAddress1, String city,int regionId, int countryId, String trxName) throws OperationException + { + MLocation location = new MLocation(ctx,0,trxName); + location.setAD_Org_ID(orgId); + location.setAddress1(address1); + location.setAddress2(address2); + location.setCity(city); + location.setPostal_Add(postalAddress1); + location.setC_Region_ID(regionId); + location.setC_Country_ID(countryId); + PoManager.save(location); + + return location; + } + + public static MLocation editLocation(Properties ctx,int locationId,String address1,String postalAddress1, Integer regionId, String city, String trxName) throws OperationException + { + + if(locationId<=0) + throw new OperationException("Location does not exist"); + + MLocation location; + + try + { + location = new MLocation(ctx,locationId,trxName); + + if(location==null) + throw new OperationException("Location does not exist"); + + + location.setAddress1(address1); + location.setCity(city); + location.setPostal_Add(postalAddress1); + + if(regionId!=null) + location.setC_Region_ID(regionId); + + PoManager.save(location); + + } + catch(OperationException e) + { + throw new OperationException("Could not edit location!!"); + } + + + return location; + + } + + public static MBPartnerLocation createDefaultBPLocation(Properties ctx, MBPartner bpartner) throws OperationException + { + MLocation location = LocationManager.createLocation(ctx, bpartner.getAD_Org_ID(), "","","", "",0, UdiConstants.COUNTRY_MAURITIUS, null); + + + MBPartnerLocation bplocation = new MBPartnerLocation(bpartner); + bplocation.setC_Location_ID(location.get_ID()); + PoManager.save(bplocation); + + bpartner.setPrimaryC_BPartner_Location_ID(bplocation.get_ID()); + PoManager.save(bpartner); + + return bplocation; + } + + public static MLocation loadLocation(Properties ctx, int locationId, String trxName) throws OperationException + { + MLocation location = new MLocation(ctx, locationId, trxName); + if(location.get_ID() == 0) + throw new OperationException("Could not load location with id: " + locationId); + return location; + } + +} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/LoginManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/LoginManager.java new file mode 100644 index 0000000000..0f2c1ea5a6 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/businesslogic/LoginManager.java @@ -0,0 +1,473 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + **/ + +package org.posterita.businesslogic; + +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.Properties; +import java.util.Vector; + +import org.compiere.model.MClient; +import org.compiere.model.MOrg; +import org.compiere.model.MUser; +import org.compiere.util.DB; +import org.compiere.util.Env; +import org.compiere.util.KeyNamePair; +import org.compiere.util.WebInfo; +import org.compiere.util.WebUser; +import org.posterita.beans.ChangePasswordBean; +import org.posterita.beans.LoginBean; +import org.posterita.beans.OrgUsersBean; +import org.posterita.beans.UserBean; +import org.posterita.businesslogic.administration.RoleManager; +import org.posterita.businesslogic.administration.UserManager; +import org.posterita.exceptions.DataException; +import org.posterita.exceptions.DuplicatePINException; +import org.posterita.exceptions.EmailNotFoundException; +import org.posterita.exceptions.InvalidPINException; +import org.posterita.exceptions.InvalidPasswordLengthException; +import org.posterita.exceptions.InvalidRoleException; +import org.posterita.exceptions.NotLoggedInException; +import org.posterita.exceptions.OperationException; +import org.posterita.exceptions.SystemException; +import org.posterita.exceptions.UserInactiveException; +import org.posterita.exceptions.UserNotFoundException; +import org.posterita.exceptions.WrongPasswordException; +import org.posterita.lib.UdiConstants; +import org.posterita.pos.help.POSHelpManager; +import org.posterita.user.WebUserInfo; +import org.posterita.util.PoManager; + + +public class LoginManager +{ + + public WebUser checkLoginPassword(Properties ctx, LoginBean bean) throws UserNotFoundException, UserInactiveException, SQLException, OperationException, NotLoggedInException + { + WebUser wu = get (ctx, bean.getUsername()); + + wu.login(bean.getPassword()); + + // Ensure that the right user id is found in ctx, not the 1 used by compiere cache. + Env.setContext(ctx, "#AD_User_ID", wu.getAD_User_ID()); + setRoleContext(ctx); + + if (!wu.isLoggedIn()) + { + throw new NotLoggedInException(); + } + + return wu; + } + + + public void setRoleContext(Properties ctx) throws SQLException, OperationException + { + ArrayList list = RoleManager.getMyRoles(ctx); + + for (KeyNamePair pair : list) + { + Env.setContext(ctx, "#AD_Role_ID", pair.getKey()); + break; + } + + Env.setContext(ctx,UdiConstants.ROLE_EDITABLE_ORGS_CTX_PARAM, RoleManager.getRoleEditableOrgAccess(ctx)); + Env.setContext(ctx,UdiConstants.ROLE_VIEWABLE_ORGS_CTX_PARAM, RoleManager.getRoleViewableOrgAccess(ctx)); + } + + public WebUserInfo login (Properties ctx, WebUser wu) throws NotLoggedInException, InvalidRoleException, DataException, OperationException, SystemException + { + + WebInfo info = new WebInfo(ctx, wu); + WebUserInfo udiInfo = new WebUserInfo(ctx,wu,info); + +// MRole currentRole = new MRole(ctx, udiInfo.getRoleId().intValue(), null); + + return udiInfo; + } + + public WebUserInfo loginUser(Properties ctx, LoginBean bean) throws UserNotFoundException, UserInactiveException, NotLoggedInException, SQLException, OperationException, InvalidRoleException, DataException, SystemException + { + +// int originalRoleID = UserManager.getOriginalRoleID(ctx); + + MUser user = new MUser(ctx,bean.getUserId().intValue(),null); + + bean.setUsername(user.getName()); + bean.setPassword(user.getPassword()); + WebUser wu = checkLoginPassword(ctx, bean); + + WebUserInfo wuInfo = login(ctx, wu); + + return wuInfo; + } + + public boolean sendPassword(Properties ctx, UserBean bean, String subject, String content) throws SQLException, UserNotFoundException, EmailNotFoundException + { + MUser user = load(ctx, bean.getUsername()); + + if (user == null) + throw new UserNotFoundException(); + + String email = user.getEMail(); + + if (email == null || email.trim().length() == 0) + throw new EmailNotFoundException(); + + content = content + user.getPassword(); + + MClient client = new MClient(ctx,Env.getAD_Client_ID(ctx),null); + + String from = "Support "; + + return POSHelpManager.sendEmail(ctx, from, email, subject, content); + + + } + + + public static void changePassword(Properties ctx, ChangePasswordBean bean, WebUserInfo userInfo) throws WrongPasswordException, OperationException + { + + MUser user = new MUser(ctx, userInfo.getUser().getAD_User_ID(),null); + + String oldPassword = bean.getOldPassword(); + + if (!oldPassword.equals(userInfo.getUser().getPassword())) + throw new WrongPasswordException(); + + String newPassword = bean.getNewPassword(); + + if(newPassword.length()<6) + throw new InvalidPasswordLengthException("The password Should be at least six characters long"); + + + user.setPassword(newPassword); + + PoManager.save(user); + + WebUser webUser = WebUser.get(ctx,user.getEMail(),user.getPassword(), false); + + userInfo.setUser(webUser); + } + + + + protected static MUser load(Properties ctx, String username) throws SQLException + { + MUser m_bpc = null; + String sql = "SELECT * " + + "FROM AD_User " + + "WHERE AD_Client_ID=?" + + " AND Name=?"; + + if (username == null) + username = ""; + + PreparedStatement pstmt = null; + ResultSet rs = null; + + try + { + pstmt = DB.prepareStatement(sql, null); + pstmt.setInt(1, Env.getAD_Client_ID(ctx)); + pstmt.setString(2, username); + + rs = pstmt.executeQuery(); + + if (rs.next()) + { + m_bpc = new MUser (ctx, rs, null); + } + + rs.close(); + + } + catch (SQLException e) + { + throw e; + } + finally + { + try + { + pstmt.close (); + } + catch (Exception e) + { + + } + + pstmt = null; + } + + return m_bpc; + } + + + + private static WebUser get(Properties ctx, String username) throws SQLException, UserNotFoundException, UserInactiveException + { + MUser m_bpc = load(ctx, username); + + if (m_bpc == null) + throw new UserNotFoundException(); + + if (!m_bpc.isActive()) + throw new UserInactiveException(); + + WebUser wu = WebUser.get(ctx, m_bpc.getAD_User_ID()); + + return wu; + } + + public static ArrayList getOrgUsers(Properties ctx) + { + ArrayList orgUsers = new ArrayList(); + Vector users = null; + MOrg org = null; + OrgUsersBean bean = null; + + int ad_client_id = Env.getAD_Client_ID(ctx); + + StringBuffer whereClause = new StringBuffer(""); + whereClause.append(" AD_CLIENT_ID = " + ad_client_id); + whereClause.append(" AND ISACTIVE = 'Y'"); + whereClause.append(" AND ISVISIBLE = 'Y'"); + + + whereClause.append(" ORDER BY NAME"); + + int[] orgIds = MOrg.getAllIDs(MOrg.Table_Name,whereClause.toString(),null); + + for(int i=0; i getAccessibleOrgsKeyNamePair(Properties ctx) throws SQLException + { + int ad_user_id = Env.getAD_User_ID(ctx); + int ad_client_id = Env.getAD_Client_ID(ctx); + + String sql = "select distinct(org.AD_ORG_ID), org.name " + + " from AD_USER_ROLES usrRole, AD_USER usr, AD_ROLE role, AD_ORG org " + + " where org.AD_ORG_ID = role.AD_ORG_ID " + + " and usrRole.AD_USER_ID = usr.AD_USER_ID " + + " and usrRole.AD_ROLE_ID = role.AD_ROLE_ID " + + " and role.AD_CLIENT_ID = ? " + + " and usrRole.AD_USER_ID = ? " + + " order by org.name"; + + PreparedStatement pstmt = DB.prepareStatement(sql, null); + ResultSet rs = null; + ArrayList orgList = new ArrayList(); + + try + { + pstmt.setInt(1,ad_client_id); + pstmt.setInt(2,ad_user_id); + + rs = pstmt.executeQuery(); + + while(rs.next()) + { + KeyNamePair pair = new KeyNamePair(rs.getInt(1),rs.getString(2)); + + orgList.add(pair); + } + + rs.close(); + } + catch (SQLException e) + { + throw e; + } + finally + { + try + { + pstmt.close(); + } + catch(Exception e) + {} + + pstmt = null; + + } + + + return orgList; + } + + public static ArrayList getUserRolesKeyNamePair(Properties ctx, int ad_org_id) throws SQLException + { + int ad_user_id = Env.getAD_User_ID(ctx); + int ad_client_id = Env.getAD_Client_ID(ctx); + + String sql = "select role.AD_ROLE_ID, role.NAME " + + " from AD_USER_ROLES usrRole, AD_USER usr, AD_ROLE role, AD_ORG org " + + " where org.AD_ORG_ID = role.AD_ORG_ID " + + " and usrRole.AD_USER_ID = usr.AD_USER_ID " + + " and usrRole.AD_ROLE_ID = role.AD_ROLE_ID " + + " and role.AD_CLIENT_ID = ? " + + " and role.AD_ORG_ID = ? " + + " and usrRole.AD_USER_ID = ? " + + " order by role.NAME"; + + PreparedStatement pstmt = DB.prepareStatement(sql, null); + ResultSet rs = null; + ArrayList roleList = new ArrayList(); + + try + { + pstmt.setInt(1,ad_client_id); + pstmt.setInt(2,ad_org_id); + pstmt.setInt(3,ad_user_id); + + rs = pstmt.executeQuery(); + + while(rs.next()) + { + KeyNamePair pair = new KeyNamePair(rs.getInt(1),rs.getString(2)); + + roleList.add(pair); + } + + rs.close(); + } + catch (SQLException e) + { + throw e; + } + finally + { + try + { + pstmt.close(); + } + catch(Exception e) + {} + + pstmt = null; + } + + return roleList; + } + + + + private static String getallOrgsAccess(Properties ctx) throws SQLException + { + String sql = "SELECT o.AD_Org_ID,o.Name,o.IsSummary " // 1..3 + + "FROM AD_Role r, AD_Client c" + + " INNER JOIN AD_Org o ON (c.AD_Client_ID=o.AD_Client_ID OR o.AD_Org_ID=0) " + + "WHERE r.AD_Role_ID=?" // #1 + + " AND c.AD_Client_ID=?" // #2 + + " AND o.IsActive='Y'" + + " AND (r.IsAccessAllOrgs='Y' " + + "OR (r.IsUseUserOrgAccess='N' AND o.AD_Org_ID IN (SELECT AD_Org_ID FROM AD_Role_OrgAccess ra " + + "WHERE ra.AD_Role_ID=r.AD_Role_ID AND ra.IsActive='Y')) " + + "OR (r.IsUseUserOrgAccess='Y' AND o.AD_Org_ID IN (SELECT AD_Org_ID FROM AD_User_OrgAccess ua " + + "WHERE ua.AD_User_ID=? AND ua.IsActive='Y'))" // #3 + + ") " + + "ORDER BY o.Name"; + + String orgIds=""; + PreparedStatement pstmt = null; + new ArrayList(); + ResultSet rs = null; + + try + { + pstmt = DB.prepareStatement(sql, null); + pstmt.setInt(1, Env.getAD_Role_ID(ctx)); + pstmt.setInt(2, Env.getAD_Client_ID(ctx)); + pstmt.setInt(3, Env.getAD_User_ID(ctx)); + rs = pstmt.executeQuery(); + + // load Orgs + while (rs.next()) + { + if(orgIds=="") + orgIds = orgIds+rs.getInt(1)+""; + else + orgIds = orgIds+","+rs.getInt(1)+""; + } + + rs.close(); + } + catch (SQLException ex) + { + throw ex; + } + finally + { + try + { + pstmt.close(); + } + catch (Exception e) + {} + + pstmt = null; + } + + return orgIds; + + } + + public LoginBean getUserNameFromPIN(Properties ctx,String userPIN) throws DuplicatePINException, InvalidPINException + { + String whereClause="AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+ + " and USERPIN='"+userPIN+"'"; + + int [] userIds = MUser.getAllIDs(MUser.Table_Name,whereClause,null); + + if(userIds.length>1) + throw new DuplicatePINException("More than one user with same pin"); + if(userIds.length<1) + throw new InvalidPINException("Invalid PIN"); + + MUser user = new MUser(ctx,userIds[0],null); + + LoginBean bean = new LoginBean(); + bean.setUsername(user.getName()); + bean.setPassword(user.getPassword()); + + return bean; + + } +} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/MenuManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/MenuManager.java new file mode 100644 index 0000000000..a0c2d68e31 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/businesslogic/MenuManager.java @@ -0,0 +1,571 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Nov 6, 2005 by alok + **/ +package org.posterita.businesslogic; + +import java.io.PrintWriter; +import java.io.StringWriter; +import java.lang.reflect.Array; +import java.math.BigDecimal; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.Properties; + +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpSession; + +import org.compiere.model.MMenu; +import org.compiere.model.X_U_WebMenu; +import org.compiere.util.DB; +import org.compiere.util.Env; +import org.posterita.Constants; +import org.posterita.beans.MenuItemBean; +import org.posterita.core.MenuItem; +import org.posterita.core.bean.ElementBean; +import org.posterita.core.businesslogic.ElementManager; +import org.posterita.exceptions.OperationException; +import org.posterita.exceptions.SystemException; +import org.posterita.factory.AbstractFactory; +import org.posterita.factory.POSMenuFactory; +import org.posterita.keyname.MenuKeyNamePair; +import org.posterita.model.MWebMenu; +import org.posterita.util.PoManager; + + +public class MenuManager +{ + + public static ArrayList getMenus(Properties ctx, int roleId) throws SystemException, OperationException + { + POSMenuFactory.getFactoryInstance(ctx); + ArrayList menuList = new ArrayList(); + int adRoleId = roleId; + + String sqlStatement = ""; + + sqlStatement = " select m.* " + + " from U_WebMENU m, U_RoleMenu rm " + + " where m.U_WebMenu_ID = rm.U_WebMenu_ID "+ + " and M.isActive='Y'"+ + " and rm.AD_Role_ID = " + adRoleId + +// " and m.AD_Client_ID = " + adClientId + // Menu not dependent on client + " order by m.Sequence, m.U_WebMenu_ID"; + + + PreparedStatement prepStatement = null; + try + { + prepStatement = DB.prepareStatement(sqlStatement, null); + ResultSet rs = prepStatement.executeQuery(); + + + while(rs.next()) + { + MWebMenu menu = new MWebMenu(ctx, rs, null); + + if (!menu.isActive()) + { + menu.setMenuLink("#"); + } + + menuList.add(menu); + } + rs.close(); + + } + catch(SQLException ex) + { + throw new SystemException(ex.getMessage()); + } + finally + { + try + { + prepStatement.close(); + } + catch(Exception e) + { + } + prepStatement = null; + } + return menuList; + } + + public static ArrayList getMenus(Properties ctx) throws SystemException, OperationException + { + int adRoleId = Env.getAD_Role_ID(ctx); + return MenuManager.getMenus(ctx, adRoleId); + } + + public static ArrayList getMenus(Properties ctx, HttpServletRequest request) throws SystemException, OperationException + { + ArrayList menuList = getMenus(ctx); + rewriteMenuURL(menuList, request); + + return menuList; + } + + + public static MenuItem buildMenuTree(Properties ctx, ArrayList menuList) + { + MenuItem rootMenuItem = MenuItem.getDummyMenuItem(ctx); + + Iterator menuIter = menuList.iterator(); + Iterator subIterator; + MWebMenu mMenu; + MWebMenu sMenu; + + + while(menuIter.hasNext()) + { + mMenu = (MWebMenu)menuIter.next(); + + if(mMenu.getParentMenu_ID() == 0) // Parent Menu + { + MenuItem mItem = new MenuItem(mMenu); + rootMenuItem.addSubMenu(mItem); + subIterator = menuList.iterator(); + + while(subIterator.hasNext()) + { + sMenu = (MWebMenu)subIterator.next(); + if(sMenu.getParentMenu_ID() == mMenu.get_ID()) + { + MenuItem sItem = new MenuItem(sMenu); + + String menuLink = sItem.getMenuLink(); + if(! menuLink.startsWith("javascript:")) + { + sItem.setMenuLink(sItem.getMenuLink() + sItem.getMenuId()); + } + + //sItem + mItem.addSubMenu(sItem); + } + } + //if(mItem.hasSubMenu()) + mItem.setMenuLink(mItem.getMenuLink() + mItem.getMenuId()); + } + } + + return rootMenuItem; + } + + public static void saveMenu(Properties ctx, MenuItemBean bean) throws OperationException + { + //when creating a new menu + MWebMenu menu; + if (bean.getMenuId().equals(Integer.valueOf(0))) + { + menu = new MWebMenu(ctx,0,null); + } +// when editing a menu + else + { + menu = new MWebMenu(ctx,bean.getMenuId().intValue(),null); + } + + menu.setIsActive(bean.getIsActive().booleanValue()); + menu.setDescription(bean.getDescription()); + PoManager.save(menu); + } + + public static MWebMenu createParentMenu(Properties ctx, String menuName, String moduleName, int sequence) throws OperationException + { + MWebMenu menu = new MWebMenu(ctx, 0, null); + + menu.setMenuLink("GetMenuItemsAction.do?action=getMenuItems&menuId="); + menu.setModule(moduleName); + menu.setPosition(AbstractFactory.MENU_POSITION_LEFT); + menu.setSequence(new BigDecimal(sequence)); + menu.setName(menuName); + + return menu; + } + + public static MWebMenu createSubMenu(Properties ctx,String menuName, String menuLink, String moduleName, int parentId, int sequence) throws OperationException + { + return createSubMenu(ctx, menuName, menuLink, moduleName, parentId, sequence, null); + } + + public static MWebMenu createSubMenu(Properties ctx,String menuName, String menuLink, String moduleName, int parentId, int sequence, String category) throws OperationException + { + MWebMenu menu = new MWebMenu(ctx, 0, null); + menu.setParentMenu_ID(parentId); + + if(!menuLink.contains("javascript")) + { + if (menuLink.endsWith(".do")) + menuLink = menuLink + "?menuId="; + else + menuLink = menuLink + "&menuId="; + } + + menu.setMenuLink(menuLink); + menu.setModule(moduleName); + menu.setSequence(new BigDecimal(sequence)); + menu.setPosition(AbstractFactory.MENU_POSITION_LEFT); + + menu.setName(menuName); + menu.setCategory(category); + return menu; + } + + + public static ArrayList getMenusForOrganisationType(Properties ctx) throws OperationException + { + + // Creating the menus first. +// MenuFactory factory = MenuFactory.getFactoryInstance(ctx); + + ArrayList menuList = new ArrayList(); + + String sqlStatement = ""; + + sqlStatement = "select * " + + "from U_WEBMENU m where " + //m.AD_Client_ID = " + adClientId + + " m.AD_CLIENT_ID=0"+ + " and m.AD_ORG_ID=0" + + " and m.isactive = 'Y'"; + +// sqlStatement += " and m." + OrganisationManager.getOrganisationSqlStatement(ctx); + + sqlStatement += " order by m.U_WebMenu_ID"; + + System.out.println(sqlStatement); + + PreparedStatement prepStatement = null; + ResultSet rs = null; + try + { + prepStatement = DB.prepareStatement(sqlStatement, null); + rs = prepStatement.executeQuery(); + + while(rs.next()) + { + // setting the link name to be either car / bike + //name = formatMenuName(ctx, name); + + MWebMenu menu = new MWebMenu(ctx, rs, null); + menuList.add(menu); + } + rs.close(); + + } + catch(SQLException ex) + { + throw new OperationException("Could not retrieve menu list with sql: " + sqlStatement, ex); + } + finally + { + + + DB.close(rs, prepStatement); + + rs = null; + prepStatement = null; + } + return menuList; + } + + + public static int[] getDefaultMenus(Properties ctx) throws OperationException + { + String whereClause = "AD_Client_ID=0 and AD_Org_ID=0 "; + whereClause += " and Position='TOP' and ParentMenu_ID is null"; + + int menuIds[] = MWebMenu.getAllIDs(MWebMenu.Table_Name, whereClause, null); + + if(menuIds == null) + throw new OperationException("Could not retrieve Default Menus, Where Clause: " + whereClause); + + return menuIds; + } + + public static int[] getMenuIdForOrganisation(Properties ctx) throws OperationException + { + int adClientId = Env.getAD_Client_ID(ctx); + + String whereClause = "AD_CLIENT_ID=" + adClientId; + + int menuIds[] = MWebMenu.getAllIDs(MWebMenu.Table_Name, whereClause, null); + + return menuIds; + } + + public static int[] getMenuIdForSuperUser(Properties ctx) throws OperationException + { + int adClientId = Env.getAD_Client_ID(ctx); + int adOrgId = Env.getAD_Org_ID(ctx); + + String whereClause = "AD_CLIENT_ID =" + adClientId + " and AD_ORG_ID = " + adOrgId + " and ISSUPERUSER = 'Y'"; + + int menuIds[] = MWebMenu.getAllIDs(MWebMenu.Table_Name, whereClause, null); + + return menuIds; + } + + public static ArrayList getClosableMenus(Properties ctx) throws OperationException + { + String sql = "ad_client_id=" + Env.getAD_Client_ID(ctx) + + " and isClosable='Y'"; + //+ filter; + + ArrayList menuKeyNamePairs; + + try + { + menuKeyNamePairs = MenuKeyNamePair.getData(ctx, MWebMenu.Table_Name, sql); + } + catch (SQLException e) + { + throw new OperationException(e.getMessage()); + } + + return menuKeyNamePairs; + } + + public static MenuItemBean getMenu(Properties ctx, int menuId) + { + MWebMenu menu = new MWebMenu(ctx, menuId, null); + + MenuItemBean bean = new MenuItemBean(); + bean.setDescription(menu.getDescription()); + bean.setMenuId(menu.get_ID()); + bean.setIsActive(menu.isActive()); + + return bean; + } + + public static MenuItemBean editMenu(Properties ctx, MenuItemBean bean) throws OperationException + { + MWebMenu menu = new MWebMenu(ctx, bean.getMenuId(), null); + menu.setDescription(bean.getDescription()); + menu.setIsActive(bean.getIsActive()); + PoManager.save(menu); + + bean.setName(menu.getName()); + + return bean; + } + + public static int[] getMenus(Properties ctx,String module) + { + int ad_client_id = Env.getAD_Client_ID(ctx); + int ad_org_id = Env.getAD_Org_ID(ctx); + + String whereClause = " and ad_client_id = "+ ad_client_id + + " and ad_org_id = "+ ad_org_id +" and isactive = 'Y'"; + + return MWebMenu.getAllIDs(MWebMenu.Table_Name,whereClause,null); + } + + + public static boolean getRoleMenuAccess(Properties ctx,String role) throws OperationException + { + int id = POSMenuFactory.getFactoryInstance(ctx).get(ctx,role).get_ID(); + + String sql="select AD_ROLE_ID from U_ROLEMENU where U_WEBMENU_ID="+id; + boolean access=false; + int currentRoleId=Env.getAD_Role_ID(ctx); + ResultSet rs = null; + PreparedStatement pstmt = DB.prepareStatement(sql,null); + try + { + rs = pstmt.executeQuery(); + + while(rs.next()) + { + if(rs.getInt(1)==currentRoleId) + { + access=true; + break; + } + + } + + rs.close(); + } + catch (SQLException e) + { + throw new OperationException(e); + } + finally + { + DB.close(rs, pstmt); + rs = null; + pstmt = null; + } + + return access; + } + + public static int getMenuId(Properties ctx, String key) throws SystemException, OperationException + { + + String sqlStatement = "select u_webmenu_id from u_webmenu where lower(name)='" + key.toLowerCase() + "'"; + int menu_id = 0; + + PreparedStatement prepStatement = null; + try + { + prepStatement = DB.prepareStatement(sqlStatement, null); + ResultSet rs = prepStatement.executeQuery(); + + + if(rs.next()) + { + menu_id = rs.getInt(1); + } + rs.close(); + + } + catch(SQLException ex) + { + throw new SystemException(ex.getMessage()); + } + finally + { + try + { + prepStatement.close(); + } + catch(Exception e) + { + } + prepStatement = null; + } + return menu_id; + } + + public static String getMainMenus(Properties ctx, HttpServletRequest request) + { + ArrayList mainMenuList = (ArrayList) request.getSession().getAttribute(Constants.TOP_MENUS); + String mainMenu = ""; + Integer menuId = 0; + String styleClass = ""; + int count = 0; + + //Check which main menu link has been clicked so as to set style + if(request.getParameter("menuId") != null) + { + menuId = Integer.valueOf(request.getParameter("menuId")); + } + + if(mainMenuList != null) + { + Iterator itr = mainMenuList.iterator(); + StringWriter sw = new StringWriter(); + PrintWriter out = new PrintWriter(sw); + ElementBean elementBean = null; + + while(itr.hasNext()) + { + MenuItem menuItem = (MenuItem) itr.next(); + elementBean = ElementManager.getMsg(ctx, menuItem.getName()); + + if(menuId.compareTo(menuItem.getMenuId()) == 0 || (menuId == 0 && count == 0)) + { + styleClass = "currentpage"; + } + else + { + styleClass = ""; + } + + out.print(""); + + count ++; + } + + out.flush(); + + mainMenu = sw.toString(); + request.getSession().setAttribute(Constants.MAIN_MENUS, mainMenu); + + } + + return mainMenu; + } + + /** + * Rewrite all the URLs. Adds session id if not present + * @param menuList + * @param request + */ + public static void rewriteMenuURL(ArrayList menuList, HttpServletRequest request) + { + HttpSession session = request.getSession(); + String sessionID = session.getId(); + + for(MWebMenu menu : menuList) + { + String link = menu.getMenuLink(); + + int index = link.indexOf("?"); + if(index != -1) + { + String part1 = link.substring(0, index); + String part2 = link.substring(index); + + link = part1 + ";jsessionid=" + sessionID + part2; + + menu.setMenuLink(link); + } + } + } + + + public static Boolean isCashSalesAllowed(Properties ctx, int roleId) throws Exception + { + boolean isCashSalesAllowed = false; + ArrayList roleMenus = getMenus(ctx, roleId); + + if(roleMenus != null) + { + Iterator itr = roleMenus.iterator(); + + while(itr.hasNext()) + { + MWebMenu webMenu = (MWebMenu) itr.next(); + + if(webMenu.getName().equalsIgnoreCase("smenu.cash.sales")) + { + isCashSalesAllowed = true; + } + } + } + return isCashSalesAllowed; + } +} + + diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/MinOutManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/MinOutManager.java new file mode 100644 index 0000000000..3a251369e4 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/businesslogic/MinOutManager.java @@ -0,0 +1,777 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 08-Jul-2005 by alok + * + */ +package org.posterita.businesslogic; + +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.Properties; + +import org.compiere.model.MBPartner; +import org.compiere.model.MBPartnerLocation; +import org.compiere.model.MDocType; +import org.compiere.model.MInOut; +import org.compiere.model.MInOutConfirm; +import org.compiere.model.MInOutLine; +import org.compiere.model.MInOutLineConfirm; +import org.compiere.model.MInvoice; +import org.compiere.model.MInvoiceLine; +import org.compiere.model.MLocation; +import org.compiere.model.MLocator; +import org.compiere.model.MOrder; +import org.compiere.model.MOrderLine; +import org.compiere.model.MOrg; +import org.compiere.model.MProduct; +import org.compiere.model.MWarehouse; +import org.compiere.print.ReportEngine; +import org.compiere.process.DocumentEngine; +import org.compiere.util.DB; +import org.compiere.util.Env; +import org.posterita.Constants; +import org.posterita.beans.ChangeDocumentStatusBean; +import org.posterita.beans.CommandBean; +import org.posterita.beans.InOutHistoryBean; +import org.posterita.beans.WebDocumentBean; +import org.posterita.beans.WebDocumentHeaderBean; +import org.posterita.beans.WebMinOutLineBean; +import org.posterita.core.JulianDate; +import org.posterita.core.UDIMap; +import org.posterita.exceptions.DataException; +import org.posterita.exceptions.OperationException; +import org.posterita.exceptions.ShipmentAlreadyExistsException; +import org.posterita.exceptions.TrackingNumberNotfoundException; +import org.posterita.util.PoManager; + +public class MinOutManager extends AbstractDocumentManager +{ + private static final String SHIPMENT_MADE = "Shipment Made"; + + //TODO pass warehouseId in list of arguments + public static MInOut createShipmentFromInvoice(Properties ctx,MInvoice invoice) throws OperationException + { + + + int SOId = invoice.getC_Order_ID(); + + MOrder order = new MOrder(ctx,SOId,invoice.get_TrxName()); + + MInvoiceLine[] lines = invoice.getLines(); + int []orderLineIds = new int[lines.length]; + for(int i=0;i list = new ArrayList(); + ResultSet rs = null; + + try + { + rs = pstmt.executeQuery(); + + while(rs.next()) + { + bean = new InOutHistoryBean(); + bean.setInOutId(Integer.valueOf(rs.getInt(1))); + bean.setDocumentNo(rs.getString(2)); + bean.setDocStatus(UDIMap.docStatusMap.get(rs.getString(3))); + bean.setDocStatusCode(rs.getString(3)); + bean.setOrderId(Integer.valueOf(rs.getInt(4))); + bean.setDateOrdered(rs.getTimestamp(5)); + bean.setDateMovement(rs.getTimestamp(6)); + bean.setWarehouseId(Integer.valueOf(rs.getInt(7))); + bean.setPoReference(rs.getString(8)); + bean.setInvoiceId(Integer.valueOf(rs.getInt(9))); + bean.setRefInOutId(Integer.valueOf(rs.getInt(10))); + bean.setPartnerName(rs.getString(11)); + bean.setPartnerId(Integer.valueOf(rs.getString(12))); + list.add(bean); + } + + rs.close(); + } + catch (SQLException e) + { + throw e; + } + finally + { + try + { + pstmt.close(); + } + catch(Exception e) + {} + + pstmt = null; + } + + + return list; + } + + public static ArrayList getShipmentHistory(Properties ctx, String docStatus, Integer partnerId, Integer month, Integer year) throws SQLException + { + return getInOutHistory(ctx,"Y",docStatus,partnerId,month,year); + } + + public static ArrayList getReceiptHistory(Properties ctx, String docStatus, Integer partnerId, Integer month, Integer year) throws SQLException + { + return getInOutHistory(ctx,"N",docStatus,partnerId,month,year); + } + + public static WebDocumentBean getWebMinOutBean(Properties ctx, MInOut minOut) throws OperationException, DataException + { + if (minOut == null) + throw new OperationException("Invalid operation shipment/receipt is null"); + + if (minOut.get_ID() == 0) + throw new OperationException("You have deleted this shipment/receipt. You cannot view this shipment/receipt."); + + WebDocumentBean bean = new WebDocumentBean(); + + bean.setMinOutId(Integer.valueOf(minOut.get_ID())); + + MOrg myOrg = OrganisationManager.getMyOrg(ctx); + MBPartner me = new MBPartner(ctx, myOrg.getLinkedC_BPartner_ID(null), null); + bean.setMe(me); + + //Me Location--------------- + MBPartnerLocation meLocation[] = MBPartnerLocation.getForBPartner(ctx,me.get_ID()); + if (meLocation.length ==0) + throw new OperationException("No location has been set for your organisation. Please ask your administrator to set one for you"); + + MLocation location = new MLocation(ctx, meLocation[0].getC_Location_ID(), null); + + bean.setMeLocation(location); + + //End----------------- + + MBPartner you = new MBPartner(ctx, minOut.getC_BPartner_ID(), null); + bean.setYou(you); + + + //You Location------------ + MBPartnerLocation youBPLocation[] = MBPartnerLocation.getForBPartner(ctx, you.get_ID()); + + if (youBPLocation.length ==0) + throw new OperationException("No location has been set for the dealer organisation. Please ask your administrator to set one for you"); + + MLocation youLocation = new MLocation(ctx, youBPLocation[0].getC_Location_ID(), null); + + bean.setYoubpLocation(youBPLocation[0]); + bean.setYouLocation(youLocation); + + bean.setLines(getWebMinOutLines(ctx, minOut)); + + WebDocumentHeaderBean headerBean = createWebDocumentHeader(ctx, minOut.getAD_Org_ID(),minOut.getC_BPartner_ID(), minOut.getDocStatus(), minOut.isSOTrx(),null); + headerBean.setDocumentHeader(getDocumentHeader(minOut)); + + MDocType doctype = new MDocType(ctx, minOut.getC_DocType_ID(), null); + headerBean.setDocumentTitle(doctype.getName()); + bean.setHeaderBean(headerBean); + + bean.setMinOut(minOut); + + + MInvoice invoice = new MInvoice(ctx, minOut.getC_Invoice_ID(), null); + bean.setInvoice(invoice); + + CommandBean cmdBean = getShipmenttWebCommands(minOut); + + bean.setSimpleCommand(cmdBean.getSimpleCommand()); + bean.setComplexCommand(cmdBean.getComplexCommand()); + + return bean; + } + + public static String getDocumentHeader(MInOut minOut) + { + if (minOut.isSOTrx()) + return SHIPMENT_MADE; + + return SHIPMENT_MADE; + } + + public static ArrayList getMinOutLines(Properties ctx, MInOut inOut) throws OperationException + { + MInOutLine lines[] = inOut.getLines(); + + MInOutLine line; + WebMinOutLineBean inOutLine; + MProduct product; + ArrayList inOutLines = new ArrayList(); + for (int i = 0; i < lines.length; i++) + { + line = lines[i]; + inOutLine = new WebMinOutLineBean(); + product = new MProduct(ctx, line.getM_Product_ID(), null); + inOutLine.setAttributeValuesPair(AttributeValuesManager.retrieveAttributeValues(ctx, product.getM_AttributeSetInstance_ID())); + inOutLine.setSerno(getSerno(ctx,line.getM_AttributeSetInstance_ID())); + inOutLine.setQtyOrdered(line.getMovementQty()); + inOutLines.add(inOutLine); + } + + return inOutLines; + } + + public static ArrayList getWebMinOutLines(Properties ctx, MInOut inOut) throws OperationException + { + MInOutLine lines[] = inOut.getLines(); + + MInOutLine line; + WebMinOutLineBean inOutLine; + MProduct product; + ArrayList inOutLines = new ArrayList(); + for (int i = 0; i < lines.length; i++) + { + line = lines[i]; + + if (line.getM_Product_ID() != 0) + { + inOutLine = new WebMinOutLineBean(); + product = new MProduct(ctx, line.getM_Product_ID(), null); + inOutLine.setProductName(product.getName().replaceAll("~"," ")); + inOutLine.setDescription(product.getDescription()); + inOutLine.setQtyOrdered(line.getQtyEntered()); + + inOutLines.add(inOutLine); + } + } + + return inOutLines; + } + + //get receipt from shipment + public static MInOut getCounterDoc(Properties ctx, int shipmentId, String trxName) + { + MInOut shipment = new MInOut(ctx,shipmentId, trxName); + + if ((shipment == null)||(shipment.get_ID() == 0)) + throw new RuntimeException("no counter document found for shipment----" + shipment.get_ID()); + + if (!shipment.getDocStatus().equals(DocumentEngine.STATUS_Completed)) + throw new RuntimeException("cannot get counter document of shipment which is not completed"); + + + MInOut receipt = new MInOut(ctx, shipment.getRef_InOut_ID(), trxName); + + if ((receipt == null) ||(receipt.get_ID() == 0)) + throw new RuntimeException("no receipt found for shipment"); + + return receipt; + } + + public static MInOut getInitialDoc(Properties ctx, int shipmentId, String trxName) + { + String sql = " AD_Client_ID=" + Env.getAD_Client_ID(ctx) + " and AD_Org_ID=" + Env.getAD_Org_ID(ctx) + " and Ref_InOut_ID=" + shipmentId; + + int minoutIds[] = MInOut.getAllIDs(MInOut.Table_Name, sql, trxName); + + if(minoutIds.length == 0) + throw new RuntimeException("Original shipment doc could not be found!"); + MInOut origInOut = new MInOut(ctx, minoutIds[0], trxName); + + return origInOut; + } + + public static boolean isShipped(Properties ctx, MInvoice invoice) throws OperationException + { + int minOutIds[] = MInOut.getAllIDs(MInOut.Table_Name, " ad_client_id=" + Env.getAD_Client_ID(ctx) + " and c_invoice_id=" + invoice.get_ID(), null); + + if (minOutIds.length == 0) + return false; + + if (minOutIds.length > 1) + throw new OperationException("More than 1 shipment found for invoice " + invoice.get_ID()); + + MInOut minout = new MInOut(ctx, minOutIds[0], null); + + if (!minout.getDocStatus().equals(DocumentEngine.STATUS_Completed)) + return false; + + int refInoutId = minout.getRef_InOut_ID(); + + if (refInoutId == 0) + return false; + + MInOut refInOut = new MInOut(ctx, refInoutId, null); + + if (!refInOut.getDocStatus().equals(DocumentEngine.STATUS_Completed)) + return false; + + return true; + } + + private static CommandBean getShipmenttWebCommands(MInOut inOut) throws OperationException, DataException + { + + String[] simpleCommands = null; + String[] complexCommands = null; + + CommandBean bean = new CommandBean(); + + if (inOut.getDocStatus().equals(DocumentEngine.STATUS_Drafted)) + { + simpleCommands = new String[]{Constants.MINOUT_ACTION_COMPLETE}; + complexCommands =new String[]{Constants.MINOUT_ACTION_CANCEL}; + } + + if (inOut.getDocStatus().equals(DocumentEngine.STATUS_Voided)) + { + complexCommands = new String[]{Constants.MINOUT_ACTION_DELETE}; + } + + + + bean.setSimpleCommand(simpleCommands); + bean.setComplexCommand(complexCommands); + return bean; + } + + public static WebDocumentBean changeMinOutStatus(Properties ctx, MInOut minOut, ChangeDocumentStatusBean bean) throws OperationException, DataException + { + WebDocumentBean webBean = new WebDocumentBean(); + + if(bean.getTrackingNo()==null) + throw new TrackingNumberNotfoundException("Please specify the FexdEx Tracking Number"); + + String submit = bean.getSubmit(); + + if (minOut == null) + { + throw new OperationException("Cannot change the status on an Shipment that does not exist anymore."); + } + + if (submit.equals(Constants.MINOUT_ACTION_COMPLETE)) + { + minOut.setTrackingNo(bean.getTrackingNo()); + PoManager.save(minOut); + minOut = MinOutManager.completeShipment(ctx,minOut); + } + + if (submit.equals(Constants.MINOUT_ACTION_CANCEL)) + { + minOut = forceVoid(ctx, minOut); + } + + if (submit.equals(Constants.MINOUT_ACTION_DELETE)) + { + minOut = deleteInOut(ctx, minOut); + } + + + webBean= MinOutManager.getWebMinOutBean(ctx,minOut); + + return webBean; + } + + + private static MInOut forceVoid(Properties ctx, MInOut inout) throws OperationException + { + PreparedStatement pstmt1 = null; + PreparedStatement pstmt2 = null; + + String sql = "update M_INOUT set DOCSTATUS=" + "'" + + DocumentEngine.STATUS_Voided + "'" + + " where AD_CLIENT_ID=" + Env.getAD_Client_ID(ctx) + + " and M_INOUT_ID=" + inout.get_ID(); + + String sql2 = "update M_INOUT set DOCACTION=" + "'" + + DocumentEngine.ACTION_None + "'" + + " where AD_CLIENT_ID=" + Env.getAD_Client_ID(ctx) + + " and M_INOUT_ID=" + inout.get_ID(); + + pstmt1 = DB.prepareStatement(sql,null); + pstmt2 = DB.prepareStatement(sql2,null); + + try + { + pstmt1.executeUpdate(); + pstmt2.executeUpdate(); + } + catch (SQLException e) + { + throw new OperationException(e.getMessage()); + } + finally + { + try + { + pstmt1.close(); + pstmt2.close(); + } + catch(Exception e) + {} + + pstmt1 = null; + pstmt2 = null; + } + + return inout; + + } + + public static MInOut deleteInOut(Properties ctx, MInOut inOut) throws OperationException + { + inOut.setIsActive(false); + PoManager.save(inOut); + + return inOut; + } + + public static void printInOut(Properties ctx,MInOut inOut) throws OperationException + { + PrintManager.print(ctx,ReportEngine.SHIPMENT,inOut.get_ID()); + } + + public static MInOut loadMInOut(Properties ctx, int minoutId, String trxName) throws OperationException + { + MInOut minout = new MInOut(ctx, minoutId, trxName); + if(minout.get_ID() == 0) + throw new OperationException("Could not load invoice with id: " + minout); + + return minout; + } + + +} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/OrderManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/OrderManager.java new file mode 100644 index 0000000000..7fc44b1ab9 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/businesslogic/OrderManager.java @@ -0,0 +1,482 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Aug 8, 2006 by alok + */ + + +package org.posterita.businesslogic; + +import java.math.BigDecimal; +import java.sql.Timestamp; +import java.util.Properties; + +import org.compiere.model.MBPartner; +import org.compiere.model.MConversionRate; +import org.compiere.model.MDocType; +import org.compiere.model.MOrder; +import org.compiere.model.MOrderLine; +import org.compiere.model.MPriceList; +import org.compiere.model.MProduct; +import org.compiere.model.MTax; +import org.compiere.print.ReportEngine; +import org.compiere.process.DocAction; +import org.compiere.process.DocumentEngine; +import org.compiere.util.DB; +import org.compiere.util.Env; +import org.posterita.beans.CreditCheckBean; +import org.posterita.beans.OrderLineBean; +import org.posterita.businesslogic.administration.TaxManager; +import org.posterita.core.utils.FormatBigDecimal; +import org.posterita.exceptions.BPartnerNoLocationException; +import org.posterita.exceptions.BPartnerOverCreditLimitException; +import org.posterita.exceptions.OperationException; +import org.posterita.order.UDIOrderTypes; +import org.posterita.util.PoManager; + + +public class OrderManager +{ + + public static MOrder createOrder(Properties ctx, int bPartnerId,boolean isSotrx,int priceListId, String orderType, int warehouseId,String paymentRule,String trxName) throws OperationException + { + int terminalId = POSTerminalManager.getTerminalId(ctx); + if (terminalId == 0) + { + throw new OperationException("NO POS Terminal!!!"); + } + + MOrder order = new MOrder(ctx, 0, trxName); + MBPartner bPartner = new MBPartner(ctx, bPartnerId, trxName); + + if(bPartner.getPrimaryC_BPartner_Location_ID() == 0) + throw new BPartnerNoLocationException("Business partner has no location"); + order.setAD_Org_ID(Env.getAD_Org_ID(ctx)); + //order.setC_POS_ID(terminalId); TODO - Trifon; order.setU_POSTerminal_ID(terminalId); + order.setBPartner(bPartner); + order.setC_BPartner_ID(bPartner.get_ID()); + order.setC_BPartner_Location_ID(bPartner.getPrimaryC_BPartner_Location_ID()); + order.setIsSOTrx(isSotrx); + + order.setM_PriceList_ID(priceListId); + + MPriceList priceList = new MPriceList(ctx,priceListId,null); + order.setC_Currency_ID(priceList.getC_Currency_ID()); + order.setDocAction(DocumentEngine.ACTION_Complete); + order.setSalesRep_ID(Env.getAD_User_ID(ctx)); + + if(orderType.equalsIgnoreCase(UDIOrderTypes.CREDIT_ORDER_NO_SHIPMENT.getOrderType())) + { + /**because for credit orders, compiere generates shipment + * automatically, so we want a credit order with standard doc type*/ + + order.setC_DocTypeTarget_ID(getDocTypeFromOrderType(ctx, UDIOrderTypes.POS_ORDER.getOrderType(), isSotrx)); + order.setOrderType(UDIOrderTypes.CREDIT_ORDER.getOrderType()); + } + else + { + order.setC_DocTypeTarget_ID(getDocTypeFromOrderType(ctx, orderType, isSotrx)); + order.setOrderType(orderType); + } + + order.setM_Warehouse_ID(warehouseId); + order.setIsDiscountPrinted(true); + if(paymentRule != null) + order.setPaymentRule(paymentRule); + + order.setDateOrdered(new Timestamp(System.currentTimeMillis())); + order.setInvoiceRule(MOrder.INVOICERULE_Immediate); + + PoManager.save(order); + + return order; + } + + public static MOrderLine createOrderLine(Properties ctx,MOrder order,int productId, BigDecimal qty, BigDecimal discount, BigDecimal lineNet) throws OperationException + { + if(qty == null) + { + qty = Env.ONE; + } + + MOrderLine orderLine = new MOrderLine(order); + + MProduct product = new MProduct(ctx,productId, order.get_TrxName()); + MTax tax = TaxManager.getTaxFromCategory(ctx, product.getC_TaxCategory_ID(), order.get_TrxName()); + orderLine.setC_Tax_ID(tax.get_ID()); + orderLine.setC_UOM_ID(product.getC_UOM_ID()); + orderLine.setC_BPartner_ID(order.getC_BPartner_ID()); + // Must set Product Id before quantity Ordered. + orderLine.setM_Product_ID(productId); + orderLine.setQty(qty); + orderLine.setPrice(); + + //Bug fix, set price to 2dp + MPriceList orderPriceList = MPriceList.get(ctx, order.getM_PriceList_ID(), order.get_TrxName()); + + if (!orderPriceList.isTaxIncluded()) + { + BigDecimal taxAmt = tax.calculateTax(lineNet, true, 12); + BigDecimal lineNetWithoutTax = lineNet.subtract(taxAmt); + orderLine.setLineNetAmt(lineNetWithoutTax); + + BigDecimal unitPriceWithoutTax = lineNetWithoutTax.divide(qty, 12, BigDecimal.ROUND_HALF_DOWN); + + orderLine.setPriceEntered(unitPriceWithoutTax.setScale (2, BigDecimal.ROUND_HALF_UP)); + orderLine.setPriceActual(unitPriceWithoutTax.setScale (2, BigDecimal.ROUND_HALF_UP)); + } + else + { + BigDecimal unitPrice = lineNet.divide(qty, 12, BigDecimal.ROUND_HALF_DOWN); + orderLine.setLineNetAmt(lineNet.setScale (2, BigDecimal.ROUND_HALF_UP)); + orderLine.setPriceEntered(unitPrice.setScale (2, BigDecimal.ROUND_HALF_UP)); + orderLine.setPriceActual(unitPrice.setScale (2, BigDecimal.ROUND_HALF_UP)); + } + + if (discount.doubleValue() != 0.0) + { + orderLine.setDiscount(); + } + + PoManager.save(orderLine); + + return orderLine; + } + + public static BigDecimal getLineTaxAmtAfterDis(BigDecimal amt,BigDecimal rate) + { + return new BigDecimal (amt.doubleValue()/(100+rate.doubleValue())*100); + } + + public static MOrder completeOrder(Properties ctx,MOrder order) throws BPartnerOverCreditLimitException,OperationException + { + if(order.isSOTrx()==true) + { + CreditCheckBean crBean = OrderManager.checkBPartnerCreditLimit(ctx,order.getC_BPartner_ID(),order.get_ID(),order.get_TrxName()); + if(crBean.getValid()==false) + throw new BPartnerOverCreditLimitException(crBean.getMsg()); + } + + PoManager.processIt(order, DocumentEngine.ACTION_Complete); + + return order; + } + + static BigDecimal calculateActualPrice(Properties ctx,BigDecimal listPrice, BigDecimal discount) throws OperationException + { + double actualPrice; + double div = (discount.doubleValue()/100)*listPrice.doubleValue(); + actualPrice=listPrice.doubleValue()-(div); + + BigDecimal formattedBigDecimal = FormatBigDecimal.currency(actualPrice); + + return formattedBigDecimal; + } + + public static int getDocTypeFromOrderType(Properties ctx,String orderType, Boolean isSotrx) throws OperationException + { + + MDocType[] docBaseTypes; + + if(orderType.equalsIgnoreCase(UDIOrderTypes.POS_ORDER.getOrderType())) + { + + return getDocTypeIDForStandardOrder(ctx); + } + + if(orderType.equalsIgnoreCase(UDIOrderTypes.CUSTOMER_RETURN_ORDER.getOrderType())) + { + return getDocTypeIDForCustomerReturnOrder(ctx,isSotrx); + } + + + if(orderType.equalsIgnoreCase(UDIOrderTypes.POS_GOODS_RETURN_NOTE.getOrderType())) + { + docBaseTypes = MDocType.getOfDocBaseType(ctx, MDocType.DOCBASETYPE_APCreditMemo); + if (docBaseTypes.length > 1) + throw new OperationException("Expected one document type for AP Credit Memo but got more than 1"); + + return docBaseTypes[0].get_ID(); + } + + + if(orderType.equalsIgnoreCase(UDIOrderTypes.POS_GOODS_RECEIVE_NOTE.getOrderType())) + { + docBaseTypes = MDocType.getOfDocBaseType(ctx, MDocType.DOCBASETYPE_PurchaseOrder); + + for(int i=0; i 1) + throw new OperationException("Expected one document type for Standard order but got more than 1"); + + return docTypes[0]; + } + + public static int getDocTypeIDForCreditOrder(Properties ctx) throws OperationException + { + int [] docTypes = MDocType.getAllIDs(MDocType.Table_Name,"AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+" and DOCSUBTYPESO='"+MDocType.DOCSUBTYPESO_OnCreditOrder+"'",null); + if (docTypes.length > 1) + throw new OperationException("Expected one document type for Credit order but got more than 1"); + + return docTypes[0]; + } + + public static int getDocTypeIDForCustomerReturnOrder(Properties ctx, Boolean isSotrx) throws OperationException + { + char sotrx = ' '; + + if (isSotrx.equals(true)) + { + sotrx = 'Y'; + } + else + { + sotrx = 'N'; + } + + int [] docTypes = MDocType.getAllIDs(MDocType.Table_Name,"AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+" and DOCSUBTYPESO='"+MDocType.DOCSUBTYPESO_ReturnMaterial+"' and isSotrx='"+sotrx+"'",null); + if (docTypes.length > 1) + throw new OperationException("Expected one document type for Return Material but got more than 1"); + + return docTypes[0]; + } + + public static int[] getAllOrderlineIDs(Properties ctx,int orderId,String trxName) + { + String whereClause = "" + + " C_ORDER_ID =" + orderId + + " AND AD_CLIENT_ID =" + Env.getAD_Client_ID(ctx) + + " AND ISACTIVE = 'Y'"; + + return MOrderLine.getAllIDs(MOrderLine.Table_Name,whereClause,trxName); + } + + /** + * Checks the order to see whether it has some orderlines + * @return true if empty else false is returned + */ + public static boolean isOrderEmpty(Properties ctx,int orderId,String trxName) + { + int[] orderlineIDs = getAllOrderlineIDs(ctx,orderId,trxName); + + if(orderlineIDs==null||orderlineIDs.length==0) + { + return true; + } + + return false; + } + + public static MOrder prepareOrder(Properties ctx,int orderId,String trxName) throws OperationException + { + MOrder order = new MOrder(ctx,orderId,trxName); + order.processIt(DocumentEngine.ACTION_Prepare); + return order; + } + + public static MOrder loadOrder(Properties ctx, int orderId, String trxName) throws OperationException + { + MOrder order = new MOrder(ctx, orderId, trxName); + + if(order.get_ID() == 0) + throw new OperationException("Could not load order with id: " + orderId); + + return order; + } + + + public static void deleteDraftedOrder(Properties ctx, int orderId, String trxName) throws OperationException + { + MOrder order = loadOrder(ctx, orderId, trxName); + deleteDraftedOrder(ctx, order); + } + + + public static void deleteDraftedOrder(Properties ctx, MOrder order) throws OperationException + { + if(order.isProcessed()) + throw new OperationException("Cannot delete order that is already processed"); + + if(!order.getDocStatus().equals(DocAction.STATUS_Drafted)) + throw new OperationException("The order is not a drafted order"); + + deleteOrder(ctx, order); + } + + private static void deleteOrder(Properties ctx, MOrder order) throws OperationException + { + if(order == null) + throw new OperationException("Order cannot be null"); + + if(order.isProcessed()) + throw new OperationException("Cannot delete order that is already processed"); + + if(!order.delete(true)) + throw new OperationException("Could not delete order"); + } + + /** + * Deletes all the orderlines from the order + * @param ctx + * @param order the order + * @param trxName + * @throws OperationException + */ + public static void deleteOrderlines(Properties ctx, MOrder order, String trxName) throws OperationException + { + boolean isEmpty = OrderManager.isOrderEmpty(ctx, order.get_ID(), trxName); + + if(isEmpty) + { + return; + } + + //checks the status of the order + if(order.isProcessed()) + { + throw new OperationException("Cannot delete order that is already processed"); + } + + String sql = "delete from C_ORDERLINE where C_ORDER_ID = " + order.get_ID(); + + int no = DB.executeUpdate(sql, trxName); + + if (no == -1) + { + throw new OperationException("Could not delete order lines"); + } + + }//deleteOrderlines + + + public static void rePrintOrder(Properties ctx,int orderId) throws OperationException + { + PrintManager.printOrder(ctx, orderId, null); + } + + public static void printOrder(Properties ctx,MOrder order) throws OperationException + { + if(order.getOrderType().equals(UDIOrderTypes.POS_ORDER.getOrderType())) + { + PrintManager.openCashDrawer(ctx); + } + PrintManager.printOrder(ctx, order.get_ID(), null); + } + + public static void printOrder(Properties ctx,MOrder order,OrderLineBean bean) throws OperationException + { + if(order.getOrderType().equals(UDIOrderTypes.POS_ORDER.getOrderType())) + { + PrintManager.openCashDrawer(ctx); + } + PrintManager.print(ctx,ReportEngine.ORDER,order.get_ID(),bean); + } + + public static CreditCheckBean checkBPartnerCreditLimit(Properties ctx,int bPartnerId,int orderId, String trxName) + { + MBPartner bp = new MBPartner(ctx,bPartnerId,trxName); + String m_processMsg=null; + + MOrder order = new MOrder(ctx,orderId,trxName); + CreditCheckBean bean= new CreditCheckBean(); + + boolean valid = true; + + if (MBPartner.SOCREDITSTATUS_CreditStop.equals(bp.getSOCreditStatus())) + { + valid = false; + + m_processMsg = "BPartnerCreditStop - TotalOpenBalance= " + + bp.getTotalOpenBalance() + + ", CreditLimit= " + bp.getSO_CreditLimit(); + } + if (MBPartner.SOCREDITSTATUS_CreditHold.equals(bp.getSOCreditStatus())) + { + valid = false; + + m_processMsg = "BPartnerCreditHold - TotalOpenBalance= " + + bp.getTotalOpenBalance() + + ", CreditLimit= " + bp.getSO_CreditLimit(); + } + + BigDecimal grandTotal = MConversionRate.convertBase(ctx, + order.getGrandTotal(),order.getC_Currency_ID(), order.getDateOrdered(), + order.getC_ConversionType_ID(), Env.getAD_Client_ID(ctx), Env.getAD_Org_ID(ctx)); + + if (MBPartner.SOCREDITSTATUS_CreditHold.equals(bp.getSOCreditStatus(grandTotal))) + { + valid = false; + + m_processMsg = "BPartnerOverCreditHold - TotalOpenBalance= " + + bp.getTotalOpenBalance() + ", GrandTotal = " + order.getGrandTotal() + + ", CreditLimit= " + bp.getSO_CreditLimit(); + } + + if (MBPartner.SOCREDITSTATUS_NoCreditCheck.equals(bp.getSOCreditStatus())) + { + valid = true; + + m_processMsg = "BPartnerCreditHold - TotalOpenBalance= " + + bp.getTotalOpenBalance() + + ", CreditLimit= " + bp.getSO_CreditLimit(); + } + + if (MBPartner.SOCREDITSTATUS_NoCreditCheck.equals(bp.getSOCreditStatus(order.getGrandTotal()))) + { + valid = true; + + m_processMsg = "BPartnerOverCreditHold - TotalOpenBalance= " + + bp.getTotalOpenBalance() + ", GrandTotal = " + order.getGrandTotal() + + ", CreditLimit= " + bp.getSO_CreditLimit(); + } + bean.setValid(valid); + bean.setMsg(m_processMsg); + return bean; + } + +} + diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/OrderReferenceManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/OrderReferenceManager.java new file mode 100644 index 0000000000..aab150597c --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/businesslogic/OrderReferenceManager.java @@ -0,0 +1,356 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 28-Jun-2005 by alok + * + */ +package org.posterita.businesslogic; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.Properties; + +import org.compiere.model.I_C_CashLine; +import org.compiere.model.MBPartner; +import org.compiere.model.MBPartnerLocation; +import org.compiere.model.MCharge; +import org.compiere.model.MCurrency; +import org.compiere.model.MInvoice; +import org.compiere.model.MLocation; +import org.compiere.model.MOrder; +import org.compiere.model.MOrderLine; +import org.compiere.model.MOrg; +import org.compiere.model.MPayment; +import org.compiere.model.MPriceList; +import org.compiere.model.MPriceListVersion; +import org.compiere.model.MProduct; +import org.compiere.model.MUser; +import org.compiere.util.Env; +import org.posterita.Constants; +import org.posterita.beans.AttributeValuesPair; +import org.posterita.beans.WebDocumentBean; +import org.posterita.beans.WebDocumentHeaderBean; +import org.posterita.beans.WebOrderLineBean; +import org.posterita.businesslogic.administration.BPartnerManager; +import org.posterita.businesslogic.administration.PriceListManager; +import org.posterita.businesslogic.administration.ProductManager; +import org.posterita.businesslogic.core.ChargeManager; +import org.posterita.exceptions.InvalidAddressException; +import org.posterita.exceptions.OperationException; +import org.posterita.order.UDIOrderTypes; + + +public class OrderReferenceManager extends AbstractDocumentManager +{ + + public static final String PURCHASE_ORDER = "Purchase Order"; + public static final String SALES_ORDER = "Sales Order"; + private static final String SO_MATERIAL_RETURN_ORDER = "Material Return Order"; + private static final String PO_MATERIAL_RETURN_ORDER = "Material Return Order"; + + + + public static WebDocumentBean getWebOrderBean(Properties ctx,MOrder order) throws InvalidAddressException,OperationException + { + if (order == null) + throw new OperationException("Invalid operation order is null"); + + if (order.get_ID() == 0) + throw new OperationException("You have deleted this order. You cannot view this order."); + + WebDocumentBean bean = new WebDocumentBean(); + + bean.setOrderId(Integer.valueOf(order.get_ID())); + bean.setDescription(order.getDescription()); + + int currencyId = order.getC_Currency_ID(); + MCurrency currency = new MCurrency(ctx,currencyId,null); + bean.setCurrencySymbole(currency.getCurSymbol()); + + + + MOrg myOrg = OrganisationManager.getMyOrg(ctx); + + MBPartner me = null; + + + me = BPartnerManager.getCreateLinkedBPartner(ctx, myOrg, null); + + MOrg orderOrg = new MOrg(ctx, order.getAD_Org_ID(), null); + + + MBPartnerLocation meLocations[] = MBPartnerLocation.getForBPartner(ctx,me.get_ID()); + + MLocation meLocation = null; + + if (meLocations.length == 0) + { + MBPartnerLocation meBPLocation = LocationManager.createDefaultBPLocation(ctx, me); + meLocation = new MLocation(ctx, meBPLocation.getC_Location_ID(), null); + } + else + meLocation = new MLocation(ctx, meLocations[0].getC_Location_ID(), null); + + MBPartner you = new MBPartner(ctx, order.getC_BPartner_ID(), null); + + MBPartnerLocation youBPLocations[] = MBPartnerLocation.getForBPartner(ctx, you.get_ID()); + MBPartnerLocation youBPLocation = null; + + if (youBPLocations.length==0) + youBPLocation = LocationManager.createDefaultBPLocation(ctx, you); + else + youBPLocation = youBPLocations[0]; + + MLocation youLocation = new MLocation(ctx, youBPLocation.getC_Location_ID(), null); + + ArrayList webOrderLines = getWebOrderLines(order); + bean.setLines(webOrderLines); + + bean = calculateOrderTotals(webOrderLines, bean); + + WebDocumentHeaderBean headerBean=null; + + + bean.setYouLocation(youLocation); + bean.setYou(you); + bean.setMeLocation(meLocation); + bean.setMe(me); + bean.setYoubpLocation(youBPLocation); + + String paymentRule=null; + if(order.getPaymentRule().equalsIgnoreCase(MOrder.PAYMENTRULE_Cash)) + paymentRule=Constants.PAYMENT_RULE_CASH; + else if + (order.getPaymentRule().equalsIgnoreCase(MOrder.PAYMENTRULE_Check)) + paymentRule=Constants.PAYMENT_RULE_CHEQUE; + else if + (order.getPaymentRule().equalsIgnoreCase(MOrder.PAYMENTRULE_CreditCard)) + paymentRule=Constants.PAYMENT_RULE_CARD; + else if + (order.getPaymentRule().equalsIgnoreCase(MOrder.PAYMENTRULE_DirectDebit)) + paymentRule=Constants.PAYMENT_RULE_CARD; + else if + (order.getPaymentRule().equalsIgnoreCase(MOrder.PAYMENTRULE_OnCredit)) + paymentRule=Constants.PAYMENT_RULE_CREDIT; + else + paymentRule=Constants.PAYMENT_RULE_MIXED; + + + headerBean = createWebDocumentHeader(ctx, order.getAD_Org_ID(),order.getC_BPartner_ID(), order.getDocStatus(), order.isSOTrx(),paymentRule); + + + + bean.setHeaderBean(headerBean); + + String isPaid = isPaid(ctx, order.getC_Order_ID(), null); + bean.setIsPaid(isPaid); + + //load the order again + order = new MOrder(ctx, order.getC_Order_ID(), null); + bean.setOrder(order); + headerBean.setDocumentHeader(getOrderHeader(order)); + + int salesRepId = order.getSalesRep_ID(); + MUser salesRep = new MUser(ctx, salesRepId, null); + bean.setSalesRep(salesRep.getName()); + + + return bean; + } + + private static String isPaid(Properties ctx, int orderId, String trxName) + { + int[] paymentIds = MPayment.getAllIDs(MPayment.Table_Name, "c_order_id=" + orderId, trxName); + + if (paymentIds.length == 0) + return Constants.NO_CHAR; + + MPayment payment = new MPayment(ctx, paymentIds[0], trxName); + + if (payment.getDocStatus().equals(MPayment.DOCSTATUS_Completed)) + return Constants.YES_CHAR; + else + return Constants.NO_CHAR; + } + + + /* + * calculates totals for tax, lines and grand total + * returns rounded figures to 2 d.p + */ + private static WebDocumentBean calculateOrderTotals(ArrayList webOrderLineList, WebDocumentBean webOrderLineBean) + { + Iterator iter = webOrderLineList.iterator(); + + WebOrderLineBean bean; + + BigDecimal totalLines = new BigDecimal(0); + BigDecimal totalTax = new BigDecimal(0); + BigDecimal grandTotal; + + BigDecimal roundedTotalLines; + BigDecimal roundedTotalTax; + BigDecimal roundedGrandTotal; + while(iter.hasNext()) + { + bean = (WebOrderLineBean) iter.next(); + BigDecimal lineNetAmt = bean.getLineNetAmt() == null?Env.ZERO:bean.getLineNetAmt(); + BigDecimal taxAmt = bean.getTaxAmt() == null? Env.ZERO:bean.getTaxAmt(); + BigDecimal discountAmt = bean.getDiscountAmt() == null?Env.ZERO:bean.getDiscountAmt(); + BigDecimal writeOffAmt = bean.getWriteOffAmt() == null?Env.ZERO:bean.getWriteOffAmt(); + totalLines = totalLines.add(lineNetAmt).subtract(discountAmt).subtract(writeOffAmt); + totalTax = totalTax.add(taxAmt); + } + + grandTotal = totalLines.add(totalTax); + + + roundedTotalLines = round(totalLines, 2); + roundedTotalTax = round(totalTax, 2); + + roundedGrandTotal = round(grandTotal, 2); + + webOrderLineBean.setTotalLines(roundedTotalLines); + webOrderLineBean.setTotalTax(roundedTotalTax); + webOrderLineBean.setGrandTotal(roundedGrandTotal); + + return webOrderLineBean; + } + + private static BigDecimal round(BigDecimal number, int decimalPlaces) + { + BigDecimal roundedNumber = number.setScale(decimalPlaces, BigDecimal.ROUND_HALF_UP); + + return roundedNumber; + } + + private static String getOrderHeader(MOrder order) throws OperationException + { + return getMaterialReturnOrderHeader(order); + } + + private static String getMaterialReturnOrderHeader(MOrder order) + { + if (order.isSOTrx()) + return SO_MATERIAL_RETURN_ORDER; + + return PO_MATERIAL_RETURN_ORDER; + } + + + + + + public static ArrayList populateOrderLines(Properties ctx, MOrderLine[] lines, MOrder order) throws OperationException + { + MOrderLine line; + MProduct product; + AttributeValuesPair attributeValuesPair; + WebOrderLineBean orderLineBean; + ArrayList orderLines = new ArrayList(); + + int priceListId = order.getM_PriceList_ID();/*Env.getContextAsInt(ctx,UdiConstants.PRICELIST_CTX_PARAM);*/ + int priceListVersionId = PriceListManager.getPriceListVersionID(ctx, priceListId, null); + + MPriceListVersion priceListVersion = new MPriceListVersion(ctx, priceListVersionId, null); + MPriceList priceList = new MPriceList(ctx, priceListVersion.getM_PriceList_ID(), null); + MCurrency currency = new MCurrency(ctx, priceList.getC_Currency_ID(), null); + + for (int i = 0; i < lines.length; i++) + { + line = lines[i]; + + product = new MProduct(ctx, line.getM_Product_ID(), null); + attributeValuesPair = AttributeValuesManager.retrieveAttributeValues(ctx, product.getM_AttributeSetInstance_ID()); + orderLineBean = new WebOrderLineBean(); + orderLineBean.setAttributeValuesPair(attributeValuesPair); + + + orderLineBean.setQtyOrdered(line.getQtyOrdered()); + orderLineBean.setPriceActual(line.getPriceActual()); + BigDecimal roundedLineNetAmount = round(line.getLineNetAmt(), 2); + orderLineBean.setLineNetAmt(roundedLineNetAmount); + + //line tax amount + if (UDIOrderTypes.WEBSTORE_ORDER.getOrderType().equals(order.getOrderType())) + { + orderLineBean.setTaxAmt(new BigDecimal(0)); + + if (line.getM_Product_ID() == 0) + { + if(line.getC_Charge_ID() != 0) + { + MCharge charge = ChargeManager.loadCharge(ctx, line.getC_Charge_ID(), null); + orderLineBean.setDescription(charge.getName()); + } + else + throw new OperationException("Unknown Order line type with id: " + line.get_ID()); + } + else + orderLineBean.setDescription(ProductManager.getProductName(ctx, line.getM_Product_ID())); + } + else + { + BigDecimal lineTaxAmount = getLineTaxAmt(line.getCtx(), line.getLineNetAmt(), line.getC_Tax_ID(), line.get_ID()); + BigDecimal roundedTaxAmount = round(lineTaxAmount, 2); + orderLineBean.setTaxAmt(roundedTaxAmount); + } + + + BigDecimal lineTotalAmount = line.getLineNetAmt().add(orderLineBean.getTaxAmt()); + BigDecimal roundedLineTotalAmount = round(lineTotalAmount, 2); + + orderLineBean.setLineTotalAmt(roundedLineTotalAmount); + + orderLineBean.setProductId(Integer.valueOf(line.getM_Product_ID())); + orderLineBean.setOrderLineId(Integer.valueOf(line.get_ID())); + orderLineBean.setIsinvoiced(Boolean.valueOf(false)); + orderLineBean.setIsQtyReserved(Boolean.valueOf(true)); + + orderLineBean.setCurrency(currency.getCurSymbol()); + + + if (line.getQtyInvoiced()!= null) + if (line.getQtyInvoiced().intValue() > 1) + orderLineBean.setIsinvoiced(Boolean.valueOf(true)); + + if(line.getQtyReserved()!=null) + if(line.getQtyReserved().equals(new BigDecimal(0))) + orderLineBean.setIsQtyReserved(Boolean.valueOf(false)); + + orderLineBean.setSerno(getSerno(ctx, line.getM_AttributeSetInstance_ID())); + + + orderLines.add(orderLineBean); + } + + return orderLines; + } + + + + public static ArrayList getWebOrderLines(MOrder order) throws OperationException + { + ArrayList orderLines = OrderReferenceManager.populateOrderLines(order.getCtx(), order.getLines(true, null), order); + + return orderLines; + } + + +} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/OrganisationManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/OrganisationManager.java new file mode 100644 index 0000000000..3cd76ef68b --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/businesslogic/OrganisationManager.java @@ -0,0 +1,609 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 21-Jun-2005 by alok + * + */ +package org.posterita.businesslogic; + +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Properties; +import java.util.StringTokenizer; +import java.util.logging.Level; + +import org.compiere.model.MAcctSchema; +import org.compiere.model.MAttachment; +import org.compiere.model.MAttachmentEntry; +import org.compiere.model.MBPartner; +import org.compiere.model.MBank; +import org.compiere.model.MBankAccount; +import org.compiere.model.MCashBook; +import org.compiere.model.MLocation; +import org.compiere.model.MOrg; +import org.compiere.model.MOrgInfo; +import org.compiere.model.MUser; +import org.compiere.model.MWarehouse; +import org.compiere.print.MPrintFormatItem; +import org.compiere.util.CLogger; +import org.compiere.util.DB; +import org.compiere.util.Env; +import org.compiere.util.KeyNamePair; +import org.posterita.Constants; +import org.posterita.beans.OrgBean; +import org.posterita.businesslogic.administration.BPartnerManager; +import org.posterita.businesslogic.administration.WarehouseManager; +import org.posterita.businesslogic.core.AccountingManager; +import org.posterita.businesslogic.core.AttachmentManager; +import org.posterita.core.CheckDuplicateEntities; +import org.posterita.core.exception.IOOperationException; +import org.posterita.core.utils.IOUtil; +import org.posterita.exceptions.LogoException; +import org.posterita.exceptions.OperationException; +import org.posterita.exceptions.OrganisationAlreadyExistsException; +import org.posterita.exceptions.WarehouseAlreadyExistsException; +import org.posterita.lib.UdiConstants; +import org.posterita.util.PoManager; + +public class OrganisationManager +{ + private static final CLogger logger = CLogger.getCLogger(OrganisationManager.class); + + public static final int COUNTRY_ID = UdiConstants.COUNTRY_MAURITIUS; + + + public static MOrg editOrganisation(Properties ctx, Integer orgId, String orgName, String description, + String address1, String address2, String city, Integer countryId, String postalAddress1, + boolean isActive, String receiptFooterMsg, String trxName) throws OperationException + { + + if(orgId==null) + { + throw new OperationException("Invalid organisation id"); + } + + MOrg mOrg = loadOrganisation(ctx, orgId.intValue(), trxName); + + if (!mOrg.getName().equals(orgName)) + { + if(CheckDuplicateEntities.checkDuplicateName(ctx,orgName,"AD_ORG")) + throw new OrganisationAlreadyExistsException("The Organisation already exists"); + } + + mOrg.setName(orgName); + mOrg.setValue(orgName); + mOrg.setIsActive(isActive); + mOrg.setDescription(description); + // mOrg.setIsVisible(isVisible); + + PoManager.save(mOrg); + + MBPartner bp = new MBPartner(ctx, mOrg.getLinkedC_BPartner_ID(trxName), trxName); + bp.setName(orgName); + bp.setValue(orgName + "_" + orgId); + + PoManager.save(bp); + + MUser user = new MUser(ctx, bp.getPrimaryAD_User_ID(), trxName); + user.setName(orgName); + user.setPassword(orgName); + PoManager.save(user); + + MOrgInfo orgInfo = mOrg.getInfo(); + MLocation location = updateOrCreateLocation(ctx, orgInfo.getC_Location_ID(), orgInfo.getAD_Org_ID(), address1, + address2, postalAddress1, city, countryId, trxName); + + orgInfo.setC_Location_ID(location.get_ID()); + orgInfo.setReceiptFooterMsg(receiptFooterMsg); + + PoManager.save(orgInfo); + orgInfo.set_TrxName(trxName); + + return mOrg; + } + + public static MOrg getMyOrg(Properties ctx) throws OperationException + { + return getMyOrg(ctx, null); + } + + + public static MOrg getMyOrg(Properties ctx, String trxName) throws OperationException + { + MOrg org = new MOrg(ctx, Env.getAD_Org_ID(ctx), trxName); + + if (org == null) + throw new OperationException("Organisation cannot be resolved"); + + return org; + } + + public static int getLinkedBusinessPartnerID(Properties ctx, int orgId) throws OperationException + { + + MOrg org = new MOrg(ctx, orgId, null); + + return org.getLinkedC_BPartner_ID(null); + + } + + + + public static OrgBean getOrganisation(Properties ctx, int orgId) throws OperationException + { + OrgBean bean = null; + + MOrg mOrg = new MOrg(ctx, orgId, null); + + MOrgInfo orgInfo = mOrg.getInfo(); + if (orgInfo != null) + { + MLocation location = MLocation.get(ctx, orgInfo.getC_Location_ID(), null); + + bean = new OrgBean(); + bean.setOrgId(Integer.valueOf(mOrg.get_ID())); + bean.setOrgName(mOrg.getName()); + bean.setCity(location.getCity()); + bean.setPostalAddress(location.getPostal_Add()); + bean.setAddress1(location.getAddress1()); + bean.setAddress2(location.getAddress2()); + bean.setRegion(location.getRegionName()); + bean.setIsActive(Boolean.valueOf(mOrg.isActive())); + bean.setReceiptFooterMsg(orgInfo.getReceiptFooterMsg()); + } + return bean; + } + + public static void deactivateOrganisation(Properties ctx, int orgId) throws OperationException + { + MOrg mOrg = new MOrg(ctx,orgId,null); + + if(mOrg==null) + throw new OperationException("Organisation does not exist"); + + mOrg.setIsActive(false); + + mOrg.save(); + + } + + public static MOrg getOrgByName(Properties ctx, String orgName, String trxName) throws OperationException + { + int orgIds[] = MOrg.getAllIDs(MOrg.Table_Name, "ad_client_id=" + Env.getAD_Client_ID(ctx) + " and name='" + orgName + "'", trxName); + + if (orgIds.length == 0) + throw new OperationException("Org not found" + orgName); + + return new MOrg(ctx, orgIds[0], trxName); + } + + + public static MOrg loadOrganisation(Properties ctx, int adOrgID, String trxName) throws OperationException + { + MOrg org = new MOrg(ctx, adOrgID, trxName); + if(org.get_ID() == 0) + throw new OperationException("Cannot load Organisation with id: " + adOrgID); + + return org; + } + + public static void uploadLogo(Properties ctx, InputStream inStream, String trxName) throws OperationException + { + byte imageData[] = IOUtil.getByteArray(inStream); + + int adClientId = Env.getAD_Client_ID(ctx); + + String imageName = UdiConstants.PRINTFORMAT_ITEM_LOGO + UdiConstants.IMAGE_EXTENSION; + String whereClause = "AD_Client_ID=" + adClientId + " and Name = '" + UdiConstants.PRINTFORMAT_ITEM_LOGO + "'"; + + int logoPrintFormatItems[] = MPrintFormatItem.getAllIDs(MPrintFormatItem.Table_Name, whereClause, trxName); + for(int i = 0; i < logoPrintFormatItems.length; i++) + { + MPrintFormatItem printFormatItem = new MPrintFormatItem(ctx, logoPrintFormatItems[i], trxName); + AttachmentManager.deleteAvailableAttachment(ctx, MPrintFormatItem.Table_ID, logoPrintFormatItems[i], trxName); + AttachmentManager.addAttachment(ctx, MPrintFormatItem.Table_ID, logoPrintFormatItems[i], imageName, imageData, trxName); + printFormatItem.setImageIsAttached(true); + PoManager.save(printFormatItem); + } + + int adOrgId = Env.getAD_Org_ID(ctx); + + MAttachment attachment = FileAttachmentManager.deleteAvailableAttachmentEntry(ctx, MOrg.Table_ID, adOrgId, imageName, null); + + //TODO Refactor + if(attachment == null) + FileAttachmentManager.addAttachment(ctx, MOrg.Table_ID, adOrgId, imageName, imageData, null); + else + FileAttachmentManager.addAttachmentEntry(ctx, attachment, imageName, imageData, null); + } + + public static byte[] getLogo(Properties ctx, String trxName) throws LogoException + { + int adOrgId = Env.getAD_Org_ID(ctx); + + MAttachment attachment = MAttachment.get(ctx, MOrg.Table_ID, adOrgId); + + if(attachment == null) + throw new LogoException("Could not load logo for Organisation with id: " + adOrgId); + + ArrayList attachmentList = AttachmentManager.getAttachmentEntriesWithPrefix(ctx, attachment, UdiConstants.PRINTFORMAT_ITEM_LOGO, trxName); + + try + { + if(attachmentList.size() == 0) + throw new LogoException("Could not load logo for Organisation with id: " + adOrgId); + else if(attachmentList.size() > 1) + throw new LogoException("Ambiguity in locating organisation logo; " + attachmentList.size() + " possible logos found for Organisation with id: " + adOrgId); + else + return IOUtil.getByteArray(attachmentList.get(0).getInputStream()); + } + catch(IOOperationException ex) + { + throw new LogoException("Could not retrieve logo for organisation with id: " + adOrgId); + } + } + + + + + //----------------------------------------------------------------------------------------------------------------- + /** + * Returns all organisations that match this organisation name or return all organisations if orgName is null. + * + * @return arraylist of organisation beans + * @param ctx ctx + * @param orgName organisation Name to load + * @param trxName transaction name + * @throws OperationException + */ + public static ArrayList getOrganisations(Properties ctx, String orgName, String trxName) throws OperationException + { + ArrayList list = new ArrayList(); + + if (orgName == null) + { + orgName = ""; + } + orgName = orgName.toUpperCase(); + String whereClause = "AD_CLIENT_ID = " + Env.getAD_Client_ID(ctx) + " AND UPPER(NAME) LIKE '%" +orgName + "%'"; + + int[] ids = MOrg.getAllIDs(MOrg.Table_Name, whereClause, trxName); + + for(int id : ids) + { + OrgBean bean = getOrganisation(ctx, id); + list.add(bean); + } + + return list; + } + + /** + * Updates or Creates organisation + * @param ctx ctx + * @param bean organisation bean + * @param trxName transaction name + * + * @return organisation + * @throws OperationException + * @throws WarehouseAlreadyExistsException + */ + public static MOrg updateOrCreateOrganisation(Properties ctx, OrgBean bean, String trxName) throws OperationException, WarehouseAlreadyExistsException + { + Integer ad_org_id = bean.getOrgId(); + MOrg org = null; + String address1 = bean.getAddress1() == null? "" : bean.getAddress1(); + String address2 = bean.getAddress2() == null? "" : bean.getAddress2(); + + if (ad_org_id == null || ad_org_id == 0) + { + + org = createOrganisation(ctx, bean.getOrgName(),bean.getDescription(),bean.getIsActive(), trxName); + + // set org location + MLocation location = LocationManager.createLocation(ctx, org.get_ID(),address1, address2, bean.getPostalAddress(), + bean.getCity(), 0, bean.getCountryId(), trxName); + + // create a linked business partner for that organisation + BPartnerManager.createLinkedBPartner(ctx, org.getAD_Org_ID(), 0, org.getName(), + "", true, true, false, false, location.getAddress1(), + location.getPostal(), location.getCity(), null, location.getC_Country_ID(), trxName); + + // create a sales representative + MBPartner salesRepBPartner = BPartnerManager.createBPartner(ctx, org.get_ID(), + org.getLinkedC_BPartner_ID(trxName), org.getName() + " Sales Rep", " ", + false, false, true, true, location.getAddress1(), location.getPostal(), location.getCity(), + " ", location.getC_Country_ID(), trxName); + MUser salesRepUser = new MUser(ctx, 0, trxName); + salesRepUser.setC_BPartner_ID(salesRepBPartner.get_ID()); + salesRepUser.setName(org.getName() + " " + "Sales Rep"); + PoManager.save(salesRepUser); + + // warehouse with default locators + String warehouseName = org.getName() + " Warehouse"; + MWarehouse warehouse = WarehouseManager.createWarehouse(ctx, org.get_ID(), warehouseName, address1, location.getPostal(), + location.getCity(), location.getC_Region_ID(), location.getC_Country_ID(), trxName); + + // web store + String hostUrl = "http://www." + org.getName() + ".com/"; + StoreManager.createStore(ctx, org.getName(), org.getName()+" pos", org.getAD_Org_ID(), + Env.getContextAsInt(ctx, UdiConstants.PRICELIST_CTX_PARAM), + salesRepUser.getAD_User_ID(), warehouse.getM_Warehouse_ID(), "pos", hostUrl, trxName); + + // load orgInfo and set details + MOrgInfo orgInfo = org.getInfo(); + orgInfo.set_TrxName(trxName); + orgInfo.setC_Location_ID(location.getC_Location_ID()); + orgInfo.setM_Warehouse_ID(warehouse.getM_Warehouse_ID()); + orgInfo.setReceiptFooterMsg(bean.getReceiptFooterMsg()); + PoManager.save(orgInfo); + + // cashbook + String cashBookName = org.getName() + " Cash Book"; + MAcctSchema[] acctSchema = MAcctSchema.getClientAcctSchema(ctx, org.getAD_Client_ID()); + int currencyId = acctSchema[0].getC_Currency_ID(); + MCashBook cashBook = CashManager.createCashBook(ctx, org.get_ID(), cashBookName, currencyId, trxName); + + MBPartner defCashBPartner = BPartnerManager.saveBPartner(ctx, org.getAD_Org_ID(), 0, org.getLinkedC_BPartner_ID(trxName), + org.getName() + " Standard Customer", " ", true, false, false, false, " ", " ", + location.getPostal(), location.getC_Region_ID(),location.getCity(), "", "", "", location.getC_Country_ID(), + true, true, trxName); + + MBank bank = new MBank(ctx, 0, trxName); + bank.setAD_Org_ID(org.getAD_Org_ID()); + bank.setName(org.getName() + " Bank"); + bank.setRoutingNo("123456789"); + bank.setC_Location_ID(orgInfo.getC_Location_ID()); + PoManager.save(bank); + + MBankAccount bankAccount = new MBankAccount(ctx, 0, trxName); + bankAccount.setAD_Org_ID(org.getAD_Org_ID()); + bankAccount.setC_Bank_ID(bank.get_ID()); + bankAccount.setBankAccountType(MBankAccount.BANKACCOUNTTYPE_Checking); + bankAccount.setC_Currency_ID(currencyId); + bankAccount.setAccountNo("123456789"); + bankAccount.setIsDefault(true); + PoManager.save(bankAccount); + + } + + else + { + org = editOrganisation(ctx, ad_org_id, bean.getOrgName(), bean.getDescription(), address1, address2, bean.getCity(), + bean.getCountryId(), bean.getPostalAddress(), bean.getIsActive(), bean.getReceiptFooterMsg(), trxName); + } + + return org; + } + + + private static MOrg createOrganisation(Properties ctx, String orgName, + String description, Boolean isActive,String trxName) throws OperationException + { + + MOrg org = new MOrg(ctx,0,trxName); + org.setName(orgName); + org.setIsActive(isActive); + org.setDescription(description); + PoManager.save(org); + + return org; + } + + public static void activateOrganisation(Properties ctx, OrgBean bean, String trxName) throws OperationException + { + int ad_org_id = bean.getOrgId(); + + MOrg org = MOrg.get(ctx, ad_org_id); + + boolean isActive = org.isActive(); + org.setIsActive(!isActive); + + PoManager.save(org); + } + + public static MLocation updateOrCreateLocation(Properties ctx,Integer locationId, Integer orgId, String address1, + String address2, String postalAddress1,String city,int countryId, String trxName) throws OperationException + { + MLocation location = new MLocation(ctx,locationId,trxName); + location.setAD_Org_ID(orgId); + location.setAddress1(address1); + location.setAddress2(address2); + location.setCity(city); + location.setPostal_Add(postalAddress1); + location.setC_Country_ID(countryId); + PoManager.save(location); + + return location; + } + public static ArrayList getAllOrgPairs(Properties ctx, String trxName) + { + ArrayList pairList = new ArrayList(); + + int clientId = Env.getAD_Client_ID(ctx); + + int[] orgIds = MOrg.getAllIDs(MOrg.Table_Name, "ad_client_id=" + clientId, trxName); + + for (int i = 0; i < orgIds.length; i++) + { + MOrg org = MOrg.get(ctx, orgIds[i]); + KeyNamePair pair = org.getKeyNamePair(); + pairList.add(pair); + } + + return pairList; + } + + public static ArrayList getUserOrgPairs(Properties ctx) + { + return getUserOrgPairs(ctx, true); + } + + public static ArrayList getUserOrgPairs(Properties ctx, boolean viewStarOrg) + { + ArrayList pairList = new ArrayList(); + + String userOrg = Env.getContext(ctx, UdiConstants.ROLE_EDITABLE_ORGS_CTX_PARAM); + + StringTokenizer token = new StringTokenizer(userOrg, ","); + + while (token.hasMoreTokens()) + { + String orgStrId = token.nextToken(); + int orgId = Integer.parseInt(orgStrId); + + if (orgId == 0) + { + if (viewStarOrg) + { + KeyNamePair allOrgPair = new KeyNamePair(0, Constants.ALL_ORGANISATIONS); + pairList.add(allOrgPair); + } + + } + else + { + MOrg org = MOrg.get(ctx, orgId); + pairList.add(org.getKeyNamePair()); + } + + } + + return pairList; + } + + + public static int[] getUserViewableOrganisations(Properties ctx) + { + int defaultOrganisations[] = new int[] {Env.getAD_Org_ID(ctx)}; + String viewableOrganisations = Env.getContext(ctx, UdiConstants.ROLE_VIEWABLE_ORGS_CTX_PARAM); + + if (viewableOrganisations == null || viewableOrganisations.trim().length() == 0) + { + return defaultOrganisations; + } + + ArrayList orgList = new ArrayList(); + + try + { + StringTokenizer tokenizer = new StringTokenizer(viewableOrganisations, ","); + while (tokenizer.hasMoreTokens()) + { + String org = tokenizer.nextToken(); + orgList.add(Integer.parseInt(org.trim())); + } + } + catch (Exception ex) + { + logger.log(Level.SEVERE, "Could not retrieve organisations, cause: " + ex.getMessage(), ex); + } + + if (orgList.size() > 0) + { + int organisations[] = new int[orgList.size()]; + System.arraycopy(orgList.toArray(), 0, organisations, 0, orgList.size()); + return organisations; + } + + return defaultOrganisations; + } + + + public static int getCreateTransferBankAccount(Properties ctx, int adOrgId, int currencyId, String trxName) throws OperationException + { + String sqlStmt = "SELECT C_BankAccount_ID FROM C_BankAccount ba " + + "INNER JOIN C_Bank b ON ba.C_Bank_ID=b.C_Bank_ID " + + "INNER JOIN AD_OrgInfo oi ON b.C_Bank_ID=oi.TransferBank_ID " + + "WHERE oi.AD_Org_ID=? AND ba.C_Currency_ID=? "; + + int bankAccountId = DB.getSQLValue(trxName, sqlStmt, adOrgId, currencyId); + + if (bankAccountId != -1) + { + return bankAccountId; + } + + MOrgInfo orgInfo = MOrgInfo.get(ctx, adOrgId); + int bankId = orgInfo.getTransferBank_ID(); + + if (bankId <= 0) + { + MBank bank = new MBank(ctx, 0, trxName); + bank.setName("BANK ACCOUNT FOR TRANSFERS"); + bank.setDescription("** DO NOT USE **"); + bank.setRoutingNo("NOT USED"); + bank.setC_Location_ID(orgInfo.getC_Location_ID()); + bank.setIsOwnBank(true); + + PoManager.save(bank); + bankId = bank.get_ID(); + + orgInfo.set_TrxName(trxName); + orgInfo.setTransferBank_ID(bankId); + PoManager.save(orgInfo); + } + + MBankAccount bankAccount = new MBankAccount(ctx, 0, trxName); + bankAccount.setC_Bank_ID(bankId); + bankAccount.setBankAccountType(MBankAccount.BANKACCOUNTTYPE_Checking); // TODO Should consider to create a new type + bankAccount.setAccountNo("NOT USED"); + bankAccount.setC_Currency_ID(currencyId); + bankAccount.setIsDefault(false); + bankAccount.setCurrentBalance(Env.ZERO); + PoManager.save(bankAccount); + + return bankAccount.get_ID(); + } + + + public static int getCreateTransferCashBook(Properties ctx, int adOrgId, int currencyId, String trxName) throws OperationException + { + MOrgInfo orgInfo = MOrgInfo.get(ctx, adOrgId); + + if (orgInfo.getTransferCashBook_ID() > 0) + { + return orgInfo.getTransferCashBook_ID(); + } + + MCashBook cashBook = new MCashBook(ctx, 0, trxName); + cashBook.setAD_Org_ID(adOrgId); + cashBook.setName("CASH BOOK FOR TRANSFERS"); + cashBook.setDescription("** DO NOT USE **"); + cashBook.setC_Currency_ID(currencyId); + PoManager.save(cashBook); + + int dummyCashElementValue = AccountingManager.getCreateDummyCashElement(ctx, trxName); + + // No model defined for cashbook accounting + StringBuffer updateStmt = new StringBuffer(); + + updateStmt.append("UPDATE C_CashBook_Acct SET CB_Asset_Acct="); + updateStmt.append(dummyCashElementValue); + updateStmt.append(" WHERE C_CashBook_ID="); + updateStmt.append(cashBook.get_ID()); + + int updated = DB.executeUpdate(updateStmt.toString(), trxName); + if (updated <= 0) + { + throw new OperationException("Could not update cash book accounting"); + } + + return cashBook.get_ID(); + } +} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/POSBpartnerInfoManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/POSBpartnerInfoManager.java new file mode 100644 index 0000000000..d493679f00 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/businesslogic/POSBpartnerInfoManager.java @@ -0,0 +1,317 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Jul 26, 2006 by alok + */ + +package org.posterita.businesslogic; + +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.Properties; + +import org.compiere.model.MBPartner; +import org.compiere.util.DB; +import org.compiere.util.Env; + +import org.posterita.Constants; +import org.posterita.beans.BPartnerInfoBean; +import org.posterita.beans.POSHistoryBean; +import org.posterita.exceptions.OperationException; +import org.posterita.lib.UdiConstants; + +public class POSBpartnerInfoManager { + + public static ArrayList getPartnerInfo(Properties ctx, + boolean isCustomer) throws OperationException { + return getPartnerInfo(ctx, 0, null, isCustomer); + } + + public static ArrayList getPartnerInfo(Properties ctx, + String partnerName, boolean isCustomer) throws OperationException { + return getPartnerInfo(ctx, 0, partnerName, isCustomer); + } + + public static ArrayList getPartnerInfo(Properties ctx, + int bPartnerId, boolean isCustomer) throws OperationException { + return getPartnerInfo(ctx, bPartnerId, null, isCustomer); + } + + public static ArrayList getPartnerInfo(Properties ctx, + int bPartnerId, String partnerName, boolean isCustomer) + throws OperationException { + String sql = "select bp.c_bpartner_id," + + // 1 + "bp.name," + + // 2 //"bp.name||' ' ||bp.name2," + //2 + "loc.address1," + + // 3 + "loc.address2," + + // 4 + "loc.city," + + // 5 + "bploc.phone," + + // 6 + "bploc.phone2," + + // 7 + "bploc.fax," + + // 8 + "bp.TOTALOPENBALANCE," + + // 9 + "bp.SO_CREDITUSED," + + // 10 + "bp.SO_CREDITLIMIT," + + // 11 + "bp.ACTUALLIFETIMEVALUE," + + // 12 + "bp.C_Dunning_id," + + // 13 + "bp.FIRSTSALE, " + + // 14 + //"DECODE(bp.SOCREDITSTATUS,'" + "CASE WHEN bp.SOCREDITSTATUS='" + + MBPartner.SOCREDITSTATUS_CreditHold + //+ "','" + + "' THEN '" + + Constants.CREDIT_HOLD + //+ "'," + //+ "'" + + "' WHEN bp.SOCREDITSTATUS='" + + MBPartner.SOCREDITSTATUS_CreditStop + //+ "','" + + "' THEN '" + + Constants.CREDIT_STOP + //+ "'," + + "' WHEN bp.SOCREDITSTATUS='" + + MBPartner.SOCREDITSTATUS_NoCreditCheck + //+ "','" + + "' THEN '" + + Constants.NO_CREDIT_CHECK + //+ "'," + + "' WHEN bp.SOCREDITSTATUS='" + //+ "'" + + MBPartner.SOCREDITSTATUS_CreditOK + //+ "','" + + "' THEN '" + + Constants.CREDIT_OK + //+ "'," + + "' WHEN bp.SOCREDITSTATUS='" + //+ "'" + + MBPartner.SOCREDITSTATUS_CreditWatch + //+ "','" + + "' THEN '" + + Constants.CREDIT_WATCH + //+ "',bp.SOCREDITSTATUS) creditStatus" + + "' ELSE bp.SOCREDITSTATUS END AS creditStatus" + + // 15 + " from C_BPARTNER bp left join (C_BPARTNER_LOCATION bploc left join C_LOCATION loc on bploc.c_location_id=loc.c_location_id)" + + " on bp.C_BPARTNER_ID=bploc.C_BPARTNER_ID" + + " where bp.AD_ORG_ID in (" + + Env.getContext(ctx, UdiConstants.ROLE_EDITABLE_ORGS_CTX_PARAM) + ")" + + " and bp.AD_CLIENT_ID=" + Env.getAD_Client_ID(ctx); + + if (isCustomer) + sql = sql + " and bp.ISCUSTOMER='Y' "; + + else + sql = sql + " and bp.ISVENDOR='Y' "; + + if (bPartnerId != 0) + sql = sql + " and bp.c_bpartner_id=" + bPartnerId; + + if (partnerName != null) + // sql=sql+" and lower(bp.name||' ' ||"+ "bp.name2) like + // lower('%"+partnerName+"%')"; + sql = sql + " and lower(bp.name) like lower('%" + partnerName + + "%')"; + + BPartnerInfoBean bean = null; + + ArrayList list = new ArrayList(); + + PreparedStatement pstmt = DB.prepareStatement(sql, null); + ResultSet rs = null; + + try { + rs = pstmt.executeQuery(); + while (rs.next()) + + { + bean = new BPartnerInfoBean(); + bean.setBpartnerId(rs.getInt(1)); + bean.setPartnerName(rs.getString(2)); + bean.setAddress1(rs.getString(3)); + bean.setAddress2(rs.getString(4)); + bean.setCity(rs.getString(5)); + bean.setPhone(rs.getString(6)); + bean.setPhone2(rs.getString(7)); + bean.setFax(rs.getString(8)); + bean.setIsCustomer(isCustomer); + bean.setOpenAmt(rs.getBigDecimal(9)); + bean.setCreditUsed(rs.getBigDecimal(10)); + bean.setCreditLimit(rs.getBigDecimal(11)); + bean.setRevenue(rs.getBigDecimal(12)); + bean.setDunningId(rs.getInt(13)); + bean.setBpfirstSale(rs.getString(14)); + bean.setSoCreditStatus(rs.getString(15)); + list.add(bean); + } + + rs.close(); + } catch (SQLException e) { + throw new OperationException(e); + } finally { + try { + + pstmt.close(); + } catch (Exception e) { + } + + pstmt = null; + } + + return list; + + } + + public static ArrayList getbPartnerTrxDetails( + Properties ctx, int bPartnerId, boolean isCustomer) + throws OperationException { + + String sql = "select pr.name," + // 1 + " acc.M_PRODUCT_ID," + // 2 + "sum(-acc.qty)," + "sum(acc.AMTACCTCR-acc.AMTACCTDR) as amt" + // 4 + " from FACT_ACCT acc,m_product pr" + + " where acc.M_product_id=pr.m_product_id" + + " and acc.C_BPARTNER_ID=" + bPartnerId + + " and acc.ad_CLIENT_ID=" + Env.getAD_Client_ID(ctx) + + " and acc.ACCOUNT_ID ="; + + if (isCustomer) + sql = sql + + "(select C_ELEMENTVALUE_ID from c_elementvalue where VALUE='41000' and AD_CLIENT_ID=" + + Env.getAD_Client_ID(ctx) + ")"; + else + sql = sql + + "(select C_ELEMENTVALUE_ID from c_elementvalue where VALUE='21100' and AD_CLIENT_ID=" + + Env.getAD_Client_ID(ctx) + ")"; + + sql = sql + " group by pr.name,acc.M_PRODUCT_ID"; + + BPartnerInfoBean bean = null; + + ArrayList list = new ArrayList(); + + PreparedStatement pstmt = DB.prepareStatement(sql, null); + ResultSet rs = null; + + try { + rs = pstmt.executeQuery(); + while (rs.next()) + + { + bean = new BPartnerInfoBean(); + bean.setProductName(rs.getString(1)); + bean.setProductId(rs.getInt(2)); + bean.setQuantity(rs.getBigDecimal(3)); + bean.setAmount(rs.getBigDecimal(4)); + list.add(bean); + } + + rs.close(); + } catch (SQLException e) { + throw new OperationException(e); + } finally { + try { + + pstmt.close(); + } catch (Exception e) { + } + + pstmt = null; + } + + return list; + + } + + public static ArrayList getBpartnerOrderHistory(Properties ctx, + int bPartnerId) throws OperationException { + String sql = "select ord.C_ORDER_ID," + // 1 + // "inv.c_invoice_id," + + "ord.created," + // 2 + "ord.grandtotal," + // 3 + "ord.DOCUMENTNO," + // 4 + "bp.name," + // 5 + " ord.orderType," + // 6 + " bp.C_BPARTNER_ID" + // 7 + " from c_order ord,C_BPARTNER bp" + + " where ord.C_BPARTNER_ID=bp.C_BPARTNER_ID" + + " and ord.AD_ORG_ID=" + Env.getAD_Org_ID(ctx) + + " and ord.AD_CLIENT_ID=" + Env.getAD_Client_ID(ctx) + + " and ord.c_bpartner_id=" + bPartnerId + + " and ord.isActive='Y'" + " and ord.docstatus in ('CO','CL')"; + + sql = sql + " order by ord.created desc"; + + System.out.println(sql); + + PreparedStatement pstmt = DB.prepareStatement(sql, null); + + POSHistoryBean bean = null; + ArrayList list = new ArrayList(); + ResultSet rs = null; + + try { + rs = pstmt.executeQuery(); + + while (rs.next()) { + bean = new POSHistoryBean(); + bean.setOrderId(Integer.valueOf(rs.getInt(1))); + + bean.setDateAcct(rs.getTimestamp(2)); + bean.setOrderGrandTotal(rs.getBigDecimal(3)); + bean.setDocumentNo(rs.getString(4)); + bean.setPartnerName(rs.getString(5)); + bean.setOrderType(rs.getString(6)); + bean.setBpartnerId(rs.getInt(7)); + + list.add(bean); + + } + + rs.close(); + } catch (SQLException e) { + throw new OperationException(e); + } finally { + try { + + pstmt.close(); + } catch (Exception e) { + } + + pstmt = null; + } + + return list; + + } + +} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/POSClientManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/POSClientManager.java new file mode 100644 index 0000000000..38947aca6d --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/businesslogic/POSClientManager.java @@ -0,0 +1,319 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + **/ + +/** + @author ashley + */ + +package org.posterita.businesslogic; + +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.Iterator; +import java.util.Properties; + +import org.compiere.model.MBPartner; +import org.compiere.model.MBankAccount; +import org.compiere.model.MCashBook; +import org.compiere.model.MClient; +import org.compiere.model.MCommission; +import org.compiere.model.MCurrency; +import org.compiere.model.MDiscountSchema; +import org.compiere.model.MLocation; +import org.compiere.model.MOrg; +import org.compiere.model.MOrgInfo; +import org.compiere.model.MPOS; +import org.compiere.model.MPOSTerminal; +import org.compiere.model.MPriceList; +import org.compiere.model.MPriceListVersion; +import org.compiere.model.MRole; +import org.compiere.model.MRoleMenu; +import org.compiere.model.MStore; +import org.compiere.model.MTaxCategory; +import org.compiere.model.MUser; +import org.compiere.model.MWarehouse; +import org.compiere.util.Env; +import org.posterita.businesslogic.administration.BPartnerManager; +import org.posterita.businesslogic.administration.PriceListManager; +import org.posterita.businesslogic.administration.RoleManager; +import org.posterita.businesslogic.administration.TaxManager; +import org.posterita.businesslogic.administration.UserManager; +import org.posterita.businesslogic.administration.WarehouseManager; +import org.posterita.businesslogic.core.ApplicationManager; +import org.posterita.core.FileManager; +import org.posterita.core.bean.ClientBean; +import org.posterita.exceptions.ClientAlreadyExistException; +import org.posterita.exceptions.OperationException; +import org.posterita.exceptions.WarehouseAlreadyExistsException; +import org.posterita.factory.GenericSystemObjectsFactory; +import org.posterita.factory.POSMenuFactory; +import org.posterita.factory.SystemObjectsFactory; +import org.posterita.lib.UdiConstants; +import org.posterita.model.MBank; +import org.posterita.model.MWebMenu; +import org.posterita.util.PoManager; + +public class POSClientManager extends ClientManager +{ + public static final String LOCATOR_SUFFIX = "Locator"; + public static final String SALES_REP_SUFFIX = "Sales Rep"; + public static final String DEFAULT_POS_TERMINAL = "Terminal 1"; + public static final String STORE_SUFFIX = "POS"; + public static final String taxCategoryName1 = "VAT"; + public static final String taxCategoryName2 = "Tax Exempt"; + public static final String CONTEXT_SUFFIX = "pos"; + public static final String STYLESHEET = "posteritaWarmsCSS.jsp"; + + public static Properties createPOSDetails(Properties ctx, int currencyId, String currencyName, String hostURL, String trxName) throws OperationException, WarehouseAlreadyExistsException + { + + int adClientId = Env.getAD_Client_ID(ctx); + int adOrgID = Env.getAD_Org_ID(ctx); + + MClient client = ClientManager.loadClient(ctx, adClientId, trxName); + MOrg org = OrganisationManager.loadOrganisation(ctx, adOrgID, trxName); + + String clientName = client.getName(); + String orgName = org.getName(); + + MOrgInfo orgInfo = org.getInfo(); + if(orgInfo == null) + throw new OperationException("Organisation does not have an Organisation Info"); + + int locationId = orgInfo.getC_Location_ID(); + if(locationId == 0) + throw new OperationException("Organistion does not have a location"); + + MLocation orgLocation = LocationManager.loadLocation(ctx, locationId, trxName); + + String city = orgLocation.getCity(); + int countryId = orgLocation.getCountry().get_ID(); + + String whereClause = "AD_Client_ID=" + Env.getAD_Client_ID(ctx) + " and AD_Org_ID=" + Env.getAD_Org_ID(ctx); + + int discountSchemaIds[] = MDiscountSchema.getAllIDs(MDiscountSchema.Table_Name, whereClause, trxName); + if(discountSchemaIds == null || discountSchemaIds.length == 0) + throw new OperationException("No Discount schema defined"); + + System.out.println("Creating Location..."); + + String cashBookName = orgName + " Cash Book"; + String posTerminalName = DEFAULT_POS_TERMINAL; + String salesPriceListName = orgName + " Sales Price List"; + String salesPriceListVersionName = orgName + " Sales Price List Version"; + String purchasePriceListName = orgName + " Purchase Price List"; + String purchasePriceListVersionName = orgName + " Purchase Price List Version"; + String warehouseName = orgName + " Warehouse"; + + + System.out.println("Creating Cash Book..."); + MCashBook cashBook = CashManager.createCashBook(ctx, org.get_ID(), cashBookName, currencyId, trxName); + + System.out.println("Creating Sales Pricelist..."); + MPriceList salesPriceList = PriceListManager.createPriceList(ctx, salesPriceListName, currencyId, 2, true, trxName); + System.out.println("Creating Purchase Pricelist..."); + MPriceList purchasePriceList = PriceListManager.createPriceList(ctx, purchasePriceListName, currencyId, 2, false, trxName); + + MPriceListVersion salesPriceListVersion = new MPriceListVersion(salesPriceList); + salesPriceListVersion.setName(salesPriceListVersionName); + salesPriceListVersion.setM_DiscountSchema_ID(discountSchemaIds[0]); + + PoManager.save(salesPriceListVersion); + + MPriceListVersion purchasePriceListVersion = new MPriceListVersion(purchasePriceList); + purchasePriceListVersion.setName(purchasePriceListVersionName); + purchasePriceListVersion.setM_DiscountSchema_ID(discountSchemaIds[0]); + PoManager.save(purchasePriceListVersion); + + System.out.println("Creating Bank..."); + MBank bank = new MBank(ctx, 0, trxName); + bank.setName(orgName + " Bank"); + bank.setRoutingNo("123456789"); + bank.setC_Location_ID(orgLocation.get_ID()); + PoManager.save(bank); + + System.out.println("Creating Bank Account..."); + MBankAccount bankAccount = new MBankAccount(ctx, 0, trxName); + bankAccount.setC_Bank_ID(bank.get_ID()); + bankAccount.setBankAccountType(MBankAccount.BANKACCOUNTTYPE_Checking); + bankAccount.setC_Currency_ID(currencyId); + bankAccount.setAccountNo("123456789"); + bankAccount.setIsDefault(true); + PoManager.save(bankAccount); + + + System.out.println("Creating Tax Categories..."); + MTaxCategory taxCategory15 = TaxManager.createTaxCategory(ctx, taxCategoryName1, trxName); + MTaxCategory taxCategory0 = TaxManager.createTaxCategory(ctx, taxCategoryName2, trxName); + + System.out.println("Creating Tax..."); + TaxManager.createTax(ctx, org.get_ID(), taxCategoryName1, taxCategory15.get_ID(), countryId, new BigDecimal("15.0"),taxCategoryName1,false, trxName); + TaxManager.createTax(ctx, org.get_ID(), taxCategoryName2, taxCategory0.get_ID(), countryId, new BigDecimal("0"), taxCategoryName1,true,trxName); + + System.out.println("Creating Warehouse..."); + MWarehouse warehouse = WarehouseManager.createWarehouse(ctx, org.get_ID(), warehouseName, + orgLocation.getC_Location_ID(), trxName); + + //set warehouse in org info + orgInfo.setM_Warehouse_ID(warehouse.getM_Warehouse_ID()); + orgInfo.save(); + + System.out.println("Creating Business Partners..."); + // Create Cash Transaction Business Partner + MBPartner defCashBPartner = BPartnerManager.createBPartner(ctx, org.get_ID(), org.getLinkedC_BPartner_ID(trxName), "Standard Customer", " ", true, false, false, false, " ", " ", city, " ", countryId, trxName); + MBPartner salesRepBPartner = BPartnerManager.createBPartner(ctx, org.get_ID(), org.getLinkedC_BPartner_ID(trxName), orgName + " Sales Rep", " ", false, false, true, true, " ", " ", city, " ", countryId, trxName); + + MUser salesRepUser = new MUser(ctx, 0, trxName); + salesRepUser.setC_BPartner_ID(salesRepBPartner.get_ID()); + salesRepUser.setName(orgName + " " + SALES_REP_SUFFIX); + PoManager.save(salesRepUser); + + + System.out.println("Creating POS Terminal..."); + MPOSTerminal terminal = POSTerminalManager.createPOSTerminal(ctx, org.get_ID(), posTerminalName, + cashBook.get_ID(), bankAccount.get_ID(), purchasePriceList.get_ID(), + salesPriceList.get_ID(), warehouse.get_ID(), defCashBPartner.get_ID(), + salesRepUser.get_ID(), trxName); + + + System.out.println("Creating Web store configuration..."); + + MStore store = StoreManager.createStore(ctx, clientName + " " + STORE_SUFFIX, + clientName + "pos", org.get_ID(), purchasePriceList.get_ID(), + salesRepUser.get_ID(), warehouse.get_ID(), "pos", hostURL, trxName) ; + + // Setting ctx with new configurations + Env.setContext(ctx, UdiConstants.TERMINAL_ID, String.valueOf(terminal.get_ID())); + Env.setContext(ctx, UdiConstants.U_POSTERMINAL_ID, String.valueOf(terminal.get_ID())); + Env.setContext(ctx, UdiConstants.PRICELIST_CTX_PARAM, String.valueOf(purchasePriceList.get_ID())); + Env.setContext(ctx, UdiConstants.POS_PURCHASE_PL_VERSION, String.valueOf(purchasePriceListVersion.get_ID())); + + return ctx; + } + + public static MUser createAdmin(Properties ctx, String userName, int orgId, String roleName, String password, String userPin, String address, String emailAddress, String trxName) throws OperationException + { + Properties nCtx = (Properties)ctx.clone(); + nCtx.setProperty("#AD_Client_ID", "0"); + nCtx.setProperty("#AD_Org_ID", "0"); + + MRole role = RoleManager.getOrCreateRole(ctx, orgId, roleName, true, BigDecimal.ZERO, true, true, true, true, true, true, trxName); + MUser user = UserManager.getOrCreateUser(ctx, 0, userName, true, address, address, address, password, emailAddress, true, "", 0, role.get_ID(), userPin,MCommission.DOCBASISTYPE_Invoice,new BigDecimal(10),MCommission.FREQUENCYTYPE_Monthly,new BigDecimal(0),false,trxName); + + String whereClause = " AD_Role_ID=" + role.get_ID(); + + int roleMenuIds[] = MRoleMenu.getAllIDs(MRoleMenu.Table_Name, whereClause, trxName); + + for(int i = 0; i < roleMenuIds.length; i++) + { + MRoleMenu roleMenu = new MRoleMenu(ctx, roleMenuIds[i], trxName); + //roleMenu.delete(true); + } + + POSMenuFactory posMFactory = POSMenuFactory.getFactoryInstance(nCtx); + Iterator keyIter = posMFactory.getAllKeys(nCtx).iterator(); + + while(keyIter.hasNext()) + { + String key = (String)keyIter.next(); + MWebMenu menu = (MWebMenu)posMFactory.get(nCtx, key); + MRoleMenu roleMenu = new MRoleMenu(ctx, 0, trxName); + roleMenu.setAD_Role_ID(role.get_ID()); + roleMenu.setU_WebMenu_ID(menu.get_ID()); + PoManager.save(roleMenu); + } + + return user; + } + + public static String createClient(ClientBean clientBean) throws ClientAlreadyExistException, OperationException, WarehouseAlreadyExistsException + { + Properties ctx = Env.getCtx(); + Env.setContext(ctx, UdiConstants.USER_ID_CTX_PARAM, "100"); // SuperUser + + if(clientBean == null) + throw new OperationException("Bean cannot be null!!!"); + + if(ClientManager.isClientPresent(clientBean.getClientName())) + throw new ClientAlreadyExistException("Client with name: " + clientBean.getClientName() + " already exist!!!"); + + MCurrency currency = new MCurrency(ctx, clientBean.getCurrencyId(), null); + if(currency.get_ID() == 0) + throw new OperationException("Could not load currency with id: " + clientBean.getCurrencyId()); + + String hostUrl = "http://www." + clientBean.getClientName() + ".com/"; + File file = null; + FileOutputStream fos = null; + + try + { + file = File.createTempFile("accounting_" + System.currentTimeMillis(), ".csv"); + FileManager.write(clientBean.getFile().getInputStream(), file.getAbsolutePath()); + } + catch (FileNotFoundException e) + { + + e.printStackTrace(); + } + catch (IOException e) + { + + e.printStackTrace(); + } + finally + { + if (fos != null) + { + try + { + fos.close(); + } + catch(Exception ex) + {} + } + } + + ClientManager.getCreateClient(ctx, clientBean.getClientName(), clientBean.getOrgName(), clientBean.getCurrencyId(), currency.getDescription(), clientBean.getCountryId(), clientBean.getCity(), clientBean.getAddress1(), clientBean.getPostalAddress(), "", file); + ctx = ClientManager.getCtx(ctx, clientBean.getClientName(), clientBean.getOrgName()); + POSClientManager.createPOSDetails(ctx, clientBean.getCurrencyId(), currency.getDescription(), hostUrl, null); + + try + { + SystemObjectsFactory.reloadFactory(ctx); + GenericSystemObjectsFactory.reloadFactory(ctx); + /*GenericProductAttributeSetFactory.reloadFactory(ctx); + GenericProductAttributeFactory.reloadFactory(ctx);*/ + } + catch(Exception ex) + { + ex.printStackTrace(); + } + + //AD_ORG_ID is set to 0 here so that Admin user can access all orgs + POSClientManager.createAdmin(ctx, clientBean.getUsername(), 0, clientBean.getRoleName(), clientBean.getPassword(), clientBean.getUserPIN(), clientBean.getAddress1(), clientBean.getEmail(), null); + + String storeContext = clientBean.getClientName() + "pos"; + return storeContext; + } + +} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/POSGoodsManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/POSGoodsManager.java new file mode 100644 index 0000000000..24d62e0927 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/businesslogic/POSGoodsManager.java @@ -0,0 +1,616 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Created on 27-Apr-2006 by alok + */ + + +package org.posterita.businesslogic; + +import java.math.BigDecimal; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.Properties; + +import org.compiere.model.MBPartner; +import org.compiere.model.MInOut; +import org.compiere.model.MInOutConfirm; +import org.compiere.model.MInvoice; +import org.compiere.model.MOrder; +import org.compiere.model.MOrderLine; +import org.compiere.model.MPayment; +import org.compiere.model.MWarehouse; +import org.compiere.process.DocumentEngine; +import org.compiere.util.DB; +import org.compiere.util.Env; +import org.posterita.beans.CreditCheckBean; +import org.posterita.beans.ItemBean; +import org.posterita.beans.OrderLineBean; +import org.posterita.beans.ProductBean; +import org.posterita.beans.ProductCategoryBean; +import org.posterita.businesslogic.creditsales.CreditOrderManager; +import org.posterita.exceptions.BPartnerOverCreditLimitException; +import org.posterita.exceptions.NoOrderLineFoundException; +import org.posterita.exceptions.OperationException; +import org.posterita.lib.UdiConstants; +import org.posterita.order.UDIOrderTypes; +import org.posterita.util.PoManager; + + +public class POSGoodsManager +{ + public static final String GET_ALL_VENDORS="getAllVendors"; + public static final String GET_ALL_VENDORS_FOR_RETURN_NOTE="getAllVendorsForReturnNote"; + + public static MOrder createCustomerReturn(Properties ctx,OrderLineBean bean,ArrayList cartBeanItems,Integer bPartnerId,String reason,String trxName) throws BPartnerOverCreditLimitException,OperationException + { + return createGoodsReceiveNote(ctx,bean,cartBeanItems,true,bPartnerId,reason,trxName); + } + + public static MOrder createGoodsReceiveNote(Properties ctx,OrderLineBean bean,ArrayList cartBeanItems,Integer bPartnerId,String SupRef,String trxName)throws OperationException + { + return createGoodsReceiveNote(ctx,bean,cartBeanItems,false,bPartnerId,SupRef,trxName); + } + + + private static MOrder createGoodsReceiveNote(Properties ctx,OrderLineBean orderlineBean,ArrayList cartBeanItems,boolean isCustomerReturn,Integer bPartnerId,String desc,String trxName)throws BPartnerOverCreditLimitException,OperationException + { + MOrder order = null; + MWarehouse warehouse = POSTerminalManager.getWarehouse(ctx); + int priceListId=0; + Integer orderId = orderlineBean.getOrderId(); + String paymentRule=null; + String orderType=null; + + + if(orderId == null) + { + if(isCustomerReturn) + { + priceListId=POSTerminalManager.getSOPriceListId(ctx); + + if(orderlineBean.getOrderType().equalsIgnoreCase(UDIOrderTypes.CREDIT_ORDER.getOrderType())) + { + paymentRule=MOrder.PAYMENTRULE_OnCredit; + orderType=UDIOrderTypes.CREDIT_MEMO.getOrderType(); + } + + else + { + paymentRule = orderlineBean.getPaymentRule(); + orderType=UDIOrderTypes.CUSTOMER_RETURN_ORDER.getOrderType(); + } + + order=OrderManager.createOrder(ctx,bPartnerId.intValue(),true,priceListId,orderType, + warehouse.get_ID(),paymentRule,trxName); + + if(orderlineBean.getPaymentTermId()!=null) + order.setC_PaymentTerm_ID(orderlineBean.getPaymentTermId()); + + int terminalId = POSTerminalManager.getTerminalId(ctx); + String posOrderDocNumber=orderlineBean.getDocumentNo(); + if(posOrderDocNumber!=null) + { + String whereClause1="AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+ + " and documentNo ='"+posOrderDocNumber+"'"; + int orderids1 []= MOrder.getAllIDs(MOrder.Table_Name,whereClause1,null); + + String number="R"+posOrderDocNumber; + String whereClause=null; + if(orderlineBean.getOrderType().equalsIgnoreCase(UDIOrderTypes.CREDIT_ORDER.getOrderType())) + { + whereClause="AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+" and orderType='"+UDIOrderTypes.CREDIT_MEMO.getOrderType()+ + "' and documentNo like('%"+number+"%')"; + } + else + { + whereClause="AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+" and orderType='"+UDIOrderTypes.CUSTOMER_RETURN_ORDER.getOrderType()+ + "' and documentNo like('%"+number+"%')"; + } + + int orderids []= MOrder.getAllIDs(MOrder.Table_Name,whereClause,null); + int noOfOrders = orderids.length; + String docNumber=number+"_"+(noOfOrders+1); + order.setDocumentNo(docNumber); + order.setRef_Order_ID(orderids1[0]);//using it when complete the credit memo to find whether shipment has to be done or not + } + + if (terminalId == 0) + throw new OperationException("POS Id not present!!"); + + //order.setC_POS_ID(terminalId);TODO - Trifon; order.setU_POSTerminal_ID(terminalId); + } + else + { + priceListId = Env.getContextAsInt(ctx,UdiConstants.POS_PURCHASE_PL); + order=OrderManager.createOrder(ctx,bPartnerId.intValue(),false,priceListId,UDIOrderTypes.POS_GOODS_RECEIVE_NOTE.getOrderType(), + warehouse.get_ID(),MOrder.PAYMENTRULE_Check,trxName); + } + } + else + { + //load existing order + order = OrderManager.loadOrder(ctx, orderId, trxName); + + //delete previous orderlines + OrderManager.deleteOrderlines(ctx, order, trxName); + } + + + boolean isDirty = false; + + if( bPartnerId != null ) + { + order.setC_BPartner_ID(bPartnerId); + isDirty = true; + } + + + if(desc!=null) + { + order.setDescription(desc); + isDirty = true; + } + + if( isDirty ) + { + PoManager.save(order); + } + + + + Iterator iter = cartBeanItems.iterator(); + ItemBean itemBean; + while(iter.hasNext()) + { + itemBean =(ItemBean)iter.next(); + + int m_product_id = itemBean.getProductId(); + BigDecimal qty = itemBean.getQty(); + BigDecimal actualPrice = itemBean.getActualPrice(); + BigDecimal discount = itemBean.getDiscountPercent(); + BigDecimal price = itemBean.getPrice(); + + OrderManager.createOrderLine(ctx, order, m_product_id, qty, discount, price); + } + + if(order.isSOTrx()==true) + { + CreditCheckBean crBean = OrderManager.checkBPartnerCreditLimit(ctx,order.getC_BPartner_ID(),order.get_ID(),order.get_TrxName()); + if(crBean.getValid()==false) + throw new BPartnerOverCreditLimitException(crBean.getMsg()); + } + + return order; + + } + + public static MOrder createAndCompletePODocuments(Properties ctx, int purchaseOrderId,String trxName) throws OperationException + { + MOrder purchaseOrder = new MOrder(ctx,purchaseOrderId,trxName); + + MOrderLine [] lines=purchaseOrder.getLines(); + + + if(lines.length==0) + { + throw new NoOrderLineFoundException("No OrderLines For This Order"); + } + + MOrder completedPurchaseOrder = completePurchaseOrder(ctx,purchaseOrder,"GRN No "+purchaseOrder.get_ID()); + + MInvoice draftedVendorInvoice = InvoiceManager.createVendorInvoice(ctx,purchaseOrder.get_ID(),trxName); + + MInvoice invoice = InvoiceManager.completeInvoice(ctx, draftedVendorInvoice); + + if(MInvoice.PAYMENTRULE_OnCredit.equals(invoice.getPaymentRule())) + { + //do nothing + } + else + { + MPayment draftedAPPayment = PaymentManager.createAPPayment(ctx,draftedVendorInvoice, trxName); + PaymentManager.completeAPPayment(ctx,draftedAPPayment); + } + + MWarehouse warehouse = new MWarehouse(ctx,purchaseOrder.getM_Warehouse_ID(),trxName); + + MInOut materialReceipt = MinOutManager.createMInOut(ctx,invoice,warehouse.get_ID()); + PoManager.save(materialReceipt); + + MInOutConfirm confirm=MinOutManager.createConfirmation(ctx,materialReceipt); + MinOutManager.completeConfirmation(ctx, confirm); + + MinOutManager.completeShipment(ctx, materialReceipt); + + OrderManager.printOrder(ctx,completedPurchaseOrder); + + return completedPurchaseOrder; + } + + public static MOrder completePurchaseOrder(Properties ctx, MOrder order,String POReference) throws BPartnerOverCreditLimitException,OperationException + { + + if (order.getDocStatus().equals(DocumentEngine.STATUS_Completed)) + throw new OperationException("Order has already been completed"); + + + + order.setPOReference(POReference); + + PoManager.processIt(order, DocumentEngine.ACTION_Complete); + + return order; + } + + + public static MOrder createGoodsReturnNote(Properties ctx,OrderLineBean orderlineBean,ArrayList cartBeanItems,Integer bPartnerId,String supRef,String trxName)throws OperationException + { + int purchasePLID = POSTerminalManager.getPOPriceListId(ctx); + MWarehouse warehouse = POSTerminalManager.getWarehouse(ctx); + + MOrder order = null; + Integer orderId = orderlineBean.getOrderId(); + + if(orderId == null) + { + order = OrderManager.createOrder(ctx,bPartnerId.intValue(),true,purchasePLID,UDIOrderTypes.POS_GOODS_RETURN_NOTE.getOrderType(), + warehouse.get_ID(),MOrder.PAYMENTRULE_Check,trxName); + } + else + { + //load existing order + order = OrderManager.loadOrder(ctx, orderId, trxName); + + //delete previous orderlines + OrderManager.deleteOrderlines(ctx, order, trxName); + } + + boolean isDirty = false; + + if( bPartnerId != null ) + { + MBPartner partner = new MBPartner(ctx, bPartnerId.intValue(), trxName); + order.setBPartner(partner); + isDirty = true; + } + + + if(supRef!=null) + { + order.setDescription(supRef); + isDirty = true; + } + + if( isDirty ) + { + PoManager.save(order); + } + + + Iterator iter = cartBeanItems.iterator(); + ItemBean itemBean; + + while(iter.hasNext()) + { + itemBean =(ItemBean)iter.next(); + OrderManager.createOrderLine(ctx,order,itemBean.getProductId().intValue(),itemBean.getQty(),new BigDecimal(0),new BigDecimal(0)) ; + } + return order; + } + + + public static ArrayList getAllSuppliers(Properties ctx) throws OperationException + { +// String sql = "select name||' '||name2 name," +//1 + String sql = "select name," +//1 FIXME Postgresql Fix, need more investigation to get to above functionality + "c_bpartner_id" +//2 + " from C_BPARTNER" + + " where AD_CLIENT_ID="+Env.getAD_Client_ID(ctx) + + " and ad_org_id in (" + Env.getContext(ctx,UdiConstants.ROLE_EDITABLE_ORGS_CTX_PARAM)+")"+ + " and ISVENDOR='Y'"+ + " and isactive='Y'"+ + " order by upper(name)"; + + PreparedStatement pstmt = DB.prepareStatement(sql,null); + + ArrayList list = new ArrayList(); + OrderLineBean bean = null; + ResultSet rs = null; + + try + { + rs = pstmt.executeQuery(); + while(rs.next()) + { + bean = new OrderLineBean(); + bean.setPartnerName(rs.getString(1)); + bean.setBpartnerId(Integer.valueOf(rs.getInt(2))); + list.add(bean); + } + + rs.close(); + } + catch (SQLException e) + { + + throw new OperationException(e); + } + finally + { + try + { + + pstmt.close(); + } + catch(Exception e) + {} + + pstmt = null; + } + + return list; + } + + public static String getForward(Properties ctx,String isSales) + { + if(Boolean.valueOf(isSales).booleanValue()==true) + return GET_ALL_VENDORS; + else + return GET_ALL_VENDORS_FOR_RETURN_NOTE; + } + + + public static ArrayList getAllProductCategory(Properties ctx) throws OperationException + { + String sql="select name," + + "m_product_category_id" + + " from m_product_category"+ + " where AD_ORG_ID="+Env.getAD_Org_ID(ctx)+ + " and AD_CLIENT_ID="+Env.getAD_Client_ID(ctx); + + PreparedStatement pstmt = DB.prepareStatement(sql,null); + ProductCategoryBean bean = null; + ArrayList list = new ArrayList(); + ResultSet rs = null; + + try + { + rs = pstmt.executeQuery(); + while(rs.next()) + { + bean = new ProductCategoryBean(); + bean.setName(rs.getString(1)); + bean.setProductCategoryId(Integer.valueOf(rs.getInt(2))); + list.add(bean); + } + + rs.close(); + } + catch (SQLException e) + { + throw new OperationException(e); + } + finally + { + try + { + + pstmt.close(); + } + catch (Exception e) + {} + + pstmt = null; + } + + return list; + + } + + + public static ArrayList getAllRevenueRecos(Properties ctx) throws OperationException + { + String sql="select name," + + "C_REVENUERECOGNITION_ID" + + " from C_REVENUERECOGNITION"+ + " where AD_ORG_ID="+Env.getAD_Org_ID(ctx)+ + " and AD_CLIENT_ID="+Env.getAD_Client_ID(ctx); + + PreparedStatement pstmt = DB.prepareStatement(sql,null); + ProductCategoryBean bean = null; + ArrayList list = new ArrayList(); + ResultSet rs = null; + try + { + rs = pstmt.executeQuery(); + while(rs.next()) + { + bean = new ProductCategoryBean(); + bean.setName(rs.getString(1)); + bean.setProductCategoryId(Integer.valueOf(rs.getInt(2))); + list.add(bean); + } + + rs.close(); + } + catch (SQLException e) + { + throw new OperationException(e); + } + finally + { + try + { + + pstmt.close(); + } + catch(Exception e) + {} + + pstmt = null; + } + + return list; + + } + +// private static int getBPartnerForProduct(Properties ctx, int productId) throws OperationException +// { +// +// String sql =" select c_bpartner_id from c_bpartner_product where "+ +// "AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+ +// " and AD_ORG_ID="+Env.getAD_Org_ID(ctx)+ +// " and M_PRODUCT_ID="+productId; +// +// int bPartnerId=0; +// +// PreparedStatement pstmt = DB.prepareStatement(sql,null); +// +// try +// { +// ResultSet rs = pstmt.executeQuery(); +// while(rs.next()) +// { +// bPartnerId=rs.getInt(1); +// } +// } +// catch (SQLException e) +// { +// throw new OperationException(e); +// } +// +// +// return bPartnerId; +// } + + public static ArrayList getAllTaxCategory(Properties ctx) throws OperationException + { + // MProduct product = new MProduct(ctx,productId,null); + + + String sql = "select tc.c_taxcategory_id, tc.name||' '||'Rate % '||tx.rate" + + " from c_taxcategory tc,C_TAX tx" + + " where tc.C_TAXCATEGORY_ID=tx.C_TAXCATEGORY_ID" + + " and tx.AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+ + " and tx.isActive='Y'"; + + + // + PreparedStatement pstmt = DB.prepareStatement(sql,null); + ProductBean bean=null; + ArrayList list = new ArrayList(); + ResultSet rs = null; + + try + { + rs = pstmt.executeQuery(); + while(rs.next()) + { + bean = new ProductBean(); + bean.setTaxCategoryId(Integer.valueOf(rs.getInt(1))); + bean.setTaxCategoryName(rs.getString(2)); + list.add(bean); + } + + rs.close(); + } + catch (SQLException e) + { + throw new OperationException(e); + } + finally + { + try + { + + pstmt.close(); + } + catch(Exception e) + {} + + pstmt = null; + } + + + return list; + } + + public static MOrder completeCustomerReturnOrder( Properties ctx,int orderId, String trxName) throws OperationException + { + MOrder order = new MOrder(ctx, orderId, trxName); + + //this is dne to support the simple customer return order so that the shipment takes place + boolean delivered=true; + + if( order.getOrderType().equals(UDIOrderTypes.CUSTOMER_RETURN_ORDER.getOrderType())|| order.getOrderType().equals(UDIOrderTypes.CREDIT_MEMO.getOrderType())) + { + if(order.getRef_Order_ID() != 0) //setting it while creating order + { + MOrder originalOrder = new MOrder(ctx,order.getRef_Order_ID(),trxName); + delivered=compareOrders(ctx,originalOrder,order); + } + } + if(delivered) + return POSManager.completePOSOrder(ctx,orderId,trxName); + else + return CreditOrderManager.completeCreditOrderWithOutShipment(ctx,order, trxName); + } + + private static boolean compareOrders(Properties ctx,MOrder orOrder,MOrder retOrder) throws OperationException + { + MOrderLine [] orOrderLine = orOrder.getLines(); + + MOrderLine [] retOrderLine = retOrder.getLines(); + + boolean delivered = false; + + for(int i=0;i maxDiscountAllowed ) + { + throw new DiscountLimitException("Discount Limit exceeded!"); + } + } + } + + if(bean.getBpartnerId() == null) + { + throw new OperationException("Business Partner cannot be null"); + } + + int cashBookId = POSTerminalManager.getCashBookId(ctx); + int terminalId = POSTerminalManager.getTerminalId(ctx); + int priceListId = POSTerminalManager.getSOPriceListId(ctx); + int warehouseId = POSTerminalManager.getWarehouseId(ctx); + + if(firstOrderOfTheDay(ctx)) + { + CashManager.closePreviousDraftedCashjournals(ctx, cashBookId, trxName); + } + + + String paymentRule=null; + + if (bean.getTrxType().equalsIgnoreCase(Constants.PAYMENT_RULE_CASH)) + paymentRule=MOrder.PAYMENTRULE_Cash; + else if(bean.getTrxType().equalsIgnoreCase(Constants.PAYMENT_RULE_CARD)) + paymentRule=MOrder.PAYMENTRULE_CreditCard; + else if(bean.getTrxType().equalsIgnoreCase(Constants.PAYMENT_RULE_CHEQUE)) + paymentRule=MOrder.PAYMENTRULE_Check; + else if(bean.getTrxType().equalsIgnoreCase(Constants.PAYMENT_RULE_MIXED)) + { + paymentRule=UdiConstants.PAYMENTRULE_MIXED; + validateMixedPaymentAmount(bean); + } + else if(bean.getTrxType().equalsIgnoreCase(MOrder.PAYMENTRULE_OnCredit)) + paymentRule=MOrder.PAYMENTRULE_OnCredit; + + else + throw new OperationException("Invalid Payment Rule"); + + //reusing existing order + MOrder order = null; + + Integer orderId = bean.getOrderId(); + if( orderId == null ) + { + //creating new order + order = OrderManager.createOrder(ctx, bean.getBpartnerId().intValue(), true, + priceListId, orderType.getOrderType(), warehouseId, paymentRule, trxName); + } + else + { + //updating existing order + MBPartner partner = new MBPartner(ctx, bean.getBpartnerId().intValue(), trxName); + order = new MOrder(ctx, orderId.intValue(), trxName); + + //deleting existing orderlines + OrderManager.deleteOrderlines(ctx, order, trxName); + + + order.setBPartner(partner); + order.setPaymentRule(paymentRule); + order.setDateOrdered(new Timestamp(System.currentTimeMillis())); + } + + //order.setC_POS_ID(terminalId);TODO - Trifon; order.setU_POSTerminal_ID(terminalId); + if(bean.getPaymentTermId()!=null) + { + order.setC_PaymentTerm_ID(bean.getPaymentTermId()); + } + PoManager.save(order); + + Iterator iter = cartBeanItems.iterator(); + ItemBean itemBean; + BigDecimal qtyTotal= BigDecimal.ZERO; + int i=0; + while(iter.hasNext()) + { + double actualPrice=0.0; + double discount=0.0; + itemBean =(ItemBean)iter.next(); + + if(bean.getDiscountPercent()!=null) + { + String discountEntered = bean.getDiscountPercent()[i]; + if( discountEntered == null || discountEntered.equals("")) + discount=0; + else + { + discount = Double.parseDouble(bean.getDiscountPercent()[i]); + actualPrice=Double.parseDouble(bean.getActualPrice()[i]); + } + } + + if(discount > 0.0) + { + MUser user = new MUser(ctx,Env.getAD_User_ID(ctx),null); + + MUserRoles[] userRole = MUserRoles.getOfUser(ctx,user.get_ID()); + + if (userRole.length == 0) + throw new OperationException("Role not found for user " + user.getName()); + + MRole role = new MRole(ctx,userRole[0].getAD_Role_ID(),null); + + MPriceList priceList = MPriceList.get(ctx, order.getM_PriceList_ID(), order.get_TrxName()); + int priceListVersionId = PriceListManager.getPriceListVersionID(ctx, order.getM_PriceList_ID(), order.get_TrxName()); + BigDecimal limitPrice=ProductManager.getLimitPrice(ctx, priceListVersionId, itemBean.getProductId(), priceList.isSOPriceList(), order.get_TrxName()); + + MProduct product = new MProduct(ctx,itemBean.getProductId().intValue(),null); + MTax tax = TaxManager.getTaxFromCategory(ctx, product.getC_TaxCategory_ID(), order.get_TrxName()); + BigDecimal limitPriceWithTax = TaxManager.getPriceWithTax(ctx,limitPrice,tax.getRate()); + + if(role.isOverwritePriceLimit()==false && actualPrice/itemBean.getQty().doubleValue() < limitPriceWithTax.doubleValue()) + { + throw new LimitPriceViolatedException("Discount Exceeds Limit price, limit price is= "+limitPriceWithTax.doubleValue()); + } + else + { + itemBean.setDiscountPercent(new BigDecimal(discount)); + itemBean.setActualPrice(new BigDecimal(actualPrice)); + } + } + qtyTotal=qtyTotal.add(itemBean.getQty()); + itemBean.setQtyTotal(qtyTotal); + OrderManager.createOrderLine(ctx,order,itemBean.getProductId().intValue(),itemBean.getQty(),itemBean.getDiscountPercent(),itemBean.getActualPrice()) ; + i++; + } + + if(order.isSOTrx()==true) + { + CreditCheckBean crBean = OrderManager.checkBPartnerCreditLimit(ctx,order.getC_BPartner_ID(),order.get_ID(),order.get_TrxName()); + if(crBean.getValid()==false) + throw new BPartnerOverCreditLimitException(crBean.getMsg()); + } + + return order; + } + + private static void validateMixedPaymentAmount(OrderLineBean bean) throws InvalidTenderedAmountException + { + if(bean.getTrxType().equalsIgnoreCase(Constants.PAYMENT_RULE_MIXED)) + { + double cashAmt=0.0; + double chequeAmt=0.0; + double cardAmt =0.0; + + if(bean.getPaymentByCash()!=null) + cashAmt = bean.getPaymentByCash(); + if(bean.getPaymentByChq()!=null) + chequeAmt=bean.getPaymentByChq(); + if(bean.getPaymentByCard()!=null) + cardAmt = bean.getPaymentByCard(); + + BigDecimal total = FormatBigDecimal.currency(cashAmt+chequeAmt+cardAmt); + + double lineDiscount=0.0; + double sumActualAmt=0.0; + int count=0; + if(bean.getDiscountPercent()!=null && bean.getDiscountPercent().length>0) + { + for(int i=0;i0.0) + { + sumActualAmt= bean.getTotalActualPrice()-(bean.getTotalActualPrice()*(lineDiscount/100)); + } + + else + { + sumActualAmt=bean.getTotalActualPrice(); + } + + + if(total.doubleValue() !=sumActualAmt) + throw new InvalidTenderedAmountException("The Tendered Amount should be equal to the total amount"); + } + } + + + public static MInvoice createDocuments(Properties ctx, MOrder order) throws OperationException + { + MInvoice customerInvoice = createCustomerInvoice(ctx, order); + PoManager.processIt(customerInvoice, DocumentEngine.ACTION_Complete); + if (!customerInvoice.getPaymentRule().equalsIgnoreCase(MInvoice.PAYMENTRULE_Cash) && !customerInvoice.getPaymentRule().equals(MInvoice.PAYMENTRULE_OnCredit)) + { + MPayment paymentReceived = PaymentManager.createARReceipt(ctx, customerInvoice, customerInvoice.get_TrxName()); + PaymentManager.completePayment(ctx, paymentReceived); + } + + MInOut shipment = MinOutManager.createMInOut(ctx, customerInvoice, order.getM_Warehouse_ID()); + + if (customerInvoice.isCreditMemo()) + { + MInOutConfirm confirm=MinOutManager.createConfirmation(ctx,shipment); + MinOutManager.completeConfirmation(ctx, confirm); + } + MinOutManager.completeShipment(ctx, shipment); + order.setIsDelivered(true); + PoManager.save(order); + + if (firstCashInvoice(ctx, customerInvoice)) + { + CashManager.updateBeginningBalance(ctx, order.getC_POS_ID(), order.get_TrxName()); + } + + return customerInvoice; + + } + + public static MOrder completePOSOrder(Properties ctx,int orderId,OrderLineBean bean,String trxName) throws InvalidTenderedAmountException,BPartnerOverCreditLimitException,NoOrderLineFoundException,OperationException + { + MOrder order = new MOrder(ctx,orderId,trxName); + + if(order.getPaymentRule().equalsIgnoreCase(MOrder.PAYMENTRULE_Cash)) + { + if(bean.getAmountGiven()==null || bean.getAmountGiven().doubleValue()< order.getGrandTotal().doubleValue()) + { + throw new InvalidTenderedAmountException("The Amount given is Invalid"); + } + } + + if(order.getPaymentRule().equalsIgnoreCase(UdiConstants.PAYMENTRULE_MIXED) && (bean.getPaymentByCash() == null || bean.getPaymentByCash() <= 0)) + { + if(bean.getAmountGiven()==null || bean.getAmountGiven().doubleValue() < bean.getPaymentByCash()) + { + throw new InvalidTenderedAmountException("The Amount given is Invalid"); + } + } + + order.setAmountTendered(bean.getAmountGiven()); + order.setAmountRefunded(bean.getAmountRefunded()); + PoManager.save(order); + + if(order.getLines().length==0) + { + throw new NoOrderLineFoundException("POS Order does not have any orderlines!"); + } + + PoManager.processIt(order, DocumentEngine.ACTION_Complete); + + Double cashAmt = bean.getPaymentByCash(); + if(cashAmt == null) + cashAmt = 0.0; + + Double chequeAmt=bean.getPaymentByChq(); + if(chequeAmt == null) + chequeAmt = 0.0; + + Double cardAmt = bean.getPaymentByCard(); + if(cardAmt == null) + cardAmt = 0.0; + + BigDecimal writeOffAmount = Env.ZERO; + + if (order.getAmountTendered() != null && order.getAmountRefunded() != null) + { + writeOffAmount = (order.getAmountTendered().subtract(order.getAmountRefunded())).subtract(order.getGrandTotal()); + } + + CheckoutBean checkoutBean = new CheckoutBean(); + checkoutBean.setAmountRefunded(order.getAmountRefunded()); + checkoutBean.setAmountTendered(order.getAmountTendered()); + checkoutBean.setBpartnerId(order.getC_BPartner_ID()); + checkoutBean.setCardAmt(new BigDecimal(cardAmt)); + checkoutBean.setCardNo(bean.getCreditCardNumber()); + checkoutBean.setCardType(bean.getCreditCardType()); + checkoutBean.setCashAmt(new BigDecimal(cashAmt)); + checkoutBean.setChequeAmt(new BigDecimal(chequeAmt)); + checkoutBean.setChequeNo(bean.getChequeNo()); + checkoutBean.setWriteOffAmt(writeOffAmount); + checkoutBean.setDiscountAmt(Env.ZERO); + + createAndCompleteDocuments(ctx, order, checkoutBean, trxName); + + return order; + } + + public static MOrder completePOSOrder(Properties ctx,int orderId, String trxName) throws OperationException + { + MOrder order = new MOrder(ctx, orderId, trxName); + + return completePOSOrder(ctx, order); + } + + public static MOrder completePOSOrder(Properties ctx,MOrder order) throws OperationException + { + MOrder completedOrder = OrderManager.completeOrder(ctx,order); + //if(completedOrder.getOrderType().equalsIgnoreCase(UDIOrderTypes.POS_ORDER.getOrderType())) + OrderManager.printOrder(ctx,completedOrder); + + createDocuments(ctx,completedOrder); + return completedOrder; + } + + public static MOrder completePOSOrderPrintInvoice(Properties ctx,MOrder order) throws OperationException + { + MOrder completedOrder = OrderManager.completeOrder(ctx,order); + MInvoice invoice = createDocuments(ctx,completedOrder); + InvoiceManager.printInvoice(ctx,invoice); + + return completedOrder; + } + + public static void createAndCompleteDocuments(Properties ctx, MOrder order, CheckoutBean bean, String trxName) throws OperationException + { + MInvoice invoice = createARInvoice(ctx,order.get_ID(), trxName); + createInvoiceLines(ctx, invoice, order, trxName); + PoManager.processIt(invoice, DocumentEngine.ACTION_Complete); + + if(order.getPaymentRule().equals(MOrder.PAYMENTRULE_OnCredit)) + { + //No payment for credit order + return; + } + + BigDecimal cashAmt = (bean.getCashAmt() == null ? Env.ZERO : bean.getCashAmt()); + BigDecimal cardAmt = (bean.getCardAmt() == null ? Env.ZERO : bean.getCardAmt()); + BigDecimal chequeAmt = (bean.getChequeAmt() == null ? Env.ZERO : bean.getChequeAmt()); + BigDecimal writeOffAmount = (bean.getWriteOffAmt() == null ? Env.ZERO : bean.getWriteOffAmt()); + BigDecimal discountAmt = (bean.getDiscountAmt() == null ? Env.ZERO : bean.getDiscountAmt()); + + boolean paymentCreated = false; + boolean discountApplied = false; + + /* + // Cash invoices creates automatically Cash Line entry upon completion of the invoice + // @see MInvoice.completeIt + // Reload cashLine to set writeOff Amt in case of cash payment + // because for each new cashline created, writeOff is set to zero by default + if (invoice.getPaymentRule().equals(MInvoice.PAYMENTRULE_Cash)) + { + paymentCreated = true; + + MCashLine cashLine = new MCashLine(ctx, invoice.getC_CashLine_ID(), trxName); + + if(cashLine != null) + { + cashLine.setWriteOffAmt(writeOffAmount); + cashLine.setDiscountAmt(discountAmt); + + if(!(discountAmt.equals(Env.ZERO))) + { + cashLine.setAmount(invoice.getGrandTotal().subtract(discountAmt).subtract(writeOffAmount)); + } + else + { + cashLine.setAmount(invoice.getGrandTotal().subtract(writeOffAmount)); + } + + PoManager.save(cashLine); + } + else + { + throw new OperationException("Could not load CashLine"); + } + } + // For mixed payment with Cash being part + else if (cashAmt.compareTo(Env.ZERO) > 0 && invoice.getPaymentRule().equals(MInvoice.PAYMENTRULE_Mixed)) + { + int cashBookId = POSTerminalManager.getCashBookId(ctx); + MCash cash = MCash.get(ctx, cashBookId, invoice.getDateInvoiced(), trxName); + + if (cash == null) + { + throw new OperationException("Could not load Cash Journal to do cash entry"); + } + + //No WriteOff in case of Mixed Payment + MCashLine cashLine = CashManager.createCashLine(ctx, cash.get_ID(), + invoice.get_ID(), cashAmt, Env.ZERO, discountAmt, trxName); + invoice.setC_CashLine_ID(cashLine.get_ID()); + PoManager.save(cashLine); + + paymentCreated = true; + discountApplied = true; + } + */ + + //Modifications for cash payment + if (invoice.getPaymentRule().equals(MInvoice.PAYMENTRULE_Cash)) + { + paymentCreated = true; + BigDecimal amt = null; + + if(!(discountAmt.equals(Env.ZERO))) + { + amt = invoice.getGrandTotal().subtract(discountAmt).subtract(writeOffAmount); + } + else + { + amt = invoice.getGrandTotal().subtract(writeOffAmount); + } + + MPayment paymentReceivedCash = PaymentManager.createARReceipt(ctx, invoice, + MPayment.TENDERTYPE_Cash, amt, invoice.get_TrxName()); + + paymentReceivedCash.setWriteOffAmt(writeOffAmount); + paymentReceivedCash.setDiscountAmt(discountAmt); + + PoManager.save(paymentReceivedCash); + PaymentManager.completePayment(ctx,paymentReceivedCash); + } + // For mixed payment with Cash being part + else if (cashAmt.compareTo(Env.ZERO) > 0 && invoice.getPaymentRule().equals(MInvoice.PAYMENTRULE_Mixed)) + { + //No WriteOff in case of Mixed Payment + MPayment paymentReceivedCash = PaymentManager.createARReceipt(ctx, invoice, + MPayment.TENDERTYPE_Cash, cashAmt, invoice.get_TrxName()); + + PoManager.save(paymentReceivedCash); + PaymentManager.completePayment(ctx,paymentReceivedCash); + + paymentCreated = true; + discountApplied = true; + } + //End of modifications + + + + // Enforce that check payment should be created only if Payment rule is check or mixed + if(chequeAmt.compareTo(Env.ZERO) > 0 + && (MInvoice.PAYMENTRULE_Check.equals(invoice.getPaymentRule()) || MInvoice.PAYMENTRULE_Mixed.equals(invoice.getPaymentRule()))) + { + MPayment paymentReceivedCheque = PaymentManager.createARReceipt(ctx, invoice, + MPayment.TENDERTYPE_Check, chequeAmt, invoice.get_TrxName()); + + if (bean.getChequeNo() != null && bean.getChequeNo().trim().length() > 0) + { + paymentReceivedCheque.setCheckNo(bean.getChequeNo()); + } + + if (!discountApplied && discountAmt.compareTo(Env.ZERO) > 0) + { + paymentReceivedCheque.setDiscountAmt(discountAmt); + } + + PoManager.save(paymentReceivedCheque); + PaymentManager.completePayment(ctx,paymentReceivedCheque); + + paymentCreated = true; + discountApplied = true; + } + + // Enforce that card payment should be created only if Payment rule is credit card or mixed + if (cardAmt.compareTo(Env.ZERO) > 0 + && (MInvoice.PAYMENTRULE_CreditCard.equals(invoice.getPaymentRule()) || MInvoice.PAYMENTRULE_Mixed.equals(invoice.getPaymentRule()))) + { + MPayment paymentReceivedCard = PaymentManager.createARReceipt(ctx, invoice, + MPayment.TENDERTYPE_CreditCard, cardAmt, invoice.get_TrxName()); + + if (bean.getCardType() != null && bean.getCardType().trim().length() > 0) + { + paymentReceivedCard.setCreditCardType(bean.getCardType()); + } + + if (bean.getCardNo() != null && bean.getCardNo().trim().length() > 0) + { + paymentReceivedCard.setCreditCardNumber(bean.getCardNo()); + } + + if (!discountApplied && discountAmt.compareTo(Env.ZERO) > 0) + { + paymentReceivedCard.setDiscountAmt(discountAmt); + } + + PoManager.save(paymentReceivedCard); + PaymentManager.completePayment(ctx,paymentReceivedCard); + + paymentCreated = true; + discountApplied = true; + } + + if (!paymentCreated) + { + throw new OperationException("No payments have been created!!!"); + } + + if (firstCashInvoice(ctx, invoice)) + CashManager.updateBeginningBalance(ctx, order.getC_POS_ID(),order.get_TrxName()); + + //@TODO not allowed to use MOrderLine getallids here, must use a manager. + int [] orderLines=MOrderLine.getAllIDs(MOrderLine.Table_Name,"AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+" and AD_ORG_ID="+Env.getAD_Org_ID(ctx)+" and C_ORDER_ID="+order.get_ID(),trxName); + MInOut shipment= MinOutManager.createShipment(ctx, order.get_ID(), orderLines, trxName); + MinOutManager.completeShipment(ctx,shipment); + } + + + public static ArrayList populateOrderLines(Properties ctx,MOrder order) throws OperationException + { + return populateOrderLines(ctx,order,false); + } + + public static ArrayList populateOrderLines(Properties ctx, MOrder order,boolean abbr) throws OperationException + { + MOrderLine [] lines=order.getLines(); + MOrderLine line; + MProduct product; + // AttributeValuesPair attributeValuesPair; + WebOrderLineBean orderLineBean; + BigDecimal qty = Env.ZERO; + BigDecimal totalGrossProfit = Env.ZERO; + BigDecimal totalGrossProfitPercentage = Env.ZERO; + + int priceListId = order.getM_PriceList_ID(); + + MPriceList priceList = MPriceList.get(ctx, priceListId, null); + ArrayList orderLines = new ArrayList(); + for (int i = 0; i < lines.length; i++) + { + line = lines[i]; + + product = new MProduct(ctx, line.getM_Product_ID(), null); + + orderLineBean = new WebOrderLineBean(); + orderLineBean.setProductName(product.getName()); + orderLineBean.setLineNetAmt(line.getLineNetAmt()); + BigDecimal lineTaxAmount = getLineTaxAmt(line.getCtx(), line.getLineNetAmt(), line.getC_Tax_ID(), priceList.isTaxIncluded(), line.getQtyOrdered()); + orderLineBean.setTaxAmt(lineTaxAmount); + BigDecimal lineTotalAmount = Env.ZERO; + if (priceList.isTaxIncluded()) + { + lineTotalAmount = line.getLineNetAmt(); + } + else + { + lineTotalAmount = line.getLineNetAmt().add(orderLineBean.getTaxAmt()); + } + + orderLineBean.setLineTotalAmt(lineTotalAmount); + orderLineBean.setUnitPrice(line.getPriceList().setScale(2)); + orderLineBean.setPriceActual(line.getPriceActual()); + orderLineBean.setProductId(Integer.valueOf(line.getM_Product_ID())); + orderLineBean.setUom(product.getUOMSymbol()); + MTax tax = MTax.get(ctx, line.getC_Tax_ID()); + orderLineBean.setTaxRate(tax.getRate()); + BigDecimal multiplier = (tax.getRate().add(Env.ONEHUNDRED)).divide(Env.ONEHUNDRED); + + Integer purchasePriceListId = PriceListManager.getDefaultPriceListId(ctx, false); + Integer ppriceListVersionId = PriceListManager.getPriceListVersionID(ctx, purchasePriceListId, null); + MPriceList ppriceList = new MPriceList(ctx, purchasePriceListId, null); + MProductPrice pprice = MProductPrice.get(ctx, ppriceListVersionId, line.getM_Product_ID(), null); + + BigDecimal priceLimit = Env.ZERO; + + try + { + if(ppriceList.isTaxIncluded()) + { + priceLimit = pprice.getPriceLimit(); + } + else + { + priceLimit = pprice.getPriceLimit().multiply(multiplier); + } + } + catch(NullPointerException e) + { + priceLimit = Env.ZERO; + } + + orderLineBean.setPurchasePriceList(priceLimit.setScale(2, RoundingMode.HALF_DOWN)); + BigDecimal grossProfit = lineTotalAmount.subtract((priceLimit).multiply(line.getQtyOrdered())); + BigDecimal grossProfitPercentage = Env.ZERO; + + try + { + grossProfitPercentage = (grossProfit.divide(lineTotalAmount, 4, BigDecimal.ROUND_UP)).multiply(Env.ONEHUNDRED); + } + catch (ArithmeticException e) + { + grossProfitPercentage = Env.ZERO; + } + + totalGrossProfit = totalGrossProfit.add(grossProfit); + + orderLineBean.setGrossProfit(grossProfit.setScale(2, RoundingMode.HALF_DOWN)); + orderLineBean.setTotalGrossProfit(totalGrossProfit.setScale(2, RoundingMode.HALF_DOWN)); + orderLineBean.setGrossProfitPercentage(grossProfitPercentage.setScale(2, RoundingMode.HALF_DOWN)); + + if (line.getM_Product_ID() == 0) + { + if(line.getC_Charge_ID() != 0) + { + MCharge charge = ChargeManager.loadCharge(ctx, line.getC_Charge_ID(), null); + orderLineBean.setProductName(charge.getName()); + } + else + throw new OperationException("Unknown Order line type with id: " + line.get_ID()); + } + else + { + String description = product.getDescription(); + if(description == null) + { + description = product.getName(); + } + orderLineBean.setDescription(description); + } + + orderLineBean.setOrderLineId(Integer.valueOf(line.get_ID())); + orderLineBean.setIsinvoiced(Boolean.valueOf(false)); + orderLineBean.setIsQtyReserved(Boolean.valueOf(true)); + qty=qty.add(line.getQtyOrdered()); + orderLineBean.setQtyTotal(qty) ; + + orderLineBean.setQtyOrdered(line.getQtyOrdered()); + orderLineBean.setDiscountPercentage(line.getDiscount()); + BigDecimal discountAmt = Env.ZERO; + BigDecimal subTotal = Env.ZERO; + BigDecimal grandTotal = Env.ZERO; + + if (order.getPaymentRule().equals(MOrder.PAYMENTRULE_Cash) || order.getPaymentRule().equals(MOrder.PAYMENTRULE_Mixed)) + { + MInvoice invoice = MInvoice.get(ctx, order.getC_Invoice_ID()); + MCashLine cashLine = new MCashLine(ctx, invoice.getC_CashLine_ID(), null); + if (cashLine.getC_CashLine_ID() != 0) + { + discountAmt = cashLine.getDiscountAmt()==null? Env.ZERO: cashLine.getDiscountAmt(); + discountAmt = discountAmt.setScale(lineTotalAmount.scale(), RoundingMode.HALF_DOWN); + BigDecimal writeOffAmt = cashLine.getWriteOffAmt() == null? Env.ZERO: cashLine.getWriteOffAmt(); + writeOffAmt = writeOffAmt.setScale(lineTotalAmount.scale(), RoundingMode.HALF_DOWN); + + orderLineBean.setWriteOffAmt(writeOffAmt); + subTotal = order.getGrandTotal(); + grandTotal = cashLine.getAmount(); + } + } + + if (!order.getPaymentRule().equals(MOrder.PAYMENTRULE_Cash)) + { + int[] payIds = MPayment.getAllIDs(MPayment.Table_Name, "C_Invoice_ID = " + order.getC_Invoice_ID(), null); + for (int payId : payIds) + { + MPayment payment = new MPayment(ctx, payId, null); + + if (payment.get_ID() != 0) + { + if (payment.getDiscountAmt() != null) + { + discountAmt = discountAmt.add(payment.getDiscountAmt()); + } + subTotal = subTotal.add(payment.getPayAmt()); + grandTotal = grandTotal.add(payment.getPayAmt()); + } + } + } + + if(!subTotal.equals(Env.ZERO)) + { + try + { + totalGrossProfitPercentage = (totalGrossProfit.divide(subTotal, 4, BigDecimal.ROUND_UP)).multiply(Env.ONEHUNDRED); + } + catch (ArithmeticException e) + { + totalGrossProfitPercentage = Env.ZERO; + } + orderLineBean.setTotalGrossProfitPercentage(totalGrossProfitPercentage.setScale(2)); + } + + orderLineBean.setDiscountAmt(discountAmt); + orderLineBean.setSubTotal(subTotal); + orderLineBean.setGrandTotal(grandTotal); + orderLines.add(orderLineBean); + } + + return orderLines; + } + + private static I_C_CashLine getCashLine(Properties ctx, MOrder order) throws OperationException + { + int invoiceId = order.getC_Invoice_ID(); + MInvoice invoice = new MInvoice(ctx, invoiceId, null); + I_C_CashLine cashLine = null; + try + { + cashLine = invoice.getC_CashLine(); + } + catch (Exception e) + { + throw new OperationException("No cash line generated for invoice: " + invoiceId); + } + return cashLine; + } + + public static WebDocumentBean calculateOrderTotals(ArrayList webOrderLineList) + { + Iterator iter = webOrderLineList.iterator(); + + WebOrderLineBean bean; + WebDocumentBean webDocumentBean=new WebDocumentBean(); + BigDecimal totalLines = Env.ZERO; + BigDecimal totalTax = Env.ZERO; + BigDecimal totalQty= Env.ZERO; + BigDecimal discountAmt = Env.ZERO; + BigDecimal writeOffAmt = Env.ZERO; + BigDecimal subTotal = Env.ZERO; + BigDecimal grandTotal = Env.ZERO; + + while(iter.hasNext()) + { + bean = (WebOrderLineBean) iter.next(); + totalLines = totalLines.add(bean.getLineNetAmt()); + totalTax = totalTax.add(bean.getTaxAmt()); + totalQty=totalQty.add(bean.getQtyTotal()); + if (bean.getDiscountAmt()!=null && !bean.getDiscountAmt().equals(Env.ZERO)) + { + discountAmt = bean.getDiscountAmt(); + } + if (bean.getWriteOffAmt()!=null && !bean.getWriteOffAmt().equals(Env.ZERO)) + { + writeOffAmt = bean.getWriteOffAmt(); + } + } + + subTotal = totalLines.add(totalTax); + grandTotal = subTotal.subtract(discountAmt).subtract(writeOffAmt); + + webDocumentBean.setTotalLines(totalLines); + webDocumentBean.setTotalTax(totalTax); + webDocumentBean.setSubTotal(subTotal); + webDocumentBean.setGrandTotal(grandTotal); + webDocumentBean.setTotalQty(totalQty); + return webDocumentBean; + } + + + public static String deleteOrderLines(Properties ctx,Integer[]orderlineIds,String trxName) throws OperationException + { + if((orderlineIds == null)||(orderlineIds.length == 0)) + { + throw new NoOrderLineSelectedException("Cannot delete orderlines. No orderlines supplied!"); + } + + MOrderLine orderLine = new MOrderLine(ctx,orderlineIds[0].intValue(),trxName); + MOrder order = new MOrder(ctx,orderLine.getC_Order_ID(),trxName); + + String orderType = order.getOrderType(); + + for(int i=0;i getPOSInfoReportData(Properties ctx, Timestamp fromDate, Timestamp todate, String trxName) throws OperationException + { + ArrayList list = getPOSInfo(ctx, fromDate, todate, trxName); + ArrayList reportData = new ArrayList(); + + Object[] headers = new Object[]{"POS Name","Organisation","Cash Total","Card Total","Cheque Total","Amount"}; + reportData.add(headers); + + NumberFormat formatter = new DecimalFormat("###,###,##0.00"); + + Object[] data = null; + String grandTotal = null; + + for (POSInfoBean bean : list) + { + data = new Object[6]; + + data[0] = bean.getPosName(); + data[1] = bean.getOrgName(); + data[2] = formatter.format(bean.getCashTotal().doubleValue()); + data[3] = formatter.format(bean.getCardTotal().doubleValue()); + data[4] = formatter.format(bean.getChequeTotal().doubleValue()); + + //format the currency + grandTotal = formatter.format(bean.getOrderGrandTotal().doubleValue()); + + data[5] = grandTotal; + + reportData.add(data); + } + + return reportData; + } + + protected static boolean firstCashInvoice(Properties ctx, MInvoice invoice) throws OperationException + { + boolean firstCashInvoice = false; + if (invoice != null && invoice.getC_CashLine_ID() > 0) + { + StringBuffer whereClause = new StringBuffer(); + whereClause.append("C_Cash_ID=(SELECT C_Cash_ID FROM C_CashLine WHERE C_CashLine_ID=") + .append(invoice.getC_CashLine_ID()) + .append(")"); + whereClause.append(" AND CashType='").append(MCashLine.CASHTYPE_Invoice).append("'"); + + int ids[] = MCashLine.getAllIDs(MCashLine.Table_Name, whereClause.toString(), invoice.get_TrxName()); + + firstCashInvoice = (ids.length == 1); + } + return firstCashInvoice; + } + + + public static BigDecimal getSumOfChequeAndCard(Properties ctx,Timestamp toDate,String paymentRule) throws OperationException + { + int terminalId = POSTerminalManager.getTerminalId(ctx); + BigDecimal grandTotal =null; + + String sql="select sum(pay.payAmt) " + + " from C_order ord,c_payment pay right outer join C_invoice inv on inv.c_Invoice_id=pay.c_Invoice_id" + + " where pay.created>="+ DB.TO_DATE(toDate, false) + + " and inv.c_order_id=ord.c_order_id"+ + " and ord.C_POS_ID="+terminalId+ + " and ord.AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+ + " and ord.AD_ORG_ID="+Env.getAD_Org_ID(ctx)+ + " and inv.isSotrx='Y'"+ + " and ord.orderType in ('"+UDIOrderTypes.POS_ORDER.getOrderType()+"',"+ + "'"+UDIOrderTypes.CREDIT_ORDER.getOrderType()+"')"+ + " and pay.tenderType='"+paymentRule+"'"; + + PreparedStatement pstmt = DB.prepareStatement(sql,null); + + try + { + ResultSet rs = pstmt.executeQuery(); + + while(rs.next()) + { + if(rs.getString(1)==null) + grandTotal=new BigDecimal(0); + else + grandTotal=new BigDecimal(rs.getString(1)); + + grandTotal=grandTotal.add(paymentAmtWithOutInvoice(ctx,toDate,null,paymentRule,terminalId)); + } + + rs.close(); + } + catch (SQLException e) + { + throw new OperationException(e); + } + finally + { + try + { + pstmt.close(); + } + catch(Exception e) {} + + pstmt = null; + + } + + return grandTotal; + + } + + /** + * @ashley TODO Should look further into this workaround solution + * @param ctx + * @param fromDate + * @param toDate + * @param paymentRule + * @param terminalId + * @return + * @throws OperationException + */ + private static BigDecimal paymentAmtWithOutInvoice(Properties ctx, Timestamp fromDate, Timestamp toDate, + String paymentRule,int terminalId) throws OperationException + { + BigDecimal grandTotal =null; + String sql="select sum(pay.payAmt) " + + "from C_PAYMENT pay " ; + if(toDate==null) + { + sql=sql+ "where pay.created>= " + DB.TO_DATE(fromDate, false); + } + else + { + sql=sql+ " where pay.created between " + DB.TO_DATE(fromDate, false) + " AND " + DB.TO_DATE(toDate, false); + } + + + sql=sql+" and not exists(select * from c_invoice inv where pay.C_invoice_id=inv.c_invoice_id)" + + " and pay.tenderType='"+paymentRule+"'"; + + sql=sql+" and pay.description='"+terminalId+"'"; //pos id was saved into descriptuon while creating the payment for multiple invoice + + + PreparedStatement pstmt = DB.prepareStatement(sql,null); + try + { + ResultSet rs = pstmt.executeQuery(); + + while(rs.next()) + { + if(rs.getString(1)==null) + grandTotal=new BigDecimal(0); + else + grandTotal=new BigDecimal(rs.getString(1)); + } + + rs.close(); + } + catch (SQLException e) + { + throw new OperationException(e); + } + finally + { + try + { + pstmt.close(); + } + catch(Exception e) {} + + pstmt = null; + + } + + return grandTotal; + } + + + public static BigDecimal getSumOfChequeAndCardPaymentsForInfo(Properties ctx, Timestamp fromDate,Timestamp toDate,String paymentRule,int posId) throws OperationException + { + BigDecimal grandTotal =null; + + String sql="select sum(pay.payAmt) " + + " from C_INVOICE inv,C_order ord,c_payment pay " + + " where inv.c_order_id=ord.c_order_id"+ + " and inv.c_Invoice_id=pay.c_Invoice_id"+ + " and ord.C_POS_ID="+posId+ + " and ord.AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+ + " and ord.AD_ORG_ID="+Env.getAD_Org_ID(ctx)+ + " and inv.isSotrx='Y'"+ + " and ord.orderType in ('"+UDIOrderTypes.POS_ORDER.getOrderType()+"',"+ + "'"+UDIOrderTypes.CREDIT_ORDER.getOrderType()+"')"+ + " and pay.tenderType='"+paymentRule+"'"+ + " and pay.created between " + DB.TO_DATE(fromDate, false) + + " and " + DB.TO_DATE(toDate, false) ; + + PreparedStatement pstmt = DB.prepareStatement(sql,null); + + try + { + ResultSet rs = pstmt.executeQuery(); + + while(rs.next()) + { + if(rs.getString(1)==null) + grandTotal=new BigDecimal(0); + else + grandTotal=new BigDecimal(rs.getString(1)); + + grandTotal=grandTotal.add(paymentAmtWithOutInvoice(ctx,fromDate,toDate,paymentRule,posId)); + } + + rs.close(); + } + catch (SQLException e) + { + throw new OperationException(e); + } + finally + { + try + { + pstmt.close(); + } + catch(Exception e) {} + + pstmt = null; + + } + + return grandTotal; + + } + + /** + * It returns the date-time of last completed cash journal + * @param ctx + * @param cashBookId + * @return + * @throws OperationException + */ + public static Timestamp getTimeOfLastCompletedJournal(Properties ctx, int cashBookId, String trxName) throws OperationException + { + Timestamp lastDateTime = TimestampConvertor.getCurrentDateTimestamp(); + + StringBuffer sqlStmt = new StringBuffer(); + sqlStmt.append("SELECT MAX(cl.Created) FROM C_Cash c "); + sqlStmt.append("INNER JOIN C_CashLine cl ON cl.C_Cash_ID = c.C_Cash_ID "); + sqlStmt.append("WHERE c.C_CashBook_ID=? "); + sqlStmt.append("AND c.DocStatus IN ('CO', 'CL')"); + + PreparedStatement pstmt = null; + ResultSet rs = null; + + try + { + pstmt = DB.prepareStatement(sqlStmt.toString(), trxName); + pstmt.setInt(1, cashBookId); + + rs = pstmt.executeQuery(); + + if (rs.next() && rs.getTimestamp(1) != null) + { + lastDateTime = rs.getTimestamp(1); + } + } + catch (Exception exception) + { + throw new OperationException("Could not get last completed journal date and time", exception); + } + + return lastDateTime; + } + + private static CurrentTillAmountBean getCurrentTillForInfo(Properties ctx, int terminalId, Timestamp fromDate, Timestamp toDate) throws OperationException + { + BigDecimal cardSum = BigDecimal.valueOf(0.0); + BigDecimal chequeSum = BigDecimal.valueOf(0.0); + BigDecimal cashSum=new BigDecimal(0); + BigDecimal grandTotal; + BigDecimal beginingBalance=null; + BigDecimal statementDifference=null; + int cashBookId = POSTerminalManager.getCashBookId(ctx, terminalId); + cardSum = getSumOfChequeAndCardPaymentsForInfo(ctx,fromDate,toDate,MPayment.TENDERTYPE_CreditCard,terminalId); + chequeSum = getSumOfChequeAndCardPaymentsForInfo(ctx,fromDate,toDate,MPayment.TENDERTYPE_Check,terminalId); + ArrayList list = CashManager.getCashBookDetailsForTill(ctx, cashBookId,fromDate,toDate); + Iterator iter = list.iterator(); + + CashBookDetailBean cashDetBean; + while(iter.hasNext()) + { + cashDetBean = (CashBookDetailBean)iter.next(); + beginingBalance=cashDetBean.getBeginingBalance(); + statementDifference=cashDetBean.getStatementDifference(); + cashSum=cashDetBean.getStatementDifference(); + + } + + grandTotal = new BigDecimal(cardSum.doubleValue()+chequeSum.doubleValue()+cashSum.doubleValue()); + + CurrentTillAmountBean bean = new CurrentTillAmountBean(); + bean.setBeginingBalance(beginingBalance); + bean.setStatementDifference(statementDifference); + bean.setCardTotal(cardSum); + bean.setCashTotal(cashSum); + bean.setChequeTotal(chequeSum); + bean.setTillGrandTotal(grandTotal); + bean.setPosName(POSTerminalManager.getTerminalName(ctx, terminalId)); + + return bean; + } + + public static CurrentTillAmountBean getCurrentTillAmount(Properties ctx) throws OperationException + { + BigDecimal cardSum ; + BigDecimal chequeSum; + BigDecimal cashSum=new BigDecimal(0); + BigDecimal grandTotal; + BigDecimal beginingBalance=null; + BigDecimal statementDifference=null; + + int cashBookId = POSTerminalManager.getCashBookId(ctx); + Timestamp toDate = getTimeOfLastCompletedJournal(ctx, cashBookId, null); + cardSum = getSumOfChequeAndCard(ctx,toDate,MPayment.TENDERTYPE_CreditCard); + chequeSum = getSumOfChequeAndCard(ctx,toDate,MPayment.TENDERTYPE_Check); + CashBookDetailBean cashDetBean = CashManager.getCashBookDetails(ctx, null); + + // Recently completed journal and not new cash transaction performed + // Thus the Till beginning balance should be the ending balance + // as the new cash journal will have + if (DocumentEngine.STATUS_Completed.equals(cashDetBean.getDocStatus())) + { + beginingBalance = cashDetBean.getEndingBalance(); + statementDifference = Env.ZERO; + cashSum = beginingBalance; + } + else + { + beginingBalance=cashDetBean.getBeginingBalance(); + statementDifference=cashDetBean.getStatementDifference(); + cashSum=cashDetBean.getStatementDifference().add(cashDetBean.getBeginingBalance()); + } + + grandTotal = new BigDecimal(cardSum.doubleValue()+chequeSum.doubleValue()+cashSum.doubleValue()); + + CurrentTillAmountBean bean = new CurrentTillAmountBean(); + bean.setBeginingBalance(beginingBalance); + bean.setStatementDifference(statementDifference); + bean.setCardTotal(cardSum); + bean.setCashTotal(cashSum); + bean.setChequeTotal(chequeSum); + bean.setTillGrandTotal(grandTotal); + bean.setPosName(POSTerminalManager.getTerminalName(ctx)); + + return bean; + + } + + public static MInvoice createCustomerInvoice(Properties ctx, MOrder salesOrder) throws OperationException + { + MInvoice invoice = null; + + boolean isSOTrx = salesOrder.isSOTrx(); + + if (!isSOTrx) + throw new OperationException("Customer Invoice should be created from sales Order"); + + MDocType [] docType; + boolean isSotrx=true; + + if (salesOrder.getOrderType().equals(UDIOrderTypes.CUSTOMER_RETURN_ORDER.getOrderType())) + docType = MDocType.getOfDocBaseType(ctx,MDocType.DOCBASETYPE_ARCreditMemo); + + else if (salesOrder.getOrderType().equals(UDIOrderTypes.CREDIT_MEMO.getOrderType())) + docType = MDocType.getOfDocBaseType(ctx,MDocType.DOCBASETYPE_ARCreditMemo); + + else if (salesOrder.getOrderType().equals(UDIOrderTypes.POS_GOODS_RETURN_NOTE.getOrderType())) + { + docType = MDocType.getOfDocBaseType(ctx,MDocType.DOCBASETYPE_APCreditMemo); + isSotrx=false; + } + else + docType = MDocType.getOfDocBaseType(ctx,MDocType.DOCBASETYPE_ARInvoice); + invoice = new MInvoice(salesOrder,docType[0].get_ID(),new Timestamp(System.currentTimeMillis())); + invoice.setIsSOTrx(isSotrx); + invoice.setC_Order_ID(salesOrder.get_ID()); + invoice.setPaymentRule(salesOrder.getPaymentRule()); + invoice.setC_DocTypeTarget_ID(docType[0].get_ID()); + invoice.setC_DocType_ID(docType[0].get_ID()); + invoice.setC_BPartner_ID(salesOrder.getC_BPartner_ID()); + invoice.setC_Currency_ID(salesOrder.getC_Currency_ID()); + invoice.setIsTaxIncluded(false); + invoice.setIsDiscountPrinted(true); + invoice.setTotalLines(salesOrder.getTotalLines()); + invoice.setGrandTotal(salesOrder.getGrandTotal()); + invoice.setC_PaymentTerm_ID(salesOrder.getC_PaymentTerm_ID()); + + PoManager.save(invoice); + + + MOrderLine [] orderLines=salesOrder.getLines(); + MInvoiceLine invoiceLine; + MTax tax; + + for( int i=0;i < orderLines.length;i++) + { + + invoiceLine = new MInvoiceLine(invoice); + invoiceLine.setOrderLine(orderLines[i]); + invoiceLine.setC_OrderLine_ID(orderLines[i].get_ID()); + invoiceLine.setQtyEntered(orderLines[i].getQtyEntered()); + invoiceLine.setM_AttributeSetInstance_ID(orderLines[i].getM_AttributeSetInstance_ID()); + + + tax = new MTax(ctx,orderLines[i].getC_Tax_ID(),null); + invoiceLine.setQty(orderLines[i].getQtyEntered()); + invoiceLine.setQtyEntered(orderLines[i].getQtyEntered()); + invoiceLine.setQtyInvoiced(orderLines[i].getQtyEntered()); + invoiceLine.setTaxAmt(tax.calculateTax(orderLines[i].getLineNetAmt(),false,3)); + invoiceLine.setLineNetAmt(orderLines[i].getLineNetAmt()); + invoiceLine.setLineTotalAmt(new BigDecimal(orderLines[i].getLineNetAmt().intValue()+tax.calculateTax(orderLines[i].getLineNetAmt(),false,3).intValue())); + + + PoManager.save(invoiceLine); + } + + return invoice; + } + + + /** + * Creates an Invoice for a sales order + * @param ctx Context + * @param salesOrderId Sales Order + * @param trxType Payment Rule + * @param trxName Transaction + * @return Invoice + * @throws OperationException if could not save invoice + */ + protected static MInvoice createARInvoice(Properties ctx, int salesOrderId, String trxName) throws OperationException + { + MOrder salesOrder = new MOrder(ctx,salesOrderId,trxName); + MInvoice invoice = null; + + boolean isSOTrx = salesOrder.isSOTrx(); + if (!isSOTrx) + { + throw new OperationException("AR Invoice should be created from sales Order"); + } + + if (!DocumentEngine.STATUS_Completed.equals(salesOrder.getDocStatus())) + { + throw new OperationException("Order not in completed status, Status: " + salesOrder.getDocStatus()); + } + + invoice = new MInvoice(salesOrder, 0, salesOrder.getDateOrdered()); + PoManager.save(invoice); + + return invoice; + } + + /** + * Create Invoice lines from OrderLines + * @param ctx + * @param invoice + * @param salesOrder + * @param trxName + * @throws OperationException if Line cannot be created + */ + protected static void createInvoiceLines(Properties ctx, MInvoice invoice, MOrder order, String trxName) throws OperationException + { + MOrderLine [] orderLines = order.getLines(); + MInvoiceLine invoiceLine; + + for( int i=0;i < orderLines.length;i++) + { + invoiceLine = new MInvoiceLine(invoice); + invoiceLine.setOrderLine(orderLines[i]); + invoiceLine.setQty(orderLines[i].getQtyEntered()); + PoManager.save(invoiceLine); + } + } + + public static boolean getCashDrawerStatusFromCookie(HttpServletRequest request) + { + String status = getDataFromCookie(request, "preference.cashdrawer"); + return "true".equalsIgnoreCase(status); + } + + public static String getPrintingTypeFromCookie(HttpServletRequest request) + { + return getDataFromCookie(request, "preference.printerType"); + } + + public static String getDataFromCookie(HttpServletRequest request, String key) + { + Cookie[] cookies = request.getCookies(); + String value = null; + + if(cookies != null) + { + for(int i=0;i cartItems = new ArrayList(); + + MOrderLine[] orderlines = order.getLines(); + MOrderLine orderline = null; + ItemBean item = null; + BigDecimal orderTotal = Env.ZERO; + BigDecimal orderTaxTotal = Env.ZERO; + BigDecimal orderQtyTotal = Env.ZERO; + + + for (int i = 0; i < orderlines.length; i++) + { + int c_tax_id = orderlines[i].getC_Tax_ID(); + MTax tax = new MTax(ctx, c_tax_id, null); + + orderline = orderlines[i]; + item = new ItemBean(); + item.setTaxRate(tax.getRate()); + + MProduct product = orderline.getProduct(); + + String description = product.getName(); + int productId = product.get_ID(); + BigDecimal qty = orderline.getQtyOrdered(); + String uom = product.getUOMSymbol(); + + //Prices + BigDecimal actualPrice = orderline.getPriceActual(); + BigDecimal lineNetAmt = actualPrice.multiply(qty); + + BigDecimal lineNetTaxAmt = tax.calculateTax(lineNetAmt, priceList.isTaxIncluded(), 2); + BigDecimal lineUnitTaxAmt = tax.calculateTax(actualPrice, priceList.isTaxIncluded(), 2); + + if (!priceList.isTaxIncluded()) + { + lineNetAmt = lineNetAmt.add(lineNetTaxAmt); + item.setUnitPrice(actualPrice); + item.setInclPrice(actualPrice.add(lineUnitTaxAmt)); + } + else + { + item.setInclPrice(actualPrice); + item.setUnitPrice(actualPrice.subtract(lineUnitTaxAmt)); + } + + item.setIsTaxIncluded(priceList.isTaxIncluded()); + item.setListPrice(orderline.getPriceList()); + item.setPriceLimit(orderline.getPriceLimit()); + item.setProductId(Integer.valueOf(productId)); + item.setDescription(description); + item.setQty(qty); + item.setUom(uom); + item.setProductName(product.getName()); + + item.setTaxAmt(lineNetTaxAmt); + item.setPrice(lineNetAmt); + item.setDiscountPercent(orderline.getDiscount()); + + //calculating totals + orderQtyTotal = orderQtyTotal.add(qty); + orderTaxTotal = orderTaxTotal.add(lineNetTaxAmt); + orderTotal = orderTotal.add(lineNetAmt); + + cartItems.add(item); + } + + cart.setTotalPrice(orderTotal); + cart.setItems(cartItems); + return cart; + } + + + public static ShoppingCartBean getShoppingCartForOrderInEdit(Properties ctx, int orderId, String trxName) throws OperationException + { + MOrder order = new MOrder(ctx, orderId, trxName); + + if(order==null) + throw new InvalidOrderIDException("Order is not present"); + + ShoppingCartBean cart = new ShoppingCartBean(); + + int priceListId = Env.getContextAsInt(ctx, UdiConstants.PRICELIST_CTX_PARAM); + String currency = PriceListManager.getCurrency(ctx, priceListId); + + /* if (currency.equals("EUR")) + cart.setCurrency(Constants.EURO_SIGN); + else */ + cart.setCurrency(currency); + + ArrayList cartItems = new ArrayList(); + + MOrderLine[] orderlines = order.getLines(); + MOrderLine orderline = null; + ItemBean item = null; + double total=0; + double taxTotal=0; + double priceTotal=0; + double qtyTotal=0; + + for (int i = 0; i < orderlines.length; i++) + { + orderline = orderlines[i]; + item = new ItemBean(); + + MProduct product = orderline.getProduct(); + + String description = product.getName(); + int productId = product.get_ID(); + BigDecimal qty = orderline.getQtyOrdered(); + + item.setProductId(Integer.valueOf(productId)); + item.setDescription(description); + item.setQty(qty); + + int [] taxIds = MTax.getAllIDs(MTax.Table_Name,"AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+" and C_TAXCATEGORY_ID="+product.getC_TaxCategory_ID() + " and isActive='Y'",null); + if(taxIds.length==0) + throw new OperationException("no tax Category for the product"); + MTax tax = new MTax(ctx,taxIds[0],null); + BigDecimal priceTax= tax.calculateTax(orderline.getLineNetAmt(),false,2); + + + + item.setUnitPrice(orderline.getPriceEntered()); + item.setStandardPrice(orderline.getLineNetAmt()); + item.setTaxAmt(priceTax); + item.setPrice(orderline.getLineNetAmt().add(priceTax)); + item.setActualPrice(orderline.getLineNetAmt().add(priceTax)); //initially price and the actual price are same + + priceTotal=priceTotal+orderline.getLineNetAmt().doubleValue(); + taxTotal=taxTotal+priceTax.doubleValue(); + total=total+orderline.getLineNetAmt().add(priceTax).doubleValue(); + qtyTotal=qtyTotal+qty.doubleValue(); + + item.setPriceTotal(new BigDecimal(priceTotal)); + item.setTaxTotal(new BigDecimal(taxTotal)); + item.setgrandTotal(new BigDecimal(total)); + item.setQtyTotal(new BigDecimal(qtyTotal)); + item.setDiscountPercent(orderline.getDiscount()); + + cartItems.add(item); + } + + //setting prices + // StockManager.setPOSItemPrices(ctx,cartItems,true); + + BigDecimal totalPrice = new BigDecimal(0.0d); + for(ItemBean bean:cartItems) + { + if(bean.getPriceTotal()!=null) + { + totalPrice = totalPrice.add(bean.getPriceTotal()); + } + } + + cart.setTotalPrice(totalPrice); + cart.setItems(cartItems); + + return cart; + } + + + + public static OrderBean getPOSOrderDetail(Properties ctx,String documentNo) throws InvalidOrderIDException,OperationException + { +// checking whether order exixts + int ids[] = MOrder.getAllIDs(MOrder.Table_Name,"ISACTIVE='Y' AND DOCUMENTNO = '" + documentNo + "' and AD_CLIENT_ID="+Env.getAD_Client_ID(ctx),null); + + if((ids == null)||(ids.length == 0)) + { + throw new InvalidOrderIDException("Could not found order!"); + } + + if(ids.length>1) + throw new OperationException("two orders with same document number"); + + MOrder order= OrderManager.loadOrder(ctx, ids[0], null); + OrderBean bean=new OrderBean(); + bean.setOrderId(order.get_ID()); + bean.setBpartnerId(order.getC_BPartner_ID()); + bean.setDocStatus(order.getDocStatus()); + bean.setOrderType(order.getOrderType()); + bean.setPaymentTermId(order.getC_PaymentTerm_ID()); + + return bean; + + } + + public static MOrder createAndCompletePOSOrder(Properties ctx,OrderLineBean bean,ArrayList cartBeanItems) throws BPartnerOverCreditLimitException,OperationException, DiscountLimitException + { + + MOrder order = null; + + Trx trx = Trx.get(TrxPrefix.getPrefix(),true); + + try + { + trx.start(); + order = createPOSOrder(ctx, bean, cartBeanItems,null/*trx.getTrxName()*/); + trx.commit(); + } + catch (OperationException e) + { + trx.rollback(); + throw (e); + } + finally + { + trx.close(); + } + + + OrderLineBean orderLineBean = new OrderLineBean(); + + if(order.getPaymentRule().equalsIgnoreCase(MOrder.PAYMENTRULE_Cash)) + { + MOrder newOrder = new MOrder(ctx,order.get_ID(),null);//has to load again as it is not getting the grand total + orderLineBean.setAmountGiven(newOrder.getGrandTotal()); + orderLineBean.setAmountRefunded(new BigDecimal(0)); + } + + order = completePOSOrder(ctx, order.get_ID(), orderLineBean, null); + + return order; + } + + public static BigDecimal getPayment(Properties ctx, int orderId, String tenderType, String trxName) throws OperationException + { + MOrder order = OrderManager.loadOrder(ctx,orderId,trxName); + + if(! UDIOrderTypes.POS_ORDER.getOrderType().equalsIgnoreCase(order.getOrderType())) + { + throw new OperationException("Only POS Orders are supported!"); + } + + if(! MOrder.DOCSTATUS_Completed.equalsIgnoreCase(order.getDocStatus())) + { + throw new OperationException("Document is not yet completed!"); + } + + boolean isCheck = MPayment.TENDERTYPE_Check.equalsIgnoreCase(tenderType); + boolean isCard = MPayment.TENDERTYPE_CreditCard.equalsIgnoreCase(tenderType); + boolean isCash = "S".equalsIgnoreCase(tenderType); + + if(isCash) + { + return order.getAmountTendered(); + } + + if(isCheck || isCard) + { + String whereClause = " C_ORDER_ID = " + orderId + + " AND TENDERTYPE = '" + tenderType + "'"; + + int[] ids = MPayment.getAllIDs(MPayment.Table_Name,whereClause,trxName); + + if(ids == null || ids.length == 0) + { + return new BigDecimal(0.0d); + } + + MPayment payment = new MPayment(ctx,ids[0],trxName); + + return payment.getPayAmt(); + } + + throw new OperationException("Invalid tender type :" + tenderType); + + } + + public static String getForward(Properties ctx,String orderType) + { + + if(orderType.equalsIgnoreCase(UDIOrderTypes.POS_ORDER.getOrderType())) + { + return "/CreatePOSOrder.do"; + } + if(orderType.equalsIgnoreCase(UDIOrderTypes.CUSTOMER_RETURN_ORDER.getOrderType())) + { + return "/CustomerReturnOrder.do"; + } + + if(orderType.equalsIgnoreCase(UDIOrderTypes.CREDIT_ORDER.getOrderType())) + { + return "/InitCreateCreditOrderAction.do?action=initCreateCreditOrder"; + } + + if(orderType.equalsIgnoreCase(UDIOrderTypes.POS_GOODS_RECEIVE_NOTE.getOrderType())) + { + return "/GetAllPOSVendor.do?action=getAllVendors&isSales=true"; + } + if(orderType.equalsIgnoreCase(UDIOrderTypes.POS_GOODS_RETURN_NOTE.getOrderType())) + { + return "/GetAllPOSVendor.do?action=getAllVendors&isSales=false"; + } + + else return "/CreatePartialPOSOrder.do"; + + } + + public static ArrayList getItemBean(ArrayList itemBean) + { + ArrayList list = new ArrayList(); + for(ItemBean bean : itemBean) + { + if(bean.getUnitPrice().compareTo(bean.getStandardPrice())==0 && bean.getDiscountPercent().doubleValue() > 0) + { + double disPer = bean.getDiscountPercent().doubleValue(); + double stanPrice = bean.getStandardPrice().doubleValue(); + double newStanPrice = stanPrice -( (stanPrice*disPer)/100); + bean.setStandardPrice(new BigDecimal(newStanPrice)); + + } + + list.add(bean); + } + + return list; + } + + //---------------------------------------------------------------------------------------------- + + public static int checkoutOrder(Properties ctx, CheckoutBean checkoutBean, ArrayList items, String trxName) throws Exception + { + boolean isSoTrx = true; + String orderType = checkoutBean.getOrderType(); + + int m_pricelist_id = POSTerminalManager.getSOPriceListId(ctx); + int m_warehouse_id = POSTerminalManager.getWarehouseId(ctx); + int cashBookId = POSTerminalManager.getCashBookId(ctx); + + //close previous cash journals + if(firstOrderOfTheDay(ctx)) + { + CashManager.closePreviousDraftedCashjournals(ctx, cashBookId, trxName); + } + + Integer c_bpartner_id = checkoutBean.getBpartnerId(); + + //takes bp pricelist + if(c_bpartner_id != null) + { + MBPartner bpartner = MBPartner.get(ctx, c_bpartner_id); + if(bpartner != null && bpartner.getM_PriceList_ID() > 0) + { + m_pricelist_id = bpartner.getM_PriceList_ID(); + } + } + else + { + //set standard customer + c_bpartner_id = POSTerminalManager.getCashBPartnerId(ctx); + } + + String tenderType = checkoutBean.getTenderType(); + String paymentRule = checkoutBean.getPaymentRuleFromTenderType(); + + //create order + MOrder order = OrderManager.createOrder(ctx, c_bpartner_id, isSoTrx, m_pricelist_id, orderType, + m_warehouse_id, paymentRule, trxName); + + + BigDecimal[] discounts = checkoutBean.getDiscount(); + BigDecimal grandTotal = Env.ZERO; + + for(int i=0; i items = (ArrayList) request.getSession().getAttribute(Constants.SHOPPING_ORDER_CART_ITEMS); + + ArrayList newItems = new ArrayList(); + + if (items == null || items.isEmpty()) + { + return; + } + + BigDecimal grandTotal = Env.ZERO; + BigDecimal grandTotalWithoutDiscount = Env.ZERO; + + int roleId = Env.getAD_Role_ID(ctx); + MRole role = MRole.get(ctx, roleId); + BigDecimal userDiscount = role.getUserDiscount(); + BigDecimal discountLimit = userDiscount; + + BigDecimal newOrderTotal = checkoutBean.getDiscountedTotal(); + BigDecimal newOrderDiscount = checkoutBean.getTotalDiscount(); + + if (newOrderDiscount.compareTo(discountLimit) == 1) // fraud! + { + throw new DiscountLimitException("user discount limit exceeded on total, " + + "discount percentage of " + newOrderDiscount +" was tried to be given"); + } + + Iterator itemBeanIter = items.iterator(); + BigDecimal priceLimitTotal = Env.ZERO; + + while (itemBeanIter.hasNext()) + { + ItemBean item = itemBeanIter.next(); + BigDecimal priceLimit = item.getPriceLimit(); + if (priceLimit == null) + { + throw new OperationException("Product "+ item.getProductName()+" has no price limit"); + } + priceLimitTotal = priceLimitTotal.add(priceLimit); + } + + if (priceLimitTotal.compareTo(newOrderTotal) == 1) //fraud! + { + throw new DiscountLimitException("user discount limit exceeded on total, " + + "total of " + newOrderTotal + "was tried to be given"); + } + + for(int i=0; i< prices.length; i++) + { + BigDecimal price = prices[i]; + Boolean isDiscOnInclUnitPrice = false; + BigDecimal discountedInclUnitPrice = Env.ZERO; + Boolean isDiscOnPerc = false; + Boolean isDiscOnTotal = false; + + if (isDiscOnInclUnitPrices != null) + { + isDiscOnInclUnitPrice = isDiscOnInclUnitPrices[i]; + } + if (discountedInclUnitPrices!= null) + { + discountedInclUnitPrice = discountedInclUnitPrices[i]; + } + if(isDiscountsOnPerc != null) + { + isDiscOnPerc = isDiscountsOnPerc[i]; + } + if(isDiscountsOnTotal != null) + { + isDiscOnTotal = isDiscountsOnTotal[i]; + } + ItemBean bean = items.get(i); + + BigDecimal unitPrice = bean.getUnitPrice(); + BigDecimal inclUnitPrice = bean.getInclPrice(); + BigDecimal listPrice = bean.getListPrice(); + BigDecimal qty = bean.getQty(); + BigDecimal total = Env.ZERO; + BigDecimal tax = bean.getTaxAmt(); + BigDecimal taxRate = bean.getTaxRate() == null? Env.ZERO: bean.getTaxRate(); + BigDecimal taxMulFactor = (taxRate.divide(Env.ONEHUNDRED, 2, RoundingMode.HALF_UP)).add(Env.ONE); + + BigDecimal discount = Env.ZERO; + BigDecimal actualPrice = Env.ZERO; + + if (priceList.isTaxIncluded()) + { + actualPrice = inclUnitPrice; + } + else + { + actualPrice = unitPrice; + } + + total = actualPrice.multiply(qty); + + // verify fraud + + if (!isDiscOnInclUnitPrice && !actualPrice.equals(discountedInclUnitPrice)) + { + if (discountedInclUnitPrice.compareTo(bean.getPriceLimit()) == -1) + { + throw new OperationException("incl unit price less than limit price, a value of " + + discountedInclUnitPrice + "was tried to be given"); + } + if (discountedInclUnitPrice.compareTo(bean.getListPrice()) == 1) + { + throw new OperationException("incl unit price less greater list price, a value of " + + discountedInclUnitPrice + "was tried to be given"); + } + } + if (!isDiscOnPerc && !discountPerc[i].equals(bean.getDiscountPercent())) + { + if (discountPerc[i].compareTo(Env.ZERO) == -1) + { + throw new OperationException("user discount less than zero on product " + + "" + bean.getProductName() +", discount percentage given is "+ discountPerc[i]); + } + if (discountPerc[i].compareTo(discountLimit) == 1) + { + throw new OperationException("user discount exceeds discount limit on product " + + "" + bean.getProductName() +", discount percentage given is "+ discountPerc[i]); + } + } + if (!isDiscOnTotal && !total.equals(price)) + { + if (price.compareTo(bean.getPriceLimit().multiply(bean.getQty())) == -1) + { + throw new OperationException("line total less than price limit total, a value of " + + price+" was tried to be given"); + } + + if (price.compareTo(bean.getListPrice().multiply(bean.getQty())) == 1) + { + throw new OperationException("line total greater than price list total, a value of " + + price+" was tried to be given"); + } + } + + if (isDiscOnInclUnitPrice) + { + discount = (listPrice.subtract(discountedInclUnitPrice)).divide(listPrice, 12, RoundingMode.HALF_UP).multiply(Env.ONEHUNDRED); + actualPrice = discountedInclUnitPrice; + } + else if (isDiscOnPerc) + { + discount = discountPerc[i]; + actualPrice = price.divide(qty, 2, RoundingMode.HALF_UP); + } + else if (isDiscOnTotal) + { + discount = ((total.subtract(price)).divide(total, 4, RoundingMode.HALF_UP)).multiply(Env.ONEHUNDRED); + actualPrice = price.divide(qty, 2, RoundingMode.HALF_UP); + bean.setIsDiscountOnTotal(false); // reset + } + + if (discount.compareTo(discountLimit) == 1) + { + throw new DiscountLimitException("user discount limit exceeded on product " + bean.getProductName() +", discount percentage given is "+ discount); + } + + // fraud verified + + bean.setActualPrice(actualPrice); + + if (priceList.isTaxIncluded()) + { + BigDecimal exclActualPrice = actualPrice.divide(taxMulFactor, 2, RoundingMode.HALF_UP); + tax = actualPrice.subtract(exclActualPrice); + unitPrice = actualPrice.divide(taxMulFactor, 2, RoundingMode.HALF_UP); + bean.setInclPrice(actualPrice); + } + else + { + tax = actualPrice.divide(taxMulFactor, 4).setScale(2, RoundingMode.HALF_UP); + bean.setInclPrice(actualPrice); + } + + bean.setTaxAmt(tax.multiply(qty)); + bean.setUnitPrice(unitPrice); + bean.setDiscountPercent(discount); + bean.setPrice(price); + bean.setIsDiscountOnInclUnitPrice(isDiscOnInclUnitPrice); + bean.setIsDiscountOnPercentage(isDiscOnPerc); + bean.setIsDiscountOnTotal(isDiscOnTotal); + + if (isDiscOnInclUnitPrice!=null && isDiscOnInclUnitPrice) + { + bean.setDiscountedInclUnitPrice(discountedInclUnitPrice); + bean.setDiscountedLinePrice(discountedInclUnitPrice); + } + // todo - remove that grand total hack + grandTotal = grandTotal.add(price); + bean.setgrandTotal(grandTotal); + grandTotalWithoutDiscount = grandTotalWithoutDiscount.add(total); + + newItems.add(bean); + } + + //Check for discount on total + request.getSession().setAttribute(Constants.DISCOUNT_ON_ORDER_TOTAL, checkoutBean.getDiscountOnTotal()); + request.getSession().setAttribute(Constants.DISCOUNT_ON_ORDER_TOTAL_PERCENT, checkoutBean.getDiscountOnTotalPercent()); + request.getSession().setAttribute(Constants.SHOPPING_CART_DISCOUNT_PERCENTAGE, newOrderDiscount); + request.getSession().setAttribute(Constants.SHOPPING_CART_DISCOUNTED_TOTAL, newOrderTotal); + request.getSession().setAttribute(Constants.SHOPPING_CART_TOTAL, grandTotal); + request.getSession().setAttribute(Constants.SHOPPING_ORDER_CART_ITEMS, newItems); + request.getSession().setAttribute(Constants.CHECKOUT_BEAN, checkoutBean); + + } + + + public static void setQuickDiscount(Properties ctx, CheckoutBean checkoutBean, HttpServletRequest request, String trxName) throws OperationException, DiscountLimitException + { + BigDecimal[] prices = checkoutBean.getDiscountedPrice(); + Boolean[] isDiscOnInclUnitPrices = checkoutBean.getIsDiscOnInclUnitPrice(); + BigDecimal[] discountPerc = checkoutBean.getDiscount(); + Boolean[] isDiscountsOnPerc = checkoutBean.getIsDiscOnPerc(); + Boolean[] isDiscountsOnTotal = checkoutBean.getIsDiscOnTotal(); + Integer priceListId = checkoutBean.getPriceListId(); + Integer productId = checkoutBean.getM_productId(); + BigDecimal totalLinesIncDisc = checkoutBean.getGrandTotal(); + MPriceList priceList = MPriceList.get(ctx, priceListId, trxName); + int priceListVersionId = 0; + + String currency = (String) request.getSession().getAttribute(Constants.CURRENCY_SYMBOLE); + + int roleId = checkoutBean.getRoleId(); + MRole role = MRole.get(ctx, roleId); + BigDecimal userDiscount = role.getUserDiscount(); + BigDecimal discountLimit = userDiscount; + boolean isDiscountAllowedOnTotal = role.isDiscountAllowedOnTotal(); + boolean isDiscountUptoLimitPrice = role.isDiscountUptoLimitPrice(); + boolean isOverideLimitPrice = role.isOverwritePriceLimit(); + + if (priceListId != null) + { + MPriceListVersion plv = PriceListManager.getPriceListVersion(ctx, priceListId, null, trxName); + priceListVersionId = plv.get_ID(); + } + + ArrayList items = (ArrayList) request.getSession().getAttribute(Constants.SHOPPING_ORDER_CART_ITEMS); + + if (items == null || items.isEmpty()) + { + return; + } + + Iterator iter = items.iterator(); + ItemBean bean; + + if(isDiscountAllowedOnTotal && isDiscountsOnTotal[0]) + { + BigDecimal totalListPrice = Env.ZERO; + BigDecimal totalLimitPrice = Env.ZERO; + BigDecimal taxPerc = Env.ZERO; + BigDecimal grandTotal = Env.ZERO; + + for (ItemBean itemBean : items) + { + MPriceList sprice = new MPriceList(ctx, itemBean.getPriceListId(), null); + ProductBean details = POSProductManager.viewPOSProduct(ctx, itemBean.getProductId(), priceListId, null); + taxPerc = (details.getTaxRate().add(Env.ONEHUNDRED)).divide(Env.ONEHUNDRED, 4, BigDecimal.ROUND_HALF_UP); + + + if(sprice.isTaxIncluded()) + { + totalLimitPrice = totalLimitPrice.add(details.getPriceLimit()); + totalListPrice = totalListPrice.add(details.getPriceList()); + } + else + { + totalLimitPrice = totalLimitPrice.add(details.getPriceLimit().multiply(taxPerc)); + totalListPrice = totalListPrice.add(details.getPriceList().multiply(taxPerc)); + } + + grandTotal = itemBean.getGrandTotal(); + + } + + if(isDiscountUptoLimitPrice && !isOverideLimitPrice) + { + if(totalLinesIncDisc.compareTo(totalListPrice) == 1) + { + throw new OperationException("DISCOUNTED TOTAL EXCEEDS TOTAL LINES!!! A discount to price " + currency + totalLinesIncDisc +" was tried to be given"); + } + + if(totalLinesIncDisc.compareTo(totalLimitPrice) == 1) + { + throw new OperationException("TOTAL DISCOUNT EXCEEDED!!! A discount to price " + currency + totalLinesIncDisc +" was tried to be given"); + } + } + + if(!isDiscountUptoLimitPrice && isOverideLimitPrice) + { + if(userDiscount.compareTo(Env.ZERO) == 1) + { + BigDecimal discount = totalListPrice.subtract(totalLinesIncDisc) ; + BigDecimal discPerc = discount.divide(totalListPrice, 2, BigDecimal.ROUND_HALF_UP).multiply(Env.ONEHUNDRED); + + if(discPerc.compareTo(userDiscount) == 1) + { + throw new OperationException("DISCOUNT LIMIT EXCEEDED!!!"); + } + + discount = totalLinesIncDisc.subtract(grandTotal); + + if(discount.compareTo(Env.ZERO) == 1) + { + throw new OperationException("DISCOUNT CANNOT BE NAGATIVE!!!"); + } + } + + if(userDiscount.compareTo(Env.ZERO) == 0) + { + throw new OperationException("CANNOT APPLY DISCOUNT!!!
    NO DISCOUNT PERCENTAGE SET"); + } + } + + if(isDiscountUptoLimitPrice && !isOverideLimitPrice) + { + if(userDiscount.compareTo(Env.ZERO) == 1) + { + if(totalLinesIncDisc.compareTo(totalLimitPrice) == -1) + { + throw new OperationException("CANNOT OVERRIDE LIMIT PRICE!!!"); + } + + if(totalLinesIncDisc.compareTo(totalListPrice) == 1) + { + throw new OperationException("DISCOUNTED TOTAL EXCEEDS TOTAL LINES!!!"); + } + } + + if(userDiscount.compareTo(Env.ZERO) == 0) + { + throw new OperationException("CANNOT APPLY DISCOUNT!!!
    NO DISCOUNT PERCENTAGE SET"); + } + } + + if(isDiscountUptoLimitPrice && isOverideLimitPrice) + { + throw new OperationException("DISCOUNT ERROR!! CANNOT PROCESS YOUR REQUEST!!!"); + } + + BigDecimal discountAmt = totalListPrice.subtract(totalLinesIncDisc); + checkoutBean.setDiscountOnTotal(isDiscountsOnTotal[0]); + checkoutBean.setDiscountAmt(discountAmt); + checkoutBean.setDiscountedTotal(totalLinesIncDisc); + checkoutBean.setGrandTotal(totalLinesIncDisc); + + request.getSession().setAttribute(Constants.SHOPPING_CART_DISCOUNTED_TOTAL, totalLinesIncDisc); + } + else + { + + while (iter.hasNext()) + { + bean = (ItemBean) iter.next(); + if(bean.getProductId().equals(productId)) + { + BigDecimal price = prices[0]; + BigDecimal listPrice = bean.getListPrice(); + BigDecimal limitPrice = bean.getPriceLimit(); + BigDecimal qty = bean.getQty(); + BigDecimal total = Env.ZERO; + BigDecimal grandTotal = Env.ZERO; + BigDecimal grandTotalWithoutDiscount = Env.ZERO; + BigDecimal tax = bean.getTaxAmt(); + + MProduct product = new MProduct(ctx,productId, trxName); + MTax mtax = TaxManager.getTaxFromCategory(ctx, product.getC_TaxCategory_ID(), trxName); + + BigDecimal taxRate = mtax.getRate(); + BigDecimal taxMulFactor = (taxRate.divide(Env.ONEHUNDRED, 2, BigDecimal.ROUND_HALF_UP)).add(Env.ONE); + BigDecimal newTaxAmt = mtax.calculateTax(price.multiply(qty), true, 12).setScale(2, BigDecimal.ROUND_HALF_DOWN); + + if(!priceList.isTaxIncluded()) + { + listPrice = listPrice.multiply(taxMulFactor); + } + + if(isDiscountUptoLimitPrice) + { + if(price.compareTo(limitPrice) == -1) + { + throw new OperationException("You cannot exceed the limit price!! A discount to price " + currency + prices[0] +" was tried to be given"); + } + + if(price.compareTo(listPrice) == 1) + { + throw new OperationException("You cannot exceed the list price!! A discount to price " + currency + prices[0] +" was tried to be given"); + } + } + + if(isDiscountUptoLimitPrice && !isOverideLimitPrice) + { + if(price.compareTo(limitPrice) == -1) + { + throw new OperationException("You cannot exceed the limit price!! A discount to price " + currency + prices[0] +" was tried to be given"); + } + + if(price.compareTo(listPrice) == 1) + { + throw new OperationException("You cannot exceed the list price!! A discount to price " + currency + prices[0] +" was tried to be given"); + } + } + + if(!isDiscountUptoLimitPrice && isOverideLimitPrice) + { + if(userDiscount.compareTo(Env.ZERO) == 1) + { + if(discountPerc[0].compareTo(userDiscount) == 1) + { + throw new OperationException("DISCOUNT LIMIT EXCEEDED!!!"); + } + } + + if(userDiscount.compareTo(Env.ZERO) == 0) + { + throw new OperationException("CANNOT APPLY DISCOUNT!!!
    NO DISCOUNT PERCENTAGE SET"); + } + } + + if(!isDiscountUptoLimitPrice && !isOverideLimitPrice) + { + if(userDiscount.compareTo(Env.ZERO) == 1) + { + if(discountPerc[0].compareTo(userDiscount) == 1) + { + throw new OperationException("DISCOUNT LIMIT EXCEEDED!!!"); + } + + if(discountPerc[0].compareTo(Env.ZERO) == -1) + { + throw new OperationException("DISCOUNT CANNOT BE NEGATIVE!!!"); + } + + if(price.compareTo(limitPrice) == -1) + { + throw new OperationException("CANNOT OVER RIDE LIMIT PRICE!!!"); + } + } + + if(userDiscount.compareTo(Env.ZERO) == 0) + { + throw new OperationException("CANNOT APPLY DISCOUNT!!!
    NO DISCOUNT PERCENTAGE SET"); + } + + } + + if(isDiscountUptoLimitPrice && isOverideLimitPrice) + { + throw new OperationException("DISCOUNT ERROR!! CANNOT PROCESS YOUR REQUEST!!!"); + } + + bean.setInclPrice(price.setScale(2)); + + BigDecimal incPriceExcVat = ((price.multiply(qty)).subtract(newTaxAmt)).divide(qty, 2, BigDecimal.ROUND_HALF_UP); + bean.setDiscountedLinePrice(incPriceExcVat.setScale(2)); + bean.setDiscountedInclUnitPrice(incPriceExcVat); + bean.setUnitPrice(incPriceExcVat.setScale(2)); + + bean.setTaxAmt(newTaxAmt.setScale(2)); + bean.setIsDiscountOnInclUnitPrice(isDiscOnInclUnitPrices[0]); + bean.setIsDiscountOnPercentage(isDiscountsOnPerc[0]); + bean.setIsDiscountOnTotal(isDiscountsOnTotal[0]); + + bean.setPrice(price.multiply(qty)); + grandTotal = grandTotal.add(price); + bean.setgrandTotal(grandTotal); + grandTotalWithoutDiscount = grandTotalWithoutDiscount.add(total); + + } + } + } + //Check for discount on total + request.getSession().setAttribute(Constants.DISCOUNT_ON_ORDER_TOTAL, checkoutBean.getDiscountOnTotal()); + request.getSession().setAttribute(Constants.DISCOUNT_ON_ORDER_TOTAL_PERCENT, checkoutBean.getDiscountOnTotalPercent()); + request.getSession().setAttribute(Constants.SHOPPING_ORDER_CART_ITEMS, items); + request.getSession().setAttribute(Constants.CHECKOUT_BEAN, checkoutBean); + + } + + /*private static void validateUserInput(ItemBean itemBean, CheckoutBean checkoutBean) + { + BigDecimal discountLimit = checkoutBean.getDiscountLimit(); + BigDecimal[] prices = checkoutBean.getDiscountedPrice(); + Boolean[] isDiscOnInclUnitPrices = checkoutBean.getIsDiscOnInclUnitPrice(); + BigDecimal[] discountedInclUnitPrices = checkoutBean.getDiscInclUnitPrice(); + BigDecimal[] discountPerc = checkoutBean.getDiscount(); + Boolean[] isDiscountsOnPerc = checkoutBean.getIsDiscOnPerc(); + Boolean[] isDiscountsOnTotal = checkoutBean.getIsDiscOnTotal(); + + if (!isDiscOnInclUnitPrice && actualPrice.compareTo(discountedInclUnitPrice) == 1) + { + throw new OperationException("incl unit price not valid, a value of " + + discountedInclUnitPrice + "was tried to be given"); + } + if (!isDiscOnPerc && discountPerc[i].compareTo(bean.getDiscountPercent()) == 1) + { + throw new OperationException("user discount limit exceeded on product " + + "" + bean.getProductName() +", discount percentage given is "+ discountPerc[i]); + } + if (!isDiscOnTotal && !total.equals(price)) + { + if ((price.compareTo(bean.getPriceLimit().multiply(bean.getQty())) == -1) || total.compareTo(price)==-1) + throw new OperationException("line total not valid, a value of " + + price+" was tried to be given"); + } + + }*/ + + public static int createGoodsReceiveNote(Properties ctx, CheckoutBean checkoutBean, HttpServletRequest request, String trxName) throws OperationException + { + MOrder order = null; + + MWarehouse warehouse = POSTerminalManager.getWarehouse(ctx); + int priceListId = 0; + Integer bpartnerId = checkoutBean.getBpartnerId(); + + if (bpartnerId == null) + { + throw new MandatoryException("Vendor is mandatory"); + } + priceListId = checkoutBean.getPriceListId(); + + if(checkoutBean.getPriceListId() == null) + { + priceListId = Env.getContextAsInt(ctx,UdiConstants.POS_PURCHASE_PL); + } + + order = OrderManager.createOrder(ctx,bpartnerId,false,priceListId,UDIOrderTypes.POS_GOODS_RECEIVE_NOTE.getOrderType(), + warehouse.get_ID(),checkoutBean.getPaymentRuleFromTenderType(),trxName); + + + PoManager.save(order); + + + //create orderlines + ArrayList items = (ArrayList) request.getSession().getAttribute(Constants.SHOPPING_ORDER_CART_ITEMS); + + for(int i=0; i items = (ArrayList) request.getSession().getAttribute(Constants.SHOPPING_ORDER_CART_ITEMS); + + MOrder order = POSGoodsManager.createCustomerReturn(ctx,orderBean,items,bpartnerId,reason,trxName); + POSGoodsManager.completeCustomerReturnOrder(ctx,order.get_ID(),trxName); + + return order.get_ID(); + } + + public static int createGoodsReturnNote(Properties ctx, CheckoutBean checkoutBean, HttpServletRequest request, String trxName) throws OperationException + { + MOrder order = null; + + MWarehouse warehouse = POSTerminalManager.getWarehouse(ctx); + int priceListId = 0; + Integer bpartnerId = checkoutBean.getBpartnerId(); + + if (bpartnerId == null) + { + throw new MandatoryException("Vendor is mandatory"); + } + priceListId = checkoutBean.getPriceListId(); + + if(checkoutBean.getPriceListId() == null) + { + priceListId = Env.getContextAsInt(ctx,UdiConstants.POS_PURCHASE_PL); + } + + order = OrderManager.createOrder(ctx,bpartnerId,false,priceListId,UDIOrderTypes.POS_GOODS_RETURN_NOTE.getOrderType(), + warehouse.get_ID(),checkoutBean.getPaymentRuleFromTenderType(),trxName); + + + PoManager.save(order); + + + //create orderlines + ArrayList items = (ArrayList) request.getSession().getAttribute(Constants.SHOPPING_ORDER_CART_ITEMS); + + for(int i=0; i0) + { + ProductImageManager.clearImages(ctx, product.get_ID(), null); + ProductImageUploader.uploadImage(ctx, product.get_ID(), attachment, attachment.getFileName(), null); + } + return product; + } + + public static ProductBean viewPOSProduct(Properties ctx,int productId, int priceListId, String trxName) throws OperationException + { + ProductBean bean = viewPOSProduct(ctx, productId, trxName); + int priceListversionId = PriceListManager.getPriceListVersionID(ctx, priceListId, trxName); + + MProductPrice productPrice = MProductPrice.get(ctx, priceListversionId, productId, trxName); + if(productPrice != null) + { + bean.setPriceList(productPrice.getPriceList()); + bean.setPriceStandard(productPrice.getPriceStd()); + bean.setPriceLimit(productPrice.getPriceLimit()); + bean.setPriceListId(priceListId); + } + + return bean; + } + + public static ProductBean viewPOSProductForInventory(Properties ctx,int productId, int priceListId, String trxName) throws OperationException + { + ProductBean bean = viewPOSProduct(ctx, productId, trxName); + int priceListversionId = PriceListManager.getPriceListVersionID(ctx, priceListId, trxName); + + MProductPrice productPrice = MProductPrice.get(ctx, priceListversionId, productId, trxName); + if(productPrice != null) + { + bean.setPriceList(productPrice.getPriceList()); + bean.setPriceStandard(productPrice.getPriceStd()); + bean.setPriceLimit(productPrice.getPriceLimit()); + bean.setPriceListId(priceListId); + + MPOS pos = MPOS.get(ctx,Env.getContextAsInt(ctx,UdiConstants.TERMINAL_ID)); + BigDecimal QtyBook = MStorage.getQtyAvailable(pos.getM_Warehouse_ID(), productId,0, null); + bean.setQtyOnHand(QtyBook); + } + + return bean; + } + + // SENDYFIXME refactor handling of price list + public static ProductBean viewPOSProduct(Properties ctx,int productId, String trxName) throws OperationException + { + if (productId == 0) + { + ProductBean productBean = new ProductBean(); + productBean.setOrgId(0); + return productBean; + } + int warehouseId = WarehouseManager.getDefaultWarehouse(ctx).getM_Warehouse_ID(); + MLocator locator = MLocator.get(ctx, warehouseId, "", "0", "0", "0"); + BigDecimal qtyAvailable = MStorage.getQtyAvailable(warehouseId, locator.get_ID(), productId, 0, trxName); + + MProduct product = new MProduct(ctx,productId,trxName); + MProductPrice purchasePrice=null; + ProductBean bean= new ProductBean(); + + bean.setProductName(product.getName()); + bean.setOrgId(product.getAD_Org_ID()); + bean.setBarCode(product.getUPC()); + int revenueRecognitionId = product.getC_RevenueRecognition_ID(); + bean.setDescription(product.getDescription()); + bean.setProductCategoryId(product.getM_Product_Category_ID()); + bean.setProductId(productId); + bean.setIsActive(product.isActive()); + bean.setRevenueRecoId(revenueRecognitionId); + int taxCategoryId = product.getC_TaxCategory_ID(); + bean.setTaxCategoryId(taxCategoryId); + bean.setProductType(product.getProductType()); + bean.setGroup1(product.getGroup1()); + bean.setGroup2(product.getGroup2()); + bean.setUnitsPerPack(product.getUnitsPerPack()); + int uomId = product.getC_UOM_ID(); + MUOM uom = MUOM.get(ctx, uomId); + bean.setUom(uom.getName()); + bean.setUomId(uomId); + bean.setQtyOnHand(qtyAvailable); + bean.setOrgId(product.getAD_Org_ID()); + bean.setIsEditable(RoleManager.isEditable(ctx, product.getAD_Org_ID())); + + MProductCategory productCategory = new MProductCategory(ctx, product.getM_Product_Category_ID(), trxName); + bean.setProductCategoryName(productCategory.getName()); + + ProductImageInfo imageInfo = new ProductImageInfo(); + boolean isImagePresent = ProductManager.isProductImagePresent(ctx, productId, trxName); + imageInfo.setHasAttachment(isImagePresent); + + bean.setImageInfo(imageInfo); + + // FIXME bad handling of tax - need refactoring + MTaxCategory taxCategory = new MTaxCategory(ctx,product.getC_TaxCategory_ID(),trxName); + MTax tax = TaxManager.getTaxFromCategory(ctx, taxCategory.getC_TaxCategory_ID(), trxName); + bean.setTaxRate(tax.getRate()); + bean.setTaxCategoryName(taxCategory.getName()); + + MRevenueRecognition reco=new MRevenueRecognition(ctx,product.getC_RevenueRecognition_ID(),trxName); + bean.setRevenueRecognition(reco.getName()); + + int priceListId = POSTerminalManager.getSOPriceListId(ctx); + int salesPriceListVersionId = PriceListManager.getPriceListVersionID(ctx, priceListId, trxName); + bean.setPriceListId(priceListId); + + MPriceList m_priceList = MPriceList.get(ctx, priceListId, trxName); + bean.setIsTaxIncluded(m_priceList.isTaxIncluded()); + + MProductPrice productPrice = MProductPrice.get(ctx,salesPriceListVersionId, productId, null); + + if(productPrice!=null) + { + if(productPrice.getPriceList()==null) + bean.setSalesPriceList(0+""); + else + bean.setSalesPriceList(productPrice.getPriceList().toString()); + + if(productPrice.getPriceStd()==null) + bean.setSalesPriceStandard(0+""); + else + bean.setSalesPriceStandard(productPrice.getPriceStd().toString()); + + if(productPrice.getPriceLimit()==null) + bean.setSalesPriceLimit(0+""); + else + bean.setSalesPriceLimit(productPrice.getPriceLimit().toString()); + } + else + { + bean.setSalesPriceStandard(0+""); + } + + int purchasePriceListVersionId = StoreManager.getPriceListId(ctx); + purchasePrice = MProductPrice.get(ctx, purchasePriceListVersionId, productId, null); + if(purchasePrice==null) + bean.setPurchasePriceStandard(0+""); + else + bean.setPurchasePriceStandard(purchasePrice.getPriceList().toString()); + + return bean; + } + + + /*public static void editProduct(Properties ctx,ProductBean bean,String existingBarCode,String trxName) throws BarcodeAlreadyExistsException,CannotInactivateProductException, OperationException + { + MProductPrice purchasePrice ; + MProductPrice salesPrice; + + FormFile attachment = bean.getFile(); + + if(attachment != null && attachment.getFileName() != null && attachment.getFileName().length()>0 && !attachment.getFileName().equals("")) + { + ProductImageManager.clearImages(ctx, bean.getProductId(), trxName); + ProductImageUploader.uploadImage(ctx, bean.getProductId(), attachment, attachment.getFileName(), trxName); + } + + MProduct product = ProductManager.loadProduct(ctx, bean.getProductId(), trxName); + + product.setName(bean.getProductName()); + product.setDescription(bean.getDescription()); + product.setGroup1(bean.getGroup1()); + product.setGroup2(bean.getGroup2()); + if(bean.getTaxCategoryId()!=null) + product.setC_TaxCategory_ID(bean.getTaxCategoryId()); + product.setUPC(bean.getBarCode()); + product.setC_UOM_ID(bean.getUomId()); + + if(bean.getRevenueRecognition()!=null) + product.setC_RevenueRecognition_ID(getOrCreateRevenueRecognition(ctx,bean.getRevenueRecognition(),trxName).get_ID()); + + if(bean.getIsActive().equals(false)) + { + String errorMsg=checkQty(ctx,product.get_ID(),trxName); + if(errorMsg!=null) + throw new CannotInactivateProductException(errorMsg); + product.setIsActive(bean.getIsActive()); + } + + else + product.setIsActive(bean.getIsActive()); + + if(bean.getProductType()!=null) + { + if( bean.getProductType().equals(MProduct.PRODUCTTYPE_Service)) + { + String errorMsg=checkQty(ctx,product.get_ID(),trxName); + if(errorMsg!=null) + throw new CannotInactivateProductException(errorMsg); + product.setIsStocked(false); + + } + else + { + product.setIsStocked(true); + } + + if(bean.getProductType()!=null) + product.setProductType(bean.getProductType()); + } + + if(bean.getSalesPriceList()==null) + bean.setSalesPriceList("0"); + if(bean.getSalesPriceStandard()==null) + bean.setSalesPriceStandard(bean.getSalesPriceList()); + if(bean.getSalesPriceLimit()==null) + bean.setSalesPriceLimit(bean.getSalesPriceStandard()); + if(bean.getPurchasePriceStandard()==null) + bean.setPurchasePriceStandard("0"); + + double salesPriceL= Double.parseDouble(bean.getSalesPriceList())); + double salesPriceS=OrderManager.round(Double.parseDouble(bean.getSalesPriceStandard())); + double salesPriceLmt=OrderManager.round(Double.parseDouble(bean.getSalesPriceLimit())); + double purchasePriceSt=OrderManager.round(Double.parseDouble(bean.getPurchasePriceStandard())); + + + + + BigDecimal salesPriceList=FormatBigDecimal.currency(salesPriceL); + BigDecimal salesPriceStand= FormatBigDecimal.currency(salesPriceS); + BigDecimal salesPriceLimit=FormatBigDecimal.currency(salesPriceLmt); + BigDecimal purchasePriceStand=FormatBigDecimal.currency(purchasePriceSt); + + + int priceListId = POSTerminalManager.getSOPriceListId(ctx); + int salesPriceListVersionId = PriceListManager.getPriceListVersionID(ctx, priceListId, trxName); + + salesPrice = MProductPrice.get(ctx,salesPriceListVersionId,bean.getProductId(),trxName); + if(salesPrice==null) + salesPrice= new MProductPrice(ctx,salesPriceListVersionId,bean.getProductId(),trxName); + salesPrice.setPrices(salesPriceList,salesPriceStand,salesPriceLimit); + PoManager.save(salesPrice); + + int purchasePriceListVersionId = Env.getContextAsInt(ctx,UdiConstants.POS_PURCHASE_PL_VERSION); + purchasePrice = MProductPrice.get(ctx,purchasePriceListVersionId,bean.getProductId(),trxName); + if(purchasePrice==null) + purchasePrice = new MProductPrice(ctx,purchasePriceListVersionId,bean.getProductId(),trxName); + purchasePrice.setPrices(purchasePriceStand,purchasePriceStand,purchasePriceStand); + PoManager.save(purchasePrice); + PoManager.save(product); + + createCosting(ctx,product,new BigDecimal(bean.getPurchasePriceStandard()),null, trxName); //null for not updating stock + }*/ + + + public static String checkQty(Properties ctx,int productId,String trxName) throws OperationException + { + MStorage[] storages = MStorage.getOfProduct(ctx, productId, trxName); + BigDecimal OnHand = Env.ZERO; + BigDecimal Ordered = Env.ZERO; + BigDecimal Reserved = Env.ZERO; + for (int i = 0; i < storages.length; i++) + { + OnHand = OnHand.add(storages[i].getQtyOnHand()); + Ordered = Ordered.add(storages[i].getQtyOrdered()); + Reserved = Reserved.add(storages[i].getQtyReserved()); + } + String errMsg = null; + if (OnHand.signum() != 0) + errMsg = "QtyOnHand = " + OnHand; + if (Ordered.signum() != 0) + errMsg += " , QtyOrdered = " + Ordered; + if (Reserved.signum() != 0) + errMsg += " , QtyReserved=" + Reserved; + if (errMsg != null) + { + return errMsg; + + } + + return errMsg; + } + + + private static MRevenueRecognition getOrCreateRevenueRecognition(Properties ctx,String name,String trxName) throws OperationException + { + MRevenueRecognition revenueRecognition; + int [] revenueRecIds = MRevenueRecognition.getAllIDs(MRevenueRecognition.Table_Name,"AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+" and AD_ORG_ID="+Env.getAD_Org_ID(ctx)+" and name='"+name+"'",trxName); + if(revenueRecIds.length>0) + { + revenueRecognition = new MRevenueRecognition(ctx,revenueRecIds[0],trxName); + return revenueRecognition; + } + + else + revenueRecognition = new MRevenueRecognition(ctx,0,trxName); + + revenueRecognition.setIsTimeBased(false); + revenueRecognition.setName(name); + revenueRecognition.setDescription(name); + + PoManager.save(revenueRecognition); + return revenueRecognition; + } + + public static ArrayList getArrayOfPriceList(Properties ctx, int productId) + { + ArrayList reportData = new ArrayList(); + + return reportData; + } + + + public static ArrayList viewAllProducts(Properties ctx,String name,String barCode,String description) throws ProductNotFoundException,OperationException + { + String sql="select m_product_id,name from m_product where AD_CLIENT_ID="+Env.getAD_Client_ID(ctx); + + if(name != null) + sql = sql+" and upper(name) like upper('%"+name+"%')"; + + if(barCode != null) + sql = sql+" and upc ='"+barCode+"'"; + + if(description != null && description.length() > 0) + { + sql = sql + " and upper(description) like upper('%" +description + "%')"; + } + + sql=sql+" order by name"; + + PreparedStatement pstmt = DB.prepareStatement(sql,null); + + ResultSet rs; + ProductBean bean=null; + ArrayList list=new ArrayList(); + + try + { + rs = pstmt.executeQuery(); + while(rs.next()) + { + bean=viewPOSProduct(ctx,rs.getInt(1), null); + list.add(bean); + } + + rs.close(); + } + catch (SQLException e) + { + throw new OperationException(e); + } + finally + { + try + { + pstmt.close(); + } + catch(Exception e) + {} + + pstmt = null; + } + + return list; + } + + private static void createCosting(Properties ctx, MProduct product, BigDecimal costPrice, BigDecimal stock, String trxName) throws OperationException + { + MClient client = new MClient(ctx, Env.getAD_Client_ID(ctx), null); + + MCostElement costElements[] = MCostElement.getCostingMethods(client); + + for(int i = 0; i < costElements.length; i++) + { + MCost cost = MCost.get(product, 0, client.getAcctSchema(), 0, costElements[i].get_ID()); + cost.set_TrxName(trxName); + cost.setCurrentCostPrice(costPrice); + if(stock!=null) + cost.setCurrentQty(stock); + PoManager.save(cost); + } + } + + + public static String getProductCartAsCSV( Properties ctx, ProductCart cart ) throws OperationException + { + ArrayList productList = cart.getProducts(); + + ArrayList data = new ArrayList(); + Object[] headers = new Object[]{"Product ID","Name","Barcode","Qty"}; + + data.add( headers ); + Object[] row = null; + + for(ProductDetailsBean bean : productList) + { + row = new Object[4]; + + row[0] = bean.getProductId(); + row[1] = bean.getProductName(); + row[2] = bean.getBarCode(); + row[3] = bean.getQuantity(); + + data.add( row ); + } + + return CSVReportManager.generateCSVReport(ctx, data); + + } + + public static String getPrintBarcodeData( Properties ctx, ProductCart cart, String trxName ) throws OperationException + { + ArrayList productList = cart.getProducts(); + StringBuffer printData = new StringBuffer(); + BarcodeFormatter formatter = new BarcodeFormatter(); + ProductBean pBean = null; + PrintBarcodeBean barcodeBean = null; + + formatter.setShowSubtitle( false); + + for(ProductDetailsBean bean : productList) + { + Integer productId = bean.getProductId(); + BigDecimal quantity = bean.getQuantity(); + String barcode = bean.getBarCode(); + String productName = bean.getProductName(); + String salesPrice = null; + + pBean = viewPOSProduct(ctx, productId.intValue(), trxName); + salesPrice = pBean.getSalesPriceStandard(); + + if( barcode == null ) + { + barcode = ProductManager.getBarcodeForSimilarProducts( ctx, productId, trxName); + } + + barcodeBean = new PrintBarcodeBean(); + + productName = productName.replaceAll(ProductManager.PRODUCT_ATTRIBUTES_DELIMETER, " "); + + barcodeBean.setBarcode( barcode ); + barcodeBean.setTitle( productName ); + barcodeBean.setPrice( salesPrice ); + barcodeBean.setQty( quantity.intValue() ); + + String s = (String) formatter.format( barcodeBean ); + + printData.append(s); + + } + + //TODO send data to barcode printer + System.out.println( "---> Printing Barcode" ); + System.out.println( printData.toString() ); + + return printData.toString(); + } + + public static ProductSalesSummaryBean getProductSalesInfoSummary( Properties ctx, int product_id, String period, String trxName) throws OperationException + { + Date startDate = ReportDateManager.getStartDateForPeriod(period); + Date endDate = ReportDateManager.getEndDateForPeriod(period); + + SimpleDateFormat f = new SimpleDateFormat(TimestampConvertor.DEFAULT_DATE_PATTERN1); + String fromDate = f.format(startDate); + String toDate = f.format(endDate); + + String sql = "select " + + "(qtyordered - qtyreturned) as NetQtySold," + //1.net qty sold + "(orderAmt - returnAmt) as NetAmount " + //2.net amount + + "from " + + "( select nvl(sum(ordline.QTYORDERED),0) as qtyordered, nvl(sum(ordline.LINENETAMT),0) as orderAmt " + + " from C_ORDERLINE ordline, C_ORDER ord, C_BPARTNER bp " + + " where ordline.M_PRODUCT_ID = ? " + //<----------1.productID + " and ord.C_ORDER_ID = ordline.C_ORDER_ID " + + " and bp.C_BPARTNER_ID = ord.C_BPARTNER_ID " + + " and bp.ISCUSTOMER = 'Y' " + + " and ORDERTYPE in ('POS Order','Credit Order') " + + " and ord.DATEORDERED between " + + " to_date( ? , 'DD-MM-YYYY HH24:MI:SS' )" + //<----------2.startDate + " and to_date( ? , 'DD-MM-YYYY HH24:MI:SS' )" + //<----------3.endDate + ") QTYORDERED, " + + + "( select nvl(sum(ordline.QTYORDERED),0) as qtyreturned, nvl(sum(ordline.LINENETAMT),0) as returnAmt " + + " from C_ORDERLINE ordline, C_ORDER ord, C_BPARTNER bp " + + " where ordline.M_PRODUCT_ID = ? " + //<----------4.productID + " and ord.C_ORDER_ID = ordline.C_ORDER_ID " + + " and bp.C_BPARTNER_ID = ord.C_BPARTNER_ID " + + " and bp.ISCUSTOMER = 'Y' " + + " and ORDERTYPE = 'Customer Return Order' " + + " and ord.DATEORDERED between " + + " to_date( ? , 'DD-MM-YYYY HH24:MI:SS' )" + //<----------5.startDate + " and to_date( ? , 'DD-MM-YYYY HH24:MI:SS' )" + //<----------6.endDate + ") QtyReturned " ; + + PreparedStatement pstmt = null; + ResultSet rs = null; + + ProductSalesSummaryBean bean = new ProductSalesSummaryBean(); + + try + { + pstmt = DB.prepareStatement( sql, trxName ); + pstmt.setInt( 1, product_id ); + pstmt.setInt( 4, product_id ); + + pstmt.setString(2, fromDate); + pstmt.setString(3, toDate); + pstmt.setString(5, fromDate); + pstmt.setString(6, toDate); + + + + rs = pstmt.executeQuery(); + + if( rs.next() ) + { + bean.setQtySold( rs.getBigDecimal(1) ); + bean.setTotalAmount( rs.getBigDecimal(2) ); + } + + rs.close(); + pstmt.close(); + } + catch (SQLException e) + { + throw new OperationException(e); + } + finally + { + rs = null; + pstmt = null; + } + + return bean; + +} + + public static ProductSalesSummaryBean getProductSalesInfoSummary( Properties ctx, int product_id, String trxName ) throws OperationException + { + String sql = "select " + + "prod.name, " + //1.product name + "(qtyordered - qtyreturned) as NetQtySold," + //2.net qty sold + "(orderAmt - returnAmt) as NetAmount, " + //3.net amount + "qtyonhand from " + //4.qty on hand + + "( select nvl(sum(ordline.QTYORDERED),0) as qtyordered, nvl(sum(ordline.LINENETAMT),0) as orderAmt " + + " from C_ORDERLINE ordline, C_ORDER ord, C_BPARTNER bp " + + " where ordline.M_PRODUCT_ID = ? " + + " and ord.C_ORDER_ID = ordline.C_ORDER_ID " + + " and bp.C_BPARTNER_ID = ord.C_BPARTNER_ID " + + " and bp.ISCUSTOMER = 'Y' " + + " and ORDERTYPE in ('POS Order','Credit Order') " + + ") QtyOrdered, " + + + "( select nvl(sum(ordline.QTYORDERED),0) as qtyreturned, nvl(sum(ordline.LINENETAMT),0) as returnAmt " + + " from C_ORDERLINE ordline, C_ORDER ord, C_BPARTNER bp " + + " where ordline.M_PRODUCT_ID = ? " + + " and ord.C_ORDER_ID = ordline.C_ORDER_ID " + + " and bp.C_BPARTNER_ID = ord.C_BPARTNER_ID " + + " and bp.ISCUSTOMER = 'Y' " + + " and ORDERTYPE = 'Customer Return Order'" + + ") QtyReturned, " + + + " ( select nvl(sum(qtyonhand),0) as qtyonhand from M_STORAGE where M_PRODUCT_ID = ? ) QtyOnHand , " + + + "M_Product prod where M_PRODUCT_ID = ?"; + + PreparedStatement pstmt = null; + ResultSet rs = null; + + ProductSalesSummaryBean bean = new ProductSalesSummaryBean(); + + try + { + pstmt = DB.prepareStatement( sql, trxName ); + pstmt.setInt( 1, product_id ); + pstmt.setInt( 2, product_id ); + pstmt.setInt( 3, product_id ); + pstmt.setInt( 4, product_id ); + + rs = pstmt.executeQuery(); + + if( rs.next() ) + { + bean.setProductName( rs.getString(1) ); + bean.setQtySold( rs.getBigDecimal(2) ); + bean.setTotalAmount( rs.getBigDecimal(3) ); + bean.setQtyOnHand( rs.getBigDecimal(4) ); + bean.setProductId( Integer.valueOf(product_id) ); + } + + rs.close(); + pstmt.close(); + } + catch (SQLException e) + { + throw new OperationException(e); + } + finally + { + rs = null; + pstmt = null; + } + + return bean; + + } + + public static ArrayList getProductSalesInfoDetails( Properties ctx, int product_id, String trxName ) throws OperationException + { + String sql = "" + + "select * from (" + + "select " + + "ord.DOCUMENTNO, " + //1.document No + "ord.DATEORDERED, " + //2.date ordered + "bp.name || ' ' || bp.name2, " + //3.customer name + "ord.ORDERTYPE, " + //4.order type + "ordline.QTYORDERED, " + //5.qty ordered + "ord.C_ORDER_ID, " + //6.order id + "ordline.linenetamt " + //7.line amount + + "from C_ORDERLINE ordline, C_ORDER ord, C_BPARTNER bp " + + "where ordline.M_PRODUCT_ID = ? " + + "and ord.C_ORDER_ID = ordline.C_ORDER_ID " + + "and bp.C_BPARTNER_ID = ord.C_BPARTNER_ID " + + "and bp.ISCUSTOMER = 'Y' " + + "order by ord.DATEORDERED desc" + + ") DocNum "; +// "where rownum <= ?"; + + PreparedStatement pstmt = null; + ResultSet rs = null; + + ArrayList list = new ArrayList(); + ProductSalesInfoBean bean = null; + + try + { + pstmt = DB.prepareStatement( sql, trxName ); + pstmt.setInt( 1, product_id ); + //pstmt.setInt( 2, maxNoOfRecords ); // limits the number of records returned + + rs = pstmt.executeQuery(); + + while( rs.next() ) + { + bean = new ProductSalesInfoBean(); + + bean.setDocumentNo( rs.getString(1)); + bean.setDateOrdered(rs.getDate(2)); + bean.setBpartnerName(rs.getString(3)); + bean.setOrderType(rs.getString(4)); + bean.setQtyOrderded(rs.getBigDecimal(5)); + bean.setOrderId(Integer.valueOf(rs.getInt(6))); + bean.setLineAmount(rs.getBigDecimal(7)); + + list.add( bean ); + } + + rs.close(); + pstmt.close(); + } + catch (SQLException e) + { + throw new OperationException(e); + } + finally + { + rs = null; + pstmt = null; + } + + return list; + + } + + public static ProductSalesSummaryBean[] getSalesBucket(Properties ctx, int productId, String trxName) throws OperationException + { + String[] periods = new String[]{ + ReportDateManager.CURRENT_YEAR, + ReportDateManager.LAST_6MONTHS, + ReportDateManager.LAST_3MONTHS, + ReportDateManager.LAST_2MONTHS, + ReportDateManager.CURRENT_MONTH, + ReportDateManager.CURRENT_WEEK, + ReportDateManager.TODAY + }; + + ProductSalesSummaryBean[] beans = new ProductSalesSummaryBean[periods.length]; + + for(int i = 0; i < periods.length; i++) + { + beans[i] = getProductSalesInfoSummary(ctx,productId,periods[i],trxName); + } + + return beans; + + } + + public static void editBulkProduct(Properties ctx, Integer[] productIds, ProductBean bean, String trxName) throws InvalidContentTypeException, OperationException + { + MProductPrice purchasePrice ; + MProductPrice salesPrice; + FormFile attachment = bean.getFile(); + boolean hasAttachment; + Integer productId; + MProduct product; + + hasAttachment = (attachment != null && !attachment.getFileName().equals("")); + + for(int i=0; i getUoms(Properties ctx, String trxName) + { + String orgs = RoleManager.getRoleViewableOrgAccess(ctx); + String whereClause = "ISACTIVE = 'Y' AND AD_CLIENT_ID IN (0," + Env.getAD_Client_ID(ctx) + ") AND AD_Org_ID IN (" + orgs + ")"; + int ids[] = MUOM.getAllIDs(MUOM.Table_Name, whereClause, trxName); + + ArrayList list = new ArrayList(); + for(int id : ids) + { + MUOM uom = MUOM.get(ctx, id); + KeyNamePair pair = uom.getKeyNamePair(); + list.add(pair); + } + + return list; + } + + public static ProductBean getProductBean(Properties ctx, + ArrayList list, Integer productId, Boolean isNext) throws OperationException + { + int index = -1; + + if (productId == 0) + { + ProductBean productBean = new ProductBean(); + productBean.setProductId(0); + productBean.setOrgId(0); + return productBean; + } + else + { + if (list != null) + { + Iterator iter = list.iterator(); + + while (iter.hasNext()) + { + ProductBean currBean = iter.next(); + if (currBean.getProductId().equals(productId)) + { + index = list.indexOf(currBean); + } + } + if (index != -1) + { + if (isNext!=null) + { + if (isNext) + { + int nextIndex = (index + 1)%list.size(); + index = nextIndex; + } + else + { + int previousIndex = (index-1)%list.size(); + if (previousIndex < 0) + { + previousIndex += list.size(); + } + index = previousIndex; + } + } + return viewPOSProduct(ctx, list.get(index).getProductId(), null); + } + else + { + throw new OperationException("product not found in search list"); + } + } + else + { + return viewPOSProduct(ctx, productId, null); + } + } + } + + public static ArrayList getProductBeans(Properties ctx, Integer priceListVersionId, String trxName) throws OperationException + { + PreparedStatement pstmt = null; + ResultSet rs = null; + ArrayList list = new ArrayList(); + StringBuffer query = new StringBuffer(); + + String orgs = RoleManager.getRoleViewableOrgAccess(ctx); + + query.append("SELECT M_Product_Id FROM M_ProductPrice where AD_CLIENT_ID = " + Env.getAD_Client_ID(ctx)); + + if(priceListVersionId != null) + { + query.append(" AND M_PriceList_Version_Id = " + priceListVersionId); + } + + query.append(" ORDER BY M_Product_Id"); + + try + { + pstmt = DB.prepareStatement(query.toString(), trxName); + rs = pstmt.executeQuery(); + + while(rs.next()) + { + ProductBean productBean = new ProductBean(); + productBean = viewPOSProduct(ctx, rs.getInt(1), trxName); + list.add(productBean); + } + } + + catch(SQLException e) + { + throw new OperationException(e); + } + + finally + { + if(pstmt != null) + { + try + { + pstmt.close(); + } + catch(SQLException e) + { + throw new OperationException(e); + } + } + + if(rs != null) + { + try + { + rs.close(); + } + catch(SQLException e) + { + throw new OperationException(e); + } + } + } + + return list; + } + + public static HashMap getOrderQtyInfoPerProduct(Properties ctx, Boolean isSOTrx, + Integer productId, String orgIds, Timestamp date1, Timestamp date2, String trxName) throws OperationException + { + DateFormatSymbols dfs = new DateFormatSymbols(Locale.ENGLISH); + String[] monthName = dfs.getMonths(); + + + HashMap dateQtymap = new HashMap(); + + String[] orgs = orgIds.split(","); + StringBuffer locatorIds = new StringBuffer(); + int i = 0; + for (String org:orgs ) + { + try + { + int orgId = Integer.parseInt(org); + locatorIds = locatorIds.append(WarehouseManager.getLocatorIds(ctx, orgId)); + if (orgId == 0) + { + break; + } + else + { + if (i < orgs.length -1) + { + locatorIds.append(","); + } + } + } + catch (NumberFormatException e) + {} + + i++; + } + + StringBuffer sql = new StringBuffer("SELECT SUM(trx.movementQty), trx.movementDate") + .append(" FROM M_Transaction trx") + .append(" WHERE trx.M_Product_ID = ? AND trx.M_Locator_ID IN (" + locatorIds+")") + .append(" AND trx.movementDate BETWEEN " + DB.TO_DATE(date1, true) +" AND " + DB.TO_DATE(date2, true)) + .append(" AND trx.movementType = ?") + .append(" GROUP BY trx.movementDate"); + + PreparedStatement pstmt =null; + ResultSet rs = null; + ArrayList list = new ArrayList(); + try + { + pstmt = DB.prepareStatement(sql.toString(), trxName); + pstmt.setInt(1, productId); + if (isSOTrx) + { + pstmt.setString(2, MTransaction.MOVEMENTTYPE_CustomerShipment); + } + else + { + pstmt.setString(2, MTransaction.MOVEMENTTYPE_VendorReceipts); + } + rs = pstmt.executeQuery(); + + while (rs.next()) + { + BigDecimal qty = rs.getBigDecimal(1); + Date date = rs.getDate(2); + list.add(date); + dateQtymap.put(date, qty); + } + } + catch (SQLException e) + { + } + finally + { + DB.close(rs, pstmt); + rs = null; + pstmt = null; + } + + Collections.sort(list); + + Iterator iter= list.iterator(); + StringBuffer monthYearList = new StringBuffer(); + + HashMap monthQtyMap = new HashMap(); + while (iter.hasNext()) + { + Date date = iter.next(); + + Calendar cal = Calendar.getInstance(); + cal.setTime(date); + + int month= cal.get(Calendar.MONTH); + int year = cal.get(Calendar.YEAR); + + String monthYear = monthName[month] + " " + year; + monthYearList.append(monthYear).append(","); + + BigDecimal qty = dateQtymap.get(date); + + if (monthQtyMap.containsKey(monthYear)) + { + qty = qty.add(monthQtyMap.get(monthYear)); + } + + monthQtyMap.put(monthYear, qty); + + } + + return monthQtyMap; + } + + public static ArrayList getExportData(Properties ctx, ArrayList list) throws IOException + { + ArrayList exportData = new ArrayList(); + String[] header = null; + + File importTemplate = new File(PathInfo.PROJECT_HOME + "/import/importTemplate.csv"); + BufferedReader bufReader = new BufferedReader(new FileReader(importTemplate)); + String line = bufReader.readLine(); + int i = 0; + int size = 0; + //read the template file header + if (line != null) + { + StringTokenizer st = new StringTokenizer(line,","); + size = st.countTokens(); + header = new String[size]; + while (st.hasMoreTokens()) + { + + header[i] = st.nextToken().replaceAll("\"","");; + i++; + } + } + //close the file + bufReader.close(); + exportData.add(header); + + if (list!=null && !list.isEmpty()) + { + Iterator productIter = list.iterator(); + + HashMap map = new HashMap(); + + while (productIter.hasNext()) + { + ProductBean productBean = productIter.next(); + map.put("Revenue Recognition", productBean.getRevenueRecognition()); + map.put("Barcode", productBean.getBarCode()); + map.put("Name", productBean.getProductName()); + map.put("Description", productBean.getDescription()); + map.put("UOM", productBean.getUom()); + map.put("Purchase Price", productBean.getPurchasePriceStandard()); + map.put("Marked Price", productBean.getSalesPriceList()); + map.put("Discounted Price", productBean.getSalesPriceStandard()); + map.put("Limit Price", productBean.getSalesPriceLimit()); + map.put("VAT %", productBean.getTaxRate()); + map.put("Stock in Hand", productBean.getQtyOnHand()); + + Object[] productLine = new Object[size]; + int count = 0; + for (String value : header) + { + if (map.containsKey(value)) + { + productLine[count] = map.get(value); + } + count++; + } + exportData.add(productLine); + map.clear(); + } + } + return exportData; + } + + public static ArrayList searchPOSGarmentAttributes(HttpServletRequest request) throws OperationException + { + Properties ctx = TmkJSPEnv.getCtx(request); + String attrName = null; + String attrValue = null; + + int ad_client_id = Env.getAD_Client_ID(ctx); + + ArrayList attributeValueList = new ArrayList(); + + String[] attributes = {"brand","colour","design","model","revenue_recognition"}; + + for(int i=0;i getAllAttributeSet(Properties ctx) throws OperationException + { + String sql = " select M_ATTRIBUTESET_ID,NAME from M_ATTRIBUTESET where AD_CLIENT_ID="+Env.getAD_Client_ID(ctx); + + AttributeBean bean =null; + + PreparedStatement pstmt = DB.prepareStatement(sql,null); + + ArrayList list = new ArrayList(); + try + { + ResultSet rs = pstmt.executeQuery(); + while(rs.next()) + { bean= new AttributeBean(); + bean.setAttributeSetId(Integer.valueOf(rs.getInt(1))); + bean.setAttributeSetName(rs.getString(2)); + list.add(bean); + } + rs.close(); + + } + catch (SQLException e) + { + throw new OperationException(e); + } + finally + { + try + { + pstmt.close(); + } + catch(Exception e) + {} + + pstmt = null; + } + + return list; + } + + + public static ArrayList getAllAttributeFromAttributeSet(Properties ctx,AttributeBean aBean) throws OperationException + { + + + String sql = "select att.M_ATTRIBUTE_ID," + + "att.name" + + " from M_ATTRIBUTEUSE u,M_ATTRIBUTE att" + + " where u.M_ATTRIBUTE_ID=att.M_ATTRIBUTE_ID"+ + " and M_ATTRIBUTESET_ID="+aBean.getAttributeSetId(); + + PreparedStatement pstmt = DB.prepareStatement(sql,null); + ArrayList list = new ArrayList(); + AttributeBean bean =null; + try + { + ResultSet rs = pstmt.executeQuery(); + + while(rs.next()) + { + bean= new AttributeBean(); + bean.setAttributeId(Integer.valueOf(rs.getInt(1))); + bean.setAttributeName(rs.getString(2)); + if(aBean.getAttributeValueIds()==null) + { + bean.setAttributeValueList(getAttributeValues(ctx,bean.getAttributeId())); + } + else + { + bean.setAttributeValueList(getFilteredAttributeValues(ctx,aBean,bean.getAttributeId().intValue())); + } + + list.add(bean); + } + rs.close(); + + } + catch (SQLException e) + { + throw new OperationException(e); + } + finally + { + try + { + pstmt.close(); + } + catch(Exception e) + {} + + pstmt = null; + } + return list; + + } + + private static ArrayList getAttributeValues(Properties ctx,int attributeId) throws OperationException + { + + String sql = "select distinct M_ATTRIBUTEVALUE_ID,VALUE from M_ATTRIBUTEINSTANCE where M_ATTRIBUTE_ID= "+attributeId+" order by VALUE"; + + + PreparedStatement pstmt = DB.prepareStatement(sql,null); + ArrayList list = new ArrayList(); + AttributeBean bean =null; + try + { + ResultSet rs = pstmt.executeQuery(); + while(rs.next()) + { + bean= new AttributeBean(); + bean.setAttributeValueId(Integer.valueOf(rs.getInt(1))); + bean.setAttributeValue(rs.getString(2)); + list.add(bean); + } + rs.close(); + } + catch (SQLException e) + { + throw new OperationException(e); + } + finally + { + try + { + pstmt.close(); + } + catch(Exception e) + {} + + pstmt = null; + } + + return list; + } + + + public static ArrayList getAllProducts(Properties ctx, Integer attributeSetId) throws OperationException + { + MWarehouse warehouse = POSTerminalManager.getWarehouse(ctx); + BigDecimal totalCost = BigDecimal.valueOf(0.0); +// int purchasePriceListVersionId = Env.getContextAsInt(ctx,UdiConstants.POS_PURCHASE_PL_VERSION); + + int poPriceListId = POSTerminalManager.getPOPriceListId(ctx); + int purchasePriceListVersionId = PriceListManager.getPriceListVersionID(ctx, poPriceListId, null); + + String sql = "select pr.name," + + " SUM(st.QTYONHAND)," + + " st.M_PRODUCT_ID,"+ + " pr.M_ATTRIBUTESETINSTANCE_ID," + + " pr.UPC,"+ + " pp.PRICESTD"+ + " from M_STORAGE st,M_PRODUCT pr left outer join M_PRODUCTPRICE pp on pr.M_PRODUCT_ID = pp.M_PRODUCT_ID" + + " where st.M_PRODUCT_ID=pr.M_PRODUCT_ID" + + " and st.ad_client_id=" +Env.getAD_Client_ID(ctx)+ + " and st.AD_ORG_ID=" +Env.getAD_Org_ID(ctx)+ + " and st.M_LOCATOR_ID="+warehouse.getDefaultLocator().get_ID()+ + " and pp.M_PRICELIST_VERSION_ID="+purchasePriceListVersionId; + if (attributeSetId != null) + { + sql += " and pr.m_attributeset_id = " + attributeSetId; + } + sql += " group by pr.name,st.M_PRODUCT_ID, pr.M_ATTRIBUTESETINSTANCE_ID,pr.UPC,pp.PRICESTD"+ + " order by pr.name "; + + + + PreparedStatement pstmt = DB.prepareStatement(sql,null); + + AttributeBean bean =null; + ArrayList productsInStock =new ArrayList(); + try + { + ResultSet rs = pstmt.executeQuery(); + while(rs.next()) + { + bean= new AttributeBean(); + bean.setProductName(rs.getString(1)); + bean.setQuantity(rs.getBigDecimal(2)); + bean.setProductId(Integer.valueOf(rs.getInt(3))); + bean.setAttributeSetInstanceId(Integer.valueOf(rs.getInt(4))); + bean.setBarCode(rs.getString(5)); + totalCost = new BigDecimal(rs.getInt(2)).multiply(rs.getBigDecimal(6)); + bean.setPrice(totalCost); + productsInStock.add(bean); + } + rs.close(); + + } + catch (SQLException e) + { + throw new OperationException(e); + } + finally + { + try + { + pstmt.close(); + } + catch(Exception e) + {} + + pstmt = null; + } + + return productsInStock; + } + + public static ArrayList getProducts(Properties ctx, AttributeBean aBean) throws OperationException + { + + + MWarehouse warehouse = POSTerminalManager.getWarehouse(ctx); + + ArrayList attributeIdList = new ArrayList(); + + + for(int i=0;i productsInStock =new ArrayList(); + try + { + ResultSet rs = pstmt.executeQuery(); + while(rs.next()) + { + bean= new AttributeBean(); + bean.setProductName(rs.getString(1)); + bean.setQuantity(rs.getBigDecimal(2)); + bean.setProductId(Integer.valueOf(rs.getInt(3))); + bean.setAttributeSetInstanceId(Integer.valueOf(rs.getInt(4))); + bean.setBarCode(rs.getString(5)); + productsInStock.add(bean); + } + rs.close(); + + } + catch (SQLException e) + { + throw new OperationException(e); + } + finally + { + try + { + pstmt.close(); + } + catch(Exception e) + {} + + pstmt = null; + } + + + return productsInStock; + + } + + public static ArrayList getFilteredAttributeValues(Properties ctx,AttributeBean aBean,int attributeId) throws OperationException + { + ArrayList attributeIdList = new ArrayList(); + for(int i=0;i list = new ArrayList(); + AttributeBean bean =null; + try + { + ResultSet rs = pstmt.executeQuery(); + while(rs.next()) + { + bean= new AttributeBean(); + bean.setAttributeValueId(Integer.valueOf(rs.getInt(1))); + bean.setAttributeValue(rs.getString(2)); + list.add(bean); + } + rs.close(); + } + catch (SQLException e) + { + throw new OperationException(e); + } + finally + { + try + { + pstmt.close(); + } + catch(Exception e) + {} + + pstmt = null; + } + + return list; + } + + + + + public static ArrayList getStockFromSearch(Properties ctx, String searchString,String barCode,String qtyFilter) throws OperationException + { + + searchString = (searchString==null)? "" : searchString; + StringTokenizer st = new StringTokenizer(searchString,"+"); + + BigDecimal totalCost = BigDecimal.valueOf(0.0); + int purchasePLId = POSTerminalManager.getPOPriceListId(ctx); + int purchasePriceListVersionId = PriceListManager.getPriceListVersionID(ctx, purchasePLId, null); + + + String sql="select pr.name as name, sum(st.qtyonhand) as qty ,pr.UPC,pr.m_product_id,pp.PRICESTD" + + " from M_STORAGE st,M_PRODUCT pr left outer join M_PRODUCTPRICE pp on pr.M_PRODUCT_ID = pp.M_PRODUCT_ID" + + " and pp.M_PRICELIST_VERSION_ID="+purchasePriceListVersionId + + " where st.M_PRODUCT_ID=pr.M_PRODUCT_ID"; + + String token = null; + + while(st.hasMoreTokens()) + { + token = st.nextToken().trim(); + sql = sql + " and upper(pr.name) like upper('%"+token+"%' )"; + } + + if(barCode!=null && !barCode.equals("")) + sql=sql+" and pr.upc='"+barCode+"'"; + + sql=sql+" and pr.AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+" and st.AD_ORG_ID="+Env.getAD_Org_ID(ctx); + + sql=sql+ " and st.M_LOCATOR_ID="+POSTerminalManager.getWarehouse(ctx).getDefaultLocator().get_ID(); + + sql=sql+" group by pr.name,pr.UPC,pr.m_product_id,pp.PRICESTD"; + + if(qtyFilter!=null && qtyFilter.length()!=0) + { + sql = "select * from (" + sql + ") stDetails where stDetails.qty" + qtyFilter; + } + + PreparedStatement pstmt = DB.prepareStatement(sql,null); + + AttributeBean bean =null; + ArrayList productsInStock =new ArrayList(); + try + { + ResultSet rs = pstmt.executeQuery(); + while(rs.next()) + { + BigDecimal quantity = rs.getBigDecimal(2); + BigDecimal price = rs.getBigDecimal(5); + + if (quantity == null) + { + quantity = BigDecimal.ZERO; + } + if (price == null) + { + price = BigDecimal.ZERO; + } + MProduct product = MProduct.get(ctx, rs.getInt(4)); + int uomPrecision = MUOM.getPrecision(ctx, product.getC_UOM_ID()); + String uom = product.getUOMSymbol(); + bean= new AttributeBean(); + bean.setProductName(rs.getString(1)); + bean.setQuantity(quantity.setScale(uomPrecision)); + bean.setBarCode(rs.getString(3)); + + totalCost = quantity.multiply(price); + bean.setUnitPrice(price); + bean.setDescription(product.getDescription()); + bean.setPrice(totalCost.setScale(price.scale(),RoundingMode.HALF_UP)); + bean.setUom(uom); + + productsInStock.add(bean); + } + rs.close(); + + } + catch (SQLException e) + { + throw new OperationException(e); + } + finally + { + try + { + pstmt.close(); + } + catch(Exception e) + {} + + pstmt = null; + } + + return productsInStock; + + } + + + public static HashMap getStockByOrg(Properties ctx, Integer productId, Timestamp asOfDate, Integer orgId, String trxName) throws OperationException, SQLException + { + if (productId == null) + { + throw new OperationException("productId is null, cannot search stock qty by org"); + } + + String locatorIds = WarehouseManager.getLocatorIds(ctx, orgId); + + BigDecimal qty = Env.ZERO; + + int precision = ProductManager.getUOMPrecision(ctx, productId); + + StringBuffer movementTypes = new StringBuffer("'"+MTransaction.MOVEMENTTYPE_CustomerShipment +"', ") + .append("'"+MTransaction. MOVEMENTTYPE_CustomerReturns +"', ") + .append("'"+MTransaction. MOVEMENTTYPE_VendorReceipts +"', ") + .append("'"+MTransaction. MOVEMENTTYPE_VendorReturns +"', ") + .append("'"+MTransaction. MOVEMENTTYPE_InventoryOut +"', ") + .append("'"+MTransaction. MOVEMENTTYPE_InventoryIn +"', ") + .append("'"+MTransaction. MOVEMENTTYPE_MovementFrom +"', ") + .append("'"+MTransaction. MOVEMENTTYPE_MovementTo +"'") ; + + StringBuffer sql = new StringBuffer("SELECT SUM(trx.movementQty), loc.AD_Org_ID FROM M_Transaction trx") + .append(" INNER JOIN M_Locator loc ON trx.M_Locator_ID = loc.M_Locator_ID WHERE") + .append(" trx.M_Product_ID="+productId+ " AND trx.M_Locator_ID IN ("+ locatorIds + ")") + .append(" AND trx.movementDate <= "+ DB.TO_DATE(asOfDate, false)) + .append(" AND trx.movementType in ("+movementTypes+")") + .append(" GROUP BY loc.AD_Org_ID"); + + + + PreparedStatement pstmt = null; + ResultSet rs = null; + + HashMap orgStock = new HashMap(); + try + { + pstmt = DB.prepareStatement (sql.toString(), trxName); + rs = pstmt.executeQuery(); + + while (rs.next()) + { + qty = rs.getBigDecimal(1); + Integer org_Id = rs.getInt(2); + + qty = qty.setScale(precision, RoundingMode.HALF_UP); + + orgStock.put(org_Id, qty); + } + + rs.close(); + } + catch (SQLException e) + { + throw new OperationException("could not get stock enquiry data",e); + } + finally + { + close(pstmt, rs); + } + + String[] orgs = null; + + if (orgId == 0) + { + String orgIdList = Env.getContext(ctx,UdiConstants.ROLE_EDITABLE_ORGS_CTX_PARAM).toString(); + orgs = orgIdList.split(","); + } + else + { + orgs = new String[]{orgId + ""}; + } + + if (orgStock.isEmpty()) + { + for (String org : orgs) + { + Integer org_ID = Integer.parseInt(org); + orgStock.put(org_ID, Env.ZERO); + } + } + + return orgStock; + } + + public static HashMap getMonthlyStockAdjustments( + Properties ctx, int productId, String orgIds, Timestamp date1, Timestamp date2, + String trxName) throws OperationException + { + int precision = ProductManager.getUOMPrecision(ctx, productId); + int ad_client_id = Env.getAD_Client_ID(ctx); + + DateFormatSymbols dfs = new DateFormatSymbols(Locale.ENGLISH); + String[] monthName = dfs.getMonths(); + + HashMap monthQtyMap = new HashMap(); + HashMap dateQtymap = new HashMap(); + + StringBuffer movementTypes = new StringBuffer("'"+MTransaction. MOVEMENTTYPE_InventoryOut +"', ") + .append("'"+MTransaction. MOVEMENTTYPE_InventoryIn +"', ") + .append("'"+MTransaction. MOVEMENTTYPE_MovementFrom +"', ") + .append("'"+MTransaction. MOVEMENTTYPE_MovementTo +"'") ; + + StringBuffer sql = new StringBuffer(); + + sql.append(" SELECT SUM(movementQty), trx.movementDate FROM M_Transaction trx INNER JOIN") + .append(" M_Locator ml ON trx.M_Locator_ID = ml.M_Locator_ID") + .append(" WHERE trx.M_Product_ID = ?") + .append(" AND trx.movementType IN ("+movementTypes+")") + .append(" AND trx.AD_Client_ID = "+ad_client_id) + .append(" AND ml.AD_Org_ID IN ("+orgIds+")") + .append(" AND trx.movementDate BETWEEN "+DB.TO_DATE(date1, true) + " AND " + DB.TO_DATE(date2, true)) + .append(" GROUP BY trx.movementDate"); + + PreparedStatement pstmt =null; + ResultSet rs = null; + ArrayList list = new ArrayList(); + try + { + pstmt = DB.prepareStatement(sql.toString(), trxName); + pstmt.setInt(1, productId); + rs = pstmt.executeQuery(); + + while (rs.next()) + { + BigDecimal qty = rs.getBigDecimal(1); + Date date = rs.getDate(2); + + list.add(date); + + if (dateQtymap.containsKey(date)) + { + qty = qty.add(dateQtymap.get(date)); + } + dateQtymap.put(date, qty); + + } + } + catch (SQLException e) + { + throw new OperationException("could not retrieve montly stock adjustments with sql"+ sql, e); + } + finally + { + close(pstmt, rs); + } + + if (!list.isEmpty()) + { + Collections.sort(list); + + Iterator iter= list.iterator(); + StringBuffer monthYearList = new StringBuffer(); + /*String list_monthYears = POSReportManager.getListMonthYears(date1, date2);*/ + + + while (iter.hasNext()) + { + Date date = iter.next(); + + Calendar cal = Calendar.getInstance(); + cal.setTime(date); + + int month= cal.get(Calendar.MONTH); + int year = cal.get(Calendar.YEAR); + + String monthYear = monthName[month] + " " + year; + monthYearList.append(monthYear).append(","); + + BigDecimal qty = dateQtymap.get(date); + + if (monthQtyMap.containsKey(monthYear)) + { + qty = qty.add(monthQtyMap.get(monthYear)); + } + + monthQtyMap.put(monthYear, qty); + } + } + return monthQtyMap; + } + + + private static void close(PreparedStatement pstmt, ResultSet rs) throws OperationException + { + if (pstmt!=null) + { + try + { + pstmt.close(); + } + catch (Exception ex) + { + throw new OperationException("Could not close prepared statement" , ex); + } + finally + { + pstmt = null; + } + } + if (rs != null) + { + try + { + rs.close(); + } + catch (Exception ex) + { + throw new OperationException("Could not close result set", ex); + } + finally + { + rs = null; + } + } + } + + + public static ArrayList getStockAdjustments(Properties ctx, ArrayList reportData, + int productId, String orgIds, Timestamp date1, Timestamp date2, + String trxName) throws OperationException + { + + + String[] orgs = orgIds.split(","); + + + ArrayList orgIdList = new ArrayList(); + ArrayList orgNameList = new ArrayList(); + for (int i = 0; i map = new HashMap(); + map.put("I-", "Inventory Out"); + map.put("I+", "Inventory In"); + map.put("M-", "Movement Out"); + map.put("M+", "Movement In"); + + sql.append(" SELECT movementType, SUM(movementQty), ml.AD_Org_ID FROM M_Transaction trx INNER JOIN") + .append(" M_Locator ml ON trx.M_Locator_ID = ml.M_Locator_ID") + .append(" WHERE trx.M_Product_ID = " + productId) + .append(" AND movementType IN ('I+','I-','M+','M-')") + .append(" AND trx.AD_Client_ID = "+ad_client_id) + .append(" AND ml.AD_Org_ID IN ("+orgIds+")") + .append(" AND movementDate BETWEEN "+ DB.TO_DATE(date1, false)) + .append(" AND " + DB.TO_DATE(date2, false)) + .append(" GROUP BY movementType, ml.AD_Org_ID"); + + + PreparedStatement pstmt = null; + ResultSet rs = null; + + HashMap> moveTypeOrgMap = new HashMap>(); + + try + { + pstmt = DB.prepareStatement(sql.toString(), trxName); + rs = pstmt.executeQuery(); + HashMap orgList = null; + + while (rs.next()) + { + String movementType = rs.getString(1); + BigDecimal movementQty = rs.getBigDecimal(2); + Integer orgId = rs.getInt(3); + + if (movementQty == null) + { + movementQty = Env.ZERO; + } + + String moveType = map.get(movementType); + if (orgList == null) + { + orgList = new HashMap(); + orgList.put(orgId, movementQty); + } + + if (moveTypeOrgMap.isEmpty()) + { + moveTypeOrgMap.put(moveType, orgList); + } + else + { + if (moveTypeOrgMap.containsKey(moveType)) + { + HashMap newOrgList = moveTypeOrgMap.get(moveType); + BigDecimal qty = movementQty; + if (newOrgList.containsKey(orgId)) + { + qty = newOrgList.get(orgId); + if (qty!=null) + { + qty = qty.add(movementQty); + } + } + newOrgList.put(orgId, qty); + moveTypeOrgMap.put(moveType, newOrgList); + } + else + { + orgList = new HashMap(); + orgList.put(orgId, movementQty); + moveTypeOrgMap.put(moveType, orgList); + } + } + } + } + catch (SQLException e) + { + throw new OperationException("could not get stock adjustments",e); + } + finally + { + close(pstmt, rs); + } + + String[] moveTypeList = new String[map.size()]; + map.values().toArray(moveTypeList); + Object[] data = null; + + for (String movementType: moveTypeList) + { + HashMap orgQtyList = null; + + if (moveTypeOrgMap.containsKey(movementType)) + { + orgQtyList = moveTypeOrgMap.get(movementType); + } + + data = new Object[header.length]; + + data[0] = movementType; + for (int i=1; i< data.length; i++) + { + data[i] = Env.ZERO; + if (orgQtyList != null) + { + if (i <= orgIdList.size()) + { + int orgId = orgIdList.get(i-1); + if (orgQtyList.containsKey(orgId)) + { + BigDecimal qty = orgQtyList.get(orgId); + data[i] = qty; + } + } + } + } + reportData.add(data); + } + + return reportData; + } + + +} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/POSTerminalManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/POSTerminalManager.java new file mode 100644 index 0000000000..1d302fb942 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/businesslogic/POSTerminalManager.java @@ -0,0 +1,1165 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Created on May 8, 2006 by alok + */ + +package org.posterita.businesslogic; + +import java.math.BigDecimal; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.Properties; +import java.util.logging.Level; + +import javax.servlet.http.Cookie; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.compiere.model.MBPartner; +import org.compiere.model.MCash; +import org.compiere.model.MCashBook; +import org.compiere.model.MCurrency; +import org.compiere.model.MPOS; +import org.compiere.model.MPOSTerminal; +import org.compiere.model.MPayment; +import org.compiere.model.MPriceList; +import org.compiere.model.MStore; +import org.compiere.model.MWarehouse; +import org.compiere.util.CLogger; +import org.compiere.util.DB; +import org.compiere.util.Env; +import org.compiere.util.Trx; +import org.posterita.Constants; +import org.posterita.beans.TerminalBean; +import org.posterita.businesslogic.administration.BPartnerManager; +import org.posterita.core.TmkJSPEnv; +import org.posterita.exceptions.InvalidTerminalCashBookException; +import org.posterita.exceptions.OperationException; +import org.posterita.exceptions.TerminalInactivateException; +import org.posterita.exceptions.TerminalLockedException; +import org.posterita.exceptions.TerminalNotFoundException; +import org.posterita.lib.UdiConstants; +import org.posterita.util.PoManager; + +public class POSTerminalManager +{ + public static final CLogger logger = CLogger.getCLogger(POSTerminalManager.class); + + /** + * Creates a new POS Terminal + * @param ctx Context + * @param orgId Organisation + * @param name Name of the terminal + * @param cashbookId Cash Book + * @param bankAccountId Bank Account + * @param poPriceListId Purchase Price list + * @param soPriceListid Sales Price list + * @param warehouseId Warehouse + * @param cashBPartnerId BPartner to be used for Cash Transactions + * @param salesRepId Sales Representative + * @param trxName Transaction + * @return POS Terminal + * @throws OperationException If the terminal cannot be created + */ + public static MPOSTerminal createPOSTerminal(Properties ctx, int orgId, String name, + int cashbookId, int bankAccountId, int poPriceListId, int soPriceListid, int warehouseId,int cashBPartnerId, + int salesRepId, String trxName) throws OperationException + { + MPOSTerminal terminal = new MPOSTerminal(ctx, 0, trxName); + terminal.setAD_Org_ID(orgId); + terminal.setName(name); + terminal.setC_CashBook_ID(cashbookId); + terminal.setM_Warehouse_ID(warehouseId); + terminal.setPO_PriceList_ID(poPriceListId); + terminal.setSO_PriceList_ID(soPriceListid); + terminal.setCard_BankAccount_ID(bankAccountId); + terminal.setCheck_BankAccount_ID(bankAccountId); + terminal.setC_CashBPartner_ID(cashBPartnerId); + terminal.setCashBookTransferType(MPOSTerminal.CASHBOOKTRANSFERTYPE_BankAccount); + terminal.setCashTransferBankAccount_ID(bankAccountId); + PoManager.save(terminal); + return terminal; + } + + + /** + * Migrates old POS Terminal structure to the new one + * @param ctx Context + * @throws OperationException If new terminal cannot be created + */ + public static void migrateOldPOSTerminal(Properties ctx) throws OperationException + { + Trx trx = Trx.get(Trx.createTrxName(), true); + trx.start(); + + try + { + String whereClause = "IsActive='Y' AND AD_Client_ID=" + Env.getAD_Client_ID(ctx); + + int oldPosIds[] = MPOS.getAllIDs(MPOS.Table_Name, whereClause, trx.getTrxName()); + + for (int i = 0; i < oldPosIds.length; i++) + { + MPOS oldPOS = new MPOS(ctx, oldPosIds[i], trx.getTrxName()); + + String posName = oldPOS.getName(); + int warehouseId = oldPOS.getM_Warehouse_ID(); + int soPriceListId = oldPOS.getM_PriceList_ID(); + int cashBookId = oldPOS.getC_CashBook_ID(); + int cashBPartnerId = oldPOS.getC_BPartnerCashTrx_ID(); + int adOrgId = oldPOS.getAD_Org_ID(); + int bankAccountId = BankManager.getDefaultBankAccountId(ctx, adOrgId, trx.getTrxName()); + int salesRepId = oldPOS.getSalesRep_ID(); + MStore store = StoreManager.getStore(ctx); + if (store.get_ID() == 0) + { + throw new OperationException("Store could not be loaded"); + } + + int poPriceListId = store.getM_PriceList_ID(); + + MPOSTerminal terminal = createPOSTerminal(ctx, adOrgId, posName, cashBookId, bankAccountId, poPriceListId, soPriceListId, warehouseId, cashBPartnerId, salesRepId, trx.getTrxName()); + StringBuffer updateStmt = new StringBuffer(); + updateStmt.append("UPDATE C_Order SET C_POS_ID=").append(terminal.get_ID()); + updateStmt.append(" WHERE C_POS_ID=").append(oldPOS.get_ID()); + + DB.executeUpdate(updateStmt.toString(), trx.getTrxName()); + + oldPOS.setIsActive(false); + PoManager.save(oldPOS); + trx.commit(); + } + } + catch (Exception ex) + { + logger.log(Level.SEVERE, "Could not migrate old pos terminal", ex); + } + finally + { + trx.rollback(); + trx.close(); + } + } + + + /** + * Checks whether a check book can be set on a terminal + * @param ctx Context + * @param terminalId Terminal + * @param cashBookId Cash Book + * @param trxName Transaction + * @return Whether the cash book can be set on the terminal + * @throws OperationException If data cannot be retrieved + */ + public static boolean isCashBookAssignedValid(Properties ctx, int terminalId, int cashBookId, String trxName) throws OperationException + { + boolean valid = false; + + StringBuffer sqlStmt = new StringBuffer(); + sqlStmt.append("SELECT COUNT(*) FROM U_POSTerminal "); + sqlStmt.append("WHERE AD_Client_ID=? AND U_POSTerminal_ID<>? AND C_CashBook_ID=? "); + sqlStmt.append("AND U_POSTerminal.IsActive='Y' "); + + PreparedStatement pstmt = null; + ResultSet rs = null; + + try + { + pstmt = DB.prepareStatement(sqlStmt.toString(), trxName); + pstmt.setInt(1, Env.getAD_Client_ID(ctx)); + pstmt.setInt(2, terminalId); + pstmt.setInt(3, cashBookId); + + rs = pstmt.executeQuery(); + + if (rs.next()) + { + valid = (rs.getInt(1) == 0); + } + } + catch (Exception ex) + { + throw new OperationException("Could not check validity of Cash Book", ex); + } + finally + { + DB.close(rs, pstmt); + rs = null; + pstmt = null; + } + + return valid; + } + + /** + * Checks whether a cash book has been assigned on a terminal + * @param ctx Context + * @param cashBookId Context + * @param trxName Transaction + * @return True if cash book is present on a terminal + */ + public static boolean isCashbookPresentOnTerminal(Properties ctx, int cashBookId, String trxName) + { + String sqlStmt = "SELECT U_POSTerminal_ID FROM U_POSTerminal WHERE AD_Client_ID=? AND C_CashBook_ID=? AND IsActive='Y'"; + + int terminalId = DB.getSQLValue(trxName, sqlStmt, Env.getAD_Client_ID(ctx), cashBookId); + + return (terminalId != -1); + } + + /** + * Creates or updates a terminal based on Data provided + * @param ctx Context + * @param bean Terminal data + * @param trxName Transaction + * @return POS Terminal PO + * @throws OperationException If data could not be updated + */ + public static MPOSTerminal createUpdatePOSTerminal(Properties ctx, TerminalBean bean, String trxName) throws OperationException + { + MPOSTerminal terminal = getPO(ctx, bean, trxName); + + if (bean.getIsActive() && !isCashBookAssignedValid(ctx, bean.getTerminalId(), bean.getCashBookId(), trxName)) + { + throw new InvalidTerminalCashBookException("The cash book assigned is already present on another terminal"); + } + else if (!bean.getIsActive() && !canInactivateTerminal(ctx, terminal.getAD_Org_ID(), terminal.get_ID(), trxName)) + { + throw new TerminalInactivateException("This terminal cannot be inactivated as no other active terminal available"); + } + + PoManager.save(terminal); + bean.setTerminalId(terminal.get_ID()); + return terminal; + } + + /** + * Returns the Persistent Object from the model used for the Terminal + * @param ctx Context + * @param bean Data model used + * @param trxName Transaction + * @return Terminal PO + * @throws OperationException If data in the model is not valid to construct the PO + */ + public static MPOSTerminal getPO(Properties ctx, TerminalBean bean, String trxName) throws OperationException + { + MPOSTerminal terminal = new MPOSTerminal(ctx, bean.getTerminalId(), trxName); + if (terminal.get_ID() != bean.getTerminalId()) + { + // Happens only when trying to load a terminal that is not present + // and the PO model resets the Id to 0 + throw new OperationException("Could not load terminal"); + } + terminal.setAD_Org_ID(bean.getOrgId()); + terminal.setName(bean.getName()); + terminal.setDescription(bean.getDescription()); + terminal.setC_CashBook_ID(bean.getCashBookId()); + terminal.setC_CashBPartner_ID(bean.getBpartnerId()); + terminal.setC_TemplateBPartner_ID(bean.getTemplateBPartnerId()); + terminal.setCheck_BankAccount_ID(bean.getCheckBankAccountId()); + terminal.setCard_BankAccount_ID(bean.getCardBankAccountId()); + terminal.setIsActive(bean.getIsActive()); + terminal.setLocked(bean.getLocked()); + terminal.setM_Warehouse_ID(bean.getWarehouseId()); + terminal.setPO_PriceList_ID(bean.getPurchasePriceListId()); + terminal.setSO_PriceList_ID(bean.getSalesPriceListId()); + + terminal.setAutoLock(bean.getAutoLock()); + + if (bean.getAutoLock()) + { + terminal.setLockTime(bean.getLockingTime()); + } + else + { + terminal.setLockTime(0); + } + + terminal.setCashBookTransferType(bean.getCashbookTransferType()); + if ( MPOSTerminal.CASHBOOKTRANSFERTYPE_CashBook.equals(bean.getCashbookTransferType())) + { + if (bean.getCashbookTransferCashbookId() == 0) + { + throw new OperationException("No cash book defined to transfer cash transactions"); + } + terminal.setCashTransferCashBook_ID(bean.getCashbookTransferCashbookId()); + terminal.setCashTransferBankAccount_ID(0); + } + else if (MPOSTerminal.CASHBOOKTRANSFERTYPE_BankAccount.equals(bean.getCashbookTransferType())) + { + if (bean.getCashbookTransferBankAccountId() == 0) + { + throw new OperationException("No bank account defined to transfer cash transactions"); + } + terminal.setCashTransferCashBook_ID(0); + terminal.setCashTransferBankAccount_ID(bean.getCashbookTransferBankAccountId()); + } + + + terminal.setCheckTransferType(bean.getCheckTransferType()); + if (MPOSTerminal.CHECKTRANSFERTYPE_CashBook.equals(bean.getCheckTransferType())) + { + if (bean.getCheckTransferCashbookId() == 0) + { + throw new OperationException("No cash book defined to transfer check transactions"); + } + terminal.setCheckTransferCashBook_ID(bean.getCheckTransferCashbookId()); + terminal.setCheckTransferBankAccount_ID(0); + } + else if (MPOSTerminal.CHECKTRANSFERTYPE_BankAccount.equals(bean.getCheckTransferType())) + { + if (bean.getCheckTransferBankAccountId() == 0) + { + throw new OperationException("No bank account defined to transfer check transactions"); + } + terminal.setCheckTransferCashBook_ID(0); + terminal.setCheckTransferBankAccount_ID(bean.getCheckTransferBankAccountId()); + } + + terminal.setCardTransferType(bean.getCardTransferType()); + if (MPOSTerminal.CARDTRANSFERTYPE_CashBook.equals(bean.getCardTransferType())) + { + if (bean.getCardTransferCashbookId() == 0) + { + throw new OperationException("No cash book defined to transfer credit card transactions"); + } + terminal.setCardTransferCashBook_ID(bean.getCardTransferCashbookId()); + terminal.setCardTransferBankAccount_ID(0); + } + else if (MPOSTerminal.CARDTRANSFERTYPE_BankAccount.equals(bean.getCardBankAccountId())) + { + if (bean.getCardBankAccountId() == 0) + { + throw new OperationException("No bank account defined to transfer credit card transactions"); + } + terminal.setCardTransferCashBook_ID(0); + terminal.setCardTransferBankAccount_ID(bean.getCardTransferBankAccountId()); + } + return terminal; + } + + + /** + * Retrieves the terminal id from the cookie stored in the client's browser + * @param request Server Request + * @return Terminal ID present in the cookie or null if not present + */ + public static String getTerminalFromCookie(HttpServletRequest request) + { + return POSManager.getDataFromCookie(request, Constants.POSTERMINAL); + } + + /** + * Retrieves the terminal id from the cookie stored in the client's browser + * @param request Server Request + * @return Terminal ID present in the cookie + * @throws OperationException If the Terminal Id is not valid + */ + public static int getTerminalIdFromCookie(HttpServletRequest request) throws OperationException + { + String strTerminalId = getTerminalFromCookie(request); + + int terminalId = -1; + + try + { + terminalId = Integer.parseInt(strTerminalId); + Properties ctx = TmkJSPEnv.getCtx(request); + loadTerminal(ctx, terminalId, null); + } + catch (Exception ex) + { + throw new OperationException("Could not retrieve terminal Id"); + } + return terminalId; + } + + /** + * Set the terminal id in the cookie that is stored in the client's browser + * @param response Response to be sent to the client + * @param terminalId Terminal Id + */ + public static void setTerminalInCookie(HttpServletResponse response, int terminalId) + { + Cookie cookie = new Cookie(Constants.POSTERMINAL, String.valueOf(terminalId)); + cookie.setMaxAge(365*24*60*60); + response.addCookie(cookie); + } + + /** + * Reset the terminal id in the cookie that is stored in the client's browser + * @param response Response to be sent to client + */ + public static void resetTerminalInCookie(HttpServletResponse response) + { + Cookie cookie = new Cookie(Constants.POSTERMINAL, ""); + response.addCookie(cookie); + } + + /** + * Checks whether a POS Terminal is present with the id provided + * and the context organisation + * @param ctx Context + * @param posId POS Terminal + * @return + */ + public static boolean isPOSTerminalAccessible(Properties ctx, int terminalId) + { + String whereClause = "AD_Client_ID=" + Env.getAD_Client_ID(ctx) + + " AND AD_Org_ID=" + Env.getAD_Org_ID(ctx) + " AND U_PosTerminal_ID=" + terminalId + + " AND IsActive='Y'"; + + int posIds[] = MPOSTerminal.getAllIDs(MPOSTerminal.Table_Name, whereClause, null); + + if(posIds.length == 0) + { + return false; + } + return true; + } + + + /** + * Returns the terminal data model from the Terminal persistent object + * @param terminal Terminal PO + * @return Data model + */ + public static TerminalBean getBean(MPOSTerminal terminal) + { + int currentTerminalId = getTerminalId(terminal.getCtx()); + TerminalBean bean = new TerminalBean(); + bean.setTerminalId(terminal.getU_POSTerminal_ID()); + bean.setOrgId(terminal.getAD_Org_ID()); + bean.setName(terminal.getName()); + bean.setDescription(terminal.getDescription()); + bean.setAutoLock(terminal.isAutoLock()); + bean.setBpartnerId(terminal.getC_CashBPartner_ID()); + bean.setCashBookId(terminal.getC_CashBook_ID()); + bean.setCashbookTransferType(terminal.getCashBookTransferType()); + bean.setCashbookTransferBankAccountId(terminal.getCashTransferBankAccount_ID()); + bean.setCashbookTransferCashbookId(terminal.getCashTransferCashBook_ID()); + bean.setCheckBankAccountId(terminal.getCheck_BankAccount_ID()); + bean.setCheckTransferBankAccountId(terminal.getCheckTransferBankAccount_ID()); + bean.setCheckTransferCashbookId(terminal.getCheckTransferCashBook_ID()); + bean.setCheckTransferType(terminal.getCheckTransferType()); + bean.setCardBankAccountId(terminal.getCard_BankAccount_ID()); + bean.setCardTransferBankAccountId(terminal.getCardTransferBankAccount_ID()); + bean.setCardTransferCashbookId(terminal.getCardTransferCashBook_ID()); + bean.setCardTransferType(terminal.getCardTransferType()); + bean.setIsActive(terminal.isActive()); + bean.setLocked(terminal.isLocked()); + bean.setLockingTime(terminal.getLockTime()); + bean.setPurchasePriceListId(terminal.getPO_PriceList_ID()); + bean.setSalesPriceListId(terminal.getSO_PriceList_ID()); + bean.setTemplateBPartnerId(terminal.getC_TemplateBPartner_ID()); + bean.setWarehouseId(terminal.getM_Warehouse_ID()); + + if (currentTerminalId == terminal.get_ID()) + { + bean.setIsCurrentTerminal(true); + } + + return bean; + } + + + /** + * Retrieves POS Terminal + * @param ctx Context + * @param terminalId Terminal ID + * @param trxName Transaction + * @return Terminal + * @throws TerminalNotFoundException If the terminal does not exist or could not be loaded + */ + public static TerminalBean getTerminalBean(Properties ctx, int terminalId, String trxName) throws TerminalNotFoundException + { + MPOSTerminal posTerminal = new MPOSTerminal(ctx, terminalId, trxName); + if (posTerminal.get_ID() == 0) + { + throw new TerminalNotFoundException("Could not load terminal with id: " + terminalId); + } + + return getBean(posTerminal); + } + + /** + * Checks whether can activate + * @param ctx + * @param adOrgId + * @param trxName + * @return + */ + private static boolean canInactivateTerminal(Properties ctx, int adOrgId, int terminalId, String trxName) + { + String sqlStmt = "SELECT COUNT(*) FROM U_POSTerminal WHERE IsActive='Y' AND AD_Org_ID=? AND U_POSTerminal_ID<>?"; + + int count = DB.getSQLValue(trxName, sqlStmt, adOrgId, terminalId); + return (count >= 1); + } + + /** + * Updates the Terminal active state + * @param ctx Context + * @param terminalId Terminal ID + * @param active State of the terminal + * @param trxName Transaction + * @return Terminal Data model + * @throws OperationException If Terminal could not be updated + */ + public static TerminalBean updateTerminalStatus(Properties ctx, int terminalId, boolean active, String trxName) throws OperationException + { + MPOSTerminal terminal = loadTerminal(ctx, terminalId, trxName); + if (active && !isCashBookAssignedValid(ctx, terminalId, terminal.getC_CashBook_ID(), trxName)) + { + throw new InvalidTerminalCashBookException("Terminal cannot be reactivated as the cash book assigned to it is already being used"); + } + if (!active && !canInactivateTerminal(ctx, terminal.getAD_Org_ID(), terminalId, trxName)) + { + throw new TerminalInactivateException("Cannot inactivate this terminal as no active terminals present"); + } + terminal.setIsActive(active); + PoManager.save(terminal); + return getBean(terminal); + } + + /** + * Retrieves the Terminal ID from the applica + * @param ctx + * @return + */ + public static int getTerminalId(Properties ctx) + { + int terminalId = Env.getContextAsInt(ctx, UdiConstants.TERMINAL_ID); + return terminalId; + } + + /** + * Retrieves POS Terminal + * @param ctx Context + * @param terminalId Terminal ID + * @param trxName Transaction + * @return Terminal + * @throws TerminalNotFoundException If the terminal does not exist or could not be loaded + */ + public static MPOSTerminal loadTerminal(Properties ctx, int terminalId, String trxName) throws TerminalNotFoundException + { + MPOSTerminal posTerminal = new MPOSTerminal(ctx, terminalId, trxName); + if (posTerminal.get_ID() == 0) + { + throw new TerminalNotFoundException("Could not load terminal with id: " + terminalId); + } + + return posTerminal; + } + + /** + * Loads the PO of the terminal present in the application context + * @param ctx Context + * @return Terminal PO + * @throws TerminalNotFoundException If no terminal ID is present in the application context + * or the terminal ID is invalid + */ + public static MPOSTerminal loadTerminal(Properties ctx) throws TerminalNotFoundException + { + return loadTerminal(ctx, getTerminalId(ctx), null); + } + + /** + * Returns the Terminal PO from the terminal ID present in the application context + * @param ctx Context + * @return Terminal PO + * @throws TerminalNotFoundException If the terminal cannot be loaded + */ + public static MPOSTerminal getTerminal(Properties ctx) throws TerminalNotFoundException + { + int terminalId = getTerminalId(ctx); + return getTerminal(ctx, terminalId); + } + + /** + * Returns the Terminal PO from the terminal ID provided + * @param ctx Context + * @param terminalId + * @return + * @throws TerminalNotFoundException If the terminal cannot be loaded + */ + private static MPOSTerminal getTerminal(Properties ctx, int terminalId) throws TerminalNotFoundException + { + MPOSTerminal terminal = MPOSTerminal.get(ctx, terminalId); + if (terminal == null) + { + throw new TerminalNotFoundException("Terminal cannot be loaded"); + } + return terminal; + } + + /** + * Get all terminals from a search based on the name of the terminals + * @param ctx Context + * @param searchText Name search term + * @param trxName Transaction + * @return List of Terminals + * @throws OperationException If data cannot be retrieved + */ + public static ArrayList getTerminals(Properties ctx, String searchText, String trxName) throws OperationException + { + ArrayList terminalList = new ArrayList(); + StringBuffer sqlStmt = new StringBuffer(); + + sqlStmt.append("SELECT pos.*, o.Name as orgName, p1.Name as poPriceList, p2.Name as soPriceList "); + sqlStmt.append("FROM U_POSTerminal pos "); + sqlStmt.append("LEFT JOIN AD_Org o ON pos.AD_Org_ID=o.AD_Org_ID "); + sqlStmt.append("LEFT JOIN M_PriceList p1 ON pos.PO_PriceList_ID=p1.M_PriceList_ID "); + sqlStmt.append("LEFT JOIN M_PriceList p2 ON pos.SO_PriceList_ID=p2.M_PriceList_ID "); + sqlStmt.append("WHERE UPPER(pos.Name) LIKE UPPER(?) AND pos.AD_Client_ID=? "); + sqlStmt.append("AND pos.AD_Org_ID IN (").append(Env.getContext(ctx, UdiConstants.ROLE_EDITABLE_ORGS_CTX_PARAM)).append(") "); + sqlStmt.append("ORDER BY pos.Name"); + PreparedStatement pstmt = null; + ResultSet rs = null; + + if (searchText == null) + { + searchText = ""; + } + + searchText = "%" + searchText.trim() + "%"; + + int currentTerminalId = getTerminalId(ctx); + + try + { + pstmt = DB.prepareStatement(sqlStmt.toString(), trxName); + pstmt.setString(1, searchText); + pstmt.setInt(2, Env.getAD_Client_ID(ctx)); + + rs = pstmt.executeQuery(); + while (rs.next()) + { + MPOSTerminal terminal = new MPOSTerminal(ctx, rs, trxName); + TerminalBean terminalBean = getBean(terminal); + terminalBean.setOrgName(rs.getString("orgName")); + terminalBean.setPoPriceList(rs.getString("poPriceList")); + terminalBean.setSoPriceList(rs.getString("soPriceList")); + terminalBean.setIsCurrentTerminal(false); + + if (terminal.get_ID() == currentTerminalId) + { + terminalBean.setIsCurrentTerminal(true); + } + + terminalList.add(terminalBean); + } + } + catch (Exception ex) + { + logger.log(Level.SEVERE, "Could not retrieve terminals", ex); + throw new OperationException("Could not retrieve terminals, cause: " + ex.getMessage()); + } + finally + { + DB.close(rs, pstmt); + } + + return terminalList; + } + + + /** + * Retrieves list of active terminals + * @param ctx Context + * @param adOrgId Organisation + * @param trxName Transaction + * @return List of Active Terminals + * @throws OperationException If data cannot be retrieved + */ + public static ArrayList getAllActiveTerminals(Properties ctx, int adOrgId, String trxName) throws OperationException + { + ArrayList terminalList = new ArrayList(); + + String sqlStmt = "SELECT * FROM U_POSTerminal WHERE AD_Client_ID=? " + + "AND AD_Org_ID=? AND IsActive='Y' ORDER BY Name"; + + PreparedStatement pstmt = null; + ResultSet rs = null; + + try + { + pstmt = DB.prepareStatement(sqlStmt, trxName); + pstmt.setInt(1, Env.getAD_Client_ID(ctx)); + pstmt.setInt(2, adOrgId); + + rs = pstmt.executeQuery(); + + while (rs.next()) + { + MPOSTerminal terminal = new MPOSTerminal(ctx, rs, trxName); + TerminalBean terminalBean = getBean(terminal); + terminalList.add(terminalBean); + } + } + catch (Exception ex) + { + logger.log(Level.SEVERE, "Could not retrieve terminals", ex); + throw new OperationException("Could not retrieve terminals, cause: " + ex.getMessage()); + } + finally + { + DB.close(rs, pstmt); + } + + return terminalList; + } + + + /** + * Retrieves the currency for the Sales Price List for the POS Terminal + * @param ctx Context + * @return Currency of Sales PriceList + * @throws TerminalNotFoundException + */ + public static MCurrency getDefaultSalesCurrency(Properties ctx) throws TerminalNotFoundException + { + int salesPriceListId = POSTerminalManager.getSOPriceListId(ctx); + MPriceList priceList = new MPriceList(ctx, salesPriceListId, null); + MCurrency currency = new MCurrency(ctx, priceList.getC_Currency_ID(), null); + return currency; + } + + /** + * Retrieves the currency for the Sales Price List for the POS Terminal + * @param ctx Context + * @return Currency of Sales PriceList + * @throws OperationException + */ + public static MCurrency getDefaultPurchaseCurrency(Properties ctx) throws OperationException + { + int poPriceListId = getPOPriceListId(ctx); + MPriceList priceList = new MPriceList(ctx, poPriceListId, null); + MCurrency currency = new MCurrency(ctx,priceList.getC_Currency_ID(),null); + return currency; + } + + /** + * Retrieves the BPartner to be used for Cash Transactions for the the terminal present in + * the application context + * @param ctx Context + * @return BPartner + * @throws OperationException If the BPartner cannot be loaded + */ + public static MBPartner getCashBPartner(Properties ctx) throws OperationException + { + MPOSTerminal terminal = getTerminal(ctx); + int cashBPartnerId = terminal.getC_CashBPartner_ID(); + return BPartnerManager.loadBPartner(ctx, cashBPartnerId, null); + } + + /** + * Retrieves the ID of the BPartner defined on the Terminal present in application context + * that is to be used for Cash Transactions + * @param ctx Context + * @return ID of BPartner for cash transactions + * @throws TerminalNotFoundException If the terminal cannot be loaded + */ + public static int getCashBPartnerId(Properties ctx) throws TerminalNotFoundException + { + MPOSTerminal terminal = getTerminal(ctx); + int cashBPartnerId = terminal.getC_CashBPartner_ID(); + return cashBPartnerId; + } + + /** + * Returns the name of the printer to be used for server printing + * @param ctx Context + * @return Name of printer to be used for server printing + * @throws TerminalNotFoundException If the terminal cannot be loaded + */ + public static String getPOSPrinter(Properties ctx) throws TerminalNotFoundException + { + MPOSTerminal terminal = getTerminal(ctx); + return terminal.getPrinterName(); + } + + /** + * Returns the Cash Book associated with the terminal defined in the application context + * @param ctx Context + * @return Cash Book + * @throws OperationException If the cash book cannot be + */ + public static MCashBook getCashBook(Properties ctx) throws OperationException + { + int terminalId = Env.getContextAsInt(ctx,UdiConstants.TERMINAL_ID); + return getCashBook(ctx, terminalId); + } + + /** + * Returns the Cash Book ID of the Cash Book associated with the terminal defined in the + * application context + * @param ctx Context + * @return Cash Book ID + * @throws OperationException If the terminal cannot be loaded + */ + public static int getCashBookId(Properties ctx) throws OperationException + { + return getTerminal(ctx).getC_CashBook_ID(); + } + + /** + * Returns the Cash Book associated with the terminal provided + * @param ctx Context + * @param terminalId Terminal + * @return Cash Book + * @throws OperationException If the terminal/cash book cannot be loaded + */ + public static MCashBook getCashBook(Properties ctx, int terminalId) throws OperationException + { + MPOSTerminal terminal = getTerminal(ctx, terminalId); + int cashBookId = terminal.getC_CashBook_ID(); + MCashBook cashBook = CashManager.loadCashBook(ctx, cashBookId, null); + return cashBook; + } + + /** + * Retrieves the cash book ID associated with the terminal provided + * @param ctx Context + * @param terminalId Terminal ID + * @return Cash Book ID + * @throws OperationException If the terminal cannot be loaded + */ + public static int getCashBookId(Properties ctx, int terminalId) throws OperationException + { + MPOSTerminal terminal = getTerminal(ctx, terminalId); + return terminal.getC_CashBook_ID(); + } + + /** + * Retrieves the Warehouse associated with the terminal present in the application context + * @param ctx Context + * @return Warehouse + * @throws TerminalNotFoundException If the terminal cannot be loaded + */ + public static MWarehouse getWarehouse(Properties ctx) throws TerminalNotFoundException + { + int terminalId = Env.getContextAsInt(ctx,UdiConstants.TERMINAL_ID); + return getWarehouse(ctx, terminalId); + } + + /** + * Retrieves the Warehouse associated with the terminal provided + * @param ctx Context + * @param terminalId Terminal + * @return Warehouse + * @throws TerminalNotFoundException If terminal cannot be loaded + */ + public static MWarehouse getWarehouse(Properties ctx, int terminalId) throws TerminalNotFoundException + { + MPOSTerminal terminal = loadTerminal(ctx, terminalId, null); + int warehouseId = terminal.getM_Warehouse_ID(); + MWarehouse warehouse = new MWarehouse(ctx,warehouseId,null); + return warehouse; + } + + /** + * Retrieves the currency of the Cash Book associated with terminal in the application context + * @param ctx Context + * @return Currency of Cash Book + * @throws OperationException If terminal/cash book cannot be loaded + */ + public static MCurrency getCurrencyOfTerminalCashBook(Properties ctx) throws OperationException + { + int terminalId = Env.getContextAsInt(ctx,UdiConstants.TERMINAL_ID); + return getCurrencyOfTerminalCashBook(ctx, terminalId); + } + + /** + * Retrieves the currency of the Cash Book associated with the terminal provided + * @param ctx Context + * @param terminalId Terminal + * @return Currency of Cash Book + * @throws OperationException If Terminal/Cash Book cannot be loaded + */ + public static MCurrency getCurrencyOfTerminalCashBook(Properties ctx, int terminalId) throws OperationException + { + MCashBook cashBook = getCashBook(ctx, terminalId); + MCurrency currency = new MCurrency(ctx, cashBook.getC_Currency_ID(), null); + return currency; + } + + + /** + * Retrieves the name of the POS Terminal in context + * @param ctx Context + * @return Terminal Name + * @throws TerminalNotFoundException If the terminal cannot be loaded + */ + public static String getTerminalName(Properties ctx) throws TerminalNotFoundException + { + MPOSTerminal terminal = getTerminal(ctx); + return terminal.getName(); + } + + /** + * Retrieves the name of the POS Terminal + * @param ctx Context + * @param terminalId Terminal + * @return Terminal Name + * @throws TerminalNotFoundException If the terminal cannot be loaded + */ + public static String getTerminalName(Properties ctx, int terminalId) throws TerminalNotFoundException + { + MPOSTerminal terminal = getTerminal(ctx, terminalId); + return terminal.getName(); + } + + /** + * Retrieves the id of the sales price list associated with the POS Terminal in context. + * @param ctx context + * @return price list id + * @throws TerminalNotFoundException + */ + public static int getSOPriceListId(Properties ctx) throws TerminalNotFoundException + { + return getPriceListId(ctx, true); + } + + /** + * Retrieves the id of the purchase price list associated with the POS Terminal in context. + * @param ctx context + * @return price list id + * @throws TerminalNotFoundException + */ + public static int getPOPriceListId(Properties ctx) throws TerminalNotFoundException + { + return getPriceListId(ctx, false); + } + + /** + * Retrieves price list associated with the POS Terminal in context + * @param ctx Context + * @param isSOTrx Sales Pricelist + * @return Price List ID (Sales or Purchase) + * @throws TerminalNotFoundException + */ + public static int getPriceListId(Properties ctx, boolean isSOTrx) throws TerminalNotFoundException + { + MPOSTerminal terminal = getTerminal(ctx); + + if (isSOTrx) + { + return terminal.getSO_PriceList_ID(); + } + else + { + return terminal.getPO_PriceList_ID(); + } + } + + /** + * Updates the price list associated with the POS Terminal in context. + * @param ctx context + * @param priceListId price list id + * @param isSOTrx True for sales price list and false for purchase price list + * @throws OperationException + */ + public static void setTerminalPriceListId(Properties ctx, int priceListId, + boolean isSOTrx, String trxName) throws OperationException + { + MPOSTerminal terminal = loadTerminal(ctx); + terminal.set_TrxName(trxName); + + if (isSOTrx) + { + terminal.setSO_PriceList_ID(priceListId); + } + else + { + terminal.setPO_PriceList_ID(priceListId); + } + PoManager.save(terminal); + } + + /** + * Retrieves the organisation associated with the POS Terminal in context. + * @param ctx context + * @return Organisation Id (AD_Org_ID) + * @throws TerminalNotFoundException + */ + public static int getOrgId(Properties ctx) throws TerminalNotFoundException + { + MPOSTerminal terminal = getTerminal(ctx); + return terminal.getAD_Org_ID(); + } + + /** + * Retrieves the Warehouse associated with the POS Terminal in context. + * @param ctx context + * @return Warehouse Id (M_Warehouse_ID) + * @throws TerminalNotFoundException + */ + public static int getWarehouseId(Properties ctx) throws TerminalNotFoundException + { + MPOSTerminal terminal = getTerminal(ctx); + return terminal.getM_Warehouse_ID(); + } + + /** + * Return the Bank Account specified for a tender type on the terminal + * @param ctx Context + * @param tenderType Payment Tender Type + * @return Bank Account Id + * @throws OperationException If no Bank Account is defined for tender type + */ + public static int getBankAccountId(Properties ctx, String tenderType) throws OperationException + { + MPOSTerminal terminal = getTerminal(ctx); + int bankAccountId = 0; + + if (MPayment.TENDERTYPE_Check.equals(tenderType)) + { + bankAccountId = terminal.getCheck_BankAccount_ID(); + } + else if (MPayment.TENDERTYPE_CreditCard.equals(tenderType)) + { + bankAccountId = terminal.getCheck_BankAccount_ID(); + } + + if (bankAccountId <= 0) + { + throw new OperationException("No bank account defined on the terminal for the tender type: " + tenderType); + } + + return bankAccountId; + } + + /** + * Retrieves the lock status of the terminal present in the application context is locked + * @param ctx Context + * @return Lock status of the terminal + * @throws TerminalNotFoundException If terminal cannot be loaded + */ + public static boolean isTerminalLocked(Properties ctx) throws TerminalNotFoundException + { + int terminalId = getTerminalId(ctx); + return isTerminalLocked(ctx, terminalId); + } + + /** + * Retrieves the locked status of the terminal provided + * @param ctx Context + * @param terminalId Terminal + * @return Lock status of the terminal + * @throws TerminalNotFoundException If the terminal cannot be loaded + */ + public static boolean isTerminalLocked(Properties ctx, int terminalId) throws TerminalNotFoundException + { + MPOSTerminal terminal = getTerminal(ctx, terminalId); + return terminal.isLocked(); + } + + /** + * Update the lock status of the terminal in context + * @param ctx Context + * @param terminalId Terminal + * @param trxName Transaction + * @throws OperationException If terminal cannot be loaded/cannot update terminal status + */ + public static void setTerminalLockStatus(Properties ctx, int terminalId, boolean locked, String trxName) throws OperationException + { + MPOSTerminal terminal = loadTerminal(ctx); + terminal.setLocked(locked); + PoManager.save(terminal); + } + + + /** + * Closes the till (Terminal). Does all the transfer of money that has been defined on the terminal + * @param ctx Context + * @param terminalId Terminal + * @param cashJournal Cash Journal being used from the cash book + * @param cashAmount Cash amount that need to be transfered + * @param checkAmount Check amount that need to be transfered + * @param cardAmount Card amount that need to be transfered + * @param trxName Transaction + * @throws OperationException If terminal is locked or transfers cannot be done + */ + public static void closeTerminal(Properties ctx, int terminalId, MCash cashJournal, BigDecimal cashAmount, + BigDecimal checkAmount, BigDecimal cardAmount, String trxName) throws OperationException + { + if (isTerminalLocked(ctx, terminalId)) + { + throw new TerminalLockedException("Terminal is locked"); + } + + MPOSTerminal terminal = loadTerminal(ctx, terminalId, trxName); + int cashBookId = cashJournal.getC_CashBook_ID(); + MCashBook cashBook = new MCashBook(ctx, cashBookId, trxName); + int currencyId = cashBook.getC_Currency_ID(); + Timestamp dateAcct = cashJournal.getStatementDate(); + + if (MPOSTerminal.CASHBOOKTRANSFERTYPE_BankAccount.equals(terminal.getCashBookTransferType())) + { + int bankAccountId = terminal.getCashTransferBankAccount_ID(); + CashManager.createBankTransferCashEntry(ctx, cashJournal, cashAmount, bankAccountId, trxName); + } + else if (MPOSTerminal.CASHBOOKTRANSFERTYPE_CashBook.equals(terminal.getCashBookTransferType())) + { + int toCashBookId = terminal.getCashTransferCashBook_ID(); + CashTransferManager.transferFromJournalToCashBook(ctx, cashJournal, toCashBookId, currencyId, cashAmount, dateAcct, trxName); + } + + if (MPOSTerminal.CHECKTRANSFERTYPE_BankAccount.equals(terminal.getCheckTransferType())) + { + int fromBankAccountId = terminal.getCheck_BankAccount_ID(); + int toBankAccountId = terminal.getCheckTransferBankAccount_ID(); + CashTransferManager.transferBankToBank(ctx, fromBankAccountId, toBankAccountId, currencyId, checkAmount, dateAcct, trxName); + } + else if (MPOSTerminal.CHECKTRANSFERTYPE_CashBook.equals(terminal.getCheckTransferType())) + { + int fromBankAccountId = terminal.getCheck_BankAccount_ID(); + int toCashBookId = terminal.getCheckTransferCashBook_ID(); + MCash toCashJournal = CashManager.getCashJournal(ctx, toCashBookId, trxName); + CashManager.createBankTransferCashEntry(ctx, toCashJournal, checkAmount.negate(), fromBankAccountId, trxName); + } + + + if (MPOSTerminal.CARDTRANSFERTYPE_BankAccount.equals(terminal.getCardTransferType())) + { + int fromBankAccountId = terminal.getCard_BankAccount_ID(); + int toBankAccountId = terminal.getCard_BankAccount_ID(); + CashTransferManager.transferBankToBank(ctx, fromBankAccountId, toBankAccountId, currencyId, cardAmount, dateAcct, trxName); + } + else if (MPOSTerminal.CARDTRANSFERTYPE_CashBook.equals(terminal.getCardTransferType())) + { + int fromBankAccountId = terminal.getCard_BankAccount_ID(); + int toCashBookId = terminal.getCardTransferCashBook_ID(); + MCash toCashJournal = CashManager.getCashJournal(ctx, toCashBookId, trxName); + CashManager.createBankTransferCashEntry(ctx, toCashJournal, cardAmount.negate(), fromBankAccountId, trxName); + } + + if (terminal.isAutoLock()) + { + // Lock the terminal + terminal.setLocked(true); + } + + PoManager.save(terminal); + } +} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/PartialPOSManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/PartialPOSManager.java new file mode 100644 index 0000000000..e5d74e02c4 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/businesslogic/PartialPOSManager.java @@ -0,0 +1,299 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Created on 14-Mar-2006 + */ + + +package org.posterita.businesslogic; + +import java.math.BigDecimal; +import java.sql.PreparedStatement; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.Properties; + +import org.compiere.model.MInOut; +import org.compiere.model.MInvoice; +import org.compiere.model.MOrder; +import org.compiere.model.MOrderLine; +import org.compiere.model.MPayment; +import org.compiere.process.DocAction; +import org.compiere.process.DocumentEngine; +import org.compiere.util.DB; +import org.compiere.util.Env; +import org.posterita.Constants; +import org.posterita.beans.ItemBean; +import org.posterita.beans.OrderLineBean; +import org.posterita.core.DocStatusMap; +import org.posterita.exceptions.InvalidInvokeOrderStatusException; +import org.posterita.exceptions.InvalidOrderIDException; +import org.posterita.exceptions.InvalidOrderTypeException; +import org.posterita.exceptions.InvalidTenderedAmountException; +import org.posterita.exceptions.NoOrderLineFoundException; +import org.posterita.exceptions.NoOrderLineSelectedException; +import org.posterita.exceptions.OperationException; +import org.posterita.lib.UdiConstants; +import org.posterita.order.UDIOrderTypes; +import org.posterita.util.PoManager; + + +public class PartialPOSManager extends POSManager +{ + public static void validateMixedPaymentAmount(OrderLineBean bean) throws InvalidTenderedAmountException + { + if(bean.getTrxType().equalsIgnoreCase("Mixed")) + { + double cashAmt = 0.0; + double chequeAmt = 0.0; + double cardAmt = 0.0; + + cashAmt = (bean.getPaymentByCash()!=null) ? bean.getPaymentByCash() : cashAmt; + chequeAmt = (bean.getPaymentByChq()!=null) ? bean.getPaymentByChq() : chequeAmt; + cardAmt = (bean.getPaymentByCard()!=null) ? bean.getPaymentByCard() : cardAmt; + + double sumActualAmt=bean.getTotalActualPrice(); + + + if( + (cashAmt+chequeAmt+cardAmt !=sumActualAmt)|| + (cashAmt<0.0)|| + (chequeAmt<0.0)|| + (cardAmt<0.0) + ) + { + throw new InvalidTenderedAmountException("The Tendered Amount should be equal to the total amount"); + } + } + } + + //FIXME + public static String deleteOrderLines(Properties ctx,Integer[]orderlineIds,String trxName) throws OperationException + { + if((orderlineIds == null)||(orderlineIds.length == 0)) + { + throw new NoOrderLineSelectedException("Cannot delete orderlines. No orderlines supplied!"); + } + + for(int i=0;i cartBeanItems, String trxName) throws OperationException + { + + MOrder order = new MOrder(ctx,orderId,trxName); + validateMixedPaymentAmount(bean); + + String paymentRule = getPaymentRule(ctx,bean.getTrxType()); + + order.setPaymentRule(paymentRule); + + PoManager.save(order); + + int i=0; + for(ItemBean itemBean : cartBeanItems) + { + double actualPrice = 0.0; + double discount = 0.0; + + if(bean.getDiscountPercent()!=null) + { + String discountEntered = bean.getDiscountPercent()[i]; + + if( discountEntered == null || discountEntered.equals("")) + { + discount = 0; + } + else + { + discount = Double.parseDouble(bean.getDiscountPercent()[i]); + + //double d = 100.0 - discount; + double priceWithDiscount = Double.parseDouble(bean.getActualPrice()[i]); + + // newPrice = (actualPrice + VAT) - discount + + actualPrice = (100.0 / 115.0) * priceWithDiscount; + } + } + + itemBean.setDiscountPercent(new BigDecimal(discount)); + itemBean.setActualPrice(new BigDecimal(actualPrice)); + + updateOrderLine(ctx,order,itemBean.getProductId().intValue(),itemBean.getDiscountPercent(),itemBean.getActualPrice()) ; + + i++; + } + + + return order; + } + + private static void updateOrderLine(Properties ctx,MOrder order,int productID,BigDecimal discount,BigDecimal actualPrice) throws OperationException + { + //load orderLine + int orderId = order.get_ID(); + + int id[] = MOrderLine.getAllIDs(MOrderLine.Table_Name,"C_ORDER_ID = "+orderId+" AND M_PRODUCT_ID = "+productID,order.get_TrxName()); + if((id==null)||(id.length==0)) + { + throw new OperationException("OrderLine not found."); + } + + String trxName = order.get_TrxName(); + + MOrderLine orderLine = new MOrderLine(ctx,id[0],trxName); + + //calculating new price + BigDecimal newActualPrice = OrderManager.calculateActualPrice(ctx,orderLine.getPriceActual(),discount); + orderLine.setPrice (newActualPrice); + + PoManager.save(orderLine); + + } + + public static MOrder invokePartialOrder(Properties ctx,int orderId,String trxName) throws InvalidOrderIDException,NoOrderLineFoundException,InvalidInvokeOrderStatusException + { + //checking whether order exixts + int ids[] = MOrder.getAllIDs(MOrder.Table_Name,"ISACTIVE='Y' AND C_ORDER_ID = " + orderId,null); + + if((ids == null)||(ids.length == 0)) + { + throw new InvalidOrderIDException("Could not found order!"); + } + + //loading order + MOrder order = new MOrder(ctx,ids[0],trxName); + + //checking order status + String status = order.getDocStatus(); + if((status.equals(DocAction.STATUS_Drafted))||(status.equals(DocAction.STATUS_InProgress))) + { + //looking for orderlines + if(OrderManager.isOrderEmpty(ctx,orderId,trxName)) + { + throw new NoOrderLineFoundException("Order does contain any orderlines!"); + } + } + else + { + //display err msg + String s = DocStatusMap.getDocStatusMap().get(status); + throw new InvalidInvokeOrderStatusException("Cannot invoke with status: " + s,s); + } + + return order; + } + + public static MOrder invokePartialOrder (Properties ctx, String documentNo, String trxName) throws InvalidOrderIDException,NoOrderLineFoundException,InvalidInvokeOrderStatusException, InvalidOrderTypeException + { + int orderId=getOrderIdFromDocumentNo(ctx,documentNo); + //loading order + MOrder order = new MOrder(ctx,orderId,trxName); + + //check order type + //only drafted pos orders can be invoked + String orderType = order.getOrderType(); + if(! orderType.equalsIgnoreCase( UDIOrderTypes.POS_ORDER.getOrderType() ) ) + { + throw new InvalidOrderTypeException("Can only POS orders "); + } + + //checking order status + String status = order.getDocStatus(); + if((status.equals(DocAction.STATUS_Drafted))||(status.equals(DocAction.STATUS_InProgress))) + { + //looking for orderlines + if(OrderManager.isOrderEmpty(ctx,orderId,trxName)) + { + throw new NoOrderLineFoundException("Order does contain any orderlines!"); + } + } + else + { + //display err msg + String s = DocStatusMap.getDocStatusMap().get(status); + throw new InvalidInvokeOrderStatusException("Cannot invoke with status: " + s,s); + } + + return order; + } + + public static int getOrderIdFromDocumentNo(Properties ctx,String documentNo) throws InvalidOrderIDException + { +// checking whether order exixts + int ids[] = MOrder.getAllIDs(MOrder.Table_Name,"ISACTIVE='Y' AND AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+" and DOCUMENTNO = '" + documentNo + "'",null); + + if((ids == null)||(ids.length == 0)) + { + throw new InvalidOrderIDException("Could not found order!"); + } + + return ids[0]; + + } + +} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/PaymentAllocationManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/PaymentAllocationManager.java new file mode 100644 index 0000000000..038eed7589 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/businesslogic/PaymentAllocationManager.java @@ -0,0 +1,372 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Dec 7, 2006 by alok + */ + + +package org.posterita.businesslogic; + +import java.math.BigDecimal; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.Properties; + +import org.compiere.model.MAllocationHdr; +import org.compiere.model.MAllocationLine; +import org.compiere.model.MInvoice; +import org.compiere.model.MPayment; +import org.compiere.process.DocumentEngine; +import org.compiere.util.DB; +import org.compiere.util.Env; + +import org.posterita.beans.OpenItemBean; +import org.posterita.exceptions.AllocatedAmtMoreThanOpenAmtException; +import org.posterita.exceptions.CanNotCreatePaymentAllocationException; +import org.posterita.exceptions.NoAllocateeInvoiceException; +import org.posterita.exceptions.OperationException; +import org.posterita.exceptions.PayAmtNotEqualToAllocateAmtException; +import org.posterita.exceptions.TooManyAllocateInvoiceException; +import org.posterita.util.PoManager; + + +public class PaymentAllocationManager +{ + + + public static void allocate(Properties ctx, Integer[] invoiceIds, Integer[] paymentIds, String trxName) throws TooManyAllocateInvoiceException,CanNotCreatePaymentAllocationException,OperationException + { + + BigDecimal discountAmt = new BigDecimal(0); + BigDecimal writeOffAmt = new BigDecimal(0); + BigDecimal overUnderAmt = new BigDecimal(0); + int paymentId = 0; + int cashLineId=0; + int creditInvoiceId=0; + MInvoice invoice = null; + BigDecimal appliedAmt=new BigDecimal(0); + int count=0; + + if(invoiceIds==null || invoiceIds.length<1) + { + throw new NoAllocateeInvoiceException("Please select an Invoice to allocate"); + } + + if(invoiceIds.length<2 && (paymentIds==null || paymentIds.length<1)) + { + throw new NoAllocateeInvoiceException("Please select an Invoice to allocate"); + } + + + for(int i=0;i1) + throw new TooManyAllocateInvoiceException("can match only one credit Invoice"); + creditInvoiceId=invoice.get_ID(); + } + + } + if(count==0) + { + throw new NoAllocateeInvoiceException("Please select an Invoice to allocate"); + } + + MInvoice creditInvoice = new MInvoice(ctx,creditInvoiceId,null); + if(appliedAmt.doubleValue()>0) + { + if((appliedAmt.doubleValue())>creditInvoice.getOpenAmt().doubleValue()) + { + throw new CanNotCreatePaymentAllocationException("the allocation amt is more than open amt"); + } + } + + MAllocationHdr alloc = new MAllocationHdr (ctx, true, // manual + new Timestamp(System.currentTimeMillis()), creditInvoice.getC_Currency_ID(), Env.getContext(Env.getCtx(), "#AD_User_Name"), trxName); + alloc.setAD_Org_ID(Env.getAD_Org_ID(ctx)); + alloc.save(); + + if(invoiceIds.length>1) + { + for(int j=0;j0) + { + MPayment payment=null; + BigDecimal overUnderPaymentAmt = null; + for(int k=0;kcreditInvoice.getOpenAmt().doubleValue()) + { + overUnderPayment=availableAmt.subtract(creditInvoice.getOpenAmt()); + } + else + { + overUnderPayment=payment.getOverUnderAmt(); + } + */ + + MAllocationLine aLine = new MAllocationLine (alloc, allocationAmt, + payment.getDiscountAmt(), payment.getWriteOffAmt(),overUnderPaymentAmt ); + aLine.setDocInfo(creditInvoice.getC_BPartner_ID(),creditInvoice.getC_Order_ID(), creditInvoice.get_ID()); + aLine.setPaymentInfo(payment.get_ID(), cashLineId); + aLine.save(); + } + } + + + String sql = "SELECT invoiceOpen("+creditInvoiceId+", 0) FROM C_Invoice WHERE C_Invoice_ID = ?"; + BigDecimal open = DB.getSQLValueBD(null, sql, creditInvoiceId); + if (open != null && open.signum() == 0) + { + sql = "UPDATE C_Invoice SET IsPaid='Y' WHERE C_Invoice_ID=" + creditInvoiceId; + DB.executeUpdate(sql,null); + + } + + alloc.processIt(DocumentEngine.ACTION_Complete); + PoManager.save(alloc); + } + + private static BigDecimal getAvailableAmt(Properties ctx, int paymentId) throws OperationException + { + String sql = "select availableAmt from RV_payment where AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+ + " and C_Payment_id="+paymentId; + + PreparedStatement pstmt = DB.prepareStatement(sql,null); + + BigDecimal availableAmt=new BigDecimal(0.0); + try + { + ResultSet rs = pstmt.executeQuery(); + while(rs.next()) + { + availableAmt=rs.getBigDecimal(1); + } + rs.close(); + + } + catch (SQLException e) + { + throw new OperationException(e); + } + finally + { + try + { + + pstmt.close(); + } + catch (SQLException e) + { + + } + + } + + return availableAmt; + } + + + + public static ArrayList getInvoiceToAllocate(Properties ctx,Integer [] invoiceIds,String trxName) throws TooManyAllocateInvoiceException,CanNotCreatePaymentAllocationException,OperationException + { + if(invoiceIds==null) + { + throw new NoAllocateeInvoiceException("Please select an Invoice to allocate"); + } + ArrayList list=new ArrayList(); + for (int i=0;i0) + { + for(int k=0;k0) + { + + for(int k=0;k list = new ArrayList(); + + try + { + rs = pstmt.executeQuery(); + + while(rs.next()) + { + bean= new PaymentHistoryBean(); + bean.setPaymentId(Integer.valueOf(rs.getInt(1))); + bean.setPartnerName(rs.getString(2)); + bean.setDocumentNo(rs.getString(3)); + bean.setDateTrx(rs.getTimestamp(4)); + bean.setIsReceipt(rs.getString(5)); + bean.setInvoiceId(Integer.valueOf(rs.getInt(6))); + bean.setCheckNo(rs.getString(7)); + bean.setPayAmt(Integer.valueOf(rs.getInt(8))); + bean.setDocStatus(UDIMap.docStatusMap.get(rs.getString(9))); + bean.setDocStatusCode(rs.getString(9)); + bean.setOrderId(Integer.valueOf(rs.getInt(10))); + bean.setPartnerId(Integer.valueOf(rs.getInt(11))); + list.add(bean); + } + + rs.close(); + + } + catch (SQLException e) + { + // TODO Auto-generated catch block + e.printStackTrace(); + } + finally + { + try + { + pstmt.close(); + } + catch(Exception e) + {} + + pstmt = null; + + } + + return list; + } + + public static MPayment generatePayments(Properties ctx, MInvoice invoice) throws OperationException + { + //the normal flow for payment should be that + //first customer creates an AP Payment + //completes it + //this generates a counter(AR payment) document on HSAF side + + //however we assume that the customer has paid for the goods + //and generate his AP payment ourselves + + //get counter(vendor invoice) from customer Invoice + + MInvoice vendorInvoice = InvoiceManager.getCounterInvoice(ctx, invoice); + Properties newCtx = (Properties) ctx.clone(); + newCtx.setProperty(UdiConstants.ORG_ID_CTX_PARAM, "" + vendorInvoice.getAD_Org_ID()); + + //appayment is linked to vendor invoice + MPayment apPayment = createAPPayment(newCtx, vendorInvoice, vendorInvoice.get_TrxName()); + + //ar receipt is linked to customer invoice + MPayment completedAPPayment = completeAPPayment(newCtx, apPayment); + + //get generated AR receipt + int arReceiptIds[] = MPayment.getAllIDs(MPayment.Table_Name, "ad_client_id=" + Env.getAD_Client_ID(ctx) + " and ref_payment_id=" + completedAPPayment.get_ID(),invoice.get_TrxName()); + + if (arReceiptIds.length == 0) + throw new RuntimeException("Expected an AR Receipt for AP Payment---" + apPayment.get_ID()); + + PaymentManager.completePayment(ctx, new MPayment(ctx,arReceiptIds[0],invoice.get_TrxName())); + return completedAPPayment; + } + + //retrieve AR receipt + public static MPayment getCounterPayment(Properties ctx, MPayment apPayment) + { + if (!apPayment.getDocStatus().equals(DocumentEngine.STATUS_Completed)) + throw new RuntimeException("Cannot get counter document of payment which has not been completed"); + + int arReceipts[] = MPayment.getAllIDs(MPayment.Table_Name, "ad_client_id=" + Env.getAD_Client_ID(ctx) + " and ref_payment_id=" + apPayment.get_ID(), apPayment.get_TrxName()); + + if (arReceipts.length == 0) + throw new RuntimeException("counter payment document not found for payment--" + apPayment.get_ID()); + + MPayment receipt = new MPayment(ctx, arReceipts[0], apPayment.get_TrxName()); + + return receipt; + } + public static WebDocumentBean getWebPaymentBean(Properties ctx, MPayment payment) throws OperationException, DataException + { + if (payment == null) + throw new OperationException("Invalid operation payment is null"); + + if (payment.get_ID() == 0) + throw new OperationException("You have deleted this payment. You cannot view this payment."); + + WebDocumentBean bean = new WebDocumentBean(); + + bean.setPaymentId(Integer.valueOf(payment.get_ID())); + + int currencyId = payment.getC_Currency_ID(); + MCurrency currency = new MCurrency(ctx,currencyId,null); + bean.setCurrencySymbole(currency.getCurSymbol()); + + MOrg myOrg = OrganisationManager.getMyOrg(ctx); + MBPartner me = new MBPartner(ctx, myOrg.getLinkedC_BPartner_ID(null), null); + bean.setMe(me); + //MOrg orderOrg = new MOrg(ctx, payment.getAD_Org_ID(), null); + /* + if (orderOrg.getLinkedC_BPartner_ID() != myOrg.getLinkedC_BPartner_ID()) + throw new DocumentDoesNotBelongToYouException("This payment does not belong to you. You do not have access to it."); + */ + + MBPartnerLocation meLocation[] = MBPartnerLocation.getForBPartner(ctx,me.get_ID()); + if (meLocation.length ==0) + throw new OperationException("No location has been set for your organisation. Please ask your administrator to set one for you"); + + MLocation location = new MLocation(ctx, meLocation[0].getC_Location_ID(), null); + + if (location.get_ID() == 0) + throw new OperationException("You must have a location set for your business partner, Please ask your administrator to set one for you"); + + bean.setMeLocation(location); + + MBPartner you = new MBPartner(ctx, payment.getC_BPartner_ID(), null); + + MBPartnerLocation youBPLocation[] = MBPartnerLocation.getForBPartner(ctx, you.get_ID()); + + if (youBPLocation.length ==0) + throw new OperationException("No location has been set for the dealer organisation. Please ask your administrator to set one for you"); + + MLocation youLocation = new MLocation(ctx, youBPLocation[0].getC_Location_ID(), null); + + bean.setYou(you); + bean.setYoubpLocation(youBPLocation[0]); + bean.setYouLocation(youLocation); + + WebDocumentHeaderBean headerBean = createWebDocumentHeader(ctx, payment.getAD_Org_ID(),payment.getC_BPartner_ID(), payment.getDocStatus(), payment.isReceipt(),payment.getTenderType()); + headerBean.setDocumentHeader(getDocumentHeader(payment)); + + String tenderTypeName = MRefList.getListName(ctx, MPayment.TENDERTYPE_AD_Reference_ID,payment.getTenderType()); + + if(payment.getCheckNo()!=null) + { + tenderTypeName=tenderTypeName+" "+payment.getCheckNo(); + } + headerBean.setPaymentType(tenderTypeName); + + bean.setHeaderBean(headerBean); + + bean.setPayment(payment); + + MInvoice invoice = new MInvoice(ctx, payment.getC_Invoice_ID(), null); + + //order linked to invoice + MOrder order = new MOrder(ctx, invoice.getC_Order_ID(), null); + + bean.setOrder(order); + bean.setInvoice(invoice); + + CommandBean cmdBean = getCustomerPaymentWebCommands(payment); + bean.setSimpleCommand(cmdBean.getSimpleCommand()); + bean.setComplexCommand(cmdBean.getComplexCommand()); + + return bean; + } + + public static String getDocumentHeader(MPayment payment) + { + if (payment.isReceipt()) + return PAYMENT_RECEIVED; + + return PAYMENT_MADE; + } + + + +// public static void paidAndShip(Properties ctx, MInvoice invoice) throws OperationException +// { +// MPayment apPayment = generatePayments(ctx, invoice); +// MessageManager.sendPaymentMessage(apPayment,UDIDocActionValues.CONFIRM); +// MinOutManager.generateMinOut(ctx, invoice); +// +// } + + + + private static CommandBean getCustomerPaymentWebCommands(MPayment payment) throws OperationException, DataException + { + + //if (!payment.isReceipt()) + // throw new OperationException("Invoice should be a AR Receipt"); + + + String[] simpleCommands = null; + String[] complexCommands = null; + + CommandBean bean = new CommandBean(); + + if (payment.getDocStatus().equals(DocumentEngine.STATUS_Drafted)) + { + simpleCommands = new String[]{Constants.PAYMENT_ACTION_COMPLETE}; + complexCommands = new String[]{Constants.PAYMENT_ACTION_CANCEL}; + } + + if (payment.getDocStatus().equals(DocumentEngine.STATUS_Voided)) + { + complexCommands = new String[]{Constants.INVOICE_ACTION_DELETE}; + } + + if (payment.getDocStatus().equals(DocumentEngine.STATUS_Completed)) + { + + simpleCommands = new String[]{Constants.MINOUT_ACTION_SHIP}; + } + + + bean.setSimpleCommand(simpleCommands); + bean.setComplexCommand(complexCommands); + return bean; + } + + + public static MPayment loadPayment(Properties ctx, int paymentId, String trxName) throws OperationException + { + MPayment payment = new MPayment(ctx, paymentId, trxName); + if(payment.get_ID() == 0) + throw new OperationException("Could not load payment with id: " + paymentId); + + return payment; + } + + public static void printInvoice(Properties ctx,MPayment payment) throws OperationException + { + PrintManager.print(ctx,ReportEngine.REMITTANCE,payment.get_ID()); + } + + + public static MPayment createPayment(Properties ctx,PaymentBean bean,String trxName) throws OperationException + { + if(bean.getBpartnerId()==null) + { + throw new BPartnerNotFoundException("customer not found"); + } + + String docBaseType = MDocType.DOCBASETYPE_APPayment; + boolean isReceipt = false; + + if(bean.getIsSoTrx()) + { + docBaseType = MDocType.DOCBASETYPE_ARReceipt; + isReceipt = true; + } + + MDocType[] docTypes = MDocType.getOfDocBaseType(ctx, docBaseType); + if (docTypes.length == 0) + { + throw new OperationException("not document type found for payment"); + } + + MPayment payment = new MPayment(ctx,0,trxName); + payment.setC_DocType_ID(docTypes[0].get_ID()); + payment.setC_Currency_ID(POSTerminalManager.getCurrencyOfTerminalCashBook(ctx).get_ID()); + payment.setC_BPartner_ID(bean.getBpartnerId()); + + // @ashley TODO Fix inconsistent Transaction type in the codes + if(bean.getTrxType().equalsIgnoreCase("Card")) + { + payment.setTenderType(MPayment.TENDERTYPE_CreditCard); + } + else if(bean.getTrxType().equalsIgnoreCase("Cheque")) + { + payment.setTenderType(MPayment.TENDERTYPE_Check); + } + else if(bean.getTrxType().equalsIgnoreCase("Cash")) + { + payment.setTenderType(MPayment.TENDERTYPE_Cash); + } + else + { + throw new OperationException("invalid tender type"); + } + + + if(MPayment.TENDERTYPE_Cash.equals(payment.getTenderType())) + { + int cashbookId = POSTerminalManager.getCashBookId(ctx); + payment.setC_CashBook_ID(cashbookId); + } + else + { + int bankAccountId = POSTerminalManager.getBankAccountId(ctx, payment.getTenderType()); + payment.setC_BankAccount_ID(bankAccountId); + } + + + payment.setIsPrepayment(false); + + payment.setPayAmt(bean.getAmount()); + if(bean.getCreditCardNumber()!=null) + payment.setCreditCardNumber(bean.getCreditCardNumber()); + if(bean.getChequeNo()!=null) + payment.setCheckNo(bean.getChequeNo()); + + payment.setIsReceipt(isReceipt); + + if(isReceipt) + payment.setDescription("(AR Receipt) Payment Received"); + else + payment.setDescription("(AP Payment) Payment Made"); + + int posId = POSTerminalManager.getTerminalId(ctx); + payment.setDescription(""+posId); //To get the proper pos info posId is saved into description + + PoManager.save(payment); + + PoManager.processIt(payment, DocumentEngine.ACTION_Complete); + + return payment; + } + + /** + * Returns the tender type for a payment rule + * @param paymentRule Order/Invoice Payment Rule + * @return Tender Type + */ + public static String getTenderType(String paymentRule) + { + if(MInvoice.PAYMENTRULE_CreditCard.equals(paymentRule)) + { + return MPayment.TENDERTYPE_CreditCard; + } + else if(MInvoice.PAYMENTRULE_DirectDebit.equals(paymentRule)) + { + return MPayment.TENDERTYPE_DirectDebit; + } + else if(MInvoice.PAYMENTRULE_DirectDeposit.equals(paymentRule)) + { + return MPayment.TENDERTYPE_DirectDeposit; + } + else if (MInvoice.PAYMENTRULE_Check.equals(paymentRule)) + { + return MPayment.TENDERTYPE_Check; + } + else if (MInvoice.PAYMENTRULE_OnCredit.equals(paymentRule) + || MInvoice.PAYMENTRULE_Mixed.equals(paymentRule)) + { + // Returns Check by default for Credit and Mixed payment rules. + return MPayment.TENDERTYPE_Check; + } + else + { + throw new IllegalArgumentException("No tender type is defined for the payment rule: " + paymentRule); + } + } + + /** + * @param ctx Context + * @param currencyId CurrencyId whose roundOff Factor is required + * @param total Total price + * @param trxName Transaction Name + * @return writeOff Amount + */ + public static BigDecimal computeWriteOff(Properties ctx, Integer currencyId, BigDecimal total, String trxName) + { + BigDecimal writeoffAmt = Env.ZERO; + BigDecimal roundOffFactor; + + MCurrency currency = new MCurrency(ctx, currencyId, trxName); + roundOffFactor = currency.getRoundOffFactor(); + + //Calculate write off amount + if(roundOffFactor != null && roundOffFactor.doubleValue() != 0.0) + { + writeoffAmt = total.remainder(roundOffFactor); + } + + return writeoffAmt; + } + + public static PaymentDetailsBean getPaymentDetails(Properties ctx, int c_order_id, String trxName) throws OperationException + { + PaymentDetailsBean bean = new PaymentDetailsBean(); + + MOrder order = new MOrder(ctx, c_order_id, trxName); + + bean.setTenderedAmt(order.getAmountTendered()); + bean.setRefundedAmt(order.getAmountRefunded()); + + String sql = " SELECT SUM(AMOUNT) AS AMOUNT, SUM(WRITEOFF) AS WRITEOFF, SUM(DISCOUNT) AS DISCOUNT FROM (" + + " SELECT SUM(AMOUNT) AS AMOUNT, SUM(WRITEOFFAMT) AS WRITEOFF, SUM(DISCOUNTAMT) AS DISCOUNT FROM C_CASHLINE,C_INVOICE " + + " WHERE C_INVOICE.C_INVOICE_ID = C_CASHLINE.C_INVOICE_ID " + + " AND C_INVOICE.C_ORDER_ID = ? " + + " UNION " + + " SELECT SUM(PAYAMT) AS AMOUNT, SUM(WRITEOFFAMT) AS WRITEOFF, SUM(DISCOUNTAMT) AS DISCOUNT FROM C_PAYMENT,C_INVOICE " + + " WHERE C_INVOICE.C_INVOICE_ID = C_PAYMENT.C_INVOICE_ID " + + " AND C_INVOICE.C_ORDER_ID = ? " + + " ) PAYMENT"; + + PreparedStatement pstmt = null; + ResultSet rs = null; + + try + { + pstmt = DB.prepareStatement(sql, trxName); + pstmt.setInt(1, c_order_id); + pstmt.setInt(2, c_order_id); + + rs = pstmt.executeQuery(); + + if(rs.next()) + { + BigDecimal amount = rs.getBigDecimal(1); + BigDecimal writeOff = rs.getBigDecimal(2); + BigDecimal discount = rs.getBigDecimal(3); + + amount = amount == null? Env.ZERO : amount; + writeOff = writeOff == null? Env.ZERO : writeOff; + discount = discount == null? Env.ZERO : discount; + + bean.setWriteOffAmt(writeOff); + bean.setDiscountAmt(discount); + bean.setPayAmt(amount.setScale(2, BigDecimal.ROUND_UP)); + + } + } + catch (SQLException e) + { + throw new OperationException(e); + } + finally + { + DB.close(rs, pstmt); + } + return bean; + } +} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/PaymentTermManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/PaymentTermManager.java new file mode 100644 index 0000000000..0d42a2eb6b --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/businesslogic/PaymentTermManager.java @@ -0,0 +1,316 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Oct 31, 2006 by alok + */ + + +package org.posterita.businesslogic; + +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.Properties; + +import org.compiere.model.MBPartner; +import org.compiere.model.MPaymentTerm; +import org.compiere.util.DB; +import org.compiere.util.Env; +import org.posterita.beans.PaymentTermBean; +import org.posterita.exceptions.CannotDeactivatePaymentTermException; +import org.posterita.exceptions.InvalidNetDaysException; +import org.posterita.exceptions.MandatoryNameException; +import org.posterita.exceptions.OperationException; +import org.posterita.exceptions.PaymentTermAlreadyExistsException; +import org.posterita.util.PoManager; + + +public class PaymentTermManager +{ + + public static ArrayList getAllActivePaymentTerm(Properties ctx) throws OperationException + { + return getAllPaymentTerm(ctx,true); + } + public static ArrayList getAllPaymentTerm(Properties ctx,boolean isActive) throws OperationException + { + String sql = "select " + + " C_PAYMENTTERM_ID," +//1 + " NAME," +//2 + " NETDAYS,"+//3 + " CASE WHEN isActive = 'Y' THEN 'true' ELSE 'false' END AS active ," + + //" DECODE(isActive,'Y','true','false') active,"+//4 + " CASE WHEN AFTERDELIVERY = 'Y' THEN 'true' ELSE 'false' END AS delivery," + + //" DECODE(AFTERDELIVERY,'Y','true','false') delivery,"+//5 + " CASE WHEN ISDUEFIXED = 'Y' THEN 'true' ELSE 'false' END AS dueFixed," + + //" DECODE(ISDUEFIXED,'Y','true','false') dueFixed,"+// + " FIXMONTHCUTOFF,"+//7 + " FIXMONTHDAY,"+//8 + " FIXMONTHOFFSET"+//9 + " from C_PAYMENTTERM " + + " where AD_CLIENT_ID="+Env.getAD_Client_ID(ctx); + + if(isActive==true) + sql=sql+"and isActive = 'Y'"; + + + ArrayList list = new ArrayList(); + PreparedStatement pstmt = DB.prepareStatement(sql,null); + ResultSet rs=null; + + + PaymentTermBean bean=null; + try + { + rs = pstmt.executeQuery(); + while(rs.next()) + { + + bean=new PaymentTermBean(); + bean.setPaymentTermId(rs.getInt(1)); + bean.setPaymentTermName(rs.getString(2)); + bean.setNetDays(rs.getInt(3)); + bean.setIsActive(Boolean.parseBoolean(rs.getString(4))); + bean.setAfterDelivery(Boolean.parseBoolean(rs.getString(5))); + bean.setFixedDueDate(Boolean.parseBoolean(rs.getString(6))); + bean.setFiedMonthCutoff(rs.getInt(7)); + bean.setFixedMonthDay(rs.getInt(8)); + bean.setFixedMonthOffset(rs.getInt(9)); + + list.add(bean); + } + } + catch (SQLException e) + { + throw new OperationException(e); + } + finally + { + try + { + if(rs!=null) + rs.close(); + pstmt.close(); + } + catch (SQLException e) + { + + } + } + + return list; + } + + public static MPaymentTerm createEditPaymentTerm(Properties ctx,PaymentTermBean bean,String trxName ) throws OperationException + { + if(bean.getPaymentTermName()==null) + { + throw new MandatoryNameException(" name is mandatory"); + } + + + MPaymentTerm paymentTerm=null; + String whereClause="AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+" and name='"+bean.getPaymentTermName()+"'"; + int [] paymentTermIds=MPaymentTerm.getAllIDs(MPaymentTerm.Table_Name,whereClause,null); + + if(bean.getPaymentTermId()==null) + { + paymentTerm = new MPaymentTerm(ctx,0,trxName); + if(paymentTermIds.length>0) + throw new PaymentTermAlreadyExistsException("The Payment Term Name already exists"); + } + else + { + paymentTerm = new MPaymentTerm(ctx,bean.getPaymentTermId(),trxName); + if(paymentTermIds.length>0 && !paymentTerm.getName().equalsIgnoreCase(bean.getPaymentTermName())) + throw new PaymentTermAlreadyExistsException("The Payment Term Name already exists"); + + } + paymentTerm.setName(bean.getPaymentTermName()); + paymentTerm.setValue(bean.getPaymentTermName()); + + if(bean.getIsActive()==false) + { + String whereClause1="AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+" and C_PAYMENTTERM_ID="+bean.getPaymentTermId(); + + int [] bPids = MBPartner.getAllIDs(MBPartner.Table_Name,whereClause1,null); + if(bPids!=null && bPids.length>0) + { + throw new CannotDeactivatePaymentTermException("cannot deActivate payment term,have associated bPartner"); + + } + } + + paymentTerm.setIsActive(bean.getIsActive()); + paymentTerm.setAfterDelivery(bean.getAfterDelivery().booleanValue()); + if(bean.getFixedDueDate().booleanValue()==true) + { + paymentTerm.setIsDueFixed(true); + + /**The Fix Month Cutoff indicates the last + * day invoices can have to be included in the current + * due date. This field only displays when the fixed due date checkbox has been + * selected.*/ + paymentTerm.setFixMonthCutoff(bean.getFiedMonthCutoff().intValue()); + + /**The Fix Month Day indicates the day of the month that invoices are due. + This field only displays if the fixed due date checkbox is selected.*/ + paymentTerm.setFixMonthDay(bean.getFixedMonthDay()); + + /**The Fixed Month Offset indicates the number of + * months from the current month to indicate an invoice is due. + * A 0 indicates the same month, a 1 the following month. + * This field will only display if the fixed due date checkbox is selected.*/ + + if(bean.getFixedMonthOffset()==null) + bean.setFixedMonthOffset(0); + paymentTerm.setFixMonthOffset(bean.getFixedMonthOffset()); + + } + else + { + paymentTerm.setIsDueFixed(false); + if(bean.getNetDays()==null || bean.getNetDays().intValue()<0) + { + throw new InvalidNetDaysException(" net days cannot be negative"); + } + paymentTerm.setNetDays(bean.getNetDays()); + } + + if(bean.getDiscountDay1()!=null) + { + paymentTerm.setDiscountDays(bean.getDiscountDay1()); + } + if(bean.getDiscountAmt1()!=null) + { + paymentTerm.setDiscount(bean.getDiscountAmt1()); + } + if(bean.getDiscountDay2()!=null) + { + paymentTerm.setDiscountDays2(bean.getDiscountDay2()); + } + if(bean.getDiscountAmt2()!=null) + { + paymentTerm.setDiscount2(bean.getDiscountAmt2()); + } + PoManager.save(paymentTerm); + return paymentTerm; + } + + + public static PaymentTermBean getPaymentTerm(Properties ctx,int paymentTermId) throws OperationException + { + String sql = "select " + + " C_PAYMENTTERM_ID," +//1 + " NAME," +//2 + " NETDAYS,"+//3 + //" DECODE(isActive,'Y','true','false') active,"+//4 + " CASE WHEN isActive='Y' THEN 'true' ELSE 'false' END AS active,"+//4 + //" DECODE(AFTERDELIVERY,'Y','true','false') delivery,"+//5 + " CASE WHEN AFTERDELIVERY = 'Y' THEN 'true' ELSE 'false' END AS delivery,"+//5 + //" DECODE(ISDUEFIXED,'Y','true','false') dueFixed,"+//6 + " CASE WHEN ISDUEFIXED = 'Y' THEN 'true' ELSE 'false' END AS dueFixed,"+//6 + " FIXMONTHCUTOFF,"+//7 + " FIXMONTHDAY,"+//8 + " FIXMONTHOFFSET,"+//9 + " DISCOUNTDAYS,"+//10 + " DISCOUNT,"+//11 + " DISCOUNTDAYS2,"+//12 + " DISCOUNT2"+//13 + " from C_PAYMENTTERM " + + " where AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+ + " and C_PAYMENTTERM_ID ="+paymentTermId; + + PreparedStatement pstmt = DB.prepareStatement(sql,null); + ResultSet rs=null; + + PaymentTermBean bean=null; + try + { + rs = pstmt.executeQuery(); + while(rs.next()) + { + + bean=new PaymentTermBean(); + bean.setPaymentTermId(rs.getInt(1)); + bean.setPaymentTermName(rs.getString(2)); + bean.setNetDays(rs.getInt(3)); + bean.setIsActive(Boolean.parseBoolean(rs.getString(4))); + bean.setAfterDelivery(Boolean.parseBoolean(rs.getString(5))); + bean.setFixedDueDate(Boolean.parseBoolean(rs.getString(6))); + bean.setFiedMonthCutoff(rs.getInt(7)); + bean.setFixedMonthDay(rs.getInt(8)); + bean.setFixedMonthOffset(rs.getInt(9)); + bean.setDiscountDay1(rs.getInt(10)); + bean.setDiscountAmt1(rs.getBigDecimal(11)); + bean.setDiscountDay2(rs.getInt(12)); + bean.setDiscountAmt2(rs.getBigDecimal(13)); + + } + } + catch (SQLException e) + { + throw new OperationException(e); + } + finally + { + try + { + if(rs!=null) + rs.close(); + pstmt.close(); + } + catch (SQLException e) + { + + } + } + + return bean; + } + + + public static MPaymentTerm activatePaymentTerm(Properties ctx,int paymentTermId, boolean activate) throws OperationException + { + + + MPaymentTerm paymentTerm = new MPaymentTerm(ctx,paymentTermId,null); + + if(activate==true) + { + paymentTerm.setIsActive(true); + } + + else + { + String whereClause="AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+" and C_PAYMENTTERM_ID="+paymentTermId; + int [] bPids = MBPartner.getAllIDs(MBPartner.Table_Name,whereClause,null); + if(bPids!=null && bPids.length>0) + { + throw new CannotDeactivatePaymentTermException("cannot deActivate payment term,have associated bPartner"); + } + paymentTerm.setIsActive(false); + } + + + PoManager.save(paymentTerm); + return paymentTerm; + } + +} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/PostingManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/PostingManager.java new file mode 100644 index 0000000000..412d12fb9f --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/businesslogic/PostingManager.java @@ -0,0 +1,78 @@ +/** + * + * Copyright (c) 2007 Posterita. All Rights Reserved. + * + * This software is the confidential and proprietary information of + * Posterita. ("Confidential Information"). You shall not + * disclose such Confidential Information and shall use it only in + * accordance with the terms of the license agreement you entered into + * with Posterita. + * + * POSTERITA MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE + * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT + * NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR + * A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. TAMAK ICT SHALL NOT + * BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, + * MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. + * + * 21 Dec 2007 17:34:13 by shameem + * + */ + +package org.posterita.businesslogic; + +import java.math.BigDecimal; +import java.util.Properties; +import java.util.logging.Level; + +import org.compiere.model.MInvoice; +import org.compiere.model.MPInstance; +import org.compiere.process.FactAcctReset; +import org.compiere.process.ProcessInfo; +import org.compiere.process.ProcessInfoParameter; +import org.compiere.util.CLogger; +import org.compiere.util.Env; + +public class PostingManager +{ + + static private CLogger cLog = CLogger.getCLogger(FactAcctReset.class); + + public static void resubmitPostingForInvoice(Properties ctx) + { + // TODO Auto-generated method stub + + BigDecimal clientId = new BigDecimal(Env.getAD_Client_ID(ctx)); + + BigDecimal invoiceIdTableId = new BigDecimal(MInvoice.Table_ID); + + ProcessInfoParameter param[] = + { + new ProcessInfoParameter("AD_Client_ID", clientId, null, null, null), + new ProcessInfoParameter("AD_Table_ID", invoiceIdTableId, null, null, null), + new ProcessInfoParameter("DeletePosting", "N", null, null, null), + }; + + + MPInstance instance = new MPInstance(ctx, 175, Env.getAD_Client_ID(ctx)); + + instance.save(); + + ProcessInfo poInfo = new ProcessInfo("Resubmit Posting", 175); + poInfo.setParameter(param); + poInfo.setAD_Process_ID(175); + poInfo.setAD_PInstance_ID(instance.get_ID()); + + + FactAcctReset factAcct = new FactAcctReset(); + boolean success = factAcct.startProcess(ctx,poInfo, null); + + + + if(success==false) + { + cLog.log(Level.FINE,"Error occurred while running process for resubmit posting for Invoice"); + } + } + +} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/PrintManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/PrintManager.java new file mode 100644 index 0000000000..2f8ef39cf7 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/businesslogic/PrintManager.java @@ -0,0 +1,398 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Aug 23, 2006 + */ + + +package org.posterita.businesslogic; + +import java.io.FileOutputStream; +import java.lang.reflect.Constructor; +import java.math.BigDecimal; +import java.util.Calendar; +import java.util.Properties; +import java.util.logging.Level; + +import javax.print.DocFlavor; +import javax.print.DocPrintJob; +import javax.print.PrintException; +import javax.print.PrintService; +import javax.print.PrintServiceLookup; +import javax.print.SimpleDoc; + +import org.compiere.model.MCashLine; +import org.compiere.model.MUser; +import org.compiere.print.MPrintFormat; +import org.compiere.print.ReportEngine; +import org.compiere.util.CLogger; +import org.compiere.util.Env; +import org.posterita.beans.OrderLineBean; +import org.posterita.beans.UDIBean; +import org.posterita.exceptions.OperationException; +import org.posterita.util.IPrintFormatter; +import org.posterita.util.TmkPrinterConstants; + + +public class PrintManager +{ + private static final CLogger logger = CLogger.getCLogger(PrintManager.class); + + final static String SINGLE_LINE = "-----------------------------"; + final static String DOUBLE_LINE = "============================="; + final static String EMPTY_STRING = ""; + + public static void printAdjustCashbookReport(Properties ctx, MCashLine cashLine) throws OperationException + { + int ad_user_id = Env.getAD_User_ID(ctx); + + if (cashLine.get_ID() <= 0) + { + throw new OperationException("Could not load Cash Line"); + } + + BigDecimal adjustmentAmount = cashLine.getAmount(); + String transferType = cashLine.getCashType(); + String title = "Adjust Cashbook"; + + if(MCashLine.CASHTYPE_GeneralExpense.equals(transferType)) + { + transferType = "Expense"; + } + else if(MCashLine.CASHTYPE_BankAccountTransfer.equals(transferType)) + { + transferType = "Account Transfer"; + adjustmentAmount = adjustmentAmount.negate(); + } + else if(MCashLine.CASHTYPE_GeneralReceipts.equals(transferType)) + { + transferType = "Receipt"; + } + else + { + throw new OperationException("Transfer type cannot be processed"); + } + + //writing the report + StringBuffer reportData = new StringBuffer(); + + //adding report header + reportData.append(TmkPrinterConstants.LOGO1); + + //adding title + reportData.append(TmkPrinterConstants.BIG_FONT) + .append(TmkPrinterConstants.CENTER_ALIGN) + .append(title) + .append(TmkPrinterConstants.LINE_FEED); + + //setting small font + reportData.append(TmkPrinterConstants.SMALL_FONT); + + //adding customer name + MUser user = new MUser(ctx,ad_user_id,null); + String username = user.getName(); + + username = String.format("%1$-60s",username); + reportData.append(username).append(TmkPrinterConstants.LINE_FEED); + + //adding date + Calendar c = Calendar.getInstance(); + String date = String.format("%1$te %1$tb,%1$tY %1$tH:%1$tM:%1$tS",c); + date = String.format("%1$-60s",date); + reportData.append(date) + .append(TmkPrinterConstants.LINE_FEED) + .append(TmkPrinterConstants.LINE_FEED); + + //1.header + reportData.append(TmkPrinterConstants.H_FULL_LINE_TOP) + .append(TmkPrinterConstants.LINE_FEED); + + String header = String.format("%1$-30s%2$-30s","Transfer Type","Amount"); + + reportData.append(header) + .append(TmkPrinterConstants.LINE_FEED); + + reportData.append(TmkPrinterConstants.H_FULL_LINE_BOTTOM) + .append(TmkPrinterConstants.LINE_FEED); + + //2.body + + String body = String.format("%1$-30s%2$-30s", transferType, adjustmentAmount); + + reportData.append(body) + .append(TmkPrinterConstants.LINE_FEED); + + reportData.append(TmkPrinterConstants.H_FULL_LINE_BOTTOM) + .append(TmkPrinterConstants.LINE_FEED); + + //3.footer + + String footer = "Sig: ..................................."; + footer = String.format("%1$60s",footer); + + reportData.append(TmkPrinterConstants.LINE_FEED) + .append(TmkPrinterConstants.LINE_FEED) + .append(footer) + .append(TmkPrinterConstants.LINE_FEED) + .append(TmkPrinterConstants.PAPER_CUT); + + print(ctx,reportData.toString()); + openCashDrawer(ctx); + + } + + /** + * Return Postscript file for document + * @param ctx Context + * @param type Type of document (Order, Invoice, ..) + * @param recordId The document id for which to generate a PS + * @return Postscript data + * @throws OperationException + * + * @author Ashley + */ + public static byte[] getPDFData(Properties ctx, int type, int recordId) throws OperationException + { + ReportEngine re = ReportEngine.get(ctx, type, recordId); + return re.createPDFData(); + } + + public static void openCashDrawer(Properties ctx) throws OperationException + { + byte [] printData= {10,27,112,48,55,1}; + print(ctx, new String(printData)); + } + + public static void print(Properties ctx, int type,int recordId) throws OperationException + { + ReportEngine re = ReportEngine.get(ctx,type, recordId); + MPrintFormat printFormatter = re.getPrintFormat(); + + String classname = printFormatter.getClassName(); + + if (classname != null) + { + String args = printFormatter.getArgs(); + try + { + Class clazz = Class.forName(classname); + IPrintFormatter formatter = null; + + Class[] parameterTypes = new Class[]{ String.class}; + Object[] parameters = new Object[]{ args}; + + Constructor constructor = clazz.getConstructor(parameterTypes); + formatter = (IPrintFormatter) constructor.newInstance(parameters); + + String str = formatter.format(ctx, recordId); + int docCopies = re.getPrintInfo().getCopies(); + System.out.println(str); + + for (int i=0; i 1) + throw new OperationException(processIds.length + " Processes found with class name: " + cl.getName()); + else + return processIds[0]; + } + + public static int getProcessIdByValue(String processValue) throws OperationException + { + if(processValue == null) + throw new OperationException("Process Value cannot be null"); + + String whereClause = "value='" + processValue + "'"; + + int processIds[] = MProcess.getAllIDs(MProcess.Table_Name, whereClause, null); + + if(processIds.length == 0) + throw new OperationException("No process found with value: " + processValue); + + else if(processIds.length > 1) + throw new OperationException(processIds.length + " Processes found with value: " + processValue); + else + return processIds[0]; + } + + public static void startProcess(Properties ctx, String className, ProcessInfo pi, Trx trx) + throws InstantiationException, IllegalAccessException, ClassNotFoundException + { + if (className == null) + { + return; + } + Class cl = Class.forName(className); + + if (cl == ReportStarter.class) + { + ReportStarter reportStarter = (ReportStarter)cl.newInstance(); + reportStarter.startProcess(ctx, pi, trx); + return; + } + SvrProcess server = (SvrProcess)cl.newInstance(); + server.startProcess(ctx, pi, trx); + } + + +} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/ProductAttributeSetManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/ProductAttributeSetManager.java new file mode 100644 index 0000000000..3019011fe9 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/businesslogic/ProductAttributeSetManager.java @@ -0,0 +1,44 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * */ +package org.posterita.businesslogic; + +import java.util.Properties; + +import org.compiere.model.MAttributeSet; +import org.posterita.exceptions.OperationException; +import org.posterita.util.PoManager; + + +public class ProductAttributeSetManager +{ + public static MAttributeSet createAttributeSet(Properties ctx, String name) throws OperationException + { + MAttributeSet attributeSet = new MAttributeSet(ctx, 0, null); + attributeSet.setMandatoryType(MAttributeSet.MANDATORYTYPE_NotMandatary); + attributeSet.setIsSerNo(false); + attributeSet.setIsSerNoMandatory(false); + attributeSet.setIsInstanceAttribute(false); + attributeSet.setName(name); + + PoManager.save(attributeSet); + + return attributeSet; + } +} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/ProductCart.java b/posterita/posterita/src/main/org/posterita/businesslogic/ProductCart.java new file mode 100644 index 0000000000..fb5ddf7f18 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/businesslogic/ProductCart.java @@ -0,0 +1,164 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * 29-Sep-2006 16:23:25 by praveen + * + */ + +package org.posterita.businesslogic; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; +import java.util.Properties; +import java.util.Set; + +import org.compiere.util.Env; +import org.posterita.beans.ProductDetailsBean; +import org.posterita.beans.StockMovementBean; +import org.posterita.businesslogic.administration.ProductManager; +import org.posterita.businesslogic.stock.MMovementManager; +import org.posterita.exceptions.OperationException; + +public class ProductCart +{ + private HashMap products = null; + private BigDecimal noOfProducts = Env.ZERO; + private Properties ctx = null; + + public ProductCart(Properties ctx) + { + this.ctx = ctx; + products = new HashMap(); + } + + public void addProduct(int product_id, BigDecimal qty) + { + noOfProducts = noOfProducts.add(Env.ONE); + + BigDecimal previousQty = products.get(Integer.valueOf(product_id)); + + if(previousQty == null) + { + products.put(Integer.valueOf(product_id),qty); + } + else + { + BigDecimal newQty = previousQty.add(qty); + products.put(Integer.valueOf(product_id), newQty); + } + } + + public void addProduct(int product_id) + { + addProduct(product_id, Env.ONE); + } + + public void removeProduct(int product_id, BigDecimal qty) + { + BigDecimal oldQty = products.get(Integer.valueOf(product_id)); + + if( oldQty == null ) + { + return; + } + else + { + if( oldQty.doubleValue() <= qty.doubleValue() ) + { + removeProduct( product_id ); + noOfProducts = noOfProducts.subtract(oldQty); + } + else + { + BigDecimal newQty = oldQty.subtract(qty); + products.put(Integer.valueOf(product_id),newQty); + noOfProducts = noOfProducts.subtract(qty); + } + } + } + + public void removeProduct(int product_id) + { + BigDecimal qty = products.remove(Integer.valueOf(product_id)); + + if( qty == null ) + { + return; + } + + noOfProducts = noOfProducts.subtract(qty); + } + + public void clear() + { + products.clear(); + noOfProducts = Env.ZERO; + } + + public BigDecimal getNoOfProducts() + { + return noOfProducts; + } + + public ArrayList getProducts() throws OperationException + { + ArrayList productList = new ArrayList(); + ProductDetailsBean bean = null; + Integer productId = null; + BigDecimal qty = null; + + Set> entrySet = products.entrySet(); + + for (Map.Entry entry : entrySet) + { + productId = entry.getKey(); + qty = entry.getValue(); + + bean = ProductManager.getProductDetailInfo(ctx, productId.intValue(), null); + bean.setQuantity(qty); + + productList.add(bean); + } + + return productList; + } + + + public Integer[] getProductIDs() + { + Set set = products.keySet(); + + if( set.isEmpty() ) + { + return new Integer[]{}; + } + + Integer[] ids = new Integer[]{}; + ids = set.toArray( ids ); + + return ids; + } + + public boolean hasProduct( int productId ) + { + return products.containsKey( Integer.valueOf(productId) ); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/ProductImageUploader.java b/posterita/posterita/src/main/org/posterita/businesslogic/ProductImageUploader.java new file mode 100644 index 0000000000..ecc906ee97 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/businesslogic/ProductImageUploader.java @@ -0,0 +1,241 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Mar 14, 2006 by praveen + * + */ +package org.posterita.businesslogic; + +import java.io.BufferedInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Properties; + +import org.apache.struts.upload.FormFile; +import org.compiere.model.MAttachment; +import org.compiere.model.MAttachmentEntry; +import org.posterita.businesslogic.administration.ProductImageManager; +import org.posterita.businesslogic.administration.ProductManager; +import org.posterita.businesslogic.core.AttachmentManager; +import org.posterita.core.ThumbnailGenerator; +import org.posterita.exceptions.AttachmentNotFoundException; +import org.posterita.exceptions.InvalidContentTypeException; +import org.posterita.exceptions.OperationException; +import org.posterita.lib.UdiConstants; +import org.posterita.util.PoManager; + +public class ProductImageUploader +{ + public static void uploadImage(Properties ctx, Integer productIds[], FormFile file, String imageName, String trxName) throws OperationException,InvalidContentTypeException + { + for(int i = 0; i < productIds.length; i++) + { + uploadImage(ctx, productIds[i].intValue(), file, imageName, trxName); + } + } + + public static void uploadImage(Properties ctx, int product_id, FormFile file, String imageName, String trxName) throws OperationException,InvalidContentTypeException + { + if((file.getContentType() == null)||(!file.getContentType().startsWith("image/"))) + throw new InvalidContentTypeException("Invalid Content type! Expecting image"); + + try + { + uploadImage(ctx, product_id, file.getFileData(), imageName, trxName); + } + catch(IOException ex) + { + throw new OperationException("Could not read form file", ex); + } + + } + + public static void uploadDefaultImage(Properties ctx, int productId, File file, String trxName) throws OperationException + { + uploadImage(ctx, productId, file, UdiConstants.DEFAULT_IMAGE, trxName); + } + + public static void uploadImage(Properties ctx, int productId, File file, String imageName, String trxName) throws OperationException + { + if(file == null) + throw new OperationException("Image file cannot be null"); + + if(!file.exists()) + throw new OperationException("Image file does not exist"); + + if(file.isDirectory()) + throw new OperationException("File cannot be a directory"); + + try + { + FileInputStream fileInStream = new FileInputStream(file); + ByteArrayOutputStream byteArrStream = new ByteArrayOutputStream(); + BufferedInputStream bufferedInStream = new BufferedInputStream(fileInStream); + byte data[] = new byte[1024]; + int read = 0; + while((read = bufferedInStream.read(data)) != -1) + { + byteArrStream.write(data, 0, read); + } + byteArrStream.flush(); + byte fileData[] = byteArrStream.toByteArray(); + bufferedInStream.close(); + byteArrStream.close(); + fileInStream.close(); + + uploadImage(ctx, productId, fileData, imageName, trxName); + } + catch(IOException ex) + { + throw new OperationException("Could not read file: " + file.getAbsolutePath(), ex); + } + } + + + public static void uploadDefaultImage(Properties ctx, int productId, byte[] imageData, String trxName) throws OperationException + { + uploadImage(ctx, productId, imageData, UdiConstants.DEFAULT_IMAGE, trxName); + } + + public static void uploadImage(Properties ctx, int productId, byte[] imageData, String imageName, String trxName) throws OperationException + { + MAttachmentEntry attEntry = new MAttachmentEntry(imageName + ".jpg", imageData); +// MAttachmentEntry entries[] = new MAttachmentEntry[] {attEntry}; + + ProductManager.addUpdateAttachment(ctx, productId, attEntry, trxName); + + try + { + generateSubImages(ctx, productId, imageName, trxName); + } + catch(AttachmentNotFoundException ex) + { + throw new OperationException("Could not generate sub images for product with ID: " + productId, ex); + } + } + + + public static void generateAllSubImages(Properties ctx, int productId, String trxName) throws AttachmentNotFoundException, OperationException + { + MAttachment attachment = ProductManager.getAttachment(ctx, productId, trxName); + + if(attachment == null) + throw new AttachmentNotFoundException("No attachment found for product with id: " + productId); + + //deleteOldImages(ctx, attachment); + + MAttachmentEntry attachmentEntries[] = attachment.getEntries(); + + for(int i = 0; i < attachmentEntries.length; i++) + { + if(attachmentEntries[i].getContentType().startsWith("image/")) + { + String imageFileName = attachmentEntries[i].getName(); + if(!(imageFileName.startsWith(UdiConstants.FULL_IMAGE_PREFIX) + || imageFileName.startsWith(UdiConstants.THUMBNAIL_IMAGE_PREFIX) + || imageFileName.equalsIgnoreCase(UdiConstants.FULL_IMAGE + UdiConstants.IMAGE_EXTENSION) + || imageFileName.equalsIgnoreCase(UdiConstants.THUMBNAIL + UdiConstants.IMAGE_EXTENSION))) + { + String imageName = imageFileName.replaceAll(UdiConstants.IMAGE_EXTENSION, ""); + generateSubImages(ctx, productId, imageName, trxName); + } + } + } + } + +// private static void deleteOldImages(Properties ctx, MAttachment attachment) throws OperationException +// { +// String oldFullImageName = UdiConstants.FULL_IMAGE + UdiConstants.IMAGE_EXTENSION; +// int oldFullImageEntryId = FileAttachmentManager.getAttachmentEntryIndex(ctx, attachment, oldFullImageName); +// if(oldFullImageEntryId != -1) +// attachment.deleteEntry(oldFullImageEntryId); +// +// String oldThumbImageName = UdiConstants.THUMBNAIL + UdiConstants.IMAGE_EXTENSION; +// int oldThumbImageEntryId = FileAttachmentManager.getAttachmentEntryIndex(ctx, attachment, oldThumbImageName); +// if(oldThumbImageEntryId != -1) +// attachment.deleteEntry(oldThumbImageEntryId); +// +// UDIMAttachment udiAttachment = new UDIMAttachment(attachment); +// udiAttachment.save(); +// } + + public static void generateSubImages(Properties ctx, int productId, String imageName, String trxName) throws OperationException, AttachmentNotFoundException + { + String originalImageName = imageName + UdiConstants.IMAGE_EXTENSION; + + MAttachment attachment = ProductManager.getAttachment(ctx, productId, trxName); + + byte originalImageData[] = ProductManager.getAttachmentData(attachment, originalImageName); + + byte[] scaledImageData = ThumbnailGenerator.getSquareThumbnail(originalImageData, 380); + byte[] framedImageData = ProductImageManager.addImageSquareBorder(ctx,scaledImageData,7.0, trxName); + byte[] thumbImageData = ThumbnailGenerator.getSquareThumbnail(framedImageData, 180); + + String fullImageName = UdiConstants.FULL_IMAGE_PREFIX + imageName + UdiConstants.IMAGE_EXTENSION; + String thumbnailImageName = UdiConstants.THUMBNAIL_IMAGE_PREFIX + imageName + UdiConstants.IMAGE_EXTENSION; + + int fullImageEntryInd = AttachmentManager.getAttachmentEntryIndex(ctx, attachment, fullImageName); + if(fullImageEntryInd != -1) + attachment.deleteEntry(fullImageEntryInd); + + int thumbnailEntryInd = AttachmentManager.getAttachmentEntryIndex(ctx, attachment, thumbnailImageName); + if(thumbnailEntryInd != -1) + attachment.deleteEntry(thumbnailEntryInd); + + MAttachmentEntry attFullImageEntry = new MAttachmentEntry(fullImageName, framedImageData); + MAttachmentEntry attThumbImageEntry = new MAttachmentEntry(thumbnailImageName, thumbImageData); + + AttachmentManager.addAttachmentEntry(attachment, attFullImageEntry); + AttachmentManager.addAttachmentEntry(attachment, attThumbImageEntry); + + PoManager.save(attachment); + } + + public static ArrayList getRelatedProductImageNames(Properties ctx, int productId, String trxName) throws OperationException + { + MAttachment attachment = ProductManager.getAttachment(ctx, productId, trxName); + + MAttachmentEntry entries[] = attachment.getEntries(); + + ArrayList productImageNameList = new ArrayList(); + + for(int i = 0; i < entries.length; i++) + { + String productImageName = entries[i].getName(); + + if(!(productImageName.startsWith(UdiConstants.THUMBNAIL_IMAGE_PREFIX) + || productImageName.startsWith(UdiConstants.FULL_IMAGE_PREFIX))) + { + productImageName = productImageName.replaceAll(UdiConstants.IMAGE_EXTENSION, ""); + productImageNameList.add(productImageName); + } + } + Collections.sort(productImageNameList); + return productImageNameList; + } + + public static String getImageAttachmentName(String imageName) + { + return imageName + UdiConstants.IMAGE_EXTENSION; + } + +} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/RegionManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/RegionManager.java new file mode 100644 index 0000000000..206d9380d8 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/businesslogic/RegionManager.java @@ -0,0 +1,112 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 19-Jul-2005 by alok + * + */ +package org.posterita.businesslogic; + +import java.util.ArrayList; +import java.util.Properties; + +import org.compiere.model.MRegion; +import org.compiere.util.Env; +import org.compiere.util.KeyNamePair; +import org.posterita.exceptions.OperationException; +import org.posterita.lib.UdiConstants; +import org.posterita.util.PoManager; + + +public class RegionManager +{ + + public static MRegion createRegion(Properties ctx,String name, String trxName) throws OperationException + { + try + { + Properties newCtx = (Properties) ctx.clone(); + Env.setContext(newCtx, "#AD_Client_ID", 0); + Env.setContext(newCtx, "#AD_Org_ID", 0); + + + MRegion region = null; + int[] allRegion=MRegion.getAllIDs(MRegion.Table_Name,"upper(NAME) = upper('" + name + "')",trxName); + + if (allRegion.length > 0) + { + region = new MRegion(newCtx, allRegion[0], trxName); + return region; + } + + //create region only if it does not exist yet + // region does not belong client or org + //it belongs to the system + else if (allRegion.length == 0) + { + region = new MRegion(newCtx, 0, trxName); + region.setC_Country_ID(UdiConstants.COUNTRY_MAURITIUS); + region.setName(name); + + return region; + } + + + PoManager.save(region); + + return region; + + } + catch(OperationException e) + { + throw e; + } + + } + + public static MRegion getOrCreateRegion(Properties ctx, String name, String trxName) throws OperationException + { + Properties nCtx = (Properties)ctx.clone(); + Env.setContext(nCtx, "#AD_CLIENT_ID", 0); + Env.setContext(nCtx, "#AD_ORG_ID", 0); + int allRegion[] = MRegion.getAllIDs(MRegion.Table_Name," AD_Client_ID= " + Env.getAD_Client_ID(ctx) + " and upper(NAME) = upper('" + name + "')",trxName); + MRegion region; + if(allRegion.length != 0) + region = new MRegion(nCtx, allRegion[0], trxName); + else + region = createRegion(nCtx, name, trxName); + + return region; + } + + + public static ArrayList getCountryRegions(Properties ctx, int countryId) + { + ArrayList list = new ArrayList(); + MRegion[] regions = MRegion.getRegions(ctx, countryId); + + for (int i = 0; i < regions.length; i++) + { + MRegion region = regions[i]; + + KeyNamePair pair = new KeyNamePair(region.get_ID(), region.getName()); + list.add(pair); + } + + return list; + } +} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/RoleMenuManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/RoleMenuManager.java new file mode 100644 index 0000000000..88cfa380ba --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/businesslogic/RoleMenuManager.java @@ -0,0 +1,79 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 27-Jul-2005 by alok + * + */ +package org.posterita.businesslogic; + +import java.util.Properties; + +import org.compiere.model.MRoleMenu; +import org.posterita.exceptions.OperationException; +import org.posterita.model.MWebMenu; +import org.posterita.util.PoManager; + + +public class RoleMenuManager +{ + + public static MRoleMenu createRoleMenu(Properties ctx,int roleId,int menuId, String trxName) throws OperationException + { + MRoleMenu roleMenu; + + MWebMenu menu = new MWebMenu(ctx, menuId, null); + + int parentMenuId = menu.getParentMenu_ID(); + + if(parentMenuId != 0) + { + int[] parentRoleMenuIds = MRoleMenu.getAllIDs(MRoleMenu.Table_Name, " ad_role_id = " + roleId + " and u_webmenu_id = " + parentMenuId, trxName); + + if (parentRoleMenuIds.length == 0) + roleMenu = createRoleMenu(ctx,roleId,parentMenuId, trxName); + } + + roleMenu = new MRoleMenu(ctx, 0, trxName); + roleMenu.setAD_Role_ID(roleId); + roleMenu.setU_WebMenu_ID(menuId); + + PoManager.save(roleMenu); + + return roleMenu; + } + + public static void createRoleMenus(Properties ctx, int roleId, int menuIds[], String trxName) throws OperationException + { + for(int i = 0; i < menuIds.length; i++) + { + RoleMenuManager.createRoleMenu(ctx, roleId, menuIds[i], trxName); + } + } + + public static boolean isRoleMenuPresent(Properties ctx, int roleId, int menuId, String trxName) + { + String whereClause = "AD_Role_ID=" + roleId + " and U_WebMenu_ID=" + menuId; + + int roleMenuIds[] = MRoleMenu.getAllIDs(MRoleMenu.Table_Name, whereClause, trxName); + + if(roleMenuIds == null || roleMenuIds.length == 0) + return false; + return true; + } + +} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/SearchManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/SearchManager.java new file mode 100644 index 0000000000..9fead40434 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/businesslogic/SearchManager.java @@ -0,0 +1,140 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +* Created on May 15, 2006 by ashley +* +*/ + +package org.posterita.businesslogic; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.posterita.beans.SearchBean; +import org.posterita.exceptions.OperationException; + +public class SearchManager +{ + + public static SearchBean getSearchParams(String searchText) throws OperationException + { + if(searchText == null) + throw new OperationException("Search text cannot be null"); + + + SearchBean searchBean = new SearchBean(searchText); + searchBean = parseExactSearch(searchBean); + searchBean = parseAndSearch(searchBean); + searchBean = parseOrSearch(searchBean); + + searchBean.setSearchText(searchText); + + return searchBean; + } + + private static SearchBean parseExactSearch(SearchBean searchBean) + { + String searchText = searchBean.getSearchText().trim(); + + int ind11 = searchText.indexOf("\""); + + if(ind11 == -1) + return searchBean; + + String lText1 = searchText.substring(0, ind11).trim(); + String rText1 = searchText.substring(ind11 + 1).trim(); + + int ind12 = rText1.indexOf("\""); + + if(ind12 == -1) + { + searchText = searchText.replaceAll("\"", ""); + searchBean.setSearchText(searchText); + return searchBean; + } + + String lText2 = rText1.substring(0, ind12); + String rText2 = rText1.substring(ind12 + 1); + + String exactSearchText = lText2; + String remSearchText = lText1.trim() + " " + rText2.trim(); + + searchBean.setSearchText(remSearchText); + searchBean.getAndCriteriasList().add(exactSearchText); + + return parseExactSearch(searchBean); + } + + private static SearchBean parseAndSearch(SearchBean searchBean) + { + String searchText = searchBean.getSearchText(); + if(searchText == null || searchText.length() == 0) + return searchBean; + + String regexStr = "\\+[\\w]+"; + + Pattern regex = Pattern.compile(regexStr); + Matcher regexMatcher = regex.matcher(searchText); + + if(regexMatcher.find()) + { + int startInd = regexMatcher.start(); + int endInd = regexMatcher.end(); + + String subStr = searchText.substring(startInd, endInd); + subStr = subStr.replaceAll("\\+", ""); + searchBean.getAndCriteriasList().add(subStr); + + searchText = searchText.substring(0, startInd) + searchText.substring(endInd); + searchBean.setSearchText(searchText); + + parseAndSearch(searchBean); + } + + return searchBean; + } + + private static SearchBean parseOrSearch(SearchBean searchBean) + { + String searchText = searchBean.getSearchText(); + if(searchText == null || searchText.length() == 0) + return searchBean; + + String regexStr = "[\\w]+"; + + Pattern regex = Pattern.compile(regexStr); + Matcher regexMatcher = regex.matcher(searchText); + + if(regexMatcher.find()) + { + int startInd = regexMatcher.start(); + int endInd = regexMatcher.end(); + + String subStr = searchText.substring(startInd, endInd); + subStr = subStr.replaceAll("\\+", ""); + searchBean.getOrCriteriasList().add(subStr); + + searchText = searchText.substring(0, startInd) + searchText.substring(endInd); + searchBean.setSearchText(searchText); + + parseOrSearch(searchBean); + } + + return searchBean; + } +} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/ShoppingcartManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/ShoppingcartManager.java new file mode 100644 index 0000000000..d8f2e90828 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/businesslogic/ShoppingcartManager.java @@ -0,0 +1,501 @@ +/** + * + * Copyright (c) 2008 Posterita. All Rights Reserved. + * + * This software is the confidential and proprietary information of + * Posterita. ("Confidential Information"). You shall not + * disclose such Confidential Information and shall use it only in + * accordance with the terms of the license agreement you entered into + * with Posterita. + * + * POSTERITA MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE + * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT + * NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR + * A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. TAMAK ICT SHALL NOT + * BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, + * MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. + * + * Mar 25, 2008 11:20:20 AM by praveen + * + */ + +package org.posterita.businesslogic; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.text.DecimalFormat; +import java.text.ParseException; +import java.util.ArrayList; +import java.util.Properties; + +import javax.servlet.http.HttpServletRequest; +import javax.swing.text.NumberFormatter; + +import org.apache.ecs.xhtml.div; +import org.apache.ecs.xhtml.table; +import org.apache.ecs.xhtml.td; +import org.apache.ecs.xhtml.th; +import org.apache.ecs.xhtml.tr; +import org.compiere.model.MOrder; +import org.compiere.util.Env; +import org.posterita.Constants; +import org.posterita.TangoColors; +import org.posterita.beans.ItemBean; +import org.posterita.beans.PaymentDetailsBean; +import org.posterita.beans.ProductDetailsBean; +import org.posterita.beans.ShoppingCartBean; +import org.posterita.businesslogic.administration.PriceListManager; +import org.posterita.core.TmkJSPEnv; +import org.posterita.exceptions.OperationException; +import org.posterita.lib.UdiConstants; + +public class ShoppingcartManager +{ + + private static String getShoppingcartAsHTML(ArrayList itemList, String currency, BigDecimal discountedTotal, BigDecimal percentageDiscount, String orderType) throws ParseException + { + NumberFormatter formatter = new NumberFormatter(new DecimalFormat("0.00")); + + BigDecimal totalQty = Env.ZERO; + BigDecimal grandTotal = Env.ZERO; + BigDecimal grandTotalWithoutDiscount = Env.ZERO; + BigDecimal totalWithoutDiscount = Env.ZERO; + BigDecimal discount = Env.ZERO; + BigDecimal totalDiscount = Env.ZERO; + String currencySymbol = currency; + + String[] headers = {"Name","Description","Qty","Uom","Unit Price","VAT","Incl Price","Total"}; + table tbl = new table("0", "0", "0", "100%", ""); + + + tr headerRow = new tr(); + headerRow.setClass("itemTitleList"); + + for(String header : headers) + { + th h = new th(header); + headerRow.addElement(h); + } + + tbl.addElement(headerRow); + + //add body + int count = 0; + + if(itemList != null) + for(ItemBean bean : itemList) + { + count ++; + + tr dataRow = new tr(); + + if(orderType != null) + { + if(count % 2 == 0) + { + if(orderType.equalsIgnoreCase("POS Order")) + { + dataRow.setClass("evenRow"); + //dataRow.setOnMouseOut("this.className='evenRow'"); + //dataRow.setOnMouseOver("this.className='highlight'"); + } + else if(orderType.equalsIgnoreCase("POS Goods Receive Note")) + { + //Keep same style for purchase sceen for time being + dataRow.setClass("evenRow"); + //dataRow.setOnMouseOut("this.className='evenRow'"); + //dataRow.setOnMouseOver("this.className='highlight'"); + } + } + else + { + dataRow.setClass("oddRow"); + //dataRow.setOnMouseOut("this.className='oddRow'"); + //dataRow.setOnMouseOver("this.className='highlight'"); + } + } + + dataRow.setID("row" + count); + dataRow.addAttribute("productId", bean.getProductId().toString()); + dataRow.addAttribute("qty", bean.getQty().toString()); + dataRow.addAttribute("priceLimit", bean.getPriceLimit().toString()); + dataRow.addAttribute("priceList", bean.getListPrice().toString()); + + + totalQty = totalQty.add(bean.getQty()); + grandTotal = grandTotal.add(bean.getPrice()); + BigDecimal unitPrice = bean.getUnitPrice()==null?Env.ZERO:bean.getUnitPrice(); + BigDecimal taxAmt = bean.getTaxAmt()==null?Env.ZERO:bean.getTaxAmt(); + dataRow.addAttribute("taxRate", bean.getTaxRate().toString()); + dataRow.addAttribute("isTaxIncluded", bean.getIsTaxIncluded().toString()); + BigDecimal inclPrice = bean.getInclPrice(); + BigDecimal listPrice = bean.getListPrice(); + + if(bean.getIsTaxIncluded()) + { + + totalWithoutDiscount = bean.getQty().multiply(listPrice); + grandTotalWithoutDiscount = grandTotalWithoutDiscount.add(totalWithoutDiscount); + } + else + { + totalWithoutDiscount = bean.getQty().multiply(listPrice.add(taxAmt)); + grandTotalWithoutDiscount = grandTotalWithoutDiscount.add(totalWithoutDiscount); + } + + String[] columnData = { + bean.getProductName(), + bean.getDescription(), + bean.getQty().toString(), + bean.getUom(), + formatter.valueToString(bean.getUnitPrice()), + formatter.valueToString(bean.getTaxAmt()), + formatter.valueToString(inclPrice), + formatter.valueToString(bean.getPrice()) + }; + + for(int i=0; i itemList = (ArrayList) request.getSession().getAttribute(Constants.SHOPPING_ORDER_CART_ITEMS); + + String currency = (String) request.getSession().getAttribute(Constants.CURRENCY_SYMBOLE); + BigDecimal discountOnTotal = (BigDecimal)request.getSession().getAttribute(Constants.SHOPPING_CART_DISCOUNTED_TOTAL); + BigDecimal discountOnTotalPer = (BigDecimal)request.getSession().getAttribute(Constants.SHOPPING_CART_DISCOUNT_PERCENTAGE); + BigDecimal cartTotal = (BigDecimal) request.getSession().getAttribute(Constants.SHOPPING_CART_TOTAL); + + //When giving discount on total, recompute total discount if quantity is changed + if(cartTotal != null && discountOnTotal != null) + { + if(discountOnTotal.doubleValue() > 0) + { + cartTotal = cartTotal.multiply(((Env.ONEHUNDRED.subtract(discountOnTotal))).divide(Env.ONEHUNDRED, RoundingMode.HALF_EVEN)); + } + } + + return getShoppingcartAsHTML(itemList, currency, cartTotal, discountOnTotalPer, null); + } + + public static String getShoppingcartAsHTML(HttpServletRequest request, String orderType) throws ParseException + { + //add body + ArrayList itemList = (ArrayList) request.getSession().getAttribute(Constants.SHOPPING_ORDER_CART_ITEMS); + + String currency = (String) request.getSession().getAttribute(Constants.CURRENCY_SYMBOLE); + Boolean isDiscOnTotal = (Boolean)request.getSession().getAttribute(Constants.DISCOUNT_ON_ORDER_TOTAL); + Boolean isDiscOnTotalPer = (Boolean)request.getSession().getAttribute(Constants.DISCOUNT_ON_ORDER_TOTAL_PERCENT); + //BigDecimal cartTotal = (BigDecimal) request.getSession().getAttribute(Constants.SHOPPING_CART_DISCOUNTED_TOTAL); + BigDecimal discountPercentOnOrderTotal = null; + BigDecimal discountedOrderTotal = null; + if (isDiscOnTotal != null && isDiscOnTotal) + { + discountedOrderTotal =(BigDecimal)request.getSession().getAttribute(Constants.SHOPPING_CART_DISCOUNTED_TOTAL); + } + else if (isDiscOnTotalPer != null && isDiscOnTotalPer) + { + discountPercentOnOrderTotal = (BigDecimal) request.getSession().getAttribute(Constants.SHOPPING_CART_DISCOUNT_PERCENTAGE); + } + //When giving discount on total, recompute total discount if quantity is changed + if (discountedOrderTotal != null && discountPercentOnOrderTotal != null) + { + if (discountPercentOnOrderTotal.compareTo(Env.ZERO) == 1) + { + discountedOrderTotal = discountedOrderTotal.multiply(((Env.ONEHUNDRED.subtract(discountedOrderTotal))).divide(Env.ONEHUNDRED, RoundingMode.HALF_EVEN)); + } + } + + String shoppingCart = getShoppingcartAsHTML(itemList, currency, discountedOrderTotal, discountPercentOnOrderTotal, orderType); + return shoppingCart; + } + + public static void clearShoppingcart(HttpServletRequest request) + { + //bug fix + request.setAttribute("qtyTotal", null); + request.setAttribute("grandTotal", null); + + request.getSession().removeAttribute(Constants.SHOPPING_ORDER_CART); + request.getSession().removeAttribute(Constants.SHOPPING_ORDER_CART_ITEMS); + request.getSession().removeAttribute(Constants.SHOPPING_CART_TOTAL); + request.getSession().removeAttribute(Constants.SHOPPING_CART_DISCOUNTED_TOTAL); + request.getSession().removeAttribute(Constants.SHOPPING_CART_DISCOUNT_PERCENTAGE); + } + + public static String getShoppingCartFromOrder(Properties ctx, int c_order_id, String trxName) throws OperationException, ParseException + { + ShoppingCartBean shoppingcart = POSManager.getShoppingCartForOrder(ctx, c_order_id, trxName); + + MOrder order = new MOrder(ctx, c_order_id, trxName); + String orderType = order.getOrderType(); + + PaymentDetailsBean bean = PaymentManager.getPaymentDetails(ctx, c_order_id, trxName); + + if(MOrder.PAYMENTRULE_OnCredit.equals(order.getPaymentRule())) + { + bean.setPayAmt(order.getGrandTotal()); + } + + //weird logic! + + BigDecimal discountedTotal = bean.getPayAmt(); + /*if(bean.getDiscountAmt()!=null && bean.getDiscountAmt().equals(Env.ZERO)) + { + discountedTotal = null; + } */ + return getShoppingcartAsHTML(shoppingcart.getItems(), shoppingcart.getCurrency(), discountedTotal, Env.ZERO, orderType); + } + + //-----------------------------------------------------------------------// + // BARCODE INTEGRATION + + private static String getBarcodecartAsHTML(ArrayList itemList, Properties ctx) throws ParseException, OperationException + { + NumberFormatter formatter = new NumberFormatter(new DecimalFormat("0.00")); + + int priceListId = Env.getContextAsInt(ctx, UdiConstants.PRICELIST_CTX_PARAM); + String currSymbol = PriceListManager.getCurrency(ctx, priceListId); + + BigDecimal totalQty = Env.ZERO; + + String[] headers = {"Barcode","Description","Sale Price (Inc VAT)","No Of Labels"}; + table tbl = new table("0", "0", "0", "100%", ""); + tbl.setID("cart"); + tbl.setBgColor(TangoColors.ALUMINIUM_2); + + BigDecimal qty = Env.ZERO; + + tr headerRow = new tr(); + headerRow.setClass("itemTitleList"); + + + for(String header : headers) + { + th h = new th(header); + headerRow.addElement(h); + } + + tbl.addElement(headerRow); + + //add body + int count = 0; + + if(itemList != null) + for(ItemBean bean : itemList) + { + count ++; + + tr dataRow = new tr(); + + if(count % 2 == 0) + { + dataRow.setClass("evenRow"); + } + else + { + dataRow.setClass("oddRow"); + } + dataRow.setID("row" + count); + dataRow.addAttribute("productId", bean.getProductId().toString()); + dataRow.addAttribute("qty", bean.getQty().toString()); + qty = bean.getQty(); + + BigDecimal stdPrice = bean.getUnitPrice()==null?Env.ZERO:bean.getUnitPrice(); + BigDecimal taxRate = bean.getTaxRate()==null?Env.ZERO:bean.getTaxRate(); + BigDecimal priceIncVat = stdPrice.multiply((taxRate.add(new BigDecimal(100))).divide(new BigDecimal(100))); + + totalQty = totalQty.add(bean.getQty()); + String[] columnData = { + bean.getBarCode(), + bean.getDescription(), + currSymbol + formatter.valueToString(priceIncVat), + bean.getQty().toString() + }; + + for(int i=0; iTotal labels to be printed ").setColSpan("3")); + footerRow.addElement(new td(new div(totalQty.toString()).setID("cartTotal"))); + + tbl.addElement(footerRow); + + + return tbl.toString(); + } + + public static String getBarcodecartAsHTML(HttpServletRequest request) throws ParseException, OperationException + { + //add body + ArrayList itemList = (ArrayList) request.getSession().getAttribute(Constants.BARCODE_CART_ITEMS); + Properties ctx = TmkJSPEnv.getCtx(request); + return getBarcodecartAsHTML(itemList, ctx); + } + + public static String copyShoppingCartAsHTML(Properties ctx, ProductCart cart) throws ParseException, OperationException + { + + NumberFormatter formatter = new NumberFormatter(new DecimalFormat("0.00")); + int priceListId = Env.getContextAsInt(ctx, UdiConstants.PRICELIST_CTX_PARAM); + String currSymbol = PriceListManager.getCurrency(ctx, priceListId); + ArrayList productList = cart.getProducts(); + + + BigDecimal totalQty = Env.ZERO; + + String[] headers = {"Barcode","Description","Sale Price (Inc VAT)","No Of Labels"}; + table tbl = new table("1", "0", "0", "100%", ""); + tbl.setID("cart"); + + BigDecimal qty = Env.ZERO; + + tr headerRow = new tr(); + for(String header : headers) + { + th h = new th(header); + headerRow.addElement(h); + } + + tbl.addElement(headerRow); + + //add body + int count = 0; + + if(productList != null) + for(ProductDetailsBean bean : productList) + { + count ++; + + String styleClass = "label"; + if ((count%2) != 0) + styleClass = "contentname"; + + tr dataRow = new tr(); + dataRow.setID("row" + count); + dataRow.addAttribute("productId", bean.getProductId().toString()); + dataRow.addAttribute("qty", bean.getQuantity().toString()); + qty = bean.getQuantity(); + totalQty = totalQty.add(bean.getQuantity()); + String[] columnData = { + bean.getBarCode(), + bean.getProductName(), + currSymbol + formatter.valueToString(bean.getStdSalesPrice()), + bean.getQuantity().toString() + }; + + for(int i=0; iTotal labels to be printed ").setAlign("right").setColSpan("3")); + footerRow.addElement(new td(new div(totalQty.toString()).setID("cartTotal")).setAlign("right")); + + tbl.addElement(footerRow); + + + return tbl.toString(); + } + + public static int getPriceList(HttpServletRequest request) + { + int priceListId = -1; + + ShoppingCartBean cart = (ShoppingCartBean)request.getSession().getAttribute(Constants.SHOPPING_CART); + if(cart != null) + { + priceListId = cart.getPricelistId(); + } + + return priceListId; + } + +} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/StockInquiryManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/StockInquiryManager.java new file mode 100644 index 0000000000..2b79ceb442 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/businesslogic/StockInquiryManager.java @@ -0,0 +1,117 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +* Created on Aug 19, 2005 by alok +* +*/ + +package org.posterita.businesslogic; + +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.Properties; + +import org.compiere.util.DB; +import org.compiere.util.Env; + +import org.posterita.beans.ProductBean; +import org.posterita.beans.ProductQuery; +import org.posterita.businesslogic.administration.ProductManager; +import org.posterita.businesslogic.stock.StockManager; +import org.posterita.exceptions.OperationException; + +public class StockInquiryManager +{ + + + + public static ArrayList getAvailableTShirts(Properties ctx, ProductQuery query) throws OperationException + { + String sql = " SELECT " + + " s.AD_Org_ID," + + " s.M_LOCATOR_ID," + + " s.M_Product_ID," + + " p.name," + + " p.m_attributesetinstance_id," + + " s.QtyOnHand," + + " s.QtyReserved," + + " s.QtyOrdered," + + " p.m_product_category_id," + + " p.description" + + " FROM M_Storage s,m_product p,m_locator loc" + + " where s.M_PRODUCT_ID = p.M_PRODUCT_ID" + + " and s.m_locator_id = loc.m_locator_id" + + " and p.m_product_category_id=" + query.getProductCategoryId() + + " and p.isWebstoreFeatured='Y'" + + " AND s.AD_Client_ID = " + Env.getAD_Client_ID(ctx) + + " @ATTRIBUTE_SEARCH_SQL@" + + " and s.ad_org_id=" + Env.getAD_Org_ID(ctx); + + String attributeSearchSQL = ProductManager.getAttributeSearchSQL(ctx, query); + + + sql = sql.replaceAll("@ATTRIBUTE_SEARCH_SQL@",attributeSearchSQL); + sql = StockManager.setBackOrderFilter(ctx, sql, query.getBackOrder()); + + PreparedStatement pstmt = DB.prepareStatement(sql, null); + ResultSet rs = null; + + ProductBean bean; + ArrayList productList = new ArrayList(); + try + { + rs = pstmt.executeQuery(); + while (rs.next()) + { + bean = new ProductBean(); + bean.setOrgId(Integer.valueOf(rs.getInt(1))); + bean.setLocatorId(Integer.valueOf(rs.getInt(2))); + bean.setProductId(Integer.valueOf(rs.getInt(3))); + bean.setProductName(rs.getString(4)); + bean.setAttributeSetInstanceId(Integer.valueOf(rs.getInt(5))); + bean.setQtyOnHand(rs.getBigDecimal(6)); + bean.setQtyReserved(rs.getBigDecimal(7)); + bean.setQtyOrdered(rs.getBigDecimal(8)); + bean.setProductCategoryId(Integer.valueOf(rs.getInt(9))); + bean.setDescription(rs.getString(10)); + productList.add(bean); + } + + rs.close(); + } + catch (SQLException e) + { + throw new OperationException(e); + } + finally + { + try + { + pstmt.close(); + } + catch(Exception e) + {} + + pstmt = null; + } + + return productList; + } +} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/StoreManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/StoreManager.java new file mode 100644 index 0000000000..d7241e7d96 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/businesslogic/StoreManager.java @@ -0,0 +1,139 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * + * + */ + +/** + @author ashley + */ + +package org.posterita.businesslogic; + +import java.util.Properties; + +import org.compiere.model.MStore; +import org.compiere.util.Env; +import org.posterita.exceptions.DefaultStoreException; +import org.posterita.exceptions.OperationException; +import org.posterita.exceptions.StoreException; +import org.posterita.lib.UdiConstants; +import org.posterita.util.PoManager; + +public class StoreManager +{ + + public static int getStoreIdByName(Properties ctx, String storeName, String trxName) throws StoreException + { + int adClientId = Env.getAD_Client_ID(ctx); + int adOrgId = Env.getAD_Org_ID(ctx); + + String whereClause = "AD_Client_ID=" + adClientId + " and AD_Org_ID=" + adOrgId + " and Name='" + storeName + "'"; + + int storeIds[] = MStore.getAllIDs(MStore.Table_Name, whereClause, trxName); + + if(storeIds.length == 0) + throw new StoreException("Could not find Store with name: " + storeName); + + else if(storeIds.length > 1) + throw new StoreException(storeIds.length + " Stores found with name: " + storeName); + + else + return storeIds[0]; + } + + public static MStore createStore(Properties ctx, String storeName, String webContext, int orgId, + int priceListId, int salesRepId, int warehouseId, String webParam6, String hostUrl, String trxName) throws OperationException + { + if(storeName == null || storeName.length() == 0) + throw new OperationException("Store name cannot be null"); + if(webContext == null || webContext.length() == 0) + throw new OperationException("Web context cannot be null"); + + MStore store = new MStore(ctx, 0, trxName); + store.setAD_Org_ID(orgId); + store.setName(storeName); + store.setWebContext(webContext); + store.setM_PriceList_ID(priceListId); + store.setSalesRep_ID(salesRepId); + store.setM_Warehouse_ID(warehouseId); + store.setWebParam6(webParam6); + store.setURL(hostUrl); + PoManager.save(store); + + return store; + } + + public static boolean isStorePresent(String webContext) + { + String whereClause = "WebContext='" + webContext + "'"; + int storeIds[] = MStore.getAllIDs(MStore.Table_Name, whereClause, null); + + return (storeIds.length > 0); + } + + public static MStore getDefaultStore(Properties ctx) throws DefaultStoreException + { + String whereClause = "IsDefault='Y'"; + int storeIds[] = MStore.getAllIDs(MStore.Table_Name, whereClause, null); + + if(storeIds.length == 0) + throw new DefaultStoreException("No Default store defined!!!"); + else if(storeIds.length > 1) + throw new DefaultStoreException("More than 1 default store defined!!!"); + else + return new MStore(ctx, storeIds[0], null); + } + + /** + * Retrieves the web store as per the context. + * @param ctx context + * @return web store + */ + public static MStore getStore(Properties ctx) + { + MStore store = MStore.get(ctx, Env.getContextAsInt(ctx, UdiConstants.WSTORE_CTX_PARAM)); + return store; + } + + /** + * Retrieves the price list id associated with the web store in context. + * This price list is a purchase price list. + * @param ctx context + * @return price list id + */ + public static int getPriceListId(Properties ctx) + { + MStore store = getStore(ctx); + return store.getM_PriceList_ID(); + } + + /** + * Updates the price list associated with the web store in context. + * @param ctx context + * @param priceListId id of the price list to set in the web store + */ + public static void setPriceListId(Properties ctx, int priceListId,String trxName) + { + MStore store = getStore(ctx); + store.setM_PriceList_ID(priceListId); + store.save(trxName); + } +} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/UDIMessageManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/UDIMessageManager.java new file mode 100644 index 0000000000..fe028e8a1f --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/businesslogic/UDIMessageManager.java @@ -0,0 +1,204 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Aug 1, 2005 by din + */ + +package org.posterita.businesslogic; + +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.Properties; + +import org.compiere.model.MMessage; +import org.compiere.model.MOrg; +import org.compiere.util.DB; +import org.compiere.util.Env; + +import org.posterita.Constants; +import org.posterita.beans.MessageBean; +import org.posterita.beans.UDIPair; +import org.posterita.exceptions.OperationException; + + +public class UDIMessageManager +{ + public static ArrayList getAllOrgMessagesReceived(Properties ctx) + { + String strOrgID = ctx.getProperty("#AD_Org_ID"); + + String sql; + + sql = "select U_Message_ID," + //1 + " subject," + //2 + " message," + //3 + " msg.created," + //4 + " org.name, " + //5 + " msg.AD_ORG_ID," + //6 + //" decode(msg.U_READ,'Y','true','false')" + //7 + " CASE WHEN msg.U_READ='Y' THEN 'true' ELSE 'false' END" + //7 + " from U_MESSAGE msg " + + " join AD_ORG org ON org.AD_ORG_ID = msg.AD_ORG_ID " + + " where msg.C_AD_ORG_ID =" + strOrgID + + " and MESSAGE_TYPE=" + "'" + Constants.RECEIVED_MESSAGE + "'" + + " and msg.IsActive=" + "'Y'" + + " order by msg.created desc"; + + PreparedStatement pstmt =null; + + System.out.println(sql); + + MessageBean message = null; + ArrayList messages = new ArrayList(); + try + { + pstmt = DB.prepareStatement(sql, null); + ResultSet rs = pstmt.executeQuery(); + + + while (rs.next()) + { + + message = new MessageBean(); + message.setMessageID(Integer.valueOf(rs.getInt(1))); + message.setSubject(rs.getString(2)); + message.setMessage(rs.getString(3)); + message.setDateCreated(rs.getTimestamp(4)); + message.setCounterOrgName(rs.getString(5)); + message.setOrgID(Integer.valueOf(rs.getInt(6))); + message.setRead(rs.getString(7)); + messages.add(message); + + } + + rs.close(); + + } + catch (SQLException e) + { + + } + finally + { + try + { + pstmt.close(); + } + catch (Exception ex) + { + } + pstmt = null; + } + + + return messages; + } + + public static ArrayList getOrgs(Properties ctx) + { + int[] orgIDs = MOrg.getAllIDs(MOrg.Table_Name,"AD_CLIENT_ID=" + Env.getAD_Client_ID(ctx) + " and AD_Org_ID<>" + ctx.getProperty("#AD_Org_ID"),null); + ArrayList orgs = new ArrayList (); + for ( int i=0 ; i < orgIDs.length ; i++ ) + { + MOrg org = new MOrg(ctx, orgIDs[i],null); + UDIPair pair = new UDIPair(Integer.valueOf(orgIDs[i]), org.getName()); + orgs.add(pair); + + } + + return orgs; + } + + public static Integer getUnreadMessageCount(Properties ctx) + { + int[] ids = MMessage.getAllIDs("U_MESSAGE", "U_READ='N' and C_AD_ORG_ID=" + ctx.getProperty("#AD_Org_ID") + " and MESSAGE_TYPE=" + "'" + Constants.RECEIVED_MESSAGE + "'" + " and IsActive=" + "'Y'",null); + + return Integer.valueOf(ids.length); + } + + public static ArrayList getMySentMessages(Properties ctx) throws OperationException + { + String strOrgID = ctx.getProperty("#AD_Org_ID"); + + String sql; + + sql = "select U_Message_ID," + //1 + " subject," + //2 + " message," + //3 + " msg.created," + //4 + " org.name, " + //5 + " msg.AD_ORG_ID," + //6 + //" decode(msg.U_READ,'Y','true','false')" + //7 + " CASE WHEN msg.U_READ='Y' THEN 'true' ELSE 'false' END" + //7 + " from U_MESSAGE msg " + + " join AD_ORG org ON org.AD_ORG_ID = msg.C_AD_ORG_ID " + + " where msg.AD_ORG_ID =" + strOrgID + + " and msg.MESSAGE_TYPE=" + "'" + Constants.SENT_MESSAGE + "'" + + " and msg.IsActive=" + "'Y'" + + " order by msg.created desc"; + + + PreparedStatement pstmt =null; + + MessageBean message = null; + ArrayList messages = new ArrayList(); + try + { + pstmt = DB.prepareStatement(sql, null); + ResultSet rs = pstmt.executeQuery(); + + + while (rs.next()) + { + message = new MessageBean(); + message.setMessageID(Integer.valueOf(rs.getInt(1))); + message.setSubject(rs.getString(2)); + message.setMessage(rs.getString(3)); + message.setDateCreated(rs.getTimestamp(4)); + message.setCounterOrgName(rs.getString(5)); + message.setOrgID(Integer.valueOf(rs.getInt(6))); + message.setRead(rs.getString(7)); + messages.add(message); + } + + rs.close(); + } + catch (SQLException e) + { + throw new OperationException(e); + } + finally + { + try + { + pstmt.close(); + } + catch (Exception ex) + { + } + pstmt = null; + } + + + return messages; + } + + +} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/administration/BPartnerManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/administration/BPartnerManager.java new file mode 100644 index 0000000000..9274ac1e2c --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/businesslogic/administration/BPartnerManager.java @@ -0,0 +1,1127 @@ +/** + * Product: Posterita Web-Based POS (an Adempiere Plugin) + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +/** + @author Alok Pathak + */ + +package org.posterita.businesslogic.administration; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Timestamp; +import java.text.DecimalFormat; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.Properties; + +import org.compiere.acct.Fact.Balance; +import org.compiere.model.MBPBankAccount; +import org.compiere.model.MBPartner; +import org.compiere.model.MBPartnerLocation; +import org.compiere.model.MCountry; +import org.compiere.model.MLocation; +import org.compiere.model.MOrg; +import org.compiere.model.MRegion; +import org.compiere.util.DB; +import org.compiere.util.Env; +import org.compiere.utils.DBUtils; +import org.posterita.beans.AddressBean; +import org.posterita.beans.BPartnerBean; +import org.posterita.beans.StatementOfAccountBean; +import org.posterita.businesslogic.LocationManager; +import org.posterita.core.TrxPrefix; +import org.posterita.exceptions.NoAccessToEditObjectException; +import org.posterita.exceptions.OperationException; +import org.posterita.lib.UdiConstants; +import org.posterita.util.PoManager; + + +public class BPartnerManager +{ + + + public static MBPartner activateBPartner(Properties ctx, int bpartnerId, boolean isActive,String trxName) throws OperationException + { + + MBPartner bpartner = new MBPartner(ctx,bpartnerId,trxName); + + if(bpartner == null) + throw new OperationException("Business Partner does not exist!"); + if(isActive == true) + { + bpartner.setIsActive(false); + } + else + { + bpartner.setIsActive(true); + } + + PoManager.save(bpartner); + + return bpartner; + + } + + public static MBPartner createBPartner(Properties ctx,int orgId, int parentBpId, String bPName, String name2, boolean isCustomer,boolean isVendor,boolean isEmployee,boolean isSalesRep,String address1, String address2, String postalAddress1, Integer regionId, String city,String bpPhone, String fax,int countryId, boolean isShipTo, boolean isBillTo, String trxName) throws OperationException + { + return saveBPartner(ctx, orgId, 0, parentBpId, bPName, name2, isCustomer, isVendor, isEmployee, isSalesRep, address1, address2, postalAddress1, regionId, city, bpPhone, "", fax, countryId, isShipTo, isBillTo, trxName); + } + + + public static MBPartner createBPartner(Properties ctx,int orgId, int parentBpId, String bPName, String name2, boolean isCustomer,boolean isVendor,boolean isEmployee,boolean isSalesRep,String address1,String postalAddress1,String city,String bpPhone,int countryId, String trxName) throws OperationException + { + return saveBPartner( ctx, orgId, 0, parentBpId, bPName, name2, isCustomer, isVendor, isEmployee, isSalesRep, address1, "", postalAddress1, null, city, bpPhone, "", "", countryId, true, true, trxName); + } + + public static MBPBankAccount createBPBankAcc(Properties ctx,int bPartnerId,String aName,String city,String street, String trxName) throws OperationException + { + MBPBankAccount bankAcc = new MBPBankAccount(ctx,0,trxName); + + try + { + bankAcc.setC_BPartner_ID(bPartnerId); + bankAcc.setA_Name(aName);//Name of Account holder + bankAcc.setA_Street(street); + bankAcc.setA_City(city);//city of bank account + + PoManager.save(bankAcc); + } + catch(OperationException e) + { + throw new OperationException("Cannot create BP Bank Account!"); + } + + + return bankAcc; + } + + public static MBPartner createLinkedBPartner(Properties ctx,int orgId, int parentBpId, String bPName, String name2, boolean isCustomer,boolean isVendor,boolean isEmployee,boolean isSalesRep,String address1,String postalAddress1,String city,String bpPhone,int countryId, String trxName) throws OperationException + { + MBPartner bpartner = saveBPartner( ctx, orgId, 0, parentBpId, bPName, name2, isCustomer, isVendor, isEmployee, isSalesRep, address1, "", postalAddress1, null, city, bpPhone, "", "",countryId, true, true, trxName); + + bpartner.setAD_OrgBP_ID(orgId); + + PoManager.save(bpartner); + return bpartner; + } + + + + public static MBPartner createShippingBPartner(Properties ctx,int orgId, int parentBpId, String bPName, String name2, boolean isCustomer,boolean isVendor,boolean isEmployee,boolean isSalesRep,String address1,String postalAddress1,String city,String bpPhone,int countryId, boolean isShipTo, boolean isBillTo, String trxName) throws OperationException + { + return saveBPartner( ctx, orgId, 0, parentBpId, bPName, name2, isCustomer, isVendor, isEmployee, isSalesRep, address1, "", postalAddress1, null, city, bpPhone, "", "", countryId, isShipTo, isBillTo, trxName); + + } + + public static MBPartner deactivateBPartner(Properties ctx, int bpartnerId, String trxName) throws OperationException + { + + MBPartner bpartner = new MBPartner(ctx,bpartnerId,trxName); + + if(bpartner == null)throw new OperationException("Business Partner does not exist!"); + + bpartner.setIsActive(false); + + PoManager.save(bpartner); + + return bpartner; + + } + + + public static ArrayList getAllBpartners(Properties ctx, String trxName) throws OperationException + { + + int adClientID = Env.getAD_Client_ID(ctx); + + + String sql; + + sql = " select bp.c_bpartner_id, " + //1 + " bp.name," + //2 + " bp.name2," + //3 + " bp.isactive,"+//4 + " bp.iscustomer," + //5 + " bp.isemployee," + //6 + " bp.isvendor, " + //7 + " bp.issalesrep," + //8 + " cl.address1," + //9 + " cl.address2," + //10 + " cl.city," + //11 + " cl.postal_add," + //12 + " bpl.c_bpartner_id," + //13 + " cl.c_location_id," + //14 + " bpl.phone," + //15 + " bpl.fax," + //16 + " cl.REGIONNAME " + //17 + " from C_BPARTNER bp left outer join (c_bpartner_location bpl left outer join c_location cl on cl.c_location_id=bpl.c_location_id) on bpl.c_bpartner_id = bp.c_bpartner_id, AD_ORG org " + + " where bp.ad_org_id = org.ad_org_id and " + + " bp.AD_CLIENT_ID = " + adClientID + + " order by bp.name"; + + PreparedStatement pstmt =null; + + System.out.println(sql); + + BPartnerBean bpartner = null; + ResultSet rs = null; + + ArrayList bpartners = new ArrayList(); + + try + { + pstmt = DB.prepareStatement(sql,trxName); + rs = pstmt.executeQuery(); + + + while (rs.next()) + { + + bpartner = new BPartnerBean(); + bpartner.setBpartnerId(Integer.valueOf(rs.getInt(1))); + bpartner.setPartnerName(rs.getString(2)); + bpartner.setName2(rs.getString(3)); + + if(rs.getString(4).equals("Y")) + { + bpartner.setIsActive(Boolean.valueOf(true)); + } + else + bpartner.setIsActive(Boolean.valueOf(false)); + + if(rs.getString(5).equals("Y")) + { + bpartner.setIsCustomer(Boolean.valueOf(true)); + } + else + bpartner.setIsCustomer(Boolean.valueOf(false)); + + if(rs.getString(6).equals("Y")) + { + bpartner.setIsEmployee(Boolean.valueOf(true)); + } + else + bpartner.setIsEmployee(Boolean.valueOf(false)); + + if(rs.getString(7).equals("Y")) + { + bpartner.setIsVendor(Boolean.valueOf(true)); + } + else + bpartner.setIsVendor(Boolean.valueOf(false)); + + if(rs.getString(8).equals("Y")) + { + bpartner.setIsSalesRep(Boolean.valueOf(true)); + } + else + bpartner.setIsSalesRep(Boolean.valueOf(false)); + + + + bpartner.setAddress1(rs.getString(9)); + bpartner.setAddress2(rs.getString(10)); + bpartner.setCity(rs.getString(11)); + bpartner.setPostalAddress(rs.getString(12)); + bpartner.setPhone(rs.getString(15)); + bpartner.setFax(rs.getString(16)); + + String regionName = rs.getString(17); + + int regionId = 0; + + int id[] = MRegion.getAllIDs(MRegion.Table_Name," name= '"+ regionName +"'",trxName); + + if(id.length != 0) + { + regionId = id[0]; + } + + bpartner.setRegionId(Integer.valueOf(regionId)); + + + bpartners.add(bpartner); + } + + rs.close(); + + } + catch (SQLException e) + { + throw new OperationException(e.getMessage()); + } + finally + { + try + { + if(pstmt != null) + pstmt.close(); + } + catch(Exception ex) + {} + + pstmt = null; + } + + return bpartners; + + + } + + + public static BPartnerBean getBpartner(Properties ctx, int bPartnerId, String trxName) throws OperationException + { + MBPartner bpartner = loadBPartner(ctx, bPartnerId, trxName); + + MBPartnerLocation bplocations[] = bpartner.getLocations(false); + + BPartnerBean bpBean = new BPartnerBean(); + bpBean.setBpartnerId(bpartner.get_ID()); + bpBean.setPartnerName(bpartner.getName()); + bpBean.setName2(bpartner.getName2()); + bpBean.setIsActive(bpartner.isActive()); + bpBean.setIsCustomer(bpartner.isCustomer()); + bpBean.setIsEmployee(bpartner.isEmployee()); + bpBean.setIsVendor(bpartner.isVendor()); + bpBean.setIsSalesRep(bpartner.isSalesRep()); + bpBean.setOrgId(bpartner.getAD_Org_ID()); + if (bplocations.length == 0) + { + throw new OperationException("No location defined for BPartner"); + } + + MBPartnerLocation bplocation = bplocations[0]; + MLocation location = bplocation.getLocation(false); + + bpBean.setAddress1(location.getAddress1()); + bpBean.setAddress2(location.getAddress2()); + bpBean.setCity(location.getCity()); + bpBean.setPostalAddress(location.getPostal_Add()); + bpBean.setPhone(bplocation.getPhone()); + bpBean.setFax(bplocation.getFax()); + bpBean.setPostalCode(location.getPostal()); + MRegion region = location.getRegion(); + + if (region != null && region.get_ID() > 0) + { + bpBean.setRegionId(region.get_ID()); + } + + return bpBean; + } + + public static MBPartnerLocation getBPartnerSingleLocation(Properties ctx, int bpartnerId) throws OperationException + { + MBPartnerLocation bpartnerLocations[] = MBPartnerLocation.getForBPartner(ctx, bpartnerId); + + if(bpartnerLocations.length == 0) + throw new OperationException("No location found business partner with id: " + bpartnerId); + else if(bpartnerLocations.length > 1) + throw new OperationException("More than 1 location found for business partner with id: " + bpartnerId); + else + return bpartnerLocations[0]; + } + + + public static MBPartner getCreateLinkedBPartner(Properties ctx, MOrg org, String trxName) throws OperationException + { + MBPartner linkedBPartner; + if(org == null) + throw new OperationException("Organisation cannot be null"); + + int linkedBPId = org.getLinkedC_BPartner_ID(trxName); + if(linkedBPId != 0) + { + linkedBPartner = loadBPartner(ctx, linkedBPId, trxName); + return linkedBPartner; + } + else + { + + linkedBPartner = BPartnerManager.saveBPartner(ctx, org.get_ID(), 0, 0, org.getName(), "", false, false, false, false, " ", " ", " ", null, "", "", "", "", MCountry.getDefault(ctx).get_ID(), true, true, trxName); + + //saveBPartner(ctx, partnerId, parentBpId, name, name2, isCustomer, isVendor, isEmployee,isSalesRep, address1, address2, postalAddress1, regionId, city,bpPhone, String phone2, String fax,int countryId, boolean isShipTo, boolean isBillTo, String trxName) throws OperationException + + linkedBPartner.setAD_OrgBP_ID(org.get_ID()); + + PoManager.save(linkedBPartner, trxName); + + return linkedBPartner; + } + } + + + public static ArrayList getMyBPartners(Properties ctx, int partnerId, String trxName) throws OperationException + { + + ArrayList bpartnerList = new ArrayList (); + + if (partnerId == 0) + throw new OperationException("Parent business partner not present!"); + + MBPartner me = new MBPartner(ctx, partnerId, trxName); + AddressBean myAddressBean = populateAddressBean(ctx, me); + bpartnerList.add(myAddressBean); + + int[] partnerIds = MBPartner.getAllIDs(MBPartner.Table_Name, "BPARTNER_PARENT_ID=" + partnerId, null); + + for (int i = 0; i < partnerIds.length; i++) + { + MBPartner partner = new MBPartner(ctx, partnerIds[i], trxName); + + AddressBean bean = populateAddressBean(ctx, partner); + + bpartnerList.add(bean); + + } + + return bpartnerList; + } + + public static MBPartner getOrCreateBPartner(Properties ctx,int orgId, int parentBpId, String bPName, String name2, boolean isCustomer,boolean isVendor,boolean isEmployee,boolean isSalesRep,String address1,String postalAddress1,String city,String bpPhone,int countryId, String trxName) throws OperationException + { + return getOrCreateBPartner( ctx, orgId, parentBpId, bPName, name2, isCustomer, isVendor, isEmployee, isSalesRep, address1, "", postalAddress1, city, bpPhone, "",countryId, trxName); + } + + + public static MBPartner getOrCreateBPartner(Properties ctx, int orgId, int bPartnerParentId, String bPName, String name2, boolean isCustomer,boolean isVendor,boolean isEmployee,boolean isSalesRep,String address1,String address2, String postalAddress1,String city,String bpPhone, String fax, int countryId, String trxName) throws OperationException + { + String sqlQuery = " upper(Name)=upper('" + bPName + "') and AD_CLIENT_ID=" + Env.getAD_Client_ID(ctx) + " and AD_ORG_ID=" + Env.getAD_Org_ID(ctx); + + int partners[] = MBPartner.getAllIDs(MBPartner.Table_Name, sqlQuery, trxName); + MBPartner partner; + if(partners.length != 0) + partner = new MBPartner(ctx, partners[0], trxName); + else + partner = saveBPartner(ctx, orgId, 0, bPartnerParentId, bPName, name2, isCustomer, isVendor, isEmployee, isSalesRep, address1, address2, postalAddress1, null, city, bpPhone,"", fax,countryId, true, true, trxName); + + return partner; + } + +/* public static int getOrgBPId(Properties ctx) throws OperationException + { + MOrg org = new MOrg(ctx, Env.getAD_Org_ID(ctx), null); + + int bpartnerId = org.getLinkedC_BPartner_ID(); + + if (bpartnerId == 0) + throw new OperationException("Organisation does not have Linked Business Partner"); + + return bpartnerId; + }*/ + + public static AddressBean getShipmentAddressBPartner(Properties ctx, int partnerId) throws OperationException + { + if (partnerId == 0) + throw new OperationException("Business partner not present!"); + + MBPartner partner = new MBPartner(ctx, partnerId, null); + + AddressBean bean = populateAddressBean(ctx, partner); + + return bean; + + } + +/* public static String getVehicleTypeWhereStatement(Properties ctx, String trxName) throws OperationException + { + MOrg org = OrganisationManager.getMyOrg(ctx, trxName); + + if (org.isAutomobile()) + { + return (" and o.isautomobile='Y' "); + } + else if(org.isMotorcycle()) + { + return (" and o.ismotorcycle='Y' "); + } + else if (org.isMotorcycle() && org.isAutomobile()) + { + return (" and (o.ismotorcycle='Y' or o.isautomobile='Y' "); + } + + return ""; + }*/ + + public static boolean isBPartnerPresent(Properties ctx, int c_bpartner_id, String trxName) + { + boolean isPresent = false; + + String sql = "SELECT C_BPARTNER_ID FROM C_BPARTNER WHERE ISACTIVE = 'Y' AND C_BPARTNER_ID = ?"; + int value = DB.getSQLValue(trxName, sql, c_bpartner_id); + if(value != -1) + { + isPresent = true; + } + + return isPresent; + } + + public static MBPartner loadBPartner(Properties ctx, int bpartnerID, String trxName) throws OperationException + { + MBPartner bPartner = new MBPartner(ctx, bpartnerID, trxName); + + if(bPartner.get_ID() == 0) + throw new OperationException("Cannot load Business Partner with id: " + bpartnerID); + + return bPartner; + } + + private static AddressBean populateAddressBean(Properties ctx, MBPartner partner) throws OperationException + { + MBPartnerLocation[] partnerLocations = MBPartnerLocation.getForBPartner(ctx, partner.get_ID()); + + if (partnerLocations.length == 0) + throw new OperationException("Partner " + partner.getName() + " " + partner.getName2() + " (" + partner.get_ID() + ") " + "does not have any location!"); + + MBPartnerLocation partnerLocation = partnerLocations[0];//We assume there is only 1 location for this partner + MLocation location = new MLocation(ctx, partnerLocation.getC_Location_ID(), partner.get_TrxName()); + + AddressBean bean = new AddressBean(); + bean.setBpartnerId(partner.get_ID()); + bean.setUsername(partner.getName()); + bean.setUserSurname(partner.getName2()); + bean.setAddress1(location.getAddress1()); + bean.setAddress2(location.getAddress2()); + bean.setPostalAddress(location.getPostal_Add()); + bean.setCity(location.getCity()); + bean.setCountryId(location.getC_Country_ID()); + bean.setCountryName(location.getCountryName()); + + return bean; + } + + public static ArrayList searchBpartners(Properties ctx, String name, String trxName) throws OperationException + { + int adClientID = Env.getAD_Client_ID(ctx); + + String sql; + + sql = " select bp.c_bpartner_id, " + //1 + " bp.name," + //2 + " bp.name2," + //3 + " bp.isactive,"+//4 + " bp.iscustomer," + //5 + " bp.isemployee," + //6 + " bp.isvendor, " + //7 + " bp.issalesrep," + //8 + " cl.address1," + //9 + " cl.address2," + //10 + " cl.city," + //11 + " cl.postal_add," + //12 + " bpl.c_bpartner_id," + //13 + " cl.c_location_id," + //14 + " bpl.phone," + //15 + " bpl.fax," + //16 + " cl.REGIONNAME " + //17 + " from C_BPARTNER bp left outer join (c_bpartner_location bpl left outer join c_location cl on cl.c_location_id=bpl.c_location_id) on bpl.c_bpartner_id = bp.c_bpartner_id " + + " where bp.ad_org_id in (" + Env.getContext(ctx,UdiConstants.ROLE_EDITABLE_ORGS_CTX_PARAM)+")"+ + " and bp.AD_CLIENT_ID = " + adClientID + + " and (upper(bp.name) like upper('%" + name + "%')" + + " or upper(bp.name2) like upper('%" + name + "%'))" + + " order by bp.name"; + + PreparedStatement pstmt =null; + + BPartnerBean bpartner = null; + ResultSet rs = null; + + ArrayList bpartners = new ArrayList(); + + try + { + pstmt = DB.prepareStatement(sql,trxName); + rs = pstmt.executeQuery(); + + + while (rs.next()) + { + + bpartner = new BPartnerBean(); + bpartner.setBpartnerId(Integer.valueOf(rs.getInt(1))); + bpartner.setPartnerName(rs.getString(2)); + bpartner.setName2(rs.getString(3)); + + if(rs.getString(4).equals("Y")) + { + bpartner.setIsActive(Boolean.valueOf(true)); + } + else + bpartner.setIsActive(Boolean.valueOf(false)); + + if(rs.getString(5).equals("Y")) + { + bpartner.setIsCustomer(Boolean.valueOf(true)); + } + else + bpartner.setIsCustomer(Boolean.valueOf(false)); + + if(rs.getString(6).equals("Y")) + { + bpartner.setIsEmployee(Boolean.valueOf(true)); + } + else + bpartner.setIsEmployee(Boolean.valueOf(false)); + + if(rs.getString(7).equals("Y")) + { + bpartner.setIsVendor(Boolean.valueOf(true)); + } + else + bpartner.setIsVendor(Boolean.valueOf(false)); + + if(rs.getString(8).equals("Y")) + { + bpartner.setIsSalesRep(Boolean.valueOf(true)); + } + else + bpartner.setIsSalesRep(Boolean.valueOf(false)); + + + + bpartner.setAddress1(rs.getString(9)); + bpartner.setAddress2(rs.getString(10)); + bpartner.setCity(rs.getString(11)); + bpartner.setPostalAddress(rs.getString(12)); + bpartner.setPhone(rs.getString(15)); + bpartner.setFax(rs.getString(16)); + + String regionName = rs.getString(17); + + int regionId = 0; + + int id[] = MRegion.getAllIDs(MRegion.Table_Name," name= '"+ regionName +"'",trxName); + + if(id.length != 0) + { + regionId = id[0]; + } + + bpartner.setRegionId(Integer.valueOf(regionId)); + + + bpartners.add(bpartner); + } + + rs.close(); + + } + catch (SQLException e) + { + throw new OperationException(e.getMessage()); + } + finally + { + try + { + if(pstmt != null) + pstmt.close(); + } + catch(Exception ex) + {} + + pstmt = null; + } + + return bpartners; + } + + public static MBPartner saveBPartner(Properties ctx, int orgId, int partnerId,int parentBpId, String name, String name2, + boolean isCustomer,boolean isVendor,boolean isEmployee,boolean isSalesRep,String address1, + String address2, String postalAddress1, Integer regionId, String city,String bpPhone, String phone2, + String fax,int countryId, boolean isShipTo, boolean isBillTo, String trxName) throws OperationException, NoAccessToEditObjectException + { + MBPartner bPartner; + int locationId; + + if (partnerId == 0) + { + bPartner = new MBPartner(ctx, -1, trxName); // Using Template BPartner + locationId = 0; + } + else + { + bPartner = loadBPartner(ctx, partnerId, trxName); + + Boolean isEditable = RoleManager.isEditable(ctx, bPartner.getAD_Org_ID()); + + if (!isEditable) + throw new NoAccessToEditObjectException("You do not have the right organisational access for editing"); + + MBPartnerLocation[] bplocations = MBPartnerLocation.getForBPartner(ctx, partnerId); + + if (bplocations.length > 1) + throw new OperationException("Error: Business Partner has more than 1 location!"); + else if (bplocations.length == 0) + locationId = 0; + else + { + MBPartnerLocation bpLocation = bplocations[0]; + locationId = bpLocation.getC_Location_ID(); + } + } + + + bPartner.setValue(name + "_" + name2 + "_" + TrxPrefix.getPrefix() ); + bPartner.setName(name); + + bPartner.setName2(name2); + bPartner.setIsCustomer(isCustomer); + bPartner.setIsVendor(isVendor); + bPartner.setIsEmployee(isEmployee); + bPartner.setIsSalesRep(isSalesRep); + bPartner.setBPartner_Parent_ID(parentBpId); +// bPartner.setDescription(Constants.WEBSTORE_CUSTOMER); + bPartner.setAD_Org_ID(orgId); + bPartner.setSalesRep_ID(Env.getAD_User_ID(ctx));//required for dunning possible bug in Compiere + + PoManager.save(bPartner); + + MLocation location = LocationManager.saveLocation(ctx, orgId, locationId, address1, address2, postalAddress1,regionId, city,countryId, trxName); + + //We need to make the link of the billing address to the business partner + MBPartnerLocation bplocation = null; + + if (bPartner.getPrimaryC_BPartner_Location_ID() == 0) + bplocation = new MBPartnerLocation(bPartner); + else + bplocation = new MBPartnerLocation(ctx, bPartner.getPrimaryC_BPartner_Location_ID(), trxName); + + bplocation.setPhone(bpPhone); + bplocation.setPhone2(phone2); + bplocation.setFax(fax); + bplocation.setC_Location_ID(location.get_ID()); + bplocation.setIsShipTo(isShipTo); + bplocation.setIsBillTo(isBillTo); + bplocation.setAD_Org_ID(orgId); + + //UDIMBPartnerLocation udiBpLocation = new UDIMBPartnerLocation(bplocation); + //udiBpLocation.save(); + + PoManager.save(bplocation); + + + //Set the default location for the business partner + bPartner.setPrimaryC_BPartner_Location_ID(bplocation.get_ID()); + + //UDIMBPartner udiBPartner_defaultLocation = new UDIMBPartner(bPartner); + //udiBPartner_defaultLocation.save(); + PoManager.save(bPartner); + + return bPartner; + + } + public static MBPartner editBPartner(Properties ctx, int orgId, int bpartnerId, String name, String name2, boolean isCustomer, boolean isVendor, boolean isEmployee, boolean isSalesRep, + String address1, String address2, String postalAddress, String city, String phoneNo,String phone2, String fax, int regionId,String trxName) throws OperationException + { + + MBPartner bPartner = new MBPartner(ctx,bpartnerId,trxName); + + bPartner.setName(name); + bPartner.setName2(name2); + bPartner.setIsVendor(isVendor); + bPartner.setIsCustomer(isCustomer); + bPartner.setIsEmployee(isEmployee); + bPartner.setIsSalesRep(isSalesRep); + bPartner.setAD_Org_ID(orgId); + + if(bPartner.getSalesRep_ID()==0) + { + bPartner.setSalesRep_ID(Env.getAD_User_ID(ctx)); + } + + + MBPartnerLocation bpLocation = editPhoneAndFax(ctx,bpartnerId,phoneNo,phone2,fax, trxName); + + LocationManager.editLocation(ctx, bpLocation.getC_Location_ID(), address1, postalAddress, regionId, city, trxName); + + PoManager.save(bpLocation); + + PoManager.save(bPartner); + + return bPartner; + + } + + public static MBPartnerLocation editPhoneAndFax(Properties ctx, int bpId, String phone,String phone2, String fax, String trxName) throws OperationException + { + + if(bpId<=0) + throw new OperationException("BPartner does not exist"); + + MBPartner bp = new MBPartner(ctx, bpId, trxName); + MBPartnerLocation bpLocation; + + try + { + bpLocation = new MBPartnerLocation(ctx, bp.getPrimaryC_BPartner_Location_ID(),trxName); + + if(bpLocation==null) + throw new OperationException("BPartner Location does not exist"); + + bpLocation.setPhone(phone); + bpLocation.setPhone2(phone2); + bpLocation.setFax(fax); + bpLocation.setAD_Org_ID(bp.getAD_Org_ID()); + + PoManager.save(bpLocation); + + + } + catch(OperationException e) + { + throw new OperationException("Error: Could not edit phone and fax!!"); + + } + + + return bpLocation; + + } + + + public static ArrayList getCreditorsDebtors(Properties ctx, boolean queryCreditors, String trxName) throws OperationException + { + ArrayList bpList = new ArrayList(); + + StringBuffer sql = new StringBuffer("SELECT C_BPARTNER_ID,NAME,NAME2,ISCUSTOMER,ISVENDOR,TOTALOPENBALANCE,ACTUALLIFETIMEVALUE,so_creditlimit,so_creditused " + + " FROM C_BPARTNER WHERE ISACTIVE = 'Y' AND AD_CLIENT_ID = ?"); + + if(queryCreditors) + sql.append(" AND ISVENDOR = 'Y' " ); + else + sql.append(" AND ISCUSTOMER = 'Y' "); + + PreparedStatement pstmt = null; + ResultSet rs = null; + + try + { + pstmt = DB.prepareStatement(sql.toString(), trxName); + pstmt.setInt(1, Env.getAD_Client_ID(ctx)); + + rs = pstmt.executeQuery(); + + while(rs.next()) + { + BPartnerBean bean = new BPartnerBean(); + bean.setBpartnerId(rs.getInt(1)); + bean.setPartnerName(rs.getString(2)); + bean.setName2(rs.getString(3)); + bean.setIsCustomer("Y".equals(rs.getString(4))); + bean.setIsVendor("Y".equals(rs.getString(5))); + bean.setActualLifetimeValue(rs.getBigDecimal(7)); + bean.setCreditLimit(rs.getBigDecimal(8)); + bean.setCreditUsed(rs.getBigDecimal(9)); + + BigDecimal openBalance = rs.getBigDecimal(6); + if(openBalance == null) + { + openBalance = Env.ZERO; + } + + if(queryCreditors) + { + openBalance = openBalance.negate(); + } + + bean.setOpenBalance(openBalance); + + bpList.add(bean); + } + + } + catch (Exception e) + { + throw new OperationException(e); + } + finally + { + DBUtils.close(rs); + DBUtils.close(pstmt); + } + + return bpList; + + } + + public static ArrayList getCreditorsHistory(Properties ctx, int c_bpartner_id, Timestamp startDate, Timestamp endDate, String trxName) + { + StringBuffer sb = new StringBuffer( + " SELECT * FROM ( " + + " SELECT C_INVOICE.CREATED AS DATETRX,C_INVOICE.DOCUMENTNO AS REFERENCE,C_DOCTYPE.NAME AS DETAILS,C_INVOICE.GRANDTOTAL AS AMT, C_INVOICE.C_ORDER_ID AS ID " + + " FROM C_INVOICE " + + " INNER JOIN C_DOCTYPE ON C_INVOICE.C_DOCTYPE_ID = C_DOCTYPE.C_DOCTYPE_ID " + + " WHERE C_INVOICE.C_BPARTNER_ID = ? " + + " AND C_INVOICE.DOCSTATUS IN ('CO','CL') " + + " AND C_DOCTYPE.NAME = 'AP Invoice' " + + " UNION " + + " SELECT C_INVOICE.CREATED AS DATETRX,C_INVOICE.DOCUMENTNO AS REFERENCE,C_DOCTYPE.NAME AS DETAILS,C_INVOICE.GRANDTOTAL AS AMT, C_INVOICE.C_ORDER_ID AS ID " + + " FROM C_INVOICE " + + " INNER JOIN C_DOCTYPE ON C_INVOICE.C_DOCTYPE_ID = C_DOCTYPE.C_DOCTYPE_ID " + + " WHERE C_INVOICE.C_BPARTNER_ID = ? " + + " AND C_INVOICE.DOCSTATUS IN ('CO','CL') " + + " AND C_DOCTYPE.NAME = 'AP CreditMemo' " + + " UNION " + + " SELECT C_PAYMENT.CREATED,C_PAYMENT.C_PAYMENT_ID || '' AS REFERENCE ,C_DOCTYPE.NAME AS DETAILS,C_PAYMENT.PAYAMT + C_PAYMENT.DISCOUNTAMT + C_PAYMENT.WRITEOFFAMT AS AMT,C_PAYMENT.C_PAYMENT_ID AS ID " + + " FROM C_PAYMENT " + + " INNER JOIN C_DOCTYPE ON C_PAYMENT.C_DOCTYPE_ID = C_DOCTYPE.C_DOCTYPE_ID " + + " WHERE C_PAYMENT.C_BPARTNER_ID = ? " + + " AND C_PAYMENT.DOCSTATUS IN ('CO','CL') " + + " AND C_DOCTYPE.NAME = 'AP Payment' " + + " UNION " + + " SELECT C_INVOICE.CREATED AS DATETRX,C_CASHLINE.C_CASHLINE_ID || '' AS REFERENCE,'AP Payment - Cash' AS DETAILS,0 - (C_CASHLINE.AMOUNT + C_CASHLINE.DISCOUNTAMT + C_CASHLINE.WRITEOFFAMT) AS AMT,C_CASHLINE.C_CASHLINE_ID AS ID " + + " FROM C_INVOICE " + + " INNER JOIN C_CASHLINE ON (C_CASHLINE.C_INVOICE_ID = C_INVOICE.C_INVOICE_ID) " + + " INNER JOIN C_CASH ON (C_CASH.C_CASH_ID = C_CASHLINE.C_CASH_ID AND C_CASH.DOCSTATUS IN ('CO','CL')) " + + " INNER JOIN C_DOCTYPE ON C_INVOICE.C_DOCTYPE_ID = C_DOCTYPE.C_DOCTYPE_ID " + + " WHERE C_INVOICE.C_BPARTNER_ID = ? " + + " AND C_INVOICE.DOCSTATUS IN ('CO','CL') " + + " AND C_DOCTYPE.NAME = 'AP Invoice' " + + " ) AS HISTORY ORDER BY DATETRX ASC, DETAILS ASC"); + + PreparedStatement pstmt = null; + ResultSet rs = null; + + BigDecimal balance = Env.ZERO; + ArrayList reportData = new ArrayList(); + + try + { + pstmt = DB.prepareStatement(sb.toString(), trxName); + pstmt.setInt(1, c_bpartner_id); + pstmt.setInt(2, c_bpartner_id); + pstmt.setInt(3, c_bpartner_id); + pstmt.setInt(4, c_bpartner_id); + + rs = pstmt.executeQuery(); + + //int previousMonth = -2; // + + while(rs.next()) + { + Timestamp date = rs.getTimestamp(1); + String reference = rs.getString(2); + String docType = rs.getString(3); + BigDecimal amount = rs.getBigDecimal(4); + BigDecimal credit = Env.ZERO; + BigDecimal debit = Env.ZERO; + int docId = rs.getInt(5); + + + if(docType.startsWith("AP Payment") || docType.equalsIgnoreCase("AP CreditMemo")) + { + credit = amount; + balance = balance.subtract(amount); + } + else + { + debit = amount; + balance = balance.add(amount); + } + + String details = ""; + String table = "Order"; + + if(docType.equalsIgnoreCase("AP Payment")) + { + details = "PAYMENT"; + table = "Payment"; + } + else if(docType.equalsIgnoreCase("AP Payment - Cash")) + { + details = "PAYMENT"; + table = "CashLine"; + } + else if(docType.equalsIgnoreCase("AP CreditMemo")) + { + details = "Account Returns"; + } + else if(docType.equalsIgnoreCase("AP Invoice")) + { + details = "Account Purchases"; + } + else + { + details = docType; + } + + StatementOfAccountBean bean = new StatementOfAccountBean(); + bean.setDate(date); + bean.setReference(reference); + bean.setDocType(table); + bean.setDetails(details); + bean.setDebit(debit); + bean.setCredit(credit); + bean.setBalance(balance); + bean.setDocId(docId); + + reportData.add(bean); + } + + } + catch (SQLException e) + { + // TODO Auto-generated catch block + e.printStackTrace(); + } + finally + { + DB.close(rs, pstmt); + } + + return reportData; + } + + public static ArrayList getDebtorsHistory(Properties ctx, int c_bpartner_id, Timestamp startDate, Timestamp endDate, String trxName) + { + StringBuffer sb = new StringBuffer( + " SELECT * FROM ( " + + " SELECT C_INVOICE.CREATED AS DATETRX,C_INVOICE.DOCUMENTNO AS REFERENCE,C_DOCTYPE.NAME AS DETAILS,C_INVOICE.GRANDTOTAL AS AMT, C_INVOICE.C_ORDER_ID AS ID " + + " FROM C_INVOICE " + + " INNER JOIN C_DOCTYPE ON C_INVOICE.C_DOCTYPE_ID = C_DOCTYPE.C_DOCTYPE_ID " + + " WHERE C_INVOICE.C_BPARTNER_ID = ? " + + " AND C_INVOICE.DOCSTATUS IN ('CO','CL') " + + " AND C_DOCTYPE.NAME = 'AR Invoice' " + + " UNION " + + " SELECT C_INVOICE.CREATED AS DATETRX,C_INVOICE.DOCUMENTNO AS REFERENCE,C_DOCTYPE.NAME AS DETAILS,C_INVOICE.GRANDTOTAL AS AMT, C_INVOICE.C_ORDER_ID AS ID " + + " FROM C_INVOICE " + + " INNER JOIN C_DOCTYPE ON C_INVOICE.C_DOCTYPE_ID = C_DOCTYPE.C_DOCTYPE_ID " + + " WHERE C_INVOICE.C_BPARTNER_ID = ? " + + " AND C_INVOICE.DOCSTATUS IN ('CO','CL') " + + " AND C_DOCTYPE.NAME = 'AR Credit Memo' " + + " UNION " + + " SELECT C_PAYMENT.CREATED,C_PAYMENT.C_PAYMENT_ID || '' AS REFERENCE ,C_DOCTYPE.NAME AS DETAILS,C_PAYMENT.PAYAMT + C_PAYMENT.DISCOUNTAMT + C_PAYMENT.WRITEOFFAMT AS AMT,C_PAYMENT.C_PAYMENT_ID AS ID " + + " FROM C_PAYMENT " + + " INNER JOIN C_DOCTYPE ON C_PAYMENT.C_DOCTYPE_ID = C_DOCTYPE.C_DOCTYPE_ID " + + " WHERE C_PAYMENT.C_BPARTNER_ID = ? " + + " AND C_PAYMENT.DOCSTATUS IN ('CO','CL') " + + " AND C_DOCTYPE.NAME = 'AR Receipt' " + + " UNION " + + " SELECT C_INVOICE.CREATED AS DATETRX,C_CASHLINE.C_CASHLINE_ID || '' AS REFERENCE,'AR Receipt - Cash' AS DETAILS,C_CASHLINE.AMOUNT + C_CASHLINE.DISCOUNTAMT + C_CASHLINE.WRITEOFFAMT AS AMT,C_CASHLINE.C_CASHLINE_ID AS ID " + + " FROM C_INVOICE " + + " INNER JOIN C_CASHLINE ON (C_CASHLINE.C_INVOICE_ID = C_INVOICE.C_INVOICE_ID) " + + " INNER JOIN C_CASH ON (C_CASH.C_CASH_ID = C_CASHLINE.C_CASH_ID AND C_CASH.DOCSTATUS IN ('CO','CL')) " + + " INNER JOIN C_DOCTYPE ON C_INVOICE.C_DOCTYPE_ID = C_DOCTYPE.C_DOCTYPE_ID " + + " WHERE C_INVOICE.C_BPARTNER_ID = ? " + + " AND C_INVOICE.DOCSTATUS IN ('CO','CL') " + + " AND C_DOCTYPE.NAME = 'AR Invoice' " + + " ) AS HISTORY ORDER BY DATETRX ASC, DETAILS ASC"); + + PreparedStatement pstmt = null; + ResultSet rs = null; + + BigDecimal balance = Env.ZERO; + ArrayList reportData = new ArrayList(); + + try + { + pstmt = DB.prepareStatement(sb.toString(), trxName); + pstmt.setInt(1, c_bpartner_id); + pstmt.setInt(2, c_bpartner_id); + pstmt.setInt(3, c_bpartner_id); + pstmt.setInt(4, c_bpartner_id); + + rs = pstmt.executeQuery(); + + //int previousMonth = -2; // + + while(rs.next()) + { + Timestamp date = rs.getTimestamp(1); + String reference = rs.getString(2); + String docType = rs.getString(3); + BigDecimal amount = rs.getBigDecimal(4); + BigDecimal credit = Env.ZERO; + BigDecimal debit = Env.ZERO; + int docId = rs.getInt(5); + + + if(docType.startsWith("AR Receipt") || docType.equalsIgnoreCase("AR Credit Memo")) + { + debit = amount; + balance = balance.subtract(amount); + } + else + { + credit = amount; + balance = balance.add(amount); + } + + String details = ""; + String table = "Order"; + + if(docType.equalsIgnoreCase("AR Receipt")) + { + details = "PAYMENT"; + table = "Payment"; + } + else if(docType.equalsIgnoreCase("AR Receipt - Cash")) + { + details = "PAYMENT"; + table = "CashLine"; + } + else if(docType.equalsIgnoreCase("AR Credit Memo")) + { + details = "Account Returns"; + } + else if(docType.equalsIgnoreCase("AR Invoice")) + { + details = "Account Sales"; + } + else + { + details = docType; + } + + StatementOfAccountBean bean = new StatementOfAccountBean(); + bean.setDate(date); + bean.setReference(reference); + bean.setDocType(table); + bean.setDetails(details); + bean.setDebit(debit); + bean.setCredit(credit); + bean.setBalance(balance); + bean.setDocId(docId); + + reportData.add(bean); + } + + } + catch (SQLException e) + { + // TODO Auto-generated catch block + e.printStackTrace(); + } + finally + { + DB.close(rs, pstmt); + } + + return reportData; + } + +} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/administration/BarcodeManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/administration/BarcodeManager.java new file mode 100644 index 0000000000..644cb8729f --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/businesslogic/administration/BarcodeManager.java @@ -0,0 +1,477 @@ +/** + * Product: Posterita Web-Based POS (an Adempiere Plugin) + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +/** + @author Praveen Beekoo + */ + +package org.posterita.businesslogic.administration; + +import java.awt.image.BufferedImage; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStream; +import java.io.PrintWriter; +import java.io.StringWriter; +import java.math.BigDecimal; +import java.text.DecimalFormat; +import java.util.ArrayList; +import java.util.Properties; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import net.sourceforge.barbecue.formatter.BarcodeFormatter; + +import org.apache.ecs.xhtml.sub; +import org.compiere.model.MProduct; +import org.compiere.model.MSequence; +import org.compiere.util.Env; +import org.krysalis.barcode4j.impl.AbstractBarcodeBean; +import org.krysalis.barcode4j.impl.code128.Code128Bean; +import org.krysalis.barcode4j.output.bitmap.BitmapCanvasProvider; +import org.krysalis.barcode4j.tools.UnitConv; + +import org.posterita.Constants; +import org.posterita.beans.CheckoutBean; +import org.posterita.beans.CustomerBean; +import org.posterita.beans.ItemBean; +import org.posterita.beans.PrintBarcodeBean; +import org.posterita.businesslogic.CustomerCart; +import org.posterita.businesslogic.OrderManager; +import org.posterita.businesslogic.performanceanalysis.ReportManager; +import org.posterita.core.RandomStringGenerator; +import org.posterita.exceptions.OperationException; + +public class BarcodeManager +{ + public static final String BARCODE_PREFIX = "609789"; + public static final String SEQUENCE_NAME = "Barcode Sequence"; + public static boolean showPrice = true; + public static boolean showTitle = true; + public static boolean showSubtitle = true; + + public static String saveBarcode(String barcode) throws OperationException + { + try + { + //Create the barcode bean + Code128Bean bean = new Code128Bean(); + + final int dpi = 400; + + //Configure the barcode generator + bean.setModuleWidth(UnitConv.in2mm(1.0f / dpi)); //makes the narrow bar + //width exactly one pixel + bean.doQuietZone(false); + bean.setBarHeight(1.5d); + bean.setFontSize(1); + bean.setFontName("Helvetica"); + + //Open output file + String filename = RandomStringGenerator.randomstring() + ".png"; + String filepath = ReportManager.getReportPath(filename); + + File outputFile = new File(filepath); + OutputStream out = new FileOutputStream(outputFile); + + //Set up the canvas provider for monochrome JPEG output + BitmapCanvasProvider canvas = new BitmapCanvasProvider( + out, "image/x-png", dpi, BufferedImage.TYPE_BYTE_BINARY, false); + + //Generate the barcode + bean.generateBarcode(canvas, barcode); + + //Signal end of generation + canvas.finish(); + + out.close(); + + return filename; + } + catch (Exception e) + { + throw new OperationException(e); + } + + } + + public static void writeBarcode(String barcode,HttpServletResponse response) throws OperationException + { + try + { + //Create the barcode bean + AbstractBarcodeBean bean = new Code128Bean(); + + final int dpi = 400; + + //Configure the barcode generator + bean.setModuleWidth(UnitConv.in2mm(1.0f / dpi)); //makes the narrow bar + //width exactly one pixel + bean.doQuietZone(false); + bean.setBarHeight(2.0d); + bean.setFontSize(1.0d); + bean.setFontName("Helvetica"); + + //writing the image to the response + OutputStream out = response.getOutputStream(); + response.setContentType("image/x-png"); + + //Set up the canvas provider for monochrome JPEG output + BitmapCanvasProvider canvas = new BitmapCanvasProvider( + out, "image/x-png", dpi, BufferedImage.TYPE_BYTE_BINARY, false); + + //Generate the barcode + bean.generateBarcode(canvas, barcode); + + //Signal end of generation + canvas.finish(); + + out.flush(); + out.close(); + } + catch (IOException e) + { + throw new OperationException(e); + } + + } + + public static byte[] getBarcodeAsByte(String barcode) throws OperationException + { + ByteArrayOutputStream baos= new ByteArrayOutputStream(); + + try + { + //Create the barcode bean + AbstractBarcodeBean bean = new Code128Bean(); + + final int dpi = 400; + + //Configure the barcode generator + bean.setModuleWidth(UnitConv.in2mm(1.0f / dpi)); //makes the narrow bar + //width exactly one pixel + bean.doQuietZone(false); + bean.setBarHeight(1.5d); + bean.setFontSize(1); + bean.setFontName("Helvetica"); + + //writing the image to outputstream + + //Set up the canvas provider for monochrome JPEG output + BitmapCanvasProvider canvas = new BitmapCanvasProvider( + baos, "image/x-png", dpi, BufferedImage.TYPE_BYTE_BINARY, false); + + //Generate the barcode + bean.generateBarcode(canvas, barcode); + + //Signal end of generation + canvas.finish(); + + baos.flush(); + baos.close(); + } + catch (IOException e) + { + throw new OperationException(e); + } + + + return baos.toByteArray(); + } + + public static MSequence getBarcodeSequence(Properties ctx, String trxName) throws OperationException + { + MSequence sequence = null; + + String whereClause = " name = '" + SEQUENCE_NAME + "'" + + " and ad_client_id =" + Env.getAD_Client_ID(ctx) + + " and ad_org_id =" + Env.getAD_Org_ID(ctx); + + int[] ids = MSequence.getAllIDs(MSequence.Table_Name, whereClause, trxName); + + if( ( ids ==null ) || ( ids.length == 0 ) ) + { + sequence = new MSequence(ctx, 0, trxName); + + sequence.setName(SEQUENCE_NAME); + sequence.setPrefix(BARCODE_PREFIX); + sequence.setIsAutoSequence(true); + sequence.setIncrementNo(1); + sequence.setIsTableID(false); + sequence.setCurrentNext(1000000); + + boolean isSaved = sequence.save(); + + if( !isSaved) + { + throw new OperationException("Unable to create barcode sequence"); + } + } + else + { + sequence = new MSequence(ctx, ids[0], trxName); + } + + return sequence; + } + + /** + * Print Product Barcode + * @param ctx + * @param request + * @param trxName + * @return + * @throws OperationException + */ + public static String printProductBarcode(Properties ctx, HttpServletRequest request, boolean isPrintProductName, boolean isPrintProductDescription, boolean isPrintPrices, String trxName) throws OperationException + { + ArrayList items = (ArrayList) request.getSession().getAttribute(Constants.BARCODE_CART_ITEMS); + StringBuffer barcodeData = new StringBuffer(); + int m_product_id = 0; + String productName = ""; + BigDecimal qty = Env.ZERO; + BigDecimal price = Env.ZERO; + BigDecimal unitSalePrice = Env.ZERO; + + + for(int i=0; i= 23) + { + + for(int j=0; j= 23) + { + for(int n=0; n customerList =null; + CustomerCart customerCart = cart; + + if(customerCart != null) + { + customerList = cart.getCustomers(); + + } + else + { + customerList = new ArrayList(); + } + + StringBuffer barcodeData = new StringBuffer(); + int bpartnerId = 0; + + + for(int i=0; i getAllBlackListed(Properties ctx) throws OperationException + { + ArrayList list= new ArrayList(); + String sql=getBlackListedsql(ctx); + + PreparedStatement pstmt = DB.prepareStatement(sql, null); + ResultSet rs = null; + BlackListedBean bean= null; + try + { + rs=pstmt.executeQuery(); + + while(rs.next()) + { + bean=new BlackListedBean(); + bean.setBlackListedBankName(rs.getString(1)); + bean.setBlackListedChequeNo(rs.getString(2)); + bean.setBlackListedId(rs.getInt(3)); + + list.add(bean); + } + rs.close(); + } + catch(SQLException e) + { + throw new OperationException(e); + } + finally + { + try + { + pstmt.close(); + } + catch(Exception e) + { + } + pstmt=null; + } + return list; + } + private static String getBlackListedsql(Properties ctx) + { + int ad_client_id = Env.getAD_Client_ID(ctx); + + StringBuffer strBufSQL = new StringBuffer(); + + strBufSQL.append("select bl.bankName, bl.chequeNo, bl.U_BLACKLISTCHEQUE_ID"); + strBufSQL.append(" from U_BLACKLISTCHEQUE bl"); + strBufSQL.append(" where ad_client_id = " + ad_client_id ); + strBufSQL.append(" and ad_ORG_ID in (" + Env.getContext(ctx,UdiConstants.ROLE_EDITABLE_ORGS_CTX_PARAM)+")"); + + + return strBufSQL.toString(); + } + + public static ArrayList searchChequeNo(Properties ctx, String chequeNo) throws OperationException + { + ArrayList list = new ArrayList(); + + int ad_client_id = Env.getAD_Client_ID(ctx); + + String sql = " select" + + " bl.bankName," + //1.BankName + " bl.chequeNo," +//2.ChequeNo + " bl.U_BLACKLISTCHEQUE_ID" +//3.ID + " from U_BLACKLISTCHEQUE bl" + + " where ad_client_id = " + ad_client_id + + "and bl.isActive = 'Y'"+ + " and ad_ORG_ID in (" + Env.getContext(ctx,UdiConstants.ROLE_EDITABLE_ORGS_CTX_PARAM)+") "; + + if(chequeNo != null && chequeNo.length() != 0) + sql += " and ( lower(bl.chequeNo) like lower('%" + chequeNo + "%')) "; + + sql += " order by bl.chequeNo" ; + + + PreparedStatement pstmt = DB.prepareStatement(sql,null); + ResultSet rs = null; + + BlackListedBean bean = null; + + try + { + rs = pstmt.executeQuery(); + + while(rs.next()) + { + bean = new BlackListedBean(); + + //set bean + bean.setBlackListedBankName(rs.getString(1)); + bean.setBlackListedChequeNo(rs.getString(2)); + bean.setBlackListedId(rs.getInt(3)); + + list.add(bean); + } + rs.close(); + } + catch (SQLException e) + { + throw new OperationException(e); + } + finally + { + try + { + pstmt.close(); + } + catch(Exception ex){} + + pstmt = null; + } + + return list; + + } + + public static BlackListedBean getBlackListedDetails(Properties ctx, int blackListedId) throws OperationException,BPartnerNotFoundException + { +// if (blackListedId == 0) +// throw new OperationException("BlackListed details not found. Please contact your administrator."); + + + int id[] = MBlackListCheque.getAllIDs(MBlackListCheque.Table_Name,"U_BLACKLISTCHEQUE_ID="+blackListedId,null); + + if((id==null)||(id.length==0)) + { + throw new BPartnerNotFoundException("Could not find Cheque with id :"+blackListedId); + } + + MBlackListCheque blacklisted = new MBlackListCheque(ctx, blackListedId, null); + BlackListedBean bean = new BlackListedBean(); + bean.setBlackListedBankName(blacklisted.getBankName()); + bean.setBlackListedChequeNo(blacklisted.getChequeNo()); + bean.setBlackListedId(blackListedId); + + +// MUser user=null; +// int userIds [] =MUser.getAllIDs(MUser.Table_Name,"AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+" and C_BPARTNER_ID="+partner.getID(),null); +// if(userIds.length==0) +// { +// user = new MUser(ctx,0,null); +// user.setName(partner.getName()); +// +// } +// else +// { +// user = new MUser(ctx,userIds[0],null); +// } + return bean; + } + + public static void deactivateBListedCheque(Properties ctx, int blackListedId, String trxName) throws OperationException + { + + MBlackListCheque blackListed = new MBlackListCheque(ctx, blackListedId, trxName); + + if(blackListed == null)throw new OperationException("Business Partner does not exist!"); + + blackListed.setIsActive(false); + + blackListed.save(); + + } + + + + + +} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/administration/CheckSequenceManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/administration/CheckSequenceManager.java new file mode 100644 index 0000000000..a9c462d0dc --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/businesslogic/administration/CheckSequenceManager.java @@ -0,0 +1,51 @@ +/** + * Product: Posterita Web-Based POS (an Adempiere Plugin) + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +/** + @author Alok Pathak + */ + +package org.posterita.businesslogic.administration; + +import java.util.Properties; + +import org.compiere.process.ProcessInfo; +import org.compiere.process.SequenceCheck; + +import org.posterita.exceptions.SequenceUpdateException; + + +public class CheckSequenceManager { + +// private static final int TABLE_ID=115; + private static final int PROCESS_ID=258; + + public static void runProcess(Properties ctx) throws SequenceUpdateException + { + ProcessInfo poInfo = new ProcessInfo("Sequencecheck",PROCESS_ID); + SequenceCheck seqCheck = new SequenceCheck(); + boolean success= seqCheck.startProcess(ctx, poInfo,null); + + if(success==false) + throw new SequenceUpdateException("Sequence not updated"); + } + + +} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/administration/CommissionManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/administration/CommissionManager.java new file mode 100644 index 0000000000..11a456ae70 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/businesslogic/administration/CommissionManager.java @@ -0,0 +1,349 @@ +/** + * Product: Posterita Web-Based POS (an Adempiere Plugin) + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +/** + @author Alok Pathak + */ + +package org.posterita.businesslogic.administration; + +import java.math.BigDecimal; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.Properties; + +import org.compiere.model.MCharge; +import org.compiere.model.MCommission; +import org.compiere.model.MCommissionLine; +import org.compiere.model.MPInstance; +import org.compiere.process.CommissionCalc; +import org.compiere.process.ProcessInfo; +import org.compiere.process.ProcessInfoParameter; +import org.compiere.util.DB; +import org.compiere.util.Env; +import org.posterita.beans.CommissionBean; +import org.posterita.businesslogic.POSTerminalManager; +import org.posterita.businesslogic.performanceanalysis.CSVReportManager; +import org.posterita.core.TimestampConvertor; +import org.posterita.exceptions.InvalidDateTimeException; +import org.posterita.exceptions.OperationException; +import org.posterita.factory.SystemObjectsFactory; +import org.posterita.util.PoManager; + + +public class CommissionManager +{ + private static final int GENERATE_COMMISSION_PROCESS_ID=123; + private static final String CHARGE_NAME="Commission Charge"; + + public static void getCreateCommission(Properties ctx,String name,int partnerId,String docBasisType,BigDecimal amtMultiplier,String frequency,BigDecimal subtractAmt,String trxName) throws OperationException + { + int [] commissionIds = MCommission.getAllIDs(MCommission.Table_Name," AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+" and C_BPARTNER_ID="+partnerId+" and isActive='Y'",null); + if(commissionIds!=null && commissionIds.length>1) + throw new OperationException("Sales rep has more than one commission"+ commissionIds.length); + + MCommission com; + MCommissionLine comLine; + if(commissionIds==null || commissionIds.length<1) + { + com = new MCommission(ctx,0,trxName); + comLine = new MCommissionLine(ctx,0,trxName); + } + else + { + com = new MCommission(ctx,commissionIds[0],trxName); + MCommissionLine [] line =com.getLines(); + if(line.length!=1) + throw new OperationException("either No commissionLine or more than One commission Line has bean defined for this bPartner"); + comLine = new MCommissionLine(ctx,line[0].get_ID(),trxName); + } + com.setC_Charge_ID(getCreateCommissionCharge(ctx)); + com.setName(name); + com.setC_BPartner_ID(partnerId); + com.setFrequencyType(frequency); + com.setC_Currency_ID(POSTerminalManager.getCurrencyOfTerminalCashBook(ctx).get_ID()); + com.setDocBasisType(docBasisType); + com.setListDetails(true); + PoManager.save(com); + + + + comLine.setC_Commission_ID(com.get_ID()); + comLine.setAmtMultiplier(amtMultiplier.divide(new BigDecimal(100))); + comLine.setDescription(name); + comLine.setCommissionOrders(true); + comLine.setIsPositiveOnly(true); + if(subtractAmt!=null) + comLine.setAmtSubtract(subtractAmt); + PoManager.save(comLine); + + } + + private static int getCreateCommissionCharge(Properties ctx) throws OperationException + { + int chargeIds [] = MCharge.getAllIDs(MCharge.Table_Name,"AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+" and name='"+CHARGE_NAME+"'",null); + + if(chargeIds.length<1) + { + MCharge charge = new MCharge(ctx,0,null); + charge.setName(CHARGE_NAME); + charge.setChargeAmt(new BigDecimal(0)); + charge.setC_TaxCategory_ID(SystemObjectsFactory.getFactoryInstance().get(ctx,SystemObjectsFactory.TAX_CATEGORY_DEFAULT_ID).get_ID()); + + PoManager.save(charge); + + return charge.get_ID(); + } + else + { + return chargeIds[0]; + } + } + + public static void generateCommission(Properties ctx, Timestamp date) throws OperationException, InvalidDateTimeException + { +// deleteComAmtTableData(ctx); + int commissionIds [] = MCommission.getAllIDs(MCommission.Table_Name," AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+" and isActive='Y'",null); + if(commissionIds!=null && commissionIds.length>0) + for(int i=0;i getCommissionAmt(Properties ctx) throws OperationException + { + + String sql="select camt.C_COMMISSIONAMT_ID," +//1 + " camt.C_COMMISSIONRUN_ID," +//2 + "camt.C_COMMISSIONLINE_ID," +//3 + "camt.CONVERTEDAMT," +//4 + "camt.ACTUALQTY," +//5 + "camt.COMMISSIONAMT," +//6 + "cline.DESCRIPTION," +//7 + //"DECODE(com.FREQUENCYTYPE,'"+MCommission.FREQUENCYTYPE_Monthly+"','Monthly','"+ + "CASE WHEN com.FREQUENCYTYPE='"+MCommission.FREQUENCYTYPE_Monthly+"' THEN 'Monthly' "+ + //MCommission.FREQUENCYTYPE_Quarterly+"','Quarterly','"+ + " WHEN com.FREQUENCYTYPE='"+MCommission.FREQUENCYTYPE_Quarterly+"' THEN 'Quarterly' "+ + //MCommission.FREQUENCYTYPE_Weekly+"','Weekly','"+ + " WHEN com.FREQUENCYTYPE='"+MCommission.FREQUENCYTYPE_Weekly+"' THEN 'Weekly' "+ + //MCommission.FREQUENCYTYPE_Yearly+"','Yearly',com.FREQUENCYTYPE) frequency," +//8 + " WHEN com.FREQUENCYTYPE='"+MCommission.FREQUENCYTYPE_Yearly+"' THEN 'Yearly' ELSE com.FREQUENCYTYPE END AS frequency," +//8 + //"DECODE(com.DOCBASISTYPE,'"+MCommission.DOCBASISTYPE_Invoice+"','Invoice','"+ + "CASE WHEN com.DOCBASISTYPE ='"+MCommission.DOCBASISTYPE_Invoice+"' THEN 'Invoice' "+ + //MCommission.DOCBASISTYPE_Order+"','Order','"+ + " WHEN com.DOCBASISTYPE ='"+MCommission.DOCBASISTYPE_Order+"' THEN 'Order' "+ + //MCommission.DOCBASISTYPE_Receipt+"','Payment Receipt',com.DOCBASISTYPE) docbasis," +//9 + " WHEN com.DOCBASISTYPE ='"+MCommission.DOCBASISTYPE_Receipt+"' THEN 'Payment Receipt' ELSE com.DOCBASISTYPE END AS docbasis," +//9 + "cline.AMTMULTIPLIER*100, "+//10 + "crun.DESCRIPTION,"+//11 + //"nvl(cline.AMTSUBTRACT,0)"+//12 + "COALESCE(cline.AMTSUBTRACT,0)"+//12 + " from C_COMMISSIONAMT camt, C_COMMISSIONLINE cline,C_COMMISSION com,C_COMMISSIONRUN crun " + + " where camt.C_COMMISSIONLINE_ID=cline.C_COMMISSIONLINE_ID"+ + " and cline.C_COMMISSION_ID=com.C_COMMISSION_ID"+ + " and camt.C_COMMISSIONRUN_ID=crun.C_COMMISSIONRUN_ID"+ + " and camt.AD_CLIENT_ID="+Env.getAD_Client_ID(ctx); + + PreparedStatement pstmt = DB.prepareStatement(sql,null); + CommissionBean bean=null; + ArrayList list = new ArrayList(); + + + + + try + { + + ResultSet rs= pstmt.executeQuery(); + + if(rs.next()) + { + bean=new CommissionBean(); + bean.setCommissionAmtId(rs.getInt(1)); + bean.setCommissionRunId(rs.getInt(2)); + bean.setCommissionLineId(rs.getInt(3)); + bean.setConvertedAmt(rs.getBigDecimal(4)); + bean.setActualQty(rs.getBigDecimal(5)); + bean.setCommissionAmt(rs.getBigDecimal(6)); + bean.setCommissionLineName(rs.getString(7)); + bean.setFrequencyType(rs.getString(8)); + bean.setDocBasisType(rs.getString(9)); + bean.setAmtMultiplier(rs.getBigDecimal(10)); + bean.setPeriodAndCurrencyDesc(rs.getString(11)); + bean.setSubtractAmt(rs.getBigDecimal(12)); + list.add(bean); + + } + rs.close(); + } + catch (SQLException e) + { + throw new OperationException(e); + } + finally + { + try + { + pstmt.close(); + } + catch (SQLException e) + { + + + } + } + return list; + } + + + + public static ArrayList getCommissionDetails(Properties ctx, int commissionAmtId) throws OperationException + { + String sql=" select det.C_COMMISSIONDETAIL_ID," +//1 + "det.C_COMMISSIONAMT_ID," +//2 + " det.REFERENCE ," +//3 + " det.C_ORDERLINE_ID," +//4 + "det.C_INVOICELINE_ID," +//5 + " det.INFO," +//6 + "det.C_CURRENCY_ID," +//7 + "det.ACTUALAMT," +//8 + "det.CONVERTEDAMT," +//9 + " det.ACTUALQTY, " +//10 + "inv.C_INVOICE_ID,"+//11 + " ord.C_ORDER_ID"+//12 + " from c_invoiceLine inv left outer join (C_COMMISSIONDETAIL det left outer join c_orderLine ord on det.C_ORDERLINE_ID=ord.C_ORDERLINE_ID ) on det.C_INVOICELINE_ID=inv.C_INVOICELINE_ID "+ + " where det.AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+ + //" and det.C_INVOICELINE_ID=inv.C_INVOICELINE_ID(+)"+ + //" and det.C_ORDERLINE_ID=ord.C_ORDERLINE_ID(+)"+ + " and det.C_COMMISSIONAMT_ID="+commissionAmtId; + + PreparedStatement pstmt = DB.prepareStatement(sql,null); + + CommissionBean bean=null; + ArrayList list = new ArrayList(); + try + { + ResultSet rs= pstmt.executeQuery(); + + while(rs.next()) + { + bean=new CommissionBean(); + bean.setCommissionDetailId(rs.getInt(1)); + bean.setCommissionAmtId(rs.getInt(2)); + bean.setReference(rs.getString(3)); + bean.setOrderLineId(rs.getInt(4)); + bean.setInvoiceLineId(rs.getInt(5)); + bean.setInfo(rs.getString(6)); + bean.setCurrencyId(rs.getInt(7)); + bean.setActualAmt(rs.getBigDecimal(8)); + bean.setConvertedAmt(rs.getBigDecimal(9)); + bean.setActualQty(rs.getBigDecimal(10)); + bean.setInvoiceId(rs.getInt(11)); + bean.setOrderId(rs.getInt(12)); + + list.add(bean); + } + rs.close(); + } + catch (SQLException e) + { + throw new OperationException(e); + } + finally + { + try + { + pstmt.close(); + } + catch (SQLException e) + { + + + } + } + return list; + } + + public static String getCommissionAmtAsCSV(Properties ctx, ArrayList commissionList) throws OperationException + { + ArrayList reportData = new ArrayList(); + + // adding column header + Object[] headers = new Object[]{ + "Name", + "Calculation Period And Curr.", + "Total Amount", + "Substract Amount", + "Commission Amount", + "Qty", + "Frequency Type", + "Doc Basis Type", + "Rate %"}; + + reportData.add(headers); + + //adding data records + Object[] data = null; + + for(CommissionBean bean : commissionList) + { + data = new Object[]{ + bean.getCommissionLineName(), + bean.getPeriodAndCurrencyDesc(), + bean.getConvertedAmt(), + bean.getSubtractAmt(), + bean.getCommissionAmt(), + bean.getActualQty(), + bean.getFrequencyType(), + bean.getDocBasisType(), + bean.getAmtMultiplier() + }; + + reportData.add(data); + } + + //generate CSV + String reportName = CSVReportManager.generateCSVReport(ctx,reportData); + + return reportName; + } + +} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/administration/CustomerManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/administration/CustomerManager.java new file mode 100644 index 0000000000..db5556b4ba --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/businesslogic/administration/CustomerManager.java @@ -0,0 +1,1270 @@ +/** + * Product: Posterita Web-Based POS (an Adempiere Plugin) + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +/** + @author Alok Pathak + */ + +package org.posterita.businesslogic.administration; + +import java.awt.Color; +import java.io.FileOutputStream; +import java.io.IOException; +import java.math.BigDecimal; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Timestamp; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Collections; +import java.util.Comparator; +import java.util.Date; +import java.util.Properties; +import java.util.StringTokenizer; + +import org.compiere.model.MBPBankAccount; +import org.compiere.model.MBPartner; +import org.compiere.model.MBPartnerLocation; +import org.compiere.model.MBank; +import org.compiere.model.MCountry; +import org.compiere.model.MLocation; +import org.compiere.model.MOrg; +import org.compiere.model.MPaymentTerm; +import org.compiere.model.MRegion; +import org.compiere.model.MUser; +import org.compiere.model.X_I_BPartner; +import org.compiere.util.DB; +import org.compiere.util.Env; +import org.posterita.beans.CustomerBean; +import org.posterita.businesslogic.OrganisationManager; +import org.posterita.businesslogic.performanceanalysis.ReportManager; +import org.posterita.core.RandomStringGenerator; +import org.posterita.core.TimestampConvertor; +import org.posterita.exceptions.BPartnerAlreadyExistException; +import org.posterita.exceptions.BPartnerNotFoundException; +import org.posterita.exceptions.InvalidDateTimeException; +import org.posterita.exceptions.NoCustomerFoundException; +import org.posterita.exceptions.OperationException; +import org.posterita.lib.UdiConstants; +import org.posterita.util.PathInfo; +import org.posterita.util.PoManager; + +import com.lowagie.text.Document; +import com.lowagie.text.DocumentException; +import com.lowagie.text.Element; +import com.lowagie.text.Font; +import com.lowagie.text.FontFactory; +import com.lowagie.text.Image; +import com.lowagie.text.PageSize; +import com.lowagie.text.Phrase; +import com.lowagie.text.pdf.PdfPCell; +import com.lowagie.text.pdf.PdfPTable; +import com.lowagie.text.pdf.PdfWriter; + +public class CustomerManager +{ + + public static MBPartner saveCustomer(Properties ctx, Integer partnerId, CustomerBean bean, String trxName) throws OperationException, InvalidDateTimeException + { + + int countryId = 0; + + if (bean.getCountryId() == null) + { + MCountry country = MCountry.getDefault(ctx); + countryId = country.get_ID(); + } + else + countryId = bean.getCountryId().intValue(); + + MOrg parentOrg = OrganisationManager.getMyOrg(ctx); + + MBPartner bPartner = BPartnerManager.saveBPartner(ctx, bean.getOrgId(), partnerId, parentOrg.getLinkedC_BPartner_ID(trxName), bean.getPartnerName(), bean.getSurname(), true, false, false, false, bean.getAddress1(), bean + .getAddress2(), bean.getPostalAddress(), bean.getRegionId(), bean.getCity(), bean.getPhone(), bean.getPhone2(), bean.getFax(), countryId, true, true, trxName); + + int customerkey = DB.getNextID(ctx, X_I_BPartner.Table_Name, null); + bPartner.setValue(String.valueOf(customerkey)); + // bPartner.setC_Dunning_ID(bean.getDunningId()); + if(bean.getCreditLimit()!=null) + { + bPartner.setSO_CreditLimit(bean.getCreditLimit()); + } + + Integer priceListId = bean.getPriceListId(); + + if (priceListId!=null && priceListId!=0) + { + bPartner.setM_PriceList_ID(priceListId); + } + bPartner.setSOCreditStatus(bean.getCreditStatus()); + bPartner.setName2(bean.getSurname()); + if(bean.getPaymentTermId()!=null) + { + bPartner.setC_PaymentTerm_ID(bean.getPaymentTermId()); + } + if(bean.getPaymentTermId()==null) + { + bPartner.setC_PaymentTerm_ID(0); + } + PoManager.save(bPartner); + + MUser user = null; + + if (bean.getUserId() == null || bean.getUserId() == 0) + { + user = new MUser(bPartner); + } + else + { + user = new MUser(ctx, bean.getUserId(), trxName); + } + + user.setEMail(bean.getEmail()); + user.setPhone(bean.getPhone()); + user.setAD_Org_ID(bean.getOrgId()); + + if (bean.getBirthdate() !=null ) + { + Timestamp timestamp = TimestampConvertor.getTimestamp(bean.getBirthdate().toString(), TimestampConvertor.BIRTH_DATE); + + user.setBirthday(timestamp); + } + + PoManager.save(user); + + return bPartner; + } + + public static CustomerBean editCustomer(Properties ctx,CustomerBean bean,String trxName) throws OperationException, InvalidDateTimeException + { + Integer bpartnerId = bean.getBpartnerId(); + if(bpartnerId==null) + { + throw new OperationException("Cannot edit business partner details. Cause bpartnerId cannot be null!"); + } + + int[] bpartnerIds = MBPartner.getAllIDs(MBPartner.Table_Name," C_bpartner_Id = "+bpartnerId, trxName); + if(bpartnerIds==null || bpartnerIds.length==0) + { + throw new OperationException("Cannot edit business partner details. Cause bpartnerId could not be found!"); + } + + MBPartnerLocation partnerLocation[] = MBPartnerLocation.getForBPartner(ctx,bpartnerIds[0]); + int region_id = 333; + if (partnerLocation.length >0) + { + + MLocation location = new MLocation(ctx, partnerLocation[0].getC_Location_ID(), trxName); + MRegion region = location.getRegion(); + + + if(region!=null) + { + region_id = region.get_ID(); + } + } + else + { + + MBPartner partner = new MBPartner(ctx,bpartnerId,null); + + MLocation location = new MLocation(ctx, 0, null); + location.setAddress1(bean.getAddress1()); + location.setAddress2(bean.getAddress2()); + location.setPostal_Add(bean.getPostalAddress()); + location.setCity(bean.getCity()); + location.save(); + MBPartnerLocation bpLocation = new MBPartnerLocation(partner); + bpLocation.setC_Location_ID(location.get_ID()); + bpLocation.setPhone(bean.getPhone()); + bpLocation.setPhone2(bean.getPhone2()); + bpLocation.setFax(bean.getFax()); + PoManager.save(bpLocation); + } + + MBPartner bPartner=BPartnerManager.editBPartner(ctx,bean.getOrgId(), bean.getBpartnerId(),bean.getPartnerName(),bean.getSurname(),true, + false,false,false,bean.getAddress1(),bean.getAddress2(),bean.getPostalAddress(),bean.getCity(),bean.getPhone(),bean.getPhone2(),bean.getFax(),region_id,trxName); + if(bean.getCreditLimit()!=null) + { + bPartner.setSO_CreditLimit(bean.getCreditLimit()); + } + bPartner.setSOCreditStatus(bean.getCreditStatus()); + if(bean.getPaymentTermId()!=null) + { + bPartner.setC_PaymentTerm_ID(bean.getPaymentTermId()); + } + if(bean.getPaymentTermId()==null) + { + bPartner.setC_PaymentTerm_ID(0); + } + + + PoManager.save(bPartner); + + MUser user; + int userIds [] =MUser.getAllIDs(MUser.Table_Name,"AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+" and C_BPARTNER_ID="+bpartnerId,trxName); + if(userIds.length==0) + { + user = new MUser(bPartner); + PoManager.save(user); + + } + else + { + user = new MUser(ctx,userIds[0],trxName); + } + + PoManager.save(user); + return bean; + } + + @SuppressWarnings("unchecked") + public static ArrayList getAllCustomers(Properties ctx, boolean isPOS) throws OperationException + { + int adOrgID = Env.getAD_Org_ID(ctx); + int adClientID = Env.getAD_Client_ID(ctx); + String sql; + + sql = " select bp.c_bpartner_id," + //1 + " bp.name," + //2 + " bp.name2," + //3 + " bp.customer_id_no," + //4 + " bp.phone," + //5 + " bp.cellno," + //6 + " cl.address1," + //7 + " cl.address1," + //8 + " cl.city," + //9 + " cl.postal_add," + //10 + " cl.birthday" + //11 + " from C_BPARTNER bp, c_bpartner_location bpl, c_location cl" + + " where bpl.c_bpartner_id = bp.c_bpartner_id" + + " and cl.c_location_id=bpl.c_location_id" + + " and bp.AD_CLIENT_ID = " + adClientID + + " and bp.ad_org_id in (" + Env.getContext(ctx,UdiConstants.ROLE_EDITABLE_ORGS_CTX_PARAM)+")"+ + " and bp.isActive = 'Y' " ; + + if(!isPOS) + sql=sql+ " and bp.name not in (select name from ad_org where ad_org_id = " + adOrgID + ")" + + " and bp.name not in (select name from ad_user where ad_client_id = "+ adClientID +" and ad_org_id = " + adOrgID + ")" ; + + sql=sql+" order by bp.name,bp.name2"; + + PreparedStatement pstmt =null; + + CustomerBean customer = null; + ArrayList customers = new ArrayList(); + + try + { + pstmt = DB.prepareStatement(sql,null); + ResultSet rs = pstmt.executeQuery(); + + + while (rs.next()) + { + + customer = new CustomerBean(); + customer.setBpartnerId(Integer.valueOf(rs.getInt(1))); + customer.setPartnerName(rs.getString(2)); + customer.setSurname(rs.getString(3)); + customer.setCustIdNumber(rs.getString(4)); + customer.setPhone(rs.getString(5)); + customer.setMobile(rs.getString(6)); + customer.setAddress1(rs.getString(7)); + customer.setAddress1(rs.getString(8)); + customer.setCity(rs.getString(9)); + customer.setPostalAddress1(rs.getString(10)); + customer.setBirthdate(rs.getString(11)); + + customers.add(customer); + } + + rs.close(); + } + catch (SQLException e) + { + throw new OperationException(e.getMessage()); + } + finally + { + try + { + pstmt.close(); + } + catch(Exception ex){} + + pstmt = null; + } + + Comparator c = new Comparator() + { + + public int compare(Object o1, Object o2) + { + CustomerBean bean1 = (CustomerBean) o1; + CustomerBean bean2 = (CustomerBean) o2; + + String customer1Name = bean1.getSurname() + "_" +bean1.getPartnerName(); + + + String customer2Name = bean2.getSurname() + "_" + bean2.getPartnerName(); + + return customer1Name.compareToIgnoreCase(customer2Name); + } + + }; + + Collections.sort(customers, c); + + return customers; + + } + + public static ArrayList getAllCustomersSortedByDateCreated(Properties ctx) throws OperationException + { + ArrayList allCustomers = getAllCustomers(ctx,false); + + Comparator c = new Comparator() + { + + public int compare(CustomerBean o1, CustomerBean o2) + { + CustomerBean bean1 = (CustomerBean) o1; + CustomerBean bean2 = (CustomerBean) o2; + return bean1.getBpartnerId().compareTo(bean2.getBpartnerId()); + + } + }; + + Collections.sort(allCustomers, c); + Collections.reverse(allCustomers); + + return allCustomers; + } + + + public static ArrayList getAllPosCustomer(Properties ctx) throws OperationException + { + + ArrayList list = new ArrayList(); + + int ad_client_id = Env.getAD_Client_ID(ctx); + //int ad_org_id = Env.getAD_Org_ID(ctx); + + String sql = " select" + + " bp.name as firstname," + //1.firstname + " bp.name2 as lastname," +//2.lastname + " loc.address1," +//3.address1 + " loc.address2," +//4.address2 + " bploc.phone," +//5.phone + " bploc.fax," +//6.fax + " bp.isactive, " +//7.isactive + " bp.c_bpartner_id " + //8.partnerid + " from c_bpartner bp left outer join (c_bpartner_location bploc left outer join c_location loc on bploc.C_LOCATION_ID = loc.C_LOCATION_ID)on bp.c_bpartner_id = bploc.c_bpartner_id" + + " where bp.ad_client_id = " + ad_client_id + + " and bp.ad_org_id in (" + Env.getContext(ctx,UdiConstants.ROLE_EDITABLE_ORGS_CTX_PARAM)+")"+ + //" and bp.c_bpartner_id = bploc.c_bpartner_id (+)" + + //" and bploc.C_LOCATION_ID = loc.C_LOCATION_ID (+)" + + " and bp.ISCUSTOMER = 'Y'" + + //" and bp.name not in (select name from ad_org where ad_org_id = " + ad_org_id + ")" + + " order by bp.name" ; + + + PreparedStatement pstmt = DB.prepareStatement(sql,null); + ResultSet rs = null; + + CustomerBean bean = null; + + try + { + rs = pstmt.executeQuery(); + + while(rs.next()) + { + bean = new CustomerBean(); + + //set bean + bean.setPartnerName(rs.getString(1)); + bean.setSurname(rs.getString(2)); + bean.setAddress1(rs.getString(3)); + bean.setAddress2(rs.getString(4)); + bean.setPhone(rs.getString(5)); + bean.setFax(rs.getString(6)); + + if(rs.getString(7).equalsIgnoreCase("Y")) + { + bean.setIsActive(Boolean.valueOf("True")); + } + else + { + bean.setIsActive(Boolean.valueOf("False")); + } + + bean.setBpartnerId(Integer.valueOf(rs.getInt(8))); + + list.add(bean); + } + rs.close(); + } + catch (SQLException e) + { + throw new OperationException(e); + } + finally + { + try + { + pstmt.close(); + } + catch(Exception ex){} + + pstmt = null; + } + + return list; + } + + + + public static CustomerBean getCustomerDetails(Properties ctx, int bpartnerId) throws OperationException,BPartnerNotFoundException, InvalidDateTimeException, Exception + { + if (bpartnerId == 0) + throw new OperationException("Customer details not found. Please contact your administrator."); + + int id[] = MBPartner.getAllIDs(MBPartner.Table_Name,"C_BPARTNER_ID="+bpartnerId,null); + + if((id==null)||(id.length==0)) + { + throw new BPartnerNotFoundException("Could not find customer with id :"+bpartnerId); + } + + MBPartner partner = new MBPartner(ctx, bpartnerId, null); + + + CustomerBean customer = new CustomerBean(); + customer.setBpartnerId(bpartnerId); + customer.setPartnerName(partner.getName()); + customer.setSurname(partner.getName2()); + customer.setPriceListId(partner.getM_PriceList_ID()); + customer.setCreditLimit(partner.getSO_CreditLimit()); + customer.setCreditStatus(partner.getSOCreditStatus()); + customer.setIsActive(partner.isActive()); + customer.setOrgId(partner.getAD_Org_ID()); + + if(partner.getC_PaymentTerm_ID()!=0) + { + customer.setPaymentTermId(partner.getC_PaymentTerm_ID()); + MPaymentTerm paymentTerm=new MPaymentTerm(ctx,partner.getC_PaymentTerm_ID(),null); + customer.setPaymentTermName(paymentTerm.getName()); + } + + MBPartnerLocation partnerLocation[] = MBPartnerLocation.getForBPartner(ctx,partner.get_ID()); + if (partnerLocation.length > 0) + { + MLocation location = new MLocation(ctx, partnerLocation[0].getC_Location_ID(), null); + customer.setAddress1(location.getAddress1()); + customer.setAddress2(location.getAddress2()); + customer.setCity(location.getCity()); + customer.setPostalAddress1(location.getPostal_Add()); + customer.setPostalCode(location.getPostal()); + customer.setPostalCity(location.getCityRegionPostal()); + customer.setPhone(partnerLocation[0].getPhone()); + customer.setPhone2(partnerLocation[0].getPhone2()); + customer.setFax(partnerLocation[0].getFax()); + + } + customer.setBpartnerId(bpartnerId); + + MUser user=null; + int userIds [] =MUser.getAllIDs(MUser.Table_Name,"AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+" and C_BPARTNER_ID="+partner.get_ID(),null); + if(userIds.length==0) + { + user = new MUser(ctx,0,null); + user.setName(partner.getName()); + + } + else + { + user = new MUser(ctx,userIds[0],null); // FIXME What about when having multiple users? + } + + customer.setUserId(user.get_ID()); + customer.setEmail(user.getEMail()); + customer.setMobile(user.getPhone()); + + Timestamp date = user.getBirthday(); + + if ((date != null)) + { + SimpleDateFormat sdf = new SimpleDateFormat(TimestampConvertor.DEFAULT_DATE_PATTERN1); + SimpleDateFormat sdfOutput = new SimpleDateFormat ("dd/MM/yyyy"); + String textDate = date.toString(); + + customer.setBirthdate(textDate); + } + + + return customer; + } + + @SuppressWarnings("unchecked") + public static ArrayList getCustomers(Properties ctx, boolean isPOS, String name) throws OperationException + { + int adOrgID = Env.getAD_Org_ID(ctx); + int adClientID = Env.getAD_Client_ID(ctx); + String sql; + + sql = " select bp.c_bpartner_id," + //1 + " bp.name," + //2 + " bp.name2," + //3 + " bp.customer_id_no," + //4 + " bp.phone," + //5 + " bp.cellno," + //6 + " bp.aa_card_no," + //7 + " cl.address1," + //8 + " cl.city," + //9 + " cl.postal_add," + //10 + " from C_BPARTNER bp, c_bpartner_location bpl, c_location cl" + + " where bpl.c_bpartner_id = bp.c_bpartner_id" + + " and cl.c_location_id=bpl.c_location_id" + + " and bp.AD_CLIENT_ID = " + adClientID + + " and bp.ad_org_id in (" + Env.getContext(ctx,UdiConstants.ROLE_EDITABLE_ORGS_CTX_PARAM)+")"+ + " and bp.isActive = 'Y' " + + " and (lower(bp.name) like lower('%"+ name +"%')" + + " or lower(bp.name2) like lower('%"+ name +"%')" ; + + if(!isPOS) + sql=sql+ " and bp.name not in (select name from ad_org where ad_org_id = " + adOrgID + ")" + + " and bp.name not in (select name from ad_user where ad_client_id = "+ adClientID +" and ad_org_id = " + adOrgID + ")" ; + + sql=sql+" order by bp.name,bp.name2"; + + PreparedStatement pstmt =null; + + CustomerBean customer = null; + ArrayList customers = new ArrayList(); + + try + { + pstmt = DB.prepareStatement(sql,null); + ResultSet rs = pstmt.executeQuery(); + + + while (rs.next()) + { + customer = new CustomerBean(); + customer.setBpartnerId(Integer.valueOf(rs.getInt(1))); + customer.setPartnerName(rs.getString(2)); + customer.setSurname(rs.getString(3)); + customer.setCustIdNumber(rs.getString(4)); + customer.setPhone(rs.getString(5)); + customer.setMobile(rs.getString(6)); + customer.setAaCardnumber(rs.getString(7)); + customer.setAddress1(rs.getString(8)); + customer.setCity(rs.getString(9)); + customer.setPostalAddress1(rs.getString(10)); + + customers.add(customer); + } + + rs.close(); + + } + catch (SQLException e) + { + throw new OperationException(e.getMessage()); + } + finally + { + try + { + pstmt.close(); + } + catch(Exception ex){} + + pstmt = null; + } + + Comparator c = new Comparator() + { + + public int compare(Object o1, Object o2) + { + CustomerBean bean1 = (CustomerBean) o1; + CustomerBean bean2 = (CustomerBean) o2; + + String customer1Name = bean1.getSurname() + "_" +bean1.getPartnerName(); + + + String customer2Name = bean2.getSurname() + "_" + bean2.getPartnerName(); + + return customer1Name.compareToIgnoreCase(customer2Name); + } + + }; + + Collections.sort(customers, c); + + return customers; + + } + + public static ArrayList searchCustomers(Properties ctx,String searchString, boolean isPOS) throws OperationException + { + searchString = (searchString==null)? "" : searchString; + + int adOrgID = Env.getAD_Org_ID(ctx); + int adClientID = Env.getAD_Client_ID(ctx); + String sql; + + StringTokenizer st = new StringTokenizer(searchString,"+ "); + String token = null; + + sql = " select bp.c_bpartner_id," + //1 + " bp.name," + //2 + " bp.name2," + //3 + " bp.m_pricelist_id," + //4 + " bp.so_creditlimit," + //5 + " bp.so_creditused," + //6 + " bp.totalopenbalance," + //7 + " bp.socreditstatus " + //8 + " from C_BPARTNER bp" + + " where bp.AD_CLIENT_ID = " + adClientID + + " and bp.ad_org_id in (" + Env.getContext(ctx,UdiConstants.ROLE_EDITABLE_ORGS_CTX_PARAM)+")"+ + " and bp.isActive = 'Y' "+ + " and bp.isCustomer='Y'"; + ArrayList params = new ArrayList(); + while(st.hasMoreTokens()) + { + token = st.nextToken().trim(); + token = "%" + token + "%"; + params.add(token); + params.add(token); + sql = sql + " and ( upper(bp.name) like upper(?) or upper(bp.name2) like upper(? ))"; + } + + if(!isPOS) + sql=sql+ " and bp.name not in (select name from ad_org where ad_org_id = " + adOrgID + ")" ; + + + sql=sql+" order by bp.name,bp.name2"; + + PreparedStatement pstmt =null; + + CustomerBean customer = null; + ArrayList customers = new ArrayList(); + + try + { + pstmt = DB.prepareStatement(sql,null); + int index = 1; + for (String s : params) + { + pstmt.setString(index, s); + index++; + } + ResultSet rs = pstmt.executeQuery(); + + + while (rs.next()) + { + customer = new CustomerBean(); + customer.setBpartnerId(Integer.valueOf(rs.getInt(1))); + customer.setPartnerName(rs.getString(2)); + customer.setSurname(rs.getString(3)); + customer.setPriceListId(rs.getInt(4)); + customer.setCreditStatus(rs.getString(8)); + + BigDecimal creditLimit = rs.getBigDecimal(5); + BigDecimal creditUsed = rs.getBigDecimal(6); + BigDecimal openBalance = rs.getBigDecimal(7); + + creditLimit = creditLimit == null ? Env.ZERO : creditLimit; + creditUsed = creditUsed == null ? Env.ZERO : creditUsed; + openBalance = openBalance == null ? Env.ZERO : openBalance; + + BigDecimal creditAvailable = Env.ZERO; + if(creditLimit.doubleValue() > 0.0d) + { + creditAvailable = creditLimit.subtract(creditUsed); + } + + customer.setTotalOpenBalance(openBalance); + customer.setCreditAvailable(creditAvailable); + customer.setCreditLimit(creditLimit); + customer.setCreditUsed(creditUsed); + + customers.add(customer); + } + + rs.close(); + + return customers; + + } + catch (SQLException e) + { + throw new OperationException(e.getMessage()); + } + finally + { + try + { + pstmt.close(); + } + catch(Exception ex){} + + pstmt = null; + } + } + + public static ArrayList searchPOSCustomer(Properties ctx, String customerName, String day, String month, String year, String isActive) throws OperationException, Exception + { + + ArrayList list = new ArrayList(); + + int ad_client_id = Env.getAD_Client_ID(ctx); + int ad_org_id = Env.getAD_Org_ID(ctx); + + StringBuffer sql = new StringBuffer(); + sql.append("select bp.c_bpartner_id,"); //1. bpartner id + sql.append(" bp.name as firstname,"); //2.firstname + sql.append(" bp.name2 as lastname,");//3.lastname + sql.append(" loc.address1,");//4.address1 + sql.append(" loc.address2,");//5.address2 + sql.append(" loc.city,");//6. City + sql.append(" bploc.phone,");//7.phone + sql.append(" bploc.fax,");//8.fax + sql.append(" bp.isactive,");//9.isactive + sql.append(" au.birthday, "); //10. birthday + sql.append(" bp.ad_org_id "); //11. organisation + sql.append(" FROM C_BPARTNER BP "); + sql.append(" LEFT OUTER JOIN AD_USER AU ON AU.C_BPARTNER_ID = BP.C_BPARTNER_ID "); + sql.append(" LEFT OUTER JOIN C_BPARTNER_LOCATION BPLOC ON BP.C_BPARTNER_ID = BPLOC.C_BPARTNER_ID "); + sql.append(" LEFT OUTER JOIN C_LOCATION LOC ON BPLOC.C_LOCATION_ID = LOC.C_LOCATION_ID "); + sql.append(" where bp.ad_client_id = ").append(ad_client_id); + sql.append(" and bp.ad_org_id in (" + Env.getContext(ctx,UdiConstants.ROLE_VIEWABLE_ORGS_CTX_PARAM)+")"); + sql.append(" and bp.ISCUSTOMER = 'Y'"); + + if( isActive.length() != 0) + { + sql.append("and bp.isActive='").append(isActive).append("'"); + } + + + sql.append(" and bp.name not in (select name from ad_org where ad_org_id = " + ad_org_id + ")" ); + sql.append(" and lower(bp.name||' ' ||"); + sql.append("bp.name2) like lower('%").append(customerName).append("%')"); + + if (day.length() != 0) + { + String dd = String.valueOf(day); + if (dd.length() == 1) + { + dd = "0" + dd; + } + + sql.append(" and to_char(bp.created, 'dd') = '").append(dd).append("'"); + } + + + if (month.length() != 0) + { + String mm = String.valueOf(month); + if (mm.length() == 1) + { + mm = "0" + mm; + } + + sql.append(" and to_char(bp.created, 'mm') = '").append(mm).append("'"); + } + + if (year.length() != 0) + { + sql.append(" and to_char(bp.created, 'yyyy') ='").append(year).append("'");; + } + + + sql.append(" order by bp.name"); + + + PreparedStatement pstmt = DB.prepareStatement(sql.toString(),null); + pstmt.execute(); + + ResultSet rs = null; + + CustomerBean bean = null; + + try + { + rs = pstmt.executeQuery(); + + while(rs.next()) + { + bean = new CustomerBean(); + + //set bean + bean.setPartnerName(rs.getString(2)); + bean.setSurname(rs.getString(3)); + bean.setAddress1(rs.getString(4)); + bean.setAddress2(rs.getString(5)); + bean.setCity(rs.getString(6)); + bean.setPhone(rs.getString(7)); + bean.setFax(rs.getString(8)); + bean.setIsEditable(RoleManager.isEditable(ctx, rs.getInt(11))); + + if(rs.getString(9).equalsIgnoreCase("Y")) + { + bean.setIsActive(Boolean.valueOf("True")); + } + else + { + bean.setIsActive(Boolean.valueOf("False")); + } + + bean.setBpartnerId(Integer.valueOf(rs.getInt(1))); + + if (rs.getString(10) != null) + { + Date textDate = rs.getDate(10); + bean.setBirthdate(textDate.toString()); + } + + list.add(bean); + } + rs.close(); + } + catch (SQLException e) + { + throw new OperationException(e); + } + finally + { + try + { + pstmt.close(); + } + catch(Exception ex){} + + pstmt = null; + } + + return list; + } + + /* + * + * param + * * return String name of the pdf file + */ + public static String fidelityCard (Properties ctx,ArrayList customerList) throws OperationException + { + String reportName =RandomStringGenerator.randomstring()+".pdf"; + String reportPath =ReportManager.getReportPath(reportName); + + boolean shouldPrintCard = false; + + for(CustomerBean b: customerList) + { + if(b.getIsActive()) + { + shouldPrintCard = true; + break; + } + } + + if(!shouldPrintCard) + { + throw new NoCustomerFoundException("Cannot print fidelity card. Cause no active customers were found."); + } + + Document document = new Document(PageSize.A4,3,3,2,4);//l,r,t,b + + try { +// step 2: + // we create a writer that listens to the document + // and directs a PDF-stream to a file + PdfWriter.getInstance(document, new FileOutputStream(reportPath)); + + // step 3: we open the document + document.open(); + + PdfPTable main = new PdfPTable(2); + main.setWidthPercentage(71.0f); + main.getDefaultCell().setBorderColor(Color.gray); + + PdfPCell cell = new PdfPCell(); + cell.setMinimumHeight(150.0f); + + Font smallFont = FontFactory.getFont(FontFactory.HELVETICA,7,Font.BOLD); + //Font spaceFont = FontFactory.getFont(FontFactory.HELVETICA,6,Font.BOLD); + //Font spaceFont2 = FontFactory.getFont(FontFactory.HELVETICA,15,Font.BOLD); + + //ResourceBundle rb = ResourceBundle.getBundle("MessageResources"); + + for(CustomerBean bean: customerList) + { + if(bean.getIsActive()) + { + String name =bean.getPartnerName(); + String name1=""; + String add2 =""; + String add1 =""; + String city =""; + + if (bean.getAddress1()!= null) + add1=bean.getAddress1(); + + if (bean.getAddress2()!= null) + add2=bean.getAddress2(); + + if (bean.getCity()!= null) + city =bean.getCity(); + + + String Address = " "+add1; + String Add2 = " " + add2; + String Add3 = " "+city; + + String BackPriv1Path = PathInfo.PROJECT_HOME + "/images/BackPriv1.jpg" ; + String backPriv2Path = PathInfo.PROJECT_HOME + "/images/backPriv2.jpg" ; + String frontImgPath = PathInfo.PROJECT_HOME + "/images/pc.png"; + + float WIDTH=205; + float HEIGHT= 135; + + + + Image Back1= Image.getInstance(BackPriv1Path); + Back1.scaleAbsolute(WIDTH-40,HEIGHT/3); + Image Back2=Image.getInstance(backPriv2Path); + Back2.scaleAbsolute(WIDTH,HEIGHT/3); + Image frontImg = Image.getInstance(frontImgPath); + frontImg.scaleAbsolute(WIDTH,HEIGHT); + + + + if(bean.getSurname() != null && bean.getSurname().trim().length() > 0) + name1 = " "+ name + " " + name1 + bean.getSurname(); + + byte[] barcode = BarcodeManager.getBarcodeAsByte(bean.getBpartnerId().toString()); + Image barcodeImg = Image.getInstance(barcode); + barcodeImg.setRotation(1.57f); + barcodeImg.scaleAbsolute(HEIGHT- 55f, WIDTH/5); + + //document.add(barcodeImg); + PdfPTable card = new PdfPTable(2); + card.getDefaultCell().setBorderWidth(0.0f); + + PdfPCell c =null; + card.setWidthPercentage(50.0f); + + PdfPTable t = new PdfPTable(1); + PdfPTable nametable = new PdfPTable(1); + + c = new PdfPCell(Back1); + c.setBorderWidth(0.0f); + nametable.addCell(c); + + + c = new PdfPCell(new Phrase(name1,smallFont)); + c.setHorizontalAlignment(Element.ALIGN_CENTER); + c.setVerticalAlignment(Element.ALIGN_CENTER); + c.setBorderWidth(0.0f); + nametable.addCell(c); + + c = new PdfPCell(new Phrase(Address,smallFont)); + c.setHorizontalAlignment(Element.ALIGN_CENTER); + c.setVerticalAlignment(Element.ALIGN_CENTER); + c.setBorderWidth(0.0f); + //c.setColspan(2); + nametable.addCell(c); + + c = new PdfPCell(new Phrase(Add2,smallFont)); + c.setHorizontalAlignment(Element.ALIGN_CENTER); + c.setVerticalAlignment(Element.ALIGN_CENTER); + c.setBorderWidth(0.0f); + //c.setColspan(2); + nametable.addCell(c); + + c = new PdfPCell(new Phrase(Add3,smallFont)); + c.setHorizontalAlignment(Element.ALIGN_CENTER); + c.setVerticalAlignment(Element.ALIGN_CENTER); + c.setBorderWidth(0.0f); + //c.setColspan(2); + nametable.addCell(c); + + //nametable.getDefaultCell(); + nametable.getDefaultCell().setBorderWidth(0.0f); + nametable.setHorizontalAlignment(Element.ALIGN_CENTER); + card.addCell(nametable); + + + c = new PdfPCell(barcodeImg); + c.setBorderWidth(0.0f); + //c.setColspan(2); + c.setHorizontalAlignment(Element.ALIGN_RIGHT); + c.setVerticalAlignment(Element.ALIGN_MIDDLE); + c.setPadding(5.0f); + card.addCell(c); + + + c = new PdfPCell(Back2); + c.setBorderWidth(0.0f); + c.setColspan(2); + card.addCell(c); + + + c = new PdfPCell(new Phrase(name1,smallFont)); + c.setBorderWidth(0.0f); + t.addCell(c); + + c = new PdfPCell(new Phrase(Address,smallFont)); + c.setBorderWidth(0.0f); + t.addCell(c); + + c = new PdfPCell(new Phrase(Add3,smallFont)); + c.setBorderWidth(0.0f); + t.addCell(c); + + + PdfPTable card1 = new PdfPTable(1); + card.getDefaultCell().setBorderWidth(0.0f); + + PdfPCell c1 =null; + card.setWidthPercentage(50.0f); + + c1 = new PdfPCell(frontImg); + c1.setBorderWidth(0.0f); + card1.addCell(c1); + + + + main.addCell(card); + main.addCell(card1); + } + + } + document.add(main); + + } + // TODO handle the following exception neatly + catch (DocumentException de) + { + System.err.println(de.getMessage()); + } + catch (IOException ioe) + { + System.err.println(ioe.getMessage()); + } + + // step 5: we close the document + document.close(); + return reportName; + } + + + public static CustomerBean createSingleCustomerForImport(Properties ctx, CustomerBean bean, String trxName) throws Exception, OperationException, InvalidDateTimeException + { + MBPartner customer = saveCustomer(ctx, 0, bean, trxName); + + /** SET ADDITIONAL DETAILS **/ + + customer.setReferenceNo(bean.getCustIdNumber()); + customer.setTaxID(bean.getTaxNo()); + PoManager.save(customer); + + + MBPartnerLocation[] partnerLocations = MBPartnerLocation.getForBPartner(ctx, customer.getC_BPartner_ID()); + + if(partnerLocations.length > 0) + { + partnerLocations[0].setPhone2(bean.getMobile()); + PoManager.save(partnerLocations[0]); + + //Set postal code and postal address for customer + MLocation location = new MLocation(ctx, partnerLocations[0].getC_Location_ID(), trxName); + + location.setPostal(bean.getPostalCode()); + location.setAddress3(bean.getPostalAddress()); + location.setAddress4(bean.getPostalAddress1()); + PoManager.save(location); + } + + + //Modify contact for new customer since contact name is same as customer name by default + if(bean.getUsername() != null && bean.getUsername().length() > 0) + { + MUser[] users = MUser.getOfBPartner(ctx, customer.getC_BPartner_ID()); + + if(users.length > 0) + { + users[0].setName(bean.getUsername()); + users[0].setFax(bean.getFax()); + users[0].setPhone2(bean.getMobile()); + PoManager.save(users[0]); + } + } + + //Set Bank account details for customer + + if(bean.getBankName() != null && bean.getBankName().length() > 0 + && bean.getAccountNo() != null && bean.getAccountNo().length() > 0) + { + MBPBankAccount bpBankAccount = new MBPBankAccount(ctx, 0, trxName); + bpBankAccount.setC_BPartner_ID(customer.getC_BPartner_ID()); + bpBankAccount.setAccountNo(bean.getAccountNo()); + bpBankAccount.setA_City(bean.getBranch()); // Set branch for bank + + String whereClause = " UPPER(name)='" + bean.getBankName().toUpperCase() + "' AND AD_Client_ID=" + Env.getAD_Client_ID(ctx) + + " AND AD_Org_ID=" + Env.getAD_Org_ID(ctx) + " AND isActive='Y'"; + + int[] bankIds = MBank.getAllIDs(MBank.Table_Name, whereClause, trxName); + MBank bank = null; + + if(bankIds.length == 0) + { + bank = new MBank(ctx, 0, trxName); + bank.setName(bean.getBankName()); + bank.setRoutingNo("123456789"); //Routing Number is mandatory + PoManager.save(bank); + } + else + { + bank = new MBank(ctx, bankIds[0], trxName); + } + + bpBankAccount.setC_Bank_ID(bank.getC_Bank_ID()); + bpBankAccount.setRoutingNo(bank.getRoutingNo()); + + PoManager.save(bpBankAccount); + + } + + CustomerBean customerBean= new CustomerBean(); + customerBean = CustomerManager.getCustomerDetails(ctx, customer.getC_BPartner_ID()); + return customerBean; + } + + public static void activateCustomer(Properties ctx, int bpartnerId, String trxName) throws OperationException + { + BPartnerManager.activateBPartner(ctx,bpartnerId, false,trxName); + + } + + public static void deactivateCustomer(Properties ctx, int bpartnerId, String trxName) throws OperationException + { + BPartnerManager.deactivateBPartner(ctx,bpartnerId, trxName); + + } + + + public static ArrayList updateCustomerListStatus(ArrayList list, Integer partnerId, Boolean status) + { + if (list == null) + return list; + + for (int i = 0; i < list.size(); i++) + { + CustomerBean bean = (CustomerBean) list.get(i); + + if (bean.getBpartnerId().equals(partnerId)) + { + bean.setIsActive(status); + + list.remove(i); + + list.add(i, bean); + + break; + } + } + + return list; + + } + + public static MBPartner getBPartner(Properties ctx, String name, String name2, boolean isCustomer, boolean isVendor, boolean isSalesRep, boolean isEmployee, String trxName) throws BPartnerAlreadyExistException, OperationException + { + MBPartner bpartner = null; + + if((name == null || name.length() == 0) && (name2 == null || name2.length() == 0)) + { + throw new OperationException("Name cannot be null or empty."); + } + + if(name != null && name.contains("'")) + { + name = name.replaceAll("'", "''"); + } + + if(name2 != null && name2.contains("'")) + { + name2 = name2.replaceAll("'", "''"); + } + + StringBuffer sql = new StringBuffer(); + + if(name != null || name.length() > 0) + { + name = name.toUpperCase(); + sql.append(" UPPER(name)='" + name + "'"); + } + + if(name2 != null && name2.length() > 0) + { + name2 = name2.toUpperCase(); + sql.append(" AND UPPER(name2)='" + name2 + "'"); + } + + if(isCustomer) + { + sql.append(" AND isCustomer='Y'"); + } + + if(isVendor) + { + sql.append(" AND isVendor='Y'"); + } + + if(isEmployee) + { + sql.append(" AND isEmployee='Y'"); + } + + if(isSalesRep) + { + sql.append(" AND isSalesRep='Y'"); + } + + sql.append(" AND AD_Client_ID=" + Env.getAD_Client_ID(ctx) + " AND isActive='Y'"); + + int[] bpartnerIds = MBPartner.getAllIDs(MBPartner.Table_Name, sql.toString(), trxName); + + if(bpartnerIds.length != 0) + { + bpartner = new MBPartner(ctx, bpartnerIds[0], trxName); + } + + return bpartner; + } +} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/administration/DunningManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/administration/DunningManager.java new file mode 100644 index 0000000000..ab0736efd4 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/businesslogic/administration/DunningManager.java @@ -0,0 +1,251 @@ +/** + * Product: Posterita Web-Based POS (an Adempiere Plugin) + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +/** + @author Alok Pathak + */ + +package org.posterita.businesslogic.administration; + +import java.math.BigDecimal; +import java.sql.Timestamp; +import java.util.Properties; + +import org.compiere.model.MDunning; +import org.compiere.model.MDunningLevel; +import org.compiere.model.MDunningRun; +import org.compiere.model.MPInstance; +import org.compiere.print.MPrintFormat; +import org.compiere.process.DunningPrint; +import org.compiere.process.DunningRunCreate; +import org.compiere.process.ProcessInfo; +import org.compiere.process.ProcessInfoParameter; +import org.compiere.util.DB; +import org.compiere.util.Env; +import org.posterita.beans.DunningBean; +import org.posterita.businesslogic.POSTerminalManager; +import org.posterita.exceptions.OperationException; +import org.posterita.util.PoManager; + + +public class DunningManager +{ + private static final int DUNNING_CREATE_PROCESS_ID=289; + private static final int DUNNING_PRINT_PROCESS_ID=312; + + + public static MDunning createDunningAndLevel(Properties ctx,String dunningName,String desc,String dunningLevelName,String printText,String printNote,int daysAfterDue) throws OperationException + { + + MDunning dunning = new MDunning(ctx,0,null); + dunning.setIsDefault(true); + dunning.setSendDunningLetter(true); + dunning.setName(dunningName); + dunning.setDescription(desc); + + PoManager.save(dunning); + + MDunningLevel dunningLevel = new MDunningLevel(ctx,0,null); + dunningLevel.setC_Dunning_ID(dunning.get_ID()); + dunningLevel.setName(dunningLevelName); + dunningLevel.setDaysAfterDue(new BigDecimal(daysAfterDue)); + dunningLevel.setDaysBetweenDunning(0); + dunningLevel.setPrintName(printText); + dunningLevel.setNote(printNote); + + int [] allIds = MPrintFormat.getAllIDs(MPrintFormat.Table_Name,"AD_CLIENT_ID=0 and name='Dunning_Header ** TEMPLATE **'",null); + if(allIds.length==0) + throw new OperationException("no dunning print format for system"); + if(allIds.length > 1) + throw new OperationException("more than one dunning print format for system"); + dunningLevel.setDunning_PrintFormat_ID(allIds[0]); + + PoManager.save(dunningLevel); + return dunning; + } + + + + + public static void printDunningLetters(Properties ctx, DunningBean bean) throws OperationException + { + if(bean.getBpartnerIds()!=null && bean.getBpartnerIds().length>0) + { + for(int i=0;i importCustomer(Properties ctx, FormFile formFile,String trxName) throws BPartnerAlreadyExistException, OperationException, InvalidDateTimeException, Exception + { + ArrayList list=new ArrayList(); + + InputStream is = null; + BufferedInputStream bis = null; + BufferedReader reader = null; + + try + { + is = formFile.getInputStream(); + + bis = new BufferedInputStream(is); + + reader = new BufferedReader(new InputStreamReader(bis)); + + String s = null; + CustomerBean bean = null; + String accountNo = null; + String name = null; + String address1 = null; + String address2 = null; + String address3 = null; + String postalCode = null; + String strAddress1 = null; + String strAddress2 = null; + String contactName = null; + String phone = null; + String fax = null; + String paymentTerm = null; + String creditLimit = null; + String broughtForwardBalance = null; + String totalOwing = null; + String salesRep = null; + String priceList = null; + String taxNo = null; + String bank = null; + String branch = null; + String bankAccountNo = null; + String email = null; + String cell = null; + + String name2 = " "; // since name2 is compulsory in posterita + + int count = 0; + StringBuffer importCustomerExMsg = new StringBuffer(); + StringBuffer csv = new StringBuffer(); + boolean isCustomerImported = true; + + csv.append(reader.readLine()).append("\n"); + + while((s=reader.readLine()) != null && s.trim().length() > 0) + { + count ++; + + // set empty string for blank fields such that when doing st.nextToken(), empty string is returned rather than + // the next token which belongs to another field. + + while(s.contains(",,")) + { + s = s.replace(",,", ",\"\","); + } + + StringTokenizer st = new StringTokenizer(s,","); + + Trx trx = Trx.get(TrxPrefix.getPrefix(), true); + + try + { + trx.start(); + accountNo = getElement(st); + name = getElement(st); + address1 = getElement(st); + address2 = getElement(st); + address3 = getElement(st); + postalCode = getElement(st); + strAddress1 = getElement(st); + strAddress2 = getElement(st); + + if(address3 == null || address3.length() == 0) + { + address3 = getElement(st); + + } + else + { + st.nextToken(); // skip empty string so that st.nextToken() gives contact name + } + + contactName = getElement(st); + phone = getElement(st); + fax = getElement(st); + paymentTerm = getElement(st); + creditLimit = getElement(st); + broughtForwardBalance = getElement(st); + totalOwing = getElement(st); + salesRep = getElement(st); + priceList = getElement(st); + taxNo = getElement(st); + bank = getElement(st); + branch = getElement(st); + bankAccountNo = getElement(st); + email = getElement(st); + cell = getElement(st); + + try + { + MBPartner customer = CustomerManager.getBPartner(ctx, name, name2, true, false, false, false, trxName); + + if(customer != null) + { + throw new BPartnerAlreadyExistException("Customer already exists!"); + } + + bean = new CustomerBean(); + + if(paymentTerm != null && paymentTerm.length() > 0) + { + String whereClause = " UPPER(name)='" + paymentTerm.toUpperCase() + "' AND AD_Client_ID=" + Env.getAD_Client_ID(ctx) + " AND AD_Org_ID=" + + Env.getAD_Org_ID(ctx) + " AND isActive='Y'"; + + int[] paymentTermIds = MPaymentTerm.getAllIDs(MPaymentTerm.Table_Name, whereClause, trxName); + + if(paymentTermIds.length == 0) + { + throw new OperationException("Payment term " + paymentTerm + " not found!"); + } + else if(paymentTermIds.length > 1) + { + throw new OperationException("Duplicate payment term " + paymentTerm + " found. Payment Term should be unique."); + } + else + { + PaymentTermBean paymentTermBean = new PaymentTermBean(); + paymentTermBean = PaymentTermManager.getPaymentTerm(ctx, paymentTermIds[0]); + + bean.setPaymentTermName(paymentTermBean.getPaymentTermName()); + bean.setPaymentTermId(paymentTermBean.getPaymentTermId()); + } + + } + + if(creditLimit != null && creditLimit.length() > 0) + { + BigDecimal creditLmt = new BigDecimal(creditLimit); + bean.setCreditLimit(creditLmt); + } + + if(totalOwing != null && totalOwing.length() > 0 && broughtForwardBalance != null && broughtForwardBalance.length() > 0) + { + BigDecimal totalOwe = new BigDecimal(totalOwing); + BigDecimal BFBal = new BigDecimal(broughtForwardBalance); + + if(totalOwe != null && BFBal != null) + { + bean.setTotalOpenBalance(BFBal.subtract(totalOwe)); + } + else + { + bean.setTotalOpenBalance(Env.ZERO); + } + + } + + if(priceList != null && priceList.length() > 0) + { + String whereClause = " UPPER(name)='" + priceList.toUpperCase() + "' AND AD_Client_ID=" + Env.getAD_Client_ID(ctx) + " AND AD_Org_ID=" + Env.getAD_Org_ID(ctx) + + " AND isSOPriceList='Y' AND isActive='Y'"; + + int[] priceListIds = MPriceList.getAllIDs(MPriceList.Table_Name, whereClause, trxName); + + if(priceListIds.length == 0) + { + throw new OperationException("Pricelist with name " + priceList + " not found."); + } + + else if(priceListIds.length > 1) + { + throw new OperationException("Duplicate pricelist with name " + priceList + " found. Pricelist name should be unique."); + } + else + { + MPriceList priceLst = new MPriceList(ctx, priceListIds[0], trxName); + bean.setPriceListId(priceListIds[0]); + bean.setPriceListName(priceLst.getName()); + } + + } + + if(salesRep != null && salesRep.length() > 0) + { + MBPartner rep = CustomerManager.getBPartner(ctx, salesRep, null, false, false, true, false, trxName); + + if(rep == null) + { + throw new BPartnerNotFoundException("Sales Rep with name " + salesRep + " not found!"); + } + + bean.setSaleRepName(rep.getName()); + bean.setSalesRepId(rep.getC_BPartner_ID()); + } + + bean.setCustIdNumber(accountNo); + bean.setAddress1(address1); + bean.setAddress2(address2); + bean.setCity(address3); + bean.setPostalCode(postalCode); + bean.setPostalAddress(strAddress1); + bean.setPostalAddress1(strAddress2); + bean.setPartnerName(name); + bean.setSurname(name2); + bean.setUsername(contactName); + bean.setEmail(email); + bean.setPhone(phone); + bean.setFax(fax); + bean.setMobile(cell); + bean.setIsActive(true); + bean.setOrgId(Env.getAD_Org_ID(ctx)); + bean.setBankName(bank); + bean.setBranch(branch); + bean.setAccountNo(bankAccountNo); + bean.setTaxNo(taxNo); + + CustomerManager.createSingleCustomerForImport(ctx,bean,trxName); + trx.commit(); + list.add(bean); + } + + catch(OperationException e) + { + trx.rollback(); + importCustomerExMsg.append("
    Customer at line "+ count + " not imported. Cause: " + e.getMessage()); + isCustomerImported = false; + csv.append(s).append("\"\n"); + + } + + finally + { + trx.close(); + } + + } + catch (NoSuchElementException e) + { + trx.rollback(); + importCustomerExMsg.append("
    Customer at line " + count + " not imported. Cause: Cannot pass data from file!"); + isCustomerImported = false; + csv.append(s).append("\"\n"); + } + + finally + { + trx.close(); + } + + }//while + + if (!isCustomerImported) + { + String filename = RandomStringGenerator.randomstring() + ".csv"; + String filepath = ReportManager.getReportPath(filename); + try + { + FileWriter writer = new FileWriter(filepath); + writer.write(csv.toString()); + writer.flush(); + writer.close(); + } + catch (IOException e1) + { + throw new OperationException(e1); + } + throw new CustomerNotImportedException(filename+importCustomerExMsg.toString()); + } + + } + + catch (FileNotFoundException e) + { + + e.printStackTrace(); + } + catch (IOException e) + { + + e.printStackTrace(); + } + + finally + { + if (is != null) + { + try + { + is.close(); + } + catch(Exception ex) + {} + } + + if (bis != null) + { + try + { + bis.close(); + } + catch(Exception ex) + {} + } + + if (reader != null) + { + try + { + reader.close(); + } + catch(Exception ex) + {} + } + } + return list; + } + + private static String getElement(StringTokenizer st) + { + String element = ""; + + if(st.hasMoreTokens()) + { + element = st.nextToken(); + element = element.replaceAll("\"", ""); + } + + return element; + } + +} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/administration/PriceListManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/administration/PriceListManager.java new file mode 100644 index 0000000000..9163e36477 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/businesslogic/administration/PriceListManager.java @@ -0,0 +1,1107 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Aug 19, 2005 by praveen + * + */ +package org.posterita.businesslogic.administration; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.Properties; +import java.util.TreeSet; + +import org.compiere.model.MColumn; +import org.compiere.model.MCurrency; +import org.compiere.model.MDiscountSchema; +import org.compiere.model.MOrg; +import org.compiere.model.MPInstance; +import org.compiere.model.MPriceList; +import org.compiere.model.MPriceListVersion; +import org.compiere.model.MProcess; +import org.compiere.model.MProcessPara; +import org.compiere.model.MProduct; +import org.compiere.model.MProductPrice; +import org.compiere.model.MTax; +import org.compiere.model.MTaxCategory; +import org.compiere.process.M_PriceList_Create; +import org.compiere.process.ProcessInfo; +import org.compiere.process.ProcessInfoParameter; +import org.compiere.process.SvrProcess; +import org.compiere.util.DB; +import org.compiere.util.Env; +import org.compiere.util.KeyNamePair; +import org.compiere.util.Trx; +import org.posterita.beans.AttributeValuesBean; +import org.posterita.beans.PriceListBean; +import org.posterita.beans.ProductBean; +import org.posterita.beans.ProductPriceBean; +import org.posterita.beans.SearchBean; +import org.posterita.beans.UDIPair; +import org.posterita.businesslogic.CurrencyManager; +import org.posterita.businesslogic.POSTerminalManager; +import org.posterita.businesslogic.SearchManager; +import org.posterita.core.CheckDuplicateEntities; +import org.posterita.exceptions.MandatoryException; +import org.posterita.exceptions.OperationException; +import org.posterita.exceptions.PriceListAlreadyExistsException; +import org.posterita.exceptions.SystemException; +import org.posterita.exceptions.TerminalNotFoundException; +import org.posterita.lib.UdiConstants; +import org.posterita.util.PoManager; + +public class PriceListManager +{ + public static ArrayList getProductPriceList(Properties ctx, int pricelistVersionId) throws OperationException + { + return getProductPriceList(ctx, pricelistVersionId, null, null, null); + } + + public static ArrayList getProductPriceList(Properties ctx, int pricelistVersionId, String searchText, Boolean isSelfService, String classification) throws OperationException + { + ArrayList productPriceList = new ArrayList(); + + int adClientId = Env.getAD_Client_ID(ctx); + int adOrgId = Env.getAD_Org_ID(ctx); + + String sql = "select distinct " + + " p.M_Product_ID," + + " p.name," + + " pp.pricelist," + + " pp.pricestd," + + " pl.name" + + " from M_product p, M_ProductPrice pp, M_PriceList pl, M_PriceList_Version plv" + + " where pp.M_product_id = p.M_product_id" + + " and pp.m_pricelist_version_id = plv.m_pricelist_version_id" + + " and plv.m_pricelist_id = pl.m_pricelist_id" + + " and p.AD_CLIENT_ID = " + adClientId + + " and p.ad_org_id = " + adOrgId + + " and pp.m_pricelist_version_id = " + pricelistVersionId + + " and p.isactive = 'Y' "; + + + if (isSelfService!= null && isSelfService) + sql = sql + " and p.isSelfService = 'Y' "; + if (isSelfService!= null && !isSelfService) + sql = sql + " and p.isSelfService = 'N' "; + + if (classification != null) + sql = sql + " and p.classification='" + classification + "' "; + + if(searchText != null && searchText.length() > 0) + { + SearchBean searchBean = SearchManager.getSearchParams(searchText); + ArrayList andSearchList = searchBean.getAndCriteriasList(); + Iterator andListIter = andSearchList.iterator(); + while(andListIter.hasNext()) + { + String andCriteria = andListIter.next(); + sql += " and ( Upper(p.name) like Upper('%" + andCriteria + "%') "; + sql += " or Upper(p.keyword) like Upper('%" + andCriteria + "%') "; + sql += " or Upper(p.keyword2) like Upper('%" + andCriteria + "%') "; + sql += " or Upper(p.keyword3) like Upper('%" + andCriteria + "%') "; + sql += " or Upper(p.keyword4) like Upper('%" + andCriteria + "%') ) "; + } + + ArrayList orSearchList = searchBean.getOrCriteriasList(); + Iterator orListIter = orSearchList.iterator(); + if(orListIter.hasNext()) + { + sql += " and ( "; + while(orListIter.hasNext()) + { + String orCriteria = orListIter.next(); + sql += " Upper(p.name) like Upper('%" + orCriteria + "%') "; + sql += " or Upper(p.keyword) like Upper('%" + orCriteria + "%') "; + sql += " or Upper(p.keyword2) like Upper('%" + orCriteria + "%') "; + sql += " or Upper(p.keyword3) like Upper('%" + orCriteria + "%') "; + sql += " or Upper(p.keyword4) like Upper('%" + orCriteria + "%') or"; + } + + sql = sql.substring(0, sql.length() - 3); + sql += " ) "; + } + } + + + sql += " Order by p.name"; + + PreparedStatement pstmt = null; + + try + { + pstmt = DB.prepareStatement(sql, null); + ResultSet rs = pstmt.executeQuery(); + + while(rs.next()) + { + ProductPriceBean prodPriceBean = new ProductPriceBean(); + prodPriceBean.setProductId(Integer.valueOf(rs.getInt(1))); + prodPriceBean.setProductName(rs.getString(2)); + prodPriceBean.setPriceList(rs.getBigDecimal(3)); + prodPriceBean.setPriceStandard(rs.getBigDecimal(4)); + prodPriceBean.setPriceListName(rs.getString(5)); + prodPriceBean.setPriceListVersionId(Integer.valueOf(pricelistVersionId)); + productPriceList.add(prodPriceBean); + } + rs.close(); + + } + catch(SQLException ex) + { + throw new OperationException("Could not retrieve product price list with sql: " + sql, ex); + } + finally + { + try + { + pstmt.close(); + } + catch (Exception ex) + { + + } + + pstmt = null; + } + + return productPriceList; + } + + public static AttributeValuesBean getAttributeValues(ArrayList priceList) + { + AttributeValuesBean attrValues = new AttributeValuesBean(); + + TreeSet models = new TreeSet(); + TreeSet colour = new TreeSet(); + TreeSet trx = new TreeSet(); + TreeSet year = new TreeSet(); + + Iterator iter = priceList.iterator(); + UDIPair pair = null; + ProductPriceBean bean = null; + + + while(iter.hasNext()) + { + bean = (ProductPriceBean) iter.next(); + + pair = new UDIPair(bean.getAttrModel(),bean.getAttrModel()); + models.add(pair); + + pair = new UDIPair(bean.getAttrColour(),bean.getAttrColour()); + colour.add(pair); + + pair = new UDIPair(bean.getAttrTrx(),bean.getAttrTrx()); + trx.add(pair); + + pair = new UDIPair(bean.getAttrYear(),bean.getAttrYear()); + year.add(pair); + } + + ArrayList list = null; + + list = new ArrayList(); + + if(!models.isEmpty()) + list.addAll(models); + + attrValues.setModel(list); + + list = new ArrayList(); + + if(!colour.isEmpty()) + list.addAll(colour); + + attrValues.setColour(list); + + list = new ArrayList(); + + if(!trx.isEmpty()) + list.addAll(trx); + + attrValues.setTrx(list); + + list = new ArrayList(); + + if(!year.isEmpty()) + list.addAll(year); + + attrValues.setYears(list); + + return attrValues; + } + + public static void editProductPrices(Properties ctx, Integer[] productIds, int priceListVersionId, BigDecimal newPrice, String trxName) throws OperationException, SystemException + { + for (int i = 0; i < productIds.length; i++) + { + editProductPrice(ctx, productIds[i].intValue(), priceListVersionId, newPrice, trxName); + } + } + + public static void editProductPrice(Properties ctx, int productId, int priceListVersionId, BigDecimal newPrice, String trxName) throws OperationException, SystemException + { + int ad_client_id = Env.getAD_Client_ID(ctx); + int ad_org_id = Env.getAD_Org_ID(ctx); + int ad_user_id = Env.getAD_User_ID(ctx); + + BigDecimal priceList = newPrice; + BigDecimal priceStd = newPrice; + BigDecimal priceLimit = newPrice; + + String updateSql = "Update M_PRODUCTPRICE set" + + " UPDATED = sysdate" + + ", UPDATEDBY = " + ad_user_id + + ", PRICELIST = " + priceList + + ", PRICESTD = " + priceStd + + ", PRICELIMIT = " + priceLimit + + ""; + + String whereClause = "" + + " where AD_CLIENT_ID =" + ad_client_id + + " and AD_ORG_ID =" + ad_org_id + + " and M_PRODUCT_ID =" + productId + + " and M_PRICELIST_VERSION_ID =" + priceListVersionId; + + String sqlStatement = updateSql + whereClause; + + System.out.println("Product Price update sql =====> " + sqlStatement); + + int i = DB.executeUpdate(sqlStatement, trxName); + + if(i<0) + { + throw new SystemException("Unable to update product price."); + } + } + + public static ProductPriceBean getProductPrice(Properties ctx, int productId, int priceListVersionId) throws SystemException + { + ProductPriceBean priceBean = null; + + int clientID = Env.getAD_Client_ID(ctx); + int orgID = Env.getAD_Org_ID(ctx); + + + StringBuffer sql = new StringBuffer("select " + + " v.M_product_id," + // 1.ProductID + " v.attr_model," + // 2.Model + " v.attr_colour," + // 3.Colour + " v.attr_trans," + // 4.Transmission + " v.attr_year," + // 5.Year + " pp.pricelist," + // 6.PriceList Price + " pp.pricestd," + // 7.Standard Price + " pl.name" + // 8.PriceList Name + " from U_VEHICLE_V v, M_product p, M_ProductPrice pp, M_PriceList pl, M_PriceList_Version plv" + + " where v.M_product_id = p.M_product_id" + + " and pp.M_product_id = p.M_product_id" + + " and pp.m_pricelist_version_id = plv.m_pricelist_version_id" + + " and plv.m_pricelist_id = pl.m_pricelist_id" + + " and p.AD_CLIENT_ID = " + clientID + + " and p.ad_org_id = " + orgID + + " and pp.m_pricelist_version_id = " + priceListVersionId + + " and v.M_product_id = " + productId + + ""); + + //System.out.println("Query for PriceListManager: " + sql); + + PreparedStatement pstmt = null; + + try + { + pstmt = DB.prepareStatement(sql.toString(),null); + ResultSet rs = pstmt.executeQuery(); + + if(rs.next()) + { + priceBean = new ProductPriceBean(); + + priceBean.setProductId(Integer.valueOf(rs.getInt(1))); + priceBean.setAttrModel(rs.getString(2)); + priceBean.setAttrColour(rs.getString(3)); + priceBean.setAttrTrx(rs.getString(4)); + priceBean.setAttrYear(rs.getString(5)); + priceBean.setPriceList(rs.getBigDecimal(6)); + priceBean.setPriceStandard(rs.getBigDecimal(7)); + priceBean.setPriceListName(rs.getString(8)); + priceBean.setPriceListVersionId(Integer.valueOf(priceListVersionId)); + + } + + rs.close(); + + } + catch (SQLException e) + { + throw new SystemException(e); + + } + finally + { + try + { + pstmt.close(); + } + catch (Exception ex) + { + + } + + pstmt = null; + } + + return priceBean; + } + + /** + * Retrieves the latest valid price list version id for this price list. + * @param ctx context + * @param priceListId id of the price list whose latest price list version id is to be returned + * @param trxName name of transaction if in transaction scope + * @return id of latest price list version or zero if none found + */ + public static int getPriceListVersionID(Properties ctx, int priceListId, String trxName) throws OperationException + { + return getPriceListVersionID(ctx, priceListId, null, trxName); + } + + + public static int getPriceListVersionID(Properties ctx, int priceListId, Timestamp date, String trxName) throws OperationException + { + MPriceList priceList = new MPriceList(ctx, priceListId, trxName); + MPriceListVersion priceListVersion = priceList.getPriceListVersion(date); + + if (priceListVersion == null) + { + throw new OperationException("No valid price list version present"); + } + + + return priceListVersion.get_ID(); + } + + public static String getCurrency(Properties ctx, int pricelistId) throws OperationException + { + MPriceList priceList = MPriceList.get(ctx, pricelistId, null); + + if (priceList == null) + throw new OperationException("Price list cannot be null!"); + + MCurrency mCurrency = new MCurrency(ctx, priceList.getC_Currency_ID(), null); + + return mCurrency.getCurSymbol(); + + } + + public static MPriceList createPriceList(Properties ctx, String name, int currencyId, int precision, + boolean isSOPriceList, String trxName) throws OperationException + { + MPriceList priceList = createOrUpdatePriceList(ctx, 0, name, true, true, true, true, isSOPriceList, false, + Env.getAD_Org_ID(ctx), currencyId, precision, trxName); + undefaultOtherPriceLists(ctx, priceList, trxName); + return priceList; + } + + private static MPriceList createOrUpdatePriceList(Properties ctx, int priceListId, String name, boolean isActive, + boolean isDefault, boolean isMandatory, boolean isPresentForProduct, boolean isSOPriceList, + boolean isTaxIncluded, int orgId, int currencyId, int precision, String trxName) throws OperationException + { + MPriceList priceList = new MPriceList(ctx, priceListId, trxName); + priceList.setName(name); + priceList.setIsActive(isActive); + priceList.setIsMandatory(isMandatory); + priceList.setisPresentForProduct(isPresentForProduct); + priceList.setAD_Org_ID(orgId); + priceList.setC_Currency_ID(currencyId); + priceList.setIsSOPriceList(isSOPriceList); + priceList.setPricePrecision(precision); + priceList.setIsDefault(isDefault); + priceList.setIsTaxIncluded(isTaxIncluded); + PoManager.save(priceList); + + return priceList; + } + + public static void createOrUpdatePriceList(Properties ctx, PriceListBean priceListBean, String trxName) throws OperationException, InstantiationException, IllegalAccessException + { + Integer priceListId = priceListBean.getPriceListId(); + String name = priceListBean.getName(); + Integer orgId = priceListBean.getOrgId(); + Boolean isSOPriceList = priceListBean.getIsSOPriceList(); + Boolean isMandatory = priceListBean.getIsMandatory(); + Boolean isDefault = priceListBean.getIsDefault(); + Boolean isPresentForProduct = priceListBean.getIsPresentForProduct(); + Boolean isActive = priceListBean.getIsActive(); + Integer basePriceListId = priceListBean.getBasePriceListId(); + Boolean isDeleteOldRecords = priceListBean.getIsDeleteOldRecords(); + Boolean isCreatePriceList = priceListBean.getIsCreatePriceList(); + Boolean isTaxIncluded = priceListBean.getIsTaxIncluded(); + priceListId = priceListId == null? 0:priceListId; + + if (name == null || "".equals(name)) + { + throw new OperationException("Price List Name is mandatory"); + } + + orgId = orgId == null? 0 : orgId; + + if (priceListId.equals(0)) // create new price list - check whether duplicate name + { + if (CheckDuplicateEntities.checkDuplicateName(ctx,name,"M_PriceList")) + { + throw new PriceListAlreadyExistsException("A price list with that name already exists"); + } + } + + MCurrency mCurrency = CurrencyManager.getCurrency(ctx); + int currencyId = mCurrency.getC_Currency_ID(); + int precision = mCurrency.getCostingPrecision(); + + + MPriceList priceList = createOrUpdatePriceList(ctx, priceListId, name, isActive, isDefault, + isMandatory, isPresentForProduct, isSOPriceList, isTaxIncluded, orgId, currencyId, precision, trxName); + setDefaultPriceList(ctx, priceList, isDefault, trxName); + MPriceListVersion plv = getPriceListVersion(ctx, priceList.getM_PriceList_ID(), null, trxName); + // + String whereClause = "AD_Client_ID=" + Env.getAD_Client_ID(ctx) + " and AD_Org_ID= 0"; + int discountSchemaIds[] = MDiscountSchema.getAllIDs(MDiscountSchema.Table_Name, whereClause, trxName); + if (discountSchemaIds == null || discountSchemaIds.length == 0) + { + throw new OperationException("No Discount schema defined"); + } + // + + if (plv == null) + { + plv = new MPriceListVersion(priceList); + plv.set_TrxName(trxName); + plv.setName(priceList.getName()+ " Version"); + plv.setM_DiscountSchema_ID(discountSchemaIds[0]); + if (basePriceListId != null && !basePriceListId.equals(0)) + { + MPriceListVersion basePlv = PriceListManager.getPriceListVersion(ctx, basePriceListId, null, trxName); + plv.setM_Pricelist_Version_Base_ID(basePlv.getM_PriceList_Version_ID()); + } + PoManager.save(plv); + } + if (isCreatePriceList) + { + if (basePriceListId != null && !basePriceListId.equals(0)) + { + SvrProcess priceListCreate = (SvrProcess)M_PriceList_Create.class.newInstance(); + + int columnId = MColumn.getColumn_ID(MPriceListVersion.Table_Name, MPriceListVersion.COLUMNNAME_ProcCreate); + MColumn column = MColumn.get(ctx, columnId); + int processId = column.getAD_Process_ID(); + MProcess process = MProcess.get(ctx, processId); + MPInstance pInstance = new MPInstance(process, 0); + pInstance.save(); + + MProcessPara[] params = process.getParameters(); + ProcessInfoParameter[] processParams = null; + for (MProcessPara para : params) + { + if ("DeleteOld".equals(para.getColumnName())) + { + String deleteOld = isDeleteOldRecords?"Y":"N"; + ProcessInfoParameter parameter = new ProcessInfoParameter(para.getColumnName(), deleteOld, null, null, null); + processParams = new ProcessInfoParameter[]{parameter}; + } + } + + ProcessInfo pi = new ProcessInfo(process.getName(), processId); + pi.setAD_PInstance_ID(pInstance.getAD_PInstance_ID()); + pi.setRecord_ID(plv.getM_PriceList_Version_ID()); + pi.setParameter(processParams); + + priceListCreate.startProcess(ctx, pi, Trx.get(trxName, false)); + } + } + + priceListBean.setPriceListId(priceList.getM_PriceList_ID()); + } + + public static void setDefaultPriceList(Properties ctx, MPriceList priceList, boolean isDefault, String trxName) throws OperationException + { + if (isDefault && priceList.isActive()) + { + // set this price list in terminal and set all other price lists as not default + priceList.setIsDefault(isDefault); + POSTerminalManager.setTerminalPriceListId(ctx, priceList.getM_PriceList_ID(), priceList.isSOPriceList(), trxName); + undefaultOtherPriceLists(ctx, priceList, trxName); + } + else // check whether this price list was set in terminal/web store before. Do not 'undefault' if that is the case + { + if (isPriceListOnTerminal(ctx, priceList)) + { + priceList.setIsDefault(true); + priceList.setIsActive(true); + } + else + { + priceList.setIsDefault(false); + } + } + priceList.save(trxName); + } + + private static boolean isPriceListOnTerminal(Properties ctx, MPriceList priceList) throws TerminalNotFoundException + { + int priceListId = priceList.getM_PriceList_ID(); + + int terminalPriceListId = POSTerminalManager.getPriceListId(ctx, priceList.isSOPriceList()); + + if (priceListId == terminalPriceListId) + { + return true; + } + else + { + return false; + } + } + + private static void undefaultOtherPriceLists(Properties ctx, MPriceList priceList, String trxName) throws OperationException + { + ArrayList list = new ArrayList(); + if (priceList.isSOPriceList()) + { + list = getPriceLists(ctx, 0, null, true, true, null, true, trxName); + } + else + { + list = getPriceLists(ctx, 0, null, true, true, null, false, trxName); + } + if (!list.isEmpty()) + { + Iterator iter = list.iterator(); + while (iter.hasNext()) + { + PriceListBean bean = iter.next(); + Integer id = bean.getPriceListId(); + if (id != null || id != 0) + { + MPriceList pl = MPriceList.get(ctx, id, trxName); + if (priceList.getM_PriceList_ID() != id) + { + pl.setIsDefault(false); + PoManager.save(pl); + } + } + } + } + } + + /** + * Loads a particular price list version for a price list as per valid from. + * + * @return price list version for a particular date + * @param ctx context + * @param priceListId id of price list whose version needs to be loaded + * @param validFrom valid from date + * @param trxName name of transaction if in transaction scope + * + */ + public static MPriceListVersion getPriceListVersion(Properties ctx, int priceListId, Timestamp validFrom, String trxName) + { + MPriceList priceList = new MPriceList(ctx, priceListId, trxName); + + return priceList.getPriceListVersion(validFrom); + } + + /** + * Retrieves all valid price lists for this product. + * @param ctx + * @param productId + * @param orgId + * @param trxName + * @return + * @throws OperationException + */ + public static ArrayList getProductPriceLists(Properties ctx, int productId, int orgId, String trxName) throws OperationException + { + Boolean isActive = true; + Boolean isDefault = null; + Boolean isPresentForProduct = true; + Boolean isSOPriceList = null; + + return getProductPriceLists(ctx, productId, orgId, isActive, isDefault, + isPresentForProduct, isSOPriceList, trxName); + } + + public static ArrayList getProductPriceLists(Properties ctx, int productId, int orgId, Boolean isActive, + Boolean isDefault, Boolean isPresentForProduct, Boolean isSOPriceList, String trxName) throws OperationException + { + MProduct product = MProduct.get(ctx, productId); + ArrayList list = getPriceLists(ctx, orgId, "", isActive, isDefault, + isPresentForProduct, isSOPriceList, trxName); + ArrayList productPriceList = new ArrayList(); + for (int i = 0; i< list.size(); i++) + { + PriceListBean priceListBean = list.get(i); + MPriceList pl = MPriceList.get(ctx, priceListBean.getPriceListId(), trxName); + MPriceListVersion plv = getPriceListVersion(ctx, priceListBean.getPriceListId(), null, trxName); + MProductPrice pp = MProductPrice.get(ctx, plv.getM_PriceList_Version_ID(), productId, trxName); + + BigDecimal stdPrice = Env.ZERO; + BigDecimal limitPrice = Env.ZERO; + BigDecimal listPrice = Env.ZERO; + BigDecimal stdPriceIncl = Env.ZERO; + BigDecimal limitPriceIncl = Env.ZERO; + BigDecimal listPriceIncl = Env.ZERO; + + if (pp != null) + { + stdPrice = pp.getPriceStd(); + limitPrice = pp.getPriceLimit(); + listPrice = pp.getPriceList(); + } + ProductBean productBean = new ProductBean(); + MOrg org = MOrg.get(ctx, plv.getAD_Org_ID()); + + productBean.setProductId(productId); + productBean.setPriceListName(priceListBean.getName()); + productBean.setIsSOPriceList(pl.isSOPriceList()); + productBean.setOrgId(org.get_ID()); + productBean.setOrgName(org.getName()); + productBean.setPriceListId(plv.getM_PriceList_ID()); + productBean.setPriceListVersionId(plv.getM_PriceList_Version_ID()); + productBean.setIsMandatory(pl.isMandatory()); + productBean.setIsActive(pl.isActive()); + productBean.setIsPresentForProduct(pl.isPresentForProduct()); + productBean.setIsDefault(pl.isDefault()); + productBean.setIsTaxIncluded(pl.isTaxIncluded()); + + if (!pl.isTaxIncluded()) + { + productBean.setStdPrice(stdPrice); + productBean.setLimitPrice(limitPrice); + productBean.setListPrice(listPrice); + + if (productId != 0) + { + MTaxCategory taxCategory = new MTaxCategory(ctx,product.getC_TaxCategory_ID(),trxName); + MTax tax = TaxManager.getTaxFromCategory(ctx, taxCategory.getC_TaxCategory_ID(), trxName); + + BigDecimal taxRate = tax.getRate().divide(Env.ONEHUNDRED); + + listPriceIncl = listPrice.multiply(taxRate).add(listPrice); + listPriceIncl = listPriceIncl.setScale(listPrice.scale(), RoundingMode.HALF_UP); + stdPriceIncl = stdPrice.multiply(taxRate).add(stdPrice); + stdPriceIncl = stdPriceIncl.setScale(stdPrice.scale(), RoundingMode.HALF_UP); + limitPriceIncl = limitPrice.multiply(taxRate).add(limitPrice); + limitPriceIncl = limitPriceIncl.setScale(limitPrice.scale(), RoundingMode.HALF_UP); + + productBean.setListPriceIncl(listPriceIncl); + productBean.setStdPriceIncl(stdPriceIncl); + productBean.setLimitPriceIncl(limitPriceIncl); + + } + else + { + productBean.setLimitPriceIncl(Env.ZERO); + productBean.setStdPriceIncl(Env.ZERO); + productBean.setListPriceIncl(Env.ZERO); + } + } + else + { + productBean.setStdPriceIncl(stdPrice); + productBean.setListPriceIncl(listPrice); + productBean.setLimitPriceIncl(limitPrice); + + if (productId != 0) + { + MTaxCategory taxCategory = new MTaxCategory(ctx,product.getC_TaxCategory_ID(),trxName); + MTax tax = TaxManager.getTaxFromCategory(ctx, taxCategory.getC_TaxCategory_ID(), trxName); + + BigDecimal taxRateFactor = (tax.getRate().divide(Env.ONEHUNDRED)).add(Env.ONE); + productBean.setStdPrice(stdPrice.divide(taxRateFactor, 2, RoundingMode.HALF_DOWN)); + productBean.setListPrice(listPrice.divide(taxRateFactor, 2, RoundingMode.HALF_DOWN)); + productBean.setLimitPrice(limitPrice.divide(taxRateFactor, 2, RoundingMode.HALF_DOWN)); + } + else + { + productBean.setLimitPrice(Env.ZERO); + productBean.setStdPrice(Env.ZERO); + productBean.setListPrice(Env.ZERO); + } + } + productPriceList.add(productBean); + } + + return productPriceList; + } + + + /** + * Retrieves all price lists under certain conditions + * @param ctx context + * @param isSOPriceList parameter to load sales/purchase price lists. Loads both if null. + * @param trxName name of transaction if in transaction scope + * @return an arraylist of PriceListBean (which is empty if no matching price lists are found). + */ + public static ArrayList getPriceLists(Properties ctx, int adOrgId, boolean isSOPriceList, String trxName) + { + return getPriceLists(ctx, adOrgId, null, Boolean.TRUE, null, null, isSOPriceList, trxName); + } + + /** + * Retrieves all price lists under certain conditions + * @param ctx context + * @param orgId id of the organisation (can be zero in case all orgs as per the role_org_access are to be queried). + * @param name name of the price list (case insensitive and matches any pricelist containing the specified string). Escaped if null. + * @param isActive parameter to load active or inactive price lists. Loads both if parameter is null. + * @param isDefault parameter to load that price list which is default. Typically only one price list can be default at a time. Escaped if null. + * @param isPresentForProduct parameter to load price lists which appear/do not appear on product screen. Loads both if parameter is null. + * @param isSOPriceList parameter to load sales/purchase price lists. Loads both if null. + * @param trxName name of transaction if in transaction scope + * @return an arraylist of PriceListBean (which is empty if no matching price lists are found). + */ + public static ArrayList getPriceLists(Properties ctx, int orgId, String name, + Boolean isActive, Boolean isDefault, Boolean isPresentForProduct, Boolean isSOPriceList, String trxName) + { + StringBuffer whereClause = new StringBuffer(); + + whereClause.append("AD_Client_ID = "+ Env.getAD_Client_ID(ctx)); + + if (orgId == 0) + { + whereClause.append(" AND AD_Org_ID IN (0, " + Env.getContext(ctx,UdiConstants.ROLE_EDITABLE_ORGS_CTX_PARAM)+ ")"); + } + else + { + whereClause.append(" AND AD_Org_ID IN ("+ orgId+")"); + } + + if (name!= null && !name.equals("")) + { + whereClause.append(" AND UPPER(name) LIKE UPPER('%"+name+"%')"); + } + + if (isActive !=null) + { + String is_Active = isActive?"'Y'":"'N'"; + whereClause.append(" AND isActive = " + is_Active); + } + + if (isDefault != null) + { + String is_Default = isDefault?"'Y'":"'N'"; + whereClause.append(" AND isDefault = " + is_Default); + } + + if (isPresentForProduct !=null) + { + String is_PresentForProduct = isPresentForProduct?"'Y'":"'N'"; + whereClause.append(" AND isPresentForProduct = " + is_PresentForProduct); + } + + if (isSOPriceList!=null) + { + String is_SOPriceList = isSOPriceList?"'Y'":"'N'"; + whereClause.append(" AND isSOPriceList = " + is_SOPriceList); + } + int[] priceListIds = MPriceList.getAllIDs(MPriceList.Table_Name, whereClause.toString(), trxName); + + ArrayList list = new ArrayList(); + + if (priceListIds == null || priceListIds.length == 0) + { + return list; + } + + for (int id : priceListIds) + { + MPriceList priceList = new MPriceList(ctx, id, trxName); + MOrg org = MOrg.get(ctx, priceList.getAD_Org_ID()); + + PriceListBean bean = new PriceListBean(); + bean.setName(priceList.getName()); + bean.setIsMandatory(priceList.isMandatory()); + bean.setIsDefault(priceList.isDefault()); + bean.setIsPresentForProduct(priceList.isPresentForProduct()); + bean.setPriceListId(priceList.getM_PriceList_ID()); + bean.setOrgName(org.getName()); + bean.setOrgId(priceList.getAD_Org_ID()); + bean.setIsActive(priceList.isActive()); + bean.setIsSOPriceList(priceList.isSOPriceList()); + list.add(bean); + } + + return list; + } + + + public static PriceListBean getPriceList(Properties ctx, + Integer priceListId, String trxName) + { + MPriceList priceList = MPriceList.get(ctx, priceListId, trxName); + MOrg org = MOrg.get(ctx, priceList.getAD_Org_ID()); + + PriceListBean bean = new PriceListBean(); + bean.setName(priceList.getName()); + bean.setIsMandatory(priceList.isMandatory()); + bean.setIsDefault(priceList.isDefault()); + bean.setIsPresentForProduct(priceList.isPresentForProduct()); + bean.setPriceListId(priceList.getM_PriceList_ID()); + bean.setOrgName(org.getName()); + bean.setOrgId(priceList.getAD_Org_ID()); + bean.setIsActive(priceList.isActive()); + bean.setIsSOPriceList(priceList.isSOPriceList()); + bean.setIsTaxIncluded(priceList.isTaxIncluded()); + return bean; + } + + /** + * Updates product price. + * The product and price list are obtained from the product bean. The latest price list version is used. + * @param ctx context + * @param productBean product bean + * @param trxName name of transaction if in transaction scope + * @throws OperationException Exception thrown if price list is mandatory but no prices entered for product. + */ + public static void updatePriceLists(Properties ctx, ProductBean productBean, + String trxName) throws OperationException + { + ArrayList list = productBean.getProductBeanList(); + + if (list!=null) + { + int productId = productBean.getProductId(); + Iterator iter = list.iterator(); + while (iter.hasNext()) + { + ProductBean bean = iter.next(); + + int priceListId = bean.getPriceListId(); + + BigDecimal stdPrice = bean.getStdPrice(); + BigDecimal listPrice = bean.getListPrice(); + BigDecimal limitPrice = bean.getLimitPrice(); + + MPriceList priceList = MPriceList.get(ctx, priceListId, trxName); + + if (priceList.isTaxIncluded()) + { + stdPrice = bean.getStdPriceIncl(); + listPrice = bean.getListPriceIncl(); + limitPrice = bean.getLimitPriceIncl(); + } + updatePriceLists(ctx, productId, priceListId, stdPrice, listPrice, limitPrice, trxName); + } + } + } + + public static void updatePriceLists(Properties ctx, int productId, int priceListId, + BigDecimal stdPrice, BigDecimal listPrice, BigDecimal limitPrice, + String trxName) throws OperationException + { + MPriceList priceList = MPriceList.get(ctx, priceListId, trxName); + + double price_Std = stdPrice == null? 0f: stdPrice.doubleValue(); + double price_List = listPrice == null? 0f:listPrice.doubleValue(); + double price_Limit = limitPrice == null? 0f: limitPrice.doubleValue(); + + int priceListVersionId = getPriceListVersionID(ctx, priceListId, trxName); + MProductPrice productPrice = MProductPrice.get(ctx, priceListVersionId, productId, trxName); + + if (productPrice == null) + { + productPrice = new MProductPrice(ctx, priceListVersionId, productId, trxName); + } + if (priceList.isMandatory()) + { + StringBuffer ex = new StringBuffer(priceList.getName() + " is mandatory"); + int length = ex.length(); + + if (price_Std == 0f) + { + ex.append(", standard price"); + } + if (priceList.isSOPriceList()) + { + if (price_List == 0f) + { + ex.append(", list price"); + } + if (price_Limit == 0f) + { + ex.append(", limit price"); + } + } + if (ex.length() > length) + { + throw new MandatoryException(ex.toString() + " cannot be zero"); + } + } + + if (priceList.isSOPriceList()) + { + productPrice.setPriceLimit(limitPrice); + productPrice.setPriceList(listPrice); + productPrice.setPriceStd(stdPrice); + } + else + { + productPrice.setPriceStd(stdPrice); + productPrice.setPriceLimit(stdPrice); + productPrice.setPriceList(stdPrice); + } + + PoManager.save(productPrice); + } + + /** + * Constructs and returns an Arraylist of Key-Name pair for price lists. + * @param ctx context + * @param priceLists arraylist of pricelists (each price list bean will have its id and name mapped) + * @return arraylist of KeyNamePair + */ + public static ArrayList getKeyNamePair(Properties ctx, + ArrayList priceLists) + { + ArrayList knp = new ArrayList(); + knp.add(new KeyNamePair(0,"")); + if (priceLists != null) + { + + Iterator iter = priceLists.iterator(); + while (iter.hasNext()) + { + PriceListBean bean = iter.next(); + + KeyNamePair keyNamePair = new KeyNamePair(bean.getPriceListId(), bean.getName()); + knp.add(keyNamePair); + } + } + return knp; + } + + public static PriceListBean getPriceListBean(Properties ctx, + ArrayList list, Integer priceListId, Boolean isNext) throws OperationException + { + int index = -1; + + if (priceListId == null || priceListId == 0) + { + PriceListBean priceListBean = new PriceListBean(); + priceListBean.setPriceListId(0); + priceListBean.setOrgId(0); + return priceListBean; + } + else + { + if (list != null) + { + Iterator iter = list.iterator(); + + while (iter.hasNext()) + { + PriceListBean currBean = iter.next(); + if (currBean.getPriceListId().equals(priceListId)) + { + index = list.indexOf(currBean); + } + } + if (index != -1) + { + if (isNext!=null) + { + if (isNext) + { + int nextIndex = (index + 1)%list.size(); + index = nextIndex; + } + else + { + int previousIndex = (index-1)%list.size(); + if (previousIndex < 0) + { + previousIndex += list.size(); + } + index = previousIndex; + } + } + return getPriceList(ctx, list.get(index).getPriceListId(), null); + } + else + { + throw new OperationException("no pricelist not found in search list"); + } + } + else + { + return getPriceList(ctx, priceListId, null); + } + } + } + + /** + * Load Price Lists as HTML with Select Tag + * @param ctx + * @param bean + * @return + */ + public static String loadPriceListAsHTMLSelect(Properties ctx, ArrayList bean) + { + StringBuffer selectHTML = new StringBuffer(); + + int m_pricelist_id = Env.getContextAsInt(ctx, UdiConstants.PRICELIST_CTX_PARAM); + + selectHTML.append(""); + + return selectHTML.toString(); + } + + + public static Integer getDefaultPriceListId(Properties ctx, boolean isSOTrx) throws OperationException + { + return POSTerminalManager.getPriceListId(ctx, isSOTrx); + } +} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/administration/ProductAttributeManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/administration/ProductAttributeManager.java new file mode 100644 index 0000000000..02f0830d45 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/businesslogic/administration/ProductAttributeManager.java @@ -0,0 +1,193 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Jul 28, 2005 by praveen + * + */ +package org.posterita.businesslogic.administration; + +import java.util.ArrayList; +import java.util.Properties; + +import org.compiere.model.MAttribute; +import org.compiere.model.MAttributeSet; +import org.compiere.model.MAttributeUse; +import org.compiere.model.MAttributeValue; +import org.compiere.util.Env; +import org.compiere.util.KeyNamePair; +import org.posterita.beans.AttributeValueDetailBean; +import org.posterita.exceptions.OperationException; +import org.posterita.exceptions.ProductInStockException; +import org.posterita.exceptions.SystemException; +import org.posterita.util.PoManager; + + +public class ProductAttributeManager +{ + public static ArrayList getProductAttributes(Properties ctx, int attributeSetId) throws OperationException, SystemException + { + MAttributeSet attributeSet = new MAttributeSet(ctx, attributeSetId, null); + + MAttribute[] attributes = attributeSet.getMAttributes(false); + + KeyNamePair pair; + ArrayList list = new ArrayList(); + for (int i = 0; i< attributes.length; i++) + { + pair = new KeyNamePair(attributes[i].get_ID(), attributes[i].getName()); + list.add(pair); + + } + + return list; + } + + public static ArrayList getProductAttributeValues(Properties ctx, int attributeId, int productCategoryId) + { + MAttribute attribute = new MAttribute(ctx, attributeId, null); + MAttributeValue attributeValue[] = attribute.getMAttributeValues(); + + int[] attributeValueIds = MAttributeValue.getAllIDs(MAttributeValue.Table_Name, "ad_client_id=" + Env.getAD_Client_ID(ctx) + " and m_attribute_id=" + attributeId + " and m_product_category_id=" + productCategoryId+" and isActive='Y' order by name", null); + + ArrayList attributeValues = new ArrayList(); + + if (attributeValue == null) + return attributeValues; + + MAttributeValue value; + for(int i=0;i getProductAttributeValuesDescription(Properties ctx, int attributeId, int productCategoryId, boolean showActiveOnly) + { + MAttribute attribute = new MAttribute(ctx, attributeId, null); + MAttributeValue attributeValue[] = attribute.getMAttributeValues(); + + String isActiveSQL = " "; + + if(showActiveOnly) + { + isActiveSQL = " and isActive = 'Y' "; + } + + int[] attributeValueIds = MAttributeValue.getAllIDs(MAttributeValue.Table_Name, "ad_client_id=" + Env.getAD_Client_ID(ctx) + " and m_attribute_id=" + attributeId + " and m_product_category_id=" + productCategoryId+ isActiveSQL +" order by name", null); + + ArrayList attributeValues = new ArrayList(); + + if (attributeValue == null) + return attributeValues; + + MAttributeValue value; + for(int i=0;i 0) + { + throw new ProductInStockException("Unable to perform action. There are some products that use the attribute value."); + } + + MAttributeValue attrValue = new MAttributeValue(ctx,attributeValueId,trxName); + + if(attrValue.isActive()) + { + attrValue.setIsActive(false); + } + else + { + attrValue.setIsActive(true); + } + + PoManager.save(attrValue); + + } + + public static MAttribute createAttribute(Properties ctx, String name) throws OperationException + { + MAttribute attribute = new MAttribute(ctx, 0, null); + attribute.setName(name); + attribute.setAttributeValueType(MAttribute.ATTRIBUTEVALUETYPE_List); + attribute.setIsMandatory(true); + PoManager.save(attribute); + return attribute; + + } + + /*public static void createAttributeUse(Properties ctx, MAttributeSet attributeSet, String attributeKey) throws OperationException + { + MAttribute attribute = ( MAttribute) GenericProductAttributeFactory.getFactoryInstance().get(ctx, attributeKey); + + int attributeUseIds[] = MAttributeUse.getAllIDs(MAttributeUse.Table_Name, "ad_client_id=" + Env.getAD_Client_ID(ctx) + " and m_attribute_id=" + attribute.get_ID() + " and m_attributeSet_id=" + attributeSet.get_ID(), null); + + if (attributeUseIds.length!=0) + return; + + MAttributeUse attributeUse = new MAttributeUse(ctx, 0 , null); + attributeUse.setM_AttributeSet_ID(attributeSet.get_ID()); + attributeUse.setM_Attribute_ID(attribute.get_ID()); + attributeUse.setSeqNo(10); + PoManager.save(attributeUse); + + }*/ + + public static void createAttributeUse(Properties ctx, MAttributeSet attributeSet, MAttribute attribute) throws OperationException + { + int attributeUseIds[] = MAttributeUse.getAllIDs(MAttributeUse.Table_Name, "ad_client_id=" + Env.getAD_Client_ID(ctx) + " and m_attribute_id=" + attribute.get_ID() + " and m_attributeSet_id=" + attributeSet.get_ID(), null); + + if (attributeUseIds.length!=0) + return; + + MAttributeUse attributeUse = new MAttributeUse(ctx, 0 , null); + attributeUse.setM_AttributeSet_ID(attributeSet.get_ID()); + attributeUse.setM_Attribute_ID(attribute.get_ID()); + attributeUse.setSeqNo(10); + PoManager.save(attributeUse); + + } + +} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/administration/ProductImageManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/administration/ProductImageManager.java new file mode 100644 index 0000000000..135844866c --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/businesslogic/administration/ProductImageManager.java @@ -0,0 +1,484 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Created on Apr 25, 2006 by praveen + * + */ + +package org.posterita.businesslogic.administration; + +import java.awt.Color; +import java.awt.Font; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Image; +import java.awt.font.FontRenderContext; +import java.awt.geom.Rectangle2D; +import java.awt.image.BufferedImage; +import java.io.BufferedInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.Calendar; +import java.util.Iterator; +import java.util.Properties; + +import javax.imageio.IIOImage; +import javax.imageio.ImageIO; +import javax.imageio.ImageWriteParam; +import javax.imageio.ImageWriter; +import javax.imageio.stream.MemoryCacheImageOutputStream; +import javax.swing.ImageIcon; + +import org.compiere.model.MAttachment; +import org.compiere.model.MProduct; +import org.compiere.util.DB; +import org.compiere.util.Env; +import org.compiere.util.Trx; + +import org.posterita.businesslogic.ProductImageUploader; +import org.posterita.core.TrxPrefix; +import org.posterita.exceptions.OperationException; +import org.posterita.util.PathInfo; + + +public class ProductImageManager +{ + private static transient byte[] backgroundImageData = null; + public static final String backImageFileName = "/images/pos/ImageBack.jpg"; + + public static byte[] getBackImageData() throws OperationException + { + if(backgroundImageData != null) + return backgroundImageData; + + try + { + String homePath = PathInfo.PROJECT_HOME; + File imgFile = new File(homePath + backImageFileName); + FileInputStream fileInStream = new FileInputStream(imgFile); + ByteArrayOutputStream byteArrStream = new ByteArrayOutputStream(); + BufferedInputStream bufferedInStream = new BufferedInputStream(fileInStream); + byte data[] = new byte[1024]; + int read = 0; + while((read = bufferedInStream.read(data)) != -1) + { + byteArrStream.write(data, 0, read); + } + byteArrStream.flush(); + backgroundImageData = byteArrStream.toByteArray(); + bufferedInStream.close(); + byteArrStream.close(); + fileInStream.close(); + return backgroundImageData; + } + catch(IOException ex) + { + throw new OperationException("Could not read backgroud image", ex); + } + } + + + /** + * Adds a border round the given image + * @param ctx + * @param m_product_id + * @param borderWidth - the border width + * @return a new Image + * @throws OperationException + */ + public static byte[] addImageBorder(Properties ctx,int m_product_id,byte[] imageData,double borderWidth, String trxName) throws OperationException + { + String sql = "select " + + " ATTR_MODEL," + //1.model + " ATTR_COLOUR," + //2.colour + " ATTR_DESIGN," + //3.design + " ATTR_SIZE" + //4.size + " from U_TShirt_V where M_Product_ID =" + m_product_id; + + PreparedStatement pstmt = null; + ResultSet rs = null; + + String design = null; + + try + { + pstmt = DB.prepareStatement(sql,trxName); + rs = pstmt.executeQuery(); + + if(rs.next()) + { + design = rs.getString(3); + } + else + { + throw new OperationException("Unable to get product's attributes!"); + } + + //------------------------------------------------------------------------------------------- + + Color borderColor = Color.DARK_GRAY; + + char copyrightSign = 169; + + String copyright_notice = copyrightSign + " " + Calendar.getInstance().get(Calendar.YEAR) + " Tamak"; + + Image image = new ImageIcon(imageData).getImage(); + + int width = image.getWidth(null); + int height = image.getHeight(null); + + double frameWidth = (double)width + 2*borderWidth; + double frameHeight = (double)height + borderWidth; + + Rectangle2D nameRect = new Rectangle2D.Double(0.0,frameHeight,frameWidth,80); + + BufferedImage bufferedImage = new BufferedImage((int)frameWidth,(int)(frameHeight + nameRect.getHeight()),BufferedImage.TYPE_USHORT_565_RGB); + Graphics2D g = (Graphics2D) bufferedImage.getGraphics(); + + g.drawImage(image,(int)borderWidth,(int)borderWidth,null); + + Rectangle2D topBorder = new Rectangle2D.Double(0.0,0.0,frameWidth,borderWidth); + //Rectangle2D bottomBorder = new Rectangle2D.Double(0.0,frameHeight-borderWidth,frameWidth,borderWidth); + Rectangle2D leftBorder = new Rectangle2D.Double(0.0,0.0,borderWidth,frameWidth); + Rectangle2D rightBorder = new Rectangle2D.Double(frameWidth-borderWidth,0.0,borderWidth,frameWidth); + + g.setColor(borderColor); + + g.fill(topBorder); + //g.fill(bottomBorder); + g.fill(leftBorder); + g.fill(rightBorder); + + + g.fill(nameRect); + g.setColor(Color.LIGHT_GRAY); + + //drawing smaill squares + double rXcoor = nameRect.getMinX(); + double rYcoor = nameRect.getMinY(); + + double h = nameRect.getHeight() - 2*borderWidth; + double w = h * 1.5; + + + + Rectangle2D rLeft = new Rectangle2D.Double(rXcoor + borderWidth, rYcoor + borderWidth, w,h); + g.fill(rLeft); + + Rectangle2D rRight = new Rectangle2D.Double(nameRect.getMaxX() - w - borderWidth, rYcoor + borderWidth, w,h); + g.fill(rRight); + + w = (rRight.getMinX() - borderWidth) - (rLeft.getMaxX() + borderWidth); + Rectangle2D rCenter = new Rectangle2D.Double(rLeft.getMaxX() + borderWidth, rYcoor + borderWidth, w, h); + g.fill(rCenter); + + + Font font = new Font("Arial", Font.PLAIN, 22); + g.setFont(font); + g.setColor(Color.WHITE); + + FontRenderContext fc = g.getFontRenderContext(); + Rectangle2D bounds = font.getStringBounds(design,fc); + + g.setFont(font); + g.drawString(design,(float)(rCenter.getMinX() + borderWidth),(float)(rCenter.getMinY() + borderWidth + bounds.getHeight())); + + //put copyright notice + g.setColor(Color.BLACK); + g.setFont(new Font("Arial", Font.PLAIN, 10)); + g.drawString(copyright_notice, (float)(2*borderWidth), (float)(frameHeight-borderWidth)); + + //get a writer and set compression + Iterator iter = ImageIO.getImageWritersByFormatName("JPG"); + + if(iter.hasNext()) + { + ImageWriter writer = (ImageWriter) iter.next(); + ImageWriteParam iwp = writer.getDefaultWriteParam(); + iwp.setCompressionMode(ImageWriteParam.MODE_EXPLICIT); + iwp.setCompressionQuality(0.75f); + + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + MemoryCacheImageOutputStream mos = new MemoryCacheImageOutputStream(bos); + + writer.setOutput(mos); + + + + IIOImage iIOimage = new IIOImage(bufferedImage,null,null); + writer.write(null,iIOimage,iwp); + + byte retData[] = bos.toByteArray(); + mos.close(); + bos.close(); + return retData; + } + + rs.close(); + + } + catch (Exception e) + { + throw new OperationException(e); + } + finally + { + try + { + pstmt.close(); + } + catch(Exception e) + {} + pstmt = null; + } + + return null; + } + + /** + * Removes the image's background + * @param img + * @param offset - range of color + * @return + */ + + public static Image removeBgColor(Image img, int offset) + { + return null; + } + + /** + * Clips the given image + * @param imageData + * @param width + * @param height + * @return + * @throws IOException + */ + public static byte[] clipImage(byte[] imageData,int width,int height) throws IOException + { + Image image = new ImageIcon(imageData).getImage(); + + BufferedImage bufferedImage = new BufferedImage(image.getWidth(null),image.getHeight(null),BufferedImage.TYPE_INT_RGB); + + Graphics graphics = bufferedImage.getGraphics(); + graphics.drawImage(image,0,0,null); + + int actualWidth = image.getWidth(null); + int actualHeight = image.getHeight(null); + + width = (actualWidth < width) ? actualWidth : width; + height = (actualHeight < height) ? actualHeight : height; + + //int x = 0, y = 250, w = 400, h = 380; + + // Clip the central part of the image + int x = (actualWidth - width)/2; + int y = (actualHeight - height)/2; + + bufferedImage = bufferedImage.getSubimage(x,y,width,height); + + //get a writer and set compression + Iterator iter = ImageIO.getImageWritersByFormatName("JPG"); + + if(iter.hasNext()) + { + ImageWriter writer = (ImageWriter) iter.next(); + ImageWriteParam iwp = writer.getDefaultWriteParam(); + iwp.setCompressionMode(ImageWriteParam.MODE_EXPLICIT); + iwp.setCompressionQuality(0.75f); + + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + MemoryCacheImageOutputStream mos = new MemoryCacheImageOutputStream(bos); + + writer.setOutput(mos); + + IIOImage iIOimage = new IIOImage(bufferedImage,null,null); + writer.write(null,iIOimage,iwp); + + return bos.toByteArray(); + } + + return null; + + } + + + public static byte[] addImageSquareBorder(Properties ctx, byte[] imageData,double borderWidth, String trxName) throws OperationException + { + + + char copyrightSign = 169; + String copyright_notice = copyrightSign + " " + Calendar.getInstance().get(Calendar.YEAR) + " Tamak"; + + Image image = new ImageIcon(imageData).getImage(); + Image backImage = new ImageIcon(getBackImageData()).getImage(); + + + int width = image.getWidth(null); + int height = image.getHeight(null); + + int frameWidth = backImage.getWidth(null); + int frameHeight = backImage.getHeight(null); + + + BufferedImage bufferedImage = new BufferedImage((int)frameWidth,(int)(frameHeight),BufferedImage.TYPE_USHORT_565_RGB); + Graphics2D g = (Graphics2D) bufferedImage.getGraphics(); + + // Draw back image + g.drawImage(backImage, 0, 0, null); + + + // Draw Image in the center of the background + double imagePosX = (frameWidth - (double)width)/2; + double imagePosY = (frameHeight - (double)height)/2; + g.drawImage(image, (int)imagePosX, (int)imagePosY, null); + + // Put Copyright Notice + g.setColor(Color.BLACK); + g.setFont(new Font("Arial", Font.PLAIN, 10)); + g.drawString(copyright_notice, 10.0F, (float)(frameHeight - 5)); + + //get a writer and set compression + Iterator iter = ImageIO.getImageWritersByFormatName("JPG"); + + if(iter.hasNext()) + { + ImageWriter writer = (ImageWriter) iter.next(); + ImageWriteParam iwp = writer.getDefaultWriteParam(); + iwp.setCompressionMode(ImageWriteParam.MODE_EXPLICIT); + iwp.setCompressionQuality(0.75f); + + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + MemoryCacheImageOutputStream mos = new MemoryCacheImageOutputStream(bos); + + writer.setOutput(mos); + + try + { + IIOImage iIOimage = new IIOImage(bufferedImage,null,null); + writer.write(null,iIOimage,iwp); + + byte retData[] = bos.toByteArray(); + mos.close(); + bos.close(); + return retData; + } + catch(IOException ex) + { + throw new OperationException("Could not write image", ex); + } + } + + throw new OperationException("JPG Image format is not supported!!!"); + + } + + public static void reprocessAllProductImages(Properties ctx) throws OperationException + { + int adClientID = Env.getAD_Client_ID(ctx); + + String sqlStmt = "Select M_Product_ID from M_Product where AD_Client_ID=" + adClientID + + " and AD_Org_ID=" + Env.getAD_Org_ID(ctx); + + PreparedStatement pstmt = null; + + try + { + pstmt = DB.prepareStatement(sqlStmt, null); + ResultSet rs = pstmt.executeQuery(); + + while(rs.next()) + { + int productId = rs.getInt(1); +// System.out.println(productId); + reprocessImage(ctx, productId); + } + + rs.close(); + } + catch(SQLException ex) + { + throw new OperationException("Could not execute query for products: " + sqlStmt, ex); + } + finally + { + try + { + pstmt.close(); + } + catch(Exception e) + {} + + pstmt = null; + } + + } + + public static void reprocessImages(Properties ctx, int productIds[], String trxName) throws OperationException + { + for(int i = 0; i < productIds.length; i++) + { + reprocessImage(ctx, productIds[i]); + } + } + + public static void reprocessImages(Properties ctx, Integer productIds[]) throws OperationException + { + for(int i = 0; i < productIds.length; i++) + { + reprocessImage(ctx, productIds[i].intValue()); + } + } + + public static void reprocessImage(Properties ctx, int productId) + { + Trx trx = Trx.get(TrxPrefix.getPrefix(), true); + + + try + { + trx.start(); + ProductImageUploader.generateAllSubImages(ctx, productId, trx.getTrxName()); + trx.commit(); + } + catch(OperationException ex) + { + trx.rollback(); + } + finally + { + trx.close(); + } + } + + public static void clearImages(Properties ctx, int product_id, String trxName) + { + MAttachment attachment = MAttachment.get(ctx,MProduct.Table_ID,product_id); + if(attachment != null) + { + attachment.delete(true); + } + } +} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/administration/ProductManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/administration/ProductManager.java new file mode 100644 index 0000000000..9944cda1f1 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/businesslogic/administration/ProductManager.java @@ -0,0 +1,1056 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Aug 19, 2005 by alok + * + */ +package org.posterita.businesslogic.administration; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Properties; +import java.util.StringTokenizer; + +import org.compiere.model.MAttachment; +import org.compiere.model.MAttachmentEntry; +import org.compiere.model.MAttributeValue; +import org.compiere.model.MPriceList; +import org.compiere.model.MProduct; +import org.compiere.model.MProductPrice; +import org.compiere.model.MRevenueRecognition; +import org.compiere.model.MSequence; +import org.compiere.model.MTax; +import org.compiere.model.MTaxCategory; +import org.compiere.model.MUOM; +import org.compiere.util.DB; +import org.compiere.util.Env; +import org.posterita.beans.ProductBean; +import org.posterita.beans.ProductDetailsBean; +import org.posterita.beans.ProductImageBean; +import org.posterita.beans.ProductImageInfo; +import org.posterita.beans.ProductQuery; +import org.posterita.beans.ProductStatusBean; +import org.posterita.beans.SearchBean; +import org.posterita.businesslogic.POSProductManager; +import org.posterita.businesslogic.POSTerminalManager; +import org.posterita.businesslogic.SearchManager; +import org.posterita.businesslogic.StoreManager; +import org.posterita.businesslogic.core.AttachmentManager; +import org.posterita.businesslogic.product.GenericProductImpl; +import org.posterita.businesslogic.product.IProduct; +import org.posterita.exceptions.AttachmentNotFoundException; +import org.posterita.exceptions.BarcodeAlreadyExistsException; +import org.posterita.exceptions.CannotInactivateProductException; +import org.posterita.exceptions.OperationException; +import org.posterita.exceptions.ProductNotFoundException; +import org.posterita.exceptions.SystemException; +import org.posterita.lib.UdiConstants; +import org.posterita.model.MMAttachment; +import org.posterita.util.PoManager; + +public class ProductManager +{ + public static final String PRODUCT_ATTRIBUTES_DELIMETER = "~"; + + private static IProduct getProductInterface(Properties ctx, int productId, String trxName) throws OperationException + { + return new GenericProductImpl(); + } + + public static int getSimilarProduct(Properties ctx, String productName, String trxName) + { + productName=productName.replaceAll("'","''"); + String whereClause = "AD_Client_id="+Env.getAD_Client_ID(ctx)+ + " and Upper(name) =Upper('"+productName + "')"; + + int productIds[] = MProduct.getAllIDs(MProduct.Table_Name, whereClause, trxName); + + if(productIds.length == 0) + return 0; + else + return productIds[0]; + } + + public static boolean isBarCodePresent(Properties ctx,String barCode, String trxName) + { + String whereClause = "AD_Client_id="+Env.getAD_Client_ID(ctx)+ + " and UPC ='"+barCode + "'"; + + int productIds[] = MProduct.getAllIDs(MProduct.Table_Name, whereClause, trxName); + + if(productIds.length == 0) + return false; + else + return true; + } + public static int getUOMPrecision(Properties ctx, Integer productId) + { + MProduct product = MProduct.get(ctx, productId); + int uomId = product.getC_UOM_ID(); + int precision = MUOM.getPrecision(ctx, uomId); + + return precision; + } + + + public static String getAttributeSearchSQL(Properties ctx, ProductQuery query) throws OperationException + { + int[] attributeValues = query.getAttributeValueIds(); + + String attributeSearchSQL = ""; + + MAttributeValue attributeValue; + for (int i = 0; i < attributeValues.length; i++) + { + if (attributeValues[i]!= 0) + { + attributeValue = new MAttributeValue(ctx, attributeValues[i], null ); + attributeSearchSQL = attributeSearchSQL + generateAttributeSearchSQL(ctx, attributeValue.getM_Attribute_ID(), attributeValue.getM_AttributeValue_ID()); + } + } + + return attributeSearchSQL; + } + + private static String generateAttributeSearchSQL(Properties ctx, int attributeId, int attributeValueId) throws OperationException + { + + String sql = " AND p.M_AttributeSetInstance_ID IN" + + " (SELECT M_AttributeSetInstance_ID FROM M_AttributeInstance WHERE M_Attribute_ID=@M_ATTRIBUTE_ID@ AND M_AttributeValue_ID=@M_ATTRIBUTEVALUE_ID@ and AD_CLIENT_ID = " + Env.getAD_Client_ID(ctx) + " and AD_ORG_ID = " + Env.getAD_Org_ID(ctx) + " )"; + + sql = sql.replaceAll("@M_ATTRIBUTE_ID@", "" + attributeId); + sql = sql.replaceAll("@M_ATTRIBUTEVALUE_ID@", "" + attributeValueId); + + return sql; + } + + public static void sortProducts(Properties ctx, ArrayList products) + { + Comparator productNameComparator = new Comparator() + { + public int compare(ProductBean o1, ProductBean o2) + { + ProductBean bean1 = (ProductBean) o1; + ProductBean bean2 = (ProductBean) o2; + + if (bean1.getProductName() == null) + return -1; + + if (bean2.getProductName() == null) + return -1; + + return (bean1.getProductName().compareToIgnoreCase(bean2.getProductName())); + + } + }; + Collections.sort(products, productNameComparator); + } + + public static BigDecimal getStdPrice(Properties ctx, int priceListVersionId, int productId, boolean isSales, String trxName) throws OperationException + { + + MProductPrice pp = MProductPrice.get(ctx, priceListVersionId, productId, trxName); + BigDecimal price = Env.ZERO; + if (pp!=null) + { + price = pp.getPriceStd(); + } + + if (price == null || price.doubleValue() == 0f) + { + pp = getTerminalOrStoreProductPrice(ctx, productId, isSales, trxName); + if (pp!=null) + { + price = pp.getPriceStd(); + } + } + return price; + } + + public static BigDecimal getListPrice(Properties ctx, int priceListVersionId, int productId, boolean isSales, String trxName) throws OperationException + { + + MProductPrice pp = MProductPrice.get(ctx, priceListVersionId, productId, trxName); + BigDecimal price = Env.ZERO; + if (pp!=null) + { + price = pp.getPriceList(); + } + + if (price == null || price.doubleValue() == 0f) + { + pp = getTerminalOrStoreProductPrice(ctx, productId, isSales, trxName); + + if (pp!=null) + { + price = pp.getPriceList(); + } + } + return price; + } + + private static MProductPrice getTerminalOrStoreProductPrice(Properties ctx, int productId, boolean isSales, String trxName) throws OperationException + { + int priceListId = 0; + + if (isSales) + { + priceListId = POSTerminalManager.getSOPriceListId(ctx); + } + else + { + priceListId = StoreManager.getPriceListId(ctx); + } + + int priceListVersionId = PriceListManager.getPriceListVersionID(ctx, priceListId, trxName); + MProductPrice pp = MProductPrice.get(ctx, priceListVersionId, productId, trxName); + return pp; + } + + public static BigDecimal getLimitPrice(Properties ctx, int priceListVersionId, int productId, boolean isSales, String trxName) throws OperationException + { + + MProductPrice pp = MProductPrice.get(ctx, priceListVersionId, productId, trxName); + BigDecimal price = Env.ZERO; + if (pp!=null) + { + price = pp.getPriceLimit(); + } + if (price == null || price.doubleValue() == 0f) + { + pp = getTerminalOrStoreProductPrice(ctx, productId, isSales, trxName); + if (pp!=null) + { + price = pp.getPriceLimit(); + } + } + return price; + } + + public static ArrayList getProductsToAttachImage(Properties ctx, String prodNameLike, boolean isActive, boolean isWebstoreFeatured) throws OperationException + { + ArrayList productList = getProductList(ctx, prodNameLike, isActive, isWebstoreFeatured); + + Iterator iter = productList.iterator(); + + ProductStatusBean bean; + ProductImageInfo info; + + while (iter.hasNext()) + { + bean = (ProductStatusBean) iter.next(); + info = getProductImageInfo(ctx, bean.getProductId()); + bean.setHasAttachment(info.getHasAttachment()); + } + + return productList; + } + + public static ArrayList getProductList(Properties ctx, String prodNameLike, boolean isActive, boolean isWebstoreFeatured) throws OperationException + { + String sql = "select distinct m_product_id, name, isWebstoreFeatured " + + ", keyword, keyword2, keyword3, keyword4, upc,CLASSIFICATION, isSelfService " + + " from m_product where ad_org_id=" + Env.getAD_Org_ID(ctx) + + " and ad_client_id=" + Env.getAD_Client_ID(ctx); + + if(prodNameLike != null && prodNameLike.length() > 0) + { + SearchBean searchBean = SearchManager.getSearchParams(prodNameLike); + ArrayList andSearchList = searchBean.getAndCriteriasList(); + Iterator andListIter = andSearchList.iterator(); + while(andListIter.hasNext()) + { + String andCriteria = andListIter.next(); + sql += " and ( Upper(name) like Upper('%" + andCriteria + "%') "; + sql += " or Upper(keyword) like Upper('%" + andCriteria + "%') "; + sql += " or Upper(keyword2) like Upper('%" + andCriteria + "%') "; + sql += " or Upper(keyword3) like Upper('%" + andCriteria + "%') "; + sql += " or Upper(keyword4) like Upper('%" + andCriteria + "%') ) "; + } + + ArrayList orSearchList = searchBean.getOrCriteriasList(); + Iterator orListIter = orSearchList.iterator(); + if(orListIter.hasNext()) + { + sql += " and ( "; + while(orListIter.hasNext()) + { + String orCriteria = orListIter.next(); + sql += " Upper(name) like Upper('%" + orCriteria + "%') "; + sql += " or Upper(keyword) like Upper('%" + orCriteria + "%') "; + sql += " or Upper(keyword2) like Upper('%" + orCriteria + "%') "; + sql += " or Upper(keyword3) like Upper('%" + orCriteria + "%') "; + sql += " or Upper(keyword4) like Upper('%" + orCriteria + "%') or"; + } + + sql = sql.substring(0, sql.length() -3 ); + sql += " ) "; + } + } + + if(isActive) + sql += " and IsActive='Y' "; + else + sql += " and IsActive='N' "; + + if(isWebstoreFeatured) + sql += " and IsWebstoreFeatured='Y' "; + else + sql += " and IsWebstoreFeatured='N' "; + + sql += " order by name"; + + PreparedStatement ps = DB.prepareStatement(sql, null); + + ResultSet rs = null; + ProductStatusBean bean; + ArrayList productStatusList = new ArrayList(); + try + { + rs = ps.executeQuery(); + + while (rs.next()) + { + bean = new ProductStatusBean(); + bean.setProductId(Integer.valueOf(rs.getInt(1))); + bean.setProductName(rs.getString(2)); + bean.setKeyword1(rs.getString(4)); + bean.setKeyword2(rs.getString(5)); + bean.setKeyword3(rs.getString(6)); + bean.setKeyword4(rs.getString(7)); + bean.setBarCode(rs.getString(8)); + bean.setProductClassification(rs.getString(9)); + + + boolean isSelfService = false; + String selfServiceStr = rs.getString(10); + if(selfServiceStr != null) + isSelfService = "Y".equals(selfServiceStr); + + bean.setIsSelfService(isSelfService); + + boolean isWebstoredFeatured = false; + String isWStoreFeatured = rs.getString(3); + if(isWStoreFeatured != null) + isWebstoredFeatured = "Y".equals(isWStoreFeatured); + + bean.setIsWebstoreFeatured(Boolean.valueOf(isWebstoredFeatured)); + productStatusList.add(bean); + } + + rs.close(); + + } + catch (SQLException e) + { + throw new OperationException(e); + } + finally + { + try + { + ps.close(); + } + catch (SQLException e1) + {} + + ps = null; + } + + return productStatusList; + } + + /** + * Search product by Name and/or Description + * Ability to Search by using + concatenation + * Picks Price List and Warehouse from Terminal + * @param ctx Context + * @param nameSearch Name like search + * @param descSearch Description like search + * @param trxName Transaction + * @return List of Product Status + * @throws OperationException if error occurred in search + */ + public static ArrayList searchProducts(Properties ctx, int adOrgId, + String nameSearch, String descSearch, String trxName) throws OperationException + { + int priceListId = POSTerminalManager.getSOPriceListId(ctx); + int warehouseId = POSTerminalManager.getWarehouseId(ctx); + + return searchProducts(ctx, adOrgId, nameSearch, descSearch, priceListId, warehouseId, trxName); + } + + /** + * Search product by Name and/or Description + * Ability to Search by using + concatenation + * @param ctx Context + * @param adOrgId Organisation on which to look up for stock + * @param nameSearch Name like search + * @param descSearch Description like search + * @param priceListId Price List on which to search product prices + * @param trxName Transaction + * @return List of Product Status + * @throws OperationException if error occurred in search + */ + public static ArrayList searchProducts(Properties ctx, int adOrgId, + String nameSearch, String descSearch, + int priceListId, int warehouseId, String trxName) throws OperationException + { + if (adOrgId <= 0) + { + throw new IllegalArgumentException("Organisation mandatory"); + } + + if (warehouseId <= 0) + { + throw new IllegalArgumentException("Warehouse mandatory"); + } + + if (priceListId <= 0) + { + throw new IllegalArgumentException("Price List mandatory"); + } + + nameSearch = (nameSearch == null) ? "" : nameSearch; + descSearch = (descSearch == null) ? "" : descSearch; + + int priceListVersionId = PriceListManager.getPriceListVersionID(ctx, priceListId, null, null); + + StringTokenizer stName = new StringTokenizer(nameSearch, "+"); + StringTokenizer stDesc = new StringTokenizer(descSearch, "+"); + + StringBuffer sqlStmt = new StringBuffer(); + sqlStmt.append("SELECT p.Name, "); // 1 + sqlStmt.append("p.M_Product_ID, p.UPC, p.Description, "); // 2,3,4 + sqlStmt.append("SUM(s.QtyOnHand), pp.PriceList "); // 5,6 + sqlStmt.append("FROM M_Product p INNER JOIN (M_Storage s INNER JOIN M_ProductPrice pp ON "); + sqlStmt.append("s.M_Product_ID=pp.M_Product_ID) ON p.M_Product_ID=s.M_Product_ID "); + sqlStmt.append("WHERE p.AD_Client_ID=? "); + sqlStmt.append("AND pp.M_PriceList_Version_ID=? "); + sqlStmt.append("AND s.AD_Org_ID=? "); + sqlStmt.append("AND s.M_Locator_ID IN (SELECT M_Locator_ID FROM M_Locator WHERE M_Warehouse_ID=?) "); + sqlStmt.append("AND p.AD_Org_ID IN (").append(Env.getContext(ctx,UdiConstants.ROLE_EDITABLE_ORGS_CTX_PARAM)).append(") "); + + ArrayList params = new ArrayList(); + String token = null; + while(stName.hasMoreTokens()) + { + token = stName.nextToken().trim(); + token = "%" + token + "%"; + params.add(token); + + sqlStmt.append("AND UPPER(p.Name) LIKE UPPER(?)"); + } + + while(stDesc.hasMoreTokens()) + { + token = stDesc.nextToken().trim(); + token = "%" + token + "%"; + params.add(token); + + sqlStmt.append("AND UPPER(p.Description) LIKE UPPER(?)"); + } + + sqlStmt.append("AND p.IsActive='Y' AND s.IsActive= 'Y' AND pp.IsActive='Y' "); + sqlStmt.append("GROUP BY p.Name, p.M_Product_ID, p.UPC, p.Description, pp.PriceList "); + sqlStmt.append("ORDER BY p.name"); + + MPriceList spriceList = new MPriceList(ctx, priceListId, null); + + PreparedStatement pstmt = null; + ResultSet rs = null; + ProductStatusBean bean; + ArrayList productStatusList = new ArrayList(); + try + { + pstmt = DB.prepareStatement(sqlStmt.toString(), trxName); + pstmt.setInt(1, Env.getAD_Client_ID(ctx)); + pstmt.setInt(2, priceListVersionId); + pstmt.setInt(3, adOrgId); + pstmt.setInt(4, warehouseId); + + int index = 5; + + for(String s : params) + { + pstmt.setString(index, s); + index ++; + } + + rs = pstmt.executeQuery(); + + while (rs.next()) + { + String productName = rs.getString(1); + Integer productId = Integer.valueOf(rs.getInt(2)); + + MProduct product = MProduct.get(ctx, productId); + int taxCategoryId = product.getC_TaxCategory_ID(); + MTax tax = TaxManager.getTaxFromCategory(ctx, taxCategoryId, null); + + String barcode = rs.getString(3); + String description = rs.getString(4); + BigDecimal qtyOnHand = rs.getBigDecimal(5); + + + BigDecimal priceList = Env.ZERO; + if(spriceList.isTaxIncluded()) + { + priceList = rs.getBigDecimal(6); + } + else + { + priceList = rs.getBigDecimal(6).multiply((tax.getRate().divide(Env.ONEHUNDRED)).add(Env.ONE)); + } + priceList = priceList.setScale(2, RoundingMode.HALF_DOWN); + bean = new ProductStatusBean(); + bean.setProductName(productName = productName==null?"":productName); + bean.setProductId(productId); + bean.setBarCode(barcode = barcode==null?"":barcode); + bean.setDescription(description = description==null?"":description); + bean.setQtyOnHand(qtyOnHand = qtyOnHand==null?Env.ZERO:qtyOnHand); + bean.setPriceStandard(priceList = priceList==null?Env.ZERO:priceList); + productStatusList.add(bean); + } + } + catch (SQLException e) + { + throw new OperationException(e); + } + finally + { + DB.close(rs, pstmt); + } + + return productStatusList; + } + + /** + * Search for product by name that is present in stock for an organisation + * @param ctx Context + * @param orgId Organisation + * @param searchString search + * @param trxName Transaction + * @return List of Product Status + * @throws OperationException if error in query execution + */ + public static ArrayList searchProductsFromStock(Properties ctx, int orgId, + String searchString, String trxName) throws OperationException + { + searchString = (searchString == null) ? "" : searchString; + + StringTokenizer st = new StringTokenizer(searchString,"+"); + StringBuffer sqlStmt = new StringBuffer(); + sqlStmt.append("SELECT DISTINCT p.Name, s.M_Product_ID, p.UPC FROM M_Product p "); + sqlStmt.append("INNER JOIN M_Storage s ON p.M_Product_ID=s.M_Product_ID "); + sqlStmt.append("WHERE p.AD_Client_ID=? "); + sqlStmt.append("AND s.AD_Org_ID=? "); + + String token = null; + while(st.hasMoreTokens()) + { + token = st.nextToken().trim(); + sqlStmt.append("AND UPPER(p.Name) LIKE UPPER('%"+token+"%' ) "); + } + + sqlStmt.append("AND p.IsActive='Y' ORDER BY p.name, s.M_Product_ID, p.UPC"); + + PreparedStatement pstmt = null; + ResultSet rs = null; + ProductStatusBean bean; + ArrayList productStatusList = new ArrayList(); + try + { + pstmt = DB.prepareStatement(sqlStmt.toString(), trxName); + pstmt.setInt(1, Env.getAD_Client_ID(ctx)); + pstmt.setInt(2, orgId); + rs = pstmt.executeQuery(); + + while (rs.next()) + { + bean = new ProductStatusBean(); + bean.setProductId(Integer.valueOf(rs.getInt(2))); + bean.setProductName(rs.getString(1)); + bean.setBarCode(rs.getString(3)); + productStatusList.add(bean); + } + + rs.close(); + } + catch (SQLException e) + { + throw new OperationException(e); + } + finally + { + DB.close(rs, pstmt); + } + + return productStatusList; + } + + public static int[] getProducts(Properties ctx, String productName, String trxName) + { + int adClientId = Env.getAD_Client_ID(ctx); + int adOrgId = Env.getAD_Org_ID(ctx); + String whereClause = "AD_Client_ID=" + adClientId + " and AD_Org_ID=" + adOrgId; + whereClause += " and upper(Name) like upper('" + productName + "')"; + + int productIds[] = MProduct.getAllIDs(MProduct.Table_Name, whereClause, trxName); + + return productIds; + } + + public static int[] getProducts(Properties ctx, String name, String description, String barCode, String trxName) throws OperationException + { + String orgIds = Env.getContext(ctx,UdiConstants.ROLE_EDITABLE_ORGS_CTX_PARAM); + int productIds[] = getProducts(ctx, name, orgIds, description, barCode, trxName); + + return productIds; + } + public static int[] getProducts(Properties ctx, String name, String orgIds, String description, String barCode, String trxName) throws OperationException + { + int adClientId = Env.getAD_Client_ID(ctx); + + if (orgIds == null) + { + throw new OperationException("orgIds cannot be null"); + } + + StringBuffer whereClause = new StringBuffer("AD_Client_ID=" + adClientId + " AND AD_Org_ID IN (" + orgIds +")"); + + if (name != null && !"".equals(name)) + { + whereClause.append(" AND UPPER(name) LIKE UPPER('%" + name + "%')"); + + } + if (description != null && !"".equals(description)) + { + whereClause.append(" AND UPPER(description) LIKE UPPER('%" + description + "%')"); + } + if (barCode != null && !"".equals(barCode)) + { + whereClause.append(" AND UPPER(upc) = UPPER('" + barCode + "')"); + } + + int productIds[] = MProduct.getAllIDs(MProduct.Table_Name, whereClause.toString(), trxName); + + return productIds; + } + + + public static Integer[] getAllProductsHavingAttributeValue(Properties ctx, int attributeValueId) throws SystemException + { + String sql = "select prod.M_PRODUCT_ID " + + "from M_PRODUCT prod,M_ATTRIBUTEINSTANCE attrIns ,M_attribute attr,M_attributeValue attrVal " + + "where prod.M_ATTRIBUTESETINSTANCE_id = attrIns.M_ATTRIBUTESETINSTANCE_id " + + "and prod.isActive = 'Y' " + + "and attr.m_attribute_id = attrIns.M_ATTRIBUTE_ID " + + "and attrIns.m_attributevalue_id = attrVal.m_attributevalue_id " + + "and attrVal.m_attributevalue_id = " + attributeValueId ; + + + PreparedStatement pstmt = null; + ResultSet rs = null; + Integer[] productIds = null; + + try + { + pstmt = DB.prepareStatement(sql, null); + + + + rs = pstmt.executeQuery(); + ArrayList productList = new ArrayList(); + + while(rs.next()) + { + productList.add(Integer.valueOf(rs.getInt(1))); + } + + productIds = new Integer[productList.size()]; + + for(int i=0;i 1) + throw new OperationException("More than one product found with Name: " + productName); + + MProduct product = new MProduct(ctx, productIds[0], trxName); + + return product; + } + + public static MProduct loadProduct(Properties ctx, int productId, String trxName) throws ProductNotFoundException + { + MProduct product = new MProduct(ctx, productId, trxName); + if(product.get_ID() == 0) + throw new ProductNotFoundException("Could not load product with id: " + productId); + return product; + } + + public static String getDistinctFieldSQL(Properties ctx, String fieldName) + { + String sql = "select distinct(" + fieldName + ") from m_product " + + " where ad_client_id=" + Env.getAD_Client_ID(ctx) + + " and AD_Org_ID=" + Env.getAD_Org_ID(ctx) + + " and isActive='Y'" + + " and IsWebstoreFeatured='Y'" + + " and " + fieldName + " is not null"; + + return sql; + } + + + public static void activateProducts(Properties ctx, Integer[] productIds, String trxName) throws OperationException + { + setProductsActive(ctx, productIds, true, trxName); + } + + public static void inactivateProducts(Properties ctx, Integer[] productIds, String trxName) throws OperationException + { + setProductsActive(ctx, productIds, false, trxName); + } + + protected static void setProductsActive(Properties ctx, Integer[] productIds, boolean active, String trxName) throws OperationException + { + if(productIds == null) + throw new OperationException("Product Ids cannot be null"); + + for(int i = 0; i < productIds.length; i++) + { + MProduct product = new MProduct(ctx, productIds[i].intValue(), trxName); + if(product.get_ID() == 0) + throw new OperationException("Could not load product with id: " + productIds[i]); + + if(active == false) + { + String errorMsg=POSProductManager.checkQty(ctx,product.get_ID(),trxName); + if(errorMsg!=null) + throw new CannotInactivateProductException(errorMsg); + + } + product.setIsActive(active); + PoManager.save(product); + } + } + + public static void updateProductsBarcode(Properties ctx, ArrayList productList, String trxName) throws OperationException + { + Iterator iter = productList.iterator(); + + while(iter.hasNext()) + { + ProductImageBean prodImageBean = (ProductImageBean)iter.next(); + if(prodImageBean.getBarCode() != null && prodImageBean.getBarCode().length() > 0) + updateProductBarcode(ctx, prodImageBean.getProductId().intValue(), prodImageBean.getBarCode(), trxName); + } + } + + public static void updateProductBarcode(Properties ctx, int productId, String barCode, String trxName) throws BarcodeAlreadyExistsException, OperationException + { + if(isBarCodePresent(ctx, barCode, trxName)) + throw new BarcodeAlreadyExistsException("Barcode " + barCode + " has already been assigned to another product"); + MProduct product = new MProduct(ctx, productId, trxName); + if(product.get_ID() == 0) + throw new OperationException("Could not load product with id: " + productId); + + + product.setUPC(barCode); + + PoManager.save(product); + } + + + public static int[] getProductsFromAttributeValue(Properties ctx, int attributeId, int attributeValueId, String trxName) + { + int adClientId = Env.getAD_Client_ID(ctx); + int adOrgId = Env.getAD_Org_ID(ctx); + + String whereClause = "AD_Client_ID=" + adClientId + " and AD_Org_ID=" + adOrgId + " and IsActive='Y'"; + whereClause += " and M_AttributeSetInstance_ID in "; + whereClause += " (select M_AttributeSetInstance_ID from M_AttributeInstance where M_Attribute_ID=" + attributeId + " and M_AttributeValue_ID=" + attributeValueId + ")"; + + return MProduct.getAllIDs(MProduct.Table_Name, whereClause, trxName); + } + + public static boolean isProductImagePresent(Properties ctx, int productId, String trxName) + { + MAttachment attachment = MAttachment.get(ctx, MProduct.Table_ID, productId); + + if(attachment == null) + return false; + + ArrayList attachmentEntryList = AttachmentManager.getAttachmentEntriesWithSuffix(ctx, attachment, UdiConstants.IMAGE_EXTENSION, trxName); + + return (attachmentEntryList.size() > 0); + } + + public static ProductDetailsBean getProductDetailInfo(Properties ctx, int productId, String trxName) throws OperationException + { + ProductDetailsBean prodDetailsBean = new ProductDetailsBean(); + MProduct product = loadProduct(ctx, productId, trxName); + + prodDetailsBean.setProductId(productId); + prodDetailsBean.setProductName(product.getName()); + prodDetailsBean.setDescription(product.getDescription()); + prodDetailsBean.setBarCode(product.getUPC()); + prodDetailsBean.setIsActive(product.isActive()); + + int taxCategoryId = product.getC_TaxCategory_ID(); + MTaxCategory taxCategory = new MTaxCategory(ctx, taxCategoryId, trxName); + prodDetailsBean.setTaxCategoryName(taxCategory.getName()); + + int revenueRecognitionId = product.getC_RevenueRecognition_ID(); + MRevenueRecognition revenueRecognition = new MRevenueRecognition(ctx, revenueRecognitionId, trxName); + prodDetailsBean.setRevenueRecognition(revenueRecognition.getName()); + //prodDetailsBean.setStdSalesPrice() + + prodDetailsBean.setHasImage(isProductImagePresent(ctx, productId, trxName)); + + return prodDetailsBean; + } + + public static String getBarcode(Properties ctx, int productId, String trxName) throws OperationException + { + String barcode = getBarcodeForSimilarProducts(ctx, productId, trxName); + + if( barcode == null) + { + barcode = createBarcode(ctx, productId, trxName); + } + + return barcode; + } + + public static String getBarcodeForSimilarProducts(Properties ctx, int productId, String trxName) throws OperationException + { + IProduct iProd = getProductInterface(ctx, productId, trxName); + + return iProd.getBarcodeForSimilarProducts(ctx, productId, trxName); + } + + public MProduct[] getAllOrgsProducts(Properties ctx, String productName, String trxName) + { + int adClientID = Env.getAD_Client_ID(ctx); + int adOrgID = Env.getAD_Org_ID(ctx); + + String whereClause = "AD_Client_ID=" + adClientID + " and AD_Org_ID=" + adOrgID; + whereClause += " and Name like'" + productName + "'"; + + return MProduct.get(ctx, whereClause, trxName); + } + + private static String createBarcode(Properties ctx, int productId, String trxName) throws OperationException + { + MSequence sequence = BarcodeManager.getBarcodeSequence(ctx, trxName); + + int nextID = sequence.getCurrentNext() + sequence.getIncrementNo(); + sequence.setCurrentNext(nextID); + + PoManager.save(sequence); + + StringBuffer barcode = new StringBuffer(); + + barcode.append(sequence.getPrefix()); + barcode.append(nextID); + + return barcode.toString(); + } + + public static Timestamp getProductLastUpdatedTime(Properties ctx, int productId, String trxName) throws OperationException + { + String sql = "Select updated from M_Product where M_Product_ID=" + productId; + + PreparedStatement pstmt = null; + Timestamp retVal = null; + try + { + pstmt = DB.prepareStatement(sql, trxName); + ResultSet rs = pstmt.executeQuery(); + if(rs.next()) + retVal = rs.getTimestamp(1); + + rs.close(); + } + catch(SQLException ex) + { + throw new OperationException("Could not get Product Last update time with sql: " + sql); + } + finally + { + try + { + pstmt.close(); + } + catch(Exception e) + {} + + pstmt = null; + } + + if(retVal == null) + throw new OperationException("Could not retrieve product updated time with productId: " + productId); + + return retVal; + } + + public static HashMap getAllImages(Properties ctx, int productId, String trxName) throws OperationException + { + IProduct iProd = getProductInterface(ctx, productId, trxName); + + return iProd.getAllImages(ctx, productId, trxName); + } + + +} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/administration/RoleManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/administration/RoleManager.java new file mode 100644 index 0000000000..7c1300446b --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/businesslogic/administration/RoleManager.java @@ -0,0 +1,826 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 27-Jul-2005 by alok + * + */ +package org.posterita.businesslogic.administration; + +import java.math.BigDecimal; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.Properties; + +import org.compiere.model.MOrg; +import org.compiere.model.MRole; +import org.compiere.model.MRoleMenu; +import org.compiere.model.MRoleOrgAccess; +import org.compiere.model.MUserRoles; +import org.compiere.util.DB; +import org.compiere.util.Env; +import org.compiere.util.KeyNamePair; +import org.posterita.Constants; +import org.posterita.beans.RoleBean; +import org.posterita.businesslogic.MenuManager; +import org.posterita.businesslogic.OrganisationManager; +import org.posterita.businesslogic.RoleMenuManager; +import org.posterita.core.MenuItem; +import org.posterita.exceptions.DuplicateRoleException; +import org.posterita.exceptions.NoAccessToEditObjectException; +import org.posterita.exceptions.NoCheckBoxSelectedException; +import org.posterita.exceptions.OperationException; +import org.posterita.exceptions.RoleAlreadyExistsException; +import org.posterita.exceptions.SystemException; +import org.posterita.lib.UdiConstants; +import org.posterita.model.MWebMenu; +import org.posterita.util.PoManager; + + +public class RoleManager +{ + + + + public static MRole createRole(Properties ctx, int orgId, String roleName, boolean isAccessAllOrgs, BigDecimal userDiscount, boolean overwritePriceLimit, boolean isDiscountAllowedOnTotal, boolean isDiscountUptoLimitPrice, boolean canCreateOrder, boolean canAlterOrder, boolean canViewOrder, String trxName) throws OperationException, RoleAlreadyExistsException + { + + String whereClause = "ad_client_id = " + Env.getAD_Client_ID(ctx) +" and ad_org_id in ("+Env.getContext(ctx,UdiConstants.ROLE_EDITABLE_ORGS_CTX_PARAM) + ") and name = '"+ roleName +"'"; + + int id[] = MRole.getAllIDs(MRole.Table_Name,whereClause,trxName); + + if(id.length > 0) + { + throw new RoleAlreadyExistsException("Please enter another name for the role. Role " + roleName + "already exists."); + } + + Properties newCtx = (Properties) ctx.clone(); + + Env.setContext(newCtx, "#AD_User_ID", 100); + MRole role = new MRole(newCtx, 0, trxName); + + role.setName(roleName); + role.setUserDiscount(BigDecimal.valueOf(0.00)); + role.setIsPersonalAccess(true); + role.setIsAccessAllOrgs(isAccessAllOrgs); + role.setUserDiscount(userDiscount); + role.setOverwritePriceLimit(overwritePriceLimit); + role.setIsDiscountAllowedOnTotal(isDiscountAllowedOnTotal); + role.setIsDiscountUptoLimitPrice(isDiscountUptoLimitPrice); + role.setAD_Org_ID(orgId); + role.setIsAccessAllOrgs(isAccessAllOrgs); + + + role.setUserLevel(MRole.USERLEVEL_Organization); + + PoManager.save(role); + + + MRoleOrgAccess orgAccess = new MRoleOrgAccess(role,orgId); + PoManager.save(orgAccess); + + return role; + } + + + + + public static MRole createRole(Properties ctx, int orgId, String roleName,Boolean isAccessAllOrgs, Integer[] menuId, BigDecimal userDiscount, Boolean overwriteLimitPrice, Boolean isDiscountAllowedOnTotal, Boolean isDiscountUptoLimitPrice, Boolean canCreateOrder, Boolean canAlterOrder, Boolean canViewOrder, String trxName) throws Exception + { + MRole role = createRole(ctx, orgId, roleName, isAccessAllOrgs.booleanValue(), userDiscount, overwriteLimitPrice.booleanValue(), overwriteLimitPrice.booleanValue(), isDiscountAllowedOnTotal.booleanValue(), canCreateOrder.booleanValue(), canAlterOrder.booleanValue(), canViewOrder.booleanValue(), trxName); + + if(menuId!=null) + { + for(int i=0; i Add default menus e.g. LogOut + int defMenuIds[] = MenuManager.getDefaultMenus(ctx); + for(int i = 0; i < defMenuIds.length; i++) + { + if(!RoleMenuManager.isRoleMenuPresent(ctx, role.get_ID(), defMenuIds[i], trxName)) + RoleMenuManager.createRoleMenu(ctx, role.get_ID(), defMenuIds[i], trxName); + } + + + + return role; + } + + public static RoleBean getRole(Properties ctx, int roleId) throws OperationException + { + RoleBean bean = new RoleBean(); + + MRole role = loadRole(ctx, roleId, null); + + bean.setRoleId(roleId); + bean.setName(role.getName()); + bean.setIsActive(Boolean.valueOf(role.isActive())); + bean.setIsAccessAllOrgs(Boolean.valueOf(role.isAccessAllOrgs())); + bean.setUserDiscount(role.getUserDiscount()); + bean.setIsOverwritePriceLimit(Boolean.valueOf(role.isOverwritePriceLimit())); + bean.setIsDiscountUptoLimitPrice(Boolean.valueOf(role.isDiscountUptoLimitPrice())); + bean.setIsDiscountAllowedOnTotal(role.isDiscountAllowedOnTotal()); + bean.setOrgId(role.getAD_Org_ID()); + + return bean; + } + + public static ArrayList getRoles(Properties ctx, String searchText) + { + ArrayList list = new ArrayList(); + int clientId = Env.getAD_Client_ID(ctx); + + String roleName = ""; + + if (searchText != null) + roleName = searchText; + + int id[] = MRole.getAllIDs(MRole.Table_Name,"upper(name) like '%" + roleName.toUpperCase() + "%' and ad_client_id ="+ clientId +" and isActive = 'Y'"+" and AD_ORG_ID in (" + Env.getContext(ctx,UdiConstants.ROLE_EDITABLE_ORGS_CTX_PARAM)+") order by name",null); + + if (id == null || id.length == 0) + { + return list; + } + + RoleBean bean; + + for(int i=0;i getAllRoles(Properties ctx) + { + ArrayList list = new ArrayList(); + int clientId = Env.getAD_Client_ID(ctx); + + + int id[] = MRole.getAllIDs(MRole.Table_Name," ad_client_id ="+ clientId +" and isActive = 'Y'"+" and AD_ORG_ID in (" + Env.getContext(ctx,UdiConstants.ROLE_EDITABLE_ORGS_CTX_PARAM)+") order by name",null); + + if (id == null || id.length == 0) + { + return list; + } + + RoleBean bean; + + for(int i=0;i 0) + { + MRole role = new MRole(ctx, roleIds[0], null); + return role; + } + else + return createRole(ctx, orgId, roleName, isAccessAllOrgs, userDiscount, overwriteLimitPrice, isDiscountAllowedOnTotal, isDicountUptoLimitPrice ,canCreateOrder, canAlterOrder, canViewOrder, trxName); + } + catch(Exception ex) + { + throw new OperationException("Cannot create role for: " + roleName); + } + } + + public static MRole getOrCreateRole(Properties ctx, int orgId, String roleName,Boolean isAccessAllOrgs, Integer[] menuId, BigDecimal userDiscount, Boolean overwriteLimitPrice, Boolean isDiscountAllowedOnTotal, Boolean isDicountUptoLimitPrice, Boolean canCreateOrder, Boolean canAlterOrder, Boolean canViewOrder, String trxName) throws OperationException + { + int clientId = Env.getAD_Client_ID(ctx); + int adOrgId = Env.getAD_Org_ID(ctx); + try + { + String sqlStatement = " AD_Client_ID=" + clientId + " and AD_Org_ID=" + adOrgId + " and Name='" + roleName + "'"; + int roleIds[] = MRole.getAllIDs(MRole.Table_Name, sqlStatement, null); + + if (roleIds!=null && roleIds.length > 0) + { + MRole role = new MRole(ctx, roleIds[0], null); + return role; + } + else + return createRole(ctx, orgId, roleName, isAccessAllOrgs, menuId, userDiscount, overwriteLimitPrice, isDiscountAllowedOnTotal, isDicountUptoLimitPrice, canCreateOrder, canAlterOrder, canViewOrder, trxName); + } + catch(Exception ex) + { + throw new OperationException("Cannot create role for: " + roleName); + } + + } + + /** + * Gets all the roles assigned to the user + * @param ctx + * @return an arraylist of keynamepairs + * @throws OperationException + */ + public static ArrayList getMyRoles(Properties ctx) throws OperationException + { + int ad_user_id = Env.getAD_User_ID(ctx); + int ad_client_id = Env.getAD_Client_ID(ctx); + + String sql = "select role.AD_ROLE_ID, role.NAME " + + " from AD_USER_ROLES usrRole, AD_USER usr, AD_ROLE role, AD_ORG org " + + " where org.AD_ORG_ID = role.AD_ORG_ID " + + " and usrRole.AD_USER_ID = usr.AD_USER_ID " + + " and usrRole.AD_ROLE_ID = role.AD_ROLE_ID " + + " and role.AD_CLIENT_ID = ? " + + " and usrRole.AD_USER_ID = ? " + + " order by role.NAME"; + + PreparedStatement pstmt = DB.prepareStatement(sql, null); + ResultSet rs = null; + ArrayList roleList = new ArrayList(); + + try + { + pstmt.setInt(1,ad_client_id); + pstmt.setInt(2,ad_user_id); + + rs = pstmt.executeQuery(); + + while(rs.next()) + { + KeyNamePair pair = new KeyNamePair(rs.getInt(1),rs.getString(2)); + + roleList.add(pair); + } + + rs.close(); + } + catch (SQLException e) + { + throw new OperationException(e); + } + finally + { + try + { + pstmt.close(); + } + catch(Exception e) + {} + + pstmt = null; + } + + return roleList; + + } + + public static String getWhereClauseOnUserRolesAccess(Properties ctx, String tableAlias) + { + int roleId = Env.getAD_Role_ID(ctx); + Env.getContext(ctx,UdiConstants.ROLE_EDITABLE_ORGS_CTX_PARAM); + //#User_Org=0,11,12, + MRole userRole = new MRole(ctx,roleId,null); + String whereClause= " and " + tableAlias+"AD_CLIENT_ID"; + + if(userRole.getUserLevel().equals(MRole.USERLEVEL_Client) || userRole.getUserLevel().equals(MRole.USERLEVEL_ClientPlusOrganization)) + { + return whereClause = whereClause +" and isActive='Y'"; + } + + else + { + return whereClause= whereClause +" and "+tableAlias+"AD_ORG_ID="+Env.getAD_Org_ID(ctx); + } + + } + + private static boolean hasMenu(int menuId, ArrayList menus) + { + boolean menuAvailable = false; + for(MWebMenu menu : menus) + { + if(menu.get_ID() == menuId) + { + menuAvailable = true; + break; + } + } + return menuAvailable; + } + + private static void setRoleMenus(MenuItem menuItem, ArrayList menus) + { + ArrayList children = menuItem.getAllChildren(); + for(MenuItem mItem : children) + { + if(mItem.hasSubMenu()) + setRoleMenus(mItem, menus); + else + { + if(hasMenu(mItem.getMenuId(), menus)) + mItem.setAvailable(true); + } + } + } + + public static MenuItem getAvailableMenus(Properties ctx, int roleId) throws SystemException, OperationException + { + ArrayList roleMenus = MenuManager.getMenus(ctx, roleId); + + ArrayList appMenus = MenuManager.getMenusForOrganisationType(ctx); + MenuItem rootItem = MenuManager.buildMenuTree(ctx, appMenus); + + setRoleMenus(rootItem, roleMenus); + + return rootItem; + } + + public static void editRole(Properties ctx, int roleId, String roleName, boolean isAccessAllOrgs, Integer[] menuId, BigDecimal userDiscount, boolean overwritePriceLimit, boolean isDiscountUptoLimitPrice, boolean isDiscountAllowedOnTotal, String trxName) throws OperationException, RoleAlreadyExistsException + { + if(menuId==null) + { + throw new NoCheckBoxSelectedException("Please select a role"); + } + String nameClause = "AD_Client_ID = " + Env.getAD_Client_ID(ctx) + " and Upper(name)='" + roleName.toUpperCase() + "' and AD_Role_ID <> " + roleId; + + int roleIds[] = MRole.getAllIDs(MRole.Table_Name, nameClause, null); + + if (roleIds!=null && roleIds.length > 0) + throw new RoleAlreadyExistsException("Role with name: " + roleName + " already exists"); + + MRole role = loadRole(ctx, roleId, trxName); + + Boolean isEditable = RoleManager.isEditable(ctx, role.getAD_Org_ID()); + + if (!isEditable) + throw new NoAccessToEditObjectException("You do not have the right organisational access for editing"); + + if(userDiscount == null) + { + userDiscount = Env.ZERO; + } + + role.setName(roleName); + role.setIsAccessAllOrgs(isAccessAllOrgs); + role.setUserDiscount(userDiscount); + role.setOverwritePriceLimit(overwritePriceLimit); + role.setIsDiscountUptoLimitPrice(isDiscountUptoLimitPrice); + role.setIsDiscountAllowedOnTotal(isDiscountAllowedOnTotal); + + PoManager.save(role); + + String whereClause = " AD_Role_ID=" + roleId; + int roleMenuIds[] = MRoleMenu.getAllIDs(MRoleMenu.Table_Name, whereClause, trxName); + + // Delete all associated role menus + for(int i = 0; i < roleMenuIds.length; i++) + { + MRoleMenu roleMenu = new MRoleMenu(ctx, roleMenuIds[i], trxName); + roleMenu.delete(true); + } + + // Create role menus assigned + for(int i = 0; i < menuId.length; i++) + { + MRoleMenu roleMenu = new MRoleMenu(ctx, 0, trxName); + roleMenu.setAD_Role_ID(role.get_ID()); + roleMenu.setU_WebMenu_ID(menuId[i]); + PoManager.save(roleMenu); + } + + // Create role menus for all default menus + int defMenuIds[] = MenuManager.getDefaultMenus(ctx); + for(int i = 0; i < defMenuIds.length; i++) + { + MRoleMenu roleMenu = new MRoleMenu(ctx, 0, trxName); + roleMenu.setAD_Role_ID(role.get_ID()); + roleMenu.setU_WebMenu_ID(defMenuIds[i]); + PoManager.save(roleMenu); + } + } + + public static BigDecimal getDiscountAllowed(Properties ctx, int AD_Role_ID, String trxName) throws OperationException + { + BigDecimal discount = BigDecimal.ZERO; + MRole role = MRole.get(ctx, AD_Role_ID); + + if (role != null) + { + discount = role.getUserDiscount(); + } + + return discount; + } + + public static boolean isOverridePriceLimitAllowed(Properties ctx, int AD_Role_ID, String trxName) throws OperationException + { + MRole role = MRole.get(ctx, AD_Role_ID); + + return role.isOverwritePriceLimit(); + } + + public static boolean isDiscountUptoPriceLimit(Properties ctx, int AD_Role_ID, String trxName) throws OperationException + { + MRole role = MRole.get(ctx, AD_Role_ID); + + return role.isDiscountUptoLimitPrice(); + } + + public static boolean isDiscountAllowedOnTotal(Properties ctx, int AD_Role_ID, String trxName) throws OperationException + { + MRole role = MRole.get(ctx, AD_Role_ID); + + return role.isDiscountAllowedOnTotal(); + } + + public static ArrayList getRoleOrgPairs(Properties ctx, String trxName) throws OperationException + { + int roleId = Env.getAD_Role_ID(ctx); + + RoleBean roleBean = getRole(ctx, roleId); + + ArrayList orgPairs = new ArrayList(); + + if (roleBean.getIsAccessAllOrgs()) + { + orgPairs = OrganisationManager.getAllOrgPairs(ctx, trxName); + } + else + { + MOrg org = MOrg.get(ctx, roleBean.getOrgId()); + KeyNamePair pair = org.getKeyNamePair(); + + orgPairs.add(pair); + } + + + return orgPairs; + + } + + + public static ArrayList getRoleOrgAccess(Properties ctx, int roleId) throws OperationException + { + + MRoleOrgAccess[] orgAccessArr = MRoleOrgAccess.getOfRole(ctx, Env.getAD_Role_ID(ctx)); + MRole role = new MRole(ctx, roleId, null); //trxName can be null here as we are just retrieving data that was previously committed and not doing any update + + ArrayList list = new ArrayList(); + + for (int i = 0; i < orgAccessArr.length; i++) + { + MRoleOrgAccess orgAccess = orgAccessArr[i]; + + MOrg org = MOrg.get(ctx, orgAccess.getAD_Org_ID()); + + RoleBean roleBean = new RoleBean(); + roleBean.setRoleId(orgAccess.getAD_Role_ID()); + roleBean.setName(role.getName()); + + if (orgAccess.getAD_Org_ID() == 0) + roleBean.setOrgName(Constants.ALL_ORGANISATIONS); + else + roleBean.setOrgName(org.getName()); + + roleBean.setOrgId(orgAccess.getAD_Org_ID()); + + + String roleOrgAccessSQL = getRoleOrgAccessSQL(); + + PreparedStatement pstmt = DB.prepareStatement(roleOrgAccessSQL, null); + + ResultSet rs = null; + int count = 0; + Boolean isActive = false; + + try + { + pstmt.setInt(1,Env.getAD_Client_ID(ctx)); + pstmt.setInt(2,org.get_ID()); + pstmt.setInt(3,role.get_ID()); + + rs = pstmt.executeQuery(); + + + + while(rs.next()) + { + if (rs.getString(4).equals("Y")) + isActive = true; + + count++; + } + + rs.close(); + } + catch (SQLException e) + { + throw new OperationException(e); + } + finally + { + try + { + pstmt.close(); + } + catch(Exception e) + {} + + pstmt = null; + } + + if (count > 1) + throw new DuplicateRoleException("Duplicate Role Organisation Access"); + else + if (count == 1) + { + roleBean.setIsChecked(isActive); + } + else + { + roleBean.setIsChecked(isActive); + } + + list.add(roleBean); + + + } + + return list; + + } + + + + + public static void editRoleOrgAccess(Properties ctx, ArrayList roleBeanList, String trxName) throws OperationException + { + for (int i = 0; i < roleBeanList.size(); i++) + { + RoleBean bean = roleBeanList.get(i); + + MRole role = new MRole(ctx, bean.getRoleId(), trxName); + + String isChecked = "Y"; + + if (bean.getIsChecked() == null) + isChecked = "N"; + + String roleOrgAccessSQL = getRoleOrgAccessSQL(); + + PreparedStatement pstmt = DB.prepareStatement(roleOrgAccessSQL, trxName); + + ResultSet rs = null; + int count = 0; + + try + { + pstmt.setInt(1,Env.getAD_Client_ID(ctx)); + pstmt.setInt(2, bean.getOrgId()); + pstmt.setInt(3, bean.getRoleId()); + + rs = pstmt.executeQuery(); + + + + while(rs.next()) + { + count++; + } + + rs.close(); + } + catch (SQLException e) + { + throw new OperationException(e); + } + finally + { + try + { + pstmt.close(); + } + catch(Exception e) + {} + + pstmt = null; + } + + if (count > 1) + throw new DuplicateRoleException("Duplicate Role Organisation Access"); + else + if (count == 1) + { + StringBuffer strBuff = new StringBuffer(); + + strBuff.append("update ").append(MRoleOrgAccess.Table_Name); + strBuff.append(" set isActive='").append(isChecked).append("'"); + strBuff.append(" where ad_client_id=").append(Env.getAD_Client_ID(ctx)); + strBuff.append(" and ad_org_id=").append(bean.getOrgId()); + strBuff.append(" and ad_role_id=").append(bean.getRoleId()); + + PreparedStatement pstmt1 = DB.prepareStatement(strBuff.toString(), trxName); + + try + { + pstmt1.executeUpdate(); + } + catch (SQLException e) + { + throw new OperationException(e); + } + finally + { + try + { + pstmt1.close(); + } + catch(Exception e) + {} + + pstmt1 = null; + } + + } + else + { + MRoleOrgAccess roleOrgAccess = new MRoleOrgAccess(role, bean.getOrgId()); + PoManager.save(roleOrgAccess); + + } + } + + + } + + private static String getRoleOrgAccessSQL() + { + StringBuffer strBuff = new StringBuffer(); + strBuff.append("select ad_role_id, ad_org_id, ad_client_id, isactive from "); + strBuff.append(MRoleOrgAccess.Table_Name); + strBuff.append(" where ad_client_id=?"); + strBuff.append(" and ad_org_id=?"); + strBuff.append(" and ad_role_id=?"); + //strBuff.append(" and isActive='Y'"); + + return strBuff.toString(); + } + + public static String getRoleEditableOrgAccess(Properties ctx) + { + StringBuffer orgIdsStr = new StringBuffer(); + + int roleId = Env.getAD_Role_ID(ctx); + + MRoleOrgAccess[] roleOrgAccessArr = MRoleOrgAccess.getOfRole(ctx, roleId); + + int count = 0; + + if (roleOrgAccessArr==null || roleOrgAccessArr.length==0) + { + return orgIdsStr.toString(); + } + + for (int i = 0; i < roleOrgAccessArr.length; i++) + { + MRoleOrgAccess roleOrgAccess = roleOrgAccessArr[i]; + + if (roleOrgAccess.isActive() == true) + { + + if (roleOrgAccess.getAD_Org_ID() == 0) + { + int[] orgIds = MOrg.getAllIDs(MOrg.Table_Name, "ad_client_id=" + Env.getAD_Client_ID(ctx) + " and isActive='Y' order by name", null); + + StringBuffer allOrgIds = new StringBuffer(); + + allOrgIds.append("0"); + + for (int j = 0; j < orgIds.length; j++) + { + allOrgIds.append(","); + allOrgIds.append(orgIds[j]); + } + + return allOrgIds.toString(); + } + + else + { + orgIdsStr.append(roleOrgAccess.getAD_Org_ID()); + orgIdsStr.append(","); + } + } + } + + orgIdsStr.replace(orgIdsStr.length()-1, orgIdsStr.length()-1, ""); + return orgIdsStr.toString(); + + } + + public static String getRoleViewableOrgAccess(Properties ctx) + { + String roleEditableOrgAccess = getRoleEditableOrgAccess(ctx); + + if (roleEditableOrgAccess.length() == 0) + return "0"; + + if (roleEditableOrgAccess.indexOf(",0") == -1) + return roleEditableOrgAccess + ",0"; + else + return roleEditableOrgAccess; + + } + + + public static Boolean isEditable(Properties ctx, int orgId) + { + int roleId = Env.getAD_Role_ID(ctx); + + MRoleOrgAccess[] roleOrgAccessArr = MRoleOrgAccess.getOfRole(ctx, roleId); + + if (roleOrgAccessArr!=null && roleOrgAccessArr.length >0) + { + for (int i = 0; i < roleOrgAccessArr.length; i++) + { + MRoleOrgAccess roleOrgAccess = roleOrgAccessArr[i]; + + if (roleOrgAccess.getAD_Org_ID() == 0) + return true; + + if (roleOrgAccess.getAD_Org_ID() == orgId) + return true; + } + } + return false; + } + +} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/administration/TaxManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/administration/TaxManager.java new file mode 100644 index 0000000000..9900550bdc --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/businesslogic/administration/TaxManager.java @@ -0,0 +1,415 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * + *Created on Aug 19, 2006 by alok + * + */ + + +package org.posterita.businesslogic.administration; + +import java.math.BigDecimal; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.Properties; + +import org.compiere.model.MBPartner; +import org.compiere.model.MBPartnerLocation; +import org.compiere.model.MLocation; +import org.compiere.model.MOrg; +import org.compiere.model.MTax; +import org.compiere.model.MTaxCategory; +import org.compiere.util.DB; +import org.compiere.util.Env; +import org.posterita.beans.TaxBean; +import org.posterita.exceptions.CannotInactivateTaxException; +import org.posterita.exceptions.InvalidNetDaysException; +import org.posterita.exceptions.MandatoryException; +import org.posterita.exceptions.MandatoryNameException; +import org.posterita.exceptions.NoAccessToEditObjectException; +import org.posterita.exceptions.OperationException; +import org.posterita.exceptions.TaxNameAlreadyExistsException; +import org.posterita.exceptions.TaxRateAlreadyExistsException; +import org.posterita.lib.UdiConstants; +import org.posterita.util.PoManager; + +public class TaxManager +{ + + public static MTaxCategory createTaxCategory(Properties ctx, String taxCategoryName, String trxName) throws OperationException + { + MTaxCategory taxCategory = new MTaxCategory(ctx, 0, trxName); + taxCategory.setName(taxCategoryName); + PoManager.save(taxCategory); + return taxCategory; + } + + private static MTaxCategory editTaxCategory(Properties ctx,int orgId, int taxCategoryId, String taxCategoryName, String trxName) throws OperationException + { + MTaxCategory taxCategory = new MTaxCategory(ctx, taxCategoryId, trxName); + taxCategory.setName(taxCategoryName); + taxCategory.setAD_Org_ID(orgId); + PoManager.save(taxCategory); + return taxCategory; + } + + public static MTax createTax(Properties ctx, int orgId, String name, int taxCategoryId, int countryId, BigDecimal rate,String description,boolean isTaxExempt ,String trxName) throws OperationException + { + return createTax(ctx, orgId, name, taxCategoryId, countryId, new Timestamp(System.currentTimeMillis()), rate,description,isTaxExempt, trxName); + } + + + + public static MTax createTax(Properties ctx, int orgId, String name, int taxCategoryId, int countryId, Timestamp validFrom, BigDecimal rate,String description,boolean isTaxExempt, String trxName) throws OperationException + { + MTax tax = new MTax(ctx, 0, trxName); + + tax.setAD_Org_ID(orgId); + tax.setName(name); + tax.setC_TaxCategory_ID(taxCategoryId); + tax.setC_Country_ID(countryId); + tax.setSOPOType(MTax.SOPOTYPE_Both); + tax.setValidFrom(validFrom); + tax.setIsTaxExempt(isTaxExempt); + tax.setIsDocumentLevel(false); + if(isTaxExempt==true) + tax.setRate(new BigDecimal(0)); + else + tax.setRate(rate); + + if(description!=null) + tax.setDescription(description); + PoManager.save(tax); + + return tax; + } + + private static MTax editTax(Properties ctx, int orgId, MTax tax,String name, int countryId, BigDecimal rate,String desc,boolean isTaxExempt, String trxName) throws OperationException + { + tax.setAD_Org_ID(orgId); + tax.setName(name); + tax.setC_Country_ID(countryId); + tax.setSOPOType(MTax.SOPOTYPE_Both); + tax.setIsTaxExempt(isTaxExempt); + tax.setIsDocumentLevel(false); + if(isTaxExempt==true) + tax.setRate(new BigDecimal(0)); + else + tax.setRate(rate); + if(desc!=null) + tax.setDescription(desc); + PoManager.save(tax); + + return tax; + } + + public static BigDecimal getPriceWithTax(Properties ctx,BigDecimal price,BigDecimal rate) + { + return new BigDecimal (price.doubleValue()+((rate.doubleValue()/(100))*price.doubleValue())); + } + + + public static void createEditTaxCategoryAndTax(Properties ctx,TaxBean bean,String trxName) throws MandatoryException,MandatoryNameException,InvalidNetDaysException, OperationException + { + + if(bean.getTaxName()==null) + throw new MandatoryNameException("Name is Mandatory"); + + if(bean.getTaxRate()==null) + throw new MandatoryException("rate"); + if(bean.getTaxRate().intValue()<0) + { + throw new InvalidNetDaysException(" tax rate cannot be negative"); + } + + MOrg org = new MOrg(ctx,Env.getAD_Org_ID(ctx),null); + MBPartner partner = new MBPartner(ctx,org.getLinkedC_BPartner_ID(trxName),null); + MBPartnerLocation bpLocation = new MBPartnerLocation(partner); + MLocation location = new MLocation(ctx,bpLocation.getC_Location_ID(),null); + + String whereClause = "AD_Client_ID=" + Env.getAD_Client_ID(ctx) + " and name='" + bean.getTaxName() + "'"; + int taxId1[] = MTax.getAllIDs(MTax.Table_Name, whereClause, trxName); + + + String whereClause2=" AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+" and RATE="+bean.getTaxRate(); + int taxId []= MTax.getAllIDs(MTax.Table_Name,whereClause2,trxName); + + + MTaxCategory taxCategory=null; + MTax tax=null; + + if(bean.getTaxId()==null) + { + if(taxId1.length > 0) + throw new TaxNameAlreadyExistsException("tax Name already exists"); + if(taxId.length>0) + throw new TaxRateAlreadyExistsException("The tax rate is already defined"); + taxCategory=createTaxCategory(ctx,bean.getTaxName(),trxName); + tax = createTax(ctx, bean.getOrgId(), bean.getTaxName(),taxCategory.get_ID(),location.getC_Country_ID(),bean.getTaxRate(),bean.getDescription(),bean.getIsTaxExempted(),trxName); + } + + else + { + + MTax mTax = new MTax(ctx,bean.getTaxId().intValue(),null); + + Boolean isEditable = RoleManager.isEditable(ctx, mTax.getAD_Org_ID()); + + if (!isEditable) + throw new NoAccessToEditObjectException("You do not have the right organisational access for editing"); + + + if(taxId1.length>0 && !mTax.getName().equalsIgnoreCase(bean.getTaxName())) + throw new TaxNameAlreadyExistsException("tax Name already exists"); + + if(taxId.length>0 && mTax.getRate().compareTo(bean.getTaxRate()) != 0) + throw new TaxRateAlreadyExistsException("The tax rate is already defined"); + + + + tax=editTax(ctx,bean.getOrgId(), mTax,bean.getTaxName(),location.getC_Country_ID(),bean.getTaxRate(),bean.getDescription(),bean.getIsTaxExempted(),trxName); + taxCategory=editTaxCategory(ctx, bean.getOrgId(), tax.getC_TaxCategory_ID(),bean.getTaxName(),trxName); + } + + + } + + public static MTaxCategory loadTaxCategory(Properties ctx, int taxCategoryId, String trxName) throws OperationException + { + MTaxCategory taxCategory = new MTaxCategory(ctx, taxCategoryId, trxName); + + if(taxCategory.get_ID() == 0) + throw new OperationException("Could not load tax category with id: " + taxCategoryId); + + return taxCategory; + } + + + public static int getTaxCategoryIdByName(Properties ctx, String name, String trxName) throws OperationException + { + int adClientId = Env.getAD_Client_ID(ctx); + + String whereClause = "AD_Client_ID=" + adClientId + " and name='" + name + "'"; + + int taxCategoryIds[] = MTaxCategory.getAllIDs(MTaxCategory.Table_Name, whereClause, trxName); + + if(taxCategoryIds.length == 0) + throw new OperationException("No tax category found with name: " + name); + else if(taxCategoryIds.length > 1) + throw new OperationException(taxCategoryIds.length + " Tax categories found with name: " + name); + else + return taxCategoryIds[0]; + } + + public static MTax loadTax(Properties ctx, int taxId, String trxName) throws OperationException + { + MTax tax = new MTax(ctx, taxId, trxName); + if(tax.get_ID() == 0) + throw new OperationException("Could not load tax with id: " + taxId); + return tax; + } + + public static MTax getTaxFromCategory(Properties ctx, int taxCategoryId, String trxName) throws OperationException + { + int taxIds[] = MTax.getAllIDs(MTax.Table_Name,"AD_CLIENT_ID=" + Env.getAD_Client_ID(ctx) + +" and C_TAXCATEGORY_ID="+ taxCategoryId + " and IsActive='Y'",trxName); + + if(taxIds.length == 0) + throw new OperationException("No tax found with tax category id: " + taxCategoryId); + else if(taxIds.length > 1) + throw new OperationException(taxIds.length + " Tax found with same tax category with id: " + taxCategoryId); + else + return loadTax(ctx, taxIds[0], trxName); + } + + + public static ArrayList getAllTaxRates(Properties ctx,boolean isActive) throws OperationException + { + String userOrg = Env.getContext(ctx, UdiConstants.ROLE_VIEWABLE_ORGS_CTX_PARAM); + + String sql="select C_TAX_ID,NAME,DESCRIPTION,RATE,ISTAXEXEMPT," + + //" DECODE(isActive,'Y','true','false') active"+ + " CASE WHEN isActive='Y' THEN 'true' ELSE 'false' END AS active"+ + " from C_Tax" + + " where AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+ + " and AD_ORG_ID in ("+ userOrg + ")" ; + + if(isActive==true) + sql=sql+" and isActive='Y'"; + + PreparedStatement pstmt = DB.prepareStatement(sql,null); + ArrayList list = new ArrayList(); + TaxBean bean=null; + try + { + ResultSet rs = pstmt.executeQuery(); + while(rs.next()) + { + bean = new TaxBean(); + bean.setTaxId(rs.getInt(1)); + bean.setTaxName(rs.getString(2)); + bean.setDescription(rs.getString(3)); + bean.setTaxRate(rs.getBigDecimal(4)); + bean.setIsTaxExempted(Boolean.parseBoolean(rs.getString(5))); + bean.setIsActive(Boolean.parseBoolean(rs.getString(6))); + list.add(bean); + } + rs.close(); + + } catch (SQLException e) + { + throw new OperationException(e); + } + finally + { + try + { + pstmt.close(); + } catch (SQLException e) + { + + } + } + + return list; + } + + public static TaxBean getTaxRate(Properties ctx,int taxId) throws OperationException + { + String userOrg = Env.getContext(ctx, UdiConstants.ROLE_VIEWABLE_ORGS_CTX_PARAM); + + String sql="select C_TAX_ID, NAME,DESCRIPTION,RATE,ISTAXEXEMPT," + + //" DECODE(isActive,'Y','true','false') active"+ + " CASE WHEN isActive='Y' THEN 'true' ELSE 'false' END AS active,"+ + " AD_ORG_ID" + + " from C_Tax" + + " where AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+ + " and AD_ORG_ID in ("+ userOrg + ")" + + " and c_TAX_ID="+taxId; + + + + PreparedStatement pstmt = DB.prepareStatement(sql,null); + + TaxBean bean=null; + try + { + ResultSet rs = pstmt.executeQuery(); + while(rs.next()) + { + bean = new TaxBean(); + bean.setTaxId(rs.getInt(1)); + bean.setTaxName(rs.getString(2)); + bean.setDescription(rs.getString(3)); + bean.setTaxRate(rs.getBigDecimal(4)); + bean.setIsTaxExempted(Boolean.parseBoolean(rs.getString(5))); + bean.setIsActive(Boolean.parseBoolean(rs.getString(6))); + bean.setOrgId(rs.getInt(7)); + + } + rs.close(); + + } catch (SQLException e) + { + throw new OperationException(e); + } + finally + { + try + { + pstmt.close(); + } catch (SQLException e) + { + + } + } + + return bean; + } + + + public static MTax activateTax(Properties ctx,int taxId, boolean activate) throws OperationException + { + MTax tax = new MTax(ctx,taxId,null); + if(activate==true) + { + tax.setIsActive(true); + } + + else + { + if(isTaxUsed(ctx,taxId)==true) + { + throw new CannotInactivateTaxException("The tax can not be set incative, there are product with this tax"); + } + tax.setIsActive(false); + } + + + PoManager.save(tax); + return tax; + } + + + public static boolean isTaxUsed(Properties ctx,int taxId) throws OperationException + { + String sql="select pr.m_product_id " + + "from M_PRODUCT pr,C_TAX t,C_TAXCATEGORY tc" + + " where pr.C_TAXCATEGORY_ID=tc.C_TAXCATEGORY_ID " + + "and tc.C_TAXCATEGORY_ID=t.C_TAXCATEGORY_ID " + + "and t.C_TAX_ID=" +taxId+ + " and t.AD_CLIENT_ID="+Env.getAD_Client_ID(ctx); + + boolean present=false; + + PreparedStatement pstmt = DB.prepareStatement(sql,null); + try + { + ResultSet rs = pstmt.executeQuery(); + while(rs.next()) + { + present=true; + + } + rs.close(); + + } catch (SQLException e) + { + throw new OperationException(e); + } + finally + { + try + { + pstmt.close(); + } catch (SQLException e) + { + + } + } + + return present; + } + +} + diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/administration/UserManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/administration/UserManager.java new file mode 100644 index 0000000000..8ac132daf8 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/businesslogic/administration/UserManager.java @@ -0,0 +1,641 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 27-Jul-2005 by alok + * + */ +package org.posterita.businesslogic.administration; + +import java.math.BigDecimal; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.Properties; +import java.util.Vector; + +import javax.management.relation.RoleNotFoundException; + +import org.compiere.model.MBPartner; +import org.compiere.model.MBPartnerLocation; +import org.compiere.model.MCommission; +import org.compiere.model.MCommissionLine; +import org.compiere.model.MCountry; +import org.compiere.model.MLocation; +import org.compiere.model.MOrg; +import org.compiere.model.MRole; +import org.compiere.model.MRoleOrgAccess; +import org.compiere.model.MUser; +import org.compiere.model.MUserRoles; +import org.compiere.util.DB; +import org.compiere.util.Env; +import org.compiere.util.KeyNamePair; +import org.posterita.beans.AddressBean; +import org.posterita.beans.UserBean; +import org.posterita.beans.WebstoreUserBean; +import org.posterita.businesslogic.LocationManager; +import org.posterita.businesslogic.OrganisationManager; +import org.posterita.core.KeyNamePairUtil; +import org.posterita.exceptions.DuplicateUserPinException; +import org.posterita.exceptions.NoAccessToEditObjectException; +import org.posterita.exceptions.OperationException; +import org.posterita.exceptions.UserAlreadyExistsException; +import org.posterita.exceptions.UserNotFoundException; +import org.posterita.lib.UdiConstants; +import org.posterita.util.PoManager; + + +public class UserManager +{ + + public static MUser createUser(Properties ctx,Integer orgId, String userName,String userSurname,boolean isSalesRep,String address,String postalAddress,String city,String password,String email,boolean isActive,String phone,int regionId,int roleId,int countryId, String userPIN, BigDecimal userDiscount,String docBasisType,BigDecimal amtMultiplier,String frequency,BigDecimal subtractAmt,boolean isFullAccess,String trxName) throws DuplicateUserPinException,OperationException + { + int [] userId = MUser.getAllIDs("AD_USER","AD_CLIENT_ID = "+Env.getAD_Client_ID(ctx),trxName); + + for(int i=0;i0) + throw new DuplicateUserPinException("User Pin Already exists"); + else + user.setUserPIN(userPIN); + } + user.setPassword(password); + user.setEMail(email); + user.setIsActive(isActive); + user.setPhone(phone); + + PoManager.save(user); + + if(isSalesRep==true && docBasisType!=null && amtMultiplier!=null) + { + CommissionManager.getCreateCommission(ctx,bpartner.getName(),bpartner.get_ID(),docBasisType,amtMultiplier,frequency,subtractAmt,trxName); + } + + MUserRoles userRoles = new MUserRoles(ctx, user.get_ID(), roleId, trxName); + userRoles.save(); + + MOrg org = new MOrg(ctx, orgId, trxName); + MRoleOrgAccess roleOrgAccess = new MRoleOrgAccess(org, roleId); + + return user; + } + + + public static Vector getAllOrgUsers(Properties ctx, int orgID) + { + int ids[] = MUser.getAllIDs(MUser.Table_Name, " AD_CLIENT_ID = "+Env.getAD_Client_ID(ctx)+" and AD_Org_ID=" + orgID + " and ISACTIVE='Y' order by name",null); + + MUser user; + + Vector thisOrgUsers = new Vector(); + for (int i = 0; i0) + { + MCommission commission=new MCommission(ctx,commissionIds[0],null); + bean.setDocBasisType(commission.getDocBasisType()); + bean.setFrequencyType(commission.getFrequencyType()); + + MCommissionLine [] line =commission.getLines(); + if(line.length!=1) + throw new OperationException("either No commissionLine or more than One commission Line has bean defined for this bPartner"); + bean.setAmtMultiplier(line[0].getAmtMultiplier().multiply(new BigDecimal(100))); + bean.setSubtractAmt(line[0].getAmtSubtract()); + + } + if(userRole.length>0) + { + bean.setRoleName(role.getName()); + bean.setRoleId(Integer.valueOf(role.get_ID())); + } + + return bean; + + } + + + public static ArrayList getUsers(Properties ctx, String searchText) throws OperationException + { + ArrayList usersList = new ArrayList(); + + int clientId = Env.getAD_Client_ID(ctx); + int orgId = Env.getAD_Org_ID(ctx); + String userOrg = Env.getContext(ctx, UdiConstants.ROLE_VIEWABLE_ORGS_CTX_PARAM); + + String sql = "select u.AD_User_ID from AD_User u, AD_User_Roles ur " + + " where u.AD_Client_ID= " + clientId + + " and u.AD_Org_ID in (" + userOrg + ")" + + " and (Select bp.IsEmployee from C_BPartner bp where u.C_BPartner_ID=bp.C_BPartner_ID) = 'Y'" + + " and ur.ad_user_id= u.ad_user_id" + + " and ur.ad_role_id is not null"; + + if (searchText != null) + sql = sql + " and upper(u.name) like '%" + searchText.toUpperCase() + "%'"; + + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement(sql, null); + ResultSet rs = pstmt.executeQuery(); + while(rs.next()) + { + int userId = rs.getInt(1); + UserBean bean = getUser(ctx, userId); + + usersList.add(bean); + } + rs.close(); + } + catch(SQLException ex) + { + throw new OperationException("Could not retrieve employees list with sql: " + sql, ex); + } + finally + { + try + { + pstmt.close(); + } + catch(Exception ex) + {} + } + return usersList; + } + + + public static ArrayList getAllEmployees(Properties ctx) throws OperationException + { + ArrayList usersList = new ArrayList(); + + int clientId = Env.getAD_Client_ID(ctx); + int orgId = Env.getAD_Org_ID(ctx); + + String sql = "select AD_User_ID from AD_User u " + + " where u.AD_Client_ID= " + clientId + + " and u.AD_Org_ID=" + orgId + + " and (Select bp.IsEmployee from C_BPartner bp where u.C_BPartner_ID=bp.C_BPartner_ID) = 'Y'"; + + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement(sql, null); + ResultSet rs = pstmt.executeQuery(); + while(rs.next()) + { + int userId = rs.getInt(1); + UserBean bean = getUser(ctx, userId); + usersList.add(bean); + } + rs.close(); + } + catch(SQLException ex) + { + throw new OperationException("Could not retrieve employees list with sql: " + sql, ex); + } + finally + { + try + { + pstmt.close(); + } + catch(Exception ex) + {} + } + return usersList; + } + + public static ArrayList getAllUsers(Properties ctx) throws OperationException + { + ArrayList list = new ArrayList(); + + int clientId = Env.getAD_Client_ID(ctx); + int orgId = Env.getAD_Org_ID(ctx); + + int id[] = MUser.getAllIDs(MUser.Table_Name," ad_client_id = "+clientId+" and ad_org_id = "+orgId,null); + // int id[] = MUser.getAllIDs(MUser.Table_Name," ad_client_id = "+clientId+" and ad_org_id = "+orgId+" and isactive = 'Y'",null); + //int id[] = MUser.getAllIDs(MUser.Table_Name," ad_client_id = "+clientId+" and isactive = 'Y'",null); + + for(int i=0;i0) + { + for(int i=0;i 0) + user = new MUser(ctx, userId[0], trxName); + else + user = createUser(ctx, orgId, userName,null, isSalesRep, address, postalAddress, city, password, email, isActive, phone, regionId, roleId,countryId,userPin,null,commDocbaseType,commRate,frequency,subtractAmt,isFullAccess,trxName); + + return user; + } + + public static MUser loadUser(Properties ctx, int adUserID, String trxName) throws OperationException + { + MUser user = new MUser(ctx, adUserID, trxName); + if(user.get_ID() == 0) + throw new OperationException("Could not load user with id: " + adUserID); + + return user; + } + + public static ArrayList getSalesReps(Properties ctx, String trxName) throws OperationException + { + int adClientId = Env.getAD_Client_ID(ctx); + int adOrgId = Env.getAD_Org_ID(ctx); + + String whereClause = "IsActive='Y' and AD_Client_ID=" + adClientId + " and AD_Org_ID=" + adOrgId; + whereClause += " and C_BPartner_ID in (select C_BPartner_ID from C_BPartner where IsActive='Y' and IsSalesRep='Y')"; + + try + { + return KeyNamePairUtil.getData(ctx, MUser.Table_Name, whereClause); + } + catch(SQLException ex) + { + throw new OperationException("Could not retrieve sales rep with whereClause: " + whereClause, ex); + } + } + + + public static ArrayList updateUserListStatus(ArrayList list, Integer userId, Boolean status) + { + if (list == null) + return list; + + for (int i = 0; i < list.size(); i++) + { + UserBean bean = (UserBean) list.get(i); + + if (bean.getUserId().equals(userId)) + { + bean.setIsActive(status); + + list.remove(i); + + list.add(i, bean); + + break; + } + } + + return list; + + } + + public static Integer getRoleId(Properties ctx, String userPIN, String trxName) throws UserNotFoundException, RoleNotFoundException, OperationException + { + int ids[] = MUser.getAllIDs(MUser.Table_Name, "IsActive = 'Y' AND AD_Client_ID=" + Env.getAD_Client_ID(ctx) + " AND userPin='"+userPIN + "'", trxName); + if(ids == null || ids.length == 0) + { + throw new UserNotFoundException(); + } + + MUserRoles[] userRoles = MUserRoles.getOfUser(ctx, ids[0]); + if(userRoles == null || userRoles.length == 0) + { + throw new RoleNotFoundException(); + } + + MUserRoles userRole = userRoles[0]; + int ad_role_id = userRole.getAD_Role_ID(); + + return ad_role_id; + } + + public static BigDecimal getDiscountAllowed(Properties ctx, String userPIN, String trxName) throws UserNotFoundException, RoleNotFoundException, OperationException + { + + int ad_role_id = getRoleId(ctx, userPIN, trxName); + BigDecimal discountAllowed = RoleManager.getDiscountAllowed(ctx, ad_role_id, trxName); + + return discountAllowed; + } + + public static boolean isOverridePriceLimitAllowed(Properties ctx, String userPIN, String trxName) throws UserNotFoundException, RoleNotFoundException, OperationException + { + int ad_role_id = getRoleId(ctx, userPIN, trxName); + boolean isOverrideAllowed = RoleManager.isOverridePriceLimitAllowed(ctx, ad_role_id, trxName); + + return isOverrideAllowed; + } + + public static boolean isDiscountAllowedOnTotal(Properties ctx, String userPIN, String trxName) throws UserNotFoundException, RoleNotFoundException, OperationException + { + int ad_role_id = getRoleId(ctx, userPIN, trxName); + boolean isDisountAllowedOnTotal = RoleManager.isDiscountAllowedOnTotal(ctx, ad_role_id, trxName); + + return isDisountAllowedOnTotal; + } + + public static boolean isDiscountUptoPriceLimit(Properties ctx, String userPIN, String trxName) throws UserNotFoundException, RoleNotFoundException, OperationException + { + int ad_role_id = getRoleId(ctx, userPIN, trxName); + boolean isDiscountUptoPriceLimit = RoleManager.isDiscountUptoPriceLimit(ctx, ad_role_id, trxName); + + return isDiscountUptoPriceLimit; + } + +} + + + + diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/administration/UserRoleManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/administration/UserRoleManager.java new file mode 100644 index 0000000000..bea2ae60dd --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/businesslogic/administration/UserRoleManager.java @@ -0,0 +1,58 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 27-Jul-2005 by alok + * + */ +package org.posterita.businesslogic.administration; + +import java.util.Properties; + +import org.compiere.model.MUserRoles; +import org.compiere.util.Trx; +import org.posterita.core.TrxPrefix; +import org.posterita.exceptions.OperationException; +import org.posterita.util.PoManager; + + +public class UserRoleManager +{ + + + public static MUserRoles createUserRoles(Properties ctx,int roleId,int userId) throws OperationException + { + Trx trx = Trx.get(Trx.createTrxName(TrxPrefix.getPrefix()), true); + trx.start(); + MUserRoles userRoles; + try + { + userRoles = new MUserRoles(ctx,userId,roleId,trx.getTrxName()); + PoManager.save(userRoles); + trx.commit(); + trx.close(); + } + catch(OperationException e) + { + trx.rollback(); + trx.close(); + throw e; + } + + return userRoles; + } +} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/administration/VendorManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/administration/VendorManager.java new file mode 100644 index 0000000000..28163e300c --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/businesslogic/administration/VendorManager.java @@ -0,0 +1,473 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 02-Sep-2005 by alok + * + */ +package org.posterita.businesslogic.administration; + +import java.math.BigDecimal; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.Properties; +import java.util.StringTokenizer; + +import org.compiere.model.MBPartner; +import org.compiere.model.MCountry; +import org.compiere.model.MUser; +import org.compiere.util.DB; +import org.compiere.util.Env; +import org.posterita.beans.CustomerBean; +import org.posterita.beans.VendorBean; +import org.posterita.exceptions.BPartnerNotFoundException; +import org.posterita.exceptions.OperationException; +import org.posterita.lib.UdiConstants; +import org.posterita.util.PoManager; + +public class VendorManager +{ + + public static MBPartner saveVendor(Properties ctx, int partnerId, VendorBean bean, String trxName) throws OperationException + { + + if (bean.getOrgId() == null) + throw new OperationException("Organisation is not set! Please select an organisation or contact the administrator."); + + int countryId = 0; + + if (bean.getCountryId() == null) + { + MCountry country = MCountry.getDefault(ctx); + countryId = country.get_ID(); + } + else + countryId = bean.getCountryId().intValue(); + + MBPartner bPartner = BPartnerManager.saveBPartner(ctx, bean.getOrgId(), partnerId, 0, bean.getPartnerName(), bean.getSurname(), false, true, false, false, bean.getAddress1(), bean.getAddress2(), "", null, bean.getCity(), bean.getPhone(), bean.getPhone2(), bean.getFax(), countryId, true, true, trxName); + + Integer priceListId = bean.getPriceListId(); + + if (priceListId != null) + { + bPartner.setM_PriceList_ID(priceListId); + bPartner.save(); + } + + MUser user; + + int[] userIds = MUser.getAllIDs(MUser.Table_Name,"AD_CLIENT_ID=" + Env.getAD_Client_ID(ctx) + " and AD_ORG_ID=" + Env.getAD_Org_ID(ctx) + " and C_BPARTNER_ID=" + partnerId,trxName); + + if(userIds.length==0) + user = new MUser(bPartner); + else if (userIds.length > 1) + throw new OperationException("Found more than 1 user for the partner."); + else + user = new MUser(ctx,userIds[0],trxName); + + user.setEMail(bean.getEmail()); + user.setIsActive(false); + PoManager.save(user); + + return bPartner; + } + + + public static ArrayList searchVendors(Properties ctx,String searchString, boolean isPOS) throws OperationException + { + searchString = (searchString==null)? "" : searchString; + + int adOrgID = Env.getAD_Org_ID(ctx); + int adClientID = Env.getAD_Client_ID(ctx); + StringBuffer sql = new StringBuffer(); + + StringTokenizer st = new StringTokenizer(searchString,"+ "); + String token = null; + + sql.append(" select bp.c_bpartner_id,");//1 + sql.append(" bp.name,");//2 + sql.append(" bp.name2,");//3 + sql.append(" bp.m_pricelist_id,");//4 + sql.append(" bp.so_creditlimit,"); //5 + sql.append(" bp.so_creditused,"); //6 + sql.append(" bp.totalopenbalance"); //7 + sql.append(" from C_BPARTNER bp"); + sql.append(" where bp.AD_CLIENT_ID = ? "); + sql.append(" and bp.ad_org_id in (" + Env.getContext(ctx,UdiConstants.ROLE_EDITABLE_ORGS_CTX_PARAM)+")"); + sql.append(" and bp.isActive = 'Y' "); + sql.append(" and bp.isVendor='Y'"); + + while(st.hasMoreTokens()) + { + token = st.nextToken().trim(); + sql.append(" and (upper(bp.name) like upper('%"+ token +"%' ) or upper(bp.name2) like upper('%"+ token +"%' ))"); + } + + + if(!isPOS) + sql.append(" and bp.name not in (select name from ad_org where ad_org_id = " + adOrgID + ")") ; + + + sql.append(" order by bp.name,bp.name2"); + + PreparedStatement pstmt =null; + + CustomerBean customer = null; + ArrayList customers = new ArrayList(); + + try + { + pstmt = DB.prepareStatement(sql.toString(),null); + pstmt.setInt(1, adClientID); + ResultSet rs = pstmt.executeQuery(); + + + while (rs.next()) + { + customer = new CustomerBean(); + customer.setBpartnerId(Integer.valueOf(rs.getInt(1))); + customer.setPartnerName(rs.getString(2)); + customer.setSurname(rs.getString(3)); + customer.setPriceListId(rs.getInt(4)); + customer.setCreditStatus(MBPartner.SOCREDITSTATUS_CreditOK); //no limit for purchase + + BigDecimal creditLimit = rs.getBigDecimal(5); + BigDecimal creditUsed = rs.getBigDecimal(6); + BigDecimal openBalance = rs.getBigDecimal(7); + + creditLimit = creditLimit == null ? Env.ZERO : creditLimit; + creditUsed = creditUsed == null ? Env.ZERO : creditUsed; + openBalance = openBalance == null ? Env.ZERO : openBalance; + + BigDecimal creditAvailable = Env.ZERO; + if(creditLimit.doubleValue() > 0.0d) + { + creditAvailable = creditLimit.subtract(creditUsed); + } + + customer.setTotalOpenBalance(openBalance); + customer.setCreditAvailable(creditAvailable); + customer.setCreditLimit(creditLimit); + customer.setCreditUsed(creditUsed); + + customers.add(customer); + } + + rs.close(); + + } + catch (SQLException e) + { + throw new OperationException("Sql used:" + sql,e); + } + finally + { + try + { + pstmt.close(); + } + catch (Exception ex) + { + } + pstmt = null; + } + + return customers; + + } + + private static String getVendorSQL(Properties ctx) + { + int ad_client_id = Env.getAD_Client_ID(ctx); + String sql = " select" + + " bp.name as firstname," + //1.firstname + " bp.name2 as lastname," +//2.lastname + " loc.address1," +//3.address1 + " loc.address2," +//4.address2 + " bploc.phone," +//5.phone + " bploc.fax," +//6.fax + " bp.isactive, " +//7.isactive + " bp.c_bpartner_id, " + //8.partnerid + " loc.city," + //9.city + " bploc.phone2, " +//10.phone + " bp.ad_org_id, " + //11.orgId + " bp.M_PriceList_ID"+ //12.priceListId + " from c_bpartner bp left outer join (c_bpartner_location bploc left outer join c_location loc on bploc.C_LOCATION_ID = loc.C_LOCATION_ID) on bp.c_bpartner_id = bploc.c_bpartner_id"+ + " where bp.ad_client_id = " + ad_client_id + + " and bp.ad_ORG_ID in (" + Env.getContext(ctx,UdiConstants.ROLE_VIEWABLE_ORGS_CTX_PARAM)+")"+ + " and bp.ISVENDOR = 'Y'"; + + + return sql; + } + + + public static ArrayList searchVendors(Properties ctx, String searchText) throws OperationException + { + + ArrayList list = new ArrayList(); + + + String sql = getVendorSQL(ctx); + + if (searchText != null) + sql = sql + " and (upper(bp.name) like '%" + searchText.toUpperCase() + "%')"; + + PreparedStatement pstmt = DB.prepareStatement(sql,null); + ResultSet rs = null; + + VendorBean bean = null; + + try + { + rs =pstmt.executeQuery(); + + while(rs.next()) + { + bean = new VendorBean(); + + //set bean + bean.setPartnerName(rs.getString(1)); + bean.setSurname(rs.getString(2)); + bean.setAddress1(rs.getString(3)); + bean.setAddress2(rs.getString(4)); + bean.setPhone(rs.getString(5)); + bean.setFax(rs.getString(6)); + bean.setPhone2(rs.getString(10)); + bean.setOrgId(rs.getInt(11)); + + + Boolean isActive = Boolean.valueOf(false); + + if(rs.getString(7).equalsIgnoreCase("Y")) + { + isActive = Boolean.valueOf(true); + } + bean.setIsActive(isActive); + bean.setBpartnerId(rs.getInt(8)); + + list.add(bean); + } + + rs.close(); + } + catch (SQLException e) + { + throw new OperationException(e); + } + finally + { + try + { + pstmt.close(); + } + catch(Exception e) + {} + + pstmt = null; + } + + return list; + } + + + + public static ArrayList getAllVendors(Properties ctx) throws OperationException + { + + ArrayList list = new ArrayList(); + + + String sql = getVendorSQL(ctx); + + PreparedStatement pstmt = DB.prepareStatement(sql,null); + ResultSet rs = null; + + VendorBean bean = null; + + try + { + rs =pstmt.executeQuery(); + + while(rs.next()) + { + bean = new VendorBean(); + + //set bean + bean.setPartnerName(rs.getString(1)); + bean.setSurname(rs.getString(2)); + bean.setAddress1(rs.getString(3)); + bean.setAddress2(rs.getString(4)); + bean.setPhone(rs.getString(5)); + bean.setFax(rs.getString(6)); + bean.setPhone2(rs.getString(10)); + bean.setOrgId(rs.getInt(11)); + + + Boolean isActive = Boolean.valueOf(false); + + if(rs.getString(7).equalsIgnoreCase("Y")) + { + isActive = Boolean.valueOf(true); + } + bean.setIsActive(isActive); + bean.setBpartnerId(rs.getInt(8)); + + list.add(bean); + } + + rs.close(); + } + catch (SQLException e) + { + throw new OperationException(e); + } + finally + { + try + { + pstmt.close(); + } + catch(Exception e) + {} + + pstmt = null; + } + + return list; + } + + + public static VendorBean getVendor(Properties ctx,int vendorId) throws OperationException + { + String sql = getVendorSQL(ctx); + sql += " and bp.c_bpartner_id=" + vendorId+ + " order by upper(bp.name)"; + + PreparedStatement pstmt = DB.prepareStatement(sql,null); + ResultSet rs = null; + VendorBean bean = new VendorBean(); + + try + { + rs =pstmt.executeQuery(); + + if(rs.next()) + { + + + //set bean + bean.setPartnerName(rs.getString(1)); + bean.setSurname(rs.getString(2)); + bean.setAddress1(rs.getString(3)); + bean.setAddress2(rs.getString(4)); + bean.setPhone(rs.getString(5)); + bean.setFax(rs.getString(6)); + bean.setCity(rs.getString(9)); + bean.setPhone2(rs.getString(10)); + bean.setOrgId(rs.getInt(11)); + bean.setPriceListId(rs.getInt(12)); + + Boolean isActive = Boolean.valueOf(false); + + if(rs.getString(7).equalsIgnoreCase("Y")) + { + isActive = Boolean.valueOf(true); + } + bean.setIsActive(isActive); + bean.setBpartnerId(rs.getInt(8)); + + MUser user=null; + int userIds [] =MUser.getAllIDs(MUser.Table_Name,"AD_CLIENT_ID=" + Env.getAD_Client_ID(ctx) + " and AD_ORG_ID=" + Env.getAD_Org_ID(ctx) + " and C_BPARTNER_ID="+ vendorId ,null); + if(userIds.length==0) + { + user = new MUser(ctx,0,null); + user.setName(bean.getPartnerName()); + } + else + { + user = new MUser(ctx,userIds[0],null); + } + + bean.setEmail(user.getEMail()); + + } + else + throw new BPartnerNotFoundException("No Business Partner found with id: " + vendorId); + + rs.close(); + } + catch (SQLException e) + { + throw new OperationException(e); + } + finally + { + try + { + pstmt.close(); + } + catch(Exception e) + {} + + pstmt = null; + } + + return bean; + } + + + public static void activateVendor(Properties ctx, int bpartnerId, String trxName) throws OperationException + { + BPartnerManager.activateBPartner(ctx,bpartnerId,false, trxName); + + } + + public static void deactivateVendor(Properties ctx, int bpartnerId, String trxName) throws OperationException + { + BPartnerManager.deactivateBPartner(ctx,bpartnerId, trxName); + + } + + public static ArrayList updateVendorListStatus(ArrayList list, Integer partnerId, Boolean status) + { + if (list == null) + return list; + + for (int i = 0; i < list.size(); i++) + { + VendorBean bean = (VendorBean) list.get(i); + + if (bean.getBpartnerId().equals(partnerId)) + { + bean.setIsActive(status); + + list.remove(i); + + list.add(i, bean); + + break; + } + + } + + return list; + + } +} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/administration/WarehouseManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/administration/WarehouseManager.java new file mode 100644 index 0000000000..700e236912 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/businesslogic/administration/WarehouseManager.java @@ -0,0 +1,385 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 22-Jul-2005 by alok + * + */ +package org.posterita.businesslogic.administration; + +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.Properties; +import java.util.logging.Level; + +import org.compiere.model.MLocation; +import org.compiere.model.MLocator; +import org.compiere.model.MWarehouse; +import org.compiere.util.CLogger; +import org.compiere.util.DB; +import org.compiere.util.Env; +import org.posterita.beans.ProductBean; +import org.posterita.beans.WarehouseBean; +import org.posterita.businesslogic.LocationManager; +import org.posterita.businesslogic.OrganisationManager; +import org.posterita.core.CheckDuplicateEntities; +import org.posterita.exceptions.CanNotMoveStockException; +import org.posterita.exceptions.OperationException; +import org.posterita.exceptions.WarehouseAlreadyExistsException; +import org.posterita.keyname.LocatorKeyNamePair; +import org.posterita.keyname.WarehouseKeyNamePair; +import org.posterita.lib.UdiConstants; +import org.posterita.order.UDIOrderType; +import org.posterita.util.PoManager; + +public class WarehouseManager +{ + private static final CLogger log = CLogger.getCLogger(WarehouseManager.class); + + public static MWarehouse createWarehouse(Properties ctx, int orgId, String warehouseName, String address1,String postalAddress1,String city,int regionId, int countryId,String trxName) throws OperationException, WarehouseAlreadyExistsException + { + MWarehouse warehouse; + + if (CheckDuplicateEntities.checkDuplicateName(ctx, warehouseName, MWarehouse.Table_Name)) + throw new WarehouseAlreadyExistsException("Warehouse already exists"); + + try + { + MLocation location = LocationManager.createLocation(ctx, orgId, address1, "", postalAddress1, city, regionId, countryId, trxName); + warehouse = createWarehouse(ctx, orgId, warehouseName, location.getC_Location_ID(), trxName); + } + catch(OperationException e) + { + throw e; + } + + return warehouse; + + } + + public static MWarehouse createWarehouse(Properties ctx, int orgId, String warehouseName, int c_location_id, String trxName) throws OperationException, WarehouseAlreadyExistsException + { + MWarehouse warehouse; + + if (CheckDuplicateEntities.checkDuplicateName(ctx, warehouseName, MWarehouse.Table_Name)) + throw new WarehouseAlreadyExistsException("Warehouse already exists"); + + try + { + warehouse = new MWarehouse(ctx,0,trxName); + warehouse.setName(warehouseName); + warehouse.setC_Location_ID(c_location_id); + warehouse.setAD_Org_ID(orgId); + PoManager.save(warehouse); + + createLocator(ctx, orgId, warehouse.get_ID(), true,"0","0","0", trxName); + } + catch(OperationException e) + { + throw e; + } + + return warehouse; + + } + + public static MLocator createLocator(Properties ctx,int orgId, int warehouseId,boolean isDefault, String aisle,String bin,String level, String trxName) throws OperationException + { + + MLocator locator = new MLocator(ctx,0,trxName); + + try + { + locator.setAD_Org_ID(orgId); + locator.setM_Warehouse_ID(warehouseId); + locator.setXYZ(aisle,bin,level); + locator.setIsDefault(isDefault); + + PoManager.save(locator); + } + catch(OperationException e) + { + throw new OperationException("Could not create locator!!"); + } + + return locator; + + } + + /** + * Returns all the warehouse present and viewable by the user + * @param ctx context + * @return List of Warehouses + * @throws OperationException if problem with sql or DB + */ + public static ArrayList getAllWarehouses(Properties ctx) throws OperationException + { + int viewableOrgs[] = OrganisationManager.getUserViewableOrganisations(ctx); + return getAllWarehouses(ctx, viewableOrgs); + } + + /** + * Returns all warehouses that is present for the organisation provided. + * @param ctx Context + * @param adOrgId Organisation + * @return List of Warehouses + * @throws OperationException if problem with sql or DB + */ + public static ArrayList getAllWarehouses(Properties ctx, int adOrgId) throws OperationException + { + int orgs[] = new int[] {adOrgId}; + return getAllWarehouses(ctx, orgs); + } + + /** + * Returns all the warehouse present for the organisations + * @param ctx context + * @param adOrgId organisation + * @return List of warehouses + * @throws OperationException if problem with sql or DB + */ + public static ArrayList getAllWarehouses(Properties ctx, int[] adOrgIds) throws OperationException + { + if (adOrgIds.length == 0) + { + throw new IllegalArgumentException("At least one organisation should be provided"); + } + + int adClientID = Env.getAD_Client_ID(ctx); + StringBuffer sqlStmt = new StringBuffer(); + + sqlStmt.append(" SELECT w.M_Warehouse_ID,"); //1 + sqlStmt.append(" w.Name,"); //2 + sqlStmt.append(" l.Address1,"); //3 + sqlStmt.append(" l.City,"); //4 + sqlStmt.append(" l.Postal_Add,");//5 + sqlStmt.append(" l.RegionName,"); //6 + sqlStmt.append(" w.Description,");//7 + sqlStmt.append(" w.IsActive"); //8 + sqlStmt.append(" FROM M_Warehouse w, C_Location l "); + sqlStmt.append(" WHERE l.C_Location_ID=W.C_Location_ID "); + sqlStmt.append(" AND w.AD_Org_ID IN ( "); + + int i; + for (i = 0; i < adOrgIds.length - 1; i++) + { + sqlStmt.append(adOrgIds[i]).append(","); + } + sqlStmt.append(adOrgIds[i]).append(")"); + + sqlStmt.append(" AND w.AD_Client_ID = ? "); + sqlStmt.append(" ORDER BY w.Name"); + + WarehouseBean warehouse=null; + ArrayList warehouses = new ArrayList(); + + String isActive; + PreparedStatement pstmt =null; + ResultSet rs = null; + + try + { + pstmt = DB.prepareStatement(sqlStmt.toString(), null); + pstmt.setInt(1, adClientID); + rs = pstmt.executeQuery(); + + while (rs.next()) + { + warehouse = new WarehouseBean(); + warehouse.setWarehouseId(Integer.valueOf(rs.getInt(1))); + warehouse.setWarehouseName(rs.getString(2)); + + warehouse.setAddress1(rs.getString(3)); + warehouse.setCity(rs.getString(4)); + warehouse.setPostalAddress(rs.getString(5)); + warehouse.setRegionName(rs.getString(6)); + warehouse.setDescription(rs.getString(7)); + isActive = rs.getString(8); + warehouse.setIsActive("Y".equals(isActive)); + warehouses.add(warehouse); + } + } + catch(SQLException e) + { + throw new OperationException(e.getMessage()); + } + finally + { + DB.close(rs, pstmt); + rs = null; + pstmt = null; + } + + return warehouses; + } + + public static WarehouseBean getWarehouse(Properties ctx, Integer warehouseId, ArrayList warehouses) + { + Iterator iter = (warehouses.iterator()); + + while (iter.hasNext()) + { + WarehouseBean warehouseBean = (WarehouseBean) iter.next(); + + if (warehouseBean.getWarehouseId().equals(warehouseId)) + return warehouseBean; + } + + return new WarehouseBean(); + } + + + + + public static ArrayList getOrganisationWarehouses(Properties ctx) throws OperationException + { + ArrayList warehouses; + + warehouses = WarehouseKeyNamePair.getKeyNamePair(ctx); + + return warehouses; + } + + public static ArrayList getOrganisationWarehouses(Properties ctx,ArrayList products) throws OperationException + { + ArrayList warehouses; + + Iterator prodIter = products.iterator(); + + ProductBean prodBean = null; + int warehouseId=0; + + while(prodIter.hasNext()) + { + prodBean = (ProductBean)prodIter.next(); + if(warehouseId==0 || warehouseId==prodBean.getWarehouseId().intValue()) + { + warehouseId=prodBean.getWarehouseId().intValue(); + } + else + { + throw new CanNotMoveStockException("Please select the products form single warehouse"); + } + } + warehouses = WarehouseKeyNamePair.getKeyNamePair(ctx,warehouseId); + + return warehouses; + } + + + + public static ArrayList getOrganisationLocators(Properties ctx) throws OperationException + { + ArrayList locators; + + locators = LocatorKeyNamePair.getKeyNamePair(ctx); + + return locators; + } + + public static MWarehouse getStorageWarehouse(Properties ctx, UDIOrderType type) throws OperationException + { + return getDefaultWarehouse(ctx); + + } + + public static MWarehouse getDefaultWarehouse(Properties ctx) throws OperationException + { + int warehouseID = Env.getContextAsInt(ctx, "#M_Warehouse_ID"); + MWarehouse warehouse = new MWarehouse(ctx, warehouseID, null); + if(warehouse.get_ID() != 0) + return warehouse; + throw new OperationException(" Cannot find default warehouse for organisation"); + } + + public static MWarehouse editWarehouse(Properties ctx, WarehouseBean bean) throws OperationException + { + MWarehouse warehouse = new MWarehouse(ctx, bean.getWarehouseId().intValue(), null); + + warehouse.setName(bean.getWarehouseName()); + + warehouse.setIsActive(bean.getIsActive().booleanValue()); + + PoManager.save(warehouse); + + return warehouse; + } + + + public static int getOrganisationWarehouse(Properties ctx, int adOrgId, String trxName) throws OperationException + { + int warehouseId = -1; + String sqlStmt = "SELECT M_Warehouse_ID FROM AD_OrgInfo WHERE AD_Org_ID=?"; + + PreparedStatement pstmt = null; + ResultSet rs = null; + + try + { + pstmt = DB.prepareStatement(sqlStmt, trxName); + pstmt.setInt(1, adOrgId); + + rs = pstmt.executeQuery(); + if (rs.next()) + { + warehouseId = rs.getInt(1); + } + } + catch (Exception ex) + { + log.log(Level.SEVERE, "Could not get organisation warehouse", ex); + throw new OperationException("Could not get organisation warehouse", ex); + } + finally + { + DB.close(rs, pstmt); + } + + return warehouseId; + } + + public static String getLocatorIds(Properties ctx, Integer orgId) throws OperationException + { + String orgIds = orgId.toString(); + + if (orgId == 0) + { + orgIds = Env.getContext(ctx,UdiConstants.ROLE_EDITABLE_ORGS_CTX_PARAM).toString(); + } + + int[] locatorIds = MLocator.getAllIDs(MLocator.Table_Name, "AD_Client_ID = " + Env.getAD_Client_ID(ctx)+ " AND AD_Org_ID IN (" + orgIds + ")", null); + + StringBuffer locIds = new StringBuffer(); + if (locatorIds != null && locatorIds.length>0) + { + for (int i = 0; i 0) + { + return elementValueId; + } + + int acctSchemaId = Env.getContextAsInt(ctx, "$C_AcctSchema_ID"); + + String sqlStmt = "SELECT C_Element_ID FROM C_AcctSchema_Element WHERE C_AcctSchema_ID=? AND ElementType=?"; + + int elementId = DB.getSQLValue(trxName, sqlStmt, acctSchemaId, MAcctSchemaElement.ELEMENTTYPE_Account); + + if (elementId <= 0) + { + throw new OperationException("Could not get Element of type Account from the accounting schema!!!"); + } + + MElementValue elementValue = new MElementValue(ctx, 0, trxName); + elementValue.setAD_Org_ID(0); + elementValue.setC_Element_ID(elementId); + elementValue.setValue(ELEMENT_DUMMY_CASH); + elementValue.setName("Dummy Cash"); + elementValue.setAccountType(MElementValue.ACCOUNTTYPE_Asset); + elementValue.setAccountSign(MElementValue.ACCOUNTSIGN_Natural); + elementValue.setPostActual(true); + elementValue.setPostBudget(true); + elementValue.setPostStatistical(true); + elementValue.setIsDocControlled(false); + elementValue.setIsBankAccount(false); + + PoManager.save(elementValue); + + elementValueId = elementValue.get_ID(); + + return elementValueId; + } + + + /** + * Returns the first accounting schema defined for the client + * @param ctx Context + * @param adClientId Client + * @param trxName Transaction + * @return Accouting Schema Id + */ + public static int getAcctSchemaId(Properties ctx, int adClientId, String trxName) + { + String sql = "SELECT C_AcctSchema_ID " + + "FROM C_AcctSchema a, AD_ClientInfo c " + + "WHERE a.C_AcctSchema_ID=c.C_AcctSchema1_ID " + + "AND c.AD_Client_ID=?"; + + int acctSchemaId = DB.getSQLValue(trxName, sql, adClientId); + return acctSchemaId; + } + + /** + * Returns the currency of the accounting schema + * @param ctx Context + * @param clientId Client + * @param trxName Transaction + * @return Currency Id + */ + public static int getCurrencyId(Properties ctx, int clientId, String trxName) + { + int acctSchemaId = getAcctSchemaId(ctx, clientId, trxName); + MAcctSchema acctSchema = MAcctSchema.get(ctx, acctSchemaId); + return acctSchema.getC_Currency_ID(); + } +} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/core/ApplicationManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/core/ApplicationManager.java new file mode 100644 index 0000000000..c040369311 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/businesslogic/core/ApplicationManager.java @@ -0,0 +1,88 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + + + +package org.posterita.businesslogic.core; + +import java.util.ArrayList; +import java.util.Properties; + +import org.compiere.model.MStore; +import org.compiere.util.Env; +import org.posterita.beans.ApplicationParametersBean; +import org.posterita.lib.UdiConstants; + + /** + * @author Ashley + */ + +public class ApplicationManager +{ + public static void setApplicationParametersInContext(Properties tmkCtx, int storeId) + { + Env.setContext(tmkCtx, "#AD_Client_ID", 0); + Env.setContext(tmkCtx, "#AD_Org_ID", 0); + MStore store = new MStore(tmkCtx, storeId, null); + + if(store.get_ID() == 0) + throw new RuntimeException("No store found for application with ID: " + storeId); + Env.setContext(tmkCtx, UdiConstants.CLIENT_ID_CTX_PARAM, store.getAD_Client_ID()); + Env.setContext(tmkCtx, UdiConstants.ORG_ID_CTX_PARAM, store.getAD_Org_ID()); + Env.setContext(tmkCtx, UdiConstants.ROLE_EDITABLE_ORGS_CTX_PARAM, store.getAD_Org_ID()); + Env.setContext(tmkCtx, UdiConstants.CSS, store.getWebParam5()); + Env.setContext(tmkCtx, UdiConstants.FORWARD, store.getWebParam6()); + Env.setContext(tmkCtx, UdiConstants.WSTORE_CTX_PARAM, store.get_ID()); + + String language = store.getWebParam4(); + if (language != null && language != "") + { + Env.setContext(tmkCtx, UdiConstants.LANGUAGE_CTX_PARAM, language); + } + + int acctSchemaId = AccountingManager.getAcctSchemaId(tmkCtx, store.getAD_Client_ID(), null); + Env.setContext(tmkCtx, "$C_AcctSchema_ID", acctSchemaId); + } + + //TODO Refactor, work with store id instead of context + public static ArrayList getAvailableApplications() + { + String whereClause = "IsActive='Y' order by Name"; + int storeIds[] = MStore.getAllIDs(MStore.Table_Name, whereClause, null); + + ArrayList appList = new ArrayList(); + Properties ctx = Env.getCtx(); + + for(int i = 0; i < storeIds.length; i++) + { + MStore store = new MStore(ctx, storeIds[i], null); + String appContextPath = store.getWebContext(); + appContextPath = appContextPath.replaceAll("/", ""); + + ApplicationParametersBean appParamBean = new ApplicationParametersBean(); + appParamBean.setApplicationName(store.getName()); + appParamBean.setApplicationWebContext(appContextPath); + appParamBean.setStoreId(store.get_ID()); + appList.add(appParamBean); + } + + return appList; + } +} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/core/AttachmentManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/core/AttachmentManager.java new file mode 100644 index 0000000000..41aa019fa9 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/businesslogic/core/AttachmentManager.java @@ -0,0 +1,310 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +/** + @author Praveen + */ + +package org.posterita.businesslogic.core; + +import java.io.FileNotFoundException; +import java.util.ArrayList; +import java.util.Properties; + +import org.apache.struts.upload.FormFile; +import org.compiere.model.MAttachment; +import org.compiere.model.MAttachmentEntry; +import org.compiere.util.Env; +import org.posterita.core.UDIPropertiesManager; +import org.posterita.exceptions.AttachmentNotFoundException; +import org.posterita.exceptions.DeleteAttachmentException; +import org.posterita.exceptions.OperationException; +import org.posterita.lib.PropertiesConstant; +import org.posterita.util.ListUtil; +import org.posterita.util.PoManager; + + + +public class AttachmentManager +{ + + public static void attachImage(Properties ctx,FormFile file,String name) throws OperationException, FileNotFoundException + { + /*X_U_UDI_LOGO attach = new X_U_UDI_LOGO(ctx,0,null); + + attach.setName(name); + + UDIMAttachment udiAttachment = new UDIMAttachment(attach); + + try + { + saveLogo(ctx,file); + udiAttachment.save(); + } + catch (OperationException e) + { + throw new OperationException("Error occurred on saving file!!"); + } + catch (FileNotFoundException e) + { + throw new FileNotFoundException("File to save not found!!"); + }*/ + } + + + + public static String getImage(Properties ctx,String name) throws OperationException + { + int orgId = Env.getAD_Org_ID(ctx); + String path = UDIPropertiesManager.getProperty().get(ctx, PropertiesConstant.LOGO_HOME)+orgId+"/"+name; + return path; + } + + public static ArrayList getAttachmentEntriesWithPrefix(Properties ctx, MAttachment attachment, String prefix, String trxName) + { + if(attachment == null) + throw new IllegalArgumentException("Attachment cannot be null"); + + + ArrayList attachmentEntryList = new ArrayList(); + + MAttachmentEntry entries[] = attachment.getEntries(); + if (prefix!=null) + prefix = prefix.toUpperCase(); + + for(int i = 0; i < entries.length; i++) + { + String attachmentName = entries[i].getName(); + attachmentName = attachmentName.toUpperCase(); + if(prefix ==null || attachmentName.startsWith(prefix)) + attachmentEntryList.add(entries[i]); + } + + return attachmentEntryList; + } + + public static ArrayList getAttachmentEntriesWithSuffix(Properties ctx, MAttachment attachment, String suffix, String trxName) + { + if(attachment == null) + throw new IllegalArgumentException("Attachment cannot be null"); + + + + ArrayList attachmentEntryList = new ArrayList(); + + MAttachmentEntry entries[] = attachment.getEntries(); + if (suffix!=null) + suffix = suffix.toUpperCase(); + + for(int i = 0; i < entries.length; i++) + { + String attachmentName = entries[i].getName(); + attachmentName = attachmentName.toUpperCase(); + if(suffix ==null || attachmentName.endsWith(suffix)) + attachmentEntryList.add(entries[i]); + } + + return attachmentEntryList; + } + + public static void addAttachment(Properties ctx, int ad_table_id, int record_id, MAttachmentEntry[] entries, String trxName) throws OperationException + { + MAttachment attachment; + if(!AttachmentManager.hasAttachment(ctx, ad_table_id, record_id, trxName)) + attachment = new MAttachment(ctx,0,trxName); + else + { + attachment = loadAttachment(ctx, ad_table_id, record_id); + attachment.set_TrxName(trxName); + } + + attachment.setAD_Table_ID(ad_table_id); + attachment.setRecord_ID(record_id); + + for(int i = 0; i < entries.length; i++) + { + attachment.addEntry(entries[i]); + } + + PoManager.save(attachment); + } + + public static void addAttachmentEntry(Properties ctx, MAttachment attachment, String fileName, byte data[], String trxName) throws OperationException + { + MAttachmentEntry attachmentEntry = new MAttachmentEntry(fileName, data); + + addAttachmentEntries(ctx, attachment, new MAttachmentEntry[]{attachmentEntry}, trxName); + } + + public static void addAttachmentEntries(Properties ctx, MAttachment attachment, MAttachmentEntry[] entries, String trxName) throws OperationException + { + for(int i = 0; i < entries.length; i++) + { + attachment.addEntry(entries[i]); + } + + PoManager.save(attachment); + } + + public static void addAttachment(Properties ctx, int adTableId, int recordId, String fileName, byte data[], String trxName) throws OperationException + { + MAttachmentEntry attachmentEntry = new MAttachmentEntry(fileName, data); + + addAttachment(ctx, adTableId, recordId, new MAttachmentEntry[]{attachmentEntry}, trxName); + } + + public static boolean hasAttachment(Properties ctx, int ad_table_id, int record_id, String trxName) + { + String whereClause = "AD_Table_ID=" + ad_table_id + " and Record_ID=" + record_id; + int mAttachmentIDs[] = MAttachment.getAllIDs(MAttachment.Table_Name, whereClause, trxName); + + if(mAttachmentIDs.length == 0) + return false; + return true; + } + + public static boolean hasAttachment(Properties ctx, int ad_table_id, int record_id, String attachmentName, String trxName) + { + String whereClause = "AD_Table_ID=" + ad_table_id + " and Record_ID=" + record_id; + int mAttachmentIDs[] = MAttachment.getAllIDs(MAttachment.Table_Name, whereClause, trxName); + + if(mAttachmentIDs.length == 0) + return false; + + for(int i = 0; i < mAttachmentIDs.length; i++) + { + MAttachment attachment = MAttachment.get(ctx, ad_table_id, record_id); + if(getAttachmentEntryIndex(ctx, attachment, attachmentName) != -1) + return true; + } + return false; + } + + public static int getAttachmentEntryIndex(Properties ctx, MAttachment attachment, String attachmentName) + { + int retIndex = -1; + + MAttachmentEntry entries[] = attachment.getEntries(); + + for(int i = 0; i < entries.length; i++) + { + MAttachmentEntry entry = entries[i]; + + if(entry.getName().equalsIgnoreCase(attachmentName)) + { + retIndex = i; + break; + } + } + return retIndex; + } + + public static void addAttachmentEntry(MAttachment attachment, MAttachmentEntry entry) throws OperationException + { + if(!attachment.addEntry(entry)) + { + throw new OperationException("Could not add Attachment Entry with name: " + entry.getName() + + " to attachment with table id: " + attachment.get_Table_ID() + " and record id: " + attachment.getRecord_ID()); + } + } + + public static void deleteAttachmentEntry(MAttachment attachment, int index) throws OperationException + { + if(!attachment.deleteEntry(index)) + { + throw new OperationException("Could not add Attachment Entry with index: " + index + + " to attachment with table id: " + attachment.get_Table_ID() + " and record id: " + attachment.getRecord_ID()); + } + } + + public static void deleteAvailableAttachment(Properties ctx, int adTableId, int recordId, String trxName) + { + if(hasAttachment(ctx, adTableId, recordId, trxName)) + { + MAttachment attachment = MAttachment.get(ctx, adTableId, recordId); + attachment.set_TrxName(trxName); + attachment.delete(true); + } + } + + public static ArrayList getAllAttachmentEntries(Properties ctx, int adTableId, int recordId) + { + ArrayList entryList = new ArrayList(); + + if(hasAttachment(ctx, adTableId, recordId, null)) + { + MAttachment attachment = MAttachment.get(ctx, adTableId, recordId); + return ListUtil.getListFromArray(attachment.getEntries()); + } + return entryList; + } + + public static ArrayList getAllImagesAttachmentEntries(Properties ctx, int adTableId, int recordId, String trxName) + { + ArrayList entryList = new ArrayList(); + + if(hasAttachment(ctx, adTableId, recordId, trxName)) + { + MAttachment attachment = MAttachment.get(ctx, adTableId, recordId); + + MAttachmentEntry attachmentEntries[] = attachment.getEntries(); + for(MAttachmentEntry entry : attachmentEntries) + { + if(entry.isGraphic()) + entryList.add(entry); + } + } + return entryList; + } + + public static MAttachment loadAttachment(Properties ctx, int adTableId, int recordId) throws AttachmentNotFoundException + { + MAttachment attachment = MAttachment.get(ctx, adTableId, recordId); + + if(attachment == null) + throw new AttachmentNotFoundException("Could not load attachment for table with id: " + adTableId + " and record: " + recordId); + + return attachment; + } + + public static MAttachment deleteAvailableAttachmentEntry(Properties ctx, int adTableId, int recordId, String attachmentName, String trxName) throws OperationException, AttachmentNotFoundException, DeleteAttachmentException + { + MAttachment retAttachment = null; + if(hasAttachment(ctx, adTableId, recordId, trxName)) + { + MAttachment attachment = loadAttachment(ctx, adTableId, recordId); + attachment.set_TrxName(trxName); + + int index = getAttachmentEntryIndex(ctx, attachment, attachmentName); + + if(index != -1) + { + boolean deleted = attachment.deleteEntry(index); + + if(!deleted) + throw new DeleteAttachmentException("Could not delete attachment for Table with id: " + adTableId + ", Record ID: " + recordId + " and attachment Name" + attachmentName); + + PoManager.save(attachment); + } + retAttachment = attachment; + } + return retAttachment; + } +} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/core/AttributeManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/core/AttributeManager.java new file mode 100644 index 0000000000..fac9b8ca5a --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/businesslogic/core/AttributeManager.java @@ -0,0 +1,47 @@ +/** + * Product: Posterita Web-Based POS (an Adempiere Plugin) + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +/** + @author ashley + */ + +package org.posterita.businesslogic.core; + +import java.util.Properties; + +import org.compiere.model.MAttributeInstance; +import org.compiere.model.MAttributeValue; +import org.posterita.exceptions.OperationException; +import org.posterita.util.PoManager; + +public class AttributeManager +{ + public static void createAttributeInstance(Properties ctx, int attributeSetInstanceId, int attributeId, MAttributeValue attributeValue, String trxName) throws OperationException + { + MAttributeInstance attInst = new MAttributeInstance(ctx, 0, trxName); + attInst.setM_AttributeSetInstance_ID(attributeSetInstanceId); + attInst.setM_Attribute_ID(attributeId); + attInst.setM_AttributeValue_ID(attributeValue.get_ID()); + + attInst.setValue(attributeValue.getName()); + + PoManager.save(attInst); + } +} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/core/ChargeManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/core/ChargeManager.java new file mode 100644 index 0000000000..f0f5f1c3fc --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/businesslogic/core/ChargeManager.java @@ -0,0 +1,45 @@ +/** + * Product: Posterita Web-Based POS (an Adempiere Plugin) + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +/** + @author Ashley + */ + +package org.posterita.businesslogic.core; + +import java.util.Properties; + +import org.compiere.model.MCharge; + +import org.posterita.exceptions.OperationException; + +public class ChargeManager +{ + + public static MCharge loadCharge(Properties ctx, int chargeId, String trxName) throws OperationException + { + MCharge charge = new MCharge(ctx, chargeId, trxName); + if(charge.get_ID() == 0) + throw new OperationException("Could not load charge with id: " + chargeId); + + return charge; + } + +} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/creditsales/CreditOrderManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/creditsales/CreditOrderManager.java new file mode 100644 index 0000000000..c7bc15b477 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/businesslogic/creditsales/CreditOrderManager.java @@ -0,0 +1,909 @@ +/** + * Product: Posterita Web-Based POS (an Adempiere Plugin) + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +/** + @author Alok Pathak + */ + +package org.posterita.businesslogic.creditsales; + +import java.math.BigDecimal; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.Properties; + +import javax.servlet.http.HttpServletRequest; + +import org.compiere.model.MBPartner; +import org.compiere.model.MCashLine; +import org.compiere.model.MInOut; +import org.compiere.model.MInvoice; +import org.compiere.model.MOrder; +import org.compiere.model.MPInstance; +import org.compiere.model.MPayment; +import org.compiere.process.Aging; +import org.compiere.process.DocumentEngine; +import org.compiere.process.ProcessInfo; +import org.compiere.process.ProcessInfoParameter; +import org.compiere.util.DB; +import org.compiere.util.Env; +import org.posterita.Constants; +import org.posterita.beans.AgingBean; +import org.posterita.beans.CheckoutBean; +import org.posterita.beans.CreditPaymentDetailsBean; +import org.posterita.beans.OpenItemBean; +import org.posterita.beans.OrderLineBean; +import org.posterita.beans.PaymentAllocationBean; +import org.posterita.beans.PaymentTypeBean; +import org.posterita.beans.ShoppingCartBean; +import org.posterita.businesslogic.CashManager; +import org.posterita.businesslogic.InvoiceManager; +import org.posterita.businesslogic.MinOutManager; +import org.posterita.businesslogic.OrderManager; +import org.posterita.businesslogic.POSManager; +import org.posterita.businesslogic.PaymentManager; +import org.posterita.businesslogic.administration.BPartnerManager; +import org.posterita.exceptions.BPartnerNotFoundException; +import org.posterita.exceptions.BPartnerOverCreditLimitException; +import org.posterita.exceptions.DiscountLimitException; +import org.posterita.exceptions.MandatoryException; +import org.posterita.exceptions.NoPaymentAmountException; +import org.posterita.exceptions.OperationException; +import org.posterita.lib.UdiConstants; +import org.posterita.util.PoManager; + + +public class CreditOrderManager +{ + private static final int PROCESS_ID=238; + + public static int createCreditOrder(Properties ctx, CheckoutBean checkoutBean, HttpServletRequest request, String trxName) + throws DiscountLimitException,BPartnerOverCreditLimitException,OperationException + { + ShoppingCartBean cartBean = (ShoppingCartBean) request.getSession().getAttribute(Constants.SHOPPING_ORDER_CART); + OrderLineBean orderBean = new OrderLineBean(); + + //populate orderlineBean + orderBean.setBpartnerId(checkoutBean.getBpartnerId()); + orderBean.setToBeShipped(checkoutBean.getToBeShipped().toString()); + orderBean.setUserDiscount(null); + orderBean.setActualPrice(null); + orderBean.setTrxType(MOrder.PAYMENTRULE_OnCredit); + orderBean.setPaymentTermId(null); + + MOrder order = createCreditOrder(ctx, orderBean, cartBean.getItems(), trxName); + + return order.get_ID(); + } + + + public static MOrder createCreditOrder(Properties ctx,OrderLineBean bean,ArrayList cartBeanItems, String trxName) throws DiscountLimitException,BPartnerOverCreditLimitException,OperationException + { + bean.setTrxType(MOrder.PAYMENTRULE_OnCredit); + MBPartner bPartner = new MBPartner(ctx,bean.getBpartnerId(),trxName); + if(bPartner.getC_PaymentTerm_ID()==0) + throw new MandatoryException("Customer does not has a Payment Term,Please create one"); + MOrder creditOrder=null; + if(Boolean.parseBoolean(bean.getToBeShipped())==true) + { + creditOrder= POSManager.createCreditOrder(ctx,bean,cartBeanItems,trxName); + completeCreditOrder(ctx, creditOrder, trxName); + } + else + { + creditOrder= POSManager.createPOSOrder(ctx,bean,cartBeanItems,trxName); + } + + return creditOrder; + + } + + + public static MOrder completeCreditOrder(Properties ctx,int orderId, String trxName) throws BPartnerOverCreditLimitException,OperationException + { + + MOrder order = new MOrder(ctx,orderId,trxName); + + if(order.getC_DocTypeTarget_ID()==OrderManager.getDocTypeIDForStandardOrder(ctx)) + { + return completeCreditOrderWithOutShipment(ctx,order,trxName); + } + + else + { + return completeCreditOrder(ctx,order, trxName); + } + + } + + public static MOrder completeCreditOrderWithOutShipment(Properties ctx,MOrder order, String trxName) throws BPartnerOverCreditLimitException, OperationException + { + MOrder completedOrder = OrderManager.completeOrder(ctx,order); + MInvoice customerInvoice = POSManager.createCustomerInvoice(ctx, order); + customerInvoice.processIt(DocumentEngine.ACTION_Complete); + return completedOrder; + } + + + + + public static PaymentTypeBean createPayment(Properties ctx,OpenItemBean bean,String trxName) throws NoPaymentAmountException,OperationException + { + MInvoice invoice = new MInvoice(ctx,bean.getInvoiceId(),trxName); + MPayment payment=null; + MCashLine cashLine=null; + PaymentTypeBean pBean = null; + if(bean.getPaymentAmt()==null) + throw new NoPaymentAmountException("Payment amount can not be null"); + + + /* + if(bean.getTrxType().equals(MInvoice.PAYMENTRULE_Cash)) + { + cashLine=CashManager.createCashLineForInvoice(ctx,bean,trxName); + } + else + { + payment = PaymentManager.createARReceiptForCreditOrder(ctx,invoice,bean,trxName); + PoManager.save(payment); + } + */ + + payment = PaymentManager.createPaymentForCreditOrder(ctx,invoice,bean,trxName); + PoManager.save(payment); + + + if(cashLine != null) + { + pBean = new PaymentTypeBean(); + pBean.setPaymentType("cash"); + pBean.setId(cashLine.get_ID()); + + } + else + { + pBean = new PaymentTypeBean(); + pBean.setPaymentType("Card_Cheque"); + pBean.setId(payment.get_ID()); + } + + return pBean; + + } + + + public static ArrayList getOpenItems(Properties ctx,Integer C_BPartner_ID) throws OperationException + { + MBPartner bpartner = MBPartner.get(ctx, C_BPartner_ID); + + if(bpartner == null) + { + throw new BPartnerNotFoundException("customer not found"); + } + + String sql="select op.DOCUMENTNO," +//1 + "op.C_INVOICE_ID," +//2 + "op.C_ORDER_ID," +//3 + "op.ISSOTRX," +//4 + "op.DATEINVOICED," +//5 + "op.NETDAYS," +//6 + "op.DUEDATE," +//7 + "op.DAYSDUE," +//8 + "op.DISCOUNTDATE," +//9 + "op.DISCOUNTAMT ," +//10 + "ord.GRANDTOTAL ," +//11 + "op.PAIDAMT," +//12 + "op.OPENAMT," +//13 + "op.C_CURRENCY_ID," +//14 + "op.C_PAYMENTTERM_ID ," +//15 + "op.C_INVOICEPAYSCHEDULE_ID," +//16 + "ord.DOCUMENTNO,"+ //17 + "cr.ISO_CODE,"+ //18 + "pt.NAME,"+//19 + "bp.name|| ' ' || bp.name2,"+//20 + "op.C_BPARTNER_ID,"+//21 + //"DECODE(ord.GRANDTOTAL-nvl(sum(cl.AMOUNT),0),0,'"+Constants.PAID+"',ord.GRANDTOTAL,'"+Constants.UNPAID+"','"+Constants.PARTIALLY_PAID+"') status,"+//22 + " CASE WHEN ord.GRANDTOTAL-COALESCE(sum(cl.AMOUNT),0) = 0 THEN '"+Constants.PAID+"' WHEN ord.GRANDTOTAL-COALESCE(sum(cl.AMOUNT),0) = ord.GRANDTOTAL THEN '"+Constants.UNPAID+"' ELSE '"+Constants.PARTIALLY_PAID+"' END AS status,"+//22 + //" DECODE(sign(op.OPENAMT),-1,'"+Constants.OVER_PAID+"','NULL') sign"+//23 + " CASE WHEN sign(op.OPENAMT) = -1 THEN '"+Constants.OVER_PAID+"' ELSE 'NULL' END AS sign"+//23 + " from RV_OPENITEM op left outer join c_cashline cl on op.C_INVOICE_ID=cl.C_INVOICE_ID,C_ORDER ord,C_CURRENCY cr,C_PAYMENTTERM pt,c_bpartner bp " + + " where op.C_ORDER_ID=ord.C_ORDER_ID"+ + " and op.C_CURRENCY_ID=cr.C_CURRENCY_ID"+ + " and ord.C_PAYMENTTERM_ID=pt.C_PAYMENTTERM_ID"+ + " and op.C_BPARTNER_ID=bp.C_BPARTNER_ID"+ + " and op.C_BPARTNER_ID="+ C_BPartner_ID + + " and op.AD_CLIENT_ID="+Env.getAD_Client_ID(ctx); + + sql=sql+" group by"+ + " op.DOCUMENTNO," +//1 + "op.C_INVOICE_ID," +//2 + "op.C_ORDER_ID," +//3 + "op.ISSOTRX," +//4 + "op.DATEINVOICED," +//5 + "op.NETDAYS," +//6 + "op.DUEDATE," +//7 + "op.DAYSDUE," +//8 + "op.DISCOUNTDATE," +//9 + "op.DISCOUNTAMT ," +//10 + "ord.GRANDTOTAL ," +//11 + "op.PAIDAMT," +//12 + "op.OPENAMT," +//13 + "op.C_CURRENCY_ID," +//14 + "op.C_PAYMENTTERM_ID ," +//15 + "op.C_INVOICEPAYSCHEDULE_ID," +//16 + "ord.DOCUMENTNO,"+ //17 + "cr.ISO_CODE,"+ //18 + "pt.NAME,"+//19 + "bp.name|| ' ' || bp.name2,"+//20 + "op.C_BPARTNER_ID"+ + " order by op.DATEINVOICED desc "; + + PreparedStatement pstmt = DB.prepareStatement(sql,null); + + OpenItemBean bean=null; + BigDecimal amt = BigDecimal.valueOf(0.0); + + ArrayList list=new ArrayList(); + try + { + ResultSet rs = pstmt.executeQuery(); + + while(rs.next()) + { + bean=new OpenItemBean(); + + bean.setInvoiceNo(rs.getString(1)); + bean.setInvoiceId(rs.getInt(2)); + bean.setOrderId(rs.getInt(3)); + boolean isSoTrx = "Y".equals(rs.getString(4)); + bean.setIsSoTrx(isSoTrx); + bean.setInvoiceDate(rs.getString(5)); + bean.setNetDays(rs.getInt(6)); + bean.setDueDate(rs.getTimestamp(7)); + bean.setDaysDue(rs.getInt(8)); + bean.setDiscountDate(rs.getString(9)); + bean.setDiscountAmt(rs.getBigDecimal(10)); + bean.setInvoiceGrandTotal(rs.getBigDecimal(11)); + amt = getNonProcessedCashAmt(ctx,rs.getInt(2)); + + BigDecimal paidAmt = rs.getBigDecimal(12).add(amt); + if(!isSoTrx) + { + paidAmt = paidAmt.negate(); + } + + bean.setPaidAmt(paidAmt); + bean.setOpenAmt(rs.getBigDecimal(13).subtract(amt)); + bean.setCurrencyId(rs.getInt(14)); + bean.setPaymentTermId(rs.getInt(15)); + bean.setInvoiceScheduleId(rs.getInt(16)); + bean.setDocumentNo(rs.getString(17)); + bean.setCurrencySymbole(rs.getString(18)); + bean.setPaymentTermName(rs.getString(19)); + bean.setPartnerName(rs.getString(20)); + bean.setBpartnerId(rs.getInt(21)); + if(rs.getString(23)==null) + { + bean.setAllocationStatus(rs.getString(22)); + } + else + { + bean.setAllocationStatus(rs.getString(23)); + } + + if (rs.getBigDecimal(12).doubleValue()>0) + { + bean.setAllocationStatus(Constants.PARTIALLY_PAID); + } + list.add(bean); + } + rs.close(); + + } + catch (SQLException e) + { + throw new OperationException(e); + } + finally + { + try + { + + pstmt.close(); + } + catch (SQLException e) + { + + } + + } + return list; + } + + + + + + + public static ArrayList getUnallocatedPayments(Properties ctx,int bPartnerId) throws OperationException + { + String sql="select C_PAYMENT_ID ," +//1 + "DOCUMENTNO," +//2 + " CREATED," +//3 + "C_BPARTNER_ID," +//4 + "C_INVOICE_ID," +//5 + //"DECODE(TENDERTYPE,'K','Cheque','C','Card','Cash') tenderType," +//6 + "CASE WHEN TENDERTYPE='K' THEN 'Cheque' WHEN TENDERTYPE= 'C' THEN 'Card' ELSE 'Cash' END AS tenderType," +//6 + "PAYAMT," +//7 + "DISCOUNTAMT,"+//8 + "WRITEOFFAMT," +//9 + "TAXAMT, " +//10 + "OVERUNDERAMT," +//11 + "ALLOCATEDAMT," +//12 + "AVAILABLEAMT," + //13 + "ISRECEIPT " + //14 + " from RV_payment " + + " where C_BPARTNER_ID="+bPartnerId+ + " and AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+ + " AND DocStatus IN ('CO','CL') " + + " and AVAILABLEAMT <> 0"; + + + PreparedStatement pstmt = DB.prepareStatement(sql,null); + ResultSet rs=null; + OpenItemBean bean=null; + + ArrayList list=new ArrayList(); + try + { + rs = pstmt.executeQuery(); + + while(rs.next()) + { + bean=new OpenItemBean(); + + bean.setPaymentId(rs.getInt(1)); + bean.setPaymentNo(rs.getString(2)); + bean.setTrxDate(rs.getString(3)); + bean.setBpartnerId(rs.getInt(4)); + bean.setInvoiceId(rs.getInt(5)); + bean.setTenderType(rs.getString(6)); + + boolean isReceipt = "Y".equalsIgnoreCase(rs.getString(14)); + BigDecimal paymentAmt = rs.getBigDecimal(7); + BigDecimal discountAmt = rs.getBigDecimal(8); + BigDecimal writeOffAmt = rs.getBigDecimal(9); + BigDecimal taxedAmt = rs.getBigDecimal(10); + BigDecimal overUnderPayment = rs.getBigDecimal(11); + BigDecimal paymentAllocatedAmt = rs.getBigDecimal(12); + BigDecimal availableAmt = rs.getBigDecimal(13); + + bean.setPaymentAmt(isReceipt ? paymentAmt : paymentAmt.negate()); + bean.setDiscountAmt(isReceipt ? discountAmt : discountAmt.negate()); + bean.setWriteOffAmt(isReceipt ? writeOffAmt : writeOffAmt.negate()); + bean.setTaxedAmt(isReceipt ? taxedAmt : taxedAmt.negate()); + bean.setOverUnderPayment(isReceipt ? overUnderPayment : overUnderPayment.negate()); + bean.setPaymentAllocatedAmt(isReceipt ? paymentAllocatedAmt : paymentAllocatedAmt.negate()); + bean.setAvailableAmt(isReceipt ? availableAmt : availableAmt.negate()); + + list.add(bean); + } + + } + catch (SQLException e) + { + throw new OperationException(e); + } + finally + { + try + { + rs.close(); + pstmt.close(); + } + catch (SQLException e) + { + + } + + } + return list; + + + } + + + public static ArrayList getAging(Properties ctx,int bPartnerId) throws OperationException + { + ProcessInfoParameter param[]={ + new ProcessInfoParameter("C_BPartner_ID",new BigDecimal(bPartnerId),null,null,null), + new ProcessInfoParameter("IsSOTrx","Y",null,null,null) + }; + + MPInstance instance = new MPInstance(ctx,PROCESS_ID,bPartnerId); + instance.save(); + + ProcessInfo poInfo = new ProcessInfo("Aging",PROCESS_ID); + poInfo.setParameter(param); + poInfo.setAD_Process_ID(PROCESS_ID); + poInfo.setAD_PInstance_ID(instance.get_ID()); + Aging aging = new Aging(); + boolean success= aging.startProcess(ctx, poInfo,null); + ArrayList list = new ArrayList(); + if(success) + { + String sql="select C_CURRENCY_ID," +//1 + " DUEDATE ," +//2 + " C_BP_GROUP_ID," +//3 + " INVOICEDAMT," +//4 + " OPENAMT," +//5 + " PASTDUE91_PLUS," +//6 + " PASTDUE61_90," +//7 + " PASTDUE31_60," +//8 + " PASTDUE1_30 ," +//9 + " PASTDUE8_30," +//10 + " PASTDUE1_7," +//11 + " PASTDUEAMT," +//12 + " DUEAMT," +//13 + " DUE0," +//14 + " DUE1_7," +//15 + " DUE8_30," +//16 + " DUE0_30," +//17 + " DUE31_60," +//18 + " DUE61_90," +//19 + " DUE91_PLUS, " +//20 + " C_INVOICE_ID"+//21 + " from T_AGING"+ + " where C_BPARTNER_ID="+bPartnerId+ + " and AD_PINSTANCE_ID="+instance.get_ID(); + + PreparedStatement pstmt = DB.prepareStatement(sql,null); + ResultSet rs=null; + + AgingBean bean=null; + try + { + rs = pstmt.executeQuery(); + while(rs.next()) + { + bean=new AgingBean(); + bean.setCurrencyId(rs.getInt(1)); + bean.setDueDate(rs.getTimestamp(2)); + bean.setInvoicedAmt(rs.getBigDecimal(4)); + bean.setOpenAmt(rs.getBigDecimal(5)); + bean.setPastDue91_plus(rs.getBigDecimal(6)); + bean.setPastDue61_90(rs.getBigDecimal(7)); + bean.setPastDue31_60(rs.getBigDecimal(8)); + bean.setPastDue1_30(rs.getBigDecimal(9)); + bean.setPastDue8_30(rs.getBigDecimal(10)); + bean.setPastDue1_7(rs.getBigDecimal(11)); + bean.setPastDueAmt(rs.getBigDecimal(12)); + bean.setDueAmt(rs.getBigDecimal(13)); + bean.setDue0(rs.getBigDecimal(14)); + bean.setDue1_7(rs.getBigDecimal(15)); + bean.setDue8_30(rs.getBigDecimal(16)); + bean.setDue0_30(rs.getBigDecimal(17)); + bean.setDue31_60(rs.getBigDecimal(18)); + bean.setDue61_90(rs.getBigDecimal(19)); + bean.setDue91_PLUS(rs.getBigDecimal(20)); + bean.setInvoiceId(rs.getInt(21)); + + list.add(bean); + } + } + catch (SQLException e) + { + throw new OperationException(e); + } + finally + { + try + { + rs.close(); + pstmt.close(); + } + catch (SQLException e) + { + throw new OperationException(e); + } + } + } + return list; + } + + + public static ArrayList getAllCashPaymentForInvoice(Properties ctx,Integer invoiceId) throws OperationException + { + String sql="select " + + " C_CASHLINE_ID ," + //1 + " CREATED," + //2 + " CREATEDBY," + //3 + " C_CASH_ID," + //4 + " DESCRIPTION," + //5 + " CASHTYPE," + //6 + " C_INVOICE_ID," + //7 + " C_CURRENCY_ID," + //8 + " AMOUNT," +//9 + " DISCOUNTAMT," +//10 + " WRITEOFFAMT" +//11 + " from C_CASHLINE" + + " where C_INVOICE_ID="+invoiceId+ + " and AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+ + " order by CREATED"; + + ArrayList list = new ArrayList(); + PreparedStatement pstmt = DB.prepareStatement(sql,null); + ResultSet rs=null; + + CreditPaymentDetailsBean bean=null; + try + { + rs = pstmt.executeQuery(); + while(rs.next()) + { + bean=new CreditPaymentDetailsBean(); + bean.setCashLineId(rs.getInt(1)); + bean.setDateCreated(rs.getTimestamp(2)); + bean.setUserID(rs.getInt(3)); + bean.setCashId(rs.getInt(4)); + bean.setDescription(rs.getString(5)); + bean.setCashType(rs.getString(6)); + bean.setInvoiceId(rs.getInt(7)); + bean.setCurrencyId(rs.getInt(8)); + bean.setPaidAmt(rs.getBigDecimal(9)); + bean.setDiscountAmt(rs.getBigDecimal(10)); + bean.setWriteOffAmt(rs.getBigDecimal(11)); + bean.setTenderType("Cash"); + + list.add(bean); + } + } + catch (SQLException e) + { + throw new OperationException(e); + } + finally + { + try + { + rs.close(); + pstmt.close(); + } + catch (SQLException e) + { + throw new OperationException(e); + } + } + + return list; + } + + public static ArrayList getAllPaymentForInvoice(Properties ctx,Integer invoiceId) throws OperationException + { + String sql="select C_PAYMENT_ID," + //1 + "CREATED," +//2 + "CREATEDBY," +//3 + "DOCUMENTNO," +//4 + "C_INVOICE_ID," +//5 + //"decode(TENDERTYPE,'"+MPayment.TENDERTYPE_Check+"','Cheque','" + + "CASE WHEN TENDERTYPE='"+MPayment.TENDERTYPE_Check+"' THEN 'Cheque' " + + //MPayment.TENDERTYPE_CreditCard+"','Card')," +//6 + " WHEN TENDERTYPE='"+MPayment.TENDERTYPE_CreditCard+"' THEN 'Card' END ," +//6 + "CREDITCARDNUMBER," +//7 + "CHECKNO," +//8 + "PAYAMT," +//9 + "DISCOUNTAMT," +//110 + "WRITEOFFAMT," +//11 + "C_CURRENCY_ID" + //12 + " from c_payment"+ + " where C_INVOICE_ID="+invoiceId+ + " and AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+ + " order by CREATED";; + + ArrayList list = new ArrayList(); + PreparedStatement pstmt = DB.prepareStatement(sql,null); + ResultSet rs=null; + + CreditPaymentDetailsBean bean=null; + try + { + rs = pstmt.executeQuery(); + while(rs.next()) + { + bean=new CreditPaymentDetailsBean(); + bean.setPaymentId(rs.getInt(1)); + bean.setDateCreated(rs.getTimestamp(2)); + bean.setUserID(rs.getInt(3)); + bean.setDocumentNo(rs.getString(4)); + bean.setInvoiceId(rs.getInt(5)); + bean.setTenderType(rs.getString(6)); + bean.setCreditCardNumber(rs.getString(7)); + bean.setChequeNo(rs.getString(8)); + bean.setPaidAmt(rs.getBigDecimal(9)); + bean.setDiscountAmt(rs.getBigDecimal(10)); + bean.setWriteOffAmt(rs.getBigDecimal(11)); + bean.setCurrencyId(rs.getInt(12)); + + list.add(bean); + } + } + catch (SQLException e) + { + throw new OperationException(e); + } + finally + { + try + + { + if(rs!=null) + rs.close(); + pstmt.close(); + } + catch (SQLException e) + { + + } + } + + return list; + } + + public static MInOut createAndCompleteShipment(Properties ctx,int invoiceId) throws OperationException + { + return createAndCompleteShipment(ctx, invoiceId, null); + } + + public static MInOut createAndCompleteShipment(Properties ctx, int invoiceId, String trxName) throws OperationException + { + MInvoice invoice = new MInvoice(ctx,invoiceId,trxName); + MOrder order = new MOrder(ctx,invoice.getC_Order_ID(),trxName); + MInOut shipment=MinOutManager.createMInOut(ctx,invoice,order.getM_Warehouse_ID()); + MInOut completedShipment= MinOutManager.completeShipment(ctx, shipment); + order.setIsDelivered(true); + PoManager.save(order); + return completedShipment; + } + + public static ArrayList viewAllocation(Properties ctx,String bpartnerName, String invoiceNumber, boolean isCustomer, boolean isVendor) throws OperationException + { + String sql="select al.C_INVOICE_ID," +//1 + "inv.documentNo," +//2 + "al.C_BPARTNER_ID," +//3 + "al.C_ORDER_ID," +//4 + "ord.documentno," +//5 + "al.C_PAYMENT_ID," +//6 + "al.C_CASHLINE_ID," +//7 + "al.AMOUNT," +//8 + "al.DISCOUNTAMT," +//9 + "al.WRITEOFFAMT," +//10 + "bp.name||' ' ||bp.name2 ," +//11 + "al.OVERUNDERAMT, " +//12 + "al.C_ALLOCATIONHDR_ID"+//13 + " from C_ALLOCATIONLINE al,c_invoice inv,c_order ord,c_bpartner bp" + + " where al.c_invoice_id = inv.c_invoice_id" + + " and al.C_ORDER_ID=ord.C_ORDER_ID"+ + " and al.C_BPARTNER_ID=bp.C_BPARTNER_ID "; + + if(isCustomer) + sql=sql+ " and bp.isCustomer='Y'"; + + if(isVendor) + sql=sql+ " and bp.isVendor='Y'"; + + if(bpartnerName!=null) + sql=sql+ " and lower(bp.name||' ' ||bp.name2) like lower('%"+bpartnerName+"%')"; + + if(invoiceNumber!=null) + sql=sql+" and inv.documentNo='"+invoiceNumber+"'"; + + ArrayList list = new ArrayList(); + PreparedStatement pstmt = DB.prepareStatement(sql,null); + ResultSet rs=null; + + String invoiceNo=null; + String documentNo=null; + String partnerName=null; + + PaymentAllocationBean bean=null; + try + { + rs = pstmt.executeQuery(); + while(rs.next()) + { + + bean=new PaymentAllocationBean(); + bean.setInvoiceId(rs.getInt(1)); + if(invoiceNo==null || !invoiceNo.equals(rs.getString(2))) + { + bean.setInvoiceNo(rs.getString(2)); + invoiceNo=rs.getString(2); + } + bean.setBpartnerId(rs.getInt(3)); + bean.setOrderId(rs.getInt(4)); + if(documentNo==null || !documentNo.equals(rs.getString(5))) + { + bean.setDocumentNo(rs.getString(5)); + documentNo=rs.getString(5); + } + + if(rs.getInt(6)!=0) + { + bean.setPaymentId(rs.getInt(6)); + } + + if(rs.getInt(7)!=0) + { + bean.setCashLineId(rs.getInt(7)); + } + if(rs.getInt(6)==0 && rs.getInt(7)==0) + { + getReturnedInvoice(ctx,bean,rs.getInt(1),rs.getInt(13),rs.getBigDecimal(8)); + } + + bean.setAmount(rs.getBigDecimal(8)); + bean.setDiscountAmt(rs.getBigDecimal(9)); + bean.setWriteOffAmt(rs.getBigDecimal(10)); + + if(partnerName==null || !partnerName.equals(rs.getString(11))) + { + bean.setPartnerName(rs.getString(11)); + partnerName=rs.getString(11); + } + bean.setOverUnderPayment(rs.getBigDecimal(12)); + list.add(bean); + } + } + catch (SQLException e) + { + throw new OperationException(e); + } + finally + { + try + { + if(rs!=null) + rs.close(); + pstmt.close(); + } + catch (SQLException e) + { + + } + } + + return list; + + } + + + private static void getReturnedInvoice(Properties ctx,PaymentAllocationBean bean,int invoiceId, int C_ALLOCATIONHDR_ID,BigDecimal amt) throws OperationException + { + String sql="select al.C_INVOICE_ID,inv.documentNo" + + " from C_ALLOCATIONLINE al,c_invoice inv " + + " where al.c_invoice_id = inv.c_invoice_id"+ + " and al.C_ALLOCATIONHDR_ID= "+C_ALLOCATIONHDR_ID+ + " and al.C_INVOICE_ID<>"+invoiceId+ + " and al.AMOUNT="+amt.negate(); + + PreparedStatement pstmt = DB.prepareStatement(sql,null); + ResultSet rs=null; + + + try + { + rs = pstmt.executeQuery(); + while(rs.next()) + { + bean.setCreditMemoId(rs.getInt(1)); + bean.setCreditMemoNumber(rs.getString(2)); + } + } + catch (SQLException e) + { + throw new OperationException(e); + } + finally + { + try + + { + if(rs!=null) + rs.close(); + pstmt.close(); + } + catch (SQLException e) + { + + } + } + + + } + + + + + private static MOrder completeCreditOrder(Properties ctx,MOrder order, String trxName) throws BPartnerOverCreditLimitException,OperationException + { + // POSManager.completePOSOrder2() + MOrder completedOrder = OrderManager.completeOrder(ctx,order); + int [] invoiceIds=InvoiceManager.getInvoiceIdsForOrder(ctx,order.get_ID(),trxName); + if(invoiceIds.length<1) + throw new OperationException("No invoice generated"); + if(invoiceIds.length>1) + throw new OperationException("More than one invoice for the order has been generated"); + //MInvoice invoice = new MInvoice(ctx,invoiceIds[0],trxName); + //InvoiceManager.printInvoice(ctx,invoice); + + return completedOrder; + } + + private static BigDecimal getNonProcessedCashAmt(Properties ctx, int invoiceId) throws OperationException + { + String sql = "select nvl(sum(cl.AMOUNT),0)" + + " from c_cashline cl,C_CASH ca" + + " where cl.c_cash_id = ca.c_cash_id " + + " and cl.c_invoice_id = " +invoiceId+ + " and cl.AD_CLIENT_ID = " +Env.getAD_Client_ID(ctx)+ + " and ca.docstatus = '"+DocumentEngine.STATUS_Drafted+"'"; + + PreparedStatement pstmt = DB.prepareStatement(sql,null); + ResultSet rs=null; + BigDecimal amt = new BigDecimal(0); + + + try + { + rs = pstmt.executeQuery(); + + while(rs.next()) + { + amt=rs.getBigDecimal(1); + } + + } + catch (SQLException e) + { + throw new OperationException(e); + } + finally + { + try + { + rs.close(); + pstmt.close(); + } + catch (SQLException e) + { + + } + + } + return amt; + + + } + +} + + diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/performanceanalysis/CSVReportManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/performanceanalysis/CSVReportManager.java new file mode 100644 index 0000000000..d30a559f85 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/businesslogic/performanceanalysis/CSVReportManager.java @@ -0,0 +1,165 @@ +/** + * Product: Posterita Web-Based POS (an Adempiere Plugin) + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +/** + @author Praveen Beekoo + */ +package org.posterita.businesslogic.performanceanalysis; + +import java.io.FileWriter; +import java.io.IOException; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.Properties; + +import org.compiere.util.DB; + +import org.posterita.core.RandomStringGenerator; +import org.posterita.exceptions.OperationException; + +public class CSVReportManager +{ + public static String generateCSVReport(Properties ctx, String sql) throws OperationException + { + PreparedStatement pstmt = DB.prepareStatement(sql, null); + + return generateCSVReport(ctx, pstmt); + } + public static String generateCSVReport(Properties ctx, PreparedStatement pstmt) throws OperationException + { + ResultSet rs; + StringBuffer sb = new StringBuffer(); + +// int count=0; + try + { + rs = pstmt.executeQuery(); + + int columnCount = rs.getMetaData().getColumnCount(); + for(int i = 1; i <= columnCount; i++) + { + if(i == 1) + sb.append("\""); + else + sb.append(",\""); + + sb.append(rs.getMetaData().getColumnName(i)); + sb.append("\""); + } + + sb.append("\n"); + + while(rs.next()) + { + for(int i = 1; i <= columnCount; i++) + { + if(i == 1) + sb.append("\""); + else + sb.append(",\""); + + sb.append(rs.getObject(i)); + sb.append("\""); + } + + sb.append("\n"); + } + + rs.close(); + } + catch (SQLException e) + { + throw new OperationException(e); + } + finally + { + try + { + pstmt.close(); + } + catch(Exception ex){} + + pstmt = null; + } + + String filename = RandomStringGenerator.randomstring() + ".csv"; + String filepath = ReportManager.getReportPath(filename); + + try + { + FileWriter writer = new FileWriter(filepath); + writer.write(sb.toString()); + writer.flush(); + writer.close(); + } + catch (IOException e1) + { + throw new OperationException(e1); + } + + return filename; + } + + public static String generateCSVReport(Properties ctx, ArrayList reportDataSource) throws OperationException + { +// ResultSet rs; + StringBuffer sb = new StringBuffer(); + + Iterator iter = reportDataSource.iterator(); + + while(iter.hasNext()) + { + Object[] obj = (Object[]) iter.next(); + + for(int i = 0; i < obj.length; i++) + { + if(i == 0) + sb.append("\""); + else + sb.append(",\""); + + sb.append(obj[i]); + sb.append("\""); + } + + sb.append("\n"); + } + + String filename = RandomStringGenerator.randomstring() + ".csv"; + String filepath = ReportManager.getReportPath(filename); + + try + { + FileWriter writer = new FileWriter(filepath); + writer.write(sb.toString()); + writer.flush(); + writer.close(); + } + catch (IOException e1) + { + throw new OperationException(e1); + } + + return filename; + } +} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/performanceanalysis/CustomPOSReportManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/performanceanalysis/CustomPOSReportManager.java new file mode 100644 index 0000000000..64c2d21933 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/businesslogic/performanceanalysis/CustomPOSReportManager.java @@ -0,0 +1,553 @@ +/** + * Product: Posterita Web-Based POS (an Adempiere Plugin) + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +/** + @author Praveen Beekoo + */ +package org.posterita.businesslogic.performanceanalysis; + +import java.awt.Color; +import java.math.BigDecimal; +import java.sql.Timestamp; +import java.text.DecimalFormat; +import java.text.NumberFormat; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Collection; +import java.util.Date; +import java.util.Iterator; +import java.util.Properties; +import java.util.TreeMap; + +import org.compiere.util.Env; +import org.jfree.chart.axis.DateAxis; +import org.jfree.chart.labels.StandardPieSectionLabelGenerator; +import org.jfree.chart.plot.PiePlot; +import org.jfree.chart.plot.XYPlot; +import org.jfree.data.category.DefaultCategoryDataset; +import org.jfree.data.general.DefaultPieDataset; +import org.jfree.data.time.Day; +import org.jfree.data.time.TimeSeries; +import org.jfree.data.time.TimeSeriesCollection; +import org.posterita.Constants; +import org.posterita.beans.ReportBean; +import org.posterita.beans.TabularReportRecordBean; +import org.posterita.businesslogic.POSTerminalManager; +import org.posterita.core.BarChart; +import org.posterita.core.PieChart; +import org.posterita.core.TabularReport; +import org.posterita.core.TimeSeriesChart; +import org.posterita.core.TimestampConvertor; +import org.posterita.exceptions.OperationException; + +public class CustomPOSReportManager +{ + public static PieChart generatePieChart(Properties ctx,String title,String subtitle,int account_id,Timestamp fromDate,Timestamp toDate,String salesGroup,String priceQtyFilter) throws OperationException + { + PieChart pieChart = new PieChart(); + pieChart.setTitle(title); + pieChart.setSubtitle(subtitle); + + String pieChartSQL = SalesAnalysisReportManager.getPieChartDataSetSQL(ctx,account_id,fromDate,toDate,salesGroup); + ArrayList list = ReportManager.getReportData(ctx,pieChartSQL,false); + DefaultPieDataset pieDataset = new DefaultPieDataset(); + StandardPieSectionLabelGenerator labelGenerator = null; + + + if(priceQtyFilter.equalsIgnoreCase(Constants.PRICE)) + { + //against price + for(Object[] obj:list) + { + String name = (String) obj[0]; + BigDecimal price = (BigDecimal) obj[1]; + + pieDataset.setValue(name,price); + } + + String currency = POSTerminalManager.getDefaultSalesCurrency(ctx).getCurSymbol(); + labelGenerator = new StandardPieSectionLabelGenerator("{0} = "+ currency +"{1}"); + } + else + { + //against qty + for(Object[] obj:list) + { + String name = (String) obj[0]; + BigDecimal qty = (BigDecimal) obj[2]; + + pieDataset.setValue(name,qty); + } + + labelGenerator = new StandardPieSectionLabelGenerator(); + } + + + pieChart.setDataset(pieDataset); + PiePlot p = (PiePlot) pieChart.getChart().getPlot(); + p.setLegendLabelGenerator(labelGenerator); + pieChart.getChart().setBackgroundPaint(Color.white); + + return pieChart; + } + + public static BarChart generateBarChart(Properties ctx,String title,String subtitle,int account_id,Timestamp fromDate,Timestamp toDate,String salesGroup,String priceQtyFilter) throws OperationException + { + BarChart barChart = new BarChart(); + barChart.setTitle(title); + barChart.setSubtitle(subtitle); + //barChart.getDataSetFromSQL(barChartSQL); + + String barChartSQL = SalesAnalysisReportManager.getBarChartDataSetSQL(ctx,account_id,fromDate,toDate,salesGroup); + ArrayList list = ReportManager.getReportData(ctx,barChartSQL,true); + DefaultCategoryDataset categoryDataset = new DefaultCategoryDataset(); + + Object[] header = list.remove(0); + String grouping = header[0]+""; + String yLabel = null; + + + if(priceQtyFilter.equalsIgnoreCase(Constants.PRICE)) + { + String currency = POSTerminalManager.getDefaultSalesCurrency(ctx).getCurSymbol(); + + //against price + for(Object[] obj:list) + { + String name = (String) obj[0]; + BigDecimal price = (BigDecimal) obj[1]; + + categoryDataset.setValue(price,grouping,name); + yLabel = "Value (" + currency + ")"; + } + } + else + { + //against qty + for(Object[] obj:list) + { + String name = (String) obj[0]; + BigDecimal qty = (BigDecimal) obj[2]; + + categoryDataset.setValue(qty,grouping,name); + yLabel = "Quantity"; + } + } + + //xLabel = grouping; + + //--------------------------------------------------------------------------------- + barChart.setDataset(categoryDataset); + barChart.setIntegerTickUnits(true); + + //CategoryItemRenderer itemRender = barChart.getChart().getPlot(); + //itemRender.setItemLabelGenerator(new StandardCategoryItemLabelGenerator()); + + barChart.setYLabel(yLabel); + //barChart.setXLabel(xLabel); + barChart.setShowLabels(true); + barChart.getChart().setBackgroundPaint(Color.white); + + + return barChart; + } + + public static TimeSeriesChart generateTimeSeriesChart(Properties ctx,String title,String subtitle,int account_id,Timestamp fromDate,Timestamp toDate,String salesGroup,String priceQtyFilter) throws OperationException + { + TimeSeriesChart timeSeriesChart = new TimeSeriesChart(); + timeSeriesChart.setTitle(title); + timeSeriesChart.setSubtitle(subtitle); + timeSeriesChart.setShowShapes(true); + //timeSeriesChart.getDataSetFromSQL(timeSeriesChartSQL); + + String timeSeriesChartSQL = SalesAnalysisReportManager.getTimeSeriesDataSetSQL(ctx,account_id,fromDate,toDate,salesGroup); + ArrayList list = ReportManager.getReportData(ctx,timeSeriesChartSQL,false); + + TimeSeriesCollection dataset = new TimeSeriesCollection(); + TimeSeries series = null; + String yLabel = null; + + String seriesName = null; + String date = null; + BigDecimal price = null; + String[] s = null; + int day,month,year; + + for (Object[] data : list) + { + seriesName = (String)data[0]; + date = (String)data[1]; + price = (BigDecimal) data[2]; + s = date.split("-"); + + if(s.length!=3) + throw new OperationException("Unable to generate timeseries. " + + "Cause:Invalid date format, the date returned should have the following format 'DD-MM-YYYY'"); + + SimpleDateFormat sdf = new SimpleDateFormat(); + Calendar cal = Calendar.getInstance(); + Date d = null; + + try + { + sdf.applyPattern("dd-MM-yyyy"); + d = sdf.parse(date); + } + catch (ParseException e1) + { + try + { + sdf.applyPattern("dd-MMM-yyyy"); + d = sdf.parse(date); + } + catch (ParseException e) + { + throw new OperationException("Unable to generate timeseries. " + + "Cause:Invalid date format, the date returned should have one of the following formats 'DD-MM-YYYY' or 'DD-MMM-YYYY'",e); + } + } + + + cal.setTime(d); + + day = cal.get(Calendar.DATE); + month = cal.get(Calendar.MONTH) + 1; + year = cal.get(Calendar.YEAR); + + series = dataset.getSeries(seriesName); + + if(series == null) + { + series = new TimeSeries(seriesName,Day.class); + series.add(new Day(day,month,year),price); + + dataset.addSeries(series); + } + else + { + series.add(new Day(day,month,year),price); + }//if + + }//for + + if(priceQtyFilter.equalsIgnoreCase(Constants.PRICE)) + { + //against price + String currency = POSTerminalManager.getDefaultSalesCurrency(ctx).getCurSymbol(); + yLabel = "Value (" + currency + ")"; + } + else + { + yLabel = "Quantity"; + } + + timeSeriesChart.setYLabel(yLabel); + timeSeriesChart.setDataset(dataset); + XYPlot plot = (XYPlot) timeSeriesChart.getChart().getPlot(); + DateAxis axis = (DateAxis) plot.getDomainAxis(); + + SimpleDateFormat sdf = new SimpleDateFormat(TimestampConvertor.DEFAULT_DATE_PATTERN1); + + axis.setRange(fromDate, toDate); + //axis.setTickUnit(new DateTickUnit(DateTickUnit.MONTH,1,new SimpleDateFormat("MMM-yyyy"))); + timeSeriesChart.getChart().setBackgroundPaint(Color.white); + + return timeSeriesChart; + } + + public static TabularReport generateTabularReport(Properties ctx,String title,String subtitle,int account_id,Timestamp fromDate,Timestamp toDate,String salesGroup,String priceQtyFilter) throws OperationException + { + String sql = SalesAnalysisReportManager.getTabularDataSetSQL(ctx,account_id,fromDate,toDate,salesGroup); + ArrayList tmpData = ReportManager.getReportData(ctx,sql,true); + String currency = POSTerminalManager.getDefaultSalesCurrency(ctx).getCurSymbol(); + + ArrayList reportData = new ArrayList(); + //copying data from tmpData to reportData + + NumberFormat formatter = new DecimalFormat("###,###,##0.00"); + + Iterator iter = tmpData.iterator(); + + Object[] data = null; + Object[] headers = null; + BigDecimal b,c = null; + + boolean isTaxDue = (account_id == Constants.TAX_DUE.intValue() ); + boolean isTaxCredit = (account_id == Constants.TAX_CREDIT.intValue() ); + + if(isTaxCredit || isTaxDue) + { + //copying header + headers = iter.next(); + + reportData.add( new Object[]{ + headers[0] +"("+ currency +")", + }); + + while(iter.hasNext()) + { + data = iter.next(); + + if(data.length == 1) + { + b = (BigDecimal)data[0]; + data[0] = formatter.format(b.doubleValue()); + } + + reportData.add(data); + } + } + else + { + //copying header + headers = iter.next(); + + reportData.add( new Object[]{ + headers[0], + headers[1], + headers[2] +"("+ currency +")", + headers[3] + }); + + double totalAmt = 0.0d; + BigDecimal totalQty = Env.ZERO; + + while(iter.hasNext()) + { + data = iter.next(); + + + if(data.length > 2) + { + b = (BigDecimal)data[2]; + c = (BigDecimal)data[3]; + + data[2] = formatter.format(b.doubleValue()); + + totalAmt += b.doubleValue(); + totalQty = totalQty.add(c); + + } + + reportData.add(data); + } + + reportData.add(new Object[]{"Total","", formatter.format(totalAmt)+"", totalQty+""}); + + } + + + //style for table + String tableStyle = "display"; + //style for columns + String[] styles = new String[]{"string","date","currency","numeric"}; + + if(isTaxCredit || isTaxDue) + { + styles = new String[]{"numeric"}; + } + + //constructing the table + TabularReport tReport = new TabularReport(reportData); + //tReport.setSortable(true); + tReport.setHeaderStyle(styles); + tReport.setStyle(tableStyle); + tReport.setTitle(title); + tReport.setSubtitle(subtitle); + tReport.createReport(); + + return tReport; + } + + public static TabularReport generateTabularReportGroupByDate(Properties ctx,String title,String subtitle,int account_id,Timestamp fromDate,Timestamp toDate,String salesGroup,String priceQtyFilter) throws OperationException + { + boolean isTaxDue = (account_id == Constants.TAX_DUE.intValue() ); + boolean isTaxCredit = (account_id == Constants.TAX_CREDIT.intValue() ); + + NumberFormat formatter = new DecimalFormat("###,###,##0.00"); + + String sql = SalesAnalysisReportManager.getTabularDataSetSQL(ctx,account_id,fromDate,toDate,salesGroup); + ArrayList tmpData = ReportManager.getReportData(ctx,sql,true); + String currency = POSTerminalManager.getDefaultSalesCurrency(ctx).getCurSymbol(); + + + ArrayList reportData = new ArrayList(); + Object[] data = null; + BigDecimal b = null; + + if(isTaxCredit || isTaxDue) + { + reportData.add( tmpData.remove(0) ); + Iterator iter = tmpData.iterator(); + + while(iter.hasNext()) + { + data = iter.next(); + + if(data.length == 1) + { + b = (BigDecimal)data[0]; + data[0] = formatter.format(b.doubleValue()); + } + + reportData.add(data); + } + } + else + { + //---------------------------------------------------------------------------------------------------------------------------------------------------------- + TreeMap map = new TreeMap(); + + String productName = null; + BigDecimal price = null; + BigDecimal qty = null; + + TabularReportRecordBean bean = null; + + ArrayList reportData2 = new ArrayList(); + Object[] headers = tmpData.remove( 0 ); + + //adding headers + reportData2.add( new Object[]{ + headers[0], + //headers[1], + headers[2] +"("+ currency +")", + headers[3] + } ); + + double totalAmt = 0.0d; + int totalQty = 0; + + for( Object[] record : tmpData) + { + productName = (String) record[0]; + price = (BigDecimal) record[2]; + qty = (BigDecimal) record[3]; + + totalAmt += price.doubleValue(); + totalQty += qty.intValue(); + + bean = map.get( productName ); + + if( bean == null ) + { + bean = new TabularReportRecordBean(); + + bean.setProductName( productName ); + bean.setDate(""); + bean.setPrice( price ); + bean.setQty( qty ); + } + else + { + bean.setPrice( bean.getPrice().add( price ) ); + bean.setQty( bean.getQty().add( qty ) ); + } + + map.put( productName, bean ); + + }//for + + + Collection c = map.values(); + + for( TabularReportRecordBean tbean : c ) + { + Object[] obj = new Object[]{ + tbean.getProductName(), + tbean.getPrice(), + tbean.getQty() + }; + + reportData2.add( obj ); + } + + reportData.add( reportData2.remove(0) ); + + Iterator iter = reportData2.iterator(); + + while(iter.hasNext()) + { + data = iter.next(); + + if(data.length > 2) + { + b = (BigDecimal)data[1]; + data[1] = formatter.format(b.doubleValue()); + } + + reportData.add(data); + } + + reportData.add(new Object[]{"Total","" + formatter.format(totalAmt), totalQty + ""}); + + } + + + //style for table + String tableStyle = "display"; + //style for columns + String[] styles = new String[]{"string","currency","numeric"}; + + if(isTaxCredit || isTaxDue) + { + styles = new String[]{"numeric"}; + } + + //constructing the table + TabularReport tReport = new TabularReport(reportData); + //tReport.setSortable(true); + tReport.setHeaderStyle(styles); + tReport.setStyle(tableStyle); + tReport.setTitle(title); + tReport.setSubtitle(subtitle); + tReport.createReport(); + + return tReport; + } + + /** + * Generates the title of the custom report + * @param ctx + * @param title + * @param bean + * @return true is returned if set + */ + public static boolean setTitle(Properties ctx, String title, ReportBean bean) + { + return true; + } + + /** + * Generates the subtitle of the custom report + * @param ctx + * @param subtitle + * @param bean + * @return true is returned if set + */ + public static String setSubTitle(Properties ctx, String subtitle, ReportBean bean) + { + return null; + } + + +} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/performanceanalysis/POSReportManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/performanceanalysis/POSReportManager.java new file mode 100644 index 0000000000..6347071ad4 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/businesslogic/performanceanalysis/POSReportManager.java @@ -0,0 +1,3962 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Created on May 9, 2006 by alok + */ + +package org.posterita.businesslogic.performanceanalysis; + +import java.awt.Color; +import java.io.FileOutputStream; +import java.io.PrintWriter; +import java.io.Writer; +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Timestamp; +import java.text.DateFormatSymbols; +import java.text.DecimalFormat; +import java.text.NumberFormat; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Collections; +import java.util.Comparator; +import java.util.Date; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.Properties; +import java.util.Set; + +import org.apache.ecs.XhtmlDocument; +import org.apache.ecs.xhtml.head; +import org.compiere.db.Database; +import org.compiere.model.I_AD_ReportView; +import org.compiere.model.Lookup; +import org.compiere.model.MBPartner; +import org.compiere.model.MBPartnerLocation; +import org.compiere.model.MDocType; +import org.compiere.model.MInOut; +import org.compiere.model.MInvoice; +import org.compiere.model.MLocation; +import org.compiere.model.MOrder; +import org.compiere.model.MOrg; +import org.compiere.model.MPInstance; +import org.compiere.model.MPInstancePara; +import org.compiere.model.MProcess; +import org.compiere.model.MProcessPara; +import org.compiere.model.MProduct; +import org.compiere.model.MQuery; +import org.compiere.model.MRole; +import org.compiere.model.MTable; +import org.compiere.model.MTransaction; +import org.compiere.model.MUOM; +import org.compiere.model.MUser; +import org.compiere.model.MWarehouse; +import org.compiere.model.PrintInfo; +import org.compiere.print.DataEngine; +import org.compiere.print.MPrintFormat; +import org.compiere.print.MPrintFormatItem; +import org.compiere.print.PrintData; +import org.compiere.print.PrintDataElement; +import org.compiere.print.ReportEngine; +import org.compiere.process.ProcessInfo; +import org.compiere.process.ProcessInfoParameter; +import org.compiere.report.ReportStarter; +import org.compiere.util.DB; +import org.compiere.util.DisplayType; +import org.compiere.util.Env; +import org.compiere.util.Language; +import org.compiere.util.Util; +import org.compiere.utils.DBUtils; +import org.posterita.Constants; +import org.posterita.beans.BPartnerBean; +import org.posterita.beans.CloseTillBean; +import org.posterita.beans.POSHistoryBean; +import org.posterita.beans.POSReportBean; +import org.posterita.beans.ProductBean; +import org.posterita.beans.WebMinOutLineBean; +import org.posterita.beans.WebOrderLineBean; +import org.posterita.businesslogic.MinOutManager; +import org.posterita.businesslogic.OrganisationManager; +import org.posterita.businesslogic.POSManager; +import org.posterita.businesslogic.POSStockManager; +import org.posterita.businesslogic.POSTerminalManager; +import org.posterita.businesslogic.administration.BPartnerManager; +import org.posterita.businesslogic.administration.ProductManager; +import org.posterita.core.RandomStringGenerator; +import org.posterita.core.TimestampConvertor; +import org.posterita.exceptions.LogoException; +import org.posterita.exceptions.MandatoryException; +import org.posterita.exceptions.OperationException; +import org.posterita.exceptions.UnsupportedDatabaseException; +import org.posterita.lib.UdiConstants; +import org.posterita.order.UDIOrderTypes; +import org.posterita.util.PathInfo; +import org.posterita.util.TmkPrinterConstants; + +import com.lowagie.text.Chunk; +import com.lowagie.text.Document; +import com.lowagie.text.Element; +import com.lowagie.text.Font; +import com.lowagie.text.Image; +import com.lowagie.text.PageSize; +import com.lowagie.text.Paragraph; +import com.lowagie.text.Phrase; +import com.lowagie.text.pdf.PdfPCell; +import com.lowagie.text.pdf.PdfPTable; +import com.lowagie.text.pdf.PdfWriter; + +public class POSReportManager { + + private static final String ASCENDING_SORT = "asc"; + + private static String getMaxMinSoldProductsSQL(Properties ctx, + String reportType, Timestamp fromDate, Timestamp toDate) { + String sql = ""; + if (DB.getDatabase().getName().equals(Database.DB_POSTGRESQL) || DB.getDatabase().getName().equals(Database.DB_ORACLE)) + { + sql = "select qty,name,COALESCE(upc, ' ') as barcode,M_PRODUCT_ID from " + + "(select sum(ol.QTYENTERED) as qty,pr.NAME, pr.UPC,ol.M_PRODUCT_ID," + //+ "DENSE_RANK() OVER (ORDER BY sum(ol.QTYENTERED) " + //+ reportType + //+ " NULLS LAST) AS Drank" + + " max(ol.QTYENTERED) AS Drank" + + " from C_ORDERLINE ol,C_ORDER ord,M_product pr" + + " where ol.C_ORDER_ID=ord.c_order_id" + + " and ol.M_PRODUCT_ID=pr.M_PRODUCT_ID" + + " and ol.AD_ORG_ID=" + + Env.getAD_Org_ID(ctx) + + " and ol.AD_CLIENT_ID=" + + Env.getAD_Client_ID(ctx) + + " and ord.ISACTIVE='Y'" + + " and ol.CREATED between " + DB.TO_DATE(fromDate, false) + + " and " + DB.TO_DATE(toDate, false) + + " and ord.ORDERTYPE='"+ UDIOrderTypes.POS_ORDER.getOrderType() +"'" + + " and ord.DOCSTATUS='CO' group by pr.NAME,pr.UPC,ol.M_PRODUCT_ID) fastStockMovement" + + " where drank <26 order by qty " + reportType; + } + + else + throw new UnsupportedDatabaseException( + "Operation GetMaxMinSoldProducts not supported on Database: " + + DB.getDatabase().getName()); + + return sql; + } + + public static ArrayList getMaxMinSoldProducts(Properties ctx, + String reportType, Timestamp fromDate, Timestamp todate) + throws OperationException { + String sql = getMaxMinSoldProductsSQL(ctx, reportType, fromDate, todate); + + PreparedStatement pstmt = DB.prepareStatement(sql, null); + + ProductBean bean = null; + ArrayList list = new ArrayList(); + + // TreeMap tree = new + // TreeMap(); + try { + ResultSet rs = pstmt.executeQuery(); + while (rs.next()) { + bean = new ProductBean(); + BigDecimal qty = getQtyReturnedFromCustomer(ctx, rs.getInt(4), + fromDate, todate); + bean.setProductName(rs.getString(2).replaceAll("~", " ")); + bean.setBarCode(rs.getString(3)); + BigDecimal qty1 = rs.getBigDecimal(1); + int productId = rs.getInt(4); + MProduct product = new MProduct(ctx, productId, null); + String uom = product.getUOMSymbol(); + bean.setUom(uom); + if (qty1 == null) + { + qty1 = BigDecimal.ZERO; + } + if (qty == null) + { + qty = BigDecimal.ZERO; + } + + BigDecimal quantity = qty1.subtract(qty); + bean.setQuantity(quantity); + + list.add(bean); + } + rs.close(); + + Collections.sort(list, getSortingComparator(reportType)); + return list; + + } catch (SQLException e) { + throw new OperationException(e); + } finally { + try { + pstmt.close(); + } catch (Exception e) { + } + + pstmt = null; + } + + } + + private static Comparator getSortingComparator( + final String order) { + Comparator comp = new Comparator() { + + public int compare(ProductBean o1, ProductBean o2) { + if (o1.getQuantity().intValue() < o2.getQuantity().intValue()) + return (order.equals(ASCENDING_SORT) ? -1 : 1); + else if (o1.getQuantity().intValue() > o2.getQuantity() + .intValue()) + return (order.equals(ASCENDING_SORT) ? 1 : -1); + else + return 0; + } + + }; + return comp; + } + + private static BigDecimal getQtyReturnedFromCustomer(Properties ctx, + int productId, Timestamp fromDate, Timestamp toDate) + throws OperationException { + BigDecimal qty = Env.ZERO; + + String sql = "select" + " sum(ol.qtyordered)" + + " from C_ORDER ord,C_ORDERLINE ol" + + " where ord.C_ORDER_ID=ol.c_order_id " + + " and ord.AD_CLIENT_ID=" + Env.getAD_Client_ID(ctx) + + " and ol.M_PRODUCT_ID=" + productId + " and ord.orderType='" + + UDIOrderTypes.CUSTOMER_RETURN_ORDER.getOrderType() + "'" + + " and ol.CREATED between "+ DB.TO_DATE(fromDate, false) + " and " + DB.TO_DATE(toDate, false); + + PreparedStatement pstmt = DB.prepareStatement(sql, null); + + try { + ResultSet rs = pstmt.executeQuery(); + while (rs.next()) { + qty = rs.getBigDecimal(1); + } + + rs.close(); + } catch (SQLException e) { + throw new OperationException(e); + } finally { + try { + pstmt.close(); + } catch (Exception e) { + } + + pstmt = null; + } + + return qty; + } + + public static ArrayList getStockMovementReport( + Properties ctx, Timestamp fromDate, Timestamp toDate) + throws OperationException { + + String sql = "select distinct v.m_product_id," + " pr.name" + + " from M_TRANSACTION_V v,m_product pr" + + " where v.m_product_id=pr.m_product_id" + + " and v.CREATED between "+DB.TO_DATE(fromDate, false) + + " and "+ DB.TO_DATE(toDate, false) + + " and v.AD_CLIENT_ID=" + + Env.getAD_Client_ID(ctx) + " and v.AD_ORG_ID=" + + Env.getAD_Org_ID(ctx) + " order by pr.name"; + + MWarehouse warehouse = POSTerminalManager.getWarehouse(ctx); + /* + * String sql = "select" + " distinct M_PRODUCT_ID " + //3 " from + * M_STORAGE st" + " where st.AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+ " + * and st.AD_ORG_ID=" +Env.getAD_Org_ID(ctx)+ " and st.M_LOCATOR_ID=" + * +warehouse.getDefaultLocator().getID(); + */ + + // String whereClause = "AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+" and + // AD_ORG_ID="+Env.getAD_Org_ID(ctx); + + POSReportBean bean; + ArrayList list = new ArrayList(); + + PreparedStatement pstmt = DB.prepareStatement(sql, null); + + ResultSet rs; + try { + rs = pstmt.executeQuery(); + while (rs.next()) { + BigDecimal qtyOfSales; + BigDecimal qtyOfReceipts; + BigDecimal qtyOfReturn; + BigDecimal qtyOfCustReturn; + BigDecimal openingBal; + BigDecimal closingBal; + BigDecimal qtyofSalesByCredit; + BigDecimal qtyInventoryIn; + // int qtyInventoryOut; + + /* + * if(!isProductPresentInOrder(ctx,rs.getInt(1),fromDate,todate)) + * continue; + */ + MProduct product = MProduct.get(ctx, rs.getInt(1)); + int uomPrecision = MUOM.getPrecision(ctx, product.getC_UOM_ID()); + String uom = product.getUOMSymbol(); + openingBal = getQtyOfOrders(ctx, null, rs.getInt(1), fromDate, + toDate, "opening", warehouse).setScale(uomPrecision, RoundingMode.HALF_UP); + // closingBal=getQtyOfOrders(ctx,null,rs.getInt(1),fromDate,todate,"closing",warehouse); + qtyOfSales = getQtyOfOrders(ctx, UDIOrderTypes.POS_ORDER + .getOrderType(), rs.getInt(1), fromDate, toDate, + "none", warehouse).setScale(uomPrecision, RoundingMode.HALF_UP); + qtyofSalesByCredit = getQtyOfOrders(ctx, + UDIOrderTypes.CREDIT_ORDER.getOrderType(), + rs.getInt(1), fromDate, toDate, "none", warehouse).setScale(uomPrecision, RoundingMode.HALF_UP); + qtyOfReceipts = getQtyOfOrders(ctx, + UDIOrderTypes.POS_GOODS_RECEIVE_NOTE.getOrderType(), rs + .getInt(1), fromDate, toDate, "none", warehouse).setScale(uomPrecision, RoundingMode.HALF_UP); + qtyOfReturn = getQtyOfOrders(ctx, + UDIOrderTypes.POS_GOODS_RETURN_NOTE.getOrderType(), rs + .getInt(1), fromDate, toDate, "none", warehouse).setScale(uomPrecision, RoundingMode.HALF_UP); + qtyOfCustReturn = getQtyOfOrders(ctx, + UDIOrderTypes.CUSTOMER_RETURN_ORDER.getOrderType(), rs + .getInt(1), fromDate, toDate, "none", warehouse).setScale(uomPrecision, RoundingMode.HALF_UP); + qtyInventoryIn = getQtyOfOrders(ctx, null, rs.getInt(1), + fromDate, toDate, "inventortIn", warehouse).setScale(uomPrecision, RoundingMode.HALF_UP); + // qtyInventoryOut + // =getQtyOfOrders(ctx,null,rs.getInt(1),fromDate,todate,"inventoryOut",warehouse); + closingBal = openingBal.subtract( + (qtyOfSales.add(qtyOfReturn).add(qtyofSalesByCredit). + add(qtyOfReceipts).add(qtyOfCustReturn).add(qtyInventoryIn))); + bean = new POSReportBean(); + try + { + bean.setProductName(ProductManager.getProductName(ctx, rs.getInt(1))); + bean.setProductId(rs.getInt(1)); + } + + catch (Exception e) + { + throw new OperationException(e); + } + + bean.setOpeningBalanceQty(openingBal); + bean.setQtyOfGoodsSold(qtyOfSales.add(qtyofSalesByCredit)); + bean.setQtyOfGoodsReceived(qtyOfReceipts); + bean.setQtyOfGoodsReturned(qtyOfReturn); + bean.setCloseingBalanceQty(closingBal); + bean.setQtyInventoryIn(qtyInventoryIn); + // bean.setQtyInventoryOut(Integer.valueOf(qtyInventoryOut)); + bean.setQtyReturnedByCustomer(qtyOfCustReturn); + bean.setUom(uom); + list.add(bean); + } + + rs.close(); + + } + + catch (SQLException e) { + throw new OperationException(e); + } finally { + try { + pstmt.close(); + } catch (Exception e) { + } + + pstmt = null; + } + + return list; + + } + + public static ArrayList getStockMovementReportData( + Properties ctx, Timestamp fromDate, Timestamp todate) + throws OperationException { + + ArrayList list = getStockMovementReport(ctx, fromDate, + todate); + ArrayList reportData = new ArrayList(); + + Object[] headers = new Object[] { "Product Name", "Uom","Opening Balance", + "Inventory In / Out", "Qty Received", "Qty Sold", + "Qty Returned to Supplier", "Qty Returned by Customer", + "Closing Balance" }; + + Object[] data = null; + + reportData.add(headers); + + for (POSReportBean bean : list) { + data = new Object[9]; + + data[0] = bean.getProductName(); + data[1] = bean.getUom(); + data[2] = bean.getOpeningBalanceQty(); + data[3] = bean.getQtyInventoryIn(); + data[4] = bean.getQtyOfGoodsReceived(); + data[5] = bean.getQtyOfGoodsSold(); + data[6] = bean.getQtyOfGoodsReturned(); + data[7] = bean.getQtyReturnedByCustomer(); + data[8] = bean.getCloseingBalanceQty(); + + reportData.add(data); + } + + return reportData; + } + + private static BigDecimal getQtyOfOrders(Properties ctx, String orderType, + int productId, Timestamp fromDate, Timestamp toDate, String queryType, + MWarehouse warehouse) throws OperationException { + + String sql = null; + String whereClause = "ol.AD_CLIENT_ID=" + Env.getAD_Client_ID(ctx) + + " and ol.AD_ORG_ID=" + Env.getAD_Org_ID(ctx); + + // SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy"); + // String date = sdf.format(toDate); + + if (queryType.equalsIgnoreCase("none")) + + sql = "select sum(ol.qtyInvoiced)" + + " from c_orderLine ol,C_ORDER ord" + + " where ol.C_ORDER_ID=ord.C_ORDER_ID and " + whereClause + + " and M_PRODUCT_ID=" + productId + + " and ol.CREATED BETWEEN "+DB.TO_DATE(fromDate, false) + + " and "+DB.TO_DATE(toDate, false) + + " and ord.ORDERTYPE='" + + orderType + "'" + " and ord.DOCSTATUS in ('CO','CL')" + + " and ord.M_WAREHOUSE_ID=" + warehouse.get_ID() + + " and ord.ISACTIVE='Y'"; + + else if (queryType.equalsIgnoreCase("opening")) + + sql = "select sum(MOVEMENTQTY)" + " from M_TRANSACTION_V " + + " where M_PRODUCT_ID=" + productId + " and M_LOCATOR_ID=" + + warehouse.getDefaultLocator().get_ID() + + " and AD_CLIENT_ID=" + Env.getAD_Client_ID(ctx) + + " and AD_ORG_ID=" + Env.getAD_Org_ID(ctx) + + " and created< "+DB.TO_DATE(fromDate, false); + + else if (queryType.equalsIgnoreCase("inventortIn")) + sql = "select sum(MOVEMENTQTY)" + " from M_TRANSACTION_V " + + " where M_PRODUCT_ID=" + productId + " and M_LOCATOR_ID=" + + warehouse.getDefaultLocator().get_ID() + + " and AD_CLIENT_ID=" + Env.getAD_Client_ID(ctx) + + " and AD_ORG_ID=" + Env.getAD_Org_ID(ctx) + + " and created> "+DB.TO_DATE(fromDate, false) + " and MOVEMENTTYPE='" + + MTransaction.MOVEMENTTYPE_InventoryIn + "'"; + + else if (queryType.equalsIgnoreCase("inventoryOut")) + + sql = "select sum(MOVEMENTQTY)" + " from M_TRANSACTION_V " + + " where M_PRODUCT_ID=" + productId + " and M_LOCATOR_ID=" + + warehouse.getDefaultLocator().get_ID() + + " and AD_CLIENT_ID=" + Env.getAD_Client_ID(ctx) + + " and AD_ORG_ID=" + Env.getAD_Org_ID(ctx) + + " and created> "+DB.TO_DATE(fromDate, false) + " and MOVEMENTTYPE='" + + MTransaction.MOVEMENTTYPE_InventoryOut + "'"; + + else if (queryType.equalsIgnoreCase("closing")) + + sql = "select sum(MOVEMENTQTY)" + " from M_TRANSACTION_V " + + " where M_PRODUCT_ID=" + productId + " and M_LOCATOR_ID=" + + warehouse.getDefaultLocator().get_ID() + + " and AD_CLIENT_ID=" + Env.getAD_Client_ID(ctx) + + " and AD_ORG_ID=" + Env.getAD_Org_ID(ctx) + + " and created< "+DB.TO_DATE(toDate, true); + /* + * sql = "select" + " sum(st.QTYONHAND)" + //3 " from M_STORAGE st" + " + * where st.M_PRODUCT_ID=" +productId+ " and + * st.AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+ " and st.AD_ORG_ID=" + * +Env.getAD_Org_ID(ctx)+ " and st.M_LOCATOR_ID=" + * +warehouse.getDefaultLocator().getID()+ " and created getOrderHistory(Properties ctx, + String orderType, String docStatus, Integer month, Integer year, + String paymentRule, String trxName) throws OperationException + { + StringBuffer payAmtSql = new StringBuffer(); + payAmtSql.append(" (SELECT SUM(p.Amount) FROM"); + payAmtSql.append(" ((SELECT payAmt as Amount FROM C_Payment p") + .append(" WHERE p.C_Invoice_ID=i.C_Invoice_ID AND p.DocStatus IN ('CO', 'CL'))"); + payAmtSql.append(" UNION"); + payAmtSql.append(" (SELECT Amount FROM C_CashLine cl") + .append(" WHERE (cl.c_Invoice_ID=i.C_Invoice_ID))) as p)"); + + StringBuffer sqlStmt = new StringBuffer(); + sqlStmt.append(" SELECT o.C_Order_ID, o.DateOrdered, o.DateAcct, o.DocumentNo, o.GrandTotal, o.OrderType, o.PaymentRule, o.DocStatus,"); + sqlStmt.append(" bp.C_BPartner_ID, bp.Name, bp.IsCustomer,"); + sqlStmt.append(" i.C_Invoice_ID, i.DocumentNo, (CASE WHEN i.C_Invoice_ID IS NULL THEN 0 ELSE "); + sqlStmt.append(payAmtSql.toString()).append(" END) as PayAmt"); + sqlStmt.append(" FROM C_Order o"); + sqlStmt.append(" INNER JOIN C_BPartner bp ON bp.C_BPartner_ID=o.C_BPartner_ID"); + sqlStmt.append(" LEFT JOIN C_Invoice i ON (i.C_Order_ID=o.C_Order_ID AND i.DocStatus IN ('CO', 'CL'))"); + + sqlStmt.append(" WHERE o.AD_Client_ID=?"); + sqlStmt.append(" AND o.IsActive='Y'"); + + if (orderType != null) + { + sqlStmt = sqlStmt.append(" AND o.OrderType='").append(orderType).append("'"); + } + + if (paymentRule != null) + { + sqlStmt = sqlStmt.append(" AND o.PaymentRule='").append(paymentRule).append("'"); + } + + if (docStatus != null) + { + sqlStmt = sqlStmt.append(" AND o.DocStatus='").append(docStatus).append("'"); + } + + if (month != null) + { + String mm = String.valueOf(month); + if (mm.length() == 1) + { + mm = "0" + mm; + } + + sqlStmt = sqlStmt.append( " AND TO_CHAR(o.DateOrdered, 'mm')= '").append(mm).append("'"); + } + + if (year != null) + { + sqlStmt = sqlStmt.append(" AND TO_CHAR(o.DateOrdered, 'yyyy') ='").append(year).append("'"); + } + sqlStmt = sqlStmt.append(" ORDER BY o.DateOrdered DESC"); + + + PreparedStatement pstmt = null; + ResultSet rs = null; + ArrayList list = new ArrayList(); + + try + { + pstmt = DB.prepareStatement(sqlStmt.toString(), trxName); + pstmt.setInt(1, Env.getAD_Client_ID(ctx)); + rs = pstmt.executeQuery(); + + while (rs.next()) + { + POSHistoryBean bean = new POSHistoryBean(); + bean.setOrderId(Integer.valueOf(rs.getInt(1))); + bean.setDateOrdered(rs.getTimestamp(2)); + bean.setDateAcct(rs.getTimestamp(3)); + bean.setDocumentNo(rs.getString(4)); + bean.setOrderGrandTotal(rs.getBigDecimal(5)); + bean.setOrderType(rs.getString(6)); + bean.setPaymentRule(rs.getString(7)); + bean.setDocStatus(rs.getString(8)); + bean.setBpartnerId(rs.getInt(9)); + bean.setPartnerName(rs.getString(10)); + bean.setIsCustomer("Y".equals(rs.getString(11)) ? true : false); + bean.setInvoiceDocumentNo(rs.getString(13)); + bean.setAmountPaid(rs.getBigDecimal(14)); + list.add(bean); + } + } + catch (SQLException e) + { + throw new OperationException("Could not retrieve order history with sql: " + sqlStmt.toString(), e); + } + finally + { + DB.close(rs, pstmt); + pstmt = null; + pstmt = null; + } + + return list; + + } + + public static ArrayList getDraftedOrderHistory( + Properties ctx, String orderType, Integer month, Integer year) + throws OperationException { + String sql = "select ord.C_ORDER_ID," + + // "inv.c_invoice_id," + + "ord.created," + "ord.grandtotal," + "ord.DOCUMENTNO," + + "bp.name" + " from c_order ord,C_BPARTNER bp" + + " where ord.C_BPARTNER_ID=bp.C_BPARTNER_ID" + + " and ord.DOCSTATUS = 'DR'" + " and ord.AD_ORG_ID=" + + Env.getAD_Org_ID(ctx) + " and ord.AD_CLIENT_ID=" + + Env.getAD_Client_ID(ctx); + + if (orderType != null) + sql = sql + " and ord.ORDERTYPE='" + orderType + "'"; + + if (month != null) + sql = sql + " and to_char(ord.created, 'mm') = " + month; + + if (year != null) + sql = sql + " and to_char(ord.created, 'yyyy') = " + year; + + sql = sql + " order by ord.created desc"; + + System.out.println(sql); + + PreparedStatement pstmt = DB.prepareStatement(sql, null); + + POSHistoryBean bean = null; + ArrayList list = new ArrayList(); + + try { + ResultSet rs = pstmt.executeQuery(); + + while (rs.next()) { + bean = new POSHistoryBean(); + bean.setOrderId(Integer.valueOf(rs.getInt(1))); + + bean.setDateAcct(rs.getTimestamp(2)); + bean.setOrderGrandTotal(rs.getBigDecimal(3)); + bean.setDocumentNo(rs.getString(4)); + bean.setPartnerName(rs.getString(5)); + + list.add(bean); + + } + + rs.close(); + } catch (SQLException e) { + throw new OperationException(e); + } finally { + try { + pstmt.close(); + } catch (Exception e) { + } + + pstmt = null; + } + return list; + + } + + public static ArrayList getPartialOrderHistory( + Properties ctx, String orderType, Integer month, Integer year) + throws OperationException { + String sql = "select ord.C_ORDER_ID," + + // "inv.c_invoice_id," + + "ord.created," + "ord.grandtotal," + "ord.DOCUMENTNO," + + "bp.name" + " from c_order ord,C_BPARTNER bp" + + " where ord.C_BPARTNER_ID=bp.C_BPARTNER_ID" + + " and ord.DOCSTATUS = 'IP'" + " and ord.AD_ORG_ID=" + + Env.getAD_Org_ID(ctx) + " and ord.AD_CLIENT_ID=" + + Env.getAD_Client_ID(ctx); + + if (orderType != null) + sql = sql + " and ord.ORDERTYPE='" + orderType + "'"; + + if (month != null) + { + String mm = String.valueOf(month); + if (mm.length() == 1) + { + mm = "0" + mm; + } + sql = sql + " and to_char(ord.created, 'mm') = '" + mm + "' " ; + } + + if (year != null) + sql = sql + " and to_char(ord.created, 'yyyy') = " + year; + + sql = sql + " order by ord.created desc"; + + System.out.println(sql); + + PreparedStatement pstmt = DB.prepareStatement(sql, null); + + POSHistoryBean bean = null; + ArrayList list = new ArrayList(); + + try { + ResultSet rs = pstmt.executeQuery(); + + while (rs.next()) { + bean = new POSHistoryBean(); + bean.setOrderId(Integer.valueOf(rs.getInt(1))); + + bean.setDateAcct(rs.getTimestamp(2)); + bean.setOrderGrandTotal(rs.getBigDecimal(3)); + bean.setDocumentNo(rs.getString(4)); + bean.setPartnerName(rs.getString(5)); + + list.add(bean); + + } + + rs.close(); + } catch (SQLException e) { + throw new OperationException(e); + } finally { + try { + pstmt.close(); + } catch (Exception e) { + } + + pstmt = null; + } + return list; + + } + + public static ArrayList getAllOrderTypes(Properties ctx) + throws OperationException { + String sql = "select distinct orderType from c_order where AD_CLIENT_ID=" + + Env.getAD_Client_ID(ctx) + + " and AD_ORG_ID=" + + Env.getAD_Org_ID(ctx) + + " and isActive='Y' and ORDERTYPE is not null"; + + PreparedStatement pstmt = DB.prepareStatement(sql, null); + + POSHistoryBean bean = null; + ArrayList list = new ArrayList(); + + try { + ResultSet rs = pstmt.executeQuery(); + + while (rs.next()) { + bean = new POSHistoryBean(); + bean.setOrderType(rs.getString(1)); + + list.add(bean); + + } + + rs.close(); + } catch (SQLException e) { + throw new OperationException(e); + } finally { + try { + pstmt.close(); + } catch (Exception e) { + } + + pstmt = null; + } + + return list; + + } + + public static ArrayList getAllPaymentRule(Properties ctx) + throws OperationException { + String sql = "select distinct paymentRule from c_order where AD_CLIENT_ID=" + + Env.getAD_Client_ID(ctx) + + " and AD_ORG_ID=" + + Env.getAD_Org_ID(ctx) + " and isActive='Y'"; + + PreparedStatement pstmt = DB.prepareStatement(sql, null); + + POSHistoryBean bean = null; + ArrayList list = new ArrayList(); + + try { + ResultSet rs = pstmt.executeQuery(); + + while (rs.next()) { + bean = new POSHistoryBean(); + bean.setPaymentRule(rs.getString(1)); + + list.add(bean); + + } + + rs.close(); + } catch (SQLException e) { + throw new OperationException(e); + } finally { + try { + pstmt.close(); + } catch (Exception e) { + } + + pstmt = null; + } + + return list; + + } + + public static ArrayList getMaxMinSoldProductReportData( + Properties ctx, String reportType, Timestamp fromDate, Timestamp todate) + throws OperationException { + ArrayList list = getMaxMinSoldProducts(ctx, reportType, + fromDate, todate); + ArrayList reportData = new ArrayList(); + + reportData.add(new Object[] { "Name", "Uom","Barcode", " Net Qty Sold" }); + + String name = null; + String barcode = null; + BigDecimal qty = null; + String uom = null; + for (ProductBean bean : list) { + name = bean.getProductName(); + name = name.replaceAll("~", " "); + qty = bean.getQuantity(); + barcode = bean.getBarCode(); + uom = bean.getUom(); + reportData.add(new Object[] { name, uom, barcode, qty }); + } + + return reportData; + } + + public static String getCompleteOrderPDFReport(Properties ctx, int orderId, + String trxName) throws OperationException { + String docStatus = null; + String dateOrdered = null; + String orderType = null; + String orgName = null; + String orgAddress = null; + String salesRep = null; + String paymentBy = null; + String customerName = null; + String customerAddress = null; + String documentNo = null; + String currency = "Rs "; + NumberFormat formatter = new DecimalFormat("###,###,##0.00"); + + currency = POSTerminalManager.getDefaultSalesCurrency(ctx) + .getCurSymbol() + + " "; + MOrder order = new MOrder(ctx, orderId, trxName); + + // getting payment info + int[] invoiceIds = MInvoice.getAllIDs(MInvoice.Table_Name, + "AD_CLIENT_ID=" + Env.getAD_Client_ID(ctx) + " and C_ORDER_ID=" + + order.get_ID(), null); + double paymentByCash = 0.0; + double paymentByCard = 0.0; + double paymentByCheque = 0.0; + + MInvoice invoice = null; + String paymentRule = null; + boolean isMixed = false; + + for (int i = 0; i < invoiceIds.length; i++) { + invoice = new MInvoice(ctx, invoiceIds[i], trxName); + + if (i == 0) { + paymentRule = invoice.getPaymentRule(); + } else { + if (!paymentRule.equalsIgnoreCase(invoice.getPaymentRule())) { + isMixed = true; + } + } + + if (invoice.getPaymentRule().equals(MOrder.PAYMENTRULE_Cash)) { + paymentByCash += invoice.getGrandTotal().doubleValue(); + paymentBy = Constants.PAYMENT_RULE_CASH; + } + + if (invoice.getPaymentRule().equals(MOrder.PAYMENTRULE_CreditCard)) { + paymentByCard += invoice.getGrandTotal().doubleValue(); + paymentBy = Constants.PAYMENT_RULE_CARD; + } + + if (invoice.getPaymentRule().equals(MOrder.PAYMENTRULE_DirectDebit)) { + paymentByCard += invoice.getGrandTotal().doubleValue(); + paymentBy = Constants.PAYMENT_RULE_CARD; + } + + if (invoice.getPaymentRule().equals(MOrder.PAYMENTRULE_Check)) { + paymentByCheque += invoice.getGrandTotal().doubleValue(); + paymentBy = Constants.PAYMENT_RULE_CHEQUE; + } + + }// for + + if (isMixed) { + paymentBy = "Mixed (Cash:" + formatter.format(paymentByCash) + + " Card:" + formatter.format(paymentByCard) + " Cheque:" + + formatter.format(paymentByCheque) + ")"; + } + + // getting orgInfo + MOrg org = new MOrg(ctx, order.getAD_Org_ID(), trxName); + int location_id = org.getInfo().getC_Location_ID(); + MLocation location = new MLocation(ctx, location_id, trxName); + + orgName = org.getName(); + + String address1 = (location.getAddress1() == null) ? " " : location + .getAddress1(); + String address2 = (location.getAddress2() == null) ? " " : location + .getAddress2(); + orgAddress = (address1 + " " + address2).trim(); + + // getting order type + orderType = order.getOrderType(); + + // getting orderInfo + docStatus = order.getDocStatusName(); + documentNo = order.getDocumentNo(); + + Date d = new Date(order.getCreated().getTime()); + SimpleDateFormat s = new SimpleDateFormat(TimestampConvertor.DEFAULT_DATE_PATTERN1); + dateOrdered = s.format(d); + + // getting salesrep + int saleRep_id = order.getSalesRep_ID(); + MUser user = new MUser(ctx, saleRep_id, trxName); + salesRep = user.getName(); + + // getting customer info + int bpartner_id = order.getBill_BPartner_ID(); + BPartnerBean bean = BPartnerManager.getBpartner(ctx, bpartner_id, + trxName); + + String name1 = (bean.getPartnerName() == null) ? " " : bean + .getPartnerName(); + String name2 = (bean.getName2() == null) ? " " : bean.getName2(); + customerName = (name1 + " " + name2).trim(); + + address1 = (bean.getAddress1() == null) ? " " : bean.getAddress1(); + address2 = (bean.getAddress2() == null) ? " " : bean.getAddress2(); + customerAddress = (address1 + " " + address2).trim(); + + ArrayList orderLineList = POSManager + .populateOrderLines(ctx, order); + + // ----------------------------------- generating pdf + // -------------------------------------- + String reportName = RandomStringGenerator.randomstring() + ".pdf"; + String reportPath = ReportManager.getReportPath(reportName); + + Font titleFont = new Font(Font.TIMES_ROMAN, 18, Font.BOLD); + Font subtitleFont = new Font(Font.TIMES_ROMAN, 14, Font.BOLD); + + Font headerFont = new Font(Font.TIMES_ROMAN, 11, Font.BOLD); + Font simpleFont = new Font(Font.TIMES_ROMAN, 10); + + float cellBorderWidth = 0.0f; + + // step 1: creation of a document-object + Document document = new Document(PageSize.A4, 30, 30, 20, 40);// l,r,t,b + // document.getPageSize().set; + + System.out.println(document.leftMargin()); + + try { + // step 2: + // we create a writer that listens to the document + // and directs a PDF-stream to a file + PdfWriter.getInstance(document, new FileOutputStream(reportPath)); + + // step 3: we open the document + document.open(); + // step 4: we add a paragraph to the document + + Image logo = null; + + String imageURI = PathInfo.PROJECT_HOME + "images/logo.gif"; + // "images/pos/openBLUE_POS_Logo.gif"; + + try { + byte logoData[] = OrganisationManager.getLogo(ctx, null); + logo = Image.getInstance(logoData); + } catch (LogoException ex) { + logo = Image.getInstance(imageURI); + } + + logo.setAbsolutePosition(document.left(), document.top() + - logo.height()); + document.add(logo); + + PdfPTable table = new PdfPTable(2); + PdfPCell cell = null; + + // + table.getDefaultCell().setPadding(5.0f); + table.setWidthPercentage(100.0f); + + // header cell + Paragraph title = new Paragraph(); + title.add(new Chunk(orgName, subtitleFont)); + title.add(new Chunk("\n")); + title.add(new Chunk(orgAddress, subtitleFont)); + + // cell = new PdfPCell(new Paragraph(new + // Chunk("Title1",titleFont))); + cell = new PdfPCell(title); + + cell.setColspan(2); + cell.setHorizontalAlignment(PdfPCell.ALIGN_RIGHT); + cell.setVerticalAlignment(PdfPCell.ALIGN_MIDDLE); + cell.setFixedHeight(logo.height()); + cell.setBorderWidth(cellBorderWidth); + table.addCell(cell); + + cell = new PdfPCell(new Paragraph("")); + cell.setBorderWidth(cellBorderWidth); + cell.setFixedHeight(10); + cell.setColspan(2); + table.addCell(cell); + + // doc type + cell = new PdfPCell(new Paragraph(new Chunk(orderType, titleFont))); + + cell.setColspan(2); + cell.setHorizontalAlignment(PdfPCell.ALIGN_CENTER); + cell.setVerticalAlignment(PdfPCell.ALIGN_MIDDLE); + cell.setBorderWidth(cellBorderWidth); + table.addCell(cell); + + // spacing + cell = new PdfPCell(new Paragraph("")); + cell.setBorderWidth(cellBorderWidth); + cell.setFixedHeight(10); + cell.setColspan(2); + table.addCell(cell); + + // row 1 + cell = new PdfPCell(new Paragraph(new Chunk(customerName, + headerFont))); + cell.setHorizontalAlignment(PdfPCell.ALIGN_LEFT); + cell.setBorderWidth(cellBorderWidth); + table.addCell(cell); + + cell = new PdfPCell(new Paragraph(new Chunk("Sales Rep: " + + salesRep, headerFont))); + cell.setHorizontalAlignment(PdfPCell.ALIGN_RIGHT); + cell.setBorderWidth(cellBorderWidth); + table.addCell(cell); + + // row 2 + cell = new PdfPCell(new Paragraph(new Chunk(customerAddress, + headerFont))); + cell.setHorizontalAlignment(PdfPCell.ALIGN_LEFT); + cell.setBorderWidth(cellBorderWidth); + table.addCell(cell); + + // spacing + cell = new PdfPCell(new Paragraph("")); + cell.setBorderWidth(cellBorderWidth); + cell.setFixedHeight(10); + cell.setColspan(2); + table.addCell(cell); + + // row 3 + cell = new PdfPCell(new Paragraph(new Chunk( + "Ref No: " + documentNo, headerFont))); + cell.setColspan(2); + cell.setHorizontalAlignment(PdfPCell.ALIGN_LEFT); + cell.setBorderWidth(cellBorderWidth); + table.addCell(cell); + + // row 4 + cell = new PdfPCell(new Paragraph(new Chunk("Doc Status: " + + docStatus, headerFont))); + cell.setColspan(2); + cell.setHorizontalAlignment(PdfPCell.ALIGN_LEFT); + cell.setBorderWidth(cellBorderWidth); + table.addCell(cell); + + // row 5 + cell = new PdfPCell(new Paragraph(new Chunk("Payment By: " + + paymentBy, headerFont))); + cell.setColspan(2); + cell.setHorizontalAlignment(PdfPCell.ALIGN_LEFT); + cell.setBorderWidth(cellBorderWidth); + table.addCell(cell); + + // row 6 + cell = new PdfPCell(new Paragraph(new Chunk("Date: " + dateOrdered, + headerFont))); + cell.setColspan(2); + cell.setHorizontalAlignment(PdfPCell.ALIGN_LEFT); + cell.setBorderWidth(cellBorderWidth); + table.addCell(cell); + + // spacing + cell = new PdfPCell(new Paragraph("")); + cell.setColspan(2); + cell.setFixedHeight(10); + cell.setBorderWidth(cellBorderWidth); + table.addCell(cell); + + // spacing + cell = new PdfPCell(new Paragraph("")); + cell.setColspan(2); + cell.setFixedHeight(10); + cell.setBorderWidth(cellBorderWidth); + table.addCell(cell); + + // ------------------------------------------------------ + cell = new PdfPCell(); + cell.setColspan(2); + cell.setBorderWidth(cellBorderWidth); + + PdfPTable t = new PdfPTable(6); + t.getDefaultCell().setPadding(3.0f); + t.setWidthPercentage(100.0f); + + int[] widths = { 1, 4, 1, 2, 2, 2 }; + t.setWidths(widths); + + // setting headers + t.addCell(new Paragraph(new Chunk("SerNo", headerFont))); + t.addCell(new Paragraph(new Chunk("Name", headerFont))); + t.addCell(new Paragraph(new Chunk("Qty", headerFont))); + t.addCell(new Paragraph(new Chunk("Price", headerFont))); + t.addCell(new Paragraph(new Chunk("VAT", headerFont))); + t.addCell(new Paragraph(new Chunk("Total", headerFont))); + + // setting table data + // --------------------------------writing table + // data------------------------------ + int serNo = 0; + int totalQty = 0; + double totalAmt = 0.0; + double totalTaxAmt = 0.0; + double grandTotal = 0.0; + + BigDecimal qty = null; + BigDecimal lineAmt = null; + BigDecimal taxAmt = null; + BigDecimal lineTotalAmt = null; + + for (WebOrderLineBean orderlineBean : orderLineList) { + serNo++; + qty = orderlineBean.getQtyOrdered(); + lineAmt = orderlineBean.getLineNetAmt(); + taxAmt = orderlineBean.getTaxAmt(); + lineTotalAmt = orderlineBean.getLineTotalAmt(); + + totalQty += qty.intValue(); + totalAmt += lineAmt.doubleValue(); + totalTaxAmt += taxAmt.doubleValue(); + grandTotal += lineTotalAmt.doubleValue(); + + t.addCell(new Paragraph(new Chunk(serNo + "", simpleFont))); + t.addCell(new Paragraph(new Chunk(orderlineBean + .getProductName(), simpleFont))); + t.addCell(new Paragraph(new Chunk(qty.intValue() + "", + simpleFont))); + t.addCell(new Paragraph(new Chunk(formatter.format(lineAmt + .doubleValue()), simpleFont))); + t.addCell(new Paragraph(new Chunk(formatter.format(taxAmt + .doubleValue()), simpleFont))); + t.addCell(new Paragraph(new Chunk(formatter.format(lineTotalAmt + .doubleValue()), simpleFont))); + } + // ----------------------------------------------------------------------------------- + + // setting table footer + t.getDefaultCell().setBackgroundColor(new Color(240, 240, 240)); + + PdfPCell c = new PdfPCell(new Paragraph(new Chunk("ORDER TOTAL", + headerFont))); + c.setColspan(2); + c.setBackgroundColor(new Color(240, 240, 240)); + t.addCell(c); + + t.addCell(new Paragraph(new Chunk(totalQty + "", simpleFont))); + t.addCell(new Paragraph(new Chunk(currency + + formatter.format(totalAmt), simpleFont))); + t.addCell(new Paragraph(new Chunk(currency + + formatter.format(totalTaxAmt), simpleFont))); + t.addCell(new Paragraph(new Chunk(currency + + formatter.format(grandTotal), simpleFont))); + + t.setSplitRows(true); + cell.addElement(t); + // ------------------------------------------------------ + + // table.addCell(cell); + table.setSplitRows(true); + + document.add(table); + document.add(t); + + } catch (Exception e) { + throw new OperationException(e); + } + + // step 5: we close the document + document.close(); + + return reportName; + } + + /* + * public static String getInvoiceFromOrderPDFReport(Properties ctx, int + * orderId, String trxName) throws OperationException { int invoiceIds[] = + * InvoiceManager.getInvoiceIdsForOrder(ctx, orderId, trxName); + * + * if(invoiceIds.length == 0) throw new OperationException("No invoice found + * for Order with id: " + orderId); else if(invoiceIds.length == 1) return + * getInvoicePDFReport(ctx, invoiceIds[0], trxName); else return + * getCompleteOrderPDFReport(ctx, orderId, trxName); } + */ + + /* + * public static String getInvoicePDFReport(Properties ctx, int invoiceId, + * String trxName) throws OperationException { String docStatus = null; + * String dateOrdered = null; String docType = null; String orgName = null; + * String orgAddress = null; String salesRep = null; String phone = " "; + * String fax = " "; + * + * String customerName = null; String customerAddress = null; String + * documentNo = null; String currency = "Rs "; NumberFormat formatter = new + * DecimalFormat("###,###,##0.00"); + * + * currency = + * POSTerminalManager.getPOSDefaultSellCurrency(ctx).getCurSymbol()+ " "; + * + * MInvoice invoice = InvoiceManager.loadInvoice(ctx, invoiceId, trxName); + * + * //getting orgInfo MOrg org = new + * MOrg(ctx,invoice.getAD_Org_ID(),trxName); int location_id = + * org.getInfo().getC_Location_ID(); MLocation location = new + * MLocation(ctx,location_id,trxName); MBPartner orgPartner = new + * MBPartner(ctx, org.getLinkedC_BPartner_ID(), trxName); MBPartnerLocation + * meLocation[] = MBPartnerLocation.getForBPartner(ctx,orgPartner.getID()); + * + * if (meLocation.length != 1) throw new OperationException("Should have + * only 1 location for organisation business partner!!"); + * + * MBPartnerLocation orgLocation = meLocation[0]; + * + * if (orgLocation.getPhone() != null); phone = orgLocation.getPhone(); + * + * if (orgLocation.getFax() != null) fax = orgLocation.getFax();; + * + * orgName = org.getName(); + * + * String address1 = (location.getAddress1() == null)? " " : + * location.getAddress1(); String address2 = (location.getAddress2() == + * null)? " " : location.getAddress2(); orgAddress = (address1 + " " + + * address2).trim(); + * + * //getting order type MDocType doctype = MDocType.get(ctx, + * invoice.getC_DocType_ID()); docType = doctype.getName(); + * + * //getting orderInfo docStatus = invoice.getDocStatusName(); documentNo = + * invoice.getDocumentNo(); + * + * Date d = new Date(invoice.getCreated().getTime()); SimpleDateFormat s = + * new SimpleDateFormat("dd-MMM-yyyy HH:mm:ss"); dateOrdered = s.format(d); + * + * //getting salesrep int saleRep_id = invoice.getSalesRep_ID(); MUser user = + * new MUser(ctx,saleRep_id,trxName); salesRep = user.getName(); + * + * //getting customer info int bpartner_id = invoice.getC_BPartner_ID(); + * BPartnerBean bean = BPartnerManager.getBpartner(ctx,bpartner_id, + * trxName); + * + * String name1 = (bean.getPartnerName() == null)? " " : + * bean.getPartnerName(); String name2 = (bean.getName2() == null)? " " : + * bean.getName2(); customerName = (name1 + " " + name2).trim(); + * + * address1 = (bean.getAddress1() == null)? " " : bean.getAddress1(); + * address2 = (bean.getAddress2() == null)? " " : bean.getAddress2(); + * customerAddress = (address1 + " " + address2).trim(); + * + * + * ArrayList orderLineList = + * InvoiceManager.populateInvoiceLines(ctx,invoice, false); + * + * //----------------------------------- generating pdf + * -------------------------------------- String reportName = + * RandomStringGenerator.randomstring() + ".pdf"; String reportPath = + * ReportManager.getReportPath(reportName); + * + * + * Font titleFont = new Font(Font.TIMES_ROMAN, 18,Font.BOLD); Font + * subtitleFont = new Font(Font.TIMES_ROMAN, 14,Font.BOLD); + * + * Font headerFont = new Font(Font.TIMES_ROMAN, 11,Font.BOLD); Font + * simpleFont = new Font(Font.TIMES_ROMAN, 10); + * + * float cellBorderWidth = 0.0f; + * // step 1: creation of a document-object Document document = new + * Document(PageSize.A4,30,30,20,40);//l,r,t,b //document.getPageSize().set; + * + * System.out.println(document.leftMargin()); + * + * try { // step 2: // we create a writer that listens to the document // + * and directs a PDF-stream to a file PdfWriter.getInstance(document,new + * FileOutputStream(reportPath)); + * // step 3: we open the document document.open(); // step 4: we add a + * paragraph to the document + * + * Image logo = null; + * + * //TODO: make this part dynamic <------------------------------ IMPORTANT + * !!!!!!!!!!!!!!!!!!!!!!!!!!! String imageURI = PathInfo.PROJECT_HOME + + * "images/pos/openBLUE_POS_Logo.gif"; logo = Image.getInstance(imageURI); + * + * //MAttachment attachment = new + * MAttachment(ctx,MOrg.Table_ID,org.getID(),null); //logo = + * Image.getInstance(attachment.getEntries()[0].getData()); + * + * try { byte logoData[] = OrganisationManager.getLogo(ctx, null); logo = + * Image.getInstance(logoData); } catch(LogoException ex) { logo = + * Image.getInstance(imageURI); } + * + * logo.setAbsolutePosition(document.left(),document.top()-logo.height()); + * document.add(logo); + * + * PdfPTable table = new PdfPTable(2); PdfPCell cell = null; + * // table.getDefaultCell().setPadding(5.0f); + * table.setWidthPercentage(100.0f); + * + * //header cell Paragraph title = new Paragraph(); title.add(new + * Chunk(orgName,subtitleFont)); title.add(new Chunk("\n")); title.add(new + * Chunk(orgAddress,subtitleFont)); title.add(new Chunk("\n")); + * title.add(new Chunk("Phone: " + phone,subtitleFont)); title.add(new + * Chunk("\n")); title.add(new Chunk("Fax: " + fax,subtitleFont)); + * + * + * //cell = new PdfPCell(new Paragraph(new Chunk("Title1",titleFont))); cell = + * new PdfPCell(title); + * + * cell.setColspan(2); cell.setHorizontalAlignment(PdfPCell.ALIGN_RIGHT); + * cell.setVerticalAlignment(PdfPCell.ALIGN_MIDDLE); + * cell.setFixedHeight(logo.height()); cell.setBorderWidth(cellBorderWidth); + * table.addCell(cell); + * + * cell = new PdfPCell(new Paragraph("")); + * cell.setBorderWidth(cellBorderWidth); cell.setFixedHeight(10); + * cell.setColspan(2); table.addCell(cell); + * + * //doc type cell = new PdfPCell(new Paragraph(new + * Chunk(docType,titleFont))); + * + * cell.setColspan(2); cell.setHorizontalAlignment(PdfPCell.ALIGN_CENTER); + * cell.setVerticalAlignment(PdfPCell.ALIGN_MIDDLE); + * cell.setBorderWidth(cellBorderWidth); table.addCell(cell); + * + * //spacing cell = new PdfPCell(new Paragraph("")); + * cell.setBorderWidth(cellBorderWidth); cell.setFixedHeight(10); + * cell.setColspan(2); table.addCell(cell); + * + * + * //row 1 cell = new PdfPCell(new Paragraph(new + * Chunk(customerName,headerFont))); + * cell.setHorizontalAlignment(PdfPCell.ALIGN_LEFT); + * cell.setBorderWidth(cellBorderWidth); table.addCell(cell); + * + * + * cell = new PdfPCell(new Paragraph(new Chunk("Sales Rep: + * "+salesRep,headerFont))); + * cell.setHorizontalAlignment(PdfPCell.ALIGN_RIGHT); + * cell.setBorderWidth(cellBorderWidth); table.addCell(cell); + * + * //row 2 cell = new PdfPCell(new Paragraph(new + * Chunk(customerAddress,headerFont))); + * cell.setHorizontalAlignment(PdfPCell.ALIGN_LEFT); + * cell.setBorderWidth(cellBorderWidth); table.addCell(cell); + * + * //spacing cell = new PdfPCell(new Paragraph("")); + * cell.setBorderWidth(cellBorderWidth); cell.setFixedHeight(10); + * cell.setColspan(2); table.addCell(cell); + * + * //row 3 cell = new PdfPCell(new Paragraph(new Chunk("No: " + documentNo, + * headerFont))); cell.setColspan(2); + * cell.setHorizontalAlignment(PdfPCell.ALIGN_LEFT); + * cell.setBorderWidth(cellBorderWidth); table.addCell(cell); + * + * //row 4 cell = new PdfPCell(new Paragraph(new Chunk("Doc Status: + * "+docStatus,headerFont))); cell.setColspan(2); + * cell.setHorizontalAlignment(PdfPCell.ALIGN_LEFT); + * cell.setBorderWidth(cellBorderWidth); table.addCell(cell); + * + * + * //row 5 cell = new PdfPCell(new Paragraph(new Chunk("Payment By: + * "+paymentBy,headerFont))); cell.setColspan(2); + * cell.setHorizontalAlignment(PdfPCell.ALIGN_LEFT); + * cell.setBorderWidth(cellBorderWidth); table.addCell(cell); + * + * + * //row 6 cell = new PdfPCell(new Paragraph(new Chunk("Date: + * "+dateOrdered,headerFont))); cell.setColspan(2); + * cell.setHorizontalAlignment(PdfPCell.ALIGN_LEFT); + * cell.setBorderWidth(cellBorderWidth); table.addCell(cell); + * + * //spacing cell = new PdfPCell(new Paragraph("")); cell.setColspan(2); + * cell.setFixedHeight(10); cell.setBorderWidth(cellBorderWidth); + * table.addCell(cell); + * + * //spacing cell = new PdfPCell(new Paragraph("")); cell.setColspan(2); + * cell.setFixedHeight(10); cell.setBorderWidth(cellBorderWidth); + * table.addCell(cell); + * + * + * //------------------------------------------------------ cell = new + * PdfPCell(); cell.setColspan(2); cell.setBorderWidth(cellBorderWidth); + * + * PdfPTable t = new PdfPTable(6); t.getDefaultCell().setPadding(3.0f); + * t.setWidthPercentage(100.0f); + * + * int[] widths = {1,4,1,2,2,2}; t.setWidths(widths); + * + * //setting headers t.addCell(new Paragraph(new + * Chunk("SerNo",headerFont))); t.addCell(new Paragraph(new + * Chunk("Name",headerFont))); t.addCell(new Paragraph(new + * Chunk("Qty",headerFont))); t.addCell(new Paragraph(new + * Chunk("Price",headerFont))); t.addCell(new Paragraph(new + * Chunk("VAT",headerFont))); t.addCell(new Paragraph(new + * Chunk("Total",headerFont))); + * + * //setting table data //--------------------------------writing table + * data------------------------------ int serNo = 0; int totalQty = 0; + * double totalAmt = 0.0; double totalTaxAmt = 0.0; double grandTotal = 0.0; + * + * BigDecimal qty = null; BigDecimal lineAmt = null; BigDecimal taxAmt = + * null; BigDecimal lineTotalAmt = null; + * + * for (WebOrderLineBean orderlineBean : orderLineList) { serNo++; qty = + * orderlineBean.getQtyOrdered(); lineAmt = orderlineBean.getLineNetAmt(); + * taxAmt = orderlineBean.getTaxAmt(); lineTotalAmt = + * orderlineBean.getLineTotalAmt(); + * + * totalQty += qty.intValue(); totalAmt += lineAmt.doubleValue(); + * totalTaxAmt += taxAmt.doubleValue(); grandTotal += + * lineTotalAmt.doubleValue(); + * + * t.addCell(new Paragraph(new Chunk(serNo+"",simpleFont))); t.addCell(new + * Paragraph(new Chunk(orderlineBean.getProductName(),simpleFont))); + * t.addCell(new Paragraph(new Chunk(qty.intValue()+"",simpleFont))); + * t.addCell(new Paragraph(new + * Chunk(formatter.format(lineAmt.doubleValue()),simpleFont))); + * t.addCell(new Paragraph(new + * Chunk(formatter.format(taxAmt.doubleValue()),simpleFont))); t.addCell(new + * Paragraph(new + * Chunk(formatter.format(lineTotalAmt.doubleValue()),simpleFont))); } + * //----------------------------------------------------------------------------------- + * + * //setting table footer t.getDefaultCell().setBackgroundColor(new + * Color(240,240,240)); + * + * PdfPCell c = new PdfPCell(new Paragraph(new Chunk("ORDER + * TOTAL",headerFont))); c.setColspan(2); c.setBackgroundColor(new + * Color(240,240,240)); t.addCell(c); + * + * t.addCell(new Paragraph(new Chunk(totalQty + "",simpleFont))); + * t.addCell(new Paragraph(new Chunk(currency + + * formatter.format(totalAmt),simpleFont))); t.addCell(new Paragraph(new + * Chunk(currency + formatter.format(totalTaxAmt),simpleFont))); + * t.addCell(new Paragraph(new Chunk(currency + + * formatter.format(grandTotal),simpleFont))); + * + * t.setSplitRows(true); cell.addElement(t); + * //------------------------------------------------------ + * + * //table.addCell(cell); table.setSplitRows(true); + * + * + * document.add(table); document.add(t); + * } catch (Exception e) { throw new OperationException(e); } + * // step 5: we close the document document.close(); + * + * + * return reportName; } + */ + + /* + * public static String getPaymentPDFReport(Properties ctx, int paymentId, + * String trxName) throws OperationException { String docStatus = null; + * String dateOrdered = null; String docType = null; String orgName = null; + * String orgAddress = null; String salesRep = null; String phone = " "; + * String fax = " "; + * + * String customerName = null; String customerAddress = null; String + * documentNo = null; String currency = "Rs "; NumberFormat formatter = new + * DecimalFormat("###,###,##0.00"); + * + * currency = + * POSTerminalManager.getPOSDefaultSellCurrency(ctx).getCurSymbol()+ " "; + * + * MPayment payment = PaymentManager.loadPayment(ctx, paymentId, trxName); + * + * //getting orgInfo MOrg org = new + * MOrg(ctx,payment.getAD_Org_ID(),trxName); int location_id = + * org.getInfo().getC_Location_ID(); MLocation location = new + * MLocation(ctx,location_id,trxName); MBPartner orgPartner = new + * MBPartner(ctx, org.getLinkedC_BPartner_ID(), trxName); MBPartnerLocation + * meLocation[] = MBPartnerLocation.getForBPartner(ctx,orgPartner.getID()); + * + * if (meLocation.length != 1) throw new OperationException("Should have + * only 1 location for organisation business partner!!"); + * + * MBPartnerLocation orgLocation = meLocation[0]; + * + * if (orgLocation.getPhone() != null); phone = orgLocation.getPhone(); + * + * if (orgLocation.getFax() != null) fax = orgLocation.getFax();; + * + * orgName = org.getName(); + * + * String address1 = (location.getAddress1() == null)? " " : + * location.getAddress1(); String address2 = (location.getAddress2() == + * null)? " " : location.getAddress2(); orgAddress = (address1 + " " + + * address2).trim(); + * + * //getting order type MDocType doctype = MDocType.get(ctx, + * payment.getC_DocType_ID()); docType = doctype.getName(); + * + * //getting orderInfo docStatus = payment.getDocStatusName(); documentNo = + * payment.getDocumentNo(); + * + * Date d = new Date(payment.getCreated().getTime()); SimpleDateFormat s = + * new SimpleDateFormat("dd-MMM-yyyy HH:mm:ss"); dateOrdered = s.format(d); + * + * //getting salesrep int saleRep_id = payment.getDoc_User_ID(); MUser user = + * new MUser(ctx,saleRep_id,trxName); salesRep = user.getName(); + * + * //getting customer info int bpartner_id = payment.getC_BPartner_ID(); + * BPartnerBean bean = BPartnerManager.getBpartner(ctx,bpartner_id, + * trxName); + * + * String name1 = (bean.getPartnerName() == null)? " " : + * bean.getPartnerName(); String name2 = (bean.getName2() == null)? " " : + * bean.getName2(); customerName = (name1 + " " + name2).trim(); + * + * address1 = (bean.getAddress1() == null)? " " : bean.getAddress1(); + * address2 = (bean.getAddress2() == null)? " " : bean.getAddress2(); + * customerAddress = (address1 + " " + address2).trim(); + * + * + * ArrayList orderLineList = + * PaymentManager.getWebPaymentBean(ctx,payment); + * + * //----------------------------------- generating pdf + * -------------------------------------- String reportName = + * RandomStringGenerator.randomstring() + ".pdf"; String reportPath = + * ReportManager.getReportPath(reportName); + * + * + * Font titleFont = new Font(Font.TIMES_ROMAN, 18,Font.BOLD); Font + * subtitleFont = new Font(Font.TIMES_ROMAN, 14,Font.BOLD); + * + * Font headerFont = new Font(Font.TIMES_ROMAN, 11,Font.BOLD); Font + * simpleFont = new Font(Font.TIMES_ROMAN, 10); + * + * float cellBorderWidth = 0.0f; + * // step 1: creation of a document-object Document document = new + * Document(PageSize.A4,30,30,20,40);//l,r,t,b //document.getPageSize().set; + * + * System.out.println(document.leftMargin()); + * + * try { // step 2: // we create a writer that listens to the document // + * and directs a PDF-stream to a file PdfWriter.getInstance(document,new + * FileOutputStream(reportPath)); + * // step 3: we open the document document.open(); // step 4: we add a + * paragraph to the document + * + * Image logo = null; + * + * //TODO: make this part dynamic <------------------------------ IMPORTANT + * !!!!!!!!!!!!!!!!!!!!!!!!!!! String imageURI = PathInfo.PROJECT_HOME + + * "images/pos/openBLUE_POS_Logo.gif"; logo = Image.getInstance(imageURI); + * + * //MAttachment attachment = new + * MAttachment(ctx,MOrg.Table_ID,org.getID(),null); //logo = + * Image.getInstance(attachment.getEntries()[0].getData()); + * + * try { byte logoData[] = OrganisationManager.getLogo(ctx, null); logo = + * Image.getInstance(logoData); } catch(LogoException ex) { logo = + * Image.getInstance(imageURI); } + * + * logo.setAbsolutePosition(document.left(),document.top()-logo.height()); + * document.add(logo); + * + * PdfPTable table = new PdfPTable(2); PdfPCell cell = null; + * // table.getDefaultCell().setPadding(5.0f); + * table.setWidthPercentage(100.0f); + * + * //header cell Paragraph title = new Paragraph(); title.add(new + * Chunk(orgName,subtitleFont)); title.add(new Chunk("\n")); title.add(new + * Chunk(orgAddress,subtitleFont)); title.add(new Chunk("\n")); + * title.add(new Chunk("Phone: " + phone,subtitleFont)); title.add(new + * Chunk("\n")); title.add(new Chunk("Fax: " + fax,subtitleFont)); + * + * + * //cell = new PdfPCell(new Paragraph(new Chunk("Title1",titleFont))); cell = + * new PdfPCell(title); + * + * cell.setColspan(2); cell.setHorizontalAlignment(PdfPCell.ALIGN_RIGHT); + * cell.setVerticalAlignment(PdfPCell.ALIGN_MIDDLE); + * cell.setFixedHeight(logo.height()); cell.setBorderWidth(cellBorderWidth); + * table.addCell(cell); + * + * cell = new PdfPCell(new Paragraph("")); + * cell.setBorderWidth(cellBorderWidth); cell.setFixedHeight(10); + * cell.setColspan(2); table.addCell(cell); + * + * //doc type cell = new PdfPCell(new Paragraph(new + * Chunk(docType,titleFont))); + * + * cell.setColspan(2); cell.setHorizontalAlignment(PdfPCell.ALIGN_CENTER); + * cell.setVerticalAlignment(PdfPCell.ALIGN_MIDDLE); + * cell.setBorderWidth(cellBorderWidth); table.addCell(cell); + * + * //spacing cell = new PdfPCell(new Paragraph("")); + * cell.setBorderWidth(cellBorderWidth); cell.setFixedHeight(10); + * cell.setColspan(2); table.addCell(cell); + * + * + * //row 1 cell = new PdfPCell(new Paragraph(new + * Chunk(customerName,headerFont))); + * cell.setHorizontalAlignment(PdfPCell.ALIGN_LEFT); + * cell.setBorderWidth(cellBorderWidth); table.addCell(cell); + * + * + * cell = new PdfPCell(new Paragraph(new Chunk("Sales Rep: + * "+salesRep,headerFont))); + * cell.setHorizontalAlignment(PdfPCell.ALIGN_RIGHT); + * cell.setBorderWidth(cellBorderWidth); table.addCell(cell); + * + * //row 2 cell = new PdfPCell(new Paragraph(new + * Chunk(customerAddress,headerFont))); + * cell.setHorizontalAlignment(PdfPCell.ALIGN_LEFT); + * cell.setBorderWidth(cellBorderWidth); table.addCell(cell); + * + * //spacing cell = new PdfPCell(new Paragraph("")); + * cell.setBorderWidth(cellBorderWidth); cell.setFixedHeight(10); + * cell.setColspan(2); table.addCell(cell); + * + * //row 3 cell = new PdfPCell(new Paragraph(new Chunk("No: " + documentNo, + * headerFont))); cell.setColspan(2); + * cell.setHorizontalAlignment(PdfPCell.ALIGN_LEFT); + * cell.setBorderWidth(cellBorderWidth); table.addCell(cell); + * + * //row 4 cell = new PdfPCell(new Paragraph(new Chunk("Doc Status: + * "+docStatus,headerFont))); cell.setColspan(2); + * cell.setHorizontalAlignment(PdfPCell.ALIGN_LEFT); + * cell.setBorderWidth(cellBorderWidth); table.addCell(cell); + * + * + * //row 5 cell = new PdfPCell(new Paragraph(new Chunk("Payment By: + * "+paymentBy,headerFont))); cell.setColspan(2); + * cell.setHorizontalAlignment(PdfPCell.ALIGN_LEFT); + * cell.setBorderWidth(cellBorderWidth); table.addCell(cell); + * + * + * //row 6 cell = new PdfPCell(new Paragraph(new Chunk("Date: + * "+dateOrdered,headerFont))); cell.setColspan(2); + * cell.setHorizontalAlignment(PdfPCell.ALIGN_LEFT); + * cell.setBorderWidth(cellBorderWidth); table.addCell(cell); + * + * //spacing cell = new PdfPCell(new Paragraph("")); cell.setColspan(2); + * cell.setFixedHeight(10); cell.setBorderWidth(cellBorderWidth); + * table.addCell(cell); + * + * //spacing cell = new PdfPCell(new Paragraph("")); cell.setColspan(2); + * cell.setFixedHeight(10); cell.setBorderWidth(cellBorderWidth); + * table.addCell(cell); + * + * + * //------------------------------------------------------ cell = new + * PdfPCell(); cell.setColspan(2); cell.setBorderWidth(cellBorderWidth); + * + * PdfPTable t = new PdfPTable(6); t.getDefaultCell().setPadding(3.0f); + * t.setWidthPercentage(100.0f); + * + * int[] widths = {1,4,1,2,2,2}; t.setWidths(widths); + * + * //setting headers t.addCell(new Paragraph(new + * Chunk("SerNo",headerFont))); t.addCell(new Paragraph(new + * Chunk("Name",headerFont))); t.addCell(new Paragraph(new + * Chunk("Qty",headerFont))); t.addCell(new Paragraph(new + * Chunk("Price",headerFont))); t.addCell(new Paragraph(new + * Chunk("VAT",headerFont))); t.addCell(new Paragraph(new + * Chunk("Total",headerFont))); + * + * //setting table data //--------------------------------writing table + * data------------------------------ int serNo = 0; int totalQty = 0; + * double totalAmt = 0.0; double totalTaxAmt = 0.0; double grandTotal = 0.0; + * + * BigDecimal qty = null; BigDecimal lineAmt = null; BigDecimal taxAmt = + * null; BigDecimal lineTotalAmt = null; + * + * for (WebOrderLineBean orderlineBean : orderLineList) { serNo++; qty = + * orderlineBean.getQtyOrdered(); lineAmt = orderlineBean.getLineNetAmt(); + * taxAmt = orderlineBean.getTaxAmt(); lineTotalAmt = + * orderlineBean.getLineTotalAmt(); + * + * totalQty += qty.intValue(); totalAmt += lineAmt.doubleValue(); + * totalTaxAmt += taxAmt.doubleValue(); grandTotal += + * lineTotalAmt.doubleValue(); + * + * t.addCell(new Paragraph(new Chunk(serNo+"",simpleFont))); t.addCell(new + * Paragraph(new Chunk(orderlineBean.getProductName(),simpleFont))); + * t.addCell(new Paragraph(new Chunk(qty.intValue()+"",simpleFont))); + * t.addCell(new Paragraph(new + * Chunk(formatter.format(lineAmt.doubleValue()),simpleFont))); + * t.addCell(new Paragraph(new + * Chunk(formatter.format(taxAmt.doubleValue()),simpleFont))); t.addCell(new + * Paragraph(new + * Chunk(formatter.format(lineTotalAmt.doubleValue()),simpleFont))); } + * //----------------------------------------------------------------------------------- + * + * //setting table footer t.getDefaultCell().setBackgroundColor(new + * Color(240,240,240)); + * + * PdfPCell c = new PdfPCell(new Paragraph(new Chunk("ORDER + * TOTAL",headerFont))); c.setColspan(2); c.setBackgroundColor(new + * Color(240,240,240)); t.addCell(c); + * + * t.addCell(new Paragraph(new Chunk(totalQty + "",simpleFont))); + * t.addCell(new Paragraph(new Chunk(currency + + * formatter.format(totalAmt),simpleFont))); t.addCell(new Paragraph(new + * Chunk(currency + formatter.format(totalTaxAmt),simpleFont))); + * t.addCell(new Paragraph(new Chunk(currency + + * formatter.format(grandTotal),simpleFont))); + * + * t.setSplitRows(true); cell.addElement(t); + * //------------------------------------------------------ + * + * //table.addCell(cell); table.setSplitRows(true); + * + * + * document.add(table); document.add(t); + * } catch (Exception e) { throw new OperationException(e); } + * // step 5: we close the document document.close(); + * + * + * return reportName; } + */ + + public static String getShipmentPDFReport(Properties ctx, int minoutId, + String trxName) throws OperationException { + String docStatus = null; + String dateOrdered = null; + String docType = null; + String orgName = null; + String orgAddress = null; + String salesRep = null; + String phone = " "; + String fax = " "; + + String customerName = null; + String customerAddress = null; + String documentNo = null; + + MInOut minout = MinOutManager.loadMInOut(ctx, minoutId, trxName); + + // getting orgInfo + MOrg org = new MOrg(ctx, minout.getAD_Org_ID(), trxName); + int location_id = org.getInfo().getC_Location_ID(); + MLocation location = new MLocation(ctx, location_id, trxName); + MBPartner orgPartner = new MBPartner(ctx, org.getLinkedC_BPartner_ID(trxName), + trxName); + MBPartnerLocation meLocation[] = MBPartnerLocation.getForBPartner(ctx, + orgPartner.get_ID()); + + if (meLocation.length != 1) + throw new OperationException( + "Should have only 1 location for organisation business partner!!"); + + MBPartnerLocation orgLocation = meLocation[0]; + + if (orgLocation.getPhone() != null) + phone = orgLocation.getPhone(); + + if (orgLocation.getFax() != null) + fax = orgLocation.getFax(); + ; + + orgName = org.getName(); + + String address1 = (location.getAddress1() == null) ? " " : location + .getAddress1(); + String address2 = (location.getAddress2() == null) ? " " : location + .getAddress2(); + orgAddress = (address1 + " " + address2).trim(); + + // getting order type + MDocType doctype = MDocType.get(ctx, minout.getC_DocType_ID()); + docType = doctype.getName(); + + // getting orderInfo + docStatus = minout.getDocStatusName(); + documentNo = minout.getDocumentNo(); + + Date d = new Date(minout.getCreated().getTime()); + SimpleDateFormat s = new SimpleDateFormat(TimestampConvertor.DEFAULT_DATE_PATTERN1); + dateOrdered = s.format(d); + + // getting salesrep + int saleRep_id = minout.getSalesRep_ID(); + MUser user = new MUser(ctx, saleRep_id, trxName); + salesRep = user.getName(); + + // getting customer info + int bpartner_id = minout.getC_BPartner_ID(); + BPartnerBean bean = BPartnerManager.getBpartner(ctx, bpartner_id, + trxName); + + String name1 = (bean.getPartnerName() == null) ? " " : bean + .getPartnerName(); + String name2 = (bean.getName2() == null) ? " " : bean.getName2(); + customerName = (name1 + " " + name2).trim(); + + address1 = (bean.getAddress1() == null) ? " " : bean.getAddress1(); + address2 = (bean.getAddress2() == null) ? " " : bean.getAddress2(); + customerAddress = (address1 + " " + address2).trim(); + + ArrayList orderLineList = MinOutManager + .getWebMinOutLines(ctx, minout); + + // ----------------------------------- generating pdf + // -------------------------------------- + String reportName = RandomStringGenerator.randomstring() + ".pdf"; + String reportPath = ReportManager.getReportPath(reportName); + + Font titleFont = new Font(Font.TIMES_ROMAN, 18, Font.BOLD); + Font subtitleFont = new Font(Font.TIMES_ROMAN, 14, Font.BOLD); + + Font headerFont = new Font(Font.TIMES_ROMAN, 11, Font.BOLD); + Font simpleFont = new Font(Font.TIMES_ROMAN, 10); + + float cellBorderWidth = 0.0f; + + // step 1: creation of a document-object + Document document = new Document(PageSize.A4, 30, 30, 20, 40);// l,r,t,b + // document.getPageSize().set; + + System.out.println(document.leftMargin()); + + try { + // step 2: + // we create a writer that listens to the document + // and directs a PDF-stream to a file + PdfWriter.getInstance(document, new FileOutputStream(reportPath)); + + // step 3: we open the document + document.open(); + // step 4: we add a paragraph to the document + + Image logo = null; + + // TODO: make this part dynamic <------------------------------ + // IMPORTANT !!!!!!!!!!!!!!!!!!!!!!!!!!! + String imageURI = PathInfo.PROJECT_HOME + + "images/pos/openBLUE_POS_Logo.gif"; + logo = Image.getInstance(imageURI); + + // MAttachment attachment = new + // MAttachment(ctx,MOrg.Table_ID,org.getID(),null); + // logo = Image.getInstance(attachment.getEntries()[0].getData()); + + try { + byte logoData[] = OrganisationManager.getLogo(ctx, null); + logo = Image.getInstance(logoData); + } catch (LogoException ex) { + logo = Image.getInstance(imageURI); + } + + logo.setAbsolutePosition(document.left(), document.top() + - logo.height()); + document.add(logo); + + PdfPTable table = new PdfPTable(2); + PdfPCell cell = null; + + // + table.getDefaultCell().setPadding(5.0f); + table.setWidthPercentage(100.0f); + + // header cell + Paragraph title = new Paragraph(); + title.add(new Chunk(orgName, subtitleFont)); + title.add(new Chunk("\n")); + title.add(new Chunk(orgAddress, subtitleFont)); + title.add(new Chunk("\n")); + title.add(new Chunk("Phone: " + phone, subtitleFont)); + title.add(new Chunk("\n")); + title.add(new Chunk("Fax: " + fax, subtitleFont)); + + // cell = new PdfPCell(new Paragraph(new + // Chunk("Title1",titleFont))); + cell = new PdfPCell(title); + + cell.setColspan(2); + cell.setHorizontalAlignment(PdfPCell.ALIGN_RIGHT); + cell.setVerticalAlignment(PdfPCell.ALIGN_MIDDLE); + cell.setFixedHeight(logo.height()); + cell.setBorderWidth(cellBorderWidth); + table.addCell(cell); + + cell = new PdfPCell(new Paragraph("")); + cell.setBorderWidth(cellBorderWidth); + cell.setFixedHeight(10); + cell.setColspan(2); + table.addCell(cell); + + // doc type + cell = new PdfPCell(new Paragraph(new Chunk(docType, titleFont))); + + cell.setColspan(2); + cell.setHorizontalAlignment(PdfPCell.ALIGN_CENTER); + cell.setVerticalAlignment(PdfPCell.ALIGN_MIDDLE); + cell.setBorderWidth(cellBorderWidth); + table.addCell(cell); + + // spacing + cell = new PdfPCell(new Paragraph("")); + cell.setBorderWidth(cellBorderWidth); + cell.setFixedHeight(10); + cell.setColspan(2); + table.addCell(cell); + + // row 1 + cell = new PdfPCell(new Paragraph(new Chunk(customerName, + headerFont))); + cell.setHorizontalAlignment(PdfPCell.ALIGN_LEFT); + cell.setBorderWidth(cellBorderWidth); + table.addCell(cell); + + cell = new PdfPCell(new Paragraph(new Chunk("Sales Rep: " + + salesRep, headerFont))); + cell.setHorizontalAlignment(PdfPCell.ALIGN_RIGHT); + cell.setBorderWidth(cellBorderWidth); + table.addCell(cell); + + // row 2 + cell = new PdfPCell(new Paragraph(new Chunk(customerAddress, + headerFont))); + cell.setHorizontalAlignment(PdfPCell.ALIGN_LEFT); + cell.setBorderWidth(cellBorderWidth); + table.addCell(cell); + + // spacing + cell = new PdfPCell(new Paragraph("")); + cell.setBorderWidth(cellBorderWidth); + cell.setFixedHeight(10); + cell.setColspan(2); + table.addCell(cell); + + // row 3 + cell = new PdfPCell(new Paragraph(new Chunk("No: " + documentNo, + headerFont))); + cell.setColspan(2); + cell.setHorizontalAlignment(PdfPCell.ALIGN_LEFT); + cell.setBorderWidth(cellBorderWidth); + table.addCell(cell); + + // row 4 + cell = new PdfPCell(new Paragraph(new Chunk("Doc Status: " + + docStatus, headerFont))); + cell.setColspan(2); + cell.setHorizontalAlignment(PdfPCell.ALIGN_LEFT); + cell.setBorderWidth(cellBorderWidth); + table.addCell(cell); + + /* + * //row 5 cell = new PdfPCell(new Paragraph(new Chunk("Payment By: + * "+paymentBy,headerFont))); cell.setColspan(2); + * cell.setHorizontalAlignment(PdfPCell.ALIGN_LEFT); + * cell.setBorderWidth(cellBorderWidth); table.addCell(cell); + */ + + // row 6 + cell = new PdfPCell(new Paragraph(new Chunk("Date: " + dateOrdered, + headerFont))); + cell.setColspan(2); + cell.setHorizontalAlignment(PdfPCell.ALIGN_LEFT); + cell.setBorderWidth(cellBorderWidth); + table.addCell(cell); + + // spacing + cell = new PdfPCell(new Paragraph("")); + cell.setColspan(2); + cell.setFixedHeight(10); + cell.setBorderWidth(cellBorderWidth); + table.addCell(cell); + + // spacing + cell = new PdfPCell(new Paragraph("")); + cell.setColspan(2); + cell.setFixedHeight(10); + cell.setBorderWidth(cellBorderWidth); + table.addCell(cell); + + // ------------------------------------------------------ + cell = new PdfPCell(); + cell.setColspan(2); + cell.setBorderWidth(cellBorderWidth); + + PdfPTable t = new PdfPTable(3); + t.getDefaultCell().setPadding(3.0f); + t.setWidthPercentage(100.0f); + + int[] widths = { 1, 10, 1 }; + t.setWidths(widths); + + // setting headers + t.addCell(new Paragraph(new Chunk("SerNo", headerFont))); + t.addCell(new Paragraph(new Chunk("Name", headerFont))); + t.addCell(new Paragraph(new Chunk("Qty", headerFont))); + + // setting table data + // --------------------------------writing table + // data------------------------------ + int serNo = 0; + + BigDecimal qty = null; + + for (WebMinOutLineBean orderlineBean : orderLineList) { + serNo++; + qty = orderlineBean.getQtyOrdered(); + + t.addCell(new Paragraph(new Chunk(serNo + "", simpleFont))); + t.addCell(new Paragraph(new Chunk(orderlineBean + .getProductName(), simpleFont))); + t.addCell(new Paragraph(new Chunk(qty.intValue() + "", + simpleFont))); + } + // ----------------------------------------------------------------------------------- + + // table.addCell(cell); + table.setSplitRows(true); + + document.add(table); + document.add(t); + + } catch (Exception e) { + throw new OperationException(e); + } + + // step 5: we close the document + document.close(); + + return reportName; + } + + public static String endOfTheDayPDF(Properties ctx, CloseTillBean bean) throws OperationException { + String reportName = RandomStringGenerator.randomstring() + ".pdf"; + String reportPath = ReportManager.getReportPath(reportName); + + double beginningBalance = (bean.getBeginningBalance() == null ? 0 + : bean.getBeginningBalance().doubleValue()); + double statementDifference = (bean.getNetCashTrx() == null ? 0 + : bean.getNetCashTrx().doubleValue()); + double transferAmount = (bean.getBalanceEntered() == null ? 0 + : bean.getBalanceEntered().doubleValue()); + double differenceAmount = (bean.getDifference() == null ? 0 + : bean.getDifference().doubleValue()); + double endingBalance = (bean.getEndingBalance() == null ? 0 + : bean.getEndingBalance().doubleValue()); + double tillCashTotal = (bean.getCashTotal() == null ? 0 : bean + .getCashTotal().doubleValue()); + double cashBeanCardTotal = (bean.getCardTotal() == null ? 0 + : bean.getCardTotal().doubleValue()); + double tillCardTotal = (bean.getCardTotal() == null ? 0 : bean + .getCardTotal().doubleValue()); + double cardDifference = (bean.getCardDifference() == null ? 0 + : bean.getCardDifference().doubleValue()); + double cashBeanChequeTotal = (bean.getChequeTotal() == null ? 0 + : bean.getChequeTotal().doubleValue()); + double tillChequeTotal = (bean.getChequeTotal() == null ? 0 + : bean.getChequeTotal().doubleValue()); + double chequeDifference = (bean.getChequeDifference() == null ? 0 + : bean.getChequeDifference().doubleValue()); + double grandTotal = (bean.getGrandTotal() == null ? 0 + : bean.getGrandTotal().doubleValue()); + + Font titleFont = new Font(Font.TIMES_ROMAN, 8, Font.BOLD); + Font subtitleFont = new Font(Font.TIMES_ROMAN, 8, Font.BOLD); + + // Font headerFont = new Font(Font.TIMES_ROMAN, 8,Font.BOLD); + Font simpleFont = new Font(Font.TIMES_ROMAN, 8); + + final float NO_BORDER = 0.0f; + // final float THIN_BORDER = 1.0f; + + String currency = "Rs "; + NumberFormat formatter = new DecimalFormat("###,###,##0.00"); + PdfPCell cell = null; + + // step 1: creation of a document-object + Document document = new Document(PageSize.A7, 3, 3, 2, 4);// l,r,t,b + // document.getPageSize().set; + + System.out.println(document.leftMargin()); + + try { + currency = POSTerminalManager.getDefaultSalesCurrency(ctx) + .getCurSymbol(); + PdfWriter.getInstance(document, new FileOutputStream(reportPath)); + + document.open(); + + PdfPTable layoutTbl = new PdfPTable(1); + layoutTbl.getDefaultCell().setBorderWidth(NO_BORDER); + layoutTbl.getDefaultCell().setPadding(2.0f); + + SimpleDateFormat sdf = new SimpleDateFormat(TimestampConvertor.DEFAULT_DATE_PATTERN1); + Date today = new Date(System.currentTimeMillis()); + + // 1.add title + Paragraph title = new Paragraph(new Chunk("End of the Day Report", + titleFont)); + title.setAlignment(Paragraph.ALIGN_CENTER); + cell = new PdfPCell(title); + cell.setHorizontalAlignment(Element.ALIGN_CENTER); + cell.setBorderWidth(NO_BORDER); + layoutTbl.addCell(cell); + + Paragraph subTitle = new Paragraph(new Chunk(sdf.format(today), + subtitleFont)); + subTitle.setAlignment(Paragraph.ALIGN_CENTER); + cell = new PdfPCell(subTitle); + cell.setHorizontalAlignment(Element.ALIGN_CENTER); + cell.setBorderWidth(NO_BORDER); + layoutTbl.addCell(cell); + + // spacing + cell = new PdfPCell(new Paragraph("")); + cell.setFixedHeight(10); + cell.setBorderWidth(NO_BORDER); + layoutTbl.addCell(cell); + + // display report data + PdfPTable table = new PdfPTable(2); + Phrase phrase = null; + + // row 1 + phrase = new Phrase("Till No:", simpleFont); + table.addCell(phrase); + + phrase = new Phrase(bean.getTillName(), simpleFont); + table.addCell(phrase); + + // row 2 + phrase = new Phrase("Begining Balance:", simpleFont); + table.addCell(phrase); + + phrase = new Phrase(currency + formatter.format(beginningBalance), + simpleFont); + table.addCell(phrase); + + // row 3 + phrase = new Phrase("Net Cash Trx:", simpleFont); + table.addCell(phrase); + + phrase = new Phrase(currency + + formatter.format(statementDifference), simpleFont); + table.addCell(phrase); + + phrase = new Phrase("Till Balance Entered:", simpleFont); + table.addCell(phrase); + + phrase = new Phrase(currency + formatter.format(transferAmount), + simpleFont); + table.addCell(phrase); + + phrase = new Phrase("Difference:", simpleFont); + table.addCell(phrase); + + phrase = new Phrase(currency + formatter.format(differenceAmount), + simpleFont); + table.addCell(phrase); + + phrase = new Phrase("Ending Balance:", simpleFont); + table.addCell(phrase); + + phrase = new Phrase(currency + formatter.format(endingBalance), + simpleFont); + table.addCell(phrase); + + phrase = new Phrase("Cash Total:", simpleFont); + table.addCell(phrase); + + phrase = new Phrase(currency + formatter.format(tillCashTotal), + simpleFont); + table.addCell(phrase); + + phrase = new Phrase("Card Amt Entered:", simpleFont); + table.addCell(phrase); + + phrase = new Phrase(currency + formatter.format(cashBeanCardTotal), + simpleFont); + table.addCell(phrase); + + phrase = new Phrase("Card Total:", simpleFont); + table.addCell(phrase); + + phrase = new Phrase(currency + formatter.format(tillCardTotal), + simpleFont); + table.addCell(phrase); + + phrase = new Phrase("Card Difference:", simpleFont); + table.addCell(phrase); + + phrase = new Phrase(currency + formatter.format(cardDifference), + simpleFont); + table.addCell(phrase); + + phrase = new Phrase("Cheque Amt Entered:", simpleFont); + table.addCell(phrase); + + phrase = new Phrase(currency + + formatter.format(cashBeanChequeTotal), simpleFont); + table.addCell(phrase); + + phrase = new Phrase("Cheque Total:", simpleFont); + table.addCell(phrase); + + phrase = new Phrase(currency + formatter.format(tillChequeTotal), + simpleFont); + table.addCell(phrase); + + phrase = new Phrase("Cheque Difference:", simpleFont); + table.addCell(phrase); + + phrase = new Phrase(currency + formatter.format(chequeDifference), + simpleFont); + table.addCell(phrase); + + phrase = new Phrase("Grand Total:", simpleFont); + table.addCell(phrase); + + phrase = new Phrase(currency + formatter.format(grandTotal), + simpleFont); + table.addCell(phrase); + + layoutTbl.addCell(table); + + document.add(layoutTbl); + + } + catch (Exception e) + { + throw new OperationException(e); + } + + document.close(); + + return reportName; + + } + + public static String endOfTheDayReport(Properties ctx, CloseTillBean bean) { + SimpleDateFormat sdf = new SimpleDateFormat(TimestampConvertor.DEFAULT_DATE_PATTERN1); + // String currency = + // POSTerminalManager.getPOSDefaultCurrency(ctx).getCurSymbol(); + Date today = new Date(System.currentTimeMillis()); + StringBuffer reportData = new StringBuffer(); + + String title = "End of the Day Report"; + String subtitle = sdf.format(today); + + // adding logo + reportData.append(TmkPrinterConstants.LOGO1); + + // adding title + reportData.append(title).append(TmkPrinterConstants.LINE_FEED); + + // adding subtitle + reportData.append(subtitle).append(TmkPrinterConstants.LINE_FEED); + + // adding space + reportData.append(TmkPrinterConstants.LINE_FEED); + + // adding report data + int maxwidth = 60; + int column1 = 30; + int column2 = maxwidth - column1; + + String format1 = "%1$-" + column1 + "s%2$" + column2 + "s%n"; // string,string + String format2 = "%1$-" + column1 + "s%2$" + column2 + ".2f%n"; // string,bigdecimal + + String tillNo = String + .format(format1, "Till No", bean.getTillName()); + String beginningBalance = String.format(format2, "Beginning Balance",bean.getBeginningBalance().doubleValue()); + String netCashTrx = String.format(format2, "Net Cash Trx", bean.getNetCashTrx().doubleValue()); + String tillBalanceEntered = String.format(format2,"Till Balance Entered", bean.getBalanceEntered().doubleValue()); + String difference = String.format(format2, "Difference", bean.getDifference().doubleValue()); + String endingBalance = String.format(format2, "Ending Balance",bean.getEndingBalance().doubleValue()); + String cashTotal = String.format(format2, "Cash Total", bean.getCashTotal().doubleValue()); + String cardTotal = String.format(format2, "Card Total", bean.getCardTotal().doubleValue()); + String chequeTotal = String.format(format2, "Cheque Total", bean.getChequeTotal()); + String grandTotal = String.format(format2, "Grand Total", bean.getGrandTotal()); + + // some new lines + // String cashEntered = String.format(format1, "Cash Amt Entered", + // cashBean.getca); + String cardEntered = String.format(format2, "Card Amt Entered",bean.getCardTotal()); + String cardDifference = String.format(format2, "Card Difference",bean.getCardDifference()); + String chequeEntered = String.format(format2, "Cheque Amt Entered",bean.getChequeTotal()); + String chequeDifference = String.format(format2, "Cheque Difference",bean.getChequeDifference()); + + reportData.append(tillNo).append(beginningBalance).append(netCashTrx) + .append(tillBalanceEntered).append(difference).append( + endingBalance) + // .append(cashEntered) + .append(cashTotal).append(cardEntered).append(cardTotal) + .append(cardDifference).append(chequeEntered).append( + chequeTotal).append(chequeDifference) + .append(grandTotal).append(TmkPrinterConstants.PAPER_CUT).append(TmkPrinterConstants.LINE_FEED); + + return reportData.toString(); + } + + public static String getDailySalesReport( Properties ctx, Timestamp time, int C_POS_ID, int maxLength, String trxName) throws SQLException, OperationException + { + if (maxLength < TmkPrinterConstants.PRINTER_DEFAULT_WIDTH) + { + maxLength = TmkPrinterConstants.PRINTER_DEFAULT_WIDTH; + } + SimpleDateFormat sdf = new SimpleDateFormat(TimestampConvertor.DEFAULT_DATE_PATTERN1); + Date today = new Date(System.currentTimeMillis()); + String subtitle = sdf.format(today); + + StringBuffer sql = new StringBuffer(); + + sql.append(" select PROD.NAME,"); + sql.append(" SUM(0 - FACT.QTY) as Qty,"); + sql.append(" round(SUM(FACT.AMTACCTCR - FACT.AMTACCTDR) * ((tax.RATE+100)/100),3) as Value"); + sql.append(" from FACT_ACCT FACT"); + sql.append(" inner join M_PRODUCT PROD on FACT.M_PRODUCT_ID = PROD.M_PRODUCT_ID"); + sql.append(" inner join C_TAX tax on tax.C_TAX_ID = FACT.C_TAX_ID"); + sql.append(" inner join C_INVOICE inv on inv.C_INVOICE_ID = fact.RECORD_ID"); + sql.append(" inner join C_ORDER ord on ord.C_Order_ID = inv.C_Order_ID"); + sql.append(" where FACT.ACCOUNT_ID = (select C_ELEMENTVALUE_ID from C_ELEMENTVALUE where value = '41000' and AD_CLIENT_ID ="+Env.getAD_Client_ID(ctx)+")"); + sql.append(" and fact.DATEACCT = ").append(DB.TO_DATE(time)); + sql.append(" and fact.AD_ORG_ID= ? "); + sql.append(" and fact.AD_CLIENT_ID = ? "); + sql.append(" and ord.C_POS_ID = ?"); + sql.append(" GROUP BY to_char(fact.DATEACCT,'DD-MM-YYYY'),"); + sql.append(" tax.RATE,"); + sql.append(" PROD.NAME "); + sql.append(" Order by to_char(fact.DATEACCT,'DD-MM-YYYY')"); + sql.append(" desc,PROD.NAME asc"); + + PreparedStatement pstmt = null; + ResultSet rs = null; + + pstmt = DB.prepareStatement(sql.toString(),trxName); + pstmt.setInt(1, Env.getAD_Org_ID(ctx)); + pstmt.setInt(2, Env.getAD_Client_ID(ctx)); + pstmt.setInt(3, C_POS_ID); + pstmt.execute(); + + BigDecimal totalQty = Env.ZERO; + BigDecimal totalValue = Env.ZERO; + + ArrayList list = new ArrayList(); + Object[] data = null; + + try + { + rs = pstmt.executeQuery(); + + while (rs.next()) + { + data = new Object[3]; + + data[0] = rs.getString(1); + data[1] = rs.getBigDecimal(2); + data[2] = rs.getBigDecimal(3); + + totalQty = totalQty.add(rs.getBigDecimal(2)); + totalValue = totalValue.add(rs.getBigDecimal(3)); + + list.add(data); + } + + } + catch(SQLException e) + { + throw new OperationException(e); + } + finally + { + DBUtils.close(rs); + DBUtils.close(pstmt); + } + + String doubleLine = ""; + String line = ""; + + for(int i=0; i getBestSellingItemsData(Properties ctx, Timestamp fromDate, Timestamp toDate, String trxName) throws OperationException, SQLException + { + ArrayList reportData = new ArrayList(); + Object[] data = null; + + BigDecimal totalQty = Env.ZERO; + BigDecimal totalValue = Env.ZERO; + + StringBuffer sql = new StringBuffer(); + + sql.append(" select PROD.NAME, SUM(0 - FACT.QTY) as QTY, round(SUM(FACT.AMTACCTCR - FACT.AMTACCTDR),2) as VALUE,"); + + if(DB.getDatabase().getName().equals(Database.DB_POSTGRESQL)) + { + sql.append(" case when prod.GROUP1 is null then 'OTHERS' else trim(prod.GROUP1) end as GROUP1"); + } + + if(DB.getDatabase().getName().equals(Database.DB_ORACLE)) + { + sql.append(" case when prod.GROUP1 is null then 'OTHERS' else to_char(prod.GROUP1) end as GROUP1"); + } + + sql.append(" from FACT_ACCT FACT inner join M_PRODUCT PROD on FACT.M_PRODUCT_ID = PROD.M_PRODUCT_ID") + .append(" where FACT.ACCOUNT_ID = (select C_ELEMENTVALUE_ID from C_ELEMENTVALUE where value = '41000' and AD_CLIENT_ID ="+Env.getAD_Client_ID(ctx)+")") + .append(" and fact.DATEACCT between " + DB.TO_DATE(fromDate) + " and " + DB.TO_DATE(toDate) ) + .append(" and fact.AD_ORG_ID="+Env.getAD_Org_ID(ctx)) + .append(" and fact.AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)) + .append(" and PROD.ISACTIVE='Y'"); + + if(DB.getDatabase().getName().equals(Database.DB_ORACLE)) + { + sql.append(" and ROWNUM < 101"); + } + + sql.append(" GROUP BY PROD.NAME, prod.GROUP1, prod.GROUP2") + .append(" Order by round(SUM(FACT.AMTACCTCR - FACT.AMTACCTDR),3) desc"); + + PreparedStatement pstmt = null; + ResultSet rs = null; + + try + { + pstmt = DB.prepareStatement (sql.toString(), trxName); + rs = pstmt.executeQuery(); + + while(rs.next()) + { + data = new Object[4]; + + data[0] = rs.getString(1); + data[1] = rs.getBigDecimal(2); + data[2] = rs.getBigDecimal(3); + data[3] = rs.getString(4); + + totalQty = totalQty.add(rs.getBigDecimal(2)); + totalValue = totalValue.add(rs.getBigDecimal(3)); + + reportData.add(data); + } + + Object[] totalValues = {"TOTAL ", totalQty, totalValue, ""}; + reportData.add(totalValues); + + rs.close(); + } + catch (SQLException e) + { + throw new OperationException(e); + } + finally + { + DBUtils.close(rs); + DBUtils.close(pstmt); + + } + + return reportData; + } + + /** + * Get Stock Enquiry Data + * @param ctx + * @param fromDate + * @param toDate + * @param trxName + * @return Array of Object + * @throws OperationException + * @throws SQLException + */ + public static ArrayList getStockEnquiryData(Properties ctx, Timestamp fromDate, Timestamp toDate, String trxName) throws OperationException, SQLException + { + ArrayList reportData = new ArrayList(); + Object[] data = null; + + BigDecimal totalOpStockQty = Env.ZERO; + BigDecimal totalOpStockValue = Env.ZERO; + BigDecimal totalClosingStockQty = Env.ZERO; + BigDecimal totalClosingStockValue = Env.ZERO; + + StringBuffer sql = new StringBuffer(); + + sql.append(" select p.UPC as Barcode, p.Name as Product,") + .append(" case when openB.sumO is null then 0 else openB.sumO end as OpStock, ") + .append(" (price.PRICESTD * (case when openB.sumO is null then 0 else openB.sumO end)) as TotalValue, ") + .append(" case when openC.sum1 is null then 0 else openC.sum1 end as ClosingStock ,") + .append(" (price.PRICESTD * (case when openC.sum1 is null then 0 else openC.sum1 end)) as TotValue ") + .append(" from (M_Product p ") + .append(" INNER JOIN ") + .append(" ( ") + .append(" Select M_Product_ID, sum(MovementQty) as sum1 from M_Transaction trx1 where trx1.MOVEMENTDATE < ").append(DB.TO_DATE(fromDate)).append(" and trx1.MOVEMENTTYPE in ('V+','V-','C-','C+','I+') group by M_Product_ID) openC ON p.M_PRODUCT_ID=openC.M_Product_ID ") + .append(" left outer JOIN (Select M_Product_ID, sum(MovementQty) as sumO from M_Transaction trxO where trxO.MOVEMENTDATE < ").append(DB.TO_DATE(toDate)).append(" and trxO.MOVEMENTTYPE in ('V+','V-','C-','C+','I+') group by M_Product_ID) openB ON p.M_PRODUCT_ID=openB.M_Product_ID ") + .append(" ) ") + .append(" left outer join M_PRODUCTPRICE price on p.M_Product_ID=price.M_Product_ID,AD_ORG org ") + .append(" where p.AD_ORG_ID = org.AD_ORG_ID ") + .append(" and p.AD_ORG_ID = ").append(Env.getAD_Org_ID(ctx)) + .append(" and p.ISACTIVE='Y' ") + .append(" and price.M_PRICELIST_VERSION_ID = ").append(Env.getContextAsInt(ctx,UdiConstants.POS_PURCHASE_PL_VERSION)) + .append(" order by p.Name "); + + PreparedStatement pstmt = null; + ResultSet rs = null; + + try + { + pstmt = DB.prepareStatement (sql.toString(), trxName); + rs = pstmt.executeQuery(); + + while(rs.next()) + { + data = new Object[6]; + + data[0] = rs.getString(1); // Bar code + data[1] = rs.getString(2); // Product Name + data[2] = rs.getBigDecimal(3); // Opening Stock + data[3] = rs.getBigDecimal(4); // Opening Value + data[4] = rs.getBigDecimal(5); // Closing Stock + data[5] = rs.getBigDecimal(6); // Closing Value + + totalOpStockQty = totalOpStockQty.add(rs.getBigDecimal(3)); + totalOpStockValue = totalOpStockValue.add(rs.getBigDecimal(4)); + totalClosingStockQty = totalClosingStockQty.add(rs.getBigDecimal(5)); + totalClosingStockValue = totalClosingStockValue.add(rs.getBigDecimal(6)); + + reportData.add(data); + } + + Object[] totalValues = {"TOTAL VALUE ", "", totalOpStockQty, totalOpStockValue, totalClosingStockQty, totalClosingStockValue}; + reportData.add(totalValues); + + rs.close(); + } + catch (SQLException e) + { + throw new OperationException(e); + } + finally + { + DBUtils.close(rs); + DBUtils.close(pstmt); + + } + + return reportData; + } + + public static ArrayList getStockSalesReport(Properties ctx, HashMap> productOrgList, ArrayList stockSalesList, boolean isSales, Integer productId, Integer orgId, Timestamp fromDate, Timestamp toDate) throws OperationException, SQLException + { + + if (productId == null) + { + throw new OperationException("product Id is null, cannot search for stock and sales by org"); + } + if (orgId == null) + { + throw new OperationException("org id is null, cannot search for stock and sales"); + } + + if (productOrgList == null) + { + productOrgList = new HashMap>(); + } + + MProduct product = MProduct.get(ctx, productId); + String productName = product.getName(); + int adClientId = Env.getAD_Client_ID(ctx); + + BigDecimal data = null; + BigDecimal stock = null; + boolean queryOrg = true; + MOrg org = MOrg.get(ctx, orgId); + + if (stockSalesList == null) + { + stockSalesList = new ArrayList(); + + data = getData(ctx, isSales, productId, orgId, fromDate, toDate); + + Object[] headerSales = new Object[] {"Product", org.getName(), "Total"}; + Object[] row = new Object[]{productName, data, data}; + stockSalesList.add(headerSales); + stockSalesList.add(row); + ArrayList orgList = new ArrayList(); + orgList.add(org.getName()); + productOrgList.put(productId, orgList); + } + + else + { + Object[] headerSales = stockSalesList.get(0); + + for (int i=1; i clone = new ArrayList(); + Iterator iterClone = stockSalesList.iterator(); + + while (iterClone.hasNext()) + { + clone.add(iterClone.next()); + } + + Iterator iter = stockSalesList.subList(1, stockSalesList.size()).iterator(); + while (iter.hasNext()) + { + Object[] row = iter.next(); + String prodName = row[0].toString(); + int[] ids = ProductManager.getProducts(ctx, prodName, "", "",null); + Integer prodId = 0; + if (ids !=null && ids.length >0) + { + prodId= Integer.valueOf(ids[0]); + } + data = getData(ctx, isSales, prodId, orgId, fromDate, toDate); + updateRow(clone,row, data); + productOrgList.get(prodId).add(org.getName()); // update list + } + stockSalesList = clone; + clone = null; + + } + if (!productOrgList.containsKey(productId)) // need to add new product + { + // add product for all existing orgs (plus the new one if just added) + headerSales = stockSalesList.get(0); + + Object[] newRowAdded = new Object[headerSales.length]; + newRowAdded[0] = productName; + ArrayList orgList = new ArrayList(); + BigDecimal total = Env.ZERO; + for (int i = 1; i< headerSales.length-1; i++) + { + String existingOrg = headerSales[i].toString(); + orgList.add(existingOrg); + Integer existingOrgId = OrganisationManager.getOrgByName(ctx, existingOrg, null).get_ID(); + data = getData(ctx, isSales, productId, existingOrgId, fromDate, toDate); + + newRowAdded[i] = data; + total = total.add(data); + } + newRowAdded[headerSales.length-1] = total; + productOrgList.put(productId, orgList); + stockSalesList.add(newRowAdded); + } + } + + return stockSalesList; + + } + + public static ArrayList doBackup(ArrayList list) + { + ArrayList backup = null; + if (list != null) + { + Iterator iter = list.iterator(); + + backup = new ArrayList(); + + while (iter.hasNext()) + { + backup.add(iter.next()); + } + } + return backup; + } + + + private static void updateRow(ArrayList stockSalesList, Object[] row, BigDecimal data) throws OperationException + { + Object[] newRow = new Object[stockSalesList.get(0).length]; + + if (!(newRow.length == row.length + 1)) + { + throw new OperationException("inconsistent header and row length"); + } + + for (int i=0; i< row.length-1; i++) + { + newRow[i] = row[i]; // fill new row with data of old row (product name to data for last org) exclude total + } + + newRow[row.length-1] = data; // append new data for new org added + + + BigDecimal total = Env.ZERO; // calculate new total + for (int j = 1; j orgSales = POSSalesReportManager.getSalesByOrg(ctx, productId, orgId, fromDate, toDate, null); + + data = orgSales.get(orgId); + + } + + else + { + HashMap orgStock = POSStockManager.getStockByOrg(ctx, productId, toDate, orgId, null); + data = orgStock.get(orgId); + + } + if (data == null) + { + return Env.ZERO; + } + + return data; + } + + public static ArrayList getStockSalesReportComplete(Properties ctx, HashSet productListCompleteSet, boolean isSales, ArrayList listComplete, Integer productId, + Integer orgId, Timestamp fromDate, Timestamp toDate) throws OperationException, SQLException + { + HashMap list = null; + + if (productListCompleteSet == null) + { + productListCompleteSet = new HashSet(); + } + + if (!productListCompleteSet.isEmpty() && productListCompleteSet.contains(productId)) + { + return listComplete; + } + else + { + productListCompleteSet.add(productId); + } + + if (isSales) + { + list = POSSalesReportManager.getSalesByOrg(ctx, productId, orgId, fromDate, toDate, null); + } + else + { + list = POSStockManager.getStockByOrg(ctx, productId, toDate, orgId, null); + } + + if (listComplete == null) + { + listComplete = getHeaderComplete(ctx); + } + + MProduct product = MProduct.get(ctx, productId); + Object[] header = listComplete.get(0); + Object[] row = new Object[header.length]; + + row[0] = product.getName(); + BigDecimal total = Env.ZERO; + for (int i = 1; i getHeaderComplete(Properties ctx) + { + ArrayList listComplete = new ArrayList(); + String orgList = Env.getContext(ctx,UdiConstants.ROLE_EDITABLE_ORGS_CTX_PARAM); + String[] orgs = orgList.split(","); + + Object[] header = new Object[orgs.length +1]; + header[0] = "Product"; + + int i = 1; + for (String org : orgs) + { + Integer org_Id = Integer.valueOf(org); + if (org_Id != 0) + { + MOrg organisation = MOrg.get(ctx, org_Id); + header[i] = organisation.getName(); + i++; + } + } + header[i] = "Total"; + listComplete.add(header); + return listComplete; + } + + public static String getListMonthYears(Timestamp fromDate, Timestamp toDate) throws OperationException + { + DateFormatSymbols dfs = new DateFormatSymbols(Locale.ENGLISH); + + String date1 = TimestampConvertor.convertTimeStamp(fromDate, TimestampConvertor.BIRTH_DATE); + String date2 = TimestampConvertor.convertTimeStamp(toDate, TimestampConvertor.BIRTH_DATE); + String[] monthName = dfs.getMonths(); + + + StringBuffer list_monthYears = new StringBuffer(); + String[] s_date1 = date1.split("/"); + String[] s_date2 = date2.split("/"); + int begin_month = 0; + int begin_year = 0; + int end_month = 0; + int end_year = 0; + + if (s_date1 != null); + { + begin_month = Integer.parseInt(s_date1[1]); + begin_year = Integer.parseInt(s_date1[2]); + + } + + if (s_date2 != null); + { + end_month = Integer.parseInt(s_date2[1]); + end_year = Integer.parseInt(s_date2[2]); + } + + int month = begin_month -1; + int year = begin_year; + + while (month <= Calendar.DECEMBER && year <= end_year) + { + list_monthYears.append(monthName[month] + " " + year + ","); + + if (month == Calendar.DECEMBER) + { + year++; + month = -1; + } + month %= Calendar.DECEMBER; + month++; + + if (year == end_year) + { + if (month >= end_month) + { + break; + } + } + + } + + return list_monthYears.toString(); + + } + + public static ArrayList formatStockSalesReportData(ArrayList reportData, HashMap monthYearQtyMap, + Timestamp fromDate, Timestamp toDate, int precision) throws OperationException + { + String list_monthYears = POSReportManager.getListMonthYears(fromDate, toDate); + String[] listOfMonthYrs = list_monthYears.split(","); + + if (reportData == null) + { + reportData = new ArrayList(); + } + + if (monthYearQtyMap.isEmpty()) + { + List repDataOnly = reportData.subList(1, reportData.size()); + if (repDataOnly.isEmpty()) + { + for (String monthYear: listOfMonthYrs) + { + Object[] data = {monthYear, Env.ZERO}; + reportData.add(data); + } + } + else + { + for (int index =1; index iter = reportData.iterator(); + int j =1; + iter.next(); // escape headers + + while (iter.hasNext()) + { + Object[] dat = iter.next(); + String monthYr = dat[0].toString(); + if (monthYear.equals(monthYr)) + { + index = j; + } + j++; + } + } + if (index != -1) + { + Object[] oldData = reportData.get(index); + reportData.remove(index); + data = new Object[oldData.length +1]; + for (int i =0; i loadReports(Properties ctx) + { + int roleId = Env.getContextAsInt(ctx, UdiConstants.AD_ROLE_ID); + + return loadReports(ctx, roleId); + } + + /** + * Loads reports accessible by this role. + * Reports are granted to a particular role as process accesses for that role. + * For the reports to be accessible, these process accesses should be active + * and this role should have read-write permissions. + * + * @param ctx context + * @param roleId id of role for which the accessible reports are to be loaded + * @return an arraylist of process ids which are the ids of those processes accessible by that role + */ + public static ArrayList loadReports(Properties ctx, int roleId) + { + if (roleId == 0) + { + return new ArrayList(); + } + MRole role = MRole.get(ctx, roleId); + int adClientId = role.getAD_Client_ID(); + + StringBuffer sqlBuffer = new StringBuffer(); + sqlBuffer.append("SELECT process.AD_Process_ID FROM AD_Process process") + .append(" INNER JOIN AD_Process_Access processAccess ON process.AD_Process_ID = processAccess.AD_Process_ID") + .append(" WHERE process.isActive='Y' AND process.isReport = 'Y' and process.isDirectPrint = 'N'") + .append(" AND processAccess.isActive = 'Y' AND processAccess.isReadWrite = 'Y' AND processAccess.AD_Role_ID = ?") + .append(" AND processAccess.AD_Client_ID = " + adClientId); + + ArrayList processList = new ArrayList(); + + PreparedStatement pstmt = null; + ResultSet rs = null; + try + { + pstmt = DB.prepareStatement(sqlBuffer.toString(), null); + pstmt.setInt(1, roleId); + rs = pstmt.executeQuery(); + + while (rs.next()) + { + processList.add(rs.getInt(1)); + } + } + catch(SQLException e) + { + + } + finally + { + DB.close(rs, pstmt); + rs = null; + pstmt = null; + } + return processList; + + } + + /** + * Creates a process instance for this process and populates its parameters. + * For every mapping found in the hashmap paramKeyValue, a parameter is created. + * Each parameter is populated thus: + * Each key is a column name identifying a parameter and the corresponding + * hashmap value is the parameter value. + * + * @param ctx context + * @param processId id of the process whose instance is to be created + * @param paramKeyValue hashmap of column names mapped to their respective values + * + * @return id of the process instance created + * @throws OperationException + */ + public static ProcessInfo createProcessInstance(Properties ctx, int processId, Map map, String trxName) throws OperationException + { + checkProcessAccess(ctx, processId, trxName); + + MProcess process = MProcess.get(ctx, processId); + MProcessPara[] processParams = process.getParameters(); + ProcessInfoParameter[] pInfoParams = new ProcessInfoParameter[processParams.length]; + MPInstance processInstance = new MPInstance(ctx, processId, 0); + processInstance.save(trxName); + + int sequence = 0; + for (MProcessPara parameter : processParams) + { + String columnName = parameter.getColumnName(); + boolean isRange = parameter.isRange(); + int displayType = parameter.getAD_Reference_ID(); + + Class classType = DisplayType.getClass(displayType, true); + Object value = null; + Object value_to = null; + + if (isRange) + { + value = map.get(columnName + "From"); + value_to = map.get(columnName + "To"); + } + else + { + value = map.get(columnName); + } + + if (parameter.isMandatory()) + { + if (isRange) + { + if (value_to == null) + { + throw new MandatoryException(columnName + " value_to parameter is mandatory"); + } + } + if (value == null) + { + throw new MandatoryException(columnName + " value parameter is mandatory"); + } + } + + value = convertValue(value, classType); + value_to = convertValue(value_to, classType); + + MPInstancePara param = new MPInstancePara(processInstance, sequence); + param.setParameterName(columnName); + setParameterValue(param, value, value_to); + String info = null; + String info_to = null; + Lookup lookup = parameter.getLookup(); + if (lookup != null) + { + if (value != null) + { + info = lookup.get(value).toString(); + } + if (value_to != null) + { + info_to = parameter.getLookup().get(value_to).toString(); + } + param.setInfo(info); + param.setInfo_To(info_to); + } + param.save(trxName); + + ProcessInfoParameter infoParam = new ProcessInfoParameter(columnName, value, value_to, null, null); + pInfoParams[sequence] = infoParam; + + sequence++; + } + + ProcessInfo pi = new ProcessInfo(process.getName(), processId); + pi.setTitle(process.getName()); + pi.setTransactionName(trxName); + pi.setAD_Client_ID(Env.getAD_Client_ID(ctx)); + pi.setParameter(pInfoParams); + pi.setAD_PInstance_ID(processInstance.getAD_PInstance_ID()); + pi.setClassName(process.getClassname()); + + return pi; + } + + /** + * + * @param param + * @param value + * @param value_to + */ + private static void setParameterValue(MPInstancePara param, Object value, Object value_to) + { + if (value == null) + { + return; + } + + if (value.getClass() == Integer.class) + { + param.setP_Number((Integer)value); + + if (value_to !=null) + { + param.setP_Number_To((Integer)value_to); + } + } + else if (value.getClass() == BigDecimal.class) + { + param.setP_Number((BigDecimal)value); + + if (value_to !=null) + { + param.setP_Number_To((BigDecimal)value_to); + } + } + else if (value.getClass() == Timestamp.class) + { + param.setP_Date((Timestamp)value); + if (value_to !=null) + { + param.setP_Date_To((Timestamp)value_to); + } + } + else + { + param.setP_String(value.toString()); + if (value_to !=null) + { + param.setP_String_To(value_to.toString()); + } + } + + } + + /** + * + * @param value + * @param classType + * @return + */ + private static Object convertValue(Object value, Class classType) + { + if (value != null) + { + String[] values = (String[]) value; + String val = values[0]; + + if ("".equals(val)) + { + return null; + } + + if (classType == String.class || classType == Boolean.class) + { + value = val; + } + else if (classType == Integer.class || classType == BigDecimal.class) + { + value = BigDecimal.valueOf(Integer.valueOf(val)); + } + else if (classType == Timestamp.class) + { + val = val +" 0:0:0.0"; // SENDYFIXME Need to fix this + value = Timestamp.valueOf(val); + } + } + return value; + } + + /** + * Loads the print format associated with a process or if none is found, loads its default one. + * + * @param ctx context + * @param process the process whose print format is to be loaded + * @return print format to use with that process + * @throws Exception + */ + public static MPrintFormat loadPrintFormat(Properties ctx, MProcess process, String trxName) throws Exception + { + MPrintFormat retValue = null; + if (process.getAD_PrintFormat_ID() ==0) + { + I_AD_ReportView reportView = process.getAD_ReportView(); + int reportViewId = 0; + int tableId = 0; + + if (reportView != null) + { + reportViewId = reportView.getAD_ReportView_ID(); + tableId = reportView.getAD_Table_ID(); + } + + PreparedStatement pstmt = null; + ResultSet rs = null; + String sql = "SELECT * FROM AD_PrintFormat WHERE "; + if (reportViewId > 0) + { + sql += "AD_ReportView_ID=?"; + } + else + { + sql += "AD_Table_ID=?"; + } + + sql += " AND AD_Client_ID = " +Env.getAD_Client_ID(ctx); + sql += " ORDER BY IsDefault DESC"; + try + { + pstmt = DB.prepareStatement (sql, trxName); + pstmt.setInt (1, reportViewId > 0 ? reportViewId : tableId); + rs = pstmt.executeQuery (); + if (rs.next ()) + { + retValue = new MPrintFormat (ctx, rs, trxName); + } + } + catch (Exception e) + { + } + finally + { + DB.close(rs, pstmt); + pstmt = null; + rs = null; + } + retValue = retValue == null ? MPrintFormat.createFromTable(ctx, tableId) : retValue; + } + else + { + retValue = new MPrintFormat(ctx, process.getAD_PrintFormat_ID(), null); + } + return retValue; + } + + /** + * + * @param ctx + * @param className + * @param pi + * @param trx + * @throws InstantiationException + * @throws IllegalAccessException + * @throws ClassNotFoundException + *//* + public static void startProcess(Properties ctx, String className, ProcessInfo pi,Trx trx) + throws InstantiationException, IllegalAccessException, ClassNotFoundException + { + if (className == null) + { + return; + } + Class cl = Class.forName(className); + + if (cl == ReportStarter.class) + { + ReportStarter reportStarter = (ReportStarter)cl.newInstance(); + reportStarter.startProcess(ctx, pi, trx); + return; + } + SvrProcess server = (SvrProcess)cl.newInstance(); + server.startProcess(ctx, pi, trx); + }*/ + + public static boolean isJasperReport(String className) throws ClassNotFoundException + { + if (className!=null) + { + Class cl = Class.forName(className); + + if (cl == ReportStarter.class) + { + return true; + } + } + return false; + } + + /** + * + * @param ctx + * @param processId + * @param trxName + * @throws OperationException + */ + private static void checkProcessAccess(Properties ctx, int processId, String trxName) throws OperationException + { + String sql = "SELECT isActive, isReadWrite FROM AD_Process_Access WHERE AD_Process_ID = ? " + + "AND AD_Role_ID = ? AND AD_Client_ID = ?"; + + MProcess process = MProcess.get(ctx, processId); + PreparedStatement pstmt = null; + ResultSet rs = null; + + String isActive = "N"; + String isReadWrite = "N"; + + + int roleId = Env.getAD_Role_ID(ctx); + MRole role = MRole.get(ctx, roleId); + int adClientId = Env.getAD_Client_ID(ctx); + try + { + pstmt = DB.prepareStatement(sql, trxName); + pstmt.setInt(1, processId); + pstmt.setInt(2, roleId); + pstmt.setInt(3, adClientId); + + rs = pstmt.executeQuery(); + + if (rs.next()) + { + isActive = rs.getString(1); + isReadWrite = rs.getString(2); + } + else + { + throw new OperationException("The report "+process.getName()+" does not exist for role " + role.getName()); + } + } + catch (SQLException e) + { + + } + finally + { + DB.close(rs, pstmt); + rs = null; + pstmt = null; + } + if (!"Y".equals(isActive)) + { + throw new OperationException("The access to the report "+process.getName()+" for role "+role.getName()+" is not active"); + } + + if (!"Y".equals(isReadWrite)) + { + throw new OperationException("Role "+role.getName()+ " does not have read/write permissions for report "+ process.getName()); + } + } + + /** + * + * @param writer + * @param title + * @param paramMap + * @param printData + * @param printFormat + * @param pdfURI + * @param csvURI + */ + public static void createHTML(Writer writer, String title, HashMap paramMap, + PrintData printData, MPrintFormat printFormat) + { + Language language = printFormat.getLanguage(); + XhtmlDocument doc = new XhtmlDocument(); + + String style = ""; + + head head = new head(style); + doc.appendHead(head); + + try + { + writer.append(""); + writer.append("
    "+title+"
    "); + + Set parameters = paramMap.keySet(); + + Iterator columnIter = parameters.iterator(); + writer.append("
    Parameters:
    "); + while (columnIter.hasNext()) + { + String columnName = columnIter.next(); + String value = paramMap.get(columnName); + writer.append("
    " + columnName+": " + value + "
    "); + } + writer.append("
     
    "); + writer.append(""); + // for all rows (-1 = header row) + for (int row = -1; row < printData.getRowCount(); row++) + { + writer.append(""); + if (row != -1) + printData.setRowIndex(row); + // for all columns + String rowClass = "odd"; + if (row%2==0) + { + rowClass = "even"; + } + for (int col = 0; col < printFormat.getItemCount(); col++) + { + MPrintFormatItem item = printFormat.getItem(col); + if (item.isPrinted()) + { + // header row + if (row == -1) + { + writer.append(""); + } + else + { + writer.append(""); + } + else if (obj instanceof PrintDataElement) + { + String value = ((PrintDataElement)obj).getValueDisplay(language); // formatted + writer.append(Util.maskHTML(value)+""); + } + else if (obj instanceof PrintData) + { + // ignore contained Data + } + else + { + + } + } + } // printed + } // for all columns + writer.append(""); + } // for all rows + writer.append("
    "+Util.maskHTML(item.getPrintName(language))+""); + Object obj = printData.getNode(new Integer(item.getAD_Column_ID())); + if (obj == null) + { + writer.append(" 
    "); + PrintWriter printWriter = new PrintWriter(writer); + doc.output(printWriter); + printWriter.flush(); + printWriter.close(); + } + catch (Exception e) + { + } + } + + /** + * Load specific reportEngine for this print format and this process info + * @param ctx context + * @param printFormat print format + * @param pi + * @return + * @throws Exception + */ + public static ReportEngine getReportEngine(Properties ctx, MPrintFormat printFormat, ProcessInfo pi) throws Exception + { + MProcess process = MProcess.get(ctx, pi.getAD_Process_ID()); + int tableId = process.getAD_ReportView().getAD_Table_ID(); + String tableName = MTable.getTableName(ctx, tableId); + // Create query from parameters + MQuery query = MQuery.get (ctx, pi.getAD_PInstance_ID(), tableName); + PrintInfo printInfo = new PrintInfo(pi); + ReportEngine reportEngine = new ReportEngine(ctx, printFormat, query, printInfo); + + return reportEngine; + } + + /** + * + * @param ctx + * @param printFormat + * @param pi + * @return + * @throws Exception + */ + public static PrintData getPrintData(Properties ctx, MPrintFormat printFormat, ProcessInfo pi) throws Exception + { + MProcess process = MProcess.get(ctx, pi.getAD_Process_ID()); + int tableId = process.getAD_ReportView().getAD_Table_ID(); + String tableName = MTable.getTableName(ctx, tableId); + // Create query from parameters + MQuery query = MQuery.get (ctx, pi.getAD_PInstance_ID(), tableName); + + DataEngine dataEngine = new DataEngine(printFormat.getLanguage()); + return dataEngine.getPrintData(ctx, printFormat, query); + } + + /** + * + * @param ctx + * @param pinstanceId + * @param trxName + * @return + */ + public static HashMap getReportParameters(Properties ctx, int pinstanceId, String trxName) + { + HashMap map = new HashMap(); + + MPInstance pinstance = new MPInstance(ctx, pinstanceId, trxName); + + MPInstancePara[] params = pinstance.getParameters(); + + for (MPInstancePara para: params) + { + String columnName = para.getParameterName(); + String info = para.getInfo(); + String info_to = para.getInfo_To(); + + String name = getElementName(columnName, trxName); + + StringBuffer value = new StringBuffer(); + + if (info != null) + { + value.append(info); + + if (info_to != null) + { + value.append("-").append(info_to); + } + map.put(name, value.toString()); + } + } + + + return map; + } + + /** + * + * @param columnName + * @param trxName + * @return + */ + private static String getElementName(String columnName, String trxName) + { + String adElementName = null; + String sql = "SELECT name from AD_Element where columnName = '" + columnName +"'"; + + PreparedStatement pstmt = null; + ResultSet rs = null; + + try + { + pstmt = DB.prepareStatement(sql, trxName); + rs = pstmt.executeQuery(); + + if (rs.next()) + { + adElementName = rs.getString(1); + } + } + catch (SQLException e) + { + + } + finally + { + DB.close(rs, pstmt); + pstmt = null; + rs = null; + } + + return adElementName; + } + + /** + * Return an HTML version of close till report + * @param ctx + * @param tillBean + * @param cashBean + * @return + */ + public static String endOfTheDayHTMLReport(Properties ctx, CloseTillBean bean) { + + double beginningBalance = (bean.getBeginningBalance() == null ? 0 + : bean.getBeginningBalance().doubleValue()); + double statementDifference = (bean.getNetCashTrx() == null ? 0 + : bean.getNetCashTrx().doubleValue()); + double transferAmount = (bean.getBalanceEntered() == null ? 0 + : bean.getBalanceEntered().doubleValue()); + double differenceAmount = (bean.getDifference() == null ? 0 + : bean.getDifference().doubleValue()); + double endingBalance = (bean.getEndingBalance() == null ? 0 + : bean.getEndingBalance().doubleValue()); + double tillCashTotal = (bean.getCashTotal() == null ? 0 : bean + .getCashTotal().doubleValue()); + double cashBeanCardTotal = (bean.getCardTotal() == null ? 0 + : bean.getCardTotal().doubleValue()); + double tillCardTotal = (bean.getCardTotal() == null ? 0 : bean + .getCardTotal().doubleValue()); + double cardDifference = (bean.getCardDifference() == null ? 0 + : bean.getCardDifference().doubleValue()); + double cashBeanChequeTotal = (bean.getChequeTotal() == null ? 0 + : bean.getChequeTotal().doubleValue()); + double tillChequeTotal = (bean.getChequeTotal() == null ? 0 + : bean.getChequeTotal().doubleValue()); + double chequeDifference = (bean.getChequeDifference() == null ? 0 + : bean.getChequeDifference().doubleValue()); + double grandTotal = (bean.getGrandTotal() == null ? 0 + : bean.getGrandTotal().doubleValue()); + + + SimpleDateFormat sdf = new SimpleDateFormat(TimestampConvertor.DEFAULT_DATE_PATTERN1); + // String currency = + // POSTerminalManager.getPOSDefaultCurrency(ctx).getCurSymbol(); + Date today = new Date(System.currentTimeMillis()); + StringBuffer reportData = new StringBuffer(); + + String title = "

    End of the Day Report

    "; + String subtitle = "

    " + sdf.format(today) + "

    "; + + // adding title + reportData.append(title); + + // adding subtitle + reportData.append(subtitle); + + // adding space + reportData.append("
    "); + + // adding report data + int maxwidth = 40; + int column1 = 20; + int column2 = maxwidth - column1; + + String format1 = "%1$-" + column1 + "s%2$" + column2 + "s%n"; // string,string + String format2 = "%1$-" + column1 + "s%2$" + column2 + ".2f%n"; // string,bigdecimal + + String tillNoTxt = String.format(format1, "Till No", bean.getTillName()); + String beginningBalanceTxt = String.format(format2, "Beginning Balance",beginningBalance); + String netCashTrxTxt = String.format(format2, "Net Cash Trx", statementDifference); + String tillBalanceEnteredTxt = String.format(format2, "Till Balance Entered", transferAmount); + String differenceTxt = String.format(format2, "Difference", differenceAmount); + String endingBalanceTxt = String.format(format2, "Ending Balance", endingBalance); + String cashTotalTxt = String.format(format2, "Cash Total", tillCashTotal); + String cardTotalTxt = String.format(format2, "Card Total", tillCardTotal); + String chequeTotalTxt = String.format(format2, "Cheque Total", tillChequeTotal); + String grandTotalTxt = String.format(format2, "Grand Total", grandTotal); + + // some new lines + // String cashEntered = String.format(format1, "Cash Amt Entered", + String cardEnteredTxt = String.format(format2, "Card Amt Entered",cashBeanCardTotal); + String cardDifferenceTxt = String.format(format2, "Card Difference",cardDifference); + String chequeEnteredTxt = String.format(format2, "Cheque Amt Entered",cashBeanChequeTotal); + String chequeDifferenceTxt = String.format(format2, "Cheque Difference",chequeDifference); + + reportData.append(tillNoTxt) + .append(beginningBalanceTxt) + .append(netCashTrxTxt) + .append(tillBalanceEnteredTxt) + .append(differenceTxt) + .append(endingBalanceTxt) + // .append(cashEntered) + .append(cashTotalTxt) + .append(cardEnteredTxt) + .append(cardTotalTxt) + .append(cardDifferenceTxt) + .append(chequeEnteredTxt) + .append(chequeTotalTxt) + .append(chequeDifferenceTxt) + .append(grandTotalTxt) + .append("
    "); + + return reportData.toString(); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/performanceanalysis/POSSalesReportManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/performanceanalysis/POSSalesReportManager.java new file mode 100644 index 0000000000..6fcf741c38 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/businesslogic/performanceanalysis/POSSalesReportManager.java @@ -0,0 +1,1049 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * 17-Jul-2006 14:15:12 by praveen + * + */ + +package org.posterita.businesslogic.performanceanalysis; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Timestamp; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.Properties; +import java.util.TreeMap; + +import org.compiere.model.MBPartner; +import org.compiere.model.MCashLine; +import org.compiere.model.MInvoice; +import org.compiere.model.MOrder; +import org.compiere.model.MPayment; +import org.compiere.model.MPriceList; +import org.compiere.model.MTransaction; +import org.compiere.util.DB; +import org.compiere.util.Env; +import org.posterita.Constants; +import org.posterita.beans.POSHistoryBean; +import org.posterita.beans.ReportBean; +import org.posterita.beans.SalesDetailsBean; +import org.posterita.beans.UDIPair; +import org.posterita.beans.WebOrderLineBean; +import org.posterita.businesslogic.OrderManager; +import org.posterita.businesslogic.POSManager; +import org.posterita.businesslogic.POSTerminalManager; +import org.posterita.businesslogic.administration.PriceListManager; +import org.posterita.businesslogic.administration.WarehouseManager; +import org.posterita.core.TimestampConvertor; +import org.posterita.exceptions.OperationException; +import org.posterita.lib.UdiConstants; +import org.posterita.order.UDIOrderTypes; + +public class POSSalesReportManager +{ + public static ArrayList getSalesGroupList(Properties ctx,ReportBean bean) throws OperationException + { + ArrayList groupList = new ArrayList(); + groupList.add(new UDIPair("Revenue Recognition",Constants.REVENUE_RECOGNITION)); + groupList.add(new UDIPair("Product",Constants.PRODUCT)); + groupList.add(new UDIPair("Customer",Constants.CUSTOMER)); + groupList.add(new UDIPair("AttributeSet",Constants.ATTRIBUTESET)); + groupList.add(new UDIPair("Group1",Constants.GROUP1)); + groupList.add(new UDIPair("Group2",Constants.GROUP2)); + + // String fromDate = null; + // String toDate = null; + + if(bean.getDateRange().equalsIgnoreCase(Constants.FIXED_DATE_RANGE)) + { + if(bean.getTimePeriod() == null) + { + throw new OperationException("Invalid parameter: timeperiod is null"); + } + + //Date startDate = + ReportDateManager.getStartDateForPeriod(bean.getTimePeriod()); + //Date endDate = + ReportDateManager.getEndDateForPeriod(bean.getTimePeriod()); + + //SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss"); + //fromDate = sdf.format(startDate); + //toDate = sdf.format(endDate); + } + else + { + //fromDate = BirtReportManager.getFromDate(bean); + // toDate = BirtReportManager.getToDate(bean); + } + + int ad_client_id = Env.getAD_Client_ID(ctx); + + if(bean.getAccountId()==null) + { + throw new OperationException("Invalid parameter value : accountId->" + bean.getAccountId()); + } + + int account_id = bean.getAccountId().intValue(); + + String sql = "select distinct attrSet.NAME as ATTRIBUTESET_NAME,attr.NAME as ATTRIBUTE_NAME,attrSet.M_ATTRIBUTESET_ID as ATTRIBUTESET_ID,attr.M_ATTRIBUTE_ID as ATTRIBUTE_ID " + + "from M_ATTRIBUTESETINSTANCE attrSetIns,M_PRODUCT prod,M_ATTRIBUTESET attrSet,M_ATTRIBUTEUSE attrUse,M_ATTRIBUTE attr,FACT_ACCT fact " + + "where prod.M_ATTRIBUTESETINSTANCE_ID = attrSetIns.M_ATTRIBUTESETINSTANCE_ID " + + "and attrSet.M_ATTRIBUTESET_ID = attrSetIns.M_ATTRIBUTESET_ID " + + "and attrUse.M_ATTRIBUTESET_ID = attrSet.M_ATTRIBUTESET_ID " + + "and attr.M_ATTRIBUTE_ID = attrUse.M_ATTRIBUTE_ID " + + "and fact.M_PRODUCT_ID = prod.M_PRODUCT_ID " + + "and fact.account_id = " + + "(select C_ELEMENTVALUE_ID from C_ELEMENTVALUE where value = ? and AD_CLIENT_ID = ? ) " + + "and fact.AD_CLIENT_ID = ? "; + + PreparedStatement pstmt = DB.prepareStatement(sql,null); + + try + { + pstmt.setString(1,account_id+""); + pstmt.setInt(2,ad_client_id); + pstmt.setInt(3,ad_client_id); + + ArrayList data = ReportManager.getReportData(pstmt,false); + String attributeSetName = null; + String attributeSetId = null; + String attributeName = null; + String attributeId = null; + + for (Object[] objects : data) + { + attributeSetName = objects[0]+""; + attributeName = objects[1]+""; + + attributeSetId = objects[2]+""; + attributeId = objects[3]+""; + + groupList.add(new UDIPair(attributeSetName+"_"+attributeName,attributeSetId+"_"+attributeId)); + } + } + catch (SQLException e) + { + throw new OperationException(e); + } + + return groupList; + } + + public static ArrayList getPriceQtyFilter(Properties ctx) + { + ArrayList filter = new ArrayList(); + filter.add(new UDIPair("Price",Constants.PRICE)); + filter.add(new UDIPair("Quantity",Constants.QUANTITY)); + + return filter; + } + + //-------------------------------------------------------------------------------------- + public static ArrayList getSalesOrPurchaseReportData(Properties ctx, ReportBean bean, String trxName) throws Exception + { + Timestamp startDate = null; + Timestamp endDate = null; + boolean isFullDetails = false; + + String isSalesRPT = bean.getIsSalesReport(); + Boolean isSalesReport = Boolean.valueOf(isSalesRPT); + String reportType = "SALES"; + String orderType = "POS Order"; + String returnedOrderType = "Customer Returned Order"; + String isSOTrx = "Y"; + + if(!(isSalesReport)) + { + reportType = "PURCHASES"; + orderType = "POS Goods Receive Note"; + returnedOrderType = "POS Goods Returned Note"; + isSOTrx = "N"; + } + + BigDecimal totalPayment = Env.ZERO; + + if (Constants.FULL_DETAILS.equals(bean.getFullDetails())) + { + isFullDetails = true; + + if(!(isSalesReport)) + { + isFullDetails = false; + } + } + + if(bean.getDateRange().equalsIgnoreCase(Constants.FIXED_DATE_RANGE)) + { + if(bean.getTimePeriod() == null) + { + throw new OperationException("Invalid parameter: timeperiod is null"); + } + + startDate = ReportDateManager.getStartDateForPeriod(bean.getTimePeriod()); + endDate = ReportDateManager.getEndDateForPeriod(bean.getTimePeriod()); + + } + else + { + startDate = ReportDateManager.getFromDateAsDate(bean); + endDate = ReportDateManager.getEndDateAsDate(bean); + } + int ad_client_id = Env.getAD_Client_ID(ctx); + + SalesDetailsBean sbean = null; + ArrayList salesList = new ArrayList(); + + //Purchase Price List + int purchasePriceListId = POSTerminalManager.getPOPriceListId(ctx); + Integer ppriceListVersionId = PriceListManager.getPriceListVersionID(ctx, purchasePriceListId, null); + MPriceList ppriceList = new MPriceList(ctx, purchasePriceListId, null); + StringBuffer sqlOrder = new StringBuffer(); + if(isSalesReport) + { + sqlOrder.append(" issotrx = 'Y'"); + } + else + { + sqlOrder.append(" issotrx = 'N'"); + } + + sqlOrder.append(" and c_pos_id=").append(Env.getContextAsInt(ctx, UdiConstants.TERMINAL_ID)); + sqlOrder.append(" and docstatus in ('CO','CL')"); + + if(isSalesReport) + { + sqlOrder.append(" and ordertype in ('POS Order','Credit Order','Customer Returned Order')"); + } + else + { + sqlOrder.append(" and ordertype in ('").append(orderType).append("','").append(returnedOrderType).append("') "); + } + + sqlOrder.append(" and ad_client_id = ").append(ad_client_id); + sqlOrder.append(" and dateacct between ").append(DB.TO_DATE(startDate, false)); + sqlOrder.append(" and ").append(DB.TO_DATE(endDate, false)); + sqlOrder.append(" and ad_org_id =").append(Env.getAD_Org_ID(ctx)); + sqlOrder.append(" order by dateacct"); + + // Get All Orders + int[] orderId = MOrder.getAllIDs(MOrder.Table_Name, sqlOrder.toString(), null); + + if(orderId != null) + { + + for (int c_order_id : orderId) + { + sbean = new SalesDetailsBean(); + BigDecimal productCost = Env.ZERO; + BigDecimal totalProductCosts = Env.ZERO; + BigDecimal taxAmt = Env.ZERO; + BigDecimal totalTaxAmt = Env.ZERO; + BigDecimal salesExempt = Env.ZERO; + BigDecimal totalSalesExempt = Env.ZERO; + BigDecimal salesExcVat = Env.ZERO; + BigDecimal totalSalesExcVat = Env.ZERO; + BigDecimal creditNoteExcVat = Env.ZERO; + BigDecimal totalCreditNoteExcVat = Env.ZERO; + BigDecimal creditNoteExempt = Env.ZERO; + BigDecimal totalCreditNoteExempt = Env.ZERO; + BigDecimal purchasesExempt = Env.ZERO; + BigDecimal totalPurchasesExempt = Env.ZERO; + BigDecimal purchasesExcVat = Env.ZERO; + BigDecimal totalPurchasesExcVat = Env.ZERO; + BigDecimal debitNoteExcVat = Env.ZERO; + BigDecimal totalDebitNoteExcVat = Env.ZERO; + BigDecimal debitNoteExempt = Env.ZERO; + BigDecimal totalDebitNoteExempt = Env.ZERO; + + MOrder order = new MOrder(ctx, c_order_id, null); + sbean.setOrderId(c_order_id); + sbean.setOrderType(order.getOrderType()); + sbean.setLinesTotals(order.getTotalLines()); + sbean.setBPartnerId(order.getC_BPartner_ID()); + sbean.setDate(order.getDateAcct()); + + ArrayList list = POSManager.populateOrderLines(ctx, order); + + for (WebOrderLineBean webOrderLineBean : list) + { + sbean.setGrandTotals(webOrderLineBean.getGrandTotal()); + sbean.setLinesTotals(webOrderLineBean.getTotalAmt()); + + taxAmt = webOrderLineBean.getTaxAmt(); + + if(taxAmt.equals(Env.ZERO)) + { + + if(order.getOrderType().equals(UDIOrderTypes.POS_ORDER.getOrderType())) + { + salesExempt = webOrderLineBean.getLineTotalAmt().subtract(taxAmt); + salesExcVat = Env.ZERO; + } + + if(order.getOrderType().equals(UDIOrderTypes.CUSTOMER_RETURN_ORDER.getOrderType())) + { + salesExempt = webOrderLineBean.getLineTotalAmt().subtract(taxAmt).negate(); + taxAmt = taxAmt.negate(); + salesExcVat = Env.ZERO; + } + + if(order.getOrderType().equals(UDIOrderTypes.CREDIT_ORDER.getOrderType())) + { + creditNoteExempt = webOrderLineBean.getLineTotalAmt().subtract(taxAmt); + creditNoteExcVat = Env.ZERO; + } + + if(order.getOrderType().equals(UDIOrderTypes.POS_GOODS_RECEIVE_NOTE.getOrderType())) + { + purchasesExempt = webOrderLineBean.getLineTotalAmt().subtract(taxAmt); + purchasesExcVat = Env.ZERO; + } + + if(order.getOrderType().equals(UDIOrderTypes.POS_GOODS_RETURN_NOTE.getOrderType())) + { + debitNoteExempt = webOrderLineBean.getLineTotalAmt().subtract(taxAmt); + debitNoteExcVat = Env.ZERO; + } + + } + else + { + if(order.getOrderType().equals(UDIOrderTypes.POS_ORDER.getOrderType())) + { + salesExempt = Env.ZERO; + salesExcVat = webOrderLineBean.getLineTotalAmt().subtract(taxAmt); + } + + if(order.getOrderType().equals(UDIOrderTypes.CUSTOMER_RETURN_ORDER.getOrderType())) + { + salesExempt = Env.ZERO; + salesExcVat = webOrderLineBean.getLineTotalAmt().subtract(taxAmt).negate(); + taxAmt = taxAmt.negate(); + } + + if(order.getOrderType().equals(UDIOrderTypes.CREDIT_ORDER.getOrderType())) + { + creditNoteExempt = Env.ZERO; + creditNoteExcVat = webOrderLineBean.getLineTotalAmt().subtract(taxAmt); + } + + if(order.getOrderType().equals(UDIOrderTypes.POS_GOODS_RECEIVE_NOTE.getOrderType())) + { + purchasesExcVat = webOrderLineBean.getLineTotalAmt().subtract(taxAmt); + purchasesExempt = Env.ZERO; + } + + if(order.getOrderType().equals(UDIOrderTypes.POS_GOODS_RETURN_NOTE.getOrderType())) + { + debitNoteExcVat = webOrderLineBean.getLineTotalAmt().subtract(taxAmt); + debitNoteExempt = Env.ZERO; + } + } + + if(order.getOrderType().equals(UDIOrderTypes.CUSTOMER_RETURN_ORDER.getOrderType())) + { + productCost = webOrderLineBean.getPurchasePriceList().negate().multiply(webOrderLineBean.getQtyOrdered()); + } + else + { + productCost = webOrderLineBean.getPurchasePriceList().multiply(webOrderLineBean.getQtyOrdered()); + } + + totalTaxAmt = totalTaxAmt.add(taxAmt); + totalProductCosts = totalProductCosts.add(productCost); + totalSalesExempt = totalSalesExempt.add(salesExempt); + totalSalesExcVat = totalSalesExcVat.add(salesExcVat); + totalCreditNoteExcVat = totalCreditNoteExcVat.add(creditNoteExcVat); + totalCreditNoteExempt = totalCreditNoteExempt.add(creditNoteExempt); + totalPurchasesExcVat = totalPurchasesExcVat.add(purchasesExcVat); + totalPurchasesExempt = totalPurchasesExempt.add(purchasesExempt); + } + + sbean.setTotalTaxAmount(totalTaxAmt); + sbean.setTotalCosts(totalProductCosts); + sbean.setSalesExempt(totalSalesExempt); + sbean.setSalesExcVat(totalSalesExcVat); + sbean.setCreditNoteExcVat(totalCreditNoteExcVat); + sbean.setCreditNoteExempt(totalCreditNoteExempt); + sbean.setPurchasesExcVat(totalPurchasesExcVat); + sbean.setPurchasesExempt(totalPurchasesExempt); + sbean.setDebitNoteExcVat(totalDebitNoteExcVat); + sbean.setDebitNoteExempt(totalDebitNoteExempt); + + sbean.setCashAmount(Env.ZERO); + sbean.setCardAmount(Env.ZERO); + sbean.setChequeAmount(Env.ZERO); + + if (order.getPaymentRule().equals(MOrder.PAYMENTRULE_Cash) || order.getPaymentRule().equals(MOrder.PAYMENTRULE_Mixed)) + { + MInvoice invoice = MInvoice.get(ctx, order.getC_Invoice_ID()); + MCashLine cashLine = new MCashLine(ctx, invoice.getC_CashLine_ID(), null); + if (cashLine.getC_CashLine_ID() != 0) + { + sbean.setCashAmount(cashLine.getAmount()); + } + } + + if(order.getPaymentRule().equals(MOrder.PAYMENTRULE_Check) || order.getPaymentRule().equals(MOrder.PAYMENTRULE_CreditCard) || order.getPaymentRule().equals(MOrder.PAYMENTRULE_Mixed)) + { + int[] payIds = MPayment.getAllIDs(MPayment.Table_Name, "C_Invoice_ID = " + order.getC_Invoice_ID(), null); + for (int payId : payIds) + { + MPayment payment = new MPayment(ctx, payId, null); + + if (payment.get_ID() != 0) + { + if(payment.getTenderType().equals(MPayment.TENDERTYPE_CreditCard)) + { + sbean.setCardAmount(payment.getPayAmt()); + } + + if(payment.getTenderType().equals(MPayment.TENDERTYPE_Check)) + { + sbean.setChequeAmount(payment.getPayAmt()); + } + } + } + } + + totalPayment = sbean.getCardAmount().add(sbean.getCashAmount()).add(sbean.getChequeAmount()); + sbean.setTotal(totalPayment); + + salesList.add(sbean); + + } + + TreeMap map = new TreeMap(); + for(SalesDetailsBean salesBean : salesList) + { + Timestamp date = salesBean.getDate(); + SalesDetailsBean myDetailsBean = map.get(date); + if(myDetailsBean == null) + { + myDetailsBean = salesBean; + } + else + { + //merge myDetailsBean and salesBean + BigDecimal salesExcVat = myDetailsBean.getSalesExcVat().add(salesBean.getSalesExcVat()); + BigDecimal salesExempt = myDetailsBean.getSalesExempt().add(salesBean.getSalesExempt()); + BigDecimal totalCosts = myDetailsBean.getTotalCosts().add(salesBean.getTotalCosts()); + BigDecimal total = myDetailsBean.getTotal().add(salesBean.getTotal()); + BigDecimal totalTaxAmount = myDetailsBean.getTotalTaxAmount().add(salesBean.getTotalTaxAmount()); + BigDecimal creditNoteExcVat = myDetailsBean.getCreditNoteExcVat().add(salesBean.getCreditNoteExcVat()); + BigDecimal creditNoteExempt = myDetailsBean.getCreditNoteExempt().add(salesBean.getCreditNoteExempt()); + BigDecimal purchasesExcVat = myDetailsBean.getPurchasesExcVat().add(salesBean.getPurchasesExcVat()); + BigDecimal purchasesExempt = myDetailsBean.getPurchasesExempt().add(salesBean.getPurchasesExempt()); + BigDecimal debitNoteExcVat = myDetailsBean.getDebitNoteExcVat().add(salesBean.getDebitNoteExempt()); + BigDecimal debitNoteExempt = myDetailsBean.getDebitNoteExempt().add(salesBean.getDebitNoteExempt()); + + myDetailsBean.setDate(date); + myDetailsBean.setSalesExcVat(salesExcVat); + myDetailsBean.setSalesExempt(salesExempt); + myDetailsBean.setTotalCosts(totalCosts); + myDetailsBean.setTotal(total); + myDetailsBean.setTotalTaxAmount(totalTaxAmount); + myDetailsBean.setCreditNoteExcVat(creditNoteExcVat); + myDetailsBean.setCreditNoteExempt(creditNoteExempt); + myDetailsBean.setPurchasesExcVat(purchasesExcVat); + myDetailsBean.setPurchasesExempt(purchasesExempt); + myDetailsBean.setDebitNoteExcVat(debitNoteExcVat); + myDetailsBean.setDebitNoteExempt(debitNoteExempt); + } + + map.put(date, myDetailsBean); + + } + + salesList = new ArrayList(); + salesList.addAll(map.values()); + } + + + + ArrayList reportData = new ArrayList(); + + String note = ""; + if(isSalesReport) + { + note = "CREDIT NOTE "; + } + else + { + note = "DEBIT NOTE "; + } + + Object[] headers = { + "DATE", + reportType + " EXCL VAT", + note + "EXCL VAT", + "EXEMPT " + reportType, + "EXEMPT " + note, + "VAT", + "NET TOTAL " + reportType + }; + Object[] totals = { + "TOTAL", + Env.ZERO, + Env.ZERO, + Env.ZERO, + Env.ZERO, + Env.ZERO, + Env.ZERO + }; + + if (isFullDetails) + { + headers = new Object[]{ + "DATE", + reportType + " EXCL VAT", + note + "EXCL VAT", + "EXEMPT " + reportType, + "EXEMPT " + note, + "VAT", + "NET TOTAL " + reportType, + "COST", + "PROFIT", + "GP %" + }; + totals = new Object[]{ + "TOTAL", + Env.ZERO, + Env.ZERO, + Env.ZERO, + Env.ZERO, + Env.ZERO, + Env.ZERO, + Env.ZERO, + Env.ZERO, + Env.ZERO + }; + + } + + // add header + reportData.add(headers); + + + BigDecimal grossProfit = Env.ZERO; + + for (SalesDetailsBean sdBean : salesList) + { + String date = sdBean.getDate().toString(); + BigDecimal salesOrPurchasesEV = Env.ZERO; + + if(isSalesReport) + { + salesOrPurchasesEV = sdBean.getSalesExcVat(); + } + else + { + salesOrPurchasesEV = sdBean.getPurchasesExcVat(); + } + BigDecimal creditOrDebitNEV = Env.ZERO; + + if(isSalesReport) + { + creditOrDebitNEV = sdBean.getCreditNoteExcVat(); + } + else + { + creditOrDebitNEV = sdBean.getDebitNoteExcVat(); + } + + BigDecimal exemptSalesOrPurchases = Env.ZERO; + + if(isSalesReport) + { + exemptSalesOrPurchases = sdBean.getSalesExempt(); + } + else + { + exemptSalesOrPurchases = sdBean.getPurchasesExempt(); + } + + BigDecimal exemptCNOrDN = Env.ZERO; + if(isSalesReport) + { + exemptCNOrDN = sdBean.getCreditNoteExempt(); + } + else + { + exemptCNOrDN = sdBean.getDebitNoteExempt(); + } + + BigDecimal vat = sdBean.getTotalTaxAmount(); + BigDecimal total = salesOrPurchasesEV.add(vat).add(exemptSalesOrPurchases).add(creditOrDebitNEV).add(exemptCNOrDN); + BigDecimal cost = sdBean.getTotalCosts(); + BigDecimal payAmt = sdBean.getTotal(); + cost = cost.setScale(total.scale(), RoundingMode.HALF_DOWN); + BigDecimal profit = total.subtract(cost); + + if (total.doubleValue() != 0.0f) + { + double prof = profit.doubleValue(); + double tots = total.doubleValue(); + grossProfit = new BigDecimal(prof/tots*100.0); + grossProfit = grossProfit.setScale(2, RoundingMode.HALF_UP); + } + Object[] data = null; + + if (isFullDetails) + { + data = new Object[]{ + date, + salesOrPurchasesEV, + creditOrDebitNEV, + exemptSalesOrPurchases, + exemptCNOrDN, + vat, + total, + cost, + profit, + grossProfit + }; + } + else + { + data = new Object[]{ + date, + salesOrPurchasesEV, + creditOrDebitNEV, + exemptSalesOrPurchases, + exemptCNOrDN, + vat, + total + }; + } + + reportData.add(data); + + //update totals + totals[1] = ((BigDecimal)totals[1]).add(salesOrPurchasesEV); + totals[2] = ((BigDecimal)totals[2]).add(creditOrDebitNEV); + totals[3] = ((BigDecimal)totals[3]).add(exemptSalesOrPurchases); + totals[4] = ((BigDecimal)totals[4]).add(exemptCNOrDN); + totals[5] = ((BigDecimal)totals[5]).add(vat); + totals[6] = ((BigDecimal)totals[6]).add(total); + + if (isFullDetails) + { + totals[7] = ((BigDecimal)totals[7]).add(cost); + totals[8] = ((BigDecimal)totals[8]).add(profit); + totals[9] = ((BigDecimal)totals[9]).add(grossProfit); + } + } + if (isFullDetails) + { + BigDecimal salesTotal = ((BigDecimal)totals[1]).add((BigDecimal)totals[2]).add((BigDecimal)totals[3]).add((BigDecimal)totals[4]).add((BigDecimal)totals[5]); + + if (salesTotal.doubleValue() != 0f) + { + double prof = ((BigDecimal)totals[8]).doubleValue(); + double tots = ((BigDecimal)salesTotal).doubleValue(); + grossProfit = new BigDecimal(prof/tots*100.0); + totals[9] = grossProfit.setScale(2, RoundingMode.HALF_UP); + } + } + + + reportData.add(totals); + + return reportData; + + } + + public static ArrayList getDetailedSalesReport(Properties ctx, String salesType, boolean isSalesReport, Timestamp date1, Timestamp date2, String trxName) throws OperationException + { + + + String sql = "select ord.C_ORDER_ID," + // 1 + " ord.dateordered," + // 2 + " ord.grandtotal," + // 3 + " ord.DOCUMENTNO," + // 4 + " (name || ' ' || COALESCE(name2,trim(' '))) as name, " + // 5 + " ord.docStatus, " + // 6 + " ord.paymentrule," + // 7 + " bp.C_BPARTNER_ID," + // 8 + " bp.isCustomer," + // 9 + " ord.ORDERTYPE " + // 10 + " from c_order ord,C_BPARTNER bp" + + " where ord.C_BPARTNER_ID=bp.C_BPARTNER_ID" + + " and ord.docStatus in ('CL', 'CO')" + + " and ord.AD_ORG_ID=" + Env.getAD_Org_ID(ctx) + + " and ord.AD_CLIENT_ID=" + Env.getAD_Client_ID(ctx) + + " and ord.isActive='Y'"; + + if("1".equals(salesType)) + { + if(isSalesReport) + { + sql = sql + " and ord.totallines <> ord.grandtotal and ord.ordertype in ('POS Order','Credit Order')"; + } + else + { + sql = sql + " and ord.totallines <> ord.grandtotal and ord.ordertype in ('POS Goods Receive Note')"; + } + } + + if("2".equals(salesType)) + { + if(isSalesReport) + { + sql = sql + " and ord.totallines <> ord.grandtotal and ord.ordertype in ('Customer Returned Order')"; + } + else + { + sql = sql + " and ord.totallines <> ord.grandtotal and ord.ordertype in ('POS Goods Returned Note')"; + } + } + + if("3".equals(salesType)) + { + if(isSalesReport) + { + sql = sql + " and ord.totallines <> ord.grandtotal and ord.ordertype in ('POS Order','Credit Order')"; + } + else + { + sql = sql + " and ord.totallines <> ord.grandtotal and ord.ordertype in ('POS Goods Receive Note')"; + } + } + + if("4".equals(salesType)) + { + if(isSalesReport) + { + sql = sql + " and ord.totallines <> ord.grandtotal and ord.ordertype in ('Customer Returned Order')"; + } + else + { + sql = sql + " and ord.totallines <> ord.grandtotal and ord.ordertype in ('POS Goods Returned Note')"; + } + } + + sql = sql + " and ord.dateordered between "+ DB.TO_DATE(date1, false)+ " and "+ DB.TO_DATE(date2, false); + + sql = sql + " order by ord.created desc"; + + PreparedStatement pstmt = null; + ResultSet rs = null; + POSHistoryBean bean = null; + ArrayList list = new ArrayList(); + + try + { + pstmt = DB.prepareStatement(sql, trxName); + rs = pstmt.executeQuery(); + + while (rs.next()) + { + int c_order_id = rs.getInt(1); + bean = new POSHistoryBean(); + bean.setOrderId(c_order_id); + bean.setDateAcct(rs.getTimestamp(2)); + bean.setOrderGrandTotal(rs.getBigDecimal(3)); + bean.setDocumentNo(rs.getString(4)); + bean.setPartnerName(rs.getString(5)); + bean.setDocStatus(rs.getString(6)); + bean.setPaymentRule(rs.getString(7)); + bean.setBpartnerId(rs.getInt(8)); + bean.setIsCustomer("Y".equals(rs.getString(9)) ? true : false); + bean.setOrderType(rs.getString(10)); + + MOrder order = new MOrder(ctx, c_order_id, trxName); + MInvoice invoice = MInvoice.get(ctx, order.getC_Invoice_ID()); + BigDecimal amountPaid = Env.ZERO; + if (invoice.getC_CashLine_ID() != 0) + { + MCashLine cashLine = new MCashLine(ctx, invoice.getC_CashLine_ID(), trxName); + amountPaid = cashLine.getAmount(); + } + int[] payIds = MPayment.getAllIDs(MPayment.Table_Name, "C_Invoice_ID = " + invoice.get_ID() + + " AND AD_Client_ID = " + Env.getAD_Client_ID(ctx), trxName); + if (payIds != null && payIds.length != 0) + { + for (int payId : payIds) + { + MPayment payment = new MPayment(ctx, payId, trxName); + amountPaid = amountPaid.add(payment.getPayAmt()); + } + } + amountPaid = amountPaid.setScale(2, RoundingMode.HALF_DOWN); + bean.setAmountPaid(amountPaid); + BigDecimal grossProfit = Env.ZERO.setScale(2, RoundingMode.HALF_DOWN); + + if ("1".equals(salesType) || "3".equals(salesType)) + { + grossProfit = getGrossProfit(ctx, c_order_id, date1, date2, trxName); + } + + if (grossProfit == null) + { + grossProfit = Env.ZERO; + } + + bean.setGrossProfit(grossProfit); + list.add(bean); + + } + + } catch (SQLException e) { + throw new OperationException( + "Could not retrieve order history with sql: " + sql, e); + } + finally + { + DB.close(rs, pstmt); + rs = null; + pstmt = null; + } + + return list; + + } + + private static BigDecimal getGrossProfit(Properties ctx, int c_order_id, Timestamp date1, Timestamp date2, String trxName) throws OperationException + { + + int poPriceListId = POSTerminalManager.getPOPriceListId(ctx); + int poPriceListVersionId = PriceListManager.getPriceListVersionID(ctx, poPriceListId, trxName); + + String sql = "select (l.qtyordered*(case when pp.pricelist is null then 0 else pp.pricelist end)) as cost, o.totallines as sales from" + + " c_order o inner join (c_orderline l left outer join m_productprice pp on" + + " (l.m_product_id = pp.m_product_id and pp.m_pricelist_version_id = " + poPriceListVersionId + ")) on" + + " o.c_order_id = l.c_order_id" + + " where o.issotrx = 'Y' " + + " and o.c_order_id = " + c_order_id + + " and o.docstatus in ('CO','CL')" + + " and o.C_Doctype_ID IN ('"+ OrderManager.getDocTypeFromOrderType(ctx, UDIOrderTypes.POS_ORDER.getOrderType(), true)+"')" + + " and o.ad_client_id = " + Env.getAD_Client_ID(ctx) + + " and o.ad_org_id = "+ Env.getAD_Org_ID(ctx) + + " and o.dateacct between " + DB.TO_DATE(date1, true)+ + " and "+ DB.TO_DATE(date2, true); + + PreparedStatement pstmt = null; + ResultSet rs = null; + BigDecimal grossProfit = Env.ZERO; + BigDecimal cost = Env.ZERO; + BigDecimal sales = Env.ZERO; + + try + { + pstmt = DB.prepareStatement(sql, trxName); + rs = pstmt.executeQuery(); + + while (rs.next()) + { + cost = cost.add(rs.getBigDecimal("cost")); + sales = rs.getBigDecimal("sales"); + } + + + + if (!sales.equals(Env.ZERO)) + { + BigDecimal profit = sales.subtract(cost); + + grossProfit = new BigDecimal(profit.doubleValue() / sales.doubleValue() * 100.0f); + } + else + { + grossProfit = BigDecimal.valueOf(0.0f); + } + } + catch (SQLException e) + { + throw new OperationException("Could not retrieve order history", e); + } + finally + { + DB.close(rs, pstmt); + rs = null; + pstmt = null; + } + + return grossProfit; + } + + + + public static HashMap getSalesByOrg(Properties ctx, Integer productId, Integer orgId, Timestamp fromDate, Timestamp toDate, String trxName) throws OperationException + { + + if (productId == null) + { + throw new OperationException("product Id is null, cannot search for sales by org for that product"); + } + + if (orgId == null) + { + throw new OperationException("org Id is null, cannot search for sales by org for that org"); + } + if (fromDate == null || toDate == null) + { + throw new OperationException("date cannot be null"); + } + + String locatorIds = WarehouseManager.getLocatorIds(ctx, orgId); + + StringBuffer sql = new StringBuffer("SELECT SUM(trx.movementQty), loc.AD_Org_ID") + .append(" FROM M_Transaction trx INNER JOIN M_Locator loc ON trx.M_Locator_ID = loc.M_Locator_ID") + .append(" WHERE trx.M_Product_ID = ? AND trx.M_Locator_ID IN (" + locatorIds + ")") + .append(" AND trx.movementDate BETWEEN " + DB.TO_DATE(fromDate, true) +" AND " + DB.TO_DATE(toDate, true)) + .append(" AND trx.movementType = ?") + .append(" GROUP BY loc.AD_Org_ID"); + + + PreparedStatement pstmt = null; + ResultSet rs = null; + HashMap orgSales = new HashMap(); + + try + { + pstmt = DB.prepareStatement(sql.toString(), trxName); + pstmt.setInt(1, productId); + pstmt.setString(2, MTransaction.MOVEMENTTYPE_CustomerShipment); + rs = pstmt.executeQuery(); + + while (rs.next()) + { + BigDecimal qty = rs.getBigDecimal(1); + Integer org_Id = rs.getInt(2); + + orgSales.put(org_Id, qty); + + } + } + catch (SQLException e) + { + throw new OperationException("could not retrieve sales by org from sql" + sql, e); + } + finally + { + DB.close(rs, pstmt); + rs = null; + pstmt = null; + } + + return orgSales; + + } + + public static ArrayList getOrderDetailsPerProduct(Properties ctx,boolean isSales, + String productId, String orgIds, Timestamp date1, Timestamp date2) throws OperationException + { + StringBuffer payAmtSql = new StringBuffer(); + payAmtSql.append(" (SELECT SUM(p.Amount) FROM"); + payAmtSql.append(" ((SELECT payAmt as Amount FROM C_Payment p") + .append(" WHERE p.C_Invoice_ID=inv.C_Invoice_ID AND p.DocStatus IN ('CO', 'CL'))"); + payAmtSql.append(" UNION"); + payAmtSql.append(" (SELECT Amount FROM C_CashLine cl") + .append(" WHERE (cl.c_Invoice_ID=inv.C_Invoice_ID))) as p)"); + + StringBuffer sql = new StringBuffer("select ord.C_ORDER_ID,") + .append("inv.documentNo, ") + .append("(CASE WHEN inv.C_Invoice_ID IS NULL THEN 0 ELSE ") + .append(payAmtSql.toString()).append(" END) PayAmt") + .append(" from (c_order ord inner join c_orderline ordl ") + .append(" on ord.c_order_id = ordl.c_order_id) inner join c_invoice inv on") + .append(" ord.c_order_id = inv.c_order_id") + .append(" where ord.docStatus in ('CL', 'CO')"); + if (isSales) + { + sql = sql.append(" and ord.orderType = '"+UDIOrderTypes.POS_ORDER.getOrderType()+"'"); + } + else + { + sql = sql.append(" and ord.orderType = '"+ UDIOrderTypes.POS_GOODS_RECEIVE_NOTE.getOrderType()+"'"); + } + + sql = sql.append(" and ord.AD_ORG_ID in (" + orgIds + ") and ord.AD_CLIENT_ID=" + Env.getAD_Client_ID(ctx)) + .append( " and ord.isActive='Y' and ordl.m_product_id = " + productId) + .append(" and ord.dateordered between "+DB.TO_DATE(date1, true)+" and " + DB.TO_DATE(date2, true)) + .append(" order by ord.created desc"); + + PreparedStatement pstmt = null; + ResultSet rs = null; + POSHistoryBean bean = null; + ArrayList list = new ArrayList(); + + try + { + pstmt = DB.prepareStatement(sql.toString(), null); + rs = pstmt.executeQuery(); + + while (rs.next()) + { + /*ReportBean bean = new ReportBean();*/ + bean = new POSHistoryBean(); + int orderId = rs.getInt(1); + String invoiceDocumentNo = rs.getString(2); + BigDecimal amountPaid = rs.getBigDecimal(3); + + MOrder order = new MOrder(ctx, orderId, null); + MBPartner partner = MBPartner.get(ctx, order.getC_BPartner_ID()); + bean.setOrderId(orderId); + bean.setDateAcct(order.getDateAcct()); + bean.setDateOrdered(order.getDateOrdered()); + bean.setOrderGrandTotal(order.getGrandTotal()); + bean.setDocumentNo(order.getDocumentNo()); + bean.setDocStatus(order.getDocStatus()); + bean.setPaymentRule(order.getPaymentRule()); + bean.setOrderType(order.getOrderType()); + bean.setOrgId(order.getAD_Org_ID()); + bean.setInvoiceDocumentNo(invoiceDocumentNo); + bean.setPartnerName(partner.getName()); + bean.setBpartnerId(partner.getC_BPartner_ID()); + bean.setIsCustomer(partner.isCustomer()); + bean.setAmountPaid(amountPaid); + BigDecimal grossProfit = Env.ZERO.setScale(2, RoundingMode.HALF_UP); + + grossProfit = getGrossProfit(ctx, orderId, date1, date2, null); + + if (grossProfit == null) + { + grossProfit = Env.ZERO; + } + + bean.setGrossProfit(grossProfit); + list.add(bean); + + } + + } catch (SQLException e) { + throw new OperationException( + "Could not retrieve sales details per product", e); + } + finally + { + DB.close(rs, pstmt); + rs = null; + pstmt = null; + } + + return list; + } + +} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/performanceanalysis/ReportDateManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/performanceanalysis/ReportDateManager.java new file mode 100644 index 0000000000..576876e1c7 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/businesslogic/performanceanalysis/ReportDateManager.java @@ -0,0 +1,260 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 19-Jul-2005 by alok + * + */ +package org.posterita.businesslogic.performanceanalysis; + +import java.sql.Timestamp; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; +import java.util.StringTokenizer; + +import org.jfree.date.SerialDate; + +import org.posterita.beans.ReportBean; +import org.posterita.core.TimestampConvertor; +import org.posterita.exceptions.InvalidDateTimeException; +import org.posterita.exceptions.InvalidMonthException; +import org.posterita.exceptions.OperationException; + +/** + * @author Praveen + * + * To change the template for this generated type comment go to + * Window - Preferences - Java - Code Style - Code Templates + */ +public class ReportDateManager +{ + + public static String getEquivalentMonth(String month) throws InvalidMonthException + { + int intMonth = Integer.parseInt(month); + + switch(intMonth) + { + case 1: + return "Jan"; + case 2: + return "Feb"; + case 3: + return "Mar"; + case 4: + return "Apr"; + case 5: + return "May"; + case 6: + return "Jun"; + case 7: + return "Jul"; + case 8: + return "Aug"; + case 9: + return "Sep"; + case 10: + return "Oct"; + case 11: + return "Nov"; + case 12: + return "Dec"; + + default: + throw new InvalidMonthException("Invalid Month"); + + } + + } + + + public static ReportBean formatDate(ReportBean bean) throws InvalidMonthException + { + String fromDate = bean.getFromDate(); + String toDate = bean.getToDate(); + String delimiter = "/"; + + String newFromDate = format(fromDate, delimiter); + String newToDate = format(toDate, delimiter); + bean.setFromDate(newFromDate); + bean.setToDate(newToDate); + + return bean; + + } + + + public static String format(String date, String delimiter) throws InvalidMonthException + { + String newDateFormatDelimiter = "-"; + StringTokenizer dateTokenizer = new StringTokenizer(date, delimiter); + + String day = dateTokenizer.nextToken(); + String month = dateTokenizer.nextToken(); + String year = dateTokenizer.nextToken(); + + String equiMonth = getEquivalentMonth(month); + + ///dd/mm/yyyy + String newDateFormat = day + + newDateFormatDelimiter + + equiMonth + + newDateFormatDelimiter + + year; + + return newDateFormat; + } + + public static Timestamp getStartDateForPeriod(String period) throws OperationException + { + Calendar cal = Calendar.getInstance(); + SerialDate serialDate = null; + + cal.set(Calendar.HOUR_OF_DAY,0); + cal.set(Calendar.MINUTE,0); + cal.set(Calendar.SECOND,0); + cal.set(Calendar.MILLISECOND,0); + + if(period.equalsIgnoreCase(TODAY)) + { + //return default + } + else if(period.equalsIgnoreCase(CURRENT_WEEK)) + { + int dayOfWeek = cal.get(Calendar.DAY_OF_WEEK); + int d = 1-dayOfWeek; + + serialDate = SerialDate.createInstance(cal.getTime()); + SerialDate s = SerialDate.addDays(d,serialDate); + cal.setTime(s.toDate()); + + } + else if(period.equalsIgnoreCase(LAST_2WEEKS)) + { + int dayOfWeek = cal.get(Calendar.DAY_OF_WEEK); + int d = 1-dayOfWeek-7; + + serialDate = SerialDate.createInstance(cal.getTime()); + SerialDate s = SerialDate.addDays(d,serialDate); + cal.setTime(s.toDate()); + } + else if(period.equalsIgnoreCase(LAST_3WEEKS)) + { + int dayOfWeek = cal.get(Calendar.DAY_OF_WEEK); + int d = 1-dayOfWeek-14; + + serialDate = SerialDate.createInstance(cal.getTime()); + SerialDate s = SerialDate.addDays(d,serialDate); + cal.setTime(s.toDate()); + } + else if(period.equalsIgnoreCase(CURRENT_MONTH)) + { + cal.set(Calendar.DATE,1); + } + else if(period.equalsIgnoreCase(LAST_3MONTHS)) + { + cal.set(Calendar.DATE,1); + serialDate = SerialDate.createInstance(cal.getTime()); + SerialDate s = SerialDate.addMonths(-2,serialDate); + cal.setTime(s.toDate()); + } + else if(period.equalsIgnoreCase(LAST_2MONTHS)) + { + cal.set(Calendar.DATE,1); + serialDate = SerialDate.createInstance(cal.getTime()); + SerialDate s = SerialDate.addMonths(-1,serialDate); + cal.setTime(s.toDate()); + } + else if(period.equalsIgnoreCase(LAST_6MONTHS)) + { + cal.set(Calendar.DATE,1); + serialDate = SerialDate.createInstance(cal.getTime()); + SerialDate s = SerialDate.addMonths(-5,serialDate); + cal.setTime(s.toDate()); + } + else if(period.equalsIgnoreCase(CURRENT_YEAR)) + { + cal.set(Calendar.DATE,1); + cal.set(Calendar.MONTH,0); + + } + else + { + throw new OperationException("Invalid Period Format - " + period); + } + + return new Timestamp(cal.getTimeInMillis()); + } + + public static Timestamp getEndDateForPeriod(String period) + { + Calendar cal = Calendar.getInstance(); + return new Timestamp(cal.getTimeInMillis()); + } + + public static final String TODAY = "Today"; + + public static final String CURRENT_WEEK = "Current Week"; + public static final String LAST_2WEEKS = "Last 2 Weeks"; + public static final String LAST_3WEEKS = "Last 3 Weeks"; + + public static final String CURRENT_MONTH = "Current Month"; + public static final String LAST_2MONTHS = "Last 2 months"; + public static final String LAST_3MONTHS = "Last 3 Months"; + public static final String LAST_6MONTHS = "Last 6 Months"; + + public static final String CURRENT_YEAR = "Current Year"; + + + public static Timestamp getFromDate(ReportBean reportBean) throws InvalidMonthException, InvalidDateTimeException + { + //String delimiter = "/"; + //String dateFrom = ReportDateManager.format(reportBean.getFromDate(),delimiter); + + String dateFrom = reportBean.getFromDate(); + String timeFrom = dateFrom + " " + reportBean.getStartHour() + ":" + reportBean.getStartMinute() + ":00"; + return TimestampConvertor.getTimestamp(timeFrom, TimestampConvertor.DEFAULT_DATE_PATTERN1); + } + + public static Timestamp getToDate(ReportBean reportBean) throws InvalidMonthException, InvalidDateTimeException + { + //String delimiter = "/"; + //String dateTo = ReportDateManager.format(reportBean.getToDate(),delimiter); + + String dateTo = reportBean.getToDate(); + String timeTo = dateTo + " " + reportBean.getEndHour() + ":" + reportBean.getEndMinute() + ":00"; + return TimestampConvertor.getTimestamp(timeTo, TimestampConvertor.DEFAULT_DATE_PATTERN1); + } + + public static Timestamp getFromDateAsDate(ReportBean bean) throws InvalidMonthException, ParseException, InvalidDateTimeException + { + Timestamp date = getFromDate(bean); + + return date; + } + + public static Timestamp getEndDateAsDate(ReportBean bean) throws InvalidMonthException, ParseException, InvalidDateTimeException + { + Timestamp date = getToDate(bean); + + return date; + } + + +} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/performanceanalysis/ReportManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/performanceanalysis/ReportManager.java new file mode 100644 index 0000000000..7e7719f698 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/businesslogic/performanceanalysis/ReportManager.java @@ -0,0 +1,263 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Feb 10, 2006 by praveen + * + */ +package org.posterita.businesslogic.performanceanalysis; + +import java.io.BufferedInputStream; +import java.io.BufferedOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.Properties; + +import javax.servlet.ServletContext; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.compiere.util.DB; +import org.compiere.util.MimeType; +import org.posterita.exceptions.OperationException; + +public class ReportManager +{ + + public static ArrayList getReportData(Properties ctx, PreparedStatement pstmt) throws OperationException + { + ResultSet rs = null; + + try + { + ArrayList reportData = new ArrayList(); + + rs = pstmt.executeQuery(); + + int columnCount = rs.getMetaData().getColumnCount(); + + Object[] data = null; + + + Object[] header = new Object[columnCount]; + Object[] columnType = new Object[columnCount]; + + for(int i = 0; i < columnCount; i++) + { + header[i] = rs.getMetaData().getColumnName(i+1); + columnType[i] = rs.getMetaData().getColumnTypeName(i+1); + } + + reportData.add(header); + + while(rs.next()) + { + data = new Object[columnCount]; + + for(int i = 0; i < columnCount; i++) + { + data[i] = rs.getObject(i+1); + } + + reportData.add(data); + } + + rs.close(); + + return reportData; + } + catch (Exception e) + { + throw new OperationException(e); + } + finally + { + try + { + pstmt.close(); + } + catch (Exception e) + {} + + pstmt = null; + } + + } + + public static ArrayList getReportData(Properties ctx, PreparedStatement pstmt, boolean columnHeader) throws OperationException + { + ResultSet rs = null; + + try + { + ArrayList reportData = new ArrayList(); + + rs = pstmt.executeQuery(); + + int columnCount = rs.getMetaData().getColumnCount(); + + Object[] data = null; + + + if(columnHeader) + { + Object[] header = new Object[columnCount]; + Object[] columnType = new Object[columnCount]; + + for(int i = 0; i < columnCount; i++) + { + header[i] = rs.getMetaData().getColumnName(i+1); + columnType[i] = rs.getMetaData().getColumnTypeName(i+1); + } + + reportData.add(header); + } + + + while(rs.next()) + { + data = new Object[columnCount]; + + for(int i = 0; i < columnCount; i++) + { + data[i] = rs.getObject(i+1); + } + + reportData.add(data); + } + + rs.close(); + + + return reportData; + } + catch (SQLException e) + { + throw new OperationException(e); + } + finally + { + try + { + pstmt.close(); + } + catch(Exception e) + {} + + pstmt = null; + } + + } + + public static ArrayList getReportData(PreparedStatement pstmt) throws OperationException + { + return getReportData(null,pstmt); + } + + public static ArrayList getReportData(PreparedStatement pstmt,boolean columnHeader) throws OperationException + { + return getReportData(null,pstmt,columnHeader); + } + + public static ArrayList getReportData(Properties ctx,String sql,boolean columnHeader) throws OperationException + { + PreparedStatement pstmt = DB.prepareStatement(sql,null); + + return getReportData(ctx,pstmt,columnHeader); + } + + public static ArrayList getReportData(Properties ctx,String sql) throws OperationException + { + PreparedStatement pstmt = DB.prepareStatement(sql,null); + + return getReportData(ctx,pstmt); + } + + public static String getReportDirectoryFromServletContext(HttpServlet servlet) + { + ServletContext context = servlet.getServletContext(); + String reportDirectory = context.getRealPath(context.getInitParameter("REPORT_DIRECTORY")) + System.getProperty("file.separator"); + + return reportDirectory; + } + + public static String getReportDirectory() + { + //String + return System.getProperty("java.io.tmpdir"); + } + + public static String getReportURI(String reportName,HttpServletRequest request) + { + //return request.getContextPath() + "/GetReportAction.do?reportName=" + reportName; + return request.getContextPath() + "/servlet/DisplayReportServlet/" + reportName; + } + + public static String getReportPath(String reportName) + { + String path = getReportDirectory() + System.getProperty("file.separator") + reportName; + + return path; + } + + public static void writeReport(String reportName, HttpServletResponse response) throws OperationException + { + String reportPath= getReportPath(reportName); + + File f = new File(reportPath); + + if(!f.exists()) + { + throw new OperationException("Unable to load " + reportName + ". Cause file not found."); + } + + String mimeType = null; + mimeType = MimeType.getMimeType(reportName); + + try + { + response.setContentType(mimeType); + + FileInputStream fis = new FileInputStream(f); + BufferedInputStream bis = new BufferedInputStream(fis); + BufferedOutputStream bos = new BufferedOutputStream(response.getOutputStream()); + + //Transfer bytes from bis to bos + byte[] buf = new byte[1024]; + int len; + while ((len = bis.read(buf)) > 0) + { + bos.write(buf, 0, len); + } + bis.close(); + + bos.flush(); + bos.close(); + + } + catch (Exception e) + { + throw new OperationException(e); + } + } + +} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/performanceanalysis/SalesAnalysisReportManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/performanceanalysis/SalesAnalysisReportManager.java new file mode 100644 index 0000000000..4800b08dcc --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/businesslogic/performanceanalysis/SalesAnalysisReportManager.java @@ -0,0 +1,791 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * 05-Jul-2006 13:45:44 by praveen + * + */ + +package org.posterita.businesslogic.performanceanalysis; + +import java.sql.PreparedStatement; +import java.sql.SQLException; +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.Properties; + +import org.compiere.model.MAttribute; +import org.compiere.model.MElementValue; +import org.compiere.util.DB; +import org.compiere.util.Env; +import org.posterita.Constants; +import org.posterita.exceptions.OperationException; + +public class SalesAnalysisReportManager +{ + public static String getCVSReport(Properties ctx,Timestamp fromDate,Timestamp toDate) throws OperationException + { + ArrayList reportDataSource = getReportData(ctx,fromDate,toDate); + + return CSVReportManager.generateCSVReport(ctx,reportDataSource); + } + + public static String getPDFReport(Properties ctx,String fromDate,String toDate) throws OperationException + { + return null; + } + + private static ArrayList getReportData(Properties ctx,Timestamp fromDate,Timestamp toDate) throws OperationException + { + ArrayList reportData = null; + String sql = getReportSQL(); + int ad_client_id = Env.getAD_Client_ID(ctx); + int ad_org_id = Env.getAD_Org_ID(ctx); + + PreparedStatement pstmt = DB.prepareStatement(sql,null); + + try + { + pstmt.setInt(1,ad_client_id); + pstmt.setInt(2,ad_org_id); + pstmt.setTimestamp(3,fromDate); + pstmt.setTimestamp(4,toDate); + + reportData = ReportManager.getReportData(ctx,pstmt); + + return reportData; + + } + catch (SQLException e) + { + throw new OperationException(e); + } + finally + { + pstmt=null; + } + } + + private static String getReportSQL() + { + String sql = "select bp.name as \"Supplier\"," + + "pc.name as \"Category\"," + + "attr_brand as \"Brand\"," + + "attr_model as \"Model\"," + + "attr_design as \"Design\"," + + "attr_colour as \"Colour\"," + + "attr_size as \"Size\"," + + "sum(ol.qtyordered) as \"Quantity\"," + + "sum(ol.LINENETAMT) as \"Amount\" "+ + "from c_orderline ol,c_order ord,u_tshirt_v v,c_bpartner bp,c_bpartner_product bpp,C_REVENUERECOGNITION pc,M_PRODUCT pr " + + "where ord.orderType='POS Order' " + + "and ol.c_order_id=ord.c_order_id " + + "and v.m_product_id=ol.m_product_id " + + "and ol.M_PRODUCT_ID=bpp.M_PRODUCT_ID " + + "and bpp.c_bpartner_id=bp.c_bpartner_id " + + "and ol.M_PRODUCT_ID=pr.M_PRODUCT_ID " + + "and ol.AD_CLIENT_ID=? " + + "and ol.AD_ORG_ID=? " + + "and pr.C_REVENUERECOGNITION_ID=pc.C_REVENUERECOGNITION_ID " + + "and ord.docstatus='CO' " + + "and ol.CREATED between to_date(?,'DD-MM-YYYY HH24:MI:SS') " + + "and to_date(?,'DD-MM-YYYY HH24:MI:SS') " + + "group by bp.name,pc.name,attr_brand,attr_model,attr_design,attr_colour,attr_size"; + + return sql; + } + + public static String getPieChartDataSetSQL(Properties ctx,int account_id,Timestamp fromDate,Timestamp toDate,String salesGroup) throws OperationException + { + return dataSetSQL(ctx,account_id,fromDate,toDate,salesGroup); + }//getPieChartDataSetSQL + + public static String getBarChartDataSetSQL(Properties ctx,int account_id,Timestamp fromDate,Timestamp toDate,String salesGroup) throws OperationException + { + return dataSetSQL(ctx,account_id,fromDate,toDate,salesGroup); + }//getBarChartDatasetSQL + + public static String getTabularDataSetSQL(Properties ctx,int account_id, Timestamp fromDate, Timestamp toDate,String salesGroup) throws OperationException + { + + int ad_client_id = Env.getAD_Client_ID(ctx); + String sql = null; + + + + //check account type + boolean isTaxDue = (account_id == Constants.TAX_DUE); + boolean isTaxCredit = (account_id == Constants.TAX_CREDIT); + boolean isProfitMargin = (account_id == Constants.PROFIT_MARGIN); + + final int TRADE_REVENUE = Constants.TRADE_REVENUE.intValue(); + final int COGS = Constants.COGS.intValue(); + + if(isProfitMargin) + { + String sql1 = getTabularDataSetSQL(ctx, TRADE_REVENUE, fromDate, toDate, salesGroup); + String sql2 = getTabularDataSetSQL(ctx, COGS, fromDate, toDate, salesGroup); + + sql2 = sql2.replace("SUM(0 - FACT.QTY)","SUM(FACT.QTY)"); + + if(salesGroup.equalsIgnoreCase(Constants.REVENUE_RECOGNITION)) + { + sql = "" + + "select rev.\"Revenue_Recognition\",rev.\"Date\",(rev.\"Value\" + co.\"Value\") as \"value\",rev.\"Qty\" from" + + "(" + sql1 + ") rev," + + "(" + sql2 + ") co " + + "where rev.\"Revenue_Recognition\" = co.\"Revenue_Recognition\" " + + "and co.\"Date\" = rev.\"Date\" " + + "and co.\"Qty\" = rev.\"Qty\""; + } + else if(salesGroup.equalsIgnoreCase(Constants.ATTRIBUTESET)) + { + sql = "" + + "select rev.\"Attributeset\",rev.\"Date\",(rev.\"Value\" + co.\"Value\") as \"value\",rev.\"Qty\" from" + + "(" + sql1 + ") rev," + + "(" + sql2 + ") co " + + "where rev.\"Attributeset\" = co.\"Attributeset\" " + + "and co.\"Date\" = rev.\"Date\" " + + "and co.\"Qty\" = rev.\"Qty\""; + } + else if(salesGroup.equalsIgnoreCase(Constants.PRODUCT)) + { + sql = "" + + "select rev.\"Product\",rev.\"Date\",(rev.\"Value\" + co.\"Value\") as \"value\",rev.\"Qty\" from" + + "(" + sql1 + ") rev," + + "(" + sql2 + ") co " + + "where rev.\"Product\" = co.\"Product\" " + + "and co.\"Date\" = rev.\"Date\" " + + "and co.\"Qty\" = rev.\"Qty\""; + } + else if(salesGroup.equalsIgnoreCase(Constants.GROUP1)) + { + sql = "" + + "select rev.\"Group1\",rev.\"Date\",(rev.\"Value\" + co.\"Value\") as \"value\",rev.\"Qty\" from" + + "(" + sql1 + ") rev," + + "(" + sql2 + ") co " + + "where rev.\"Group1\" = co.\"Group1\" " + + "and co.\"Date\" = rev.\"Date\" " + + "and co.\"Qty\" = rev.\"Qty\""; + } + else if(salesGroup.equalsIgnoreCase(Constants.GROUP2)) + { + sql = "" + + "select rev.\"Group2\",rev.\"Date\",(rev.\"Value\" + co.\"Value\") as \"value\",rev.\"Qty\" from" + + "(" + sql1 + ") rev," + + "(" + sql2 + ") co " + + "where rev.\"Group2\" = co.\"Group2\" " + + "and co.\"Date\" = rev.\"Date\" " + + "and co.\"Qty\" = rev.\"Qty\""; + } + else if(salesGroup.equalsIgnoreCase(Constants.CUSTOMER)) + { + sql = "" + + "select rev.\"Customer\",rev.\"Date\",(rev.\"Value\" + co.\"Value\") as \"value\",rev.\"Qty\" from" + + "(" + sql1 + ") rev," + + "(" + sql2 + ") co " + + "where rev.\"Customer\" = co.\"Customer\" " + + "and co.\"Date\" = rev.\"Date\" " + + "and co.\"Qty\" = rev.\"Qty\""; + } + else + { + String[] s = salesGroup.split("_"); + + if(s.length!=2) + { + throw new OperationException("Cannot generate sql. Unknown salesGroup parameter:"+salesGroup); + } + + int attributeId = Integer.parseInt(s[1]); + + String attributeName = new MAttribute(ctx,attributeId,null).getName(); + + sql = "" + + "select rev.\""+ attributeName +"\",rev.\"Date\",(rev.\"Value\" + co.\"Value\") as \"value\",rev.\"Qty\" from" + + "(" + sql1 + ") rev," + + "(" + sql2 + ") co " + + "where rev.\""+ attributeName +"\" = co.\""+ attributeName +"\" " + + "and co.\"Date\" = rev.\"Date\" " + + "and co.\"Qty\" = rev.\"Qty\""; + } + + + + return sql; + } + + if(isTaxCredit || isTaxDue) + { + int[] ids = MElementValue.getAllIDs(MElementValue.Table_Name,"AD_CLIENT_ID ="+ Env.getAD_Client_ID(ctx) + " AND VALUE ='"+ account_id + "'",null); + MElementValue elementValue = new MElementValue(ctx,ids[0],null); + String accountName = elementValue.getName(); + + sql = "" + + "select COALESCE(SUM(fact.AMTACCTDR - fact.AMTACCTCR), 0) as \""+ accountName +"\" " + + "from FACT_ACCT FACT where fact.ACCOUNT_ID = " + + "(select C_ELEMENTVALUE_ID from C_ELEMENTVALUE where value = '" + account_id + "' and AD_CLIENT_ID = "+ ad_client_id +") " + + "and fact.DATEACCT between " + + DB.TO_DATE(fromDate, false) + + " and " + + DB.TO_DATE(toDate, false) + + " and fact.AD_CLIENT_ID = " + ad_client_id; + + return sql; + } + + if(salesGroup.equalsIgnoreCase(Constants.REVENUE_RECOGNITION)) + { + sql = "" + + "select DECODE(rev.NAME, null, 'others', rev.Name) as \"Revenue_Recognition\"," + //1.Revenue Recognition + "to_char(fact.DATEACCT,'DD-MM-YYYY') as \"Date\"," + //2.Date + "SUM(fact.AMTACCTCR-fact.AMTACCTDR) as \"Value\"," + //3.Value + " SUM(0 - FACT.QTY) as \"Qty\" " + //4.Qty + "from FACT_ACCT fact, (M_PRODUCT prod left outer join C_REVENUERECOGNITION rev on rev.C_REVENUERECOGNITION_ID = prod.C_REVENUERECOGNITION_ID ) " + + "where fact.ACCOUNT_ID = " + + "(select C_ELEMENTVALUE_ID from C_ELEMENTVALUE where value = '"+account_id+"' and AD_CLIENT_ID = "+ad_client_id+") " + + "and fact.M_PRODUCT_ID = prod.M_PRODUCT_ID " + + //"and rev.C_REVENUERECOGNITION_ID(+) = prod.C_REVENUERECOGNITION_ID " + + "and fact.DATEACCT between " + + DB.TO_DATE(fromDate, false) + + " and " + + DB.TO_DATE(toDate, false) + + " and fact.AD_CLIENT_ID = "+ad_client_id + + " group by rev.NAME,to_char(fact.DATEACCT,'DD-MM-YYYY') " + + " order by to_char(fact.DATEACCT,'DD-MM-YYYY') desc,rev.NAME asc"; + } + else if(salesGroup.equalsIgnoreCase(Constants.ATTRIBUTESET)) + { + sql = "" + + " select DECODE(attrSet.NAME, null, 'others', attrSet.NAME) as \"Attributeset\"," + //1.Attributeset + " to_char(fact.DATEACCT,'DD-MM-YYYY') as \"Date\"," + //2.Date + " SUM(fact.AMTACCTCR-fact.AMTACCTDR) as \"Value\"," + //3.Value + " SUM(0 - FACT.QTY) as \"Qty\" " + //4.Qty + " from FACT_ACCT fact, (M_PRODUCT prod left outer join C_REVENUERECOGNITION rev on rev.C_REVENUERECOGNITION_ID = prod.C_REVENUERECOGNITION_ID ),M_ATTRIBUTESETINSTANCE attrSetIns, M_ATTRIBUTESET attrSet " + + " where fact.ACCOUNT_ID = " + + " (select C_ELEMENTVALUE_ID from C_ELEMENTVALUE where value = '"+account_id+"' and AD_CLIENT_ID = "+ad_client_id +") " + + " and fact.M_PRODUCT_ID = prod.M_PRODUCT_ID " + + //" and rev.C_REVENUERECOGNITION_ID(+) = prod.C_REVENUERECOGNITION_ID " + + " and prod.M_ATTRIBUTESETINSTANCE_ID = attrSetIns.M_ATTRIBUTESETINSTANCE_ID " + + " and attrSet.M_ATTRIBUTESET_ID = attrSetIns.M_ATTRIBUTESET_ID " + + " and fact.DATEACCT between " + + DB.TO_DATE(fromDate, false) + + " and " + + DB.TO_DATE(toDate, false) + + " and fact.AD_CLIENT_ID = "+ad_client_id + + " group by attrSet.name,to_char(fact.DATEACCT,'DD-MM-YYYY') " + + " order by to_char(fact.DATEACCT,'DD-MM-YYYY') desc,attrSet.name asc"; + } + else if(salesGroup.equalsIgnoreCase(Constants.PRODUCT)) + { + sql = "" + + " select PROD.NAME as \"Product\"," + //1.Product + " to_char(fact.DATEACCT,'DD-MM-YYYY') as \"Date\"," + //3.Date + " SUM(FACT.AMTACCTCR - FACT.AMTACCTDR) as \"Value\"," + //4.Value + " SUM(0 - FACT.QTY) as \"Qty\" " + //5.Qty + " from FACT_ACCT FACT, M_PRODUCT PROD " + + " where FACT.ACCOUNT_ID = " + + " (select C_ELEMENTVALUE_ID from C_ELEMENTVALUE where value = '"+account_id+"' and AD_CLIENT_ID = "+ad_client_id +") " + + " AND FACT.M_PRODUCT_ID = PROD.M_PRODUCT_ID " + + " and fact.DATEACCT between " + + DB.TO_DATE(fromDate, false) + + " and " + + DB.TO_DATE(toDate, false) + + " and fact.AD_CLIENT_ID = "+ad_client_id + + " GROUP BY to_char(fact.DATEACCT,'DD-MM-YYYY'),PROD.NAME" + + " Order by to_char(fact.DATEACCT,'DD-MM-YYYY') desc,PROD.NAME asc"; + } + else if(salesGroup.equalsIgnoreCase(Constants.GROUP1)) + { + sql = "" + + " select DECODE(PROD.GROUP1, null, 'Ungroup', PROD.GROUP1) as \"Group1\"," + //1.Product + " to_char(fact.DATEACCT,'DD-MM-YYYY') as \"Date\"," + //3.Date + " SUM(FACT.AMTACCTCR - FACT.AMTACCTDR) as \"Value\"," + //4.Value + " SUM(0 - FACT.QTY) as \"Qty\" " + //5.Qty + " from FACT_ACCT FACT, M_PRODUCT PROD " + + " where FACT.ACCOUNT_ID = " + + " (select C_ELEMENTVALUE_ID from C_ELEMENTVALUE where value = '"+account_id+"' and AD_CLIENT_ID = "+ad_client_id +") " + + " AND FACT.M_PRODUCT_ID = PROD.M_PRODUCT_ID " + + " and fact.DATEACCT between " + + DB.TO_DATE(fromDate, false) + + " and " + + DB.TO_DATE(toDate, false) + + " and fact.AD_CLIENT_ID = "+ad_client_id + + " GROUP BY to_char(fact.DATEACCT,'DD-MM-YYYY'),PROD.GROUP1" + + " Order by to_char(fact.DATEACCT,'DD-MM-YYYY') desc,PROD.GROUP1 asc"; + } + else if(salesGroup.equalsIgnoreCase(Constants.GROUP2)) + { + sql = "" + + " select DECODE(PROD.GROUP2, null, 'Ungroup', PROD.GROUP2) as \"Group2\"," + //1.Product + " to_char(fact.DATEACCT,'DD-MM-YYYY') as \"Date\"," + //3.Date + " SUM(FACT.AMTACCTCR - FACT.AMTACCTDR) as \"Value\"," + //4.Value + " SUM(0 - FACT.QTY) as \"Qty\" " + //5.Qty + " from FACT_ACCT FACT, M_PRODUCT PROD " + + " where FACT.ACCOUNT_ID = " + + " (select C_ELEMENTVALUE_ID from C_ELEMENTVALUE where value = '"+account_id+"' and AD_CLIENT_ID = "+ad_client_id +") " + + " AND FACT.M_PRODUCT_ID = PROD.M_PRODUCT_ID " + + " and fact.DATEACCT between " + + DB.TO_DATE(fromDate, false) + + " and " + + DB.TO_DATE(toDate, false) + + " and fact.AD_CLIENT_ID = "+ad_client_id + + " GROUP BY to_char(fact.DATEACCT,'DD-MM-YYYY'),PROD.GROUP2" + + " Order by to_char(fact.DATEACCT,'DD-MM-YYYY') desc,PROD.GROUP2 asc"; + } + else if(salesGroup.equalsIgnoreCase(Constants.CUSTOMER)) + { + sql = "" + + //" select BP.NAME||' '||BP.NAME2 \"Customer\"," + //1.Customer + " Select BP.NAME as \"Customer\","+ + " to_char(fact.DATEACCT,'DD-MM-YYYY') as \"Date\"," + //2.Date + " SUM(FACT.AMTACCTCR - FACT.AMTACCTDR) as \"Value\"," + //3.Value + " SUM(0 - FACT.QTY) as \"Qty\" " + //4.Qty + " from FACT_ACCT FACT, C_BPARTNER BP " + + " where FACT.ACCOUNT_ID = " + + " (select C_ELEMENTVALUE_ID from C_ELEMENTVALUE where value = '"+account_id+"' and AD_CLIENT_ID = "+ad_client_id +") " + + " AND FACT.C_BPARTNER_ID = BP.C_BPARTNER_ID " + + " and fact.DATEACCT between " + + DB.TO_DATE(fromDate, false) + + " and " + + DB.TO_DATE(toDate, false) + + " and fact.AD_CLIENT_ID = "+ad_client_id + + //" having SUM(0 - FACT.QTY) <> 0 " + + " GROUP BY to_char(fact.DATEACCT,'DD-MM-YYYY'),BP.NAME" + + " Order by to_char(fact.DATEACCT,'DD-MM-YYYY') desc,BP.NAME asc"; + //" GROUP BY to_char(fact.DATEACCT,'DD-MM-YYYY'),BP.NAME||' '||BP.NAME2" + + //" Order by to_char(fact.DATEACCT,'DD-MM-YYYY') desc,BP.NAME||' '||BP.NAME2 asc"; + } + else + { + String[] s = salesGroup.split("_"); + + if(s.length!=2) + { + throw new OperationException("Cannot generate sql. Unknown salesGroup parameter:"+salesGroup); + } + + int attributeSetId = Integer.parseInt(s[0]); + int attributeId = Integer.parseInt(s[1]); + + String attributeName = new MAttribute(ctx,attributeId,null).getName(); + + sql = "select ATTRIBUTE_VALUE as \""+attributeName+ "\"," + + "to_char(DATEACCT,'DD-MM-YYYY') as \"Date\"," + + "sum(AMTACCTCR-AMTACCTDR) as \"Value\"," + + "SUM(0 - QTY) as \"Qty\" " + + "from " + + "(" + + " select attrIns.m_attribute_id,prod.m_product_category_id, attrIns.m_attributevalue_id,attr.name ATTRIBUTE_NAME,attrSet.name ATTRIBUTESET_NAME,attrSet.M_ATTRIBUTESET_ID,prod.m_product_id, attrVal.name ATTRIBUTE_VALUE, attrVal.description,fact.AMTACCTCR,fact.AMTACCTDR,fact.DATEACCT,fact.QTY" + + " from M_PRODUCT prod,M_ATTRIBUTEINSTANCE attrIns ,M_attribute attr,M_attributeValue attrVal, M_ATTRIBUTESETINSTANCE attrSetIns, M_ATTRIBUTESET attrSet, FACT_ACCT fact" + + " where prod.M_ATTRIBUTESETINSTANCE_id = attrIns.M_ATTRIBUTESETINSTANCE_id" + + " and attr.m_attribute_id = attrIns.m_attribute_id" + + " and attrIns.m_attributevalue_id = attrVal.m_attributevalue_id" + + " and prod.M_ATTRIBUTESETINSTANCE_ID = attrSetIns.M_ATTRIBUTESETINSTANCE_ID" + + " and attrSet.M_ATTRIBUTESET_ID = attrSetIns.M_ATTRIBUTESET_ID" + + " and fact.ACCOUNT_ID = " + + " (select C_ELEMENTVALUE_ID from C_ELEMENTVALUE where value = '"+account_id+"' and AD_CLIENT_ID = "+ad_client_id +") " + + " and fact.M_PRODUCT_ID = prod.M_PRODUCT_ID" + + " and fact.AD_CLIENT_ID = " + ad_client_id + + " and attrSetIns.M_ATTRIBUTESET_ID = " + attributeSetId + + " and attr.M_ATTRIBUTE_ID = " + attributeId + + " and fact.DATEACCT between " + + DB.TO_DATE(fromDate, false) + + " and " + + DB.TO_DATE(toDate, false) + + ")" + + "group by ATTRIBUTE_VALUE,to_char(DATEACCT,'DD-MM-YYYY') " + + "order by to_char(DATEACCT,'DD-MM-YYYY') desc,ATTRIBUTE_VALUE asc"; + } + + return sql; + + }//getTabularDataSetSQL + + public static String dataSetSQL(Properties ctx,int account_id,Timestamp fromDate,Timestamp toDate,String salesGroup) throws OperationException + { + int ad_client_id = Env.getAD_Client_ID(ctx); + String sql = null; + + + + boolean isProfitMargin = (account_id == Constants.PROFIT_MARGIN); + + if(isProfitMargin) + { + String innerSql = getTabularDataSetSQL(ctx, account_id, fromDate, toDate, salesGroup); + + if(salesGroup.equalsIgnoreCase(Constants.REVENUE_RECOGNITION)) + { + sql = "select \"Revenue_Recognition\",sum(\"value\"),sum(\"Qty\") from ("+ innerSql +") sub group by \"Revenue_Recognition\""; + } + else if(salesGroup.equalsIgnoreCase(Constants.ATTRIBUTESET)) + { + sql = "select \"Attributeset\",sum(\"value\"),sum(\"Qty\") from ("+ innerSql +") att group by \"Attributeset\""; + } + else if(salesGroup.equalsIgnoreCase(Constants.PRODUCT)) + { + sql = "select \"Product\",sum(\"value\"),sum(\"Qty\") from ("+ innerSql +") prod group by \"Product\""; + } + else if(salesGroup.equalsIgnoreCase(Constants.CUSTOMER)) + { + sql = "select \"Customer\",sum(\"value\"),sum(\"Qty\") from ("+ innerSql +") customer group by \"Customer\""; + } + else if(salesGroup.equalsIgnoreCase(Constants.GROUP1)) + { + sql = "select \"Group1\",sum(\"value\"),sum(\"Qty\") from ("+ innerSql +") group1 group by \"Group1\""; + } + else if(salesGroup.equalsIgnoreCase(Constants.GROUP2)) + { + sql = "select \"Group2\",sum(\"value\"),sum(\"Qty\") from ("+ innerSql +") group2 group by \"Group2\""; + } + else + { + String[] s = salesGroup.split("_"); + + if(s.length!=2) + { + throw new OperationException("Cannot generate sql. Unknown salesGroup parameter:"+salesGroup); + } + + int attributeId = Integer.parseInt(s[1]); + + String attributeName = new MAttribute(ctx,attributeId,null).getName(); + + sql = "select \""+ attributeName +"\",sum(\"value\"),sum(\"Qty\") from ("+ innerSql +") attName group by \""+ attributeName +"\""; + } + + return sql; + } + + if(salesGroup.equalsIgnoreCase(Constants.REVENUE_RECOGNITION)) + { + sql = "select DECODE(rev.NAME, null, 'Others', rev.NAME) as RevenueRecognition,SUM(fact.AMTACCTCR - fact.AMTACCTDR) as Revenue_Recognition,SUM(0-fact.QTY) as Qty " + + "from FACT_ACCT fact, (M_PRODUCT prod right outer join C_REVENUERECOGNITION rev on rev.C_REVENUERECOGNITION_ID = prod.C_REVENUERECOGNITION_ID) " + + "where fact.ACCOUNT_ID = " + + "(select C_ELEMENTVALUE_ID from C_ELEMENTVALUE where value = '"+account_id+"' and AD_CLIENT_ID = "+ad_client_id+") " + + "and fact.M_PRODUCT_ID = prod.M_PRODUCT_ID " + + "and fact.DATEACCT between " + + DB.TO_DATE(fromDate, false) + + " and " + + DB.TO_DATE(toDate, false) + + " and fact.AD_CLIENT_ID = "+ad_client_id + + " group by rev.NAME"; + } + else if(salesGroup.equalsIgnoreCase(Constants.ATTRIBUTESET)) + { + sql = "select attrSet.name as attributeset,SUM(fact.AMTACCTCR - fact.AMTACCTDR) as Attribute_Set,SUM(0-fact.QTY) as Qty " + + "from FACT_ACCT fact, (M_PRODUCT prod right outer join C_REVENUERECOGNITION rev on rev.C_REVENUERECOGNITION_ID = prod.C_REVENUERECOGNITION_ID),M_ATTRIBUTESETINSTANCE attrSetIns, M_ATTRIBUTESET attrSet " + + "where fact.ACCOUNT_ID = " + + "(select C_ELEMENTVALUE_ID from C_ELEMENTVALUE where value = '"+account_id+"' and AD_CLIENT_ID = "+ad_client_id +") " + + "and fact.M_PRODUCT_ID = prod.M_PRODUCT_ID " + + "and prod.M_ATTRIBUTESETINSTANCE_ID = attrSetIns.M_ATTRIBUTESETINSTANCE_ID " + + "and attrSet.M_ATTRIBUTESET_ID = attrSetIns.M_ATTRIBUTESET_ID " + + "and fact.DATEACCT between " + + DB.TO_DATE(fromDate, false) + + " and " + + DB.TO_DATE(toDate, false) + + " and fact.AD_CLIENT_ID = "+ad_client_id + + " group by attrSet.name"; + } + else if(salesGroup.equalsIgnoreCase(Constants.PRODUCT)) + { + sql = "select PROD.NAME as \"Product\",SUM(FACT.AMTACCTCR - FACT.AMTACCTDR) as \"Value\",SUM(0 - FACT.QTY) as \"Qty\" " + + "from FACT_ACCT FACT, M_PRODUCT PROD " + + "where FACT.ACCOUNT_ID = " + + "(select C_ELEMENTVALUE_ID from C_ELEMENTVALUE where value = '"+account_id+"' and AD_CLIENT_ID = "+ad_client_id +") " + + "AND FACT.M_PRODUCT_ID = PROD.M_PRODUCT_ID " + + "and fact.DATEACCT between " + + DB.TO_DATE(fromDate, false) + + " and " + + DB.TO_DATE(toDate, false) + + " and fact.AD_CLIENT_ID = "+ad_client_id + + " GROUP BY PROD.NAME"; + } + else if(salesGroup.equalsIgnoreCase(Constants.GROUP1)) + { + sql = "select DECODE(PROD.GROUP1, null, 'Ungrouped', PROD.GROUP1) as \"Group1\",SUM(FACT.AMTACCTCR - FACT.AMTACCTDR) as \"Value\",SUM(0 - FACT.QTY) as \"Qty\" " + + "from FACT_ACCT FACT, M_PRODUCT PROD " + + "where FACT.ACCOUNT_ID = " + + "(select C_ELEMENTVALUE_ID from C_ELEMENTVALUE where value = '"+account_id+"' and AD_CLIENT_ID = "+ad_client_id +") " + + "AND FACT.M_PRODUCT_ID = PROD.M_PRODUCT_ID " + + "and fact.DATEACCT between " + + DB.TO_DATE(fromDate, false) + + " and " + + DB.TO_DATE(toDate, false) + + " and fact.AD_CLIENT_ID = "+ad_client_id + + " GROUP BY PROD.GROUP1"; + } + else if(salesGroup.equalsIgnoreCase(Constants.GROUP2)) + { + sql = "select DECODE(PROD.GROUP2, null, 'Ungrouped', PROD.GROUP2) as \"Group2\",SUM(FACT.AMTACCTCR - FACT.AMTACCTDR) as \"Value\",SUM(0 - FACT.QTY) as \"Qty\" " + + "from FACT_ACCT FACT, M_PRODUCT PROD " + + "where FACT.ACCOUNT_ID = " + + "(select C_ELEMENTVALUE_ID from C_ELEMENTVALUE where value = '"+account_id+"' and AD_CLIENT_ID = "+ad_client_id +") " + + "AND FACT.M_PRODUCT_ID = PROD.M_PRODUCT_ID " + + "and fact.DATEACCT between " + + DB.TO_DATE(fromDate, false) + + " and " + + DB.TO_DATE(toDate, false) + + " and fact.AD_CLIENT_ID = "+ad_client_id + + " GROUP BY PROD.GROUP2"; + } + else if(salesGroup.equalsIgnoreCase(Constants.CUSTOMER)) + { + //sql = "select BP.NAME || ' ' || BP.NAME2 as \"Customer\", " + + sql = "Select BP.NAME as \"Customer\","+ + "SUM(FACT.AMTACCTCR - FACT.AMTACCTDR) as \"Value\", SUM(0 - FACT.QTY) as \"Qty\" " + + "from FACT_ACCT FACT, C_BPARTNER BP " + + "where FACT.ACCOUNT_ID = " + + "(select C_ELEMENTVALUE_ID from C_ELEMENTVALUE where value = '"+account_id+"' and AD_CLIENT_ID = "+ad_client_id +") " + + "AND FACT.C_BPARTNER_ID = BP.C_BPARTNER_ID " + + "and fact.DATEACCT between " + + DB.TO_DATE(fromDate, false) + + " and " + + DB.TO_DATE(toDate, false) + + " and fact.AD_CLIENT_ID = "+ad_client_id + + //" having SUM(0 - FACT.QTY) <> 0 " + + " GROUP BY BP.NAME Order by BP.NAME asc"; + //"GROUP BY BP.NAME || ' ' || BP.NAME2 Order by BP.NAME || ' ' || BP.NAME2 asc"; + } + else + { + String[] s = salesGroup.split("_"); + + if(s.length!=2) + { + throw new OperationException("Cannot generate sql. Unknown salesGroup parameter:"+salesGroup); + } + + int attributeSetId = Integer.parseInt(s[0]); + int attributeId = Integer.parseInt(s[1]); + + String attributeName = new MAttribute(ctx,attributeId,null).getName(); + + sql = "select ATTRIBUTE_VALUE, sum(AMTSOURCECR - AMTSOURCEDR) as \""+attributeName+ "\",SUM(0-QTY) as Qty from " + + "(" + + " select attrIns.m_attribute_id,prod.m_product_category_id, attrIns.m_attributevalue_id,attr.name ATTRIBUTE_NAME,attrSet.name ATTRIBUTESET_NAME,attrSet.M_ATTRIBUTESET_ID,prod.m_product_id, attrVal.name ATTRIBUTE_VALUE, attrVal.description,fact.AMTSOURCECR,fact.AMTSOURCEDR,fact.QTY" + + " from M_PRODUCT prod,M_ATTRIBUTEINSTANCE attrIns ,M_attribute attr,M_attributeValue attrVal, M_ATTRIBUTESETINSTANCE attrSetIns, M_ATTRIBUTESET attrSet, FACT_ACCT fact" + + " where prod.M_ATTRIBUTESETINSTANCE_id = attrIns.M_ATTRIBUTESETINSTANCE_id" + + " and attr.m_attribute_id = attrIns.m_attribute_id" + + " and attrIns.m_attributevalue_id = attrVal.m_attributevalue_id" + + " and prod.M_ATTRIBUTESETINSTANCE_ID = attrSetIns.M_ATTRIBUTESETINSTANCE_ID" + + " and attrSet.M_ATTRIBUTESET_ID = attrSetIns.M_ATTRIBUTESET_ID" + + " and fact.M_PRODUCT_ID = prod.M_PRODUCT_ID" + + " and fact.ACCOUNT_ID = " + + " (select C_ELEMENTVALUE_ID from C_ELEMENTVALUE where value = '"+account_id+"' and AD_CLIENT_ID = "+ad_client_id +") " + + " and fact.AD_CLIENT_ID = " + ad_client_id + + " and attrSetIns.M_ATTRIBUTESET_ID = " + attributeSetId + + " and attr.M_ATTRIBUTE_ID = " + attributeId + + " and fact.DATEACCT between " + + DB.TO_DATE(fromDate, false) + + " and " + + DB.TO_DATE(toDate, false) + + ")" + + " group by ATTRIBUTE_VALUE"; + + + } + + return sql; + }//dataSetSQL + + public static String getTimeSeriesDataSetSQL(Properties ctx,int account_id,Timestamp fromDate,Timestamp toDate,String salesGroup) throws OperationException + { + + int ad_client_id = Env.getAD_Client_ID(ctx); + String sql = null; + + + + boolean isProfitMargin = (account_id == Constants.PROFIT_MARGIN); + if(isProfitMargin) + { + return getTabularDataSetSQL(ctx, account_id, fromDate, toDate, salesGroup); + } + + + + if(salesGroup.equalsIgnoreCase(Constants.REVENUE_RECOGNITION)) + { + sql = "" + + "select DECODE(rev.NAME, null, 'others', rev.Name) as RevenueRecognition," + //1.Revenue Recognition + "to_char(fact.DATEACCT,'DD-MM-YYYY')," + //2.Date + "SUM(fact.AMTACCTCR-fact.AMTACCTDR) as REVENUE," + //3.Value + "SUM(0-fact.QTY) " + //4.Qty + "from FACT_ACCT fact, (M_PRODUCT prod left outer join C_REVENUERECOGNITION rev on rev.C_REVENUERECOGNITION_ID = prod.C_REVENUERECOGNITION_ID ) " + + "where fact.ACCOUNT_ID = " + + "(select C_ELEMENTVALUE_ID from C_ELEMENTVALUE where value = '"+account_id+"' and AD_CLIENT_ID = "+ad_client_id+") " + + "and fact.M_PRODUCT_ID = prod.M_PRODUCT_ID " + + //"and rev.C_REVENUERECOGNITION_ID(+) = prod.C_REVENUERECOGNITION_ID " + + "and fact.DATEACCT between " + + DB.TO_DATE(fromDate, false) + + " and " + + DB.TO_DATE(toDate, false) + + "and fact.AD_CLIENT_ID = "+ad_client_id + + " group by rev.NAME,to_char(fact.DATEACCT,'DD-MM-YYYY')"; + } + else if(salesGroup.equalsIgnoreCase(Constants.ATTRIBUTESET)) + { + sql = "select attrSet.name as attributeset,to_char(fact.DATEACCT,'DD-MM-YYYY'),SUM(fact.AMTACCTCR-fact.AMTACCTDR) as REVENUE,SUM(0-fact.QTY) " + + "from FACT_ACCT fact, (M_PRODUCT prod left outer join C_REVENUERECOGNITION rev on rev.C_REVENUERECOGNITION_ID = prod.C_REVENUERECOGNITION_ID ),M_ATTRIBUTESETINSTANCE attrSetIns, M_ATTRIBUTESET attrSet " + + "where fact.ACCOUNT_ID = " + + "(select C_ELEMENTVALUE_ID from C_ELEMENTVALUE where value = '"+account_id+"' and AD_CLIENT_ID = "+ad_client_id +") " + + "and fact.M_PRODUCT_ID = prod.M_PRODUCT_ID " + + //"and rev.C_REVENUERECOGNITION_ID(+) = prod.C_REVENUERECOGNITION_ID " + + "and prod.M_ATTRIBUTESETINSTANCE_ID = attrSetIns.M_ATTRIBUTESETINSTANCE_ID " + + "and attrSet.M_ATTRIBUTESET_ID = attrSetIns.M_ATTRIBUTESET_ID " + + "and fact.DATEACCT between " + + DB.TO_DATE(fromDate, false) + + " and " + + DB.TO_DATE(toDate, false) + + "and fact.AD_CLIENT_ID = "+ad_client_id + + " group by attrSet.name,to_char(fact.DATEACCT,'DD-MM-YYYY')"; + } + else if(salesGroup.equalsIgnoreCase(Constants.PRODUCT)) + { + sql = "" + + " select PROD.NAME as \"Product\"," + //1.Product + " to_char(fact.DATEACCT,'DD-MM-YYYY') as \"Date\"," + //2.Date + " SUM(FACT.AMTACCTCR - FACT.AMTACCTDR) as \"Value\"," + //3.Value + " SUM(0 - FACT.QTY) as \"Qty\" " + //4.Qty + " from FACT_ACCT FACT, M_PRODUCT PROD " + + " where FACT.ACCOUNT_ID = " + + " (select C_ELEMENTVALUE_ID from C_ELEMENTVALUE where value = '"+account_id+"' and AD_CLIENT_ID = "+ad_client_id +") " + + " AND FACT.M_PRODUCT_ID = PROD.M_PRODUCT_ID " + + " and fact.DATEACCT between " + + DB.TO_DATE(fromDate, false) + + " and " + + DB.TO_DATE(toDate, false) + + " and fact.AD_CLIENT_ID = "+ad_client_id + + " GROUP BY to_char(fact.DATEACCT,'DD-MM-YYYY'),PROD.NAME"; + } + else if(salesGroup.equalsIgnoreCase(Constants.PRODUCT)) + { + sql = "" + + " select PROD.NAME as \"Product\"," + //1.Product + " to_char(fact.DATEACCT,'DD-MM-YYYY') as \"Date\"," + //2.Date + " SUM(FACT.AMTACCTCR - FACT.AMTACCTDR) as \"Value\"," + //3.Value + " SUM(0 - FACT.QTY) \"Qty\" " + //4.Qty + " from FACT_ACCT FACT, M_PRODUCT PROD " + + " where FACT.ACCOUNT_ID = " + + " (select C_ELEMENTVALUE_ID from C_ELEMENTVALUE where value = '"+account_id+"' and AD_CLIENT_ID = "+ad_client_id +") " + + " AND FACT.M_PRODUCT_ID = PROD.M_PRODUCT_ID " + + " and fact.DATEACCT between " + + DB.TO_DATE(fromDate, false) + + " and " + + DB.TO_DATE(toDate, false) + + " and fact.AD_CLIENT_ID = "+ad_client_id + + " GROUP BY to_char(fact.DATEACCT,'DD-MM-YYYY'),PROD.NAME"; + } + else if(salesGroup.equalsIgnoreCase(Constants.GROUP1)) + { + sql = "" + + " select NVL(PROD.GROUP1,'OTHERS') as \"Group1\"," + //1.Product + " to_char(fact.DATEACCT,'DD-MM-YYYY') as \"Date\"," + //2.Date + " SUM(FACT.AMTACCTCR - FACT.AMTACCTDR) as \"Value\"," + //3.Value + " SUM(0 - FACT.QTY) as \"Qty\" " + //4.Qty + " from FACT_ACCT FACT, M_PRODUCT PROD " + + " where FACT.ACCOUNT_ID = " + + " (select C_ELEMENTVALUE_ID from C_ELEMENTVALUE where value = '"+account_id+"' and AD_CLIENT_ID = "+ad_client_id +") " + + " AND FACT.M_PRODUCT_ID = PROD.M_PRODUCT_ID " + + " and fact.DATEACCT between " + + DB.TO_DATE(fromDate, false) + + " and " + + DB.TO_DATE(toDate, false) + + " and fact.AD_CLIENT_ID = "+ad_client_id + + " GROUP BY to_char(fact.DATEACCT,'DD-MM-YYYY'),PROD.GROUP1"; + } + else if(salesGroup.equalsIgnoreCase(Constants.GROUP2)) + { + sql = "" + + " select NVL(PROD.GROUP2,'OTHERS') as \"Group2\"," + //1.Product + " to_char(fact.DATEACCT,'DD-MM-YYYY') as \"Date\"," + //2.Date + " SUM(FACT.AMTACCTCR - FACT.AMTACCTDR) as \"Value\"," + //3.Value + " SUM(0 - FACT.QTY) as \"Qty\" " + //4.Qty + " from FACT_ACCT FACT, M_PRODUCT PROD " + + " where FACT.ACCOUNT_ID = " + + " (select C_ELEMENTVALUE_ID from C_ELEMENTVALUE where value = '"+account_id+"' and AD_CLIENT_ID = "+ad_client_id +") " + + " AND FACT.M_PRODUCT_ID = PROD.M_PRODUCT_ID " + + " and fact.DATEACCT between " + + DB.TO_DATE(fromDate, false) + + " and " + + DB.TO_DATE(toDate, false) + + " and fact.AD_CLIENT_ID = "+ad_client_id + + " GROUP BY to_char(fact.DATEACCT,'DD-MM-YYYY'),PROD.GROUP2"; + } + else if(salesGroup.equalsIgnoreCase(Constants.CUSTOMER)) + { + sql = "" + + //" select BP.NAME||' '||BP.NAME2 as \"Customer\"," + //1.Customer + "Select BP.NAME as \"Customer\","+ + " to_char(fact.DATEACCT,'DD-MM-YYYY') as \"Date\"," + //2.Date + " SUM(FACT.AMTACCTCR - FACT.AMTACCTDR) as \"Value\"," + //3.Value + " SUM(0 - FACT.QTY) as \"Qty\" " + //4.Qty + " from FACT_ACCT FACT, C_BPARTNER BP " + + " where FACT.ACCOUNT_ID = " + + " (select C_ELEMENTVALUE_ID from C_ELEMENTVALUE where value = '"+account_id+"' and AD_CLIENT_ID = "+ad_client_id +") " + + " AND FACT.C_BPARTNER_ID = BP.C_BPARTNER_ID " + + " and fact.DATEACCT between " + + DB.TO_DATE(fromDate, false) + + " and " + + DB.TO_DATE(toDate, false) + + " and fact.AD_CLIENT_ID = "+ad_client_id + + //" having SUM(0 - FACT.QTY) <> 0 " + + " GROUP BY to_char(fact.DATEACCT,'DD-MM-YYYY'),BP.NAME"; + //" GROUP BY to_char(fact.DATEACCT,'DD-MM-YYYY'),BP.NAME||' '||BP.NAME2"; + + } + else + { + String[] s = salesGroup.split("_"); + + if(s.length!=2) + { + throw new OperationException("Cannot generate sql. Unknown salesGroup parameter:"+salesGroup); + } + + int attributeSetId = Integer.parseInt(s[0]); + int attributeId = Integer.parseInt(s[1]); + + sql = "select ATTRIBUTE_VALUE,to_char(DATEACCT,'DD-MM-YYYY'),sum(AMTACCTCR-AMTACCTDR),SUM(0-QTY) from " + + "(" + + " select attrIns.m_attribute_id,prod.m_product_category_id, attrIns.m_attributevalue_id,attr.name ATTRIBUTE_NAME,attrSet.name ATTRIBUTESET_NAME,attrSet.M_ATTRIBUTESET_ID,prod.m_product_id, attrVal.name ATTRIBUTE_VALUE, attrVal.description,fact.AMTACCTCR,fact.AMTACCTDR,fact.DATEACCT,fact.QTY" + + " from M_PRODUCT prod,M_ATTRIBUTEINSTANCE attrIns ,M_attribute attr,M_attributeValue attrVal, M_ATTRIBUTESETINSTANCE attrSetIns, M_ATTRIBUTESET attrSet, FACT_ACCT fact" + + " where prod.M_ATTRIBUTESETINSTANCE_id = attrIns.M_ATTRIBUTESETINSTANCE_id" + + " and attr.m_attribute_id = attrIns.m_attribute_id" + + " and attrIns.m_attributevalue_id = attrVal.m_attributevalue_id" + + " and prod.M_ATTRIBUTESETINSTANCE_ID = attrSetIns.M_ATTRIBUTESETINSTANCE_ID" + + " and attrSet.M_ATTRIBUTESET_ID = attrSetIns.M_ATTRIBUTESET_ID" + + " and fact.ACCOUNT_ID = " + + " (select C_ELEMENTVALUE_ID from C_ELEMENTVALUE where value = '"+account_id+"' and AD_CLIENT_ID = "+ad_client_id +") " + + " and fact.M_PRODUCT_ID = prod.M_PRODUCT_ID" + + " and fact.AD_CLIENT_ID = " + ad_client_id + + " and attrSetIns.M_ATTRIBUTESET_ID = " + attributeSetId + + " and attr.M_ATTRIBUTE_ID = " + attributeId + + " and fact.DATEACCT between " + + DB.TO_DATE(fromDate, false) + + " and " + + DB.TO_DATE(toDate, false) + + " group by ATTRIBUTE_VALUE,to_char(DATEACCT,'DD-MM-YYYY')"; + } + + return sql; + + }//getTimeSeriesDataSetSQL + +}//SalesAnalysisReportManager diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/product/GenericProductImpl.java b/posterita/posterita/src/main/org/posterita/businesslogic/product/GenericProductImpl.java new file mode 100644 index 0000000000..34769bec44 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/businesslogic/product/GenericProductImpl.java @@ -0,0 +1,69 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +* +* Created on Oct 10, 2006 by ashley +* +*/ + +/** + @author ashley + */ + +package org.posterita.businesslogic.product; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Properties; + +import org.compiere.model.MAttachmentEntry; +import org.compiere.model.MProduct; + +import org.posterita.businesslogic.administration.ProductManager; +import org.posterita.businesslogic.core.AttachmentManager; +import org.posterita.exceptions.OperationException; + +public class GenericProductImpl implements IProduct +{ + + public String getProductName(Properties ctx, int productId, String trxName) throws OperationException + { + MProduct product = ProductManager.loadProduct(ctx, productId, trxName); + + return product.getName(); + } + + public String getBarcodeForSimilarProducts(Properties ctx, int productId, String trxName) throws OperationException + { + return null; + } + + public HashMap getAllImages(Properties ctx, int productId, String trxName) throws OperationException + { + HashMap imagesMap = new HashMap(); + ArrayList entryList = AttachmentManager.getAllImagesAttachmentEntries(ctx, MProduct.Table_ID, productId, trxName); + + for(MAttachmentEntry entry : entryList) + { + imagesMap.put(entry.getName(), entry.getData()); + } + + return imagesMap; + } + +} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/product/IProduct.java b/posterita/posterita/src/main/org/posterita/businesslogic/product/IProduct.java new file mode 100644 index 0000000000..a8d521c111 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/businesslogic/product/IProduct.java @@ -0,0 +1,43 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +* +* Created on Oct 10, 2006 by ashley +* +*/ + +/** + @author ashley + */ + +package org.posterita.businesslogic.product; + +import java.util.HashMap; +import java.util.Properties; + +import org.posterita.exceptions.OperationException; + +public interface IProduct +{ + + public String getProductName(Properties ctx, int productId, String trxName) throws OperationException; + + public String getBarcodeForSimilarProducts(Properties ctx, int productId, String trxName) throws OperationException; + + public HashMap getAllImages(Properties ctx, int productId, String trxName) throws OperationException; +} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/stock/InventoryCartManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/stock/InventoryCartManager.java new file mode 100644 index 0000000000..7c68dc61c3 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/businesslogic/stock/InventoryCartManager.java @@ -0,0 +1,684 @@ +package org.posterita.businesslogic.stock; + +import java.io.BufferedInputStream; +import java.io.BufferedReader; +import java.io.FileNotFoundException; +import java.io.FileWriter; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.text.DecimalFormat; +import java.text.ParseException; +import java.util.ArrayList; +import java.util.NoSuchElementException; +import java.util.Properties; +import java.util.StringTokenizer; + +import javax.servlet.http.HttpServletRequest; +import javax.swing.text.NumberFormatter; + +import org.apache.ecs.xhtml.div; +import org.apache.ecs.xhtml.table; +import org.apache.ecs.xhtml.tbody; +import org.apache.ecs.xhtml.td; +import org.apache.ecs.xhtml.tfoot; +import org.apache.ecs.xhtml.th; +import org.apache.ecs.xhtml.thead; +import org.apache.ecs.xhtml.tr; +import org.apache.struts.upload.FormFile; +import org.compiere.model.MDocType; +import org.compiere.model.MInventory; +import org.compiere.model.MInventoryLine; +import org.compiere.model.MPInstance; +import org.compiere.model.MProduct; +import org.compiere.model.MProductPrice; +import org.compiere.model.MUOM; +import org.compiere.process.InventoryCountCreate; +import org.compiere.process.ProcessInfo; +import org.compiere.process.ProcessInfoParameter; +import org.compiere.util.DB; +import org.compiere.util.Env; +import org.compiere.util.Trx; +import org.posterita.Constants; +import org.posterita.beans.InventoryCartBean; +import org.posterita.beans.InventoryLineBean; +import org.posterita.beans.ItemBean; +import org.posterita.beans.ProductBean; +import org.posterita.businesslogic.POSProductManager; +import org.posterita.businesslogic.POSTerminalManager; +import org.posterita.businesslogic.administration.PriceListManager; +import org.posterita.businesslogic.performanceanalysis.CSVReportManager; +import org.posterita.businesslogic.performanceanalysis.ReportManager; +import org.posterita.core.RandomStringGenerator; +import org.posterita.core.TmkJSPEnv; +import org.posterita.core.TrxPrefix; +import org.posterita.exceptions.BarcodeAlreadyExistsException; +import org.posterita.exceptions.CannotCreateInventoryLineException; +import org.posterita.exceptions.ImportProductException; +import org.posterita.exceptions.OperationException; +import org.posterita.exceptions.ProductAlreadyExistException; +import org.posterita.exceptions.ProductNotFoundException; +import org.posterita.exceptions.ProductNotImportedException; +import org.posterita.lib.UdiConstants; +import org.posterita.util.PoManager; + +public class InventoryCartManager +{ + private static final int CREATE_INVENTORY_COUNT_LIST_PROCESS=289; + + private static String getInventoryCartAsHTML(ArrayList itemList, Properties ctx) throws ParseException, OperationException + { + NumberFormatter formatter = new NumberFormatter(new DecimalFormat("0")); + + int priceListId = Env.getContextAsInt(ctx, UdiConstants.PRICELIST_CTX_PARAM); + String currSymbol = PriceListManager.getCurrency(ctx, priceListId); + + BigDecimal totalQtyCount = Env.ZERO; + BigDecimal totalQtyBook = Env.ZERO; + BigDecimal totalQtyCsv = Env.ZERO; + BigDecimal difference = Env.ZERO; + BigDecimal totalDifference = Env.ZERO; + + String[] headers = {"Name","Description","UOM","Quantity CSV", "Quantity Book","Quantity Count", "Difference"}; + table tbl = new table("0", "0", "0", "100%", ""); + tbl.setID("inventoryCart"); + tbl.addAttribute("class", "filterable sortable"); + + BigDecimal qtyCsv = Env.ZERO; + BigDecimal qtyCount = Env.ZERO; + BigDecimal qtyBook = Env.ZERO; + + thead theader = new thead(); + + tr headerRow = new tr(); + headerRow.setClass("itemTitleList"); + + for(String header : headers) + { + th h = new th(header); + headerRow.addElement(h); + } + + theader.addElement(headerRow); + tbl.addElement(theader); + + + //add body + tbody body = new tbody(); + int count = 0; + + if(itemList != null) + { + for(ItemBean bean : itemList) + { + count ++; + + tr dataRow = new tr(); + + dataRow.setClass("evenRow"); + dataRow.setID("row" + count); + dataRow.addAttribute("productId", bean.getProductId().toString()); + dataRow.addAttribute("qty", bean.getQtyCount().toString()); + dataRow.addAttribute("qtyBook", bean.getQtyBook().toString()); + + qtyCount = bean.getQtyCount(); + qtyCsv = bean.getQtyCsv(); + qtyBook = bean.getQtyBook(); + + difference = qtyBook.subtract(qtyCount); + + totalQtyCount = totalQtyCount.add(bean.getQtyCount()); + totalQtyBook = totalQtyBook.add(bean.getQtyBook()); + totalQtyCsv = totalQtyCsv.add(bean.getQtyCsv()); + totalDifference = totalDifference.add(difference); + + int n = qtyCount.compareTo(qtyBook); + + //Greater + if(n == -1) + { + dataRow.addAttribute("style", "color:#0101DF"); + } + + //Equal + if(n == 0) + { + dataRow.addAttribute("style", "color:#000000"); + } + + //less + if(n == 1) + { + dataRow.addAttribute("style", "color:#DF0101"); + } + + + + String[] columnData = { + bean.getProductName(), + bean.getDescription(), + bean.getUom(), + formatter.valueToString(bean.getQtyCsv()), + formatter.valueToString(bean.getQtyBook()), + formatter.valueToString(bean.getQtyCount()), + formatter.valueToString(difference) + }; + + for(int i=0; iTotal ").setColSpan("3")); + footerRow.addElement(new td(new div(formatter.valueToString(totalQtyCsv)).setID("cartTotalCsv"))); + footerRow.addElement(new td(new div(formatter.valueToString(totalQtyBook)).setID("cartTotalBook"))); + footerRow.addElement(new td(new div(formatter.valueToString(totalQtyCount)).setID("cartTotalCount"))); + footerRow.addElement(new td(new div(formatter.valueToString(totalDifference)).setID("cartDifference"))); + + footer.addElement(footerRow); + tbl.addElement(footer); + + + return tbl.toString(); + } + + public static String getInventoryCartAsHTML(HttpServletRequest request) throws ParseException, OperationException + { + //add body + ArrayList itemList = (ArrayList) request.getSession().getAttribute(Constants.INVENTORY_CART_ITEMS); + Properties ctx = TmkJSPEnv.getCtx(request); + return getInventoryCartAsHTML(itemList, ctx); + } + + public static void clearInventorycart(Properties ctx, HttpServletRequest request) + { + //bug fix + request.setAttribute("cartTotalCsv", null); + request.setAttribute("cartTotalBook", null); + request.setAttribute("cartTotalCount", null); + + Env.setContext(ctx, Constants.DESCRIPTION, ""); + Env.setContext(ctx, Constants.INVENTORY_ID, ""); + + request.getSession().setAttribute(Constants.DOC_NO, null); + request.getSession().setAttribute(Constants.DOC_STATUS, null); + request.getSession().setAttribute(Constants.DESCRIPTION, null); + request.getSession().setAttribute(Constants.INVENTORY_ID, null); + request.getSession().setAttribute(Constants.INVENTORY_CART, null); + request.getSession().setAttribute(Constants.INVENTORY_CART_ITEMS, null); + } + + public static void saveCountQtyInInventoryLine(Properties ctx,int inventoryLineId, BigDecimal qtyBook, BigDecimal countQty, BigDecimal qtyCsv, String trxName) throws OperationException + { + MInventoryLine line = new MInventoryLine(ctx,inventoryLineId,trxName); + line.setQtyCount(countQty); + line.setQtyBook(qtyBook); + line.setQtyCsv(qtyCsv); + PoManager.save(line); + } + + public static boolean addInventoryLine(Properties ctx, Integer inventoryId,Integer productId, BigDecimal qtyBook, BigDecimal qtyCount, BigDecimal qtyCsv, boolean updateCount,String trxName) throws OperationException + { + if(productId == null || productId.intValue()==0) + { + throw new ProductNotFoundException("product not available"); + } + + MProduct product = new MProduct(ctx,productId.intValue(),trxName); + if(product.getProductType().equalsIgnoreCase(MProduct.PRODUCTTYPE_Service)) + { + throw new CannotCreateInventoryLineException("product is a service, cannot add to inventory"); + } + MInventory inventory = new MInventory(ctx,inventoryId,trxName); + MInventoryLine inventoryLine[]=inventory.getLines(true); + boolean added=true; + if(inventoryLine.length>0) + { + for(int i=0;i 1) + { + throw new OperationException("More that one inventory lines found matching criteria"); + } + else + { + return inventoryLines[0]; + } + + } + + public static MInventory createInventory(Properties ctx,String description,String trxName) throws OperationException + { + MInventory inventory = new MInventory(ctx,0,trxName); + MDocType[] docTypes= MDocType.getOfDocBaseType(ctx,MDocType.DOCBASETYPE_MaterialPhysicalInventory); + if(docTypes.length>1) + throw new OperationException("More than one document type for Physical Inventory"); + + inventory.setC_DocType_ID(docTypes[0].get_ID()); + inventory.setM_Warehouse_ID(POSTerminalManager.getWarehouseId(ctx)); + if(description!=null) + inventory.setDescription(description); + + PoManager.save(inventory); + return inventory; + + } + + public static ArrayList getInventoryLines(Properties ctx,int inventoryId) throws OperationException + { + + MInventory inventory = new MInventory(ctx,inventoryId,null); + MInventoryLine inventoryLine[]=inventory.getLines(true); + + ArrayList countList = new ArrayList(); + + ItemBean bean=null; + BigDecimal bookQtyValue=null; + BigDecimal countQtyValue=null; + + for(int i=0;i getInventoryData(Properties ctx, ArrayList list, String trxName) throws ParseException + { + + ArrayList reportData = new ArrayList(); + NumberFormatter formatter = new NumberFormatter(new DecimalFormat("0.00")); + NumberFormatter qtyFormatter = new NumberFormatter(new DecimalFormat("0")); + + String productName = null; + String productDescrition = null; + String barcode = null; + + BigDecimal qtyBook = Env.ZERO; + BigDecimal qtyCount = Env.ZERO; + BigDecimal qtyCsv = Env.ZERO; + + BigDecimal bookValue = Env.ZERO; + BigDecimal countValue = Env.ZERO; + + BigDecimal qtyBookTotal = Env.ZERO; + BigDecimal qtyCountTotal = Env.ZERO; + BigDecimal qtyCsvTotal = Env.ZERO; + + BigDecimal valueBookTotal = Env.ZERO; + BigDecimal valueCountTotal = Env.ZERO; + + BigDecimal qtyDifference = Env.ZERO; + BigDecimal valueDifference = Env.ZERO; + + + for(ItemBean itemBean : list) + { + qtyBook = itemBean.getQtyBook(); + qtyCount = itemBean.getQtyCount(); + + qtyBookTotal = qtyBookTotal.add(qtyBook); + qtyCountTotal = qtyCountTotal.add(qtyCount); + + productName = itemBean.getProductName(); + productDescrition = itemBean.getDescription(); + barcode = itemBean.getBarCode(); + + int purchasePriceListVersionId = Env.getContextAsInt(ctx,UdiConstants.POS_PURCHASE_PL_VERSION); + MProductPrice purchasePrice = MProductPrice.get(ctx, purchasePriceListVersionId, itemBean.getProductId(), trxName); + + if(purchasePrice==null) + { + bookValue=new BigDecimal(0); + countValue=new BigDecimal(0); + } + else + { + bookValue=purchasePrice.getPriceList().multiply(itemBean.getQtyBook()); + countValue=purchasePrice.getPriceList().multiply(itemBean.getQtyCount()); + } + + valueBookTotal = valueBookTotal.add(bookValue); + valueCountTotal = valueCountTotal.add(countValue); + + qtyDifference = qtyCount.subtract(qtyBook); + valueDifference = countValue.subtract(bookValue); + + Object[] data = {barcode, productName, qtyFormatter.valueToString(qtyCsv), qtyFormatter.valueToString(qtyBook), qtyFormatter.valueToString(qtyCount), formatter.valueToString(bookValue), formatter.valueToString(countValue), qtyFormatter.valueToString(qtyDifference), formatter.valueToString(valueDifference)}; + + reportData.add(data); + } + + // Add Total + Object[] totalValue = {"TOTAL"," ", qtyFormatter.valueToString(qtyCsvTotal) ,qtyFormatter.valueToString(qtyBookTotal), qtyFormatter.valueToString(qtyCountTotal), formatter.valueToString(valueBookTotal), formatter.valueToString(valueCountTotal), qtyFormatter.valueToString(qtyCountTotal.subtract(qtyBookTotal)), formatter.valueToString(valueCountTotal.subtract(valueBookTotal))}; + reportData.add(totalValue); + + return reportData; + } + + public static InventoryCartBean addItemsFromCsv(Properties ctx, FormFile file, InventoryLineBean ibean, InventoryCartBean cartBean, String trxName) throws NumberFormatException, ProductAlreadyExistException,BarcodeAlreadyExistsException, OperationException + { + + InputStream is = null; + BufferedInputStream bis = null; + BufferedReader reader = null; + + ArrayList ilBean = new ArrayList(); + + StringBuffer csv = new StringBuffer(); + StringBuffer importProductEx = new StringBuffer(); + try + { + is = file.getInputStream(); + bis = new BufferedInputStream(is); + reader = new BufferedReader(new InputStreamReader(bis)); + + String s = null; + Integer lineNumber = 0; + String barcode = null; + String qty=null; + + BigDecimal qtyCsv = new BigDecimal(0); + + ArrayList uomErrorList = new ArrayList(); + + boolean isProductImported = true; + String filename = ""; + + while((s=reader.readLine())!=null && s.trim().length()>0) + { + lineNumber++; + StringTokenizer st = new StringTokenizer(s,","); + + ibean = new InventoryLineBean(); + Trx trx = Trx.get(TrxPrefix.getPrefix(),true); + try + { + trx.start(); + try + { + barcode = st.nextToken(); + barcode = barcode.replaceAll("\"",""); + qty=st.nextToken(); + qty=qty.replaceAll("\"",""); + qtyCsv = new BigDecimal(qty); + + } + catch (NoSuchElementException e) + { + // TODO: handle exception + throw new ImportProductException("An error occurred while passing the data in the file."); + } + + ProductBean product = POSProductManager.getProduct(ctx, barcode, trxName); + + ibean.setProductId(product.getProductId()); + ibean.setBarCode(barcode); + ibean.setProductName(product.getProductName()); + ibean.setDescription(product.getDescription()); + ibean.setUom(product.getUom()); + ibean.setQtyCount(qtyCsv); + ibean.setQtyCsv(qtyCsv); + ibean.setQtyBook(product.getQtyOnHand()); + ibean.setPriceListId(product.getPriceListId()); + + ilBean.add(ibean); + trx.commit(); + + cartBean = StockManager.addToInventoryCart(ctx, ibean, cartBean, false , true); + } + catch (OperationException e) + { + trx.rollback(); + importProductEx = importProductEx.append("
    Product with barcode: "+ barcode + " at line " + lineNumber + " not imported. ").append(e.getMessage()); + isProductImported = false; + csv.append(s).append("\"\n"); + } + finally + { + trx.close(); + } + + } + + if (isProductImported == false) + { + filename = RandomStringGenerator.randomstring() + ".csv"; + String filepath = ReportManager.getReportPath(filename); + try + { + FileWriter writer = new FileWriter(filepath); + writer.write(csv.toString()); + writer.flush(); + writer.close(); + } + catch (IOException e1) + { + throw new OperationException(e1); + } + throw new ProductNotImportedException(filename+importProductEx.toString()); + } + } + catch (FileNotFoundException e) + { + e.printStackTrace(); + } + catch (IOException e) + { + e.printStackTrace(); + } + finally + { + if (is != null) + { + try + { + is.close(); + } + catch(Exception ex) + {} + } + + if (bis != null) + { + try + { + bis.close(); + } + catch(Exception ex) + {} + } + + if (reader != null) + { + try + { + reader.close(); + } + catch(Exception ex) + {} + } + } + + return cartBean; + + } + +} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/stock/InventoryManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/stock/InventoryManager.java new file mode 100644 index 0000000000..10bb5e46c7 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/businesslogic/stock/InventoryManager.java @@ -0,0 +1,788 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Dec 4, 2006 by alok + */ + + +package org.posterita.businesslogic.stock; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Timestamp; +import java.text.DecimalFormat; +import java.text.ParseException; +import java.util.ArrayList; +import java.util.Properties; + +import javax.swing.text.NumberFormatter; + +import org.compiere.model.MDocType; +import org.compiere.model.MInventory; +import org.compiere.model.MInventoryLine; +import org.compiere.model.MPInstance; +import org.compiere.model.MProduct; +import org.compiere.model.MProductPrice; +import org.compiere.model.MUOM; +import org.compiere.process.DocumentEngine; +import org.compiere.process.InventoryCountCreate; +import org.compiere.process.ProcessInfo; +import org.compiere.process.ProcessInfoParameter; +import org.compiere.util.DB; +import org.compiere.util.Env; +import org.compiere.util.Trx; +import org.posterita.beans.InventoryBean; +import org.posterita.beans.InventoryLineBean; +import org.posterita.beans.ProductBean; +import org.posterita.businesslogic.POSProductManager; +import org.posterita.businesslogic.POSTerminalManager; +import org.posterita.businesslogic.performanceanalysis.CSVReportManager; +import org.posterita.exceptions.CannotCreateInventoryLineException; +import org.posterita.exceptions.NoCheckBoxSelectedException; +import org.posterita.exceptions.OperationException; +import org.posterita.exceptions.ProductNotFoundException; +import org.posterita.lib.UdiConstants; +import org.posterita.util.PoManager; + + +public class InventoryManager +{ + private static final int CREATE_INVENTORY_COUNT_LIST_PROCESS=289; + + public static MInventory createInventory(Properties ctx,String description,String trxName) throws OperationException + { + MInventory inventory = new MInventory(ctx,0,trxName); + MDocType[] docTypes= MDocType.getOfDocBaseType(ctx,MDocType.DOCBASETYPE_MaterialPhysicalInventory); + if(docTypes.length>1) + throw new OperationException("More than one document type for Physical Inventory"); + + inventory.setC_DocType_ID(docTypes[0].get_ID()); + inventory.setM_Warehouse_ID(POSTerminalManager.getWarehouseId(ctx)); + if(description!=null) + inventory.setDescription(description); + + PoManager.save(inventory); + return inventory; + + } + + /** + * Add Inventory Line + * @param ctx + * @param inventoryId + * @param productId + * @param qtyCount + * @param updateCount + * @param trxName + * @return + * @throws OperationException + */ + public static boolean addInventoryLine(Properties ctx, Integer inventoryId,Integer productId, BigDecimal qtyCsv, BigDecimal qtyCount, boolean updateCount,String trxName) throws OperationException + { + if(productId == null || productId.intValue()==0) + { + throw new ProductNotFoundException("product not available"); + } + + MProduct product = new MProduct(ctx,productId.intValue(),trxName); + if(product.getProductType().equalsIgnoreCase(MProduct.PRODUCTTYPE_Service)) + { + throw new CannotCreateInventoryLineException("product is a service, cannot add to inventory"); + } + MInventory inventory = new MInventory(ctx,inventoryId,trxName); + MInventoryLine inventoryLine[]=inventory.getLines(true); + boolean added=true; + if(inventoryLine.length>0) + { + for(int i=0;i 1) + { + throw new OperationException("More that one inventory lines found matching criteria"); + } + else + { + return inventoryLines[0]; + } + + } + + public static void addAllProductsInventoryLine(Properties ctx, Integer inventoryId,String trxName) throws OperationException + { + + MPInstance instance = new MPInstance(ctx,CREATE_INVENTORY_COUNT_LIST_PROCESS,inventoryId.intValue()); + instance.save(); + ProcessInfo poInfo = new ProcessInfo("Create Inventory Count List",CREATE_INVENTORY_COUNT_LIST_PROCESS); + // poInfo.setParameter(param); + poInfo.setRecord_ID(inventoryId.intValue()); + poInfo.setAD_Process_ID(CREATE_INVENTORY_COUNT_LIST_PROCESS); + poInfo.setAD_PInstance_ID(instance.get_ID()); + InventoryCountCreate countCreate = new InventoryCountCreate(); + Trx trx = Trx.get(trxName, false); + boolean success = countCreate.startProcess(ctx,poInfo,trx); + if(success==false) + throw new OperationException("Problem encountered while creating inventory"); + } + + + public static ArrayList getInventoryLines(Properties ctx,int inventoryId) throws OperationException + { + + MInventory inventory = new MInventory(ctx,inventoryId,null); + MInventoryLine inventoryLine[]=inventory.getLines(true); + + ArrayList countList = new ArrayList(); + + InventoryLineBean bean=null; + BigDecimal bookQtyValue=null; + BigDecimal countQtyValue=null; + + for(int i=0;i list=new ArrayList(); + try + { + ResultSet rs = pstmt.executeQuery(); + + while(rs.next()) + { + bean=new InventoryBean(); + + bean.setInventoryId(rs.getInt(1)); + bean.setInventoryNo(rs.getString(2)); + bean.setMovementDate(rs.getString(3)); + bean.setDocStatus(rs.getString(5)); + bean.setDescription(rs.getString(4)); + list.add(bean); + } + rs.close(); + } + catch (SQLException e) + { + throw new OperationException(e); + } + finally + { + try + { + + pstmt.close(); + } + catch (SQLException e) + { + + } + + } + return list; + + } + + public static ArrayList viewInventoryHistory(Properties ctx, int adOrgId, int productId, Timestamp fromDate, Timestamp toDate, String trxName) throws OperationException + { + + String sql = "SELECT inv.M_Inventory_ID, inv.documentNo, inv.movementDate, inv.description, inv.docStatus" + + " FROM M_Inventory inv INNER JOIN m_inventoryline invl ON"+ + " inv.M_Inventory_ID = invl.M_Inventory_ID WHERE"+ + " invl.M_Product_ID = "+ productId +" AND"+ + " inv.AD_Client_ID = "+Env.getAD_Client_ID(ctx)+" AND"+ + " inv.AD_Org_ID = "+ adOrgId+ " AND"+ + " inv.movementDate BETWEEN " + DB.TO_DATE(fromDate, false) + " AND " + DB.TO_DATE(toDate, false); + + PreparedStatement pstmt = DB.prepareStatement(sql,trxName); + ResultSet rs = null; + InventoryBean bean=null; + + ArrayList list=new ArrayList(); + try + { + rs = pstmt.executeQuery(); + + while(rs.next()) + { + bean=new InventoryBean(); + + bean.setInventoryId(rs.getInt(1)); + bean.setInventoryNo(rs.getString(2)); + bean.setMovementDate(rs.getString(3)); + bean.setDocStatus(rs.getString(5)); + bean.setDescription(rs.getString(4)); + list.add(bean); + } + rs.close(); + } + catch (SQLException e) + { + throw new OperationException(e); + } + finally + { + close(pstmt, rs); + } + return list; + + } + + private static void close(PreparedStatement pstmt, ResultSet rs) throws OperationException + { + if (pstmt!=null) + { + try + { + pstmt.close(); + } + catch (Exception ex) + { + throw new OperationException("Could not close prepared statement" , ex); + } + finally + { + pstmt = null; + } + } + if (rs != null) + { + try + { + rs.close(); + } + catch (Exception ex) + { + throw new OperationException("Could not close result set", ex); + } + finally + { + rs = null; + } + } + } + + public static String getInventoryDocStatus(Properties ctx,int inventoryId) + { + MInventory inventory = new MInventory(ctx,inventoryId,null); + return inventory.getDocStatus(); + + } + + + private static void updateCountQty(Properties ctx,int inventoryID) + { + String sql = "update M_INVENTORYLINE set QTYCOUNT=1 where M_INVENTORYLINE_ID="+ + "(select max(M_INVENTORYLINE_ID) from M_INVENTORYLINE where AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+ + " and M_INVENTORY_ID="+inventoryID+")"; + DB.executeUpdate(sql, null); + } + + public static String createCSVForInventory(Properties ctx,ArrayList list) throws OperationException + { + Object[] columns = null; + ArrayList objectList = new ArrayList(); + Object[] header =new Object[]{"Name","Barcode","QtyBook","QtyCount","Book Qty Value","Count Qty Value"}; + objectList.add(header); + + double sumQtyBook = 0.0d; + double sumQtyCount = 0.0d; + double sumBookQtyValue = 0.0d; + double sumCountQtyValue = 0.0d; + + for(InventoryBean bean : list) + { + columns = new Object[]{ + bean.getProductName(), + bean.getBarCode(), + bean.getQtyBook(), + bean.getQtyCount(), + bean.getBookQtyValue(), + bean.getCountQtyValue() + }; + objectList.add(columns); + + sumQtyBook += bean.getQtyBook().doubleValue(); + sumQtyCount += bean.getQtyCount().doubleValue(); + sumBookQtyValue += bean.getBookQtyValue().doubleValue(); + sumCountQtyValue += bean.getCountQtyValue().doubleValue(); + } + Object[] total = new Object[]{ + "Total", + " ", + new Double(sumQtyBook), + new Double(sumQtyCount), + new Double(sumBookQtyValue), + new Double(sumCountQtyValue) + }; + objectList.add(total); + + return CSVReportManager.generateCSVReport(ctx,objectList); + } + + public static void deleteInventory(Properties ctx,int inventoryId) + { + MInventory inventory = new MInventory(ctx,inventoryId,null); + inventory.delete(true); + } + + public static void deleteInventoryLine(Properties ctx,int inventoryId,int M_INVENTORYLINE_ID) + { + String sql="delete from M_INVENTORYLine where M_INVENTORYLINE_ID="+M_INVENTORYLINE_ID+ + " and M_INVENTORY_ID="+inventoryId+ + " and AD_CLIENT_ID="+Env.getAD_Client_ID(ctx); + + + DB.executeUpdate(sql,null); + } + + + public static MInventory mergeInventory(Properties ctx,InventoryBean bean,String trxName) throws OperationException + { + if(bean.getInventoryIds()==null || bean.getInventoryIds().length==0) + { + throw new NoCheckBoxSelectedException("Please select an Inventory"); + } + + MInventory inventory=createInventory(ctx,"Combined created on "+new Timestamp(System.currentTimeMillis()),trxName); + + for(int i = 0; i < bean.getInventoryIds().length; i++) + { + MInventory existingInv = new MInventory(ctx, bean.getInventoryIds()[i],trxName); + + MInventoryLine [] line = existingInv.getLines(true); + + for( int j = 0 ; j< line.length ; j++) + { + addInventoryLine(ctx, inventory.get_ID(),line[j].getProduct().get_ID(), line[j].getQtyCsv(), line[j].getQtyCount(), true, trxName); + } + + existingInv.processIt(DocumentEngine.ACTION_Void); + PoManager.save(existingInv); + } + + return inventory; + } + + + private static ArrayList getProductsNotScanned(Properties ctx, int inventoryId) throws OperationException + { + String sql = "select pr.m_product_id " + + "from M_PRODUCT pr" + + " where not Exists" + + "(select * from m_inventory inv,M_INVENTORYLINE invl" + + " where inv.m_inventory_id=" +inventoryId+ + " and inv.m_inventory_id=invl.m_inventory_id" + + " and invl.m_product_id=pr.m_product_id) " + + // Fix: Cannot do inventory on product that has no storage yet (i.e: No PO/SO) + " and Exists (select * from M_Storage s where s.M_Product_ID=pr.M_Product_ID) " + + "and pr.isactive='Y'" + + " and pr.AD_CLIENT_ID = "+Env.getAD_Client_ID(ctx)+ + " and pr.productType='"+MProduct.PRODUCTTYPE_Item+"'"; + + + PreparedStatement pstmt = DB.prepareStatement(sql,null); + + ArrayList list = new ArrayList(); + + try + { + ResultSet rs = pstmt.executeQuery(); + while(rs.next()) + { + list.add(Integer.valueOf(rs.getInt(1))); + } + rs.close(); + } + catch (SQLException e) + { + throw new OperationException(e); + } + finally + { + try + { + pstmt.close(); + } + catch (SQLException e) + { + + } + } + + return list; + } + + + //------------------------------------------------------------------------------------------// + + public static ArrayList getInventoryReportData(Properties ctx, int inventoryId, String trxName) throws OperationException, SQLException, ParseException + { + ArrayList reportData = new ArrayList(); + NumberFormatter qtyformatter = new NumberFormatter(new DecimalFormat("0")); + NumberFormatter valueformatter = new NumberFormatter(new DecimalFormat("0.00")); + + MInventory inventory = new MInventory(ctx,inventoryId,null); + MInventoryLine inventoryLine[]=inventory.getLines(true); + + String productName = null; + BigDecimal qtyBook = Env.ZERO; + BigDecimal qtyCount = Env.ZERO; + BigDecimal bookValue = Env.ZERO; + BigDecimal countValue = Env.ZERO; + BigDecimal qtyBookTotal = Env.ZERO; + BigDecimal qtyCountTotal = Env.ZERO; + BigDecimal valueBookTotal = Env.ZERO; + BigDecimal valueCountTotal = Env.ZERO; + BigDecimal qtyDifference = Env.ZERO; + BigDecimal valueDifference = Env.ZERO; + + + for(int i=0;i list=new ArrayList(); + try + { + ResultSet rs = pstmt.executeQuery(); + + while(rs.next()) + { + bean=new InventoryBean(); + + bean.setInventoryId(rs.getInt(1)); + bean.setInventoryNo(rs.getString(2)); + bean.setMovementDate(rs.getString(3)); + bean.setDocStatus(rs.getString(5)); + bean.setDescription(rs.getString(4)); + list.add(bean); + } + rs.close(); + } + catch (SQLException e) + { + throw new OperationException(e); + } + finally + { + try + { + + pstmt.close(); + } + catch (SQLException e) + { + + } + + } + return list; + + } + + public static ArrayList searchProductInInventory(Properties ctx, Integer productId, String barcode) throws OperationException + { + StringBuffer sql = new StringBuffer(); + + sql.append(" select inv.m_inventory_id, inv.documentno, to_char(inv.movementdate,'dd/Mon/yyyy'), inv.description, inv.docstatus"); + sql.append(" from m_inventory inv"); + sql.append(" inner join m_inventoryline invl on invl.m_inventory_id = inv.m_inventory_id"); + sql.append(" where inv.AD_CLIENT_ID=").append(Env.getAD_Client_ID(ctx)); + sql.append(" and inv.ad_org_id=").append(Env.getAD_Org_ID(ctx)); + sql.append(" and invl.m_product_id ="); + + + if(productId != null) + { + sql.append(productId); + } + + if(barcode != null) + { + ProductBean pBean = POSProductManager.getProduct(ctx, barcode, null); + sql.append(pBean.getProductId()); + } + + sql.append(" order by DOCUMENTNO desc"); + + PreparedStatement pstmt = DB.prepareStatement(sql.toString(),null); + + InventoryBean bean=null; + + ArrayList list=new ArrayList(); + try + { + ResultSet rs = pstmt.executeQuery(); + + while(rs.next()) + { + bean=new InventoryBean(); + + bean.setInventoryId(rs.getInt(1)); + bean.setInventoryNo(rs.getString(2)); + bean.setMovementDate(rs.getString(3)); + bean.setDocStatus(rs.getString(5)); + bean.setDescription(rs.getString(4)); + list.add(bean); + } + rs.close(); + } + catch (SQLException e) + { + throw new OperationException(e); + } + finally + { + try + { + + pstmt.close(); + } + catch (SQLException e) + { + + } + + } + return list; + + } + +} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/stock/MMovementManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/stock/MMovementManager.java new file mode 100644 index 0000000000..0bc2286ffa --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/businesslogic/stock/MMovementManager.java @@ -0,0 +1,1405 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on May 22, 2006 by alok + */ +package org.posterita.businesslogic.stock; + +import java.math.BigDecimal; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Timestamp; +import java.text.DecimalFormat; +import java.text.ParseException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Properties; + +import javax.servlet.http.HttpServletRequest; +import javax.swing.text.NumberFormatter; + +import org.apache.ecs.xhtml.div; +import org.apache.ecs.xhtml.input; +import org.apache.ecs.xhtml.table; +import org.apache.ecs.xhtml.td; +import org.apache.ecs.xhtml.th; +import org.apache.ecs.xhtml.tr; +import org.compiere.model.MDocType; +import org.compiere.model.MGLCategory; +import org.compiere.model.MLocation; +import org.compiere.model.MLocator; +import org.compiere.model.MMovement; +import org.compiere.model.MMovementConfirm; +import org.compiere.model.MMovementLine; +import org.compiere.model.MOrder; +import org.compiere.model.MOrg; +import org.compiere.model.MOrgInfo; +import org.compiere.model.MPriceList; +import org.compiere.model.MProduct; +import org.compiere.model.MProductPrice; +import org.compiere.model.MStorage; +import org.compiere.model.MWarehouse; +import org.compiere.process.DocAction; +import org.compiere.process.DocumentEngine; +import org.compiere.util.DB; +import org.compiere.util.Env; +import org.posterita.Constants; +import org.posterita.TangoColors; +import org.posterita.beans.ItemBean; +import org.posterita.beans.MMovementCartBean; +import org.posterita.beans.PaymentDetailsBean; +import org.posterita.beans.ShoppingCartBean; +import org.posterita.beans.StockMovementBean; +import org.posterita.businesslogic.POSManager; +import org.posterita.businesslogic.POSTerminalManager; +import org.posterita.businesslogic.PaymentManager; +import org.posterita.businesslogic.administration.PriceListManager; +import org.posterita.businesslogic.administration.WarehouseManager; +import org.posterita.core.TmkJSPEnv; +import org.posterita.exceptions.OperationException; +import org.posterita.exceptions.ProductNotFoundException; +import org.posterita.exceptions.ProductNotOnPriceListException; +import org.posterita.lib.UdiConstants; +import org.posterita.util.PoManager; +/** + * manager for moving product between warehouses and locators + * @author sendy + * + */ +public class MMovementManager +{ + /** + * Create New Inventory Move (Material Movement) + * @param ctx + * @param description + * @param trxName + * @return MMovement + * @throws OperationException + */ + public static MMovement createInventoryMove(Properties ctx,String description,String trxName) throws OperationException + { + MMovement mmovement = new MMovement(ctx, 0, trxName); + mmovement.setDescription(description); + // Set Material Movement Document + int docTypeId = getDocType(ctx, "Inter Branch Transfer"); + mmovement.setC_DocType_ID(docTypeId); + + PoManager.save(mmovement); + return mmovement; + + } + + /** + * Get Document Type + * @param ctx + * @param name + * @return + * @throws OperationException + */ + private static int getDocType(Properties ctx, String name) throws OperationException + { + if (name == null) + { + return 0; + } + + int[] docTypesMM = MDocType.getAllIDs(MDocType.Table_Name, "AD_Client_ID = "+ Env.getAD_Client_ID(ctx)+ " AND docBaseType = '" + MDocType.DOCBASETYPE_MaterialMovement + "' AND name = '" + name +"'", null); + + int docType_Id = 0; + int[] glc = MGLCategory.getAllIDs(MGLCategory.Table_Name, "AD_Client_ID = "+ Env.getAD_Client_ID(ctx)+" AND name = 'Material Management'", null); + + if (glc.length == 0) + { + throw new OperationException("gl category does not exist"); + + } + if (glc.length > 1) + { + throw new OperationException("more than one gl category found"); + } + + int gl_catId = glc[0]; + if (docTypesMM.length == 0) + { + MDocType docType = new MDocType(ctx, 0 ,null); + docType.setAD_Org_ID(0); + docType.setName(name); + docType.setPrintName(name); + docType.setGL_Category_ID(gl_catId); + docType.setDocBaseType(MDocType.DOCBASETYPE_MaterialMovement); + docType.setIsInTransit(true); + docType.save(); + docType_Id = docType.getC_DocType_ID(); + } + else if (docTypesMM.length> 1) + { + throw new OperationException("Error while getting document type for material movement"); + } + + else + { + docType_Id = docTypesMM[0]; + } + + return docType_Id; + } + + /** + * Check Locator + * @param locatorFrom + * @param locatorTo + * @throws OperationException + */ + private static void checkLocator(int locatorFrom, int locatorTo) throws OperationException + { + if (locatorFrom == 0 || locatorTo == 0) + { + throw new OperationException("No warehouse locators defined"); + } + + if (locatorFrom == locatorTo) + { + throw new OperationException("Organisation from cannot be equal to Organisation To!"); + } + + } + + /** + * Get Locator + * @param ctx + * @param adClientId + * @param org + * @param trxName + * @return + */ + private static int getLocator(Properties ctx, int adClientId, MOrg org, String trxName) + { + MOrgInfo orgInfo = org.getInfo(); + + int warehouseId = orgInfo.getM_Warehouse_ID(); + + int[] locator = MLocator.getAllIDs(MLocator.Table_Name, "AD_Client_ID = "+ adClientId + + " AND AD_Org_ID = " + org.getAD_Org_ID() + + " AND M_Warehouse_ID = " + warehouseId, trxName); + + if (locator.length == 0) + { + return 0; + } + + else + { + return locator[0]; + } + + } + + /** + * Create Or Update Material Movement Line + * @param ctx + * @param movementId + * @param productId + * @param qtyToMove + * @param fromLocatorId + * @param toLocatorId + * @param trxName + * @return + * @throws OperationException + */ + public static boolean createOrUpdateMaterialMovementLine(Properties ctx, int movementId, int productId, BigDecimal qtyToMove, int fromLocatorId, int toLocatorId, String trxName) throws OperationException + { + if (trxName == null) + { + throw new OperationException("transaction cannot be null while creating a material movement line"); + } + + if (movementId < 1) + { + throw new OperationException("movement Id is mandatory"); + } + + if(productId ==0) + { + throw new ProductNotFoundException("product not available"); + } + + MProduct product = new MProduct(ctx, productId, trxName); + if(product.getProductType().equalsIgnoreCase(MProduct.PRODUCTTYPE_Service)) + { + throw new OperationException("product is a service, cannot add to stock transfer"); + } + + checkLocator(fromLocatorId, toLocatorId); + + MMovement movement = new MMovement(ctx, movementId, trxName); + MMovementLine[] movementLine = movement.getLines(true); + boolean added = true; + + if(movementLine.length>0) + { + for(int i=0;i getAvailableProducts(Properties ctx, int orgId, String productName, + String description, String barcode, String trxName) throws ProductNotFoundException + { + + ArrayList productList = new ArrayList(); + StringBuffer sql = new StringBuffer("SELECT s.M_Product_ID FROM M_Storage s INNER JOIN M_Product p on ") + .append("s.M_Product_ID = p.M_Product_ID WHERE s.AD_Client_ID = ? AND s.AD_Org_ID = ? "); + + ArrayList list = new ArrayList(); + if (productName!=null && !"".equals(productName)) + { + sql.append(" AND lower(p.name) like lower(%?%)"); + list.add(productName); + } + if (description!=null && !"".equals(description)) + { + sql.append(" AND lower(p.description) like " +"(%?%)"); + list.add(description); + } + if (barcode!=null && !"".equals(barcode)) + { + sql.append(" AND p.upc = ?"); + list.add(barcode); + } + PreparedStatement pstmt = null; + ResultSet rs = null; + try + { + pstmt = DB.prepareStatement (sql.toString(), trxName); + pstmt.setInt(1, Env.getAD_Client_ID(ctx)); + pstmt.setInt(2, orgId); + + for (int i = 0; i convertToBeanList(Properties ctx, ArrayList prodList, HashMap stockProductList, ArrayList product, int preOrgFromId, int orgFromId, int orgToId, String trxName) throws OperationException + { + MOrg orgFrom = MOrg.get(ctx, orgFromId); + MOrgInfo orgInfo = orgFrom.getInfo(); + int warehouseId = orgInfo.getM_Warehouse_ID(); + + MOrg orgTo = MOrg.get(ctx, orgToId); + + if (orgFromId != preOrgFromId) + { + if (prodList != null) + { + prodList.clear(); + } + preOrgFromId = orgFromId; + } + + Iterator prodIter = product.iterator(); + while (prodIter.hasNext()) + { + StockMovementBean stockBean = new StockMovementBean(); + MProduct prod = prodIter.next(); + + if (!stockProductList.containsKey(prod.getM_Product_ID())) + { + stockBean = getStockMovementBean(ctx, 0, prod, orgFrom, orgTo, Env.ZERO); + } + + prodList.add(stockBean); + stockProductList.put(prod.getM_Product_ID(), stockBean); + } + return prodList; + } + + /** + * + * @param ctx + * @param movementLineId + * @param product + * @param orgFrom + * @param orgTo + * @param qtyToMove + * @return + * @throws OperationException + */ + public static StockMovementBean getStockMovementBean(Properties ctx, int movementLineId, MProduct product, + MOrg orgFrom, MOrg orgTo, BigDecimal qtyToMove) throws OperationException + { + StockMovementBean stockBean = new StockMovementBean(); + + int movementId = 0; + BigDecimal qtyAvailable = Env.ZERO; + String documentNo = ""; + String docStatus = ""; + int lineNo = 0; + + if (product == null) + { + throw new OperationException("product cannot be null"); + } + if (orgFrom == null || orgTo == null) + { + throw new OperationException("organisations cannot be null"); + } + + MWarehouse warehouseFrom = MWarehouse.get(ctx, orgFrom.getInfo().getM_Warehouse_ID()); + MLocator fromLoc = MLocator.get(ctx, warehouseFrom.get_ID(), warehouseFrom.getName()+" Locator", "0", "0", "0"); + qtyAvailable = MStorage.getQtyAvailable(warehouseFrom.get_ID(), fromLoc.getM_Locator_ID(), product.getM_Product_ID(), + 0, null); + + MMovementLine movementLine = new MMovementLine(ctx, movementLineId, null); + if (movementLineId != 0) + { + movementId = movementLine.getM_Movement_ID(); + fromLoc = MLocator.get(ctx,movementLine.getM_Locator_ID()); + orgFrom = MOrg.get(ctx, fromLoc.getAD_Org_ID()); + + MLocator toLoc = MLocator.get(ctx,movementLine.getM_LocatorTo_ID()); + orgTo = MOrg.get(ctx, toLoc.getAD_Org_ID()); + + qtyToMove = movementLine.getMovementQty(); + + MMovement movement = new MMovement(ctx, movementLine.getM_Movement_ID(), null); + documentNo = movement.getDocumentNo(); + docStatus = movement.getDocStatus(); + lineNo = movementLine.getLine(); + } + stockBean.setMovementId(movementId); + stockBean.setMovementLineId(movementLineId); + stockBean.setLineNo(lineNo); + stockBean.setDocumentNo(documentNo); + stockBean.setDocStatus(docStatus); + stockBean.setProductId(product.getM_Product_ID()); + stockBean.setProductName(product.getName()); + stockBean.setOrgFromName(orgFrom.getName()); + stockBean.setOrgToName(orgTo.getName()); + stockBean.setIsActive(product.isActive()); + stockBean.setDescription(product.getDescription()); + stockBean.setBarCode(product.getUPC()); + stockBean.setQtyOnHand(qtyAvailable); + stockBean.setQtyToMove(Env.ZERO); + stockBean.setOrgFromId(orgFrom.get_ID()); + stockBean.setOrgToId(orgTo.get_ID()); + stockBean.setUom(product.getUOMSymbol()); + stockBean.setQuantity(qtyToMove); + return stockBean; + } + + /** + * + * @param productId + * @param stockProductList + * @return + */ + public static StockMovementBean getStockBean(int productId , HashMap stockProductList) + { + if (stockProductList != null) + { + if (stockProductList.containsKey(productId)) + { + return stockProductList.get(productId); + } + } + + return null; + + } + + /** + * + * @param ctx + * @param movementId + * @return + * @throws OperationException + */ + public static ArrayList getMovementLines(Properties ctx, int movementId) throws OperationException + { + MMovement movement = new MMovement(ctx, movementId, null); + ArrayList movementLines = new ArrayList(); + + MMovementLine[] lines = movement.getLines(true); + + for (MMovementLine line : lines) + { + StockMovementBean bean = new StockMovementBean(); + int locFromId = line.getM_Locator_ID(); + int locToId = line.getM_LocatorTo_ID(); + MLocator locFrom = MLocator.get(ctx, locFromId); + MLocator locTo = MLocator.get(ctx, locToId); + int orgFromId = locFrom.getAD_Org_ID(); + int orgToId = locTo.getAD_Org_ID(); + + MOrg orgFrom = MOrg.get(ctx, orgFromId); + MOrg orgTo = MOrg.get(ctx, orgToId); + + bean = getStockMovementBean(ctx, line.get_ID(), line.getProduct(), orgFrom, orgTo, null); + + movementLines.add(bean); + } + return movementLines; + } + + /** + * + * @param ctx + * @param orgFromId + * @param docStatus + * @param docNo + * @param fromDate + * @param toDate + * @return + * @throws OperationException + */ + public static ArrayList getMovementByOrgFrom(Properties ctx, int orgFromId, String docStatus, String docNo, Timestamp fromDate, Timestamp toDate) throws OperationException + { + ArrayList list = new ArrayList(); + int adClientId = Env.getAD_Client_ID(ctx); + + int docTypeId = getDocType(ctx, "Inter Branch Transfer"); + + StringBuffer sql = new StringBuffer("SELECT DISTINCT(mm.M_Movement_ID) from M_Movement mm INNER JOIN " + + "(M_MovementLine ml INNER JOIN M_Locator lc ON ml.M_Locator_ID = lc.M_Locator_ID) " + + "ON mm.M_Movement_ID = ml.M_Movement_ID WHERE mm.C_DocType_ID = ? " + + "AND mm.AD_Client_ID = ? AND lc.AD_Org_ID = ? "); + + + if (docStatus != null) + { + sql = sql.append(" AND mm.DocStatus = '" + docStatus + "'"); + } + + if (docNo != null) + { + if (docNo.indexOf('%') != -1) + { + sql = sql.append(" AND mm.DocumentNo LIKE '" + docNo + "'"); + } + else + { + sql = sql.append(" AND mm.DocumentNo LIKE '%" + docNo + "%'"); + } + } + + if (fromDate != null && toDate != null) + { + sql = sql.append(" AND mm.movementDate >= " + + DB.TO_DATE(fromDate, true) +" AND mm.movementDate <= " + DB.TO_DATE(toDate, true)); + } + + PreparedStatement pstmt = null; + ResultSet rs = null; + + try + { + pstmt = DB.prepareStatement(sql.toString(), null); + pstmt.setInt(1, docTypeId); + pstmt.setInt(2, adClientId); + pstmt.setInt(3, orgFromId); + + rs = pstmt.executeQuery(); + while (rs.next()) + { + int movementId = rs.getInt(1); + + MMovement movement = new MMovement(ctx, movementId, null); + StockMovementBean bean = new StockMovementBean(); + bean.setIsActive(movement.isActive()); + bean.setMovementId(movementId); + bean.setDescription(movement.getDescription()); + bean.setDocStatus(movement.getDocStatus()); + MDocType dt = MDocType.get(ctx, movement.getC_DocType_ID()); + bean.setDocumentType(dt.getName()); + bean.setDocumentNo(movement.getDocumentNo()); + MOrg org = MOrg.get(ctx, movement.getAD_Org_ID()); + bean.setOrgName(org.getName()); + String isApproved = movement.isApproved()? "Y":"N"; + bean.setIsApproved(isApproved); + bean.setMovementDate(String.valueOf(movement.getMovementDate())); + + list.add(bean); + } + } + catch (SQLException e) + { + + } + finally + { + DB.close(rs, pstmt); + rs=null; + pstmt=null; + } + + return list; + } + + /** + * + * @param ctx + * @param orgId + * @param type + * @param productId + * @param fromDate + * @param toDate + * @return + * @throws OperationException + */ + public static ArrayList getMMovement(Properties ctx, String orgId, String type, int productId, Timestamp fromDate, Timestamp toDate) throws OperationException + { + ArrayList list = new ArrayList(); + int adClientId = Env.getAD_Client_ID(ctx); + + int docTypeId = getDocType(ctx, "Inter Branch Transfer"); + + StringBuffer sql = new StringBuffer("SELECT mm.M_Movement_ID, lc.AD_Org_Id from M_Movement mm INNER JOIN "); + if ("1".equals(type)) + { + sql.append("(M_MovementLine ml INNER JOIN M_Locator lc ON ml.M_LocatorTo_ID = lc.M_Locator_ID) "); + } + if ("2".equals(type)) + { + sql.append("(M_MovementLine ml INNER JOIN M_Locator lc ON ml.M_Locator_ID = lc.M_Locator_ID) "); + } + + sql.append("ON mm.M_Movement_ID = ml.M_Movement_ID WHERE ml.M_Product_ID = "+ productId + + " AND mm.AD_Client_ID = "+adClientId+" AND lc.AD_Org_ID =" + orgId + + " AND mm.DocStatus IN ('CO','CL')"); + + + if (fromDate != null && toDate != null) + { + sql = sql.append(" AND mm.MovementDate BETWEEN " + DB.TO_DATE(fromDate, false) + + " AND " + DB.TO_DATE(toDate, false)); + } + + PreparedStatement pstmt = null; + ResultSet rs = null; + + try + { + pstmt = DB.prepareStatement(sql.toString(), null); + rs = pstmt.executeQuery(); + while (rs.next()) + { + int movementId = rs.getInt(1); + int org_Id = rs.getInt(2); + MOrg organisation = MOrg.get(ctx, org_Id); + + MMovement movement = new MMovement(ctx, movementId, null); + StockMovementBean bean = new StockMovementBean(); + bean.setOrgName(organisation.getName()); + bean.setIsActive(movement.isActive()); + bean.setMovementId(movementId); + bean.setDescription(movement.getDescription()); + bean.setDocStatus(movement.getDocStatus()); + MDocType dt = MDocType.get(ctx, movement.getC_DocType_ID()); + bean.setDocumentType(dt.getName()); + bean.setDocumentNo(movement.getDocumentNo()); + String isApproved = movement.isApproved()? "Y":"N"; + bean.setIsApproved(isApproved); + bean.setMovementDate(String.valueOf(movement.getMovementDate())); + + list.add(bean); + } + } + catch (SQLException e) + { + throw new OperationException("could not execute query"+ e); + } + finally + { + DB.close(rs, pstmt); + rs=null; + pstmt=null; + } + + return list; + } + + /** + * + * @param ctx + * @param orgToId + * @param trxName + * @return + */ + public static ArrayList getMoveConfirmByOrgTo(Properties ctx, int orgToId, String trxName) + { + + int adClientId = Env.getAD_Client_ID(ctx); + + MDocType[] docTypes = MDocType.getOfDocBaseType(ctx, MDocType.DOCBASETYPE_MaterialMovement); + int c_doctype_id = 0; + + for(MDocType docType:docTypes) + { + if ("Inter Branch Transfer".equals(docType.getName())) + { + c_doctype_id = docType.getC_DocType_ID(); + } + } + String sql = "SELECT DISTINCT(mc.M_MovementConfirm_ID) FROM M_MovementConfirm mc INNER JOIN (M_Movement mm INNER JOIN " + + "(M_MovementLine ml INNER JOIN M_Locator lc ON ml.M_LocatorTo_ID = lc.M_Locator_ID)" + + "ON mm.M_Movement_ID = ml.M_Movement_ID) ON mc.M_Movement_ID = mm.M_Movement_ID WHERE " + + "mm.C_DocType_ID = ? AND mm.AD_Client_ID = ? AND lc.AD_Org_ID = ?"; + + PreparedStatement pstmt = null; + ResultSet rs = null; + ArrayList m_list = new ArrayList(); + try + { + pstmt = DB.prepareStatement(sql, trxName); + pstmt.setInt(1, c_doctype_id); + pstmt.setInt(2, adClientId); + pstmt.setInt(3, orgToId); + + rs = pstmt.executeQuery(); + + while (rs.next()) + { + int moveConfirmId = rs.getInt(1); + StockMovementBean bean = new StockMovementBean(); + + MMovementConfirm moveConfirm = new MMovementConfirm(ctx, moveConfirmId, trxName); + int movementId = moveConfirm.getM_Movement_ID(); + MMovement movement = new MMovement(ctx, movementId, trxName); + MMovementLine[] lines = movement.getLines(true); + if (lines.length > 0) + { + int locatorId = lines[0].getM_Locator_ID(); + MLocator loc = MLocator.get(ctx, locatorId); + MOrg org = MOrg.get(ctx, loc.getAD_Org_ID()); + bean.setOrgFromName(org.getName()); + } + bean.setMovementId(movementId); + bean.setMoveConfirmId(moveConfirmId); + bean.setIsActive(moveConfirm.isActive()); + bean.setDocStatus(moveConfirm.getDocStatus()); + bean.setDocumentNo(movement.getDocumentNo()); + bean.setMovementDate(String.valueOf(movement.getMovementDate())); + m_list.add(bean); + } + } + catch (SQLException e) + { + + } + finally + { + DB.close(rs, pstmt); + rs=null; + pstmt=null; + } + + return m_list; + } + + /** + * + * @param ctx + * @param moveConfirmId + * @param trxName + * @throws OperationException + */ + public static void completeMoveConfirm(Properties ctx, int moveConfirmId, + String trxName) throws OperationException + { + + MMovementConfirm moveConfirm = new MMovementConfirm(ctx, moveConfirmId, trxName); + String docStatus = moveConfirm.getDocStatus(); + int movementId = moveConfirm.getM_Movement_ID(); + + + if (!docStatus.equals(DocAction.STATUS_Drafted) || docStatus.equals(DocAction.STATUS_InProgress)) + { + throw new OperationException("material movement document status invalid"); + } + + moveConfirm.setDocStatus(DocumentEngine.STATUS_Completed); + moveConfirm.setDocAction(DocumentEngine.ACTION_Close); + moveConfirm.completeIt(); + moveConfirm.save(); + + MMovement movement = new MMovement(ctx, movementId, trxName); + movement.setIsApproved(true); + movement.save(); + } + + /** + * + * @param ctx + * @param list + * @param moveConfirmId + * @return + */ + public static ArrayList getConfirmList(Properties ctx, + ArrayList list, int moveConfirmId) + { + Iterator iter = list.iterator(); + while (iter.hasNext()) + { + StockMovementBean bean = iter.next(); + int movId = bean.getMoveConfirmId(); + if (movId == moveConfirmId) + { + MMovementConfirm mvConfirm = new MMovementConfirm(ctx, moveConfirmId, null); + bean.setDocStatus(mvConfirm.getDocStatus()); + } + } + return list; + } + + /** + * + * @param ctx + * @param list + * @param movementId + * @return + */ + public static ArrayList getMoveList(Properties ctx, + ArrayList list, int movementId) + { + if (list != null) + { + Iterator iter = list.iterator(); + while (iter.hasNext()) + { + StockMovementBean bean = iter.next(); + int movId = bean.getMovementId(); + + if (movId == movementId) + { + MMovement movement = new MMovement(ctx, movId, null); + bean.setDocStatus(movement.getDocStatus()); + } + } + } + return list; + } + + /** + * + * @param ctx + * @param movementId + * @return + */ + public static StockMovementBean getBean(Properties ctx, int movementId) + { + MMovement movement = new MMovement(ctx, movementId, null); + MMovementLine[] lines = movement.getLines(true); + + MLocator locFrom = new MLocator(ctx,lines[0] .getM_Locator_ID(), null); + MLocator locTo = new MLocator(ctx, lines[0].getM_LocatorTo_ID(), null); + + MOrg orgFrom = MOrg.get(ctx, locFrom.getAD_Org_ID()); + MOrg orgTo = MOrg.get(ctx, locTo.getAD_Org_ID()); + + MOrgInfo orgFromInfo = orgFrom.getInfo(); + MOrgInfo orgToInfo = orgTo.getInfo(); + + MLocation locationFrom = MLocation.get(ctx, orgFromInfo.getC_Location_ID(), null); + MLocation locationTo = MLocation.get(ctx, orgToInfo.getC_Location_ID(), null); + + StockMovementBean bean = new StockMovementBean(); + + String addressFrom = locationFrom.getAddress1() == null? "":locationFrom.getAddress1(); + String addressTo = locationTo.getAddress1() == null? "":locationTo.getAddress1(); + + bean.setAddress1(addressFrom); + bean.setAddress2(addressTo); + bean.setDocStatus(movement.getDocStatus()); + bean.setDocumentNo(movement.getDocumentNo()); + bean.setMovementDate(movement.getMovementDate().toString()); + bean.setOrgFromName(orgFrom.getName()); + bean.setOrgToName(orgTo.getName()); + + return bean; + + } + + /** + * + * @param ctx + * @param qtyToMove + * @param index + * @param salesPriceListId + * @param list + * @return + * @throws OperationException + */ + public static BigDecimal setQtyToMove(Properties ctx, BigDecimal qtyToMove, Integer index, Integer salesPriceListId, ArrayList list) throws OperationException + { + qtyToMove = qtyToMove == null? Env.ZERO : qtyToMove; + + if (index == null) + { + throw new OperationException("stock index is null"); + } + + StockMovementBean bean = list.get(index); + + BigDecimal salesPriceList = Env.ZERO; + if (salesPriceListId == 0) + { + salesPriceListId = POSTerminalManager.getSOPriceListId(ctx); + } + + MPriceList priceList = MPriceList.get(ctx, salesPriceListId, null); + MProductPrice productPrice = MProductPrice.get(ctx, + PriceListManager.getPriceListVersionID(ctx, salesPriceListId, null), bean.getProductId(), null); + if (productPrice != null) + { + salesPriceList = productPrice.getPriceList(); + } + BigDecimal stockValue = salesPriceList.multiply(qtyToMove); + bean.setStockValue(stockValue); + bean.setQtyToMove(qtyToMove); + return stockValue; + } + + //***********************************************************************************************// + + /** + * Get Stock Transfer Cart in HTML + * @param itemList + * @param ctx + * @return + * @throws ParseException + * @throws OperationException + */ + private static String getMMovementCartAsHTML(ArrayList itemList, Properties ctx) throws ParseException, OperationException + { + NumberFormatter formatter = new NumberFormatter(new DecimalFormat("0.00")); + + int priceListId = Env.getContextAsInt(ctx, UdiConstants.PRICELIST_CTX_PARAM); + String currSymbol = PriceListManager.getCurrency(ctx, priceListId); + + BigDecimal totalQty = Env.ZERO; + BigDecimal totalValue = Env.ZERO; + + String[] headers = {"Product Name","Description","Barcode","UOM", "Qty Available", "No of Pack", "Qty To Move", "Stock Value"}; + table tbl = new table("0", "0", "0", "100%", ""); + tbl.setID("cart"); + tbl.setBgColor(TangoColors.ALUMINIUM_2); + + BigDecimal qty = Env.ZERO; + BigDecimal stockValue = Env.ZERO; + + tr headerRow = new tr(); + headerRow.setClass("itemTitleList"); + + + for(String header : headers) + { + th h = new th(header); + headerRow.addElement(h); + } + + tbl.addElement(headerRow); + + //add body + int count = 0; + + if(itemList != null) + for(ItemBean bean : itemList) + { + count ++; + + tr dataRow = new tr(); + + if(count % 2 == 0) + { + dataRow.setClass("evenRow"); + } + else + { + dataRow.setClass("oddRow"); + } + dataRow.setID("row" + count); + dataRow.addAttribute("productId", bean.getProductId().toString()); + dataRow.addAttribute("qty", bean.getQtyToMove().toString()); + dataRow.addAttribute("unitsPerPack", bean.getUnitsPerPack().toString()); + qty = bean.getQtyToMove(); + stockValue = bean.getStockValue(); + + input packSize = new input("text", "packSize" + count, bean.getNoOfPack()); + packSize.setID("packSize" + count); + packSize.setSize(10); + + totalQty = totalQty.add(qty); + totalValue = totalValue.add(stockValue); + String[] columnData = { + bean.getProductName(), + bean.getDescription(), + bean.getBarCode(), + bean.getUom(), + bean.getQtyBook().toString(), + packSize.toString(), + bean.getQtyToMove().toString(), + bean.getStockValue().toString() + }; + + for(int i=0; iTOTAL STOCK TO BE TRANSFERED:  ").setColSpan("6")); + footerRow.addElement(new td(new div(totalQty.toString()).setID("cartTotal"))); + footerRow.addElement(new td(new div(totalValue.toString()).setID("totalStockValue"))); + + tbl.addElement(footerRow); + + + return tbl.toString(); + } + + + /** + * Get Stock Transfer Cart in HTML + * @param request + * @return + * @throws ParseException + * @throws OperationException + */ + public static String getMMovementCartAsHTML(HttpServletRequest request) throws ParseException, OperationException + { + //add body + ArrayList itemList = (ArrayList) request.getSession().getAttribute(Constants.MMOVEMENT_CART_ITEMS); + Properties ctx = TmkJSPEnv.getCtx(request); + return getMMovementCartAsHTML(itemList, ctx); + } + + /** + * Clear Stock Transfer Cart + * @param request + */ + public static void clearCart(Properties ctx, HttpServletRequest request) + { + request.setAttribute("qtyTotal", null); + request.setAttribute("grandTotal", null); + + Env.setContext(ctx, Constants.MMOVEMENT_ID, ""); + request.getSession().removeAttribute(Constants.DOC_NO); + request.getSession().removeAttribute(Constants.DOC_STATUS); + request.getSession().removeAttribute(Constants.DESCRIPTION); + request.getSession().removeAttribute(Constants.MMOVEMENT_ID); + request.getSession().removeAttribute(Constants.MMOVEMENT_CART); + request.getSession().removeAttribute(Constants.MMOVEMENT_CART_ITEMS); + + } + + /** + * Set the no of pack + * @param ctx + * @param itemBean + * @throws OperationException + */ + public static void setNoOfPack(Properties ctx, ItemBean itemBean) throws OperationException + { + //Load Product + MProduct product = new MProduct(ctx, itemBean.getProductId(),null); + + // Calculate no of pack + BigDecimal UnitsPerPack = new BigDecimal(product.getUnitsPerPack()); + BigDecimal noOfPack = itemBean.getQtyToMove().divide(UnitsPerPack, BigDecimal.ROUND_UP); + itemBean.setNoOfPack(noOfPack.intValue()); + + } + + /** + * Delete Movement line + * @param ctx + * @param movementId + */ + public static void deleteMovementLine(Properties ctx, int movementLineId) + { + // Load Movement lines and force delete + MMovementLine movementLine = new MMovementLine(ctx, movementLineId, null); + movementLine.delete(true, null); + } + + /** + * Delete Movement Lines + * @param ctx + * @param movementId + */ + public static void deleteMovementLines(Properties ctx,int movementId) + { + String sql="delete from M_MovementLine where " + + " M_Movement_Id="+movementId+ + " and AD_CLIENT_ID="+Env.getAD_Client_ID(ctx); + + + DB.executeUpdate(sql,null); + } + + /** + * view Inventory Move (Material Movement) History + * @param ctx + * @return list of inventory move + * @throws OperationException + */ + public static ArrayList viewMMovementHistory(Properties ctx, String docStatus, Integer month, Integer year) throws OperationException + { + + ArrayList stockMovementList = new ArrayList(); + StockMovementBean stockMovementBean = null; + + /** + * SQL FOR MOVEMENT HISTORY + */ + StringBuffer sql = new StringBuffer(); + sql.append(" SELECT M_MOVEMENT_ID") + .append(" FROM M_MOVEMENT ") + .append(" WHERE AD_CLIENT_ID = ").append(Env.getAD_Client_ID(ctx)) + .append(" AND AD_ORG_ID = ").append(Env.getAD_Org_ID(ctx)); + + if (docStatus != null) + { + sql = sql.append(" and docstatus='").append(docStatus).append("'"); + } + + if (month != null) + { + String mm = String.valueOf(month); + if (mm.length() == 1) + { + mm = "0" + mm; + } + + sql = sql.append( " AND TO_CHAR(MOVEMENTDATE, 'mm')= '").append(mm).append("'"); + } + + if (year != null) + { + sql = sql.append(" AND TO_CHAR(MOVEMENTDATE, 'yyyy') ='").append(year).append("'"); + } + + sql.append(" ORDER BY DOCUMENTNO DESC "); + + PreparedStatement pstmt = DB.prepareStatement(sql.toString(), null); + + try + { + ResultSet rs = pstmt.executeQuery(); + + while(rs.next()) + { + stockMovementBean = new StockMovementBean(); + stockMovementBean.setMovementId(rs.getInt(1)); + + MMovement mmovement = new MMovement(ctx, stockMovementBean.getMovementId(), null); + + stockMovementBean.setIsActive(mmovement.isActive()); + stockMovementBean.setDocumentNo(mmovement.getDocumentNo()); + + MDocType docType = new MDocType(ctx, mmovement.getC_DocType_ID(), null); + String documentType = docType.getName() ; + stockMovementBean.setDocumentType(documentType); + + stockMovementBean.setMovementDate(mmovement.getMovementDate().toString()); + stockMovementBean.setDescription(mmovement.getDescription()); + stockMovementBean.setDocStatus(mmovement.getDocStatus()); + + if(mmovement.isApproved() == true) + { + stockMovementBean.setIsApproved("Y"); + } + else + { + stockMovementBean.setIsApproved("N"); + } + + stockMovementList.add(stockMovementBean); + } + rs.close(); + } + catch (SQLException e) + { + throw new OperationException(e); + } + finally + { + try + { + pstmt.close(); + } + catch (SQLException e) + { + + } + + } + + return stockMovementList; + } + + /** + * Delete Inventory Move + * @param ctx + * @param movementId + */ + public static void deleteInventoryMove(Properties ctx, int movementId) + { + MMovement movement = new MMovement(ctx, movementId, null); + movement.delete(true); + } + + /** + * Get existing materital movement + * @param ctx + * @param movementId + * @param priceListId + * @return + * @throws OperationException + */ + public static MMovementCartBean getMMovementCartBean(Properties ctx, int movementId, int priceListId) throws OperationException + { + ItemBean bean = null; + ArrayList items = new ArrayList(); + + MMovement movement = new MMovement(ctx, movementId, null); + MMovementLine[] movementLine = movement.getLines(true); + + for (MMovementLine line : movementLine) + { + MProduct product = new MProduct(ctx, line.getM_Product_ID(), null); + + bean = new ItemBean(); + bean.setProductId(product.getM_Product_ID()); + bean.setProductName(product.getName()); + bean.setDescription(product.getDescription()); + bean.setQtyToMove(line.getMovementQty()); + bean.setUnitsPerPack(product.getUnitsPerPack()); + setNoOfPack(ctx, bean); + + int warehouseId = WarehouseManager.getDefaultWarehouse(ctx).getM_Warehouse_ID(); + MLocator locator = MLocator.get(ctx, warehouseId, "", "0", "0", "0"); + BigDecimal qtyAvailable = MStorage.getQtyAvailable(warehouseId, locator.get_ID(), product.getM_Product_ID(), 0, null); + + bean.setQtyBook(qtyAvailable); + + items.add(bean); + } + + + StockManager.setMMovementItemCosts(ctx, priceListId, items, false); + + MMovementCartBean cartBean = new MMovementCartBean(); + cartBean.setItems(items); + + return cartBean; + } + + public static String getMMovementCartFromInventoryMove(Properties ctx, int movementId, String trxName) throws OperationException, ParseException + { + int priceListId = PriceListManager.getDefaultPriceListId(ctx, false); + MMovementCartBean bean = getMMovementCartBean(ctx, movementId, priceListId); + return getMMovementCartAsHTML(bean.getItems(), ctx); + } +} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/stock/StockList.java b/posterita/posterita/src/main/org/posterita/businesslogic/stock/StockList.java new file mode 100644 index 0000000000..ba5734c061 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/businesslogic/stock/StockList.java @@ -0,0 +1,69 @@ +package org.posterita.businesslogic.stock; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.Properties; + +import org.compiere.util.Env; +import org.posterita.beans.StockMovementBean; +import org.posterita.exceptions.OperationException; + +public class StockList +{ + private ArrayList products; + private BigDecimal noOfProducts = Env.ZERO; + private Properties ctx = null; + + public StockList(Properties ctx) + { + this.ctx = ctx; + products = new ArrayList(); + } + + public void addMovementLine(StockMovementBean bean) + { + noOfProducts = noOfProducts.add(Env.ONE); + + products.add(bean); + } + + public void removeMovementLine(StockMovementBean bean) + { + products.remove(bean); + noOfProducts = noOfProducts.subtract(Env.ONE); + } + + public void clear() + { + products.clear(); + noOfProducts = Env.ZERO; + } + + public BigDecimal getNoOfProducts() + { + return noOfProducts; + } + + public ArrayList getStockProducts() throws OperationException + { + ArrayList productList = new ArrayList(); + StockMovementBean bean = null; + + Iterator iter = products.iterator(); + + while (iter.hasNext()) + { + bean = iter.next(); + + productList.add(bean); + } + + return productList; + } + + public boolean hasProduct(StockMovementBean stock) + { + return products.contains(stock); + } +} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/stock/StockManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/stock/StockManager.java new file mode 100644 index 0000000000..5b205d8a65 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/businesslogic/stock/StockManager.java @@ -0,0 +1,1499 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Created on Aug 19, 2005 by alok + * + */ +package org.posterita.businesslogic.stock; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.Comparator; +import java.util.Iterator; +import java.util.Properties; +import java.util.TreeSet; + +import javax.servlet.http.HttpServletRequest; + +import org.apache.poi.hssf.dev.BiffViewer; +import org.compiere.model.MAttribute; +import org.compiere.model.MBPartner; +import org.compiere.model.MLocator; +import org.compiere.model.MPOS; +import org.compiere.model.MPriceList; +import org.compiere.model.MPriceListVersion; +import org.compiere.model.MProduct; +import org.compiere.model.MProductPrice; +import org.compiere.model.MStorage; +import org.compiere.model.MTax; +import org.compiere.model.MTaxCategory; +import org.compiere.model.MUOM; +import org.compiere.model.MWarehouse; +import org.compiere.util.DB; +import org.compiere.util.Env; +import org.compiere.util.KeyNamePair; +import org.posterita.Constants; +import org.posterita.beans.AttributeValuesPair; +import org.posterita.beans.InventoryBean; +import org.posterita.beans.InventoryCartBean; +import org.posterita.beans.InventoryLineBean; +import org.posterita.beans.ItemBean; +import org.posterita.beans.MMovementCartBean; +import org.posterita.beans.OrderLineBean; +import org.posterita.beans.ProductBean; +import org.posterita.beans.ShoppingCartBean; +import org.posterita.beans.StockMovementBean; +import org.posterita.businesslogic.AttributeValuesManager; +import org.posterita.businesslogic.POSProductManager; +import org.posterita.businesslogic.POSTerminalManager; +import org.posterita.businesslogic.StoreManager; +import org.posterita.businesslogic.administration.PriceListManager; +import org.posterita.businesslogic.administration.ProductManager; +import org.posterita.businesslogic.administration.TaxManager; +import org.posterita.businesslogic.administration.WarehouseManager; +import org.posterita.core.utils.FormatBigDecimal; +import org.posterita.exceptions.DiscountLimitException; +import org.posterita.exceptions.InputQuantityLessThanZeroException; +import org.posterita.exceptions.OperationException; +import org.posterita.exceptions.ProductNotFoundException; +import org.posterita.exceptions.ProductNotOnPriceListException; +import org.posterita.exceptions.QuantityNotAvailableException; +import org.posterita.exceptions.TotalQuantityLessThanZeroException; +import org.posterita.exceptions.UOMValuePrecisionNotValidException; +import org.posterita.lib.UdiConstants; + + +public class StockManager +{ + + public static Comparator getDistinctByAttributeComparator(Properties ctx, int attributeID) + { + final MAttribute attribute = new MAttribute(ctx, attributeID, null); + Comparator c = new Comparator() + { + + public int compare(ProductBean o1, ProductBean o2) + { + ProductBean bean1 = (ProductBean) o1; + ProductBean bean2 = (ProductBean) o2; + + KeyNamePair attributeValuePair1 = (KeyNamePair) bean1.getAttributeValuesMap().get(attribute.getName()); + KeyNamePair attributeValuePair2 = (KeyNamePair) bean2.getAttributeValuesMap().get(attribute.getName()); + + + Integer attributeValueID1 = Integer.valueOf(attributeValuePair1.getKey()); + Integer attributeValueID2 = Integer.valueOf(attributeValuePair2.getKey()); + return (attributeValueID1.compareTo(attributeValueID2)); + } + + }; + + return c; + + } + + + public static ShoppingCartBean addToCart(Properties ctx,OrderLineBean bean, ShoppingCartBean cartBean, String backOrder) throws OperationException + { + validateInputQuantity(ctx,bean, backOrder); + + Integer priceListId = bean.getPriceListId(); + if(priceListId == null) + { + priceListId = Env.getContextAsInt(ctx, UdiConstants.PRICELIST_CTX_PARAM); + } + + ArrayList oldItems; + if (cartBean == null) + { + cartBean = new ShoppingCartBean(); + String currency = PriceListManager.getCurrency(ctx, priceListId); + cartBean.setCurrency(currency); + oldItems = new ArrayList(); + } + else + { + oldItems = cartBean.getItems(); + } + + ArrayList itemsToBeAdded = getItems(ctx, bean, backOrder); + + oldItems = addToItemList(oldItems, itemsToBeAdded,true); + setPOSItemPrices(ctx, priceListId, oldItems, true); + + cartBean.setItems(oldItems); + cartBean.setTotalPrice(setGrandTotal(oldItems)); + cartBean.setPricelistId(priceListId); + + return cartBean; + } + + + public static BigDecimal setGrandTotal(ArrayList items) + { + Iterator iter = items.iterator(); + + BigDecimal grandTotalPrice = new BigDecimal(0); + + while (iter.hasNext()) + { + ItemBean bean = (ItemBean) iter.next(); + + grandTotalPrice = grandTotalPrice.add(bean.getPrice()); + } + + return FormatBigDecimal.currency(grandTotalPrice); + } + + @SuppressWarnings("unchecked") + public static ShoppingCartBean addToPOSCart(Properties ctx,OrderLineBean bean, ShoppingCartBean cartBean,boolean isSales,boolean ifAdd) + throws OperationException,ProductNotFoundException,ProductNotOnPriceListException, + UOMValuePrecisionNotValidException + { + //setPrice for the items + + ArrayList oldItems; + if (cartBean == null) + { + cartBean = new ShoppingCartBean(); + oldItems = new ArrayList(); + } + else + { + oldItems = cartBean.getItems(); + } + + ArrayList oldItemsClone = (ArrayList)oldItems.clone(); + + ArrayList itemsToBeAdded = getPOSItems(ctx, bean); + oldItems = addToItemList(oldItemsClone, itemsToBeAdded,ifAdd); + // need to take into account business partner price list + + Integer priceListId = bean.getPriceListId(); + Integer bpartnerId = bean.getBpartnerId(); + if (priceListId == null && bpartnerId != null) + { + MBPartner bpartner = MBPartner.get(ctx, bpartnerId); + priceListId = bpartner.getM_PriceList_ID(); + } + + oldItems = setPOSItemPrices(ctx, priceListId, oldItems, isSales); + cartBean.setItems(oldItems); + cartBean.setTotalPrice(setGrandTotal(oldItems)); + cartBean.setPricelistId(priceListId); + + return cartBean; + } + + public static ArrayList setItemPrices(Properties ctx, ArrayList items) throws OperationException + { + +// UDIMPriceListVersion udiSalesPriceListVersion = (UDIMPriceListVersion) GenericSystemObjectsFactory.getFactoryInstance().get(ctx, GenericSystemObjectsFactory.SALES_PRICELV_ID); + int priceListId = Env.getContextAsInt(ctx, UdiConstants.PRICELIST_CTX_PARAM); + MPriceList priceList = MPriceList.get(ctx, priceListId, null); + int priceListVersionId = PriceListManager.getPriceListVersionID(ctx, priceListId, null); + Iterator iter = items.iterator(); + + ItemBean bean; + BigDecimal pricePerUnit; + BigDecimal totalPrice; + + while (iter.hasNext()) + { + bean = (ItemBean) iter.next(); + + pricePerUnit = ProductManager.getListPrice(ctx, priceListVersionId, bean.getProductId(), priceList.isSOPriceList(), null); + + totalPrice = pricePerUnit.multiply(new BigDecimal(bean.getQty().intValue())); + + totalPrice = FormatBigDecimal.currency(totalPrice); + + bean.setActualPrice(pricePerUnit); + bean.setPrice(totalPrice); + } + + return items; + } + + public static ArrayList setPOSItemPrices(Properties ctx, ArrayList items,boolean isSales) throws ProductNotOnPriceListException,OperationException + { + ArrayList list = setPOSItemPrices(ctx, 0, items, isSales); + + return list; + } + + + public static ArrayList setPOSItemPrices(Properties ctx, int priceListId, ArrayList items,boolean isSales) throws ProductNotOnPriceListException,OperationException + { + if (items == null || items.size() == 0) + { + return items; + } + + if (priceListId == 0) + { + priceListId = POSTerminalManager.getPriceListId(ctx, isSales); + } + + MPriceList priceList = MPriceList.get(ctx, priceListId, null); + int precision = MPriceList.getStandardPrecision(ctx, priceListId); + int priceListVersionId = PriceListManager.getPriceListVersionID(ctx, priceListId, null); + + Iterator iter = items.iterator(); + + ItemBean bean; + + Boolean isTaxIncluded = priceList.isTaxIncluded(); + BigDecimal listPrice = Env.ZERO; + BigDecimal limitPrice = Env.ZERO; + BigDecimal actualPrice = Env.ZERO; + + BigDecimal lineQty = Env.ZERO; + BigDecimal actualLineInclTotalPrice = Env.ZERO; + BigDecimal lineTotalTax = Env.ZERO; + BigDecimal lineUnitTax = Env.ZERO; + BigDecimal lineInclLimitPrice = Env.ZERO; + + BigDecimal orderInclTotal = Env.ZERO; + BigDecimal orderTaxTotal = Env.ZERO; + BigDecimal orderPriceLimitTotal = Env.ZERO; + + BigDecimal qtyTotal= Env.ZERO; + + while (iter.hasNext()) + { + bean = (ItemBean) iter.next(); + MProduct product = new MProduct(ctx,bean.getProductId(),null); + MProductPrice price = MProductPrice.get(ctx, priceListVersionId, bean.getProductId(), null); + if (price == null) + { + throw new ProductNotOnPriceListException(""+updateProductLink(ctx,bean.getProductId())); + } + + listPrice = price.getPriceList(); + limitPrice = price.getPriceLimit(); + bean.setListPrice(listPrice); + + lineQty = bean.getQty(); + BigDecimal lineTotal = listPrice.multiply(lineQty); + + int[] taxIds = MTax.getAllIDs(MTax.Table_Name,"AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+" and C_TAXCATEGORY_ID=" +product.getC_TaxCategory_ID() + " and isActive='Y'",null); + if (taxIds == null || taxIds.length == 0) + { + throw new OperationException("no tax Category for the product, or it has been set inactive"); + } + + MTax tax = new MTax(ctx,taxIds[0],null); + lineTotalTax = tax.calculateTax(lineTotal, isTaxIncluded, 12); + BigDecimal taxMulFactor = (tax.getRate().divide(Env.ONEHUNDRED, 2, BigDecimal.ROUND_HALF_UP)).add(Env.ONE); + + bean.setIsTaxIncluded(isTaxIncluded); + + BigDecimal discountedLineInclUnitPrice = Env.ZERO; + BigDecimal discountPercentOnLine = Env.ZERO; + BigDecimal discountedLineTotal = Env.ZERO; + bean.setDiscountedLinePrice(listPrice); + + if (bean.getIsDiscountOnInclUnitPrice()) + { + discountedLineInclUnitPrice = bean.getDiscountedInclUnitPrice().setScale(2, BigDecimal.ROUND_HALF_UP); + bean.setDiscountedLinePrice(discountedLineInclUnitPrice); + } + else if (bean.getIsDiscountOnPercentage()) + { + discountPercentOnLine = bean.getDiscountPercent(); + } + else if (bean.getIsDiscountOnTotal()) + { + discountedLineTotal = bean.getPrice(); + } + + if (discountPercentOnLine != null && !discountPercentOnLine.equals(Env.ZERO)) + { + BigDecimal discFactor = (Env.ONEHUNDRED.subtract(discountPercentOnLine)).divide(Env.ONEHUNDRED, 12, RoundingMode.HALF_DOWN); + actualLineInclTotalPrice = (lineTotal).multiply(discFactor).setScale(2, RoundingMode.HALF_UP); + + } + else if (discountedLineInclUnitPrice != null && !discountedLineInclUnitPrice.equals(Env.ZERO)) + { + if(isTaxIncluded) + { + actualLineInclTotalPrice = ((discountedLineInclUnitPrice.multiply(taxMulFactor)).setScale(2, BigDecimal.ROUND_HALF_UP)).multiply(lineQty); + } + else + { + actualLineInclTotalPrice = (discountedLineInclUnitPrice.multiply(lineQty)).setScale(2, BigDecimal.ROUND_HALF_UP); + } + } + else + { + actualLineInclTotalPrice = lineTotal; + } + + actualPrice = actualLineInclTotalPrice.divide(lineQty).setScale(2, RoundingMode.HALF_UP); + lineUnitTax = tax.calculateTax(actualPrice, isTaxIncluded, 12).setScale(2, RoundingMode.HALF_UP); + lineTotalTax = lineUnitTax.multiply(lineQty); + + if (isTaxIncluded) + { + BigDecimal unitExclPrice = (actualPrice.subtract(lineUnitTax)).setScale(precision, RoundingMode.HALF_DOWN); + bean.setUnitPrice(unitExclPrice); + bean.setInclPrice(actualPrice); + + lineInclLimitPrice = limitPrice; + bean.setPriceLimit(lineInclLimitPrice); + } + else + { + BigDecimal unitInclPrice = (actualPrice.add(lineUnitTax)).setScale(precision, RoundingMode.HALF_DOWN); + bean.setInclPrice(unitInclPrice); + bean.setUnitPrice(actualPrice); + + actualLineInclTotalPrice = (actualLineInclTotalPrice.add(lineTotalTax)).setScale(precision, RoundingMode.HALF_DOWN); + lineInclLimitPrice = limitPrice.add(tax.calculateTax(limitPrice, false, 12)); + bean.setPriceLimit(lineInclLimitPrice.setScale(precision, RoundingMode.HALF_DOWN)); + } + + bean.setPrice(actualLineInclTotalPrice); + bean.setTaxAmt(lineTotalTax.setScale(precision, RoundingMode.HALF_DOWN)); + bean.setTaxRate(tax.getRate()); + bean.setUom(product.getUOMSymbol()); + + orderTaxTotal = orderTaxTotal.add(lineTotalTax).setScale(precision, RoundingMode.HALF_DOWN); + orderInclTotal = orderInclTotal.add(actualLineInclTotalPrice).setScale(precision, RoundingMode.HALF_DOWN); + orderPriceLimitTotal = orderPriceLimitTotal.add(lineInclLimitPrice.multiply(bean.getQty())); + qtyTotal = qtyTotal.add(bean.getQty()); + + bean.setPriceTotal(orderInclTotal); + bean.setTaxTotal(orderTaxTotal); + bean.setgrandTotal(orderInclTotal); + bean.setQtyTotal(qtyTotal); + bean.setPriceLimitTotal(orderPriceLimitTotal); + } + + return items; + } + + public static ArrayList getItems(Properties ctx, OrderLineBean bean, String backOrder) throws OperationException + { + ArrayList orderLines = bean.getOrderLineList(); + + Iterator iter = orderLines.iterator(); + + OrderLineBean orderLineBean; + + ItemBean itemBean; + ArrayList items = new ArrayList(); + + while (iter.hasNext()) + { + orderLineBean = (OrderLineBean) iter.next(); + + itemBean = new ItemBean(); + itemBean.setProductId(orderLineBean.getProductId()); + itemBean.setDescription(ProductManager.getProductName(ctx, orderLineBean.getProductId().intValue())); + itemBean.setQty(orderLineBean.getQuantity()); + itemBean.setBackOrder(backOrder); + + if (orderLineBean.getQuantity().intValue() != 0) + items.add(itemBean); + } + + return items; + } + + public static ArrayList getPOSItems(Properties ctx, OrderLineBean orderLineBean) + throws OperationException,ProductNotFoundException,UOMValuePrecisionNotValidException + { + + ItemBean itemBean; + ArrayList items = new ArrayList(); + int productId = 0; + + if (orderLineBean.getProductId()==null) + { + productId = getProductIdFromBarCode(ctx,orderLineBean.getBarCode()); + orderLineBean.setProductId(Integer.valueOf(productId)); + } + else + { + productId = orderLineBean.getProductId(); + } + + MProduct product = MProduct.get(ctx, productId); + if (product.get_ID() == 0 || product.isActive()==false) + { + throw new ProductNotFoundException("product not found or is either deActivated"); + } + + if (orderLineBean.getQuantity()==null) + { + orderLineBean.setQuantity(Env.ONE); + } + + BigDecimal qty = orderLineBean.getQuantity(); + String barcode = product.getUPC(); + String name = product.getName(); + String description = product.getDescription(); + int uomPrecision = validateProductUOMQuantityPrecision(ctx, productId, qty); + + itemBean = new ItemBean(); + itemBean.setProductId(productId); + itemBean.setProductName(name); + itemBean.setBarCode(barcode); + itemBean.setPriceListId(orderLineBean.getPriceListId()); + itemBean.setDescription(description); + itemBean.setQty(orderLineBean.getQuantity().setScale(uomPrecision)); + itemBean.setIsDiscountOnInclUnitPrice(false); + itemBean.setIsDiscountOnPercentage(false); + itemBean.setIsDiscountOnTotal(false); + itemBean.setDiscountedLinePrice(Env.ZERO); + items.add(itemBean); + + return items; + } + + + public static ArrayList addToItemList(ArrayList items, ArrayList itemsToBeAdded, boolean ifAdd) throws ProductNotOnPriceListException, OperationException + { + Iterator iter = itemsToBeAdded.iterator(); + ItemBean itemBean; + + ItemBean foundItemBean; + while (iter.hasNext()) + { + itemBean = (ItemBean) iter.next(); + + foundItemBean = findItem(itemBean, items); + + if (foundItemBean == null) + items.add(itemBean); + else + { + itemBean.updateQuantity(foundItemBean, itemBean,ifAdd); + BigDecimal finalQty=foundItemBean.getQty(); + + if(Env.ZERO.compareTo(finalQty) == 0) + deleteItemFromList(items,foundItemBean.getProductId()); + } + } + + return items; + } + + + public static ArrayList deleteItemFromList(ArrayList items, Integer productId) throws ProductNotOnPriceListException, OperationException + { + ItemBean itemBean = new ItemBean(); + + itemBean.setProductId(productId); + items.remove(itemBean); + + + + return items; + } + + + + public static ItemBean findItem(ItemBean queryItemBean, ArrayList items) + { + int indexOfFound = items.indexOf(queryItemBean); + + if (indexOfFound == -1) + return null; + + ItemBean found = (ItemBean) items.get(indexOfFound); + + return found; + } + + public static InventoryCartBean findInventoryLine(InventoryCartBean queryItemBean, ArrayList items) + { + int indexOfFound = items.indexOf(queryItemBean); + + if (indexOfFound == -1) + return null; + + InventoryCartBean found = (InventoryCartBean) items.get(indexOfFound); + + return found; + } + + + @SuppressWarnings("unchecked") + public static ArrayList deleteItemFromPOSList(Properties ctx,ArrayList items, Integer productId,boolean isSales) throws ProductNotOnPriceListException, OperationException + { + ItemBean itemBean = new ItemBean(); + + itemBean.setProductId(productId); + items.remove(itemBean); + + setPOSItemPrices(ctx,items,true); + + return items; + } + + public static ArrayList updateItemFromPOSList(Properties ctx, Integer priceListId, ArrayList items, Integer productId, BigDecimal quantity) throws ProductNotOnPriceListException, OperationException + { + + if (items == null) + { + return items; + } + + ItemBean itemBean = new ItemBean(); + itemBean.setProductId(productId); + + + int index = items.indexOf(itemBean); + + if(index != -1) + { + itemBean = (ItemBean) items.get(index); + + if(quantity.doubleValue() == 0.0d) + { + items.remove(index); + } + else + { + itemBean.setQty(quantity); + } + + setPOSItemPrices(ctx,priceListId, items, true); + } + + return items; + } + + public static ArrayList updateItemFromInventoryList(Properties ctx, Integer priceListId, ArrayList items, Integer productId, Integer quantity) throws ProductNotOnPriceListException, OperationException + { + + if (items == null) + { + return items; + } + + ItemBean itemBean = new ItemBean(); + itemBean.setProductId(productId); + + + int index = items.indexOf(itemBean); + + if(index != -1) + { + itemBean = (ItemBean) items.get(index); + + if(quantity.intValue() == 0) + { + items.remove(index); + } + else + { + itemBean.setQtyCount(new BigDecimal(quantity.intValue())); + } + + setInventoryItemPrices(ctx,priceListId, items, true); + } + + return items; + } + + + public static ArrayList updateItemFromMMovementList(Properties ctx, Integer priceListId, ArrayList items, Integer productId, Integer quantity) throws ProductNotOnPriceListException, OperationException + { + + if (items == null) + { + return items; + } + + ItemBean itemBean = new ItemBean(); + itemBean.setProductId(productId); + + + int index = items.indexOf(itemBean); + + if(index != -1) + { + itemBean = (ItemBean) items.get(index); + + if(quantity.intValue() == 0) + { + items.remove(index); + } + else + { + itemBean.setQtyToMove(new BigDecimal(quantity.intValue())); + } + + setMMovementItemCosts(ctx, priceListId, items, false); + } + + return items; + } + + public static ArrayList updateNoOfPack(Properties ctx, Integer priceListId, ArrayList items, Integer productId, Integer noOfPack) throws ProductNotOnPriceListException, OperationException + { + + if (items == null) + { + return items; + } + + ItemBean itemBean = new ItemBean(); + itemBean.setProductId(productId); + + + int index = items.indexOf(itemBean); + + if(index != -1) + { + itemBean = (ItemBean) items.get(index); + + if(noOfPack.intValue() == 0) + { + items.remove(index); + } + else + { + itemBean.setNoOfPack(noOfPack); + } + + } + + return items; + } + + public static boolean validateInputQuantity(Properties ctx,OrderLineBean bean, String backOrder) throws OperationException + { + + boolean valid = checkForNegativeQuantity(ctx, bean); + + if (!valid) + throw new InputQuantityLessThanZeroException("Please enter a quantity greater than 0"); + + boolean totalQtyValid = checkTotalQuantityGreaterThanZero(ctx,bean); + + if(!totalQtyValid) + throw new TotalQuantityLessThanZeroException("Please enter a quantity per Size!"); + + validateAvailableStock(ctx, bean, backOrder); + + return true; + } + + public static void validateAvailableStock(Properties ctx, OrderLineBean bean, String backOrder) throws OperationException + { + //Here we are assuming that if backOrder is null + //then we take it as NO. + //Normally what I have understood from previous discussions + //we should always display all products that are available + //In some way it means that we have to take it as NO when backOrder is null + if (backOrder == null) + backOrder = Constants.YES_CHAR; + + if (backOrder.equals(Constants.YES_CHAR)) + return; + + ArrayList orderLineList = bean.getOrderLineList(); + + Iterator iter = orderLineList.iterator(); + + OrderLineBean bean2; + boolean isInstock; + while (iter.hasNext()) + { + bean2 = (OrderLineBean) iter.next(); + isInstock = isInstock(ctx, bean2); + + if (!isInstock) + { + QuantityNotAvailableException exception = new QuantityNotAvailableException(); + MProduct product = new MProduct(ctx, bean2.getProductId().intValue(), null); + AttributeValuesPair pair = AttributeValuesManager.retrieveAttributeValues(ctx, product.getM_AttributeSetInstance_ID()); + exception.setMessage(pair.getSizeAttributeValue().getName()); + throw exception; + } + + } + } + + + private static boolean checkForNegativeQuantity(Properties ctx, OrderLineBean bean) + { + ArrayList orderLines = bean.getOrderLineList(); + + Iterator iter = orderLines.iterator(); + + OrderLineBean orderLineBean; + + while (iter.hasNext()) + { + orderLineBean = (OrderLineBean) iter.next(); + + if (orderLineBean.getQuantity().intValue() < 0) + return false; + + } + + return true; + } + + private static boolean checkTotalQuantityGreaterThanZero(Properties ctx, OrderLineBean bean) + { + ArrayList orderLines = bean.getOrderLineList(); + + Iterator iter = orderLines.iterator(); + + OrderLineBean orderLineBean; + + int totalQuantity = 0; + + while (iter.hasNext()) + { + orderLineBean = (OrderLineBean) iter.next(); + + totalQuantity = totalQuantity + orderLineBean.getQuantity().intValue(); + } + + if (totalQuantity == 0) + return false; + + return true; + } + + private static boolean isInstock(Properties ctx, OrderLineBean bean) throws OperationException + { + int posteritaWarehouseIds[] = MWarehouse.getAllIDs(MWarehouse.Table_Name, " ad_client_id=" + Env.getAD_Client_ID(ctx) + " and ad_org_id=" + Env.getAD_Org_ID(ctx), null); + + if (posteritaWarehouseIds.length == 0) + throw new OperationException("No warehouse found"); + + if (posteritaWarehouseIds.length > 1) + throw new OperationException("Expected one warehouse for organisation Tamak but got " + posteritaWarehouseIds.length); + + MWarehouse warehouse = new MWarehouse(ctx, posteritaWarehouseIds[0], null); + + MLocator defaultWarehouseLocator = warehouse.getDefaultLocator(); + + int qtyAvailable = getQtyAvailable(ctx, bean.getProductId().intValue(), defaultWarehouseLocator.get_ID()); + + int qtyEntered = bean.getQuantity().intValue(); + + if (qtyEntered > qtyAvailable) + return false; + + return true; + } + + private static int getQtyAvailable(Properties ctx, int productId, int locatorId) throws OperationException + { + String sql = "select sum(qtyonhand) from m_storage" + + " where m_product_id=" + productId + + " and m_locator_id=" + locatorId + + " and qtyreserved=0" + + " and ad_client_id=" + Env.getAD_Client_ID(ctx) + + " and ad_org_id=" + Env.getAD_Org_ID(ctx); + + PreparedStatement ps = DB.prepareStatement(sql, null); + ResultSet rs = null; + + int qtyAvailable = 0; + try + { + rs = ps.executeQuery(); + + while (rs.next()) + { + qtyAvailable = rs.getInt(1); + } + + rs.close(); + } + catch (SQLException e) + { + throw new OperationException(e); + } + finally + { + try + { + ps.close(); + } + catch (SQLException e1) + { + throw new OperationException(e1); + } + + ps = null; + } + + return qtyAvailable; + } + + + public static ArrayList getDistinctByDescription(Properties ctx, ArrayList productList) + { + Comparator c = new Comparator() + { + + public int compare(ProductBean o1, ProductBean o2) + { + ProductBean bean1 = (ProductBean) o1; + ProductBean bean2 = (ProductBean) o2; + + return (bean1.getDescription().compareToIgnoreCase(bean2.getDescription())); + } + + }; + + TreeSet set = new TreeSet(c); + set.addAll(productList); + + ArrayList distinctBy = new ArrayList(set); + + return distinctBy; + } + + public static String setBackOrderFilter(Properties ctx, String sql, String backOrder) + { + if (backOrder.equals("N")) + sql = sql +" and s.qtyonhand > s.qtyreserved"; + + return sql; + } + + + public static int getProductIdFromBarCode(Properties ctx,String barCode) throws OperationException + { + String sql = "select m_product_id from m_product where UPC='"+barCode+"'" + +" and AD_CLIENT_ID="+Env.getAD_Client_ID(ctx); + + PreparedStatement pstmt = DB.prepareStatement(sql, null); + + int productId=0; + + try + { + ResultSet rs = pstmt.executeQuery(); + while (rs.next()) + { + productId=rs.getInt(1); + } + rs.close(); + } + catch (SQLException e) + { + throw new OperationException(e); + } + finally + { + try + { + pstmt.close(); + } + catch(Exception e) + {} + + pstmt = null; + } + + //begin e-evolution is necessary find also search key + if (productId == 0) + { + sql = "select m_product_id from m_product where value='"+barCode+"'" + +" and AD_CLIENT_ID="+Env.getAD_Client_ID(ctx); + + System.out.println("BarCode: " + barCode); + + pstmt = DB.prepareStatement(sql, null); + + try + { + ResultSet rs = pstmt.executeQuery(); + while (rs.next()) + { + productId=rs.getInt(1); + } + rs.close(); + } + catch (SQLException e) + { + throw new OperationException(e); + } + finally + { + try + { + pstmt.close(); + } + catch(Exception e) + {} + + pstmt = null; + } + } + //end e-evolution is necessary find also search key + + return productId; + } + + private static String updateProductLink(Properties ctx,int productId) + { + + String link = "" + + "here" + + ""; + String str = " Click " + + link + + " to update the product"; + + return str; + + } + + public static int validateProductUOMQuantityPrecision(Properties ctx, Integer productId, BigDecimal qty) throws UOMValuePrecisionNotValidException + { + int enteredPrecision = getQtyPrecision(qty); + + MProduct product = new MProduct(ctx,productId,null); + int uomPrecision = MUOM.getPrecision(ctx, product.getC_UOM_ID()); + + // validate UOM precision and quantity precision + if ( enteredPrecision > uomPrecision) + { + throw new UOMValuePrecisionNotValidException( + "The precision entered for the quantity field of the product: '"+product.getName() + + "' should not be greater than " + uomPrecision); + } + + return uomPrecision; + } + + public static int getQtyPrecision(BigDecimal qty) + { + int enteredPrecision = 0; + int position = 0; + int count = 0; + + String s = qty.toString(); + + + position = s.indexOf('.') + 1; // position of decimal point + + if (position > 0) + { + int i = s.length() - 1; + + while (s.charAt(i) == '0') // count no of trailing zeroes (to be removed) + { + count++; + i--; + } + + enteredPrecision = s.length() - position - count; + } + + return enteredPrecision; + } + + public static ArrayList getInventoryLines(Properties ctx, InventoryLineBean bean) + throws OperationException,ProductNotFoundException,UOMValuePrecisionNotValidException + { + + ItemBean itemBean; + ArrayList lines = new ArrayList(); + int productId = 0; + + if (bean.getProductId()==null) + { + productId = getProductIdFromBarCode(ctx,bean.getBarCode()); + bean.setProductId(Integer.valueOf(productId)); + } + else + { + productId = bean.getProductId(); + } + + MProduct product = MProduct.get(ctx, productId); + if (product.get_ID() == 0 || product.isActive()==false) + { + throw new ProductNotFoundException("product not found or is either deActivated"); + } + + if(bean.getQtyCsv() == null) + { + bean.setQtyCsv(Env.ZERO); + } + + if(bean.getQtyCount() == null) + { + bean.setQtyCount(Env.ONE); + } + + BigDecimal qty = bean.getQtyCount(); + String barcode = product.getUPC(); + String name = product.getName(); + String description = product.getDescription(); + int uomPrecision = validateProductUOMQuantityPrecision(ctx, productId, qty); + + ProductBean pBean = POSProductManager.getProduct(ctx, barcode, null); + + itemBean = new ItemBean(); + itemBean.setProductId(productId); + itemBean.setProductName(name); + itemBean.setBarCode(barcode); + itemBean.setPriceListId(bean.getPriceListId()); + itemBean.setDescription(description); + itemBean.setQtyCount((bean.getQtyCount().setScale(uomPrecision))); + itemBean.setQtyBook(pBean.getQtyOnHand()); + itemBean.setQtyCsv(bean.getQtyCsv()); + + lines.add(itemBean); + + return lines; + } + + public static ArrayList addToInventoryList(ArrayList items, ArrayList itemsToBeAdded, boolean ifAdd) throws ProductNotOnPriceListException, OperationException + { + Iterator iter = itemsToBeAdded.iterator(); + ItemBean itemBean; + + ItemBean foundItemBean; + while (iter.hasNext()) + { + itemBean = (ItemBean) iter.next(); + + foundItemBean = findItem(itemBean, items); + + if (foundItemBean == null) + items.add(itemBean); + else + { + itemBean.updateQuantityCount(foundItemBean, itemBean,ifAdd); + int finalQty=foundItemBean.getQtyCount().intValue(); + + itemBean.updateQuantityCsv(foundItemBean, itemBean,ifAdd); + int finalQtycsv=foundItemBean.getQtyCsv().intValue(); + + if(finalQty==0) + deleteItemFromList(items,foundItemBean.getProductId()); + } + + + } + + return items; + } + + public static ArrayList setInventoryItemPrices(Properties ctx, int priceListId, ArrayList items,boolean isSales) throws ProductNotOnPriceListException,OperationException + { + if (items == null || items.size() == 0) + { + return items; + } + + if (priceListId == 0) + { + priceListId = POSTerminalManager.getPriceListId(ctx, isSales); + } + + int precision = MPriceList.getStandardPrecision(ctx, priceListId); + + + int priceListVersionId = 0; + priceListVersionId = PriceListManager.getPriceListVersionID(ctx, priceListId, null); + //UDIMPriceListVersion udiSalesPriceListVersion = (UDIMPriceListVersion) GenericSystemObjectsFactory.getFactoryInstance().get(ctx, GenericSystemObjectsFactory.SALES_PRICELV_ID); + Iterator iter = items.iterator(); + + ItemBean bean; + BigDecimal priceStd = Env.ZERO; + BigDecimal priceList = Env.ZERO; + BigDecimal priceLimit = Env.ZERO; + BigDecimal totalPrice = Env.ZERO; + BigDecimal totalTax = Env.ZERO; + BigDecimal discount = Env.ZERO; + + BigDecimal total = Env.ZERO; + BigDecimal taxTotal = Env.ZERO; + BigDecimal priceTotal = Env.ZERO; + BigDecimal qtyTotal= Env.ZERO; + + while (iter.hasNext()) + { + bean = (ItemBean) iter.next(); + + int product_id = bean.getProductId(); + + MProductPrice price = MProductPrice.get(ctx, priceListVersionId, product_id, null); + + if (price == null) + { + throw new ProductNotOnPriceListException(""+updateProductLink(ctx,bean.getProductId())); + } + + priceStd = price.getPriceStd(); + priceList = price.getPriceList(); + priceLimit = price.getPriceLimit(); + + /*if(priceList.doubleValue() != 0.0) + { + discount = priceStd.subtract(priceList) + .multiply(new BigDecimal(100)) + .divide(priceList, precision, BigDecimal.ROUND_HALF_UP); + }*/ + + + MProduct product = new MProduct(ctx,bean.getProductId(),null); + + int [] taxIds = MTax.getAllIDs(MTax.Table_Name,"AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+" and C_TAXCATEGORY_ID=" +product.getC_TaxCategory_ID() + " and isActive='Y'",null); + if(taxIds == null || taxIds.length == 0) + { + throw new OperationException("no tax Category for the product, or it has been set inactive"); + } + + MTax tax = new MTax(ctx,taxIds[0],null); + BigDecimal taxAmt = tax.calculateTax(priceList,false,4); + + bean.setUnitPrice(priceList); + bean.setDiscountPercent(discount); + + totalPrice = priceList.multiply(bean.getQtyCount()); + totalPrice = totalPrice.setScale(precision, RoundingMode.HALF_UP); + totalTax = taxAmt.multiply(bean.getQtyCount()); + totalTax = totalTax.setScale(precision, RoundingMode.HALF_UP); + bean.setStandardPrice(totalPrice); + bean.setTaxAmt(totalTax); + bean.setUom(product.getUOMSymbol()); + bean.setPrice(totalPrice.add(totalTax)); + bean.setActualPrice(totalPrice.add(totalTax)); //initially price and the actual price are same + + priceTotal = priceTotal.add(totalPrice); + priceTotal = priceTotal.setScale(precision, RoundingMode.HALF_UP); + + BigDecimal priceLimitTotal = Env.ZERO; + + priceLimitTotal = priceLimitTotal.add(priceLimit.multiply(bean.getQtyCount())); + taxAmt = tax.calculateTax(priceLimitTotal,false,4); + priceLimitTotal = priceLimitTotal.add(taxAmt); + priceLimitTotal = priceLimitTotal.setScale(precision, RoundingMode.HALF_UP); + + taxTotal = taxTotal.add(totalTax); + taxTotal = taxTotal.setScale(precision, RoundingMode.HALF_UP); + total = total.add(totalPrice.add(totalTax)); + total = total.setScale(precision, RoundingMode.HALF_UP); + qtyTotal = qtyTotal.add(bean.getQtyCount()); + + bean.setPriceTotal(priceTotal); + bean.setTaxTotal(taxTotal); + bean.setgrandTotal(total); + bean.setQtyTotal(qtyTotal); + + } + + return items; + } + + public static InventoryCartBean addToInventoryCart(Properties ctx,InventoryLineBean bean, InventoryCartBean cartBean,boolean isSales,boolean ifAdd) + throws OperationException,ProductNotFoundException,ProductNotOnPriceListException, + UOMValuePrecisionNotValidException + { + //setPrice for the items + + ArrayList oldItems; + if (cartBean == null) + { + cartBean = new InventoryCartBean(); + oldItems = new ArrayList(); + } + else + { + oldItems = cartBean.getItems(); + } + + ArrayList oldItemsClone = (ArrayList)oldItems.clone(); + ArrayList itemsToBeAdded = getInventoryLines(ctx, bean); + oldItems = addToInventoryList(oldItemsClone, itemsToBeAdded,ifAdd); + // need to take into account business partner price list + + Integer priceListId = bean.getPriceListId(); + + if(priceListId == null || priceListId == 0) + { + priceListId = POSTerminalManager.getPriceListId(ctx, isSales); + } + + oldItems = setInventoryItemPrices(ctx, priceListId, oldItems, isSales); + cartBean.setItems(oldItems); + cartBean.setTotalPrice(setGrandTotal(oldItems)); + cartBean.setPricelistId(priceListId); + + return cartBean; + } + + + /** + * Add To movement Cart (Stock Transfer Cart) + * @param ctx + * @param bean + * @param cartBean + * @param isSales + * @param ifAdd + * @return + * @throws OperationException + * @throws ProductNotFoundException + * @throws ProductNotOnPriceListException + */ + public static MMovementCartBean addToMovementCart(Properties ctx,StockMovementBean bean, MMovementCartBean cartBean, boolean isSales, boolean ifAdd) throws OperationException,ProductNotFoundException,ProductNotOnPriceListException + { + //setPrice for the items + + ArrayList oldItems; + if (cartBean == null) + { + cartBean = new MMovementCartBean(); + oldItems = new ArrayList(); + } + else + { + oldItems = cartBean.getItems(); + } + + ArrayList oldItemsClone = (ArrayList)oldItems.clone(); + ArrayList itemsToBeAdded = getMMovementItems(ctx, bean); + oldItems = addToMMovementList(ctx, oldItemsClone, itemsToBeAdded,ifAdd); + // need to take into account business partner price list + + Integer priceListId = POSTerminalManager.getPriceListId(ctx, isSales); + + oldItems = setMMovementItemCosts(ctx, priceListId, oldItems, isSales); + cartBean.setItems(oldItems); + cartBean.setPricelistId(priceListId); + + return cartBean; + } + + /** + * Get Movement Items + * @param ctx + * @param bean + * @return + * @throws OperationException + * @throws ProductNotFoundException + */ + public static ArrayList getMMovementItems(Properties ctx, StockMovementBean bean) throws OperationException,ProductNotFoundException + { + + ItemBean itemBean; + ArrayList stockItems = new ArrayList(); + int productId = 0; + + if (bean.getProductId()==null) + { + productId = getProductIdFromBarCode(ctx,bean.getBarCode()); + bean.setProductId(Integer.valueOf(productId)); + } + else + { + productId = bean.getProductId(); + } + + MProduct product = MProduct.get(ctx, productId); + if (product.get_ID() == 0 || product.isActive()==false) + { + throw new ProductNotFoundException("product not found or is either deActivated"); + } + + if(bean.getQtyToMove() == null) + { + bean.setQtyToMove(Env.ONE); + } + + if(bean.getNoOfPack() == null) + { + bean.setNoOfPack(1); + } + + BigDecimal qty = bean.getQtyToMove(); + int noOfPack = bean.getNoOfPack(); + String barcode = product.getUPC(); + String name = product.getName(); + String description = product.getDescription(); + int uomPrecision = validateProductUOMQuantityPrecision(ctx, productId, qty); + + int warehouseId = WarehouseManager.getDefaultWarehouse(ctx).getM_Warehouse_ID(); + MLocator locator = MLocator.get(ctx, warehouseId, "", "0", "0", "0"); + BigDecimal qtyAvailable = MStorage.getQtyAvailable(warehouseId, locator.get_ID(), productId, 0, null); + + itemBean = new ItemBean(); + itemBean.setProductId(productId); + itemBean.setProductName(name); + itemBean.setBarCode(barcode); + itemBean.setUnitsPerPack(product.getUnitsPerPack()); + itemBean.setDescription(description); + itemBean.setUom(product.getUOMSymbol()); + itemBean.setQtyToMove(qty); + itemBean.setNoOfPack(noOfPack); + itemBean.setQtyBook(qtyAvailable); + + stockItems.add(itemBean); + + return stockItems; + } + + /** + * Add Items to Movement List + * @param ctx + * @param items + * @param itemsToBeAdded + * @param ifAdd + * @return + * @throws ProductNotOnPriceListException + * @throws OperationException + */ + public static ArrayList addToMMovementList(Properties ctx, ArrayList items, ArrayList itemsToBeAdded, boolean ifAdd) throws ProductNotOnPriceListException, OperationException + { + Iterator iter = itemsToBeAdded.iterator(); + ItemBean itemBean; + + ItemBean foundItemBean; + while (iter.hasNext()) + { + itemBean = (ItemBean) iter.next(); + + foundItemBean = findItem(itemBean, items); + + if (foundItemBean == null) + items.add(itemBean); + else + { + itemBean.updateQuantityToMove(foundItemBean, itemBean,ifAdd); + int finalQty=foundItemBean.getQtyToMove().intValue(); + + if(finalQty==0) + { + deleteItemFromList(items,foundItemBean.getProductId()); + } + else + { + // set the no of pack + MMovementManager.setNoOfPack(ctx, foundItemBean); + } + } + + + } + + return items; + } + + /** + * Set Movement Items Costs + * @param ctx + * @param priceListId + * @param items + * @param isSales + * @return + * @throws ProductNotOnPriceListException + * @throws OperationException + */ + public static ArrayList setMMovementItemCosts(Properties ctx, int priceListId, ArrayList items,boolean isSales) throws ProductNotOnPriceListException,OperationException + { + if (items == null || items.size() == 0) + { + return items; + } + + if (priceListId == 0) + { + priceListId = POSTerminalManager.getPriceListId(ctx, isSales); + } + + int precision = MPriceList.getStandardPrecision(ctx, priceListId); + MPriceList ppriceList = new MPriceList(ctx, priceListId, null); + + int priceListVersionId = 0; + priceListVersionId = PriceListManager.getPriceListVersionID(ctx, priceListId, null); + + Iterator iter = items.iterator(); + + ItemBean bean; + BigDecimal priceStd = Env.ZERO; + + while (iter.hasNext()) + { + bean = (ItemBean) iter.next(); + + int product_id = bean.getProductId(); + + MProductPrice price = MProductPrice.get(ctx, priceListVersionId, product_id, null); + + if (price == null) + { + throw new ProductNotOnPriceListException(""+updateProductLink(ctx,bean.getProductId())); + } + + priceStd = price.getPriceStd().setScale(2, BigDecimal.ROUND_HALF_UP); + + MProduct product = new MProduct(ctx,bean.getProductId(),null); + int warehouseId = WarehouseManager.getDefaultWarehouse(ctx).getM_Warehouse_ID(); + MLocator locator = MLocator.get(ctx, warehouseId, "", "0", "0", "0"); + BigDecimal qtyAvailable = MStorage.getQtyAvailable(warehouseId, locator.get_ID(), bean.getProductId(), 0, null); + + if(bean.getQtyToMove().compareTo(qtyAvailable) == -1) + { + BigDecimal noOfPack = bean.getQtyToMove().divide(new BigDecimal(product.getUnitsPerPack()), BigDecimal.ROUND_DOWN); + bean.setNoOfPack(noOfPack.intValue()); + } + + int [] taxIds = MTax.getAllIDs(MTax.Table_Name,"AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+" and C_TAXCATEGORY_ID=" +product.getC_TaxCategory_ID() + " and isActive='Y'",null); + if(taxIds == null || taxIds.length == 0) + { + throw new OperationException("no tax Category for the product, or it has been set inactive"); + } + + MTax tax = new MTax(ctx,taxIds[0],null); + BigDecimal taxMul = (tax.getRate().add(Env.ONEHUNDRED)).divide(Env.ONEHUNDRED, 2, BigDecimal.ROUND_HALF_EVEN); + + BigDecimal stockValue = Env.ZERO; + + if(ppriceList.isTaxIncluded()) + { + stockValue = priceStd.multiply(bean.getQtyToMove()); + } + else + { + stockValue = (priceStd.multiply(bean.getQtyToMove())).multiply(taxMul); + } + + bean.setStockValue(stockValue); + + } + + return items; + } + +} diff --git a/posterita/posterita/src/main/org/posterita/cashType/UDICashType.java b/posterita/posterita/src/main/org/posterita/cashType/UDICashType.java new file mode 100644 index 0000000000..7c24eb5329 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/cashType/UDICashType.java @@ -0,0 +1,33 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Created on 17-Mar-2006 + */ + + +package org.posterita.cashType; + + +public interface UDICashType +{ + + public String getCashType(); + + +} diff --git a/posterita/posterita/src/main/org/posterita/cashType/UDICashTypes.java b/posterita/posterita/src/main/org/posterita/cashType/UDICashTypes.java new file mode 100644 index 0000000000..3b5f36693d --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/cashType/UDICashTypes.java @@ -0,0 +1,78 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Created on 17-Mar-2006 + */ + + +package org.posterita.cashType; + + + +public class UDICashTypes +{ + private UDICashTypes() + { + + } + + public static UDICashType GENERAL_RECEIPTS = new GeneralReceipts(); + + public static UDICashType GENERAL_EXPENSE = new GeneralExpense(); + + public static UDICashType INVOICE = new Invoice(); + + public static UDICashType BANK_ACCOUNT_TRANSFER = new BankAccountTransfer(); + + + + public static class GeneralReceipts implements UDICashType + { + public String getCashType() + { + return "General Receipts"; + } + } + + + public static class GeneralExpense implements UDICashType + { + public String getCashType() + { + return "General Expense"; + } + } + + public static class Invoice implements UDICashType + { + public String getCashType() + { + return "Invoice"; + } + } + + public static class BankAccountTransfer implements UDICashType + { + public String getCashType() + { + return "Bank Account Transfer"; + } + } + +} diff --git a/posterita/posterita/src/main/org/posterita/core/AbstractChart.java b/posterita/posterita/src/main/org/posterita/core/AbstractChart.java new file mode 100644 index 0000000000..0ce7f14561 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/core/AbstractChart.java @@ -0,0 +1,211 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * 12-Jul-2006 15:56:26 by praveen + * + */ + +package org.posterita.core; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStream; +import java.io.PrintWriter; +import java.io.StringWriter; + +import org.jfree.chart.ChartRenderingInfo; +import org.jfree.chart.ChartUtilities; +import org.jfree.chart.JFreeChart; +import org.jfree.chart.entity.StandardEntityCollection; + +import org.posterita.exceptions.OperationException; + +public abstract class AbstractChart +{ + protected String title = ""; + protected String subtitle = null; + protected String xLabel = ""; + protected String yLabel = ""; + protected boolean showLegend = true; + protected boolean showTooltip = true; + protected boolean showLabels = false; + protected ChartRenderingInfo renderingInfo = new ChartRenderingInfo(new StandardEntityCollection()); + protected JFreeChart chart = null; + + public abstract JFreeChart createChart() throws OperationException ; + + public abstract void getDataSetFromSQL(String sql) throws OperationException ; + + public String saveChartAsPNG(String filePath,int width,int height) throws OperationException + { + try { + ChartUtilities.saveChartAsPNG(new File(filePath),getChart(),width,height,renderingInfo); + return filePath; + } catch (IOException e) { + throw new OperationException("Problem occured while saving chart.",e); + } + } + + public String saveChartAsJPEG(String filePath,int width,int height) throws OperationException + { + try { + ChartUtilities.saveChartAsJPEG(new File(filePath),getChart(),width,height,renderingInfo); + return filePath; + } catch (IOException e) { + throw new OperationException("Problem occured while saving chart.",e); + } + } + + public void writeChartAsPNG(OutputStream outputStream,int width,int height) throws OperationException + { + try { + ChartUtilities.writeChartAsPNG(outputStream,getChart(),width,height,renderingInfo); + } catch (IOException e) { + throw new OperationException("Problem occured while write chart.",e); + } + } + + public void writeChartAsJPEG(OutputStream outputStream,int width,int height) throws OperationException + { + try { + ChartUtilities.writeChartAsJPEG(outputStream,getChart(),width,height,renderingInfo); + } catch (IOException e) { + throw new OperationException("Problem occured while write chart.",e); + } + } + + public String getImageMap(String imageMapName) throws OperationException + { + try { + StringWriter stringWriter = new StringWriter(); + PrintWriter printWriter = new PrintWriter(stringWriter); + ChartUtilities.writeImageMap(printWriter, imageMapName, renderingInfo,false); + printWriter.flush(); + + String imageMap = stringWriter.getBuffer().toString(); + return imageMap; + } catch (IOException e) { + throw new OperationException("Problem occured while writing imagemap",e); + } + } + + public void writeImageMap(OutputStream outputStream,String imageMapName) throws OperationException + { + PrintWriter printWriter = new PrintWriter(outputStream); + try { + ChartUtilities.writeImageMap(printWriter, imageMapName, renderingInfo,false); + printWriter.flush(); + printWriter.close(); + } catch (IOException e) { + throw new OperationException("Problem occured while writing imagemap",e); + } + } + + public String saveImageMap(String imageMapPath) throws OperationException + { + String fileSeparator = System.getProperty("file.separator"); + int index = imageMapPath.lastIndexOf(fileSeparator)+1; + String imageMapName = imageMapPath.substring(index); + + try { + FileOutputStream fos = new FileOutputStream(new File(imageMapPath)); + PrintWriter printWriter = new PrintWriter(fos); + ChartUtilities.writeImageMap(printWriter, imageMapName, renderingInfo,false); + printWriter.flush(); + fos.close(); + + return imageMapName; + } catch (IOException e) { + throw new OperationException("Problem occured while writing imagemap",e); + } + } + + public boolean isShowLegend() { + return showLegend; + } + + public void setShowLegend(boolean showLegend) { + this.showLegend = showLegend; + } + + public boolean isShowTooltip() { + return showTooltip; + } + + public void setShowTooltip(boolean showTooltip) { + this.showTooltip = showTooltip; + } + + public String getSubtitle() { + return subtitle; + } + + public void setSubtitle(String subtitle) { + this.subtitle = subtitle; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getXLabel() { + return xLabel; + } + + public void setXLabel(String label) { + xLabel = label; + } + + public String getYLabel() { + return yLabel; + } + + public void setYLabel(String label) { + yLabel = label; + } + + public boolean isShowLabels() { + return showLabels; + } + + public void setShowLabels(boolean showLabels) { + this.showLabels = showLabels; + } + + public ChartRenderingInfo getRenderingInfo() { + return renderingInfo; + } + + public void setRenderingInfo(ChartRenderingInfo renderingInfo) { + this.renderingInfo = renderingInfo; + } + + public JFreeChart getChart() throws OperationException { + + if(chart==null) + createChart(); + + return chart; + } + +} diff --git a/posterita/posterita/src/main/org/posterita/core/AbstractParser.java b/posterita/posterita/src/main/org/posterita/core/AbstractParser.java new file mode 100644 index 0000000000..d0f75c658b --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/core/AbstractParser.java @@ -0,0 +1,95 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * 12-Jul-2006 16:05:22 by praveen + * + */ + +package org.posterita.core; + +import org.posterita.exceptions.OperationException; + + + +/** + * @author vikram + * + * To change the template for this generated type comment go to + * Window>Preferences>Java>Code Generation>Code and Comments + */ + + +public abstract class AbstractParser +{ + protected static final String START_TAG = "<"; + protected static final String END_TAG = ">"; + protected static final String START_COMMENT = ""; + + protected String removeTag(String strData, String startTagData, String endTagData) throws OperationException + { + int startTag; + int endTag; + startTag = strData.indexOf(startTagData); + endTag = strData.indexOf(endTagData); + + if (startTag == -1) + { + throw new OperationException("No startTag found"); + } + + if (endTag == -1) + { + throw new OperationException("No endTag found"); + } + if (startTag > endTag) + { + throw new OperationException("startTag greater than endTag found"); + } + String beginning; + String end; + + beginning = strData.substring(0, startTag +startTagData.length()-1); + end = strData.substring(endTag +startTagData.length()); + strData = beginning.concat(end); + + return strData; + } + + protected String removeTags(String str) throws OperationException + { + while (str.indexOf(START_TAG) != -1) + { + str = removeTag(str, START_TAG, END_TAG); + } + + return str; + } + + + protected String removeComments(String str) throws OperationException + { + while (str.indexOf(START_COMMENT) != -1) + { + str = removeTag(str, START_COMMENT, END_COMMENT); + } + + return str; + } + +} diff --git a/posterita/posterita/src/main/org/posterita/core/BarChart.java b/posterita/posterita/src/main/org/posterita/core/BarChart.java new file mode 100644 index 0000000000..02c0798b58 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/core/BarChart.java @@ -0,0 +1,174 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * 12-Jul-2006 16:05:22 by praveen + * + */ + +package org.posterita.core; + +import java.sql.SQLException; + +import org.compiere.util.DB; +import org.jfree.chart.ChartFactory; +import org.jfree.chart.JFreeChart; +import org.jfree.chart.axis.NumberAxis; +import org.jfree.chart.labels.StandardCategoryItemLabelGenerator; +import org.jfree.chart.plot.CategoryPlot; +import org.jfree.chart.plot.PlotOrientation; +import org.jfree.chart.renderer.category.BarRenderer; +import org.jfree.chart.renderer.category.CategoryItemRenderer; +import org.jfree.chart.title.TextTitle; +import org.jfree.data.category.DefaultCategoryDataset; +import org.jfree.data.jdbc.JDBCCategoryDataset; + +import org.posterita.exceptions.OperationException; + +public class BarChart extends AbstractChart +{ + public static final String CHART_TYPE = "BarChart"; + public static final PlotOrientation VERTICAL = PlotOrientation.VERTICAL; + public static final PlotOrientation HORIZONTAL = PlotOrientation.HORIZONTAL; + public static final int BARCHART_FLAT = 1; + public static final int BARCHART_3D = 2; + + private DefaultCategoryDataset dataset = null; + private PlotOrientation orientation = VERTICAL; + private int type = BARCHART_FLAT; + private double maximumBarWidth = 0.1d; + private boolean integerTickUnits = false; + + public BarChart(){}; + + public BarChart(DefaultCategoryDataset dataset,String title) + { + this.dataset = dataset; + this.title = title; + + } + + public BarChart(DefaultCategoryDataset dataset,String title,String xLabel,String yLabel) + { + this.dataset = dataset; + this.title = title; + this.xLabel = xLabel; + this.yLabel = yLabel; + } + + public JFreeChart createChart() throws OperationException + { + if(dataset==null) + { + throw new OperationException("Cannot create Bar chart: cause -> dataset empty!"); + } + + switch (type) { + case BARCHART_FLAT: + chart = ChartFactory.createBarChart(title,xLabel,yLabel,dataset,orientation,showLegend,showTooltip,true); + break; + + case BARCHART_3D: + chart = ChartFactory.createBarChart3D(title,xLabel,yLabel,dataset,orientation,showLegend,showTooltip,true); + break; + + default: + throw new OperationException("Invalid barchart type! Can only be BarChart.BARCHART_FLAT or BarChart.BARCHART_3D"); + } + + //setting subtitle + if(subtitle!=null) + { + TextTitle title = new TextTitle(subtitle); + chart.addSubtitle(title); + } + + CategoryPlot plot = chart.getCategoryPlot(); + NumberAxis axis = (NumberAxis) plot.getRangeAxis(); + + //setting tickUnits + if(integerTickUnits) + axis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); + + BarRenderer barRender = (BarRenderer) plot.getRenderer(); + barRender.setMaximumBarWidth(maximumBarWidth); + + //displaying labels + if(showLabels) + { + CategoryItemRenderer itemRender = plot.getRenderer(); + itemRender.setItemLabelGenerator(new StandardCategoryItemLabelGenerator()); + itemRender.setItemLabelsVisible(true); + } + + return chart; + } + + public DefaultCategoryDataset getDataset() { + return dataset; + } + + public void setDataset(DefaultCategoryDataset dataset) { + this.dataset = dataset; + } + + public PlotOrientation getOrientation() { + return orientation; + } + + public void setOrientation(PlotOrientation orientation) { + this.orientation = orientation; + } + + public int getType() { + return type; + } + + public void setType(int type) { + this.type = type; + } + + public double getMaximumBarWidth() { + return maximumBarWidth; + } + + public void setMaximumBarWidth(double maximumBarWidth) { + this.maximumBarWidth = maximumBarWidth; + } + + public boolean isIntegerTickUnits() { + return integerTickUnits; + } + + public void setIntegerTickUnits(boolean integerTickUnits) { + this.integerTickUnits = integerTickUnits; + } + + public void getDataSetFromSQL(String sql) throws OperationException + { + JDBCCategoryDataset jdbcDataset = new JDBCCategoryDataset(DB.getConnectionRO()); + + try + { + jdbcDataset.executeQuery(sql); + this.dataset = jdbcDataset; + } catch (SQLException e) { + throw new OperationException(e); + } + } + +} diff --git a/posterita/posterita/src/main/org/posterita/core/BarLabelGenerator.java b/posterita/posterita/src/main/org/posterita/core/BarLabelGenerator.java new file mode 100644 index 0000000000..d9072aa2b1 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/core/BarLabelGenerator.java @@ -0,0 +1,49 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * 29-Aug-2006 16:39:33 by praveen + * + */ + +package org.posterita.core; + +import java.util.Map; + +import org.jfree.chart.labels.StandardCategoryItemLabelGenerator; +import org.jfree.data.category.CategoryDataset; + +public class BarLabelGenerator extends StandardCategoryItemLabelGenerator +{ + /** + * + */ + private static final long serialVersionUID = 1L; + Map labelMap = null; + + public BarLabelGenerator(Map labelMap) + { + this.labelMap = labelMap; + } + + public String generateLabel(CategoryDataset arg0, int arg1, int arg2) + { + return super.generateLabel(arg0, arg1, arg2); + } + + +} diff --git a/posterita/posterita/src/main/org/posterita/core/CheckDuplicateEntities.java b/posterita/posterita/src/main/org/posterita/core/CheckDuplicateEntities.java new file mode 100644 index 0000000000..a2608281d9 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/core/CheckDuplicateEntities.java @@ -0,0 +1,178 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 01-Aug-2005 by alok + * + */ +package org.posterita.core; + +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.Properties; + +import org.compiere.util.DB; +import org.compiere.util.Env; + + + + +public class CheckDuplicateEntities +{ + + public static boolean checkDuplicateName(Properties ctx,String name,String tableName) + { + boolean existName = false; + + String sql = " select name from "+tableName + + " where upper(name) = upper('"+name+"')" + + " and AD_CLIENT_ID = "+ Env.getAD_Client_ID(ctx); + + PreparedStatement pstmt = DB.prepareStatement(sql, null); + + ResultSet rs = null; + + try + { + rs = pstmt.executeQuery(); + + while(rs.next()) + { + existName = true; + } + + rs.close(); + } + catch(SQLException e) + { + e.printStackTrace(); + } + finally + { + try + { + pstmt.close(); + } + catch(Exception e) + {} + + pstmt = null; + } + + return existName; + + } + + public static boolean checkDuplicateBPName(Properties ctx,String name,String name2,String tableName) + { + boolean existName = false; + String sql; + + if (name2 != null) + sql = " select name, name2 from "+tableName + + " where upper(name) = upper('"+name+"')" + + " and upper(name2) = upper('" + name2 + "')" + + " and ad_org_id = " + Env.getAD_Org_ID(ctx) + + " and AD_CLIENT_ID = "+ Env.getAD_Client_ID(ctx); + else + sql = " select name, name2 from "+tableName + + " where upper(name) = upper('"+name+"')" + + " and upper(name2) is null" + + " and ad_org_id = " + Env.getAD_Org_ID(ctx) + + " and AD_CLIENT_ID = "+ Env.getAD_Client_ID(ctx); + + PreparedStatement pstmt = DB.prepareStatement(sql, null); + + ResultSet rs = null; + + try + { + rs = pstmt.executeQuery(); + + while(rs.next()) + { + existName = true; + } + + rs.close(); + } + catch(SQLException e) + { + e.printStackTrace(); + } + finally + { + try + { + pstmt.close(); + } + catch (Exception e) + {} + + pstmt = null; + } + + return existName; + + } + + public static boolean checkDuplicateChequeNo(Properties ctx,String chequeNo,String tableName) + { + boolean existCheque = false; + + String sql = " select CHEQUENO from "+tableName + + " where upper(CHEQUENO) = upper('"+chequeNo+"')" + + " and AD_CLIENT_ID = "+ Env.getAD_Client_ID(ctx); + + PreparedStatement pstmt = DB.prepareStatement(sql, null); + + ResultSet rs = null; + + try + { + rs = pstmt.executeQuery(); + + while(rs.next()) + { + existCheque = true; + } + + rs.close(); + } + catch(SQLException e) + { + e.printStackTrace(); + } + finally + { + try + { + pstmt.close(); + } + catch(Exception e) + {} + + pstmt = null; + } + + return existCheque; + + } + + +} diff --git a/posterita/posterita/src/main/org/posterita/core/Configuration.java b/posterita/posterita/src/main/org/posterita/core/Configuration.java new file mode 100644 index 0000000000..7d08a925db --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/core/Configuration.java @@ -0,0 +1,310 @@ +/** + * + * Copyright (c) 2008 Posterita. All Rights Reserved. + * + * This software is the confidential and proprietary information of + * Posterita. ("Confidential Information"). You shall not + * disclose such Confidential Information and shall use it only in + * accordance with the terms of the license agreement you entered into + * with Posterita. + * + * POSTERITA MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE + * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT + * NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR + * A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. TAMAK ICT SHALL NOT + * BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, + * MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. + * + * Apr 9, 2008 11:07:09 AM by praveen + * + */ + +package org.posterita.core; + +import java.util.logging.Level; + +import javax.servlet.http.Cookie; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.compiere.util.CLogger; +import org.posterita.Constants; + +public class Configuration +{ + public static final String IS_QUICK_SALES = "configuration.isQuickSales"; + public static final String IS_CUSTOMER_COMPULSORY = "configuration.isCustomerCompulsory"; + public static final String ALLOW_CREDIT_SALES = "configuration.allowCreditSales"; + public static final String ALLOW_CUSTOMER_RETURN_ORDER = "configuration.allowCustomerReturnOrder"; + public static final String ALLOW_INVOKE_CUSTOMER_RETURN_ORDER = "configuration.allowInvokeCustomerReturnOrder"; + public static final String PAYMENT_RULE = "configuration.paymentRule"; + public static final String SEARCH_PRODUCT_BY = "configuration.searchProductBy"; + + public static final String BARCODE = "barcode"; + public static final String DESCRIPTION = "description"; + public static final String PRODUCT_NAME = "productQuery"; + + private static CLogger log = CLogger.getCLogger(Configuration.class); + + private boolean isQuickSales = true; + private boolean isCustomerCompulsory = false; + private boolean allowCreditSales = true; + private boolean allowCustomerReturnOrder = true; + private boolean allowInvokeCustomerReturnOrder = true; + private String paymentRule = "cash"; + private String searchProductBy = BARCODE; + private String orderType; + private int priceListId; + private boolean isSOTrx; + + public boolean getIsSOTrx() + { + return isSOTrx; + } + + public void setIsSOTrx(boolean isSOTrx) + { + this.isSOTrx = isSOTrx; + } + + public int getPriceListId() + { + return priceListId; + } + + public void setPriceListId(int priceListId) + { + this.priceListId = priceListId; + } + + public String getOrderType() + { + return orderType; + } + + public void setOrderType(String orderType) + { + this.orderType = orderType; + } + + public Configuration() + { + //do nothing + } + + public static Configuration getConfiguration(HttpServletRequest request) + { + Configuration config = null; + config = (Configuration) request.getSession().getAttribute(Constants.CONFIGURATION); + + if(config == null) + { + config = new Configuration(); + config.load(request); + + request.getSession().setAttribute(Constants.CONFIGURATION, config); + } + + return config; + } + + /** + * Loads configuration from cookie + * @param request + */ + public void load(HttpServletRequest request) + { + //TODO refactor load configuration from role + + Cookie[] cookies = request.getCookies(); + if(cookies != null && cookies.length > 0) + { + for(Cookie cookie : cookies) + { + String name = cookie.getName(); + String value = cookie.getValue(); + + if(name.startsWith("configuration.")) + { + if(IS_QUICK_SALES.equalsIgnoreCase(name)) + { + try + { + isQuickSales = Boolean.parseBoolean(value); + } + catch(Exception e) + { + log.log(Level.WARNING, "Invalid value for: "+ IS_QUICK_SALES +" Using default: " + isQuickSales, e); + } + } + + if(IS_CUSTOMER_COMPULSORY.equalsIgnoreCase(name)) + { + try + { + isCustomerCompulsory = Boolean.parseBoolean(value); + } + catch(Exception e) + { + log.log(Level.WARNING, "Invalid value for: "+ IS_CUSTOMER_COMPULSORY +" Using default: " + isCustomerCompulsory, e); + } + } + + if(ALLOW_CREDIT_SALES.equalsIgnoreCase(name)) + { + try + { + allowCreditSales = Boolean.parseBoolean(value); + } + catch(Exception e) + { + log.log(Level.WARNING, "Invalid value for: "+ ALLOW_CREDIT_SALES +" Using default: " + allowCreditSales, e); + } + } + + if(ALLOW_CUSTOMER_RETURN_ORDER.equalsIgnoreCase(name)) + { + try + { + allowCustomerReturnOrder = Boolean.parseBoolean(value); + } + catch(Exception e) + { + log.log(Level.WARNING, "Invalid value for: "+ ALLOW_CUSTOMER_RETURN_ORDER +" Using default: " + allowCustomerReturnOrder, e); + } + } + + if(ALLOW_INVOKE_CUSTOMER_RETURN_ORDER.equalsIgnoreCase(name)) + { + try + { + allowInvokeCustomerReturnOrder = Boolean.parseBoolean(value); + } + catch(Exception e) + { + log.log(Level.WARNING, "Invalid value for: "+ ALLOW_INVOKE_CUSTOMER_RETURN_ORDER +" Using default: " + allowInvokeCustomerReturnOrder, e); + } + } + + if(PAYMENT_RULE.equalsIgnoreCase(name)) + { + if(value.equalsIgnoreCase(Constants.PAYMENT_RULE_CASH)|| + value.equalsIgnoreCase(Constants.PAYMENT_RULE_CARD)|| + value.equalsIgnoreCase(Constants.PAYMENT_RULE_CHEQUE)|| + value.equalsIgnoreCase(Constants.PAYMENT_RULE_MIXED)) + { + paymentRule = value; + } + else + { + log.log(Level.WARNING, "Invalid value for: "+ PAYMENT_RULE +" Using default: " + paymentRule); + } + } + + if(SEARCH_PRODUCT_BY.equalsIgnoreCase(name)) + { + if(value.equalsIgnoreCase("barcode")|| + value.equalsIgnoreCase("name")|| + value.equalsIgnoreCase("description")) + { + searchProductBy = value; + } + else + { + log.log(Level.WARNING, "Invalid value for: "+ SEARCH_PRODUCT_BY +" Using default: " + searchProductBy); + } + } + + } + } + } + + } + + /** + * Save default configuration in cookies + * @param request + */ + public void save(HttpServletResponse response) + { + String[][] nameValues = { + { IS_QUICK_SALES, isQuickSales + "" }, + { IS_CUSTOMER_COMPULSORY, isCustomerCompulsory + "" }, + { ALLOW_CREDIT_SALES, allowCreditSales + "" }, + { ALLOW_CUSTOMER_RETURN_ORDER, allowCustomerReturnOrder + "" }, + { ALLOW_INVOKE_CUSTOMER_RETURN_ORDER, allowInvokeCustomerReturnOrder + "" }, + { PAYMENT_RULE, paymentRule }, + { SEARCH_PRODUCT_BY, searchProductBy } + }; + + for (int i = 0; i < nameValues.length; i++) + { + String[] namevalue = nameValues[i]; + String name = namevalue[0]; + String value = namevalue[1]; + + Cookie cookie = new Cookie(name, value); + cookie.setMaxAge(60*60*24*365); + + response.addCookie(cookie); + } + } + + public boolean isQuickSales() { + return isQuickSales; + } + + public void setQuickSales(boolean isQuickSales) { + this.isQuickSales = isQuickSales; + } + + public boolean isCustomerCompulsory() { + return isCustomerCompulsory; + } + + public void setCustomerCompulsory(boolean isCustomerCompulsory) { + this.isCustomerCompulsory = isCustomerCompulsory; + } + + public boolean isAllowCreditSales() { + return allowCreditSales; + } + + public void setAllowCreditSales(boolean allowCreditSales) { + this.allowCreditSales = allowCreditSales; + } + + public boolean isAllowCustomerReturnOrder() { + return allowCustomerReturnOrder; + } + + public void setAllowCustomerReturnOrder(boolean allowCustomerReturnOrder) { + this.allowCustomerReturnOrder = allowCustomerReturnOrder; + } + + public boolean isAllowInvokeCustomerReturnOrder() { + return allowInvokeCustomerReturnOrder; + } + + public void setAllowInvokeCustomerReturnOrder( + boolean allowInvokeCustomerReturnOrder) { + this.allowInvokeCustomerReturnOrder = allowInvokeCustomerReturnOrder; + } + + public String getPaymentRule() { + return paymentRule; + } + + public void setPaymentRule(String paymentRule) { + this.paymentRule = paymentRule; + } + + public String getSearchProductBy() { + return searchProductBy; + } + + public void setSearchProductBy(String searchProductBy) { + this.searchProductBy = searchProductBy; + } + +} diff --git a/posterita/posterita/src/main/org/posterita/core/ContextId.java b/posterita/posterita/src/main/org/posterita/core/ContextId.java new file mode 100644 index 0000000000..43844daa22 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/core/ContextId.java @@ -0,0 +1,65 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Sep 26, 2006 + */ + + +package org.posterita.core; + +import java.util.Properties; + + +public class ContextId +{ + Properties ctx; + int id; + Object bean; + + public ContextId(Properties ctx, int id) + { + + this.ctx = ctx; + this.id = id; + } + + public Properties getCtx() { + return ctx; + } + + public void setCtx(Properties ctx) { + this.ctx = ctx; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public Object getBean() { + return bean; + } + + public void setBean(Object bean) { + this.bean = bean; + } + +} diff --git a/posterita/posterita/src/main/org/posterita/core/CrossTabReportGenerator.java b/posterita/posterita/src/main/org/posterita/core/CrossTabReportGenerator.java new file mode 100644 index 0000000000..aa14078563 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/core/CrossTabReportGenerator.java @@ -0,0 +1,254 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Feb 24, 2006 by praveen + * + */ +package org.posterita.core; + +import java.awt.Color; +import java.util.Iterator; + +import org.posterita.exceptions.OperationException; +import com.lowagie.text.Chunk; +import com.lowagie.text.Document; +import com.lowagie.text.DocumentException; +import com.lowagie.text.Element; +import com.lowagie.text.Image; +import com.lowagie.text.Paragraph; +import com.lowagie.text.Rectangle; +import com.lowagie.text.pdf.PdfPCell; +import com.lowagie.text.pdf.PdfPTable; + + +public class CrossTabReportGenerator extends PDFReportGenerator +{ + + protected void writeDocument(Document document) throws OperationException + { + try + { + int noOfRows = dataSource.size(); + String longestText = ""; + int columnCount = 0; + + Object[] obj = null; + + Object[] header = (Object[]) dataSource.get(0); + columnCount = header.length; + + PdfPTable table = new PdfPTable(columnCount); + table.setWidthPercentage(100); + table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER); + table.getDefaultCell().setVerticalAlignment(Element.ALIGN_MIDDLE); + table.getDefaultCell().setPaddingBottom(5); + table.getDefaultCell().setPaddingTop(5); + + + //adding the headers + for(int i = 0; i < columnCount; i++) + { + if(i==0) + { + longestText = header[i].toString(); + table.addCell(new Paragraph(header[i].toString())); + } + else + { + Image img = getTextAsImage(header[i].toString()); + img.setRotationDegrees(90); + img.setAlignment(Image.ALIGN_BOTTOM); + + PdfPCell cell = new PdfPCell(img); + cell.setPadding(4); + cell.setHorizontalAlignment(Element.ALIGN_CENTER); + cell.setVerticalAlignment(Element.ALIGN_BOTTOM); + //cell.setBackgroundColor(new Color(0, 0, 255)); + + table.addCell(cell); + } + } + + + + //adding the data + for(int j = 1; j < noOfRows; j++) + { + obj = (Object[]) dataSource.get(j); + + + for(int k = 0; k < columnCount; k++) + { + if(k==0) + { + String text = obj[0].toString(); + + if(new Chunk(text,HEADER_FONT).getWidthPoint() > new Chunk(longestText,HEADER_FONT).getWidthPoint()) + { + longestText = text; + } + + + Chunk txtck = new Chunk(obj[0].toString(),HEADER_FONT); + PdfPCell cell = new PdfPCell(new Paragraph(txtck)); + + if(j == noOfRows - 1) + { + cell.setBackgroundColor(new Color(170,170,170)); + } + + cell.setHorizontalAlignment(Element.ALIGN_LEFT); + cell.setVerticalAlignment(Element.ALIGN_MIDDLE); + cell.setPaddingBottom(5); + cell.setPaddingTop(5); + cell.setPaddingLeft(5); + + table.addCell(cell); + } + else + { + Chunk txtck = new Chunk(obj[k].toString(),DATA_FONT); + + if(k == columnCount-1) + { + PdfPCell cell = new PdfPCell(new Paragraph(txtck)); + cell.setBackgroundColor(new Color(170,170,170)); + cell.setHorizontalAlignment(Element.ALIGN_CENTER); + cell.setVerticalAlignment(Element.ALIGN_MIDDLE); + cell.setPaddingBottom(5); + cell.setPaddingTop(5); + + table.addCell(cell); + } + else + { + PdfPCell cell = new PdfPCell(new Paragraph(txtck)); + cell.setHorizontalAlignment(Element.ALIGN_CENTER); + cell.setVerticalAlignment(Element.ALIGN_MIDDLE); + cell.setPaddingBottom(5); + cell.setPaddingTop(5); + + if(j == noOfRows - 1) + { + cell.setBackgroundColor(new Color(170,170,170)); + } + + table.addCell(cell); + } + } + + } + + } + + //setting table width + Chunk dataChk = new Chunk("9999",DATA_FONT); + Chunk headerChk = new Chunk(longestText,HEADER_FONT); + + float dataChkLength = dataChk.getWidthPoint() + 2*CELLPADDING ; + float headerChkLength = headerChk.getWidthPoint() + 2*CELLPADDING; + + float tableWidth = headerChkLength + dataChkLength*columnCount; + float actualTableWidth = document.getPageSize().width() - 2*MARGIN; + + float columnWidth = dataChkLength; + + if(tableWidth < actualTableWidth) + { + columnWidth = (actualTableWidth - headerChkLength)/(columnCount - 1); + } + + + float[] widths = new float[columnCount]; + widths[0] = headerChkLength + 2*CELLPADDING; + + for(int i=1; i longestText.length()) + { + longestText = header; + } + } + + + //setting the table width + Chunk dataChk = new Chunk("9999",DATA_FONT); + Chunk headerChk = new Chunk(longestText,HEADER_FONT); + + float dataChkLength = dataChk.getWidthPoint() + 2*CELLPADDING ; + float headerChkLength = headerChk.getWidthPoint() + 2*CELLPADDING; + + float tableWidth = headerChkLength + dataChkLength*columnCount; + + float actualTableWidth = document.getPageSize().width() - 2*MARGIN; + //float actualTableHeight = document.getPageSize().height() - 2*MARGIN; + + //if the table size is greater than that of the page we should + //scale the page + + if(tableWidth > actualTableWidth) + { + float documentWidth = document.getPageSize().width(); + float documentHeight = document.getPageSize().height(); + + float newDocumentWidth = tableWidth + 2*MARGIN; + float newDocumentHeight = (documentHeight * newDocumentWidth)/documentWidth; + + return new Rectangle(newDocumentWidth,newDocumentHeight); + } + + return document.getPageSize(); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/core/DocStatusMap.java b/posterita/posterita/src/main/org/posterita/core/DocStatusMap.java new file mode 100644 index 0000000000..6f6afe11b9 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/core/DocStatusMap.java @@ -0,0 +1,55 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Jun 17, 2005 by din + */ + +package org.posterita.core; + +import java.util.LinkedHashMap; + +import org.compiere.process.DocAction; + +public class DocStatusMap +{ + static LinkedHashMap docStatusMap; + + public static LinkedHashMap getDocStatusMap() + { + return docStatusMap; + } + + + static + { + docStatusMap = new LinkedHashMap(); + docStatusMap.put(DocAction.STATUS_Approved,"Approved"); + docStatusMap.put(DocAction.STATUS_Closed,"Closed"); + docStatusMap.put(DocAction.STATUS_Completed,"Completed"); + docStatusMap.put(DocAction.STATUS_Drafted,"Drafted"); + docStatusMap.put(DocAction.STATUS_InProgress,"In Progress"); + docStatusMap.put(DocAction.STATUS_Invalid,"Invalid"); + docStatusMap.put(DocAction.STATUS_NotApproved,"Not Approved"); + docStatusMap.put(DocAction.STATUS_Reversed,"Reserved"); + docStatusMap.put(DocAction.STATUS_Unknown,"UnKnown"); + docStatusMap.put(DocAction.STATUS_Voided,"Voided"); + docStatusMap.put(DocAction.STATUS_WaitingConfirmation,"Waiting Confirmation"); + docStatusMap.put(DocAction.STATUS_WaitingPayment,"Waiting Payment"); + + } +} diff --git a/posterita/posterita/src/main/org/posterita/core/EmailValidator.java b/posterita/posterita/src/main/org/posterita/core/EmailValidator.java new file mode 100644 index 0000000000..04b7adb676 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/core/EmailValidator.java @@ -0,0 +1,171 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * 12-Jul-2006 16:05:22 by praveen + * + */ + + +package org.posterita.core; + +public class EmailValidator +{ + public static boolean isValidEmail(String theEmail) + { + if(theEmail == null) + return false; + + else if(theEmail.length() == 0) + return false; + + else if(theEmail.length() > 78) // email addresses must fit on one line + return false; + + else + { + // if last character is a period, remove it + if(theEmail.charAt(theEmail.length()-1) == '.') + theEmail = theEmail.substring(0, theEmail.length() -1); + + //check for presence of "at" sign + int atIndex = theEmail.indexOf('@'); + + if(atIndex < 0) return false; + + //check for valid characters in the mailbox portion of the address + String mailbox = theEmail.substring(0, atIndex); + + if(mailbox == null || mailbox.length() == 0) + return false; + + else + { + int oldDotIndex = 0; + int dotEnd = mailbox.indexOf('.', oldDotIndex); + boolean done = false; + do + { + //cannot have 2 dots in a row + if(dotEnd == oldDotIndex) + return false; + + if(dotEnd < 0) + { + dotEnd = mailbox.length(); + done = true; + } + + for(int i = oldDotIndex; i < dotEnd; i++) + { + char cur = mailbox.charAt(i); + + if(!Character.isLetter(cur) && + !Character.isDigit(cur) && + cur != '!' && cur != '#' && + cur != '$' && cur != '%' && + cur != '&' && cur != '\'' && + cur != '*' && cur != '+' && + cur != '-' && cur != '/' && + cur != '=' && cur != '?' && + cur != '^' && cur != '_' && + cur != '`' && cur != '{' && + cur != '|' && cur != '}' && + cur != '~') + return false; + } + + oldDotIndex = dotEnd+1; + dotEnd = mailbox.indexOf('.', oldDotIndex+1); + } + while(!done); + } + + //check for a valid domain name + String domain = theEmail.substring(atIndex+1); + + if(domain == null || domain.length() == 0) + return false; + + else + { + //domains are divided into groups separated by dots + int oldDotIndex = 0; + int dotEnd = domain.indexOf('.', oldDotIndex); + + if(dotEnd < 0) + return false; + + + do + { + //cannot have 2 dots in a row + if(oldDotIndex == dotEnd) + return false; + + //first character must be letter or digit + if(!Character.isLetter(domain.charAt(oldDotIndex)) && + !Character.isDigit(domain.charAt(oldDotIndex))) + return false; + + //middle characters can be digits, letters, or hyphens + for(int i = oldDotIndex+1; i < dotEnd - 1; i++) + { + char cur = domain.charAt(i); + + if(!Character.isLetter(cur) && + !Character.isDigit(cur) && + cur != '-') + return false; + } + + //last character must be a letter or digit + if(!Character.isLetter(domain.charAt(dotEnd - 1)) && + !Character.isDigit(domain.charAt(dotEnd - 1))) + return false; + + oldDotIndex = dotEnd+1; + dotEnd = domain.indexOf('.', oldDotIndex+1); + } + + while(dotEnd > 0); + + //check the last part of the domain + String ext = domain.substring(oldDotIndex); + + if(ext == null || ext.length() == 0) + return false; + + else if(ext.length() < 2 || ext.length() > 4) + return false; + + else + { + for(int i = 0; i < ext.length(); i++) + { + if(!Character.isLetter(ext.charAt(i)) && + !Character.isDigit(ext.charAt(i))) + return false; + } + } + + } + } + return true; + } // end isValidEmail + +} diff --git a/posterita/posterita/src/main/org/posterita/core/FactoryPropertiesManager.java b/posterita/posterita/src/main/org/posterita/core/FactoryPropertiesManager.java new file mode 100644 index 0000000000..5a1786f513 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/core/FactoryPropertiesManager.java @@ -0,0 +1,50 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 24-Jun-2005 by alok + * + */ +package org.posterita.core; + +import org.posterita.factory.DBPropertiesManager; +import org.posterita.factory.WebProperties; + + + +public class FactoryPropertiesManager +{ + private FactoryPropertiesManager() + { + + } + + private static WebProperties singleton; + + public static WebProperties getProperty() + { + if (singleton == null) + singleton = new DBPropertiesManager(); + + return singleton; + } + + protected String getFileName() + { + return "Factory"; + } +} diff --git a/posterita/posterita/src/main/org/posterita/core/FileManager.java b/posterita/posterita/src/main/org/posterita/core/FileManager.java new file mode 100644 index 0000000000..cb16b9ef03 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/core/FileManager.java @@ -0,0 +1,274 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ +package org.posterita.core; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.FileReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.OutputStream; +import java.io.OutputStreamWriter; +import java.util.ArrayList; +import java.util.Properties; + +import org.compiere.util.KeyNamePair; + +import org.posterita.beans.AttributeValuesPair; +import org.posterita.beans.InventoryBean; +import org.posterita.beans.ProductBean; +import org.posterita.businesslogic.stock.InventoryManager; +import org.posterita.exceptions.BarcodeAlreadyExistsException; +import org.posterita.exceptions.OperationException; +import org.posterita.exceptions.ProductAlreadyExistException; + +public class FileManager +{ + public static final String FILE_PATH_SEPARATOR = System.getProperty("file.separator"); + + public static void createFile(String filename) throws IOException + { + File newFile = new File(filename); + + File parentFile = newFile.getParentFile(); + + if(!parentFile.exists()) + parentFile.mkdirs(); + if (!newFile.exists()) + newFile.createNewFile(); + + + } + + + public static void write(String filename, String content, boolean cond) throws IOException + { + createFile(filename); + + + //BufferedWriter bw = null; + + + FileOutputStream out = new FileOutputStream(filename, cond); + OutputStreamWriter wr = new OutputStreamWriter(out,"ISO-8859-1"); + + + wr.write(content); + + wr.flush(); + + wr.close(); + + } + + public static ArrayList read(InputStream is) throws IOException + { + String delimiter = ","; + String line; + ProductBean bean; + AttributeValuesPair pair = null; + ArrayList list = new ArrayList(); + + InputStreamReader isr = new InputStreamReader(is); + BufferedReader bf = new BufferedReader(isr); + line = bf.readLine(); + String model; + String colour; + String transmission; + String year; + String strProductid; + String serno; + String engineNo; + while ((line = bf.readLine())!=null) + { + + bean = new ProductBean(); + ArrayList tokens = tokenize(line,delimiter); + strProductid = tokens.get(0).toString(); + bean.setProductId(Integer.valueOf(strProductid)); + + model = tokens.get(1).toString(); + KeyNamePair knpModel = new KeyNamePair(1,model); + + + transmission = tokens.get(2).toString(); + KeyNamePair knpTransmission = new KeyNamePair(2,transmission); + + colour = tokens.get(3).toString(); + KeyNamePair knpColour = new KeyNamePair(3,colour); + + year = tokens.get(4).toString();; + KeyNamePair knpYear = new KeyNamePair(4,year); + + pair = new AttributeValuesPair(); + pair.setModelAttributeValue(knpModel); + pair.setTransmissionAttributeValue(knpTransmission); + pair.setColourAttributeValue(knpColour); + pair.setYearAttributeValue(knpYear); + bean.setAttributeValuesPair(pair); + + + serno = tokens.get(5).toString();; + engineNo = tokens.get(6).toString();; + bean.setSerno(serno); + bean.setEngineNo(engineNo); + list.add(bean); + } + + bf.close(); + isr.close(); + return list; + + } + + public static ArrayList tokenize(String str, String delimiter) + { + ArrayList list = Interpreter.interprete(str,delimiter); + + return list; + } + + public static void write(InputStream content, String fileTarget) throws IOException + { + createFile(fileTarget); + + FileOutputStream streamOut = new FileOutputStream(fileTarget); + + int bytesRead = 0; + + byte[] buffer = new byte[8192]; + while((bytesRead = content.read(buffer,0,8192))!=-1) + { + streamOut.write(buffer,0,bytesRead); + } + + streamOut.close(); + content.close(); + } + + public static void copy(File src, File dst) throws IOException + { + InputStream in = new FileInputStream(src); + OutputStream out = new FileOutputStream(dst); + + // Transfer bytes from in to out + byte[] buf = new byte[1024]; + int len; + + while ((len = in.read(buf)) > 0) + { + out.write(buf, 0, len); + } + + in.close(); + out.close(); + } + + public static ArrayList readLines(File file) throws OperationException + { + BufferedReader bufferedReader = null; + + if(file == null) + throw new OperationException("File cannot be null"); + if(!file.exists()) + throw new OperationException("File does not exist, file: " + file.getAbsolutePath()); + if(file.isDirectory()) + throw new OperationException("File cannot be a directory, file: " + file.getAbsolutePath()); + + ArrayList readLines = new ArrayList(); + + try + { + FileReader fileInReader = new FileReader(file); + bufferedReader = new BufferedReader(fileInReader); + String line; + while((line = bufferedReader.readLine()) != null) + readLines.add(line); + + return readLines; + } + catch(FileNotFoundException ex) + { + throw new OperationException("File not found exception, file: " + file.getAbsolutePath(), ex); + } + catch(IOException ex) + { + throw new OperationException("IOException while reading file: " + file.getAbsolutePath(), ex); + } + finally + { + if (bufferedReader != null) + { + try + { + bufferedReader.close(); + } + catch(Exception e) + {} + } + } + + } + + public static void moveFile(File from, File to) throws OperationException + { + if (from.getAbsolutePath().equals(to.getAbsolutePath())) + return; + + if(!from.exists()) + throw new OperationException("From file does not exist"); + if(from.isDirectory()) + throw new OperationException("From file cannot be a directory"); + + if(to.exists()) + throw new OperationException("To file already exists"); + + try + { + InputStream in = new FileInputStream(from); + OutputStream out = new FileOutputStream(to); + + // Transfer bytes from in to out + byte[] buf = new byte[1024]; + int len; + + while ((len = in.read(buf)) > 0) + { + out.write(buf, 0, len); + } + + in.close(); + out.close(); + + if (!from.delete()) + throw new OperationException("Cannot delete from file: " + from.getAbsolutePath()); + } + catch(IOException ex) + { + throw new OperationException("Could not move file, from: " + from.getAbsolutePath() + " and to: " + to.getAbsolutePath()); + } + } + + +} diff --git a/posterita/posterita/src/main/org/posterita/core/FilePropertiesManager.java b/posterita/posterita/src/main/org/posterita/core/FilePropertiesManager.java new file mode 100644 index 0000000000..3f7e6d9090 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/core/FilePropertiesManager.java @@ -0,0 +1,125 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +package org.posterita.core; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.MissingResourceException; +import java.util.Properties; +import java.util.ResourceBundle; + +import org.posterita.beans.MessageBean; +import org.posterita.exceptions.OperationException; +import org.posterita.factory.WebProperties; +import org.posterita.lib.PropertiesConstant; +import org.posterita.util.PathInfo; + + +public abstract class FilePropertiesManager implements WebProperties +{ + protected static final String propertiesFileDirectory = "/WEB-INF/src/"; + protected ResourceBundle bundle; + + protected abstract String getFileName(); + + public synchronized void put(Properties ctx, String key, String value) throws OperationException + { + Object obj = new MessageBean(); + + ClassLoader loader = obj.getClass().getClassLoader(); + + InputStream stream = loader.getResourceAsStream("posterita.properties"); + + Properties prop2 = new Properties(); + try + { + prop2.load(stream); + } + catch (IOException e) + { + throw new OperationException(e.getMessage()); + } + + String absoluteFilePath = prop2.getProperty(PropertiesConstant.UDI_HOME) + propertiesFileDirectory + getFileName() + ".properties"; + + File file = new File(absoluteFilePath); + + InputStream is = null; + OutputStream os = null; + Properties prop = new Properties(); + try + { + is = new FileInputStream(file); + prop.load(is); + prop.put(key,value); + os = new FileOutputStream(file); + prop.store(os,getFileName()); + os.flush(); + os.close(); + } + catch(IOException ioException) + { + throw new OperationException(ioException.getMessage()); + } + finally + { + try + { + if( is != null) + { + is.close(); + } + if( os != null) + { + os.close(); + } + } + catch(Exception ex) + {} + } + + bundle = ResourceBundle.getBundle(getFileName()); + } + + public synchronized String get(Properties ctx, String key) + { + if (bundle == null) + bundle = ResourceBundle.getBundle(getFileName()); + + String value; + if(key.equals(PropertiesConstant.UDI_HOME)) + return PathInfo.PROJECT_HOME; + try + { + value = (String) bundle.getString(key); + } + catch (MissingResourceException e) + { + return null; + } + + return value; + } + +} diff --git a/posterita/posterita/src/main/org/posterita/core/I18nAdapter.java b/posterita/posterita/src/main/org/posterita/core/I18nAdapter.java new file mode 100644 index 0000000000..caa92c191c --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/core/I18nAdapter.java @@ -0,0 +1,77 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2008 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package org.posterita.core; + +import java.util.Locale; +import java.util.Properties; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpSession; +import javax.servlet.jsp.PageContext; +import javax.servlet.jsp.tagext.Tag; + +import org.apache.struts.Globals; +import org.displaytag.localization.I18nResourceProvider; +import org.displaytag.localization.LocaleResolver; +import org.posterita.core.bean.ElementBean; +import org.posterita.core.businesslogic.ElementManager; + +public class I18nAdapter implements I18nResourceProvider, LocaleResolver +{ + + public String getResource(String resourceKey, String defaultValue, + Tag tag, PageContext pageContext) + { + Properties ctx = TmkJSPEnv.getCtx((HttpServletRequest)pageContext.getRequest()); + + String key = resourceKey; + + if (key == null) + { + key = defaultValue; + } + + ElementBean msgBean = ElementManager.getMsg(ctx, key); + return msgBean.getName(); + } + + /** + * @see LocaleResolver#resolveLocale(HttpServletRequest) + */ + public Locale resolveLocale(HttpServletRequest request) + { + Locale userLocale = null; + HttpSession session = request.getSession(false); + + if (session != null) + { + userLocale = (Locale) session.getAttribute(Globals.LOCALE_KEY); + } + + if (userLocale == null) + { + userLocale = request.getLocale(); + } + + return userLocale; + } + +} diff --git a/posterita/posterita/src/main/org/posterita/core/ImageServer.java b/posterita/posterita/src/main/org/posterita/core/ImageServer.java new file mode 100644 index 0000000000..cffb111628 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/core/ImageServer.java @@ -0,0 +1,129 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Mar 14, 2006 by praveen + * + */ +package org.posterita.core; + +import java.io.BufferedInputStream; +import java.io.BufferedOutputStream; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.Properties; + +import javax.servlet.http.HttpServletResponse; + +import org.compiere.model.MAttachment; +import org.compiere.model.MAttachmentEntry; + +import org.posterita.exceptions.OperationException; +import org.posterita.util.PathInfo; + +public class ImageServer +{ + public static final String DEFAULT_IMAGE_PATH = PathInfo.PROJECT_HOME + "/images/webstore/noimage.jpg"; + + public static boolean sendImage(Properties ctx, int attachment_id, String size, HttpServletResponse response) throws OperationException + { + MAttachment attachment = new MAttachment(ctx,attachment_id,null); + + if(attachment == null) + { + return false; + } + + MAttachmentEntry[] entries = attachment.getEntries(); + MAttachmentEntry entry = null; + + try + { + for(int i=0; i appList = ApplicationManager.getAvailableApplications(); + servlet.getServletContext().setAttribute(Constants.WEB_APPLICATIONS, appList); + } + + + /** + * Clears all the dynamically generated reports + * @param servlet + */ + private void clearReportsDirectory(HttpServlet servlet) + { + /* + ServletContext context = servlet.getServletContext(); + String reportDirectoryPath = context.getRealPath(context.getInitParameter("REPORT_DIRECTORY")); + File reportDirectory = new File(reportDirectoryPath); + + if(reportDirectory.exists()) + { + System.out.println("Cleaning old reports --> "+ reportDirectoryPath); + + File[] files = reportDirectory.listFiles(); + for (File file : files) + { + if(file.isFile()) + file.delete(); + } + + System.out.println("Cleaning process completed successfully."); + } + else + { + System.out.println("Creating report directory."); + if(reportDirectory.mkdirs()) + { + System.out.println("Report directory created successfully."); + } + else + { + System.err.println("Unable to create report directory!"); + } + } + */ + + } + + public void destroy() + { + } + + + + +} diff --git a/posterita/posterita/src/main/org/posterita/core/Interpreter.java b/posterita/posterita/src/main/org/posterita/core/Interpreter.java new file mode 100644 index 0000000000..adfa85ad7e --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/core/Interpreter.java @@ -0,0 +1,64 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 29-Jul-2005 by alok + * + */ +package org.posterita.core; + +import java.util.ArrayList; + + +public class Interpreter +{ + public static ArrayList interprete(String initValues, String Delimiter) + { + + int index1; + int index2; + String firstValue; + String finalVal; + ArrayList list = new ArrayList(); + + + initValues = initValues.replaceAll("\"", ""); + for( int i=0;i< initValues.length();i++) + { + index1 = initValues.indexOf(Delimiter); + + firstValue = initValues.substring(index1+1); + + index2 = firstValue.indexOf(Delimiter); + if (index2 >=0) + { + finalVal = initValues.substring(index1+1,index1+index2+1); + initValues=initValues.substring(index1+index2); + list.add(finalVal); + } + + else + { + finalVal = initValues.substring(index1+1); + list.add(finalVal); + break; + } + } + return list; + } + +} diff --git a/posterita/posterita/src/main/org/posterita/core/JulianDate.java b/posterita/posterita/src/main/org/posterita/core/JulianDate.java new file mode 100644 index 0000000000..02771fc443 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/core/JulianDate.java @@ -0,0 +1,696 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 29-Jul-2005 by alok + * + */ + +package org.posterita.core; + +import java.sql.Timestamp; +import java.text.*; +import java.util.*; + + + +/** + * A light weight date class stored in julian format. + */ +public class JulianDate implements Comparable +{ + /** + * The end of time. + */ + public static final JulianDate MAX_VALUE = new JulianDate(Integer.MAX_VALUE); + + /** + * Beginning of AD + */ + public static final int INT_REAL_MIN_VALUE = 1721424; + public static final JulianDate MIN_VALUE = new JulianDate(0); + + /** + * Calculator used to convert java.util.Dates. + */ + protected static final GregorianCalendar gc = new GregorianCalendar(); + + /** + * Julian date, defaults to January 1'st, 1970 + */ + protected int julian = 2440588; + + /** + * No argument constructor. + */ + public JulianDate() {} + + /** + * Constructs a date according to the specified year, month, and day. + *

    + * Entering an illegal value (e.g., a 14 for a month, or 31 for the number + * of days in February) results in a date of unpredictable value. + * + * @param year The year expressed as a 4-digit number. For example, 2002 + * @param month The month expressed as an integer between 1 and 12 + * @param day The day of the month, expressed as a number between 1 up to 31 + * + */ + public JulianDate(int year, int month, int day) + { + YMD ymd = new YMD(year, month, day); + + julian = ymd.julian(); + } + + + /** + * Constructs a julian date from a julian date value. + */ + public JulianDate(int julian) + { + this.julian = julian; + } + + /** + * Constructs a julian date from another julian date. + */ + public JulianDate(JulianDate d) + { + julian = d.julian; + } + + /** + * Constructs a julian date from a java date. + */ + public JulianDate(Date date) + { + julian = toJulian(date); + } + + /** + * Compares the current object and the passed-in object for equality. + * + * @param obj the object to compare with the current object. + * @return true if the two objects are equal, false otherwise. + */ + public boolean equals(Object obj) + { + try + { + JulianDate d = (JulianDate)obj; + + return (julian == d.julian); + } + catch (Exception ignore) {} + + return false; + } + + /** + * Returns the hash code of this object. + * + * @return the hash code of this object. + */ + public int hashCode() + { + return julian; + } + + /** + * + * Checks if the specified date is eual to this date. + * + * @return true if the specified object equals this object, + * otherwise returns false. + */ + public boolean equals(JulianDate d) + { + return (julian == d.julian); + } + + /** + * Returns the int difference between two julian dates. + * + * @param d the julian date whose value will be subtracted from this date. + * + * @return the difference betwween the julian value of this date and the + * julian value of the specified date. + */ + public int difference(JulianDate d) + { + return (julian - d.julian); + } + + /** + * Returns the julian value of this date. + * + * @return the julian value of this date. + */ + public int getJulian() + { + return julian; + } + + public Integer getJulianInt() + { + return Integer.valueOf(julian); + } + + /** + * Method used to create a timestamp. must have nonjulian time. + * + * @return the mseconds that are in the date(non Julian). + */ + public long getStandardTime() + { + return getJavaDate().getTime(); + } + + /** + * Returns a Long that is the last MSecond Of the Date Object. + * + * @return the last MSecond Of the Date Object. + */ + public long getLastMSDate() + { + JulianDate startOfDayTime = new JulianDate(this.getYear(), this.getMonth(), this.getDay()); + return (startOfDayTime.getStandardTime() + (24 * 60 * 60 * 1000 - 1)); + } + + /** + * Returns the day of the present year in which this date falls. + *

    + * The 1'st of January is day 0. + * + * @return the day of the present year in which this date falls. + */ + public int getDay() + { + YMD ymd = new YMD(julian); + + return ymd.day; + } + + /** + * Returns the month of the present year in which this date falls. + *

    + * January is month 0. + * + * @return the month of the present year in which this date falls. + */ + public int getMonth() + { + YMD ymd = new YMD(julian); + + return ymd.month; + } + + /** + * Returns the year in which this date falls. + * + * @return the year in which this date falls. + */ + public int getYear() + { + YMD ymd = new YMD(julian); + + return ymd.year; + } + + /** + * Checks if this date is on or before the input date. + * + * @return true if this date is on or before the input date, + * false otherwise. + */ + public boolean isOnOrBefore(JulianDate d) + { + return (julian < d.julian || julian == d.julian); + } + + + /** + * Checks if this date is on or after the input date. + * + * @return true if this date is on or after the input date, + * false otherwise. + */ + public boolean isOnOrAfter(JulianDate d) + { + return (julian > d.julian || julian == d.julian); + } + + /** + * Checks if this date is before the input date. + * + * @return true if this date is before the input date, + * false otherwise. + */ + public boolean isBefore(JulianDate d) + { + return (julian < d.julian); + } + + /** + * Checks if this date is after the input date. + * + * @return true if this date is before the input date, + * false otherwise. + */ + public boolean isAfter(JulianDate d) + { + return (julian > d.julian); + } + + /** + * Shifts the adjusted version by the offset, interpreted + * as a number of calendar dates, and sets the unadjusted version to be + * equal to the adjusted version. + * For example, if initially the unadjusted date is December 25, and the + * adjusted date is December 26, then shifting by an shift of 2 + * would cause the adjusted and unadjusted version to be December 28. + * + * @return the shifted date. + */ + public JulianDate shift(int shift) + { + JulianDate date = new JulianDate(this); + + date.julian += shift; + + return date; + } + + /** + * Returns a java.util.Date representation of the adjusted + * version of this. + * + * return a java.util.Date representation of the adjusted + * version of this. + */ + public java.util.Date getJavaDate() + { + return fromJulian(julian); + } + + /** + * Returns a java.sql.Date representation of the unadjusted + * version of this. + * + * @return a java.sql.Date representation of the unadjusted + * version of this. + */ + public java.sql.Date getSqlDate() + { + return new java.sql.Date(getJavaDate().getTime()); + } + + /** + * Returns a java.sql.Date representation of the adjusted + * version of this. + * + * @return a java.sql.Date representation of the adjusted + * version of this. + */ + public java.sql.Date getAdjSqlDate() + { + return new java.sql.Date(getJavaDate().getTime()); + } + + /** + * Add the given number of period units to this date. + */ + public JulianDate add(int units, int amount) + { + JulianDate date = null; + + synchronized (gc) + { + gc.setTime(getJavaDate()); + gc.add(units, amount); + + date = new JulianDate(gc.getTime()); + } + + return date; + } + + /** + * Convert a Java Date to it's Julian equivalent. + * + * @param the specified java date + * @return the corresponding julian value. + */ + protected int toJulian(java.util.Date date) + { + YMD ymd = null; + + synchronized (gc) + { + gc.setTime(date); + + ymd = new YMD(gc.get(GregorianCalendar.YEAR), gc.get(GregorianCalendar.MONTH) + 1, // GC month starts at 0 + gc.get(GregorianCalendar.DAY_OF_MONTH)); + } + + return ymd.julian(); + } + + /** + * Convert a Julian to it's Java Date equivalent. + * + * @param the specified julian value. + * @return the corresponding java date. + */ + protected java.util.Date fromJulian(int julian) + { + YMD ymd = new YMD(julian); + GregorianCalendar cal = new GregorianCalendar(ymd.year, ymd.month - 1, ymd.day); + + return cal.getTime(); + } + + /** + * Returns the day of the week of this date. + * + * @return the day of the week of this date. + */ + public int toDayOfWeek() + { + return new YMD(julian).toDayOfWeek(this); + } + + /** + * Returns a string representation of this object. + * + * @return a string representation of this object. + */ + public String toString() + { + DateFormat shortDF = DateFormat.getDateInstance(DateFormat.SHORT); + + return shortDF.format(fromJulian(julian)); + } + + /** + * Convert between Greogorian dates and Julian dates. + *

    + * Algorithm adapted from Press et al., Numerical Recipes in C, 2nd ed., + * Cambridge University Press 1992 + */ + protected class YMD + { + + /** + * Gregorian day of month (1-31). + */ + int day = 0; + + /** + * Gregorian month of year (1-12). + */ + int month = 0; + + /** + * Gregorian year. + */ + int year = 0; + + YMD(int year, int month, int day) + { + this.year = year; + this.month = month; + this.day = day; + } + + YMD(int julian) + { + if (julian < 0) + { + julian = 0; + + } + + int a = julian; + + if (julian >= 2299161) + { + int jadj = (int)(((float)(julian - 1867216) - 0.25) / 36524.25); + + a += 1 + jadj - (int)(0.25 * jadj); + } + + int b = a + 1524; + int c = (int)(6680.0 + ((float)(b - 2439870) - 122.1) / 365.25); + int d = (int)(365 * c + (0.25 * c)); + int e = (int)((b - d) / 30.6001); + + day = b - d - (int)(30.6001 * e); + month = e - 1; + + if (month > 12) + { + month -= 12; + + } + + year = c - 4715; + + if (month > 2) + { + --year; + + } + + if (year <= 0) + { + --year; + } + } + + int julian() + { + int y = year; + + if (year < 0) + { + y++; + + } + + int m = month; + + if (month > 2) + { + m++; + } + else + { + y--; + m += 13; + } + + int julian = (int)(java.lang.Math.floor(365.25 * y) + java.lang.Math.floor(30.6001 * m) + day + 1720995.0); + + int yearZero = 15 + 31 * (10 + 12 * 1582); + + if (day + 31 * (month + 12 * year) >= yearZero) + { + int jadj = (int)(0.01 * y); + + julian += 2 - jadj + (int)(0.25 * jadj); + } + + return julian; + } + + public final int toDayOfWeek(JulianDate julDate) + { + + long julian = julDate.getDay(); + // If julian is negative, then julian%7 will be negative, so we adjust + // accordingly. We add 1 because Julian day 0 is Monday. + int dayOfWeek = (int)((julian + 1) % 7); + + return dayOfWeek + ((dayOfWeek < 0) ? (7 + Calendar.SUNDAY) : Calendar.SUNDAY); + } + + } + + /** + * Gets the day of week of the julian day, following the Calendar + * convention: + *

  • Calendar.SUNDAY = 1 + *
  • Calendar.MONDAY = 2 + *
  • ... + *
  • Calendar.SATURDAY = 7 + * + * @return gets the day of week of the julian day + */ + public static int getDayOfWeek(int julian) + { + // If julian is negative, then julian%DAYS_IN_WEEK will be negative, so we adjust + // accordingly. We add 1 because Julian day 0 is Monday. + int dayOfWeek = (int)((julian + 1) % DAYS_IN_WEEK); + + return dayOfWeek + ((dayOfWeek < 0) ? (DAYS_IN_WEEK + Calendar.SUNDAY) : Calendar.SUNDAY); + } + + /** + * Number of days in a week. + */ + public static final int DAYS_IN_WEEK = 7; + + /** + * Checks if a year is a leap year. + * + * @param aYear the year to check + * @eturn true if the specified year is a leap year, false otherwise. + */ + public static final boolean isLeapYear(int aYear) + { + return ((aYear % 4 == 0) && ((aYear % 100 != 0) || (aYear % 400 == 0))); + } + + /** + * Checks if the period contains the 29th of February. + * + * @param start the start date of the period + * @param end the end date of the period + * Returns true if the period contains the 29th of February, false otherwise. + */ + public static final boolean containsFebruary29AsAdj(JulianDate start, JulianDate end) + { + int startYear = start.getYear(); + int endYear = end.getYear(); + + if (isLeapYear(startYear)) + { + if (start.isOnOrBefore(new JulianDate(startYear, 2, 29))) + { + if (end.isOnOrAfter(new JulianDate(startYear, 2, 29))) + { + return true; + } + } + } + else if (isLeapYear(endYear)) + { + if (end.isOnOrAfter(new JulianDate(endYear, 2, 29))) + { + if (start.isOnOrBefore(new JulianDate(endYear, 2, 29))) + { + return true; + } + } + } + + return false; + } + + + /** + * Checks if this date is at the end of the month. + * + * Returns true if the date is on the last day of the month, false otherwise. + */ + public boolean isEndOfMonth() + { + return equals(getLastDayOfMonth()); + } + + /** + * Returns the last day of the specified month. + * + * @param aMonth the specified month + * @param aYear the specified year + * @return the last JulianDate of this month. + */ + public static final JulianDate getLastDayOfMonth(int aMonth, int aYear) + { + return getFirstDayOfNextMonth(aMonth, aYear).shift(-1); + } + + /** + * Returns the last day of the month in which this date falls. + * + * @return the last day of the month in which this date falls. + */ + public JulianDate getLastDayOfMonth() + { + return getLastDayOfMonth(this.getMonth(), this.getYear()); + } + + /** + * Returns the day following the specified month. + * + * @param aMonth the soecified month. + * @param aYear the specified year. + * @return the first JulianDate of the next month. + */ + public static final JulianDate getFirstDayOfNextMonth(int aMonth, int aYear) + { + if (aMonth == Calendar.DECEMBER + 1) // Calendar month starts at 0 + { + return new JulianDate(aYear + 1, 1, 1); + } + else + { + return new JulianDate(aYear, aMonth + 1, 1); + } + } + + /** + * Get today as a JulianDate. + * + * @return today as a JulianDate.. + */ + public static final JulianDate getToday() + { + Calendar rightNow = Calendar.getInstance(); + + // Calendar.MONTH starts at 0!! + return new JulianDate(rightNow.get(Calendar.YEAR), + rightNow.get(Calendar.MONTH) + 1, + rightNow.get(Calendar.DAY_OF_MONTH)); + } + + public int compareTo(Object o) + { + JulianDate date = (JulianDate) o; + return this.difference(date); + + } + + + public static Timestamp getTodayDateOnly() + { + Calendar cal = Calendar.getInstance(); + + cal.set(Calendar.HOUR_OF_DAY,0); + cal.set(Calendar.MINUTE,0); + cal.set(Calendar.SECOND,0); + cal.set(Calendar.MILLISECOND,0); + + Timestamp today = new Timestamp(cal.getTimeInMillis()); + + return today; + } + + +} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/core/KeyNamePairUtil.java b/posterita/posterita/src/main/org/posterita/core/KeyNamePairUtil.java new file mode 100644 index 0000000000..a258159eca --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/core/KeyNamePairUtil.java @@ -0,0 +1,97 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +package org.posterita.core; + +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.Properties; + +import org.compiere.util.DB; +import org.compiere.util.KeyNamePair; + +public class KeyNamePairUtil +{ + public static ArrayList getData(Properties ctx, String tableName, String whereClause) throws SQLException + { + return getData(ctx, tableName, whereClause, null); + } + + public static ArrayList getData(Properties ctx, String tableName, String whereClause, String trxName) throws SQLException + { + + // StringBuffer where = new StringBuffer(); + //StringBuffer from = new StringBuffer(); + + String keyColumn = tableName + "_ID"; + String sql; + + sql = "select name, " + + keyColumn + + " from " + + tableName; + + if (whereClause!=null) + sql = sql + " where " + whereClause+(" order by 1"); + + PreparedStatement pstmt = null; + + pstmt = DB.prepareStatement(sql, trxName); + ResultSet rs; + ArrayList data = new ArrayList(); + KeyNamePair pair; + int key; + String name; + + + try + { + rs = pstmt.executeQuery(); + + while (rs.next()) + { + name = rs.getString(1); + key = rs.getInt(2); + pair = new KeyNamePair(key, name); + data.add(pair); + } + + rs.close(); + } + catch (SQLException e) + { + throw e; + } + finally + { + try + { + pstmt.close(); + } + catch (Exception e) + {} + + pstmt = null; + } + + return data; + } +} diff --git a/posterita/posterita/src/main/org/posterita/core/MenuItem.java b/posterita/posterita/src/main/org/posterita/core/MenuItem.java new file mode 100644 index 0000000000..663d7fcf04 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/core/MenuItem.java @@ -0,0 +1,750 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Jul 25, 2005 by vishee + */ + +package org.posterita.core; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.Properties; + +import org.compiere.model.X_U_WebMenu; +import org.posterita.factory.AbstractFactory; +import org.posterita.model.MWebMenu; + +public class MenuItem +{ + + protected String menuLink; + protected MWebMenu menu; + protected ArrayList children; + protected int menuId; + protected boolean available; + + //dangerous constructor since nothing else is initialised. + private MenuItem(int menuId) + { + this.menuId = menuId; + } + + public MenuItem(MWebMenu menu) + { + this.menu = menu; + children = new ArrayList(); + menuLink = menu.getMenuLink(); + menuId = menu.get_ID(); + } + + public ArrayList getSubMenus() + { + return children; + } + + public Iterator getSubMenusIterator() + { + return children.iterator(); + } + + public void addSubMenu(MenuItem subMenu) + { + children.add(subMenu); + } + + public boolean hasSubMenu() + { + return (!children.isEmpty()); + } + + public boolean getHasSubMenu() + { + return (!children.isEmpty()); + } + + public boolean isActive() + { + return menu.isActive(); + } + + public String getImageLink() + { + return menu.getImageLink(); + } + + public String getMenuLink() + { + return menuLink; + } + + public int getMenuId() + { + return menuId; + } + + public String getModule() + { + return menu.getModule(); + } + + public int getParentMenuId() + { + return menu.getParentMenu_ID(); + } + + public String getPosition() + { + return menu.getPosition(); + } + + public void setMenuLink(String link) + { + menuLink = link; + } + + public String getDescription() + { + return menu.getDescription(); + } + + public boolean AmIaParent(int menuId) + { + ArrayList list = getAllChildren(); + MenuItem item = new MenuItem(menuId); + return list.contains(item); + } + + public ArrayList getBreadCrumb(int menuId) + { + ArrayList list = new ArrayList(); + + if (children.size() == 0) + return list; + + Iterator iter = children.iterator(); + + MenuItem me = new MenuItem(menuId); + + while (iter.hasNext()) + { + MenuItem item = (MenuItem) iter.next(); + + if (item.AmIaParent(menuId) || item.equals(me)) + { + list.add(item); + list.addAll(item.getBreadCrumb(menuId)); + } + + } + + return list; + } + + public String convert(int menuId) + { + ArrayList breadCrumb = getBreadCrumb(menuId); + Iterator iter = breadCrumb.iterator(); + + String bread = "\"\"  "; + while(iter.hasNext()) + { + MenuItem item = (MenuItem) iter.next(); + bread = bread + item.getName(); + } + + return bread; + } + + public ArrayList getAllChildren() + { + ArrayList list = new ArrayList(); + + if (children.size() == 0) + return list; + + Iterator iter = children.iterator(); + + while (iter.hasNext()) + { + MenuItem item = (MenuItem) iter.next(); + + ArrayList temp = item.getAllChildren(); + list.add(item); + list.addAll(temp); + } + + return list; + } + + + + + public static MenuItem getDummyMenuItem(Properties ctx) + { + MWebMenu menu = new MWebMenu(ctx, 0, null); + menu.setName("Dummy Root Menu"); + menu.setIsActive(false); + + MenuItem retMenu = new MenuItem(menu); + + return retMenu; + } + + + + public ArrayList getTopMenus() + { + return getMenus(AbstractFactory.MENU_POSITION_TOP); + } + + public ArrayList getLeftMenus() + { + return getMenus(AbstractFactory.MENU_POSITION_LEFT); + + } + + private ArrayList getMenus(String position) + { + ArrayList menuList = new ArrayList(); + + ArrayList menus = children; + + Iterator parentIter = menus.iterator(); + + while(parentIter.hasNext()) + { + MenuItem menuItem = (MenuItem)parentIter.next(); + if(menuItem.getPosition().compareTo(position) == 0) + { + menuList.add(menuItem); + } + } + + return menuList; + } + + // not good. + public ArrayList getSubMenus(int parentId) + { + ArrayList subMenus = new ArrayList(); + + Iterator pIter = children.iterator(); + MenuItem mItem; + + while(pIter.hasNext()) + { + mItem = (MenuItem)pIter.next(); + + if(mItem.getMenuId() == parentId) + { + subMenus = mItem.children; + + return subMenus; + } + } + + return subMenus; + } + + public boolean equals(Object obj) + { + MenuItem item = (MenuItem) obj; + + if ( obj == null) + return false; + + if (this.getMenuId() == item.getMenuId()) + return true; + else + return false; + } + + public boolean isAvailable() + { + return available; + } + + public void setAvailable(boolean available) + { + this.available = available; + } + + + public void setCategory(String category) + { + menu.setCategory(category); + } + + +/* public String getBreadCrumbMenu(Properties ctx, Integer menuId) + { + + if (menuId.intValue() != 0) + { + X_U_WebMenu menu = new X_U_WebMenu(ctx, menuId.intValue(), null); + + breadcrumb = breadcrumb + "" + menu.getName() + ""; + + if (menu.getParentMenu_ID() == 0) + return breadcrumb; + + getBreadCrumbMenu(ctx, Integer.valueOf(menu.getParentMenu_ID())); + } + + return breadcrumb; + } +*/ +/* public static String printTopMenu(MenuItem menuItem) + { + Iterator parentIter = menuItem.getSubMenusIterator(); + String htmlCode = ""; + htmlCode += ""; + MenuItem pItem; + + while(parentIter.hasNext()) + { + pItem = (MenuItem)parentIter.next(); + if(pItem.getPosition() == MenuFactory.MENU_POSITION_TOP) + { + + } + } + + htmlCode += "
    "; + }*/ + +/* private Properties ctx; + private Integer menuId; + private Integer parentMenuId; + private String name; + private String link; + private MenuItem[] children; + private String imageLink; + + private static final String BREAD_CRUMB_DELIMITER = ">"; + + public MenuItem(Properties ctx, Integer menuId) + { + this.ctx = ctx; + this.menuId = menuId; + } + + public String print() throws SystemException + { + MenuItem[] items = getChildren(); + + table table = new table(); + + for (int i = 0; i < items.length; i++) + { + MenuItem item = items[i]; + + tr tr = new tr(); + td td = new td(); + + img img = new img("images/link_icon.gif"); + img.addAttribute("width","15"); + img.addAttribute("height","15"); + img.addAttribute("border","0"); + img.addAttribute("align","absmiddle"); + img.addAttribute("vspace","5"); + + a a; + + //this is a leaf node + if (MenuManager.getChildren(ctx, item.getMenuId()).length == 0) + a = new a(item.getLink()); + else + a = new a(item.getLink() + item.getMenuId()); + + a.setClass("left"); + a.addElement(img); + + img.setTagText("" + item.getName()); + + a.addElement(img); + a.setPrettyPrint(true); + + td.addElement(a); + tr.addElement(td); + + table.addElement(tr); + } + + return table.toString(); + } + + public String getBreadCrumb(Integer menuId) throws SystemException, OperationException + { + MenuItem item = MenuManager.getParent(ctx, menuId); + MenuItem childMenuItm = getMenuItem(menuId); + + if (item == null) + return createBreadCrumb(childMenuItm); + + String breadCrumb = new String(""); + do + { + breadCrumb = createBreadCrumb(item) + BREAD_CRUMB_DELIMITER + breadCrumb; + item = MenuManager.getParent(ctx, item.getMenuId()); + } + while(item!=null); + + return breadCrumb; + + } + + private static String createBreadCrumb(MenuItem item) + { + a a = new a(item.getLink() + item.getMenuId()); + a.setTagText(item.getName()); + return a.toString(); + } + + public MenuItem[] getMenuJSP() throws SystemException + { + this.menuId = null; // make sure to retrieve first level menu + return getChildren(); + } + + public MenuItem[] MenuItems(Integer menuId) throws SystemException + { + return MenuManager.getChildren(ctx, menuId); + } + + private MenuItem getMenuItem(Integer menuItemId) + { + X_U_Menu menu = new X_U_Menu(ctx, menuItemId.intValue(), null); + MenuItem menuItem = new MenuItem(ctx, menuItemId); + menuItem.setLink(menu.getMenuLink()); + menuItem.setName(menu.getName()); + menuItem.setParentMenuId(Integer.valueOf(menu.getParentMenu_ID())); + return menuItem; + } + + + protected MenuItem[] getChildren() throws SystemException + { + if (children != null) + return children; + + MenuItem[] item = MenuManager.getChildren(ctx, menuId); + + children = item; + + return children; + } + + + public Integer getMenuId() + { + return menuId; + } + + public void setMenuId(Integer menuId) + { + this.menuId = menuId; + } + + public String getLink() + { + return link; + } + + public void setLink(String link) + { + this.link = link; + } + + public String getName() + { + return name; + } + + public void setName(String name) + { + this.name = name; + } + + + public Integer getParentMenuId() + { + return parentMenuId; + } + + public void setParentMenuId(Integer parentMenuId) + { + this.parentMenuId = parentMenuId; + } + + + //Generating menurole + + public static String getMenu(Properties ctx,Integer menuId) throws SystemException, OperationException + { + + String tab = "    "; + + StringBuffer menuStr = new StringBuffer(""); + + StringBuffer whereClause = new StringBuffer("ad_client_id=" + Env.getAD_Client_ID(ctx) + " and ad_org_id="+ Env.getAD_Org_ID(ctx)); + + // Modification brought due to Organisation type + String orgType = OrganisationManager.getOrganisationType(ctx); + + if(orgType == UdiConstants.ORG_TYPE_WHOLESALER) + whereClause.append(" and IsWholesaler='Y'"); + else if(orgType == UdiConstants.ORG_TYPE_RETAILER) + whereClause.append(" and IsRetailer='Y'"); + + // end modification + + MenuItem menuItem; + + if(menuId == null) + { + whereClause.append(" and parentmenu_id is null"); + } + else + { + whereClause.append(" and parentmenu_id =" + menuId); + + X_U_Menu menu = new X_U_Menu(ctx,menuId.intValue(), null); + + + if((MenuManager.getChildren(ctx,menuId).length == 0) && + (MenuManager.getParent(ctx,menuId) != null)) + { + menuStr.append(""); + menuStr.append(tab + menu.getName()); + menuStr.append(""); + menuStr.append(""); + menuStr.append(""); + } + else + { + menuStr.append(""); + menuStr.append(tab + menu.getName()); + menuStr.append(""); + menuStr.append(" "); + menuStr.append(""); + } + } + + //getting the child menus + int[] childId = X_U_Menu.getAllIDs(X_U_Menu.Table_Name,whereClause.toString(),null); + tab = tab + tab; + + for(int i=0; i 0) + { + img = new img(imageLink); + img.addAttribute("width","48"); + img.addAttribute("height","48"); + img.addAttribute("border","0"); + img.addAttribute("align","absmiddle"); + img.addAttribute("vspace","5"); + img.setTagText("" + item.getName()); + a.addElement(img); + } + else + { + a.setTagText(item.getName()); + } + + a.setPrettyPrint(true); + + td.addElement(a); + td.setHeight(48); + tr.addElement(td); + } + table.setCellPadding(10); + table.setBorder(2); + table.setBorderColor("#CC0000"); + table.setClass("header"); + table.addElement(tr); + return table.toString(); + } + + public String getImageLink() + { + return imageLink; + } + + public void setImageLink(String imageLink) + { + this.imageLink = imageLink; + } +*/ + public String getCategory() + { + //return ElementManager.getMsg(menu.getCtx(),menu.getCategory()).getName(); + return menu.getCategory(); + } + + public String getName() + { + //return ElementManager.getMsg(menu.getCtx(),menu.getName()).getName(); + return menu.getName(); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/core/NameValuePair.java b/posterita/posterita/src/main/org/posterita/core/NameValuePair.java new file mode 100644 index 0000000000..0b100c6bb7 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/core/NameValuePair.java @@ -0,0 +1,88 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +package org.posterita.core; + +import org.compiere.util.NamePair; + + +public class NameValuePair extends NamePair +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + /** + * Constructor KeyValue Pair - + * @param key Key (-1 is considered as null) + * @param name string representation + */ + public NameValuePair(String name, String value) + { + super(name); + this.value = value; + this.name = name; + } // KeyNamePair + + + private String value; + private String name; + + public String getValue() + { + return value; + } + + + public boolean equals(Object obj) + { + if (obj instanceof NameValuePair) + { + NameValuePair pair = (NameValuePair) obj; + if (pair.getName() != null) + if (pair.getName().equals(name) && pair.getValue().equals(value)) + return true; + + } + return false; + } // equals + + + + public String getID() + { + return name; + } + + public String getName() + { + return name; + } + + public void setName(String name) + { + this.name = name; + } + + public void setValue(String value) + { + this.value = value; + } +} diff --git a/posterita/posterita/src/main/org/posterita/core/PDFReportGenerator.java b/posterita/posterita/src/main/org/posterita/core/PDFReportGenerator.java new file mode 100644 index 0000000000..96ef612e2f --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/core/PDFReportGenerator.java @@ -0,0 +1,181 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Mar 1, 2006 by praveen + * + */ +package org.posterita.core; + +import java.awt.Color; +import java.io.FileOutputStream; +import java.util.ArrayList; +import java.util.Properties; + +import org.posterita.exceptions.OperationException; +import org.posterita.lib.PropertiesConstant; +import com.lowagie.text.Chunk; +import com.lowagie.text.Document; +import com.lowagie.text.Element; +import com.lowagie.text.Font; +import com.lowagie.text.FontFactory; +import com.lowagie.text.Image; +import com.lowagie.text.PageSize; +import com.lowagie.text.Paragraph; +import com.lowagie.text.Rectangle; +import com.lowagie.text.pdf.BaseFont; +import com.lowagie.text.pdf.PdfTemplate; +import com.lowagie.text.pdf.PdfWriter; + +public abstract class PDFReportGenerator +{ + protected float CELLPADDING = 4; + protected float MARGIN = 30f; + + //setting default fonts + protected Font TITLE_FONT = FontFactory.getFont(FontFactory.HELVETICA,18,Font.BOLD,new Color(255,0,0)); + protected Font SUBTITLE_FONT = FontFactory.getFont(FontFactory.HELVETICA,15,Font.BOLD,new Color(255,0,0)); + protected Font HEADER_FONT = FontFactory.getFont(FontFactory.HELVETICA,10,Font.BOLD); + protected Font DATA_FONT = FontFactory.getFont(FontFactory.HELVETICA,10); + + //setting default pagesize + protected Rectangle PAGE_SIZE = PageSize.A4.rotate(); + + protected Image getTextAsImage(String text) throws OperationException + { + try + { + PdfTemplate template = writer.getDirectContent().createTemplate(20, 20); + //BaseFont bf = BaseFont.createFont("Helvetica", "winansi", false); + BaseFont bf = HEADER_FONT.getBaseFont(); + float size = 10; + float width = bf.getWidthPoint(text, size); + template.beginText(); + //template.setRGBColorFillF(1, 1, 1); + template.setFontAndSize(bf, size); + template.setTextMatrix(0, 2); + template.showText(text); + template.endText(); + template.setWidth(width); + template.setHeight(size + 2); + // make an Image object from the template + Image img = Image.getInstance(template); + img.setAlignment(Image.RIGHT | Image.TEXTWRAP); + + return img; + + } + catch (Exception e) + { + throw new OperationException(e); + } + } + + + public String getPDFReport(Properties ctx,ArrayList dataSource) throws OperationException + { + String filename = RandomStringGenerator.randomstring() + ".pdf"; + String dir = UDIFilePropertiesManager.getProperty().get(ctx, PropertiesConstant.UDI_HOME) + "/config/reports/pdf/"; + String filepath = dir + filename; + + //Generatting report + + //Initialising the datasource + this.dataSource = dataSource; + + if(dataSource == null) + throw new OperationException("Cannot generate report! Cause: empty datasource"); + + Rectangle dimension = getDocumentDimension(); + Document document = new Document(dimension,MARGIN,MARGIN,MARGIN,MARGIN); + + try + { + writer = PdfWriter.getInstance(document, new FileOutputStream(filepath)); + writer.setPageEvent(new PDFReportPageEventHelper()); + + document.open(); + + //Add the title part + Paragraph title = new Paragraph(); + Paragraph subTitle = new Paragraph(); + + + if(reportTitle != null) + { + title.add(new Chunk(reportTitle,TITLE_FONT)); + title.setAlignment(Element.ALIGN_CENTER); + document.add(title); + } + + if(reportSubTitle != null) + { + subTitle.add(new Chunk(reportSubTitle,SUBTITLE_FONT)); + subTitle.setAlignment(Element.ALIGN_CENTER); + document.add(subTitle); + } + + if((reportSubTitle != null)||(reportTitle != null)) + { + document.add(new Paragraph(" ")); + } + + writeDocument(document); + + document.close(); + writer.close(); + + + return "config/report/pdf/" + filename; + } + catch (Exception e) + { + throw new OperationException(e); + } + + } + + public String getReportSubTitle() + { + return reportSubTitle; + } + + public void setReportSubTitle(String reportSubTitle) + { + this.reportSubTitle = reportSubTitle; + } + + public String getReportTitle() + { + return reportTitle; + } + + public void setReportTitle(String reportTitle) + { + this.reportTitle = reportTitle; + } + + + protected abstract void writeDocument(Document document) throws OperationException; + protected abstract Rectangle getDocumentDimension(); + + protected ArrayList dataSource = null; + protected PdfWriter writer = null; + private String reportTitle = null; + private String reportSubTitle = null; + +} diff --git a/posterita/posterita/src/main/org/posterita/core/PDFReportPageEventHelper.java b/posterita/posterita/src/main/org/posterita/core/PDFReportPageEventHelper.java new file mode 100644 index 0000000000..e862c7db05 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/core/PDFReportPageEventHelper.java @@ -0,0 +1,107 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Mar 1, 2006 by praveen + * + */ +package org.posterita.core; + +import java.text.SimpleDateFormat; +import java.util.Calendar; + +import com.lowagie.text.Document; +import com.lowagie.text.Font; +import com.lowagie.text.FontFactory; +import com.lowagie.text.Rectangle; +import com.lowagie.text.pdf.PdfContentByte; +import com.lowagie.text.pdf.PdfPTable; +import com.lowagie.text.pdf.PdfPageEventHelper; +import com.lowagie.text.pdf.PdfTemplate; +import com.lowagie.text.pdf.PdfWriter; + +/** + * This class extends the page event handler that displays the + * header and footer. + */ +public class PDFReportPageEventHelper extends PdfPageEventHelper +{ + protected PdfPTable table; + protected PdfTemplate tpl; + protected String dateAndTime; + + protected static final Font PAGE_FOOTER_FONT = FontFactory.getFont(FontFactory.HELVETICA,10,Font.BOLD); + protected static final float MARGIN = 30f; + + public void onOpenDocument(PdfWriter writer, Document document) + { + SimpleDateFormat sdf = new SimpleDateFormat(TimestampConvertor.DEFAULT_DATE_PATTERN1); + dateAndTime = sdf.format(Calendar.getInstance().getTime()); + + table = new PdfPTable(2); + tpl = writer.getDirectContent().createTemplate(100, 100); + tpl.setBoundingBox(new Rectangle(-20, -20, 100, 100)); + + } + + public void onEndPage(PdfWriter writer, Document document) + { + PdfContentByte cb = writer.getDirectContent(); + cb.saveState(); + // write the headertable + table.setTotalWidth(document.right() - document.left()); + table.writeSelectedRows(0, -1, document.left(), document.getPageSize().height() - 50, cb); + // compose the footer + String text = "Page " + writer.getPageNumber() + " of "; + float textSize = PAGE_FOOTER_FONT.getBaseFont().getWidthPoint(text, 10); + float textBase = document.bottom() - 20; + cb.beginText(); + cb.setFontAndSize(PAGE_FOOTER_FONT.getBaseFont(), 10); + + float adjust = PAGE_FOOTER_FONT.getBaseFont().getWidthPoint("0", 10); + cb.setTextMatrix(document.right() - textSize - adjust, textBase); + cb.showText(text); + cb.endText(); + cb.addTemplate(tpl, document.right() - adjust, textBase); + + cb.saveState(); + + text = "Report Generated on : " + dateAndTime; + + textSize = PAGE_FOOTER_FONT.getBaseFont().getWidthPoint(text, 10); + textBase = document.bottom() - 20; + cb.beginText(); + cb.setFontAndSize(PAGE_FOOTER_FONT.getBaseFont(), 10); + + adjust = PAGE_FOOTER_FONT.getBaseFont().getWidthPoint("0", 10); + cb.setTextMatrix(MARGIN, textBase); + cb.showText(text); + cb.endText(); + + cb.saveState(); + + } + + public void onCloseDocument(PdfWriter writer, Document document) { + tpl.beginText(); + tpl.setFontAndSize(PAGE_FOOTER_FONT.getBaseFont(), 10); + tpl.setTextMatrix(0, 0); + tpl.showText("" + (writer.getPageNumber() - 1)); + tpl.endText(); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/core/PieChart.java b/posterita/posterita/src/main/org/posterita/core/PieChart.java new file mode 100644 index 0000000000..7eae18b472 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/core/PieChart.java @@ -0,0 +1,108 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * 12-Jul-2006 17:18:07 by praveen + * + */ + +package org.posterita.core; + +import java.sql.SQLException; + +import org.compiere.util.DB; +import org.jfree.chart.ChartFactory; +import org.jfree.chart.JFreeChart; +import org.jfree.chart.title.TextTitle; +import org.jfree.data.general.DefaultPieDataset; +import org.jfree.data.jdbc.JDBCPieDataset; + +import org.posterita.exceptions.OperationException; + +public class PieChart extends AbstractChart +{ + public static final String CHART_TYPE = "PieChart"; + public static final int PIE_FLAT = 1; + public static final int PIE_3D = 2; + + private DefaultPieDataset dataset = null; + private int type = PIE_FLAT; + + public PieChart(){}; + + public PieChart(DefaultPieDataset dataset,String title) + { + this.dataset = dataset; + this.title = title; + + } + + public JFreeChart createChart() throws OperationException + { + if(dataset==null) + { + throw new OperationException("Cannot create Pie chart: cause -> dataset empty!"); + } + + + switch (type) { + case PIE_FLAT: + chart = ChartFactory.createPieChart(title,dataset,showLegend,showTooltip,true); + break; + + case PIE_3D: + chart = ChartFactory.createPieChart3D(title,dataset,showLegend,showTooltip,true); + break; + + default: + throw new OperationException("Invalid Piechart type! Can only be Piechart.PIE_FLAT or Piechart.PIE_3D"); + } + + //setting subtitle + if(subtitle!=null) + { + TextTitle title = new TextTitle(subtitle); + chart.addSubtitle(title); + } + + return chart; + + } + + public void getDataSetFromSQL(String sql) throws OperationException + { + + JDBCPieDataset jdbcDataset = new JDBCPieDataset(DB.getConnectionRO()); + + try + { + jdbcDataset.executeQuery(sql); + this.dataset = jdbcDataset; + } catch (SQLException e) { + throw new OperationException(e); + } + } + + public DefaultPieDataset getDataset() { + return dataset; + } + + public void setDataset(DefaultPieDataset dataset) { + this.dataset = dataset; + } + +} diff --git a/posterita/posterita/src/main/org/posterita/core/PieLabelGenerator.java b/posterita/posterita/src/main/org/posterita/core/PieLabelGenerator.java new file mode 100644 index 0000000000..d4d6d19e83 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/core/PieLabelGenerator.java @@ -0,0 +1,49 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * 29-Aug-2006 13:54:31 by praveen + * + */ + +package org.posterita.core; + +import java.util.Map; + +import org.jfree.chart.labels.StandardPieSectionLabelGenerator; +import org.jfree.data.general.PieDataset; + +public class PieLabelGenerator extends StandardPieSectionLabelGenerator +{ + /** + * + */ + private static final long serialVersionUID = 1L; + Map labelMap = null; + + public PieLabelGenerator(Map labelMap) + { + this.labelMap = labelMap; + } + + public String generateSectionLabel(PieDataset arg0, Comparable arg1) + { + return ""+labelMap.get(arg1); + } + + +} diff --git a/posterita/posterita/src/main/org/posterita/core/PrintOrderApplet.java b/posterita/posterita/src/main/org/posterita/core/PrintOrderApplet.java new file mode 100644 index 0000000000..a0519bb412 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/core/PrintOrderApplet.java @@ -0,0 +1,360 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * 17-Nov-2006 10:46:34 by praveen + * + */ + +package org.posterita.core; + +import java.applet.Applet; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; +import java.io.BufferedInputStream; +import java.io.ByteArrayOutputStream; +import java.net.URL; +import java.net.URLConnection; + +import javax.print.DocFlavor; +import javax.print.DocPrintJob; +import javax.print.PrintService; +import javax.print.PrintServiceLookup; +import javax.print.SimpleDoc; +import javax.print.attribute.HashPrintRequestAttributeSet; +import javax.swing.JButton; +import javax.swing.JComboBox; +import javax.swing.JLabel; +import javax.swing.JTextField; + +import org.jpedal.PdfDecoder; + +/** + * Modifications: Added pdf printing capability + * @author ashley + */ +public class PrintOrderApplet extends Applet implements Runnable, ItemListener +{ + private static final long serialVersionUID = 1L; + /** Printer Name **/ + private String printerName = null; + /** Print Data **/ + private byte[] _printData = null; + private String _dataURL = null; + private String _dataContentType = null; + private JComboBox cmbPrintServices; + private PrintService pServices[]; + private JTextField txtUrl; + + /** + * Initialise the applet and the print services + * @see java.applet.Applet#init() + */ + public void init() + { + pServices = getPrintServices(); + cmbPrintServices = new JComboBox(); + cmbPrintServices.setSize(100, 20); + cmbPrintServices.addItemListener(this); + + for (int i = 0; i < pServices.length; i++) + { + cmbPrintServices.addItem(pServices[i].getName()); + } + + add(cmbPrintServices); + + if(pServices.length == 0l) + { + cmbPrintServices.addItem("No Printers found on the system"); + } + + JLabel lbl = new JLabel(); + add(lbl); + + txtUrl = new JTextField(40); + add(txtUrl); + + JButton btn = new JButton("Print"); + btn.addActionListener( + new ActionListener(){ + public void actionPerformed(ActionEvent e) + { + String url = txtUrl.getText(); + printURL(url); + }} + ); + + add(btn); + } + + /** + * Triggered when printer is changed + * @see java.awt.event.ItemListener#itemStateChanged(java.awt.event.ItemEvent) + */ + public void itemStateChanged(ItemEvent e) + { + String pName = (String)e.getItem(); + if (e.getStateChange() == ItemEvent.SELECTED) + { + this.printerName = pName; + } + } + + /** + * Launch printing in a thread + * @see java.lang.Runnable#run() + */ + public void run() + { + PrintService printService = getPrintService(printerName); + + if (printService == null) + { + System.out.println("Could not get printer with name: " + printerName); + System.out.println("Taking default print service"); + printService = getDefaultPrintService(); + } + + if (printService == null) + { + System.out.println("No printers found"); + return; + } + + boolean isDataReady = loadPrintData(); + + if(isDataReady) + { + printData(printService); + } + else + { + System.out.println("Unable to print data."); + } + } + + /** + * Removes network protocol from printer name (Java problem) + * @param name Name of printer + * @return Name trimmed from Network protocol + */ + private String getValidatedPrinterName(String name) + { + if (name == null || name.length() == 0) + { + return name; + } + + if (name.startsWith("IPP") || name.startsWith("Win32")) + { + int index = name.indexOf(":"); + name = name.substring(index + 1, name.length()); + name = name.trim(); + } + return name; + } + + /** + * Get the system's print service by name + * @param name Name of Printer + * @return PrintService with the + */ + private PrintService getPrintService(String name) + { + PrintService pService = null; + if (name == null || name.trim().length() == 0) + { + return null; + } + + name = getValidatedPrinterName(name); + PrintService pServices[] = getPrintServices(); + for (int i = 0; i < pServices.length; i++) + { + String pServiceName = pServices[i].getName(); + pServiceName = getValidatedPrinterName(pServiceName); + if (name.equalsIgnoreCase(pServiceName)) + { + pService = pServices[i]; + break; + } + } + return pService; + } + + /** + * Get the system's default print service + * @return Default PrintService + */ + private PrintService getDefaultPrintService() + { + return PrintServiceLookup.lookupDefaultPrintService(); + } + + /** + * Get all the print services available on the system + * @return System available Print Services + */ + private PrintService[] getPrintServices() + { + if (pServices != null && pServices.length > 0) + { + return pServices; + } + + return PrintServiceLookup.lookupPrintServices(null, null); + } + + /** + * Retrieves the data from URL Provided + * @return true if loading of data successful + */ + private boolean loadPrintData() + { + try + { + URL url = new URL(_dataURL); + + System.out.println("Connecting to :" + _dataURL); + + URLConnection conn = url.openConnection(); + _dataContentType = conn.getContentType(); + + BufferedInputStream bis = new BufferedInputStream(conn.getInputStream()); + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + + System.out.println("Reading ......"); + + byte[] buf = new byte[1024]; + int len; + + while ((len = bis.read(buf)) > 0) + { + bos.write(buf, 0, len); + } + bis.close(); + + bos.flush(); + bos.close(); + + System.out.println("Reading completed successfully"); + + _printData = bos.toByteArray(); + + } + catch (Exception e) + { + e.printStackTrace(); + return false; + } + + return true; + } + + /** + * Sends the data to the print service based on the content type of the data + * @param printService Printer on which to print + * @return true if print command sent successfully + */ + private boolean printData(PrintService printService) + { + try + { + SimpleDoc doc; + + System.out.println("Printing data as:" + _dataContentType); + + //Print data as byte or PDF + if(_dataContentType.equalsIgnoreCase("application/pdf")) + { + PdfDecoder decodePDF = new PdfDecoder(true); + decodePDF.openPdfArray(_printData); + decodePDF.setPagePrintRange(1, decodePDF.getPageCount()); + decodePDF.setUsePDFPaperSize(true); + doc = new SimpleDoc(decodePDF, DocFlavor.SERVICE_FORMATTED.PAGEABLE, null); + } + else + { + doc = new SimpleDoc(_printData, DocFlavor.BYTE_ARRAY.AUTOSENSE, null); + } + + DocPrintJob job = printService.createPrintJob(); + job.print(doc, new HashPrintRequestAttributeSet()); + + System.out.println("Job sent to printer succesfully"); + return true; + } + catch (Exception e) + { + e.printStackTrace(); + return false; + } + } + + /** + * Prints data retrieved from URL + * @param url Data URL + */ + public void printURL(String url) + { + _dataURL = url; + System.out.println("Printing URL: " + url); + Thread thread = new Thread(this); + thread.start(); + } + + /** + * Returns flat string of the printers + * @return All printers available separated by ### + */ + public String getPrintersForJS() + { + if (pServices == null || pServices.length == 0) + { + return "No printers found, check settings"; + } + + String printers = ""; + for (int i = 0; i < pServices.length - 1; i++) + { + printers += pServices[i].getName() + "###"; + } + + printers += pServices[pServices.length - 1]; + + return printers; + } + + /** + * @return the printerName + */ + public String getPrinterName() + { + return printerName; + } + + /** + * @param printerName the printerName to set + */ + public void setPrinterName(String printerName) + { + this.printerName = printerName; + } +} diff --git a/posterita/posterita/src/main/org/posterita/core/RandomStringGenerator.java b/posterita/posterita/src/main/org/posterita/core/RandomStringGenerator.java new file mode 100644 index 0000000000..404c0985ac --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/core/RandomStringGenerator.java @@ -0,0 +1,70 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 29-Jul-2005 by alok + * + */ +package org.posterita.core; + +import java.util.Random; + +/** + * @author jane + * + * To change the template for this generated type comment go to + * Window - Preferences - Java - Code Style - Code Templates + */ +public class RandomStringGenerator +{ + private static Random rn = new Random(); + + private RandomStringGenerator() + { + } + + public static int rand(int lo, int hi) + { + int n = hi - lo + 1; + int i = rn.nextInt() % n; + if (i < 0) + i = -i; + return lo + i; + } + + @SuppressWarnings("deprecation") + public static String randomstring(int lo, int hi) + { + int n = rand(lo, hi); + byte b[] = new byte[n]; + for (int i = 0; i < n; i++) + b[i] = (byte)rand('a', 'z'); + return new String(b, 0); + } + + public static String randomstring() + { + return randomstring(5, 25); + } + + + + + + + +} diff --git a/posterita/posterita/src/main/org/posterita/core/Range.java b/posterita/posterita/src/main/org/posterita/core/Range.java new file mode 100644 index 0000000000..6bbd2047db --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/core/Range.java @@ -0,0 +1,81 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 29-Jul-2005 by alok + * + */ + +package org.posterita.core; + +import java.io.Serializable; + + +public class Range implements Serializable +{ + + /** + * + */ + private static final long serialVersionUID = 1L; + Comparable minValue; + Comparable maxValue; + + public Range(Comparable minValue, Comparable maxValue) + { + setMinValue(minValue); + setMaxValue(maxValue); + } + + public Comparable getMinValue() + { + return minValue; + } + + public void setMinValue(Comparable minValue) + { + this.minValue = minValue; + } + + public Comparable getMaxValue() + { + return maxValue; + } + + public void setMaxValue(Comparable maxValue) + { + this.maxValue = maxValue; + } + /** + * @value + * @return return true if the value is found in between the minimum value + * and the maximum value, else return false; + */ + @SuppressWarnings("unchecked") + public boolean isInRange(Comparable value) + { + if(value == null) + return false; + if((minValue == null || value.compareTo(minValue)>=0) && + (maxValue == null || value.compareTo(maxValue)<=0)) + return true; + + return false; + + } + +} diff --git a/posterita/posterita/src/main/org/posterita/core/ReadKiaDemoData.java b/posterita/posterita/src/main/org/posterita/core/ReadKiaDemoData.java new file mode 100644 index 0000000000..54f5da2d13 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/core/ReadKiaDemoData.java @@ -0,0 +1,444 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + **/ +package org.posterita.core; + +import java.io.BufferedReader; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStreamReader; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.StringTokenizer; + + +public class ReadKiaDemoData +{ + private static String DELIMITER = ","; + public static void main(String args[]) throws IOException + { + ArrayList list = readNatisFile("/home/vickram/Documents/natisFile.csv"); + ArrayList models = readModels("/home/vickram/Documents/modelMatch.csv"); + list = processNatisUploads(list, models); + write(list, "/home/vickram/Documents/processed.csv"); + } + + public static ArrayList readNatisFile(String filename) throws FileNotFoundException + { + FileInputStream fis = new FileInputStream(filename); + + ArrayList list = new ArrayList(); + + String unitNo; + String vinNo; + String natisModelNo; + String natisModelDesc; + String engineNo; + String mainColorCode; + String noOfWheels; + String tare; + String enginePower; + String engineCapacity; + String year; + String countryCode; + String shippingInvoiceNo; + String colorCodeHex; + String colourName; + String eta; + String price; + + KiaNatisProductBean bean; + + InputStreamReader isr = null; + BufferedReader bf = null; + + String line; + try + { + isr = new InputStreamReader(fis); + bf = new BufferedReader(isr); + StringTokenizer tokenizer; + + while ((line = bf.readLine())!=null) + { + tokenizer = new StringTokenizer(line, ","); + + unitNo = tokenizer.nextToken(); + vinNo = tokenizer.nextToken(); + natisModelNo = tokenizer.nextToken(); + natisModelDesc = tokenizer.nextToken(); + engineNo = tokenizer.nextToken(); + mainColorCode = tokenizer.nextToken(); + noOfWheels = tokenizer.nextToken(); + tare = tokenizer.nextToken(); + enginePower = tokenizer.nextToken(); + engineCapacity = tokenizer.nextToken(); + year = tokenizer.nextToken(); + countryCode = tokenizer.nextToken(); + shippingInvoiceNo = tokenizer.nextToken(); + colorCodeHex = tokenizer.nextToken(); + colourName = tokenizer.nextToken(); + eta = tokenizer.nextToken(); + eta = "12252005"; + price = tokenizer.nextToken(); + + engineNo = engineNo.replaceAll(" ", ""); + bean = new ReadKiaDemoData().new KiaNatisProductBean(); + bean.setUnitNo(unitNo); + bean.setVinNo(vinNo); + bean.setNatisModelNo(natisModelNo); + bean.setNatisModelDesc(natisModelDesc); + bean.setEngineNo(engineNo); + bean.setMainColorCode(mainColorCode); + bean.setNoOfWheels(noOfWheels); + bean.setTare(tare); + bean.setEnginePower(enginePower); + bean.setEngineCapacity(engineCapacity); + bean.setYear(year); + bean.setCountryCode(countryCode); + bean.setShippingInvoiceNo(shippingInvoiceNo); + bean.setColorCodeHex(colorCodeHex); + bean.setColourName(colourName); + bean.setEta(eta); + bean.setPrice(price); + list.add(bean); + + } + + } + catch(Exception e) + { + e.printStackTrace(); + } + finally + { + try + { + if ( isr != null) + { + isr.close(); + } + if ( bf != null) + { + bf.close(); + } + } + catch(Exception ex) + {} + } + + return list; + } + + public static ArrayList readModels(String filename) throws FileNotFoundException + { + FileInputStream fis = new FileInputStream(filename); + + ArrayList list = new ArrayList(); + + String model; + String modelNo; + String modelDerivative; + + + KiaNatisProductBean bean; + + InputStreamReader isr = null; + BufferedReader bf = null; + + String line; + try + { + isr = new InputStreamReader(fis); + bf = new BufferedReader(isr); + StringTokenizer tokenizer; + + while ((line = bf.readLine())!=null) + { + tokenizer = new StringTokenizer(line, ","); + + model = tokenizer.nextToken(); + modelNo = tokenizer.nextToken(); + modelDerivative = tokenizer.nextToken(); + + bean = new ReadKiaDemoData().new KiaNatisProductBean(); + bean.setModel(model); + bean.setNatisModelNo(modelNo); + bean.setModelDerivative(modelDerivative); + list.add(bean); + + } + + } + catch(Exception e) + { + e.printStackTrace(); + } + finally + { + try + { + if (fis != null) + { + fis.close(); + } + if (isr != null) + { + isr.close(); + } + if( bf != null) + { + bf.close(); + } + } + catch(Exception ex) + {} + } + + return list; + } + + + class KiaNatisProductBean + { + String unitNo; + String vinNo; + String natisModelNo; + String natisModelDesc; + String engineNo; + String mainColorCode; + String noOfWheels; + String tare; + String enginePower; + String engineCapacity; + String year; + String countryCode; + String shippingInvoiceNo; + String colorCodeHex; + String colourName; + String eta; + String price; + String model; + String modelDerivative; + + + public String getModel() { + return model; + } + public void setModel(String model) { + this.model = model; + } + public String getModelDerivative() { + return modelDerivative; + } + public void setModelDerivative(String modelDerivative) { + this.modelDerivative = modelDerivative; + } + public String getColorCodeHex() { + return colorCodeHex; + } + public void setColorCodeHex(String colorCodeHex) { + this.colorCodeHex = colorCodeHex; + } + public String getColourName() { + return colourName; + } + public void setColourName(String colourName) { + this.colourName = colourName; + } + public String getCountryCode() { + return countryCode; + } + public void setCountryCode(String countryCode) { + this.countryCode = countryCode; + } + public String getEngineCapacity() { + return engineCapacity; + } + public void setEngineCapacity(String engineCapacity) { + this.engineCapacity = engineCapacity; + } + public String getEngineNo() { + return engineNo; + } + public void setEngineNo(String engineNo) { + this.engineNo = engineNo; + } + public String getEnginePower() { + return enginePower; + } + public void setEnginePower(String enginePower) { + this.enginePower = enginePower; + } + public String getEta() { + return eta; + } + public void setEta(String eta) { + this.eta = eta; + } + public String getMainColorCode() { + return mainColorCode; + } + public void setMainColorCode(String mainColorCode) { + this.mainColorCode = mainColorCode; + } + public String getNatisModelDesc() { + return natisModelDesc; + } + public void setNatisModelDesc(String natisModelDesc) { + this.natisModelDesc = natisModelDesc; + } + public String getNatisModelNo() { + return natisModelNo; + } + public void setNatisModelNo(String natisModelNo) { + this.natisModelNo = natisModelNo; + } + public String getNoOfWheels() { + return noOfWheels; + } + public void setNoOfWheels(String noOfWheels) { + this.noOfWheels = noOfWheels; + } + public String getPrice() { + return price; + } + public void setPrice(String price) { + this.price = price; + } + public String getShippingInvoiceNo() { + return shippingInvoiceNo; + } + public void setShippingInvoiceNo(String shippingInvoiceNo) { + this.shippingInvoiceNo = shippingInvoiceNo; + } + public String getTare() { + return tare; + } + public void setTare(String tare) { + this.tare = tare; + } + public String getUnitNo() { + return unitNo; + } + public void setUnitNo(String unitNo) { + this.unitNo = unitNo; + } + public String getVinNo() { + return vinNo; + } + public void setVinNo(String vinNo) { + this.vinNo = vinNo; + } + public String getYear() { + return year; + } + public void setYear(String year) { + this.year = year; + } + + public String toString() + { + String str = unitNo + DELIMITER + + vinNo + DELIMITER + + natisModelNo + DELIMITER + + natisModelDesc + DELIMITER + + engineNo + DELIMITER + + mainColorCode + DELIMITER + + noOfWheels + DELIMITER + + tare + DELIMITER + + enginePower + DELIMITER + + engineCapacity + DELIMITER + + year + DELIMITER + + countryCode + DELIMITER + + shippingInvoiceNo + DELIMITER + + colorCodeHex + DELIMITER + + colourName + DELIMITER + + eta + DELIMITER + + price + DELIMITER + + "" + DELIMITER + //natis registration status + "" + DELIMITER + //order status + ""; //description + return str; + } + } + + public static ArrayList processNatisUploads(ArrayList natisUploads, ArrayList models) + { + Iterator iter = natisUploads.iterator(); + + KiaNatisProductBean bean; + + String match; + while (iter.hasNext()) + { + bean = (KiaNatisProductBean) iter.next(); + match = getModelMatch(bean, models); + bean.setNatisModelDesc(match); + + } + + return natisUploads; + } + + public static String getModelMatch(KiaNatisProductBean bean, ArrayList models) + { + Iterator iter = models.iterator(); + + KiaNatisProductBean model; + + while (iter.hasNext()) + { + model = (KiaNatisProductBean) iter.next(); + + if (matchFound(bean, model)) + return model.getModel(); + } + + return "No match Found"; + + } + + public static boolean matchFound(KiaNatisProductBean bean, KiaNatisProductBean bean2) + { + if (bean.getNatisModelNo().equals(bean2.getNatisModelNo())) + if (bean.getNatisModelDesc().equals(bean2.getModelDerivative())) + return true; + + return false; + } + + public static void write(ArrayList natisModels, String fileName) throws IOException + { + Iterator iter = natisModels.iterator(); + + StringBuffer buffer = new StringBuffer(); + KiaNatisProductBean bean; + while (iter.hasNext()) + { + bean = (KiaNatisProductBean) iter.next(); + buffer.append(bean.toString()); + buffer.append("\n"); + + } + + FileManager.write(fileName, buffer.toString(), false); + } +} diff --git a/posterita/posterita/src/main/org/posterita/core/SessionStorage.java b/posterita/posterita/src/main/org/posterita/core/SessionStorage.java new file mode 100644 index 0000000000..a49405175e --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/core/SessionStorage.java @@ -0,0 +1,514 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Jul 29, 2005 by praveen + * + */ +package org.posterita.core; + +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.Properties; +import java.util.TreeSet; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.compiere.model.MCountry; +import org.compiere.model.MOrder; +import org.compiere.model.MOrg; +import org.compiere.model.MPOSTerminal; +import org.compiere.model.MStore; +import org.compiere.util.Env; +import org.compiere.util.KeyNamePair; +import org.compiere.util.ValueNamePair; +import org.posterita.Constants; +import org.posterita.beans.AttributeValuesBean; +import org.posterita.beans.FilterBean; +import org.posterita.beans.OrderLineBean; +import org.posterita.beans.PriceListBean; +import org.posterita.beans.ProductAttributeBean; +import org.posterita.beans.ProductInfo; +import org.posterita.beans.ReportBean; +import org.posterita.beans.StockBean; +import org.posterita.beans.UDIPair; +import org.posterita.beans.WebDocumentBean; +import org.posterita.businesslogic.CurrencyManager; +import org.posterita.businesslogic.HistoryFilterBean; +import org.posterita.businesslogic.MenuManager; +import org.posterita.businesslogic.OrganisationManager; +import org.posterita.businesslogic.POSManager; +import org.posterita.businesslogic.POSTerminalManager; +import org.posterita.businesslogic.administration.PriceListManager; +import org.posterita.businesslogic.performanceanalysis.POSSalesReportManager; +import org.posterita.exceptions.OperationException; +import org.posterita.exceptions.SystemException; +import org.posterita.lib.UdiConstants; + +public class SessionStorage +{ + + public static void putProductAttributes(HttpServletRequest request, ProductAttributeBean productAttributeBean) + { + //extract parameters from request + //1.attributeSetId + //2.attributeId + request.getSession().setAttribute(Constants.ATTRIBUTE_NAME, productAttributeBean.getAttributes()); + request.getSession().setAttribute(Constants.ATTRIBUTE_SET, productAttributeBean.getAttributeSets()); + request.getSession().setAttribute(Constants.ATTRIBUTE_VALUES, productAttributeBean.getAttributeValues()); + } + + @SuppressWarnings("unchecked") + public static void putTextileProductInfo(HttpServletRequest request, ProductInfo info) + { + //Properties ctx = TmkJSPEnv.getCtx(request); + + TreeSet brandSet = new TreeSet(info.getAttributeValuesBean().getBrand()); + TreeSet modelSet = new TreeSet(info.getAttributeValuesBean().getModel()); + TreeSet designSet = new TreeSet(info.getAttributeValuesBean().getDesign()); + TreeSet colourSet = new TreeSet(info.getAttributeValuesBean().getColour()); + TreeSet sizeSet = new TreeSet(info.getAttributeValuesBean().getSize()); + TreeSet trxSet = new TreeSet(info.getAttributeValuesBean().getTrx()); + TreeSet yearSet = new TreeSet(info.getAttributeValuesBean().getYears()); + + request.getSession().setAttribute(Constants.POS_STOCK,info.getProducts()); + request.getSession().setAttribute(Constants.BRAND_ATTRIBUTE_VALUES, brandSet); + request.getSession().setAttribute(Constants.MODEL_ATTRIBUTE_VALUES, modelSet); + request.getSession().setAttribute(Constants.DESIGN_ATTRIBUTE_VALUES, designSet); + request.getSession().setAttribute(Constants.COLOUR_ATTRIBUTE_VALUES, colourSet); + request.getSession().setAttribute(Constants.SIZE_ATTRIBUTE_VALUES, sizeSet); + request.getSession().setAttribute(Constants.TRX_ATTRIBUTE_VALUES, trxSet); + request.getSession().setAttribute(Constants.YEAR_ATTRIBUTE_VALUES, yearSet); + } + + public static void putWebOrderBean(Properties ctx,HttpServletRequest request, WebDocumentBean bean) throws OperationException + { + request.getSession().setAttribute(Constants.ORDER_LINES,bean.getLines()); + request.getSession().setAttribute(Constants.MORDER, bean.getOrder()); + } + + public static void putHistoryFilterBeans(HttpServletRequest request, ArrayList orderHistory) + { + HistoryFilterBean orderHistoryBeans = new HistoryFilterBean(orderHistory); + + TreeSet bPartners = orderHistoryBeans.getBPartnerList(); + TreeSet docStatus = orderHistoryBeans.getDocStatusList(); + + request.getSession().setAttribute(Constants.BPARTNER, bPartners); + request.getSession().setAttribute(Constants.DOC_STATUS, docStatus); + } + + public static WebDocumentBean getWebOrderBean(Properties ctx, HttpServletRequest request) + { + ArrayList orderLines = (ArrayList) request.getSession().getAttribute(Constants.ORDER_LINES); + + MOrder order = (MOrder) request.getSession().getAttribute(Constants.MORDER); + + WebDocumentBean webOrderBean = new WebDocumentBean(); + webOrderBean.setLines(orderLines); + webOrderBean.setOrder(order); + return webOrderBean; + } + + public static void putPriceList(HttpServletRequest request, ArrayList priceList) + { + AttributeValuesBean attrs = PriceListManager.getAttributeValues(priceList); + + ArrayList modelSet = attrs.getModel(); + ArrayList colourSet = attrs.getColour(); + ArrayList trxSet = attrs.getTrx(); + ArrayList yearSet = attrs.getYears(); + + request.getSession().setAttribute(Constants.PRICE_LIST, priceList); + request.getSession().setAttribute(Constants.MODEL_ATTRIBUTE_VALUES, modelSet); + request.getSession().setAttribute(Constants.COLOUR_ATTRIBUTE_VALUES, colourSet); + request.getSession().setAttribute(Constants.TRX_ATTRIBUTE_VALUES, trxSet); + request.getSession().setAttribute(Constants.YEAR_ATTRIBUTE_VALUES, yearSet); + + } + + @SuppressWarnings({"unchecked","unchecked"}) + public static void putOrderFiltering(Properties ctx, HttpServletRequest request, FilterBean filterBean) + { + ArrayList bpList = (ArrayList) filterBean.getBpList(); + ArrayList docStatusList = (ArrayList) filterBean.getDocStatusList(); + + if ((bpList!=null) && (bpList.size()!=0)) + { + TreeSet bpSet = new TreeSet(bpList); + request.setAttribute(Constants.BPARTNER, bpSet); + } + + if ((docStatusList!=null) && (docStatusList.size()!=0)) + { + TreeSet bpSet = new TreeSet(docStatusList); + request.setAttribute(Constants.DOC_STATUS, bpSet); + } + } + + public static void putSCOrderFiltering(Properties ctx, HttpServletRequest request, FilterBean filterBean) throws OperationException + { + putOrderFiltering(ctx, request, filterBean); + + MOrg myOrg = OrganisationManager.getMyOrg(ctx); + } + + @SuppressWarnings("unchecked") + public static void putPriceListProducts(HttpServletRequest request, ProductInfo info) + { + TreeSet modelSet = new TreeSet(info.getAttributeValuesBean().getModel()); + TreeSet colourSet = new TreeSet(info.getAttributeValuesBean().getColour()); + TreeSet trxSet = new TreeSet(info.getAttributeValuesBean().getTrx()); + TreeSet yearSet = new TreeSet(info.getAttributeValuesBean().getYears()); + + request.getSession().setAttribute(Constants.MODEL_ATTRIBUTE_VALUES, modelSet); + request.getSession().setAttribute(Constants.COLOUR_ATTRIBUTE_VALUES, colourSet); + request.getSession().setAttribute(Constants.TRX_ATTRIBUTE_VALUES, trxSet); + request.getSession().setAttribute(Constants.YEAR_ATTRIBUTE_VALUES, yearSet); + } + + public static void putMenus(Properties ctx, HttpServletRequest request) throws SystemException, OperationException + { + ArrayList menuList = MenuManager.getMenus(ctx, request); + MenuItem menus = MenuManager.buildMenuTree(ctx, menuList); + ArrayList topMenusList = menus.getTopMenus(); + ArrayList leftMenusList = menus.getLeftMenus(); + + request.getSession().setAttribute(Constants.MENUS, menus); + request.getSession().setAttribute(Constants.TOP_MENUS, topMenusList); + request.getSession().setAttribute(Constants.LEFT_MENUS, leftMenusList); + + } + + public static void putOrg(Properties ctx, HttpServletRequest request) + { + MOrg org = new MOrg(ctx, Env.getAD_Org_ID(ctx), null); + + request.getSession().setAttribute(Constants.ORGANISATION, org); + } + + public static void putProductAttributeValueIds(HttpServletRequest request, StockBean bean) + { + request.getSession().setAttribute(Constants.MODEL_ATTRIBUTE_VALUE_ID, bean.getModel()); + request.getSession().setAttribute(Constants.COLOUR_ATTRIBUTE_VALUE_ID, bean.getColour()); + request.getSession().setAttribute(Constants.TRX_ATTRIBUTE_VALUE_ID, bean.getTransmission()); + request.getSession().setAttribute(Constants.YEAR_ATTRIBUTE_VALUE_ID, bean.getYear()); + } + + public static StockBean getProductAttributeValueIds(HttpServletRequest request, StockBean bean) + { + Integer modelAttributeValueId = (Integer) request.getSession().getAttribute(Constants.MODEL_ATTRIBUTE_VALUE_ID); + Integer colourAttributeValueId = (Integer) request.getSession().getAttribute(Constants.COLOUR_ATTRIBUTE_VALUE_ID); + Integer trxAttributeValueId = (Integer) request.getSession().getAttribute(Constants.TRX_ATTRIBUTE_VALUE_ID); + Integer yearAttributeValueId = (Integer) request.getSession().getAttribute(Constants.YEAR_ATTRIBUTE_VALUE_ID); + + bean.setModel(modelAttributeValueId); + bean.setColour(colourAttributeValueId); + bean.setTransmission(trxAttributeValueId); + bean.setYear(yearAttributeValueId); + + return bean; + } + + public static void putOrderInfo(Properties ctx, WebDocumentBean webBean, HttpServletRequest request) + { + request.getSession().setAttribute(Constants.ME_LOCATION, webBean.getMeLocation()); + request.getSession().setAttribute(Constants.YOU_LOCATION, webBean.getYouLocation()); + request.getSession().setAttribute(Constants.YOU_BP_LOCATION, webBean.getYoubpLocation()); + request.getSession().setAttribute(Constants.ME, webBean.getMe()); + request.getSession().setAttribute(Constants.YOU,webBean.getYou()); + request.getSession().setAttribute(Constants.MORDER, webBean.getOrder()); + request.getSession().setAttribute(Constants.MORDER_LINES_COLLECTION,webBean.getLines()); + request.getSession().setAttribute(Constants.SIMPLE_COMMAND,webBean.getSimpleCommand()); + request.getSession().setAttribute(Constants.COMPLEX_COMMAND,webBean.getComplexCommand()); + request.getSession().setAttribute(Constants.WEB_DOCUMENT_HEADER_BEAN, webBean.getHeaderBean()); + request.getSession().setAttribute(Constants.ORDER_TAX,webBean.getTotalTax()); + request.getSession().setAttribute(Constants.TOTAL_LINES,webBean.getTotalLines()); + request.getSession().setAttribute(Constants.GRAND_TOTAL,webBean.getGrandTotal()); + request.getSession().setAttribute(Constants.ALLOCATION,webBean.getAllocations()); + request.getSession().setAttribute(Constants.SALES_REP, webBean.getSalesRep()); + } + + public static void putPOSOrderInfo(Properties ctx,OrderLineBean bean,HttpServletRequest request,String forward) throws OperationException + { + if (forward == null) + throw new OperationException("Invalid forward parameter, it is set to null"); + + if (forward.equals(POSManager.DELETE_POS_ORDERLINE)) + { + Integer posOrderId=(Integer)request.getSession().getAttribute(Constants.CURRENT_POS_ORDER_ID); + MOrder posOrder = new MOrder(ctx, posOrderId, null); + ArrayList POSlist = POSManager.populateOrderLines(ctx,posOrder); + WebDocumentBean POSdocumentBean=POSManager.calculateOrderTotals(POSlist); + request.getSession().setAttribute(Constants.CURRENT_POS_ORDER_ID,posOrder.get_ID()); + request.setAttribute(Constants.POS_ORDER_LINES,POSlist); + request.setAttribute(Constants.ORDER_TAX,POSdocumentBean.getTotalTax()); + request.setAttribute(Constants.TOTAL_LINES,POSdocumentBean.getTotalLines()); + request.setAttribute(Constants.GRAND_TOTAL,POSdocumentBean.getGrandTotal()); + } + else if (forward.equals(POSManager.DELETE_PARTIAL_POS_ORDERLINE)) + { + Integer posOrderId=(Integer)request.getSession().getAttribute(Constants.CURRENT_PARTIAL_POS_ORDER_ID); + MOrder posOrder = new MOrder(ctx, posOrderId, null); + ArrayList POSlist = POSManager.populateOrderLines(ctx,posOrder); + WebDocumentBean POSdocumentBean=POSManager.calculateOrderTotals(POSlist); + request.getSession().setAttribute(Constants.CURRENT_PARTIAL_POS_ORDER_ID,posOrder.get_ID()); + request.setAttribute(Constants.PARTIAL_POS_ORDER_LINES,POSlist); + request.setAttribute(Constants.ORDER_TAX,POSdocumentBean.getTotalTax()); + request.setAttribute(Constants.TOTAL_LINES,POSdocumentBean.getTotalLines()); + request.setAttribute(Constants.GRAND_TOTAL,POSdocumentBean.getGrandTotal()); + } + else if (forward.equals(POSManager.DELETE_GOODS_RECEIVE_ORDERLINE)) + { + Integer goodsReceiceNoteId=(Integer)request.getSession().getAttribute(Constants.GOODS_RECEIVE_NOTE_ID); + MOrder goodsReceiveNote = new MOrder(ctx,goodsReceiceNoteId,null); + goodsReceiveNote = new MOrder(ctx, goodsReceiveNote.get_ID(), null); + ArrayList Receivelist = POSManager.populateOrderLines(ctx,goodsReceiveNote); + WebDocumentBean receivedocumentBean=POSManager.calculateOrderTotals(Receivelist); + request.getSession().setAttribute(Constants.GOODS_RECEIVE_NOTE_ID,goodsReceiveNote.get_ID()); + request.setAttribute(Constants.GOODS_RECEIVE_NOTE_LINES,Receivelist); + request.setAttribute(Constants.ORDER_TAX,receivedocumentBean.getTotalTax()); + request.setAttribute(Constants.TOTAL_LINES,receivedocumentBean.getTotalLines()); + request.setAttribute(Constants.GRAND_TOTAL,receivedocumentBean.getGrandTotal()); + } + else if (forward.equals(POSManager.DELETE_CUSTOMER_RETURN_ORDERLINE)) + { + Integer customerReturnOrderId=(Integer)request.getSession().getAttribute(Constants.CUSTOMER_RETURN_ORDER_ID); + MOrder customerReturnOrder=new MOrder(ctx,customerReturnOrderId,null); + ArrayList returnList = POSManager.populateOrderLines(ctx,customerReturnOrder); + WebDocumentBean receivedocumentBean=POSManager.calculateOrderTotals(returnList); + request.getSession().setAttribute(Constants.CUSTOMER_RETURN_ORDER,customerReturnOrder); + request.setAttribute(Constants.CUSTOMER_RETURN_ORDER_LINES,returnList); + request.setAttribute(Constants.ORDER_TAX,receivedocumentBean.getTotalTax()); + request.setAttribute(Constants.TOTAL_LINES,receivedocumentBean.getTotalLines()); + request.setAttribute(Constants.GRAND_TOTAL,receivedocumentBean.getGrandTotal()); + } + else + { + Integer goodsReturnNoteId=(Integer)request.getSession().getAttribute(Constants.GOODS_RETURN_NOTE_ID); + MOrder goodsReturnNote=new MOrder(ctx,goodsReturnNoteId,null); + goodsReturnNote = new MOrder(ctx, goodsReturnNote.get_ID(), null); + ArrayList list = POSManager.populateOrderLines(ctx,goodsReturnNote); + WebDocumentBean documentBean=POSManager.calculateOrderTotals(list); + + request.getSession().setAttribute(Constants.GOODS_RETURN_NOTE,goodsReturnNote); + request.setAttribute(Constants.GOODS_RETURN_NOTE_LINES,list); + request.setAttribute(Constants.ORDER_TAX,documentBean.getTotalTax()); + request.setAttribute(Constants.TOTAL_LINES,documentBean.getTotalLines()); + request.setAttribute(Constants.GRAND_TOTAL,documentBean.getGrandTotal()); + } + } + + public static void putCompleteOrderInfo(Properties ctx,HttpServletRequest request,WebDocumentBean webBean,WebDocumentBean documentBean) + { + request.setAttribute(Constants.ORDER_TAX,documentBean.getTotalTax()); + request.setAttribute(Constants.TOTAL_LINES,documentBean.getTotalLines()); + request.setAttribute(Constants.SUB_TOTAL, documentBean.getSubTotal()); + request.setAttribute(Constants.GRAND_TOTAL,documentBean.getGrandTotal()); + request.getSession().setAttribute(Constants.ME_LOCATION, webBean.getMeLocation()); + request.getSession().setAttribute(Constants.YOU_LOCATION, webBean.getYouLocation()); + request.getSession().setAttribute(Constants.YOU_BP_LOCATION, webBean.getYoubpLocation()); + request.getSession().setAttribute(Constants.ME, webBean.getMe()); + request.getSession().setAttribute(Constants.YOU,webBean.getYou()); + request.getSession().setAttribute(Constants.MORDER, webBean.getOrder()); + request.getSession().setAttribute(Constants.MORDER_LINES_COLLECTION,webBean.getLines()); + request.getSession().setAttribute(Constants.SIMPLE_COMMAND,webBean.getSimpleCommand()); + request.getSession().setAttribute(Constants.COMPLEX_COMMAND,webBean.getComplexCommand()); + request.getSession().setAttribute(Constants.WEB_DOCUMENT_HEADER_BEAN, webBean.getHeaderBean()); + request.getSession().setAttribute(Constants.ORDER_TAX,webBean.getTotalTax()); + request.getSession().setAttribute(Constants.TOTAL_LINES,webBean.getTotalLines()); + request.getSession().setAttribute(Constants.GRAND_TOTAL,webBean.getGrandTotal()); + request.getSession().setAttribute(Constants.ALLOCATION,webBean.getAllocations()); + request.getSession().setAttribute(Constants.SALES_REP, webBean.getSalesRep()); + request.getSession().setAttribute(Constants.DESCRIPTION, webBean.getDescription()); + request.getSession().setAttribute(Constants.PAYMENT_BY_CASH, webBean.getPaymentByCash()); + request.getSession().setAttribute(Constants.PAYMENT_BY_CARD, webBean.getPaymentByCard()); + request.getSession().setAttribute(Constants.PAYMENT_BY_CHEQUE, webBean.getPaymentbyCheque()); + request.setAttribute(Constants.CURRENCY_SYMBOLE,webBean.getCurrencySymbole()); + + } + + + public static void setPOSTerminal(Properties ctx, int terminalId, HttpServletRequest request) throws OperationException + { + Env.setContext(ctx, UdiConstants.TERMINAL_ID, terminalId); + + MPOSTerminal terminal = new MPOSTerminal(ctx, terminalId, null); + + int purchasePList = terminal.getPO_PriceList_ID(); + int purchasePLVersion = PriceListManager.getPriceListVersionID(ctx, purchasePList, null); + + Env.setContext(ctx,UdiConstants.POS_PURCHASE_PL_VERSION,purchasePLVersion); + Env.setContext(ctx,UdiConstants.POS_PURCHASE_PL,purchasePList); + + } + + public static void putSalesGroupFilter(Properties ctx,HttpServletRequest request,ReportBean bean) throws OperationException + { + ArrayList groupList = POSSalesReportManager.getSalesGroupList(ctx,bean); + ArrayList priceQtyFilter = POSSalesReportManager.getPriceQtyFilter(ctx); + + request.getSession().setAttribute(Constants.SALESGROUP_LIST,groupList); + request.getSession().setAttribute(Constants.PRICEQTY_FILTER,priceQtyFilter); + request.getSession().removeAttribute(Constants.REPORT_URL); + } + public static void removeSession(Properties ctx,HttpServletRequest request) + { + //goods Receive Note + request.getSession().removeAttribute(Constants.ALL_CUSTOMERS); + request.getSession().removeAttribute(Constants.GOODS_RECEIVE_NOTE_SHOPPING_CART); + request.getSession().removeAttribute(Constants.GOODS_RECEIVE_NOTE_SHOPPING_CART_ITEMS); + request.getSession().removeAttribute(Constants.DESCRIPTION); + request.getSession().removeAttribute(Constants.B_PARTNER_ID); + request.getSession().removeAttribute(Constants.GOODS_RECEIVE_NOTE_ID); + request.getSession().removeAttribute(Constants.DESCRIPTION); + request.getSession().removeAttribute(Constants.PRESENT_GRN_ORDER); + request.getSession().removeAttribute(Constants.PRESENT_GRN_ORDER_ID); + + //goods return Note + + request.getSession().removeAttribute(Constants.ALL_CUSTOMERS); + request.getSession().removeAttribute(Constants.GOODS_RETURN_NOTE_SHOPPING_CART); + request.getSession().removeAttribute(Constants.GOODS_RETURN_NOTE_SHOPPING_CART_ITEMS); + request.getSession().removeAttribute(Constants.GOODS_RETURN_NOTE_ID); + request.getSession().removeAttribute(Constants.B_PARTNER_ID); + request.getSession().removeAttribute(Constants.DESCRIPTION); + request.getSession().removeAttribute(Constants.PRESENT_GOODS_RET_ORDER); + request.getSession().removeAttribute(Constants.PRESENT_GOODS_RET_ORDER_ID); + + //Customer Return Order + + request.getSession().removeAttribute(Constants.ALL_CUSTOMERS); + request.getSession().removeAttribute(Constants.CUSTOMER_RETURN_ORDER_SHOPPING_CART); + request.getSession().removeAttribute(Constants.CUSTOMER_RETURN_ORDER_SHOPPING_CART_ITEMS); + request.getSession().removeAttribute(Constants.DESCRIPTION); + request.getSession().removeAttribute(Constants.CUSTOMER_RETURN_ORDER_ID); + request.getSession().removeAttribute(Constants.B_PARTNER_ID); + + request.getSession().removeAttribute(Constants.ORDER_TYPE); + request.getSession().removeAttribute(Constants.POS_ORDER_DOC_NUMBER); + request.getSession().removeAttribute(Constants.CREDIT_PAYMENT_TERM_ID); + request.getSession().removeAttribute( Constants.PRESENT_CUSTOMER_RET_ORDER ); + request.getSession().removeAttribute( Constants.PRESENT_CUSTOMER_RET_ORDER_ID); + + //pos order + + request.getSession().removeAttribute(Constants.ALL_CUSTOMERS); + request.getSession().removeAttribute(Constants.BPARTNER); + request.getSession().removeAttribute(Constants.SHOPPING_ORDER_CART); + request.getSession().removeAttribute(Constants.SHOPPING_ORDER_CART_ITEMS); + request.getSession().removeAttribute(Constants.CURRENT_POS_ORDER_ID); + + + request.getSession().removeAttribute(Constants.PARTIAL_ORDER_SHOPPING_CART); + request.getSession().removeAttribute(Constants.PARTIAL_ORDER_SHOPPING_CART_ITEMS); + request.getSession().removeAttribute(Constants.CURRENT_PARTIAL_POS_ORDER_ID); + request.getSession().removeAttribute(Constants.PRESENT_POS_ORDER); + request.getSession().removeAttribute( Constants.PRESENT_POS_ORDER_ID ); + + //credit order + + request.getSession().removeAttribute(Constants.ALL_CUSTOMERS); + request.getSession().removeAttribute(Constants.CREDIT_ORDER_SHOPPING_CART); + request.getSession().removeAttribute(Constants.CREDIT_ORDER_SHOPPING_CART_ITEMS); + request.getSession().removeAttribute(Constants.CURRENT_POS_ORDER_ID); + request.getSession().removeAttribute(Constants.CREDITORDER_BPARTNER); + request.getSession().removeAttribute(Constants.SHIPMENT_REQUIRED); + request.getSession().removeAttribute(Constants.TO_BE_SHIPPED); + request.getSession().removeAttribute(Constants.CREDITORDER_BPARTNER); + request.getSession().removeAttribute( Constants.PRESENT_CREDIT_ORDER ); + request.getSession().removeAttribute( Constants.PRESENT_CREDIT_ORDER_ID); + + request.getSession().removeAttribute(Constants.ORDER_TYPE); + request.getSession().removeAttribute(Constants.POS_ORDER_DOC_NUMBER); + } + + public static void putCountriesAndCurrencies(Properties ctx, HttpServletRequest request) throws OperationException + { + try + { + ArrayList countriesKNPair = KeyNamePairUtil.getData(ctx, MCountry.Table_Name, "IsActive='Y'"); + ArrayList currenciesKNPair = CurrencyManager.getAllCurrencies(); + + request.getSession().setAttribute(Constants.COUNTRIES, countriesKNPair); + request.getSession().setAttribute(Constants.CURRENCIES, currenciesKNPair); + } + catch (SQLException e) + { + throw new OperationException(e); + } + } + + public static void putStoreName(Properties ctx, HttpServletRequest request) + { + MStore store = MStore.get(ctx, Env.getContextAsInt(ctx, UdiConstants.WSTORE_CTX_PARAM)); + + if (store == null) + request.getSession().setAttribute(Constants.APP_NAME, ""); + else + request.getSession().setAttribute(Constants.APP_NAME, store.getName()); + } + + public static void putLoginSession(Properties ctx, HttpServletRequest request, HttpServletResponse response, int terminalId) throws OperationException + { + setPOSTerminal(ctx, terminalId, request); + POSTerminalManager.setTerminalInCookie(response, terminalId); + String currSymboleSales = POSTerminalManager.getDefaultSalesCurrency(ctx).getCurSymbol(); + String currSymbolePurchase = POSTerminalManager.getDefaultPurchaseCurrency(ctx).getCurSymbol(); + request.getSession().setAttribute(Constants.CURRENCY_SYMBOLE,currSymboleSales); + request.getSession().setAttribute(Constants.CURRENCY_SYMBOLE_PURCHASE,currSymbolePurchase); + request.getSession().setAttribute(Constants.USER_ORGS,OrganisationManager.getUserOrgPairs(ctx)); + request.getSession().setAttribute(Constants.USER_ORGS_STOCK, OrganisationManager.getUserOrgPairs(ctx, false)); + putCountriesAndCurrencies(ctx, request); + putStoreName(ctx, request); + putPriceLists(ctx, request); + + // Terminal Transfer values + ValueNamePair noTransfer = new ValueNamePair("", ""); + ValueNamePair bankAccountTransfer = new ValueNamePair(MPOSTerminal.CASHBOOKTRANSFERTYPE_BankAccount, "Bank Account"); + ValueNamePair cashbookTransfer = new ValueNamePair(MPOSTerminal.CASHBOOKTRANSFERTYPE_CashBook, "Cashbook"); + ArrayList terminalTransferList = new ArrayList(); + terminalTransferList.add(noTransfer); + terminalTransferList.add(bankAccountTransfer); + terminalTransferList.add(cashbookTransfer); + request.getSession().setAttribute(Constants.TERMINAL_TRANSFER_TYPE, terminalTransferList); + } + + public static void putPriceLists(Properties ctx, HttpServletRequest request) throws OperationException + { + int soPriceListId = POSTerminalManager.getSOPriceListId(ctx); + int poPriceListId = POSTerminalManager.getPOPriceListId(ctx); + int warehouseId = POSTerminalManager.getWarehouseId(ctx); + Env.setContext(ctx, UdiConstants.PRICELIST_CTX_PARAM, soPriceListId); + Env.setContext(ctx, UdiConstants.WAREHOUSE_CTX_PARAM, warehouseId); + + ArrayList activeSalesPriceLists = PriceListManager.getPriceLists(ctx,0,"",true,null,null,true,null); + ArrayList salesPriceListsKNP = PriceListManager.getKeyNamePair(ctx, activeSalesPriceLists); + + ArrayList activePurchasePriceLists = PriceListManager.getPriceLists(ctx,0,"",true,null,null,false,null); + ArrayList purchasePriceListsKNP = PriceListManager.getKeyNamePair(ctx, activePurchasePriceLists); + + ArrayList activePriceLists = PriceListManager.getPriceLists(ctx, 0, "", true, null, null, null, null); + ArrayList priceListsKNP = PriceListManager.getKeyNamePair(ctx, activePriceLists); + + request.getSession().setAttribute(Constants.USER_SALES_PRICE_LISTS, salesPriceListsKNP); + request.getSession().setAttribute(Constants.USER_PURCHASE_PRICE_LISTS, purchasePriceListsKNP); + request.getSession().setAttribute(Constants.USER_PRICE_LISTS, priceListsKNP); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/core/SimpleCalendarDate.java b/posterita/posterita/src/main/org/posterita/core/SimpleCalendarDate.java new file mode 100644 index 0000000000..cefc49cb08 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/core/SimpleCalendarDate.java @@ -0,0 +1,90 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 29-Jul-2005 by alok + * + */ + +package org.posterita.core; + +/* + * This class is used for formatting purposes only + * @author vishee + * + * To change the template for this generated type comment go to + * Window - Preferences - Java - Code Generation - Code and Comments + */ +public class SimpleCalendarDate +{ + private String year; + private String month; + private String day; + + + public SimpleCalendarDate(String day, String month, String year) + { + this.day = day; + this.month = month; + this.year = year; + } + + + + /** + * @return Returns the day. + */ + public String getDay() + { + return day; + } + /** + * @param day The day to set. + */ + public void setDay(String day) + { + this.day = day; + } + /** + * @return Returns the month. + */ + public String getMonth() + { + return month; + } + /** + * @param month The month to set. + */ + public void setMonth(String month) + { + this.month = month; + } + /** + * @return Returns the year. + */ + public String getYear() + { + return year; + } + /** + * @param year The year to set. + */ + public void setYear(String year) + { + this.year = year; + } +} diff --git a/posterita/posterita/src/main/org/posterita/core/SimpleReportGenerator.java b/posterita/posterita/src/main/org/posterita/core/SimpleReportGenerator.java new file mode 100644 index 0000000000..2740a52e76 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/core/SimpleReportGenerator.java @@ -0,0 +1,178 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Mar 6, 2006 by praveen + * + */ +package org.posterita.core; + +import java.util.Iterator; + +import org.posterita.exceptions.OperationException; +import com.lowagie.text.Chunk; +import com.lowagie.text.Document; +import com.lowagie.text.Element; +import com.lowagie.text.PageSize; +import com.lowagie.text.Paragraph; +import com.lowagie.text.Rectangle; +import com.lowagie.text.pdf.PdfPCell; +import com.lowagie.text.pdf.PdfPTable; + +public class SimpleReportGenerator extends PDFReportGenerator +{ + private PdfPTable table = null; + float[] columnWidth = null; + + public SimpleReportGenerator() + { + this.PAGE_SIZE = PageSize.A4.rotate(); + } + + protected void writeDocument(Document document) throws OperationException + { + int columnCount = 0; + + Object[] obj = null; + + Iterator iter = dataSource.iterator(); + + try + { + if(iter.hasNext()) + { + obj = (Object[]) iter.next(); + + columnCount = obj.length; + + table = new PdfPTable(columnCount); + + + for(int i = 0; i < columnCount; i++) + { + Paragraph p = new Paragraph(new Chunk(obj[i].toString(),HEADER_FONT)); + PdfPCell cell = new PdfPCell(p); + cell.setHorizontalAlignment(Element.ALIGN_CENTER); + + table.addCell(cell); + } + + //table.endHeaders(); + } + + while(iter.hasNext()) + { + obj = (Object[]) iter.next(); + + + for(int i = 0; i < columnCount; i++) + { + Paragraph p = new Paragraph(new Chunk(obj[i].toString(),HEADER_FONT)); + PdfPCell cell = new PdfPCell(p); + + table.addCell(cell); + } + } + + table.setWidths(columnWidth); + document.add(table); + } + catch (Exception e) + { + throw new OperationException(e); + } + } + + + protected Rectangle getDocumentDimension() + { + if(dataSource == null) return PAGE_SIZE; + + Iterator iter = dataSource.iterator(); + + int columnCount = 0; + + Object[] obj = null; + + if(iter.hasNext()) + { + obj = (Object[]) iter.next(); + + columnCount = obj.length; + columnWidth = new float[columnCount]; + + for(int i = 0; i < columnCount; i++) + { + columnWidth[i] = new Chunk(obj[i].toString(),HEADER_FONT).getWidthPoint(); + } + } + + while(iter.hasNext()) + { + obj = (Object[]) iter.next(); + + columnCount = obj.length; + + for(int i = 0; i < columnCount; i++) + { + if(obj[i] == null)obj[i] = ""; + + float dataWidth = new Chunk(obj[i].toString(),DATA_FONT).getWidthPoint(); + + if(dataWidth > columnWidth[i])columnWidth[i] = dataWidth; + } + } + + + float tableWidth = 0.0f; + + for(int j=0; j actualTableWidth) + { + float documentWidth = PAGE_SIZE.width(); + float documentHeight = PAGE_SIZE.height(); + + float newDocumentWidth = tableWidth + 2*MARGIN; + float newDocumentHeight = (documentHeight * newDocumentWidth)/documentWidth; + + return new Rectangle(newDocumentWidth,newDocumentHeight); + } + else + { + float scaleFactor = (actualTableWidth * tableWidth)/tableWidth; + + for(int k=0; k reportData = null; + private table tbl = new table(); + + private boolean sortable = false; + private String id = null; + private String[] headerStyle = null; + private String style = null; + private String title = null; + private String subtitle = null; + private Timestamp fromDate = null; + private Timestamp toDate = null; + + + public TabularReport(ArrayList reportData) + { + this.reportData = reportData; + } + + public TabularReport() + { + + } + + public void createReport() throws OperationException + { + + tbl = new table(); + tbl.addAttribute("border","0"); + tbl.addAttribute("width","100%"); + tbl.addAttribute("class","main"); + + td tdtitle = new td("" + title + ""); + td tdsubtitle = new td("" + subtitle + ""); + + tbl.addElement( + new tr().addElement(tdtitle.addAttribute("align","center")) + ); + + tbl.addElement( + new tr().addElement(tdsubtitle.addAttribute("align","center")) + ); + + tbl.addElement(new td(" ")); + + //////////////////////////////////////////////////////////////////////// + table displaytbl = new table(); + + if(reportData==null) + { + throw new OperationException("Cannot create tabular report: cause -> dataset empty!"); + } + + id = RandomStringGenerator.randomstring(); + + displaytbl.addAttribute("border","1"); + //displaytbl.addAttribute("width","100%"); + + String styleClass = (style == null) ? "" : style; + if(isSortable()) + { + styleClass = styleClass + " sortable"; + } + displaytbl.addAttribute("class",styleClass.trim()); + displaytbl.addAttribute("id",id); + + Iterator iter = reportData.iterator(); + Object[] headers = iter.next(); + + int columnCount = headers.length; + + tr r = new tr(); + + for(int i=0;i i)) + { + String style = headerStyle[i]+""; + h.addAttribute("class",style); + } + + r.addElement(h); + } + + displaytbl.addElement(r); + + int count = 0; + String[] s = {"label","contentname"}; + String tdStyle = ""; + + while(iter.hasNext()) + { + count++; + + tdStyle = s[count%2]; + + Object[] data = iter.next(); + tr rr = new tr(); + + for(int i=0;i" + title + ""); + td tdsubtitle = new td("" + subtitle + ""); + + tbl.addElement( + new tr().addElement(tdtitle.addAttribute("align","center")) + ); + + tbl.addElement( + new tr().addElement(tdsubtitle.addAttribute("align","center")) + ); + + tbl.addElement(new td(" ")); + + //////////////////////////////////////////////////////////////////////// + table displaytbl = new table(); + + if(reportData==null) + { + throw new OperationException("Cannot create tabular report: cause -> dataset empty!"); + } + + id = RandomStringGenerator.randomstring(); + + displaytbl.addAttribute("border","1"); + //displaytbl.addAttribute("width","100%"); + + String styleClass = (style == null) ? "" : style; + if(isSortable()) + { + styleClass = styleClass + " sortable"; + } + displaytbl.addAttribute("class",styleClass.trim()); + displaytbl.addAttribute("id",id); + + Iterator iter = reportData.iterator(); + Object[] headers = iter.next(); + + int columnCount = headers.length; + + tr r = new tr(); + + for(int i=0;i i)) + { + String style = headerStyle[i]+""; + h.addAttribute("class",style); + } + + r.addElement(h); + } + + displaytbl.addElement(r); + + int count = 0; + String[] s = {"label","contentname"}; + String tdStyle = ""; + int size = reportData.size(); + + + while(iter.hasNext()) + { + count++; + + tdStyle = s[count%2]; + + Object[] data = iter.next(); + + tr rr = new tr(); + for(int i=0;i2) + { + cellData = "" + data[i] + ""; + } + else + { + if (count == 1) + { + cellData = "" + data[i] + ""; + } + else + { + cellData = "" + data[i] + ""; + } + } + } + td d = new td(cellData); + d.addAttribute("class",tdStyle); + + rr.addElement(d); + } + + displaytbl.addElement(rr); + } + //////////////////////////////////////////////////////////////////////// + tbl.addElement(new tr().addElement(new td().addElement(displaytbl))); + } + + public void createReport(String action, Integer productId) throws OperationException + { + tbl = new table(); + tbl.addAttribute("border","0"); + tbl.addAttribute("width","100%"); + tbl.addAttribute("class","main"); + + td tdtitle = new td("" + title + ""); + td tdsubtitle = new td("" + subtitle + ""); + + tbl.addElement( + new tr().addElement(tdtitle.addAttribute("align","center")) + ); + + tbl.addElement( + new tr().addElement(tdsubtitle.addAttribute("align","center")) + ); + + tbl.addElement(new td(" ")); + + //////////////////////////////////////////////////////////////////////// + table displaytbl = new table(); + + if(reportData==null) + { + throw new OperationException("Cannot create tabular report: cause -> dataset empty!"); + } + + id = RandomStringGenerator.randomstring(); + + displaytbl.addAttribute("border","1"); + //displaytbl.addAttribute("width","100%"); + + String styleClass = (style == null) ? "" : style; + if(isSortable()) + { + styleClass = styleClass + " sortable"; + } + displaytbl.addAttribute("class",styleClass.trim()); + displaytbl.addAttribute("id",id); + + Iterator iter = reportData.iterator(); + Object[] headers = iter.next(); + + int columnCount = headers.length; + + tr r = new tr(); + + for(int i=0;i i)) + { + String style = headerStyle[i]+""; + h.addAttribute("class",style); + } + + r.addElement(h); + } + + displaytbl.addElement(r); + + int count = 0; + String[] s = {"label","contentname"}; + String tdStyle = ""; + + int size = reportData.size(); + while(iter.hasNext()) + { + + tdStyle = s[count%2]; + + Object[] data = iter.next(); + tr rr = new tr(); + + String date = data[0].toString(); + String month = ""; + String[] dateSplit = date.split(" "); + + + if (dateSplit != null) + { + month= dateSplit[0]; + } + DateFormatSymbols dfs = new DateFormatSymbols(Locale.ENGLISH); + int mon = 0; + int yr = 0; + + if (count < size-1) + { + yr = Integer.parseInt(dateSplit[1]); + + String[] monthName = dfs.getMonths(); + for (int i = 0; i" + data[i] + ""; + } + if (i == 2 && ! (qty == 0f)) + { + cellData = "" + data[i] + ""; + } + if (i == 3) + { + cellData = "" + data[i] + ""; + } + } + + td d = new td(cellData); + d.addAttribute("class",tdStyle); + + rr.addElement(d); + displaytbl.addElement(rr); + } + count++; + + } + + //////////////////////////////////////////////////////////////////////// + tbl.addElement(new tr().addElement(new td().addElement(displaytbl))); + + } + + public String createPDFReport() throws DocumentException, FileNotFoundException + { + String filename = RandomStringGenerator.randomstring() + ".pdf"; + String filepath = ReportManager.getReportPath(filename); + + FileOutputStream fos = new FileOutputStream(filepath); + + Document document = new Document(PageSize.A4); + PdfWriter pdfWriter = PdfWriter.getInstance(document, fos); + + document.open(); + + Font style1 = new Font(Font.HELVETICA, 16.0f, Font.BOLD); + Font style2 = new Font(Font.HELVETICA, 12.0f); + //write content + Paragraph p = new Paragraph(new Chunk(title, style1)); + p.setAlignment(Element.ALIGN_CENTER); + document.add(p); + + p = new Paragraph(new Chunk(subtitle, style2)); + p.setAlignment(Element.ALIGN_CENTER); + document.add(p); + + p = new Paragraph("\n\n"); + document.add(p); + + Object[] headers = reportData.get(0); + + PdfPTable table = new PdfPTable(headers.length); + for(Object[] row : reportData) + { + for(Object data : row) + { + PdfPCell cell = new PdfPCell(new Phrase(data.toString())); + table.addCell(cell); + } + } + + document.add(table); + document.close(); + + + return filename; + } + + public byte[] getPDFData() throws DocumentException + { + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + + Document document = new Document(PageSize.A4); + PdfWriter pdfWriter = PdfWriter.getInstance(document, bos); + + document.open(); + + // Font Syle + Font style1 = new Font(Font.TIMES_ROMAN, 12.0f, Font.BOLD); + Font style2 = new Font(Font.TIMES_ROMAN, 8.0f, Font.BOLD); + Font style3 = new Font(Font.TIMES_ROMAN, 8.0f); + Font style4 = new Font(Font.TIMES_ROMAN, 9.0f, Font.BOLD); + float[] widths = { 2f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f}; + + // Table header + PdfPTable mytable = new PdfPTable(7); + mytable.setTotalWidth(widths); + mytable.setWidthPercentage(100f); + PdfPCell header = new PdfPCell(new Paragraph(getTitle() + "\n" + getSubtitle(), style1)); + header.setColspan(7); + header.setHorizontalAlignment(Element.ALIGN_CENTER); + header.setBackgroundColor(new Color(0xC0, 0xC0, 0xC0)); + mytable.addCell(header); + + // Table sub header + PdfPCell subheader = new PdfPCell(); + subheader = new PdfPCell(new Paragraph("")); + mytable.addCell(subheader); + + subheader = new PdfPCell(new Paragraph("QUANTITY", style2)); + subheader.setColspan(2); + subheader.setHorizontalAlignment(Element.ALIGN_CENTER); + mytable.addCell(subheader); + + subheader = new PdfPCell(new Paragraph("VALUE (Excl. VAT)", style2)); + subheader.setColspan(2); + subheader.setHorizontalAlignment(Element.ALIGN_CENTER); + mytable.addCell(subheader); + + subheader = new PdfPCell(new Paragraph("DISCREPANCY", style2)); + subheader.setColspan(2); + subheader.setHorizontalAlignment(Element.ALIGN_CENTER); + mytable.addCell(subheader); + + // Rows Header + PdfPCell rowHeader = new PdfPCell(new Paragraph("PRODUCT NAME",style4)); + rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); + mytable.addCell(rowHeader); + + rowHeader = new PdfPCell(new Paragraph("BOOK", style4)); + rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); + mytable.addCell(rowHeader); + + rowHeader = new PdfPCell(new Paragraph("COUNT", style4)); + rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); + mytable.addCell(rowHeader); + + rowHeader = new PdfPCell(new Paragraph("BOOK", style4)); + rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); + mytable.addCell(rowHeader); + + rowHeader = new PdfPCell(new Paragraph("COUNT", style4)); + rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); + mytable.addCell(rowHeader); + + rowHeader = new PdfPCell(new Paragraph("QTY", style4)); + rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); + mytable.addCell(rowHeader); + + rowHeader = new PdfPCell(new Paragraph("VALUE", style4)); + rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); + mytable.addCell(rowHeader); + + document.add(mytable); + + + Object[] headers = reportData.get(0); + + PdfPTable table = new PdfPTable(headers.length); + + table.setTotalWidth(widths); + table.setWidthPercentage(100f); + for(Object[] row : reportData) + { + + for(Object data : row) + { + PdfPCell dataCell = new PdfPCell(new Phrase(data.toString(), style3)); + table.addCell(dataCell); + } + } + + document.add(table); + document.close(); + + return bos.toByteArray(); + } + + /** + * Get Selling Items Data + * @return + * @throws DocumentException + * @throws OperationException + */ + public byte[] getSellingItemsData() throws DocumentException, OperationException + { + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + + Document document = new Document(PageSize.A4); + PdfWriter pdfWriter = PdfWriter.getInstance(document, bos); + + document.open(); + + // Font Syle + Font style1 = new Font(Font.TIMES_ROMAN, 12.0f, Font.BOLD); + Font style2 = new Font(Font.TIMES_ROMAN, 8.0f, Font.BOLD); + Font style3 = new Font(Font.TIMES_ROMAN, 8.0f); + Font style4 = new Font(Font.TIMES_ROMAN, 9.0f, Font.BOLD); + Font style5 = new Font(Font.TIMES_ROMAN, 6.0f); + float[] widths = { 2f, 0.5f, 0.5f, 1.0f}; + + // Table header + PdfPTable mytable = new PdfPTable(4); + mytable.setTotalWidth(widths); + mytable.setWidthPercentage(100f); + PdfPCell header = new PdfPCell(new Paragraph(new Chunk(getTitle(), style1) + "\n" + new Chunk(getSubtitle(), style2) + "\n", style1)); + header.setColspan(4); + header.setHorizontalAlignment(Element.ALIGN_CENTER); + header.setBackgroundColor(new Color(0xC0, 0xC0, 0xC0)); + mytable.addCell(header); + + //Date Header + PdfPCell dateHeader = new PdfPCell(new Paragraph("From : " + new Chunk(TimestampConvertor.convertTimeStampToFyracleDate(fromDate), style1), style1)); + dateHeader.setColspan(1); + dateHeader.setHorizontalAlignment(Element.ALIGN_LEFT); + dateHeader.setBackgroundColor(Color.GRAY); + dateHeader.setBorderColor(Color.WHITE); + mytable.addCell(dateHeader); + + dateHeader = new PdfPCell(new Paragraph("To : " +new Chunk(TimestampConvertor.convertTimeStampToFyracleDate(toDate), style1), style1)); + dateHeader.setColspan(3); + dateHeader.setHorizontalAlignment(Element.ALIGN_LEFT); + dateHeader.setBackgroundColor(Color.GRAY); + dateHeader.setBorderColor(Color.WHITE); + mytable.addCell(dateHeader); + + // Info Header + PdfPCell infoHeader = new PdfPCell(new Paragraph("ALL VALUES ARE EXCLUSIVE OF VAT - SALES FIGURES ARE TAKEN AFTER DISCOUNT", style5)); + infoHeader.setColspan(4); + infoHeader.setHorizontalAlignment(Element.ALIGN_CENTER); + infoHeader.setBackgroundColor(new Color(0xC0, 0xC0, 0xC0)); + mytable.addCell(infoHeader); + + // Rows Header + PdfPCell rowHeader = new PdfPCell(new Paragraph("PRODUCT NAME",style4)); + rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); + mytable.addCell(rowHeader); + + + rowHeader = new PdfPCell(new Paragraph("QTY", style4)); + rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); + mytable.addCell(rowHeader); + + rowHeader = new PdfPCell(new Paragraph("VALUE", style4)); + rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); + mytable.addCell(rowHeader); + + rowHeader = new PdfPCell(new Paragraph("SUPPLIER", style4)); + rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); + mytable.addCell(rowHeader); + + document.add(mytable); + + + Object[] headers = reportData.get(0); + + PdfPTable table = new PdfPTable(headers.length); + + table.setTotalWidth(widths); + table.setWidthPercentage(100f); + for(Object[] row : reportData) + { + + for(Object data : row) + { + PdfPCell dataCell = new PdfPCell(new Phrase(data.toString(), style3)); + table.addCell(dataCell); + } + } + + document.add(table); + document.close(); + + return bos.toByteArray(); + } + + /** + * Get Stock Enquiry Report Data + * @return + * @throws DocumentException + * @throws OperationException + */ + public byte[] getStockEnquiryData() throws DocumentException, OperationException + { + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + + Document document = new Document(PageSize.A4); + PdfWriter pdfWriter = PdfWriter.getInstance(document, bos); + + document.open(); + + // Font Syle + Font style1 = new Font(Font.TIMES_ROMAN, 12.0f, Font.BOLD); + Font style2 = new Font(Font.TIMES_ROMAN, 8.0f, Font.BOLD); + Font style3 = new Font(Font.TIMES_ROMAN, 8.0f); + Font style4 = new Font(Font.TIMES_ROMAN, 7.0f, Font.BOLD); + Font style5 = new Font(Font.TIMES_ROMAN, 6.0f); + float[] widths = { 1f, 2f, 0.5f, 0.5f, 0.5f, 0.5f }; + + // Table header + PdfPTable mytable = new PdfPTable(6); + mytable.setTotalWidth(widths); + mytable.setWidthPercentage(100f); + PdfPCell header = new PdfPCell(new Paragraph(new Chunk(title, style1) + "\n" + new Chunk(subtitle, style2) + "\n", style1)); + header.setColspan(6); + header.setHorizontalAlignment(Element.ALIGN_CENTER); + header.setBackgroundColor(new Color(0xC0, 0xC0, 0xC0)); + mytable.addCell(header); + + //Date Header + PdfPCell dateHeader = new PdfPCell(new Paragraph("From : " + new Chunk(TimestampConvertor.convertTimeStampToFyracleDate(fromDate), style1), style1)); + dateHeader.setColspan(2); + dateHeader.setHorizontalAlignment(Element.ALIGN_LEFT); + dateHeader.setBackgroundColor(Color.GRAY); + dateHeader.setBorderColor(Color.WHITE); + mytable.addCell(dateHeader); + + dateHeader = new PdfPCell(new Paragraph("To : " + new Chunk(TimestampConvertor.convertTimeStampToFyracleDate(toDate), style1), style1)); + dateHeader.setColspan(4); + dateHeader.setHorizontalAlignment(Element.ALIGN_LEFT); + dateHeader.setBackgroundColor(Color.GRAY); + dateHeader.setBorderColor(Color.WHITE); + mytable.addCell(dateHeader); + + // Info Header + PdfPCell infoHeader = new PdfPCell(new Paragraph("ALL VALUES ARE EXCLUSIVE OF VAT & BASED ON PURCHASE PRICES", style5)); + infoHeader.setColspan(6); + infoHeader.setHorizontalAlignment(Element.ALIGN_CENTER); + infoHeader.setBackgroundColor(new Color(0xC0, 0xC0, 0xC0)); + mytable.addCell(infoHeader); + + // Rows Header + PdfPCell rowHeader = new PdfPCell(new Paragraph("BARCODE",style4)); + rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); + mytable.addCell(rowHeader); + + rowHeader = new PdfPCell(new Paragraph("PRODUCT NAME", style4)); + rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); + mytable.addCell(rowHeader); + + + rowHeader = new PdfPCell(new Paragraph("Opening Stock Qty", style4)); + rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); + mytable.addCell(rowHeader); + + rowHeader = new PdfPCell(new Paragraph("Opening Stock Value", style4)); + rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); + mytable.addCell(rowHeader); + + rowHeader = new PdfPCell(new Paragraph("Closing Stock Qty", style4)); + rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); + mytable.addCell(rowHeader); + + rowHeader = new PdfPCell(new Paragraph("Closing Stock Value", style4)); + rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); + mytable.addCell(rowHeader); + + document.add(mytable); + + + Object[] headers = reportData.get(0); + + PdfPTable table = new PdfPTable(headers.length); + + table.setTotalWidth(widths); + table.setWidthPercentage(100f); + for(Object[] row : reportData) + { + + for(Object data : row) + { + PdfPCell dataCell = new PdfPCell(new Phrase(data.toString(), style3)); + table.addCell(dataCell); + } + } + + document.add(table); + document.close(); + + return bos.toByteArray(); + } + + public byte[] getInventoryData() throws DocumentException + { + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + + Document document = new Document(PageSize.A4); + PdfWriter pdfWriter = PdfWriter.getInstance(document, bos); + + document.open(); + + // Font Syle + Font style1 = new Font(Font.TIMES_ROMAN, 12.0f, Font.BOLD); + Font style2 = new Font(Font.TIMES_ROMAN, 8.0f, Font.BOLD); + Font style3 = new Font(Font.TIMES_ROMAN, 8.0f); + Font style4 = new Font(Font.TIMES_ROMAN, 8.0f, Font.BOLD); + float[] widths = { 1f, 1f, 0.55f, 0.55f, 0.55f, 1f, 1f, 1f, 1f}; + + // Table header + PdfPTable mytable = new PdfPTable(9); + mytable.setTotalWidth(widths); + mytable.setWidthPercentage(100f); + PdfPCell header = new PdfPCell(new Paragraph(getTitle() + "\n" + getSubtitle(), style1)); + header.setColspan(9); + header.setHorizontalAlignment(Element.ALIGN_CENTER); + header.setBackgroundColor(new Color(0xC0, 0xC0, 0xC0)); + mytable.addCell(header); + + // Table sub header + PdfPCell subheader = new PdfPCell(); + subheader = new PdfPCell(new Paragraph("")); + subheader.setColspan(2); + mytable.addCell(subheader); + + subheader = new PdfPCell(new Paragraph("QUANTITY", style2)); + subheader.setColspan(3); + subheader.setHorizontalAlignment(Element.ALIGN_CENTER); + mytable.addCell(subheader); + + subheader = new PdfPCell(new Paragraph("VALUE (Excl. VAT)", style2)); + subheader.setColspan(2); + subheader.setHorizontalAlignment(Element.ALIGN_CENTER); + mytable.addCell(subheader); + + subheader = new PdfPCell(new Paragraph("DIFFERENCE", style2)); + subheader.setColspan(2); + subheader.setHorizontalAlignment(Element.ALIGN_CENTER); + mytable.addCell(subheader); + + // Rows Header + PdfPCell rowHeader = new PdfPCell(new Paragraph("BARCODE",style4)); + rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); + mytable.addCell(rowHeader); + + rowHeader = new PdfPCell(new Paragraph("PRODUCT", style4)); + rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); + mytable.addCell(rowHeader); + + + rowHeader = new PdfPCell(new Paragraph("CSV", style4)); + rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); + mytable.addCell(rowHeader); + + rowHeader = new PdfPCell(new Paragraph("BOOK", style4)); + rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); + mytable.addCell(rowHeader); + + rowHeader = new PdfPCell(new Paragraph("COUNT", style4)); + rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); + mytable.addCell(rowHeader); + + rowHeader = new PdfPCell(new Paragraph("BOOK", style4)); + rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); + mytable.addCell(rowHeader); + + rowHeader = new PdfPCell(new Paragraph("COUNT", style4)); + rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); + mytable.addCell(rowHeader); + + rowHeader = new PdfPCell(new Paragraph("QUANTITY", style4)); + rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); + mytable.addCell(rowHeader); + + rowHeader = new PdfPCell(new Paragraph("VALUE (Excl. VAT)", style4)); + rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); + mytable.addCell(rowHeader); + + document.add(mytable); + + Object[] headers = reportData.get(0); + + PdfPTable table = new PdfPTable(headers.length); + + table.setTotalWidth(widths); + table.setWidthPercentage(100f); + for(Object[] row : reportData) + { + + for(Object data : row) + { + PdfPCell dataCell = new PdfPCell(new Phrase(data.toString(), style3)); + table.addCell(dataCell); + } + } + + document.add(table); + document.close(); + + return bos.toByteArray(); + } + + public String toString() + { + return tbl.toString(); + } + + public void getDataFromSQL(Properties ctx,String sql) throws OperationException + { + reportData = ReportManager.getReportData(ctx,sql); + } + + public ArrayList getReportData() { + return reportData; + } + + public void setReportData(ArrayList reportData) { + this.reportData = reportData; + } + + public table getTable() { + return tbl; + } + + public String[] getHeaderStyle() { + return headerStyle; + } + + public void setHeaderStyle(String[] headerStyle) { + this.headerStyle = headerStyle; + } + + public boolean isSortable() { + return sortable; + } + + public void setSortable(boolean sortable) { + this.sortable = sortable; + } + + public String getStyle() { + return style; + } + + public void setStyle(String style) { + this.style = style; + } + + public String getSubtitle() { + return subtitle; + } + + public void setSubtitle(String subtitle) { + this.subtitle = subtitle; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public Timestamp getFromDate() { + return fromDate; + } + + public void setFromDate(Timestamp fromDate) { + this.fromDate = fromDate; + } + + public Timestamp getToDate() { + return toDate; + } + + public void setToDate(Timestamp toDate) { + this.toDate = toDate; + } + + +} diff --git a/posterita/posterita/src/main/org/posterita/core/TabularReport2.java b/posterita/posterita/src/main/org/posterita/core/TabularReport2.java new file mode 100644 index 0000000000..d10b77bd01 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/core/TabularReport2.java @@ -0,0 +1,472 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * 31-Jul-2006 12:07:35 by praveen + * + */ + +package org.posterita.core; + +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.math.BigDecimal; +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.Properties; + +import org.apache.ecs.xhtml.table; +import org.apache.ecs.xhtml.td; +import org.apache.ecs.xhtml.th; +import org.apache.ecs.xhtml.tr; +import org.posterita.businesslogic.performanceanalysis.ReportManager; +import org.posterita.exceptions.OperationException; + +import com.lowagie.text.Chunk; +import com.lowagie.text.Document; +import com.lowagie.text.DocumentException; +import com.lowagie.text.Element; +import com.lowagie.text.Font; +import com.lowagie.text.PageSize; +import com.lowagie.text.Paragraph; +import com.lowagie.text.Phrase; +import com.lowagie.text.pdf.PdfPCell; +import com.lowagie.text.pdf.PdfPTable; +import com.lowagie.text.pdf.PdfWriter; + +public class TabularReport2 +{ + private ArrayList reportData = null; + private table tbl = new table(); + + private boolean sortable = false; + private String id = null; + private String[] headerStyle = null; + private String style = null; + private String title = null; + private String subtitle = null; + private Timestamp fromDate = null; + private Timestamp toDate = null; + private boolean isSalesReport = false; + private boolean fullDetails = false; + + public TabularReport2(ArrayList reportData) + { + this.reportData = reportData; + } + + public TabularReport2() + { + + } + + public void createReport() throws OperationException + { + + tbl = new table(); + tbl.addAttribute("border","0"); + tbl.addAttribute("width","100%"); + tbl.addAttribute("class","main"); + + td tdtitle = new td("" + title + ""); + td tdsubtitle = new td("" + subtitle + ""); + + tbl.addElement( + new tr().addElement(tdtitle.addAttribute("align","center")) + ); + + tbl.addElement( + new tr().addElement(tdsubtitle.addAttribute("align","center")) + ); + + tbl.addElement(new td(" ")); + + //////////////////////////////////////////////////////////////////////// + table displaytbl = new table(); + + if(reportData==null) + { + throw new OperationException("Cannot create tabular report: cause -> dataset empty!"); + } + + id = RandomStringGenerator.randomstring(); + + displaytbl.addAttribute("border","1"); + //displaytbl.addAttribute("width","100%"); + + String styleClass = (style == null) ? "" : style; + if(isSortable()) + { + styleClass = styleClass + " sortable"; + } + displaytbl.addAttribute("class",styleClass.trim()); + displaytbl.addAttribute("id",id); + + Iterator iter = reportData.iterator(); + Object[] headers = iter.next(); + + int columnCount = headers.length; + + tr r = new tr(); + + for(int i=0;i i)) + { + String style = headerStyle[i]+""; + h.addAttribute("class",style); + } + + r.addElement(h); + } + + displaytbl.addElement(r); + + int count = 0; + String[] s = {"label","contentname"}; + String tdStyle = ""; + + String date1 = ""; + String date2 = ""; + String temp1 = ""; + String temp2 = ""; + + while(iter.hasNext()) + { + count++; + + tdStyle = s[count%2]; + + Object[] data = iter.next(); + tr rr = new tr(); + + if (count == 1) + { + temp1 = data[0].toString(); + } + if (count == reportData.size() - 2) + { + temp2 = data[0].toString(); + } + date2 = date1 = data[0].toString(); + + if(count == reportData.size()-1) + { + date1 = temp1; + date2 = temp2; + } + + for(int i=0;i0 && i<5) + { + if (data[i]!=null) + { + qty = Double.valueOf(data[i].toString()); + } + if (qty != 0.0) + { + cellData = "" + data[i] + ""; + } + } + + + td d = new td(cellData); + + if(count == reportData.size()-1) + { + d.setAlign("left"); + } + + d.addAttribute("class",tdStyle); + + rr.addElement(d); + } + + displaytbl.addElement(rr); + } + //////////////////////////////////////////////////////////////////////// + tbl.addElement(new tr().addElement(new td().addElement(displaytbl))); + + } + + public void createReport(String action) throws OperationException + { + tbl = new table(); + tbl.addAttribute("border","0"); + tbl.addAttribute("width","100%"); + tbl.addAttribute("class","main"); + + td tdtitle = new td("" + title + ""); + td tdsubtitle = new td("" + subtitle + ""); + + tbl.addElement( + new tr().addElement(tdtitle.addAttribute("align","center")) + ); + + tbl.addElement( + new tr().addElement(tdsubtitle.addAttribute("align","center")) + ); + + tbl.addElement(new td(" ")); + + //////////////////////////////////////////////////////////////////////// + table displaytbl = new table(); + + if(reportData==null) + { + throw new OperationException("Cannot create tabular report: cause -> dataset empty!"); + } + + id = RandomStringGenerator.randomstring(); + + displaytbl.addAttribute("border","1"); + //displaytbl.addAttribute("width","100%"); + + String styleClass = (style == null) ? "" : style; + if(isSortable()) + { + styleClass = styleClass + " sortable"; + } + displaytbl.addAttribute("class",styleClass.trim()); + displaytbl.addAttribute("id",id); + + Iterator iter = reportData.iterator(); + Object[] headers = iter.next(); + + int columnCount = headers.length; + + tr r = new tr(); + + for(int i=0;i i)) + { + String style = headerStyle[i]+""; + h.addAttribute("class",style); + } + + r.addElement(h); + } + + displaytbl.addElement(r); + + int count = 0; + String[] s = {"label","contentname"}; + String tdStyle = ""; + + while(iter.hasNext()) + { + count++; + + tdStyle = s[count%2]; + + Object[] data = iter.next(); + tr rr = new tr(); + + for(int i=0;i 0 && i < 5) + { + cellData = " getReportData() { + return reportData; + } + + public void setReportData(ArrayList reportData) { + this.reportData = reportData; + } + + public table getTable() { + return tbl; + } + + public String[] getHeaderStyle() { + return headerStyle; + } + + public void setHeaderStyle(String[] headerStyle) { + this.headerStyle = headerStyle; + } + + public boolean isSortable() { + return sortable; + } + + public void setSortable(boolean sortable) { + this.sortable = sortable; + } + + public String getStyle() { + return style; + } + + public void setStyle(String style) { + this.style = style; + } + + public String getSubtitle() { + return subtitle; + } + + public void setSubtitle(String subtitle) { + this.subtitle = subtitle; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public Timestamp getFromDate() { + return fromDate; + } + + public void setFromDate(Timestamp fromDate) { + this.fromDate = fromDate; + } + + public Timestamp getToDate() { + return toDate; + } + + public void setToDate(Timestamp toDate) { + this.toDate = toDate; + } + + public boolean isSalesReport() + { + return isSalesReport; + } + + public void setSalesReport(boolean isSalesReport) + { + this.isSalesReport = isSalesReport; + } + + public boolean isFullDetails() + { + return fullDetails; + } + + public void setFullDetails(boolean fullDetails) + { + this.fullDetails = fullDetails; + } + + +} diff --git a/posterita/posterita/src/main/org/posterita/core/TabularReportMerge.java b/posterita/posterita/src/main/org/posterita/core/TabularReportMerge.java new file mode 100644 index 0000000000..d3293199ea --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/core/TabularReportMerge.java @@ -0,0 +1,633 @@ +package org.posterita.core; + +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * 31-Jul-2006 12:07:35 by praveen + * + */ + +import java.awt.Color; +import java.io.ByteArrayOutputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.Properties; + +import org.apache.ecs.xhtml.div; +import org.apache.ecs.xhtml.table; +import org.apache.ecs.xhtml.td; +import org.apache.ecs.xhtml.th; +import org.apache.ecs.xhtml.tr; +import org.posterita.Constants; +import org.posterita.businesslogic.performanceanalysis.ReportManager; +import org.posterita.exceptions.OperationException; + +import com.lowagie.text.Chunk; +import com.lowagie.text.Document; +import com.lowagie.text.DocumentException; +import com.lowagie.text.Element; +import com.lowagie.text.Font; +import com.lowagie.text.PageSize; +import com.lowagie.text.Paragraph; +import com.lowagie.text.Phrase; +import com.lowagie.text.pdf.PdfPCell; +import com.lowagie.text.pdf.PdfPTable; +import com.lowagie.text.pdf.PdfWriter; + +public class TabularReportMerge +{ + private ArrayList reportData = null; + private table bigTable; + private div contain; + private tr bigRow; + private boolean sortable = false; + private String id = null; + private String[] headerStyle = null; + private String style = null; + private String title = null; + private String subtitle = null; + private Timestamp fromDate = null; + private Timestamp toDate = null; + private int screenWidth = 1024; + public TabularReportMerge(ArrayList reportData) + { + this.reportData = reportData; + } + + public TabularReportMerge(String title, int colspan) + { + bigTable = new table(); + bigRow = new tr(); + setTitle(title, colspan); + bigTable.addElement(bigRow); + contain = new div(); + contain.setStyle("width:" + screenWidth + ";overflow:auto;"); + contain.addElement(bigTable); + } + + public void createReport(ArrayList reportData, int type, String subtitle) throws OperationException + { + table tbl = new table(); + tbl.addAttribute("border","0"); + tbl.addAttribute("width","100%"); + tbl.addAttribute("class","main"); + + + td tdsubtitle = new td("" + subtitle + ""); + + + + tbl.addElement( + new tr().addElement(tdsubtitle.addAttribute("align","center")) + ); + + tbl.addElement(new td(" ")); + + //////////////////////////////////////////////////////////////////////// + table displaytbl = new table(); + + if(reportData==null) + { + throw new OperationException("Cannot create tabular report: cause -> dataset empty!"); + } + + id = RandomStringGenerator.randomstring(); + + displaytbl.addAttribute("border","1"); + //displaytbl.addAttribute("width","100%"); + + String styleClass = (style == null) ? "" : style; + if(isSortable()) + { + styleClass = styleClass + " sortable"; + } + displaytbl.addAttribute("class",styleClass.trim()); + displaytbl.addAttribute("id",id); + + Iterator iter = reportData.iterator(); + Object[] headers = iter.next(); + + int columnCount = headers.length; + + tr r = new tr(); + + for(int i=0;i i)) + { + String style = headerStyle[i]+""; + h.addAttribute("class",style); + } + + r.addElement(h); + } + + displaytbl.addElement(r); + + int count = 0; + String[] s = {"label","contentname"}; + String tdStyle = ""; + + while(iter.hasNext()) + { + count++; + + tdStyle = s[count%2]; + + Object[] data = iter.next(); + tr rr = new tr(); + String productName=""; + for(int i=0;i" + data[i] + ""; + } + else if (type == Constants.STOCK_TYPE) + { + total = "" + data[i] + ""; + } + d = new td(total); + } + d.addAttribute("class",tdStyle); + + rr.addElement(d); + } + + displaytbl.addElement(rr); + } + //////////////////////////////////////////////////////////////////////// + tbl.addElement(new tr().addElement(new td().addElement(displaytbl))); + + bigRow.addElement(new td().addElement(tbl)); + + } + + public String createPDFReport() throws DocumentException, FileNotFoundException + { + String filename = RandomStringGenerator.randomstring() + ".pdf"; + String filepath = ReportManager.getReportPath(filename); + + FileOutputStream fos = new FileOutputStream(filepath); + + Document document = new Document(PageSize.A4); + PdfWriter pdfWriter = PdfWriter.getInstance(document, fos); + + document.open(); + + Font style1 = new Font(Font.HELVETICA, 16.0f, Font.BOLD); + Font style2 = new Font(Font.HELVETICA, 12.0f); + //write content + Paragraph p = new Paragraph(new Chunk(title, style1)); + p.setAlignment(Element.ALIGN_CENTER); + document.add(p); + + p = new Paragraph(new Chunk(subtitle, style2)); + p.setAlignment(Element.ALIGN_CENTER); + document.add(p); + + p = new Paragraph("\n\n"); + document.add(p); + + Object[] headers = reportData.get(0); + + PdfPTable table = new PdfPTable(headers.length); + for(Object[] row : reportData) + { + for(Object data : row) + { + PdfPCell cell = new PdfPCell(new Phrase(data.toString())); + table.addCell(cell); + } + } + + document.add(table); + document.close(); + + + return filename; + } + + public byte[] getPDFData() throws DocumentException + { + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + + Document document = new Document(PageSize.A4); + PdfWriter pdfWriter = PdfWriter.getInstance(document, bos); + + document.open(); + + // Font Syle + Font style1 = new Font(Font.TIMES_ROMAN, 12.0f, Font.BOLD); + Font style2 = new Font(Font.TIMES_ROMAN, 8.0f, Font.BOLD); + Font style3 = new Font(Font.TIMES_ROMAN, 8.0f); + Font style4 = new Font(Font.TIMES_ROMAN, 9.0f, Font.BOLD); + float[] widths = { 2f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f}; + + // Table header + PdfPTable mytable = new PdfPTable(7); + mytable.setTotalWidth(widths); + mytable.setWidthPercentage(100f); + PdfPCell header = new PdfPCell(new Paragraph(new Chunk(title, style1) + "\n" + new Chunk(subtitle, style2) + "\n", style1)); + header.setColspan(7); + header.setHorizontalAlignment(Element.ALIGN_CENTER); + header.setBackgroundColor(new Color(0xC0, 0xC0, 0xC0)); + mytable.addCell(header); + + // Table sub header + PdfPCell subheader = new PdfPCell(); + subheader = new PdfPCell(new Paragraph("")); + mytable.addCell(subheader); + + subheader = new PdfPCell(new Paragraph("QUANTITY", style2)); + subheader.setColspan(2); + subheader.setHorizontalAlignment(Element.ALIGN_CENTER); + mytable.addCell(subheader); + + subheader = new PdfPCell(new Paragraph("VALUE (Excl. VAT)", style2)); + subheader.setColspan(2); + subheader.setHorizontalAlignment(Element.ALIGN_CENTER); + mytable.addCell(subheader); + + subheader = new PdfPCell(new Paragraph("DISCREPANCY", style2)); + subheader.setColspan(2); + subheader.setHorizontalAlignment(Element.ALIGN_CENTER); + mytable.addCell(subheader); + + // Rows Header + PdfPCell rowHeader = new PdfPCell(new Paragraph("PRODUCT NAME",style4)); + rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); + mytable.addCell(rowHeader); + + rowHeader = new PdfPCell(new Paragraph("BOOK", style4)); + rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); + mytable.addCell(rowHeader); + + rowHeader = new PdfPCell(new Paragraph("COUNT", style4)); + rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); + mytable.addCell(rowHeader); + + rowHeader = new PdfPCell(new Paragraph("BOOK", style4)); + rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); + mytable.addCell(rowHeader); + + rowHeader = new PdfPCell(new Paragraph("COUNT", style4)); + rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); + mytable.addCell(rowHeader); + + rowHeader = new PdfPCell(new Paragraph("QTY", style4)); + rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); + mytable.addCell(rowHeader); + + rowHeader = new PdfPCell(new Paragraph("VALUE", style4)); + rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); + mytable.addCell(rowHeader); + + document.add(mytable); + + + Object[] headers = reportData.get(0); + + PdfPTable table = new PdfPTable(headers.length); + + table.setTotalWidth(widths); + table.setWidthPercentage(100f); + for(Object[] row : reportData) + { + + for(Object data : row) + { + PdfPCell dataCell = new PdfPCell(new Phrase(data.toString(), style3)); + table.addCell(dataCell); + } + } + + document.add(table); + document.close(); + + return bos.toByteArray(); + } + + /** + * Get Selling Items Data + * @return + * @throws DocumentException + * @throws OperationException + */ + public byte[] getSellingItemsData() throws DocumentException, OperationException + { + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + + Document document = new Document(PageSize.A4); + PdfWriter pdfWriter = PdfWriter.getInstance(document, bos); + + document.open(); + + // Font Syle + Font style1 = new Font(Font.TIMES_ROMAN, 12.0f, Font.BOLD); + Font style2 = new Font(Font.TIMES_ROMAN, 8.0f, Font.BOLD); + Font style3 = new Font(Font.TIMES_ROMAN, 8.0f); + Font style4 = new Font(Font.TIMES_ROMAN, 9.0f, Font.BOLD); + Font style5 = new Font(Font.TIMES_ROMAN, 6.0f); + float[] widths = { 2f, 0.5f, 0.5f, 1.0f}; + + // Table header + PdfPTable mytable = new PdfPTable(4); + mytable.setTotalWidth(widths); + mytable.setWidthPercentage(100f); + PdfPCell header = new PdfPCell(new Paragraph(new Chunk(title, style1) + "\n" + new Chunk(subtitle, style2) + "\n", style1)); + header.setColspan(4); + header.setHorizontalAlignment(Element.ALIGN_CENTER); + header.setBackgroundColor(new Color(0xC0, 0xC0, 0xC0)); + mytable.addCell(header); + + //Date Header + PdfPCell dateHeader = new PdfPCell(new Paragraph("From : " + new Chunk(TimestampConvertor.convertTimeStamp(fromDate, TimestampConvertor.DEFAULT_DATE_PATTERN1), style1), style1)); + dateHeader.setColspan(1); + dateHeader.setHorizontalAlignment(Element.ALIGN_LEFT); + dateHeader.setBackgroundColor(Color.GRAY); + dateHeader.setBorderColor(Color.WHITE); + mytable.addCell(dateHeader); + + dateHeader = new PdfPCell(new Paragraph("To : " + new Chunk(TimestampConvertor.convertTimeStamp(toDate, TimestampConvertor.DEFAULT_DATE_PATTERN1), style1), style1)); + dateHeader.setColspan(3); + dateHeader.setHorizontalAlignment(Element.ALIGN_LEFT); + dateHeader.setBackgroundColor(Color.GRAY); + dateHeader.setBorderColor(Color.WHITE); + mytable.addCell(dateHeader); + + // Info Header + PdfPCell infoHeader = new PdfPCell(new Paragraph("ALL VALUES ARE EXCLUSIVE OF VAT - SALES FIGURES ARE TAKEN AFTER DISCOUNT", style5)); + infoHeader.setColspan(4); + infoHeader.setHorizontalAlignment(Element.ALIGN_CENTER); + infoHeader.setBackgroundColor(new Color(0xC0, 0xC0, 0xC0)); + mytable.addCell(infoHeader); + + // Rows Header + PdfPCell rowHeader = new PdfPCell(new Paragraph("PRODUCT NAME",style4)); + rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); + mytable.addCell(rowHeader); + + + rowHeader = new PdfPCell(new Paragraph("QTY", style4)); + rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); + mytable.addCell(rowHeader); + + rowHeader = new PdfPCell(new Paragraph("VALUE", style4)); + rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); + mytable.addCell(rowHeader); + + rowHeader = new PdfPCell(new Paragraph("SUPPLIER", style4)); + rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); + mytable.addCell(rowHeader); + + document.add(mytable); + + + Object[] headers = reportData.get(0); + + PdfPTable table = new PdfPTable(headers.length); + + table.setTotalWidth(widths); + table.setWidthPercentage(100f); + for(Object[] row : reportData) + { + + for(Object data : row) + { + PdfPCell dataCell = new PdfPCell(new Phrase(data.toString(), style3)); + table.addCell(dataCell); + } + } + + document.add(table); + document.close(); + + return bos.toByteArray(); + } + + /** + * Get Stock Enquiry Report Data + * @return + * @throws DocumentException + * @throws OperationException + */ + public byte[] getStockEnquiryData() throws DocumentException, OperationException + { + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + + Document document = new Document(PageSize.A4); + PdfWriter pdfWriter = PdfWriter.getInstance(document, bos); + + document.open(); + + // Font Syle + Font style1 = new Font(Font.TIMES_ROMAN, 12.0f, Font.BOLD); + Font style2 = new Font(Font.TIMES_ROMAN, 8.0f, Font.BOLD); + Font style3 = new Font(Font.TIMES_ROMAN, 8.0f); + Font style4 = new Font(Font.TIMES_ROMAN, 7.0f, Font.BOLD); + Font style5 = new Font(Font.TIMES_ROMAN, 6.0f); + float[] widths = { 1f, 2f, 0.5f, 0.5f, 0.5f, 0.5f }; + + // Table header + PdfPTable mytable = new PdfPTable(6); + mytable.setTotalWidth(widths); + mytable.setWidthPercentage(100f); + PdfPCell header = new PdfPCell(new Paragraph(new Chunk(title, style1) + "\n" + new Chunk(subtitle, style2) + "\n", style1)); + header.setColspan(6); + header.setHorizontalAlignment(Element.ALIGN_CENTER); + header.setBackgroundColor(new Color(0xC0, 0xC0, 0xC0)); + mytable.addCell(header); + + //Date Header + PdfPCell dateHeader = new PdfPCell(new Paragraph("From : " + new Chunk(TimestampConvertor.convertTimeStamp(fromDate, TimestampConvertor.DEFAULT_DATE_PATTERN1), style1), style1)); + dateHeader.setColspan(2); + dateHeader.setHorizontalAlignment(Element.ALIGN_LEFT); + dateHeader.setBackgroundColor(Color.GRAY); + dateHeader.setBorderColor(Color.WHITE); + mytable.addCell(dateHeader); + + dateHeader = new PdfPCell(new Paragraph("To : " + new Chunk(TimestampConvertor.convertTimeStamp(toDate, TimestampConvertor.DEFAULT_DATE_PATTERN1), style1), style1)); + dateHeader.setColspan(4); + dateHeader.setHorizontalAlignment(Element.ALIGN_LEFT); + dateHeader.setBackgroundColor(Color.GRAY); + dateHeader.setBorderColor(Color.WHITE); + mytable.addCell(dateHeader); + + // Info Header + PdfPCell infoHeader = new PdfPCell(new Paragraph("ALL VALUES ARE EXCLUSIVE OF VAT & BASED ON PURCHASE PRICES", style5)); + infoHeader.setColspan(6); + infoHeader.setHorizontalAlignment(Element.ALIGN_CENTER); + infoHeader.setBackgroundColor(new Color(0xC0, 0xC0, 0xC0)); + mytable.addCell(infoHeader); + + // Rows Header + PdfPCell rowHeader = new PdfPCell(new Paragraph("BARCODE",style4)); + rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); + mytable.addCell(rowHeader); + + rowHeader = new PdfPCell(new Paragraph("PRODUCT NAME", style4)); + rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); + mytable.addCell(rowHeader); + + + rowHeader = new PdfPCell(new Paragraph("Opening Stock Qty", style4)); + rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); + mytable.addCell(rowHeader); + + rowHeader = new PdfPCell(new Paragraph("Opening Stock Value", style4)); + rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); + mytable.addCell(rowHeader); + + rowHeader = new PdfPCell(new Paragraph("Closing Stock Qty", style4)); + rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); + mytable.addCell(rowHeader); + + rowHeader = new PdfPCell(new Paragraph("Closing Stock Value", style4)); + rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); + mytable.addCell(rowHeader); + + document.add(mytable); + + + Object[] headers = reportData.get(0); + + PdfPTable table = new PdfPTable(headers.length); + + table.setTotalWidth(widths); + table.setWidthPercentage(100f); + for(Object[] row : reportData) + { + + for(Object data : row) + { + PdfPCell dataCell = new PdfPCell(new Phrase(data.toString(), style3)); + table.addCell(dataCell); + } + } + + document.add(table); + document.close(); + + return bos.toByteArray(); + } + + public String toString() + { + return contain.toString(); + } + + public void getDataFromSQL(Properties ctx,String sql) throws OperationException + { + reportData = ReportManager.getReportData(ctx,sql); + } + + public ArrayList getReportData() { + return reportData; + } + + public void setReportData(ArrayList reportData) { + this.reportData = reportData; + } + + public table getTable() { + return bigTable; + } + + public String[] getHeaderStyle() { + return headerStyle; + } + + public void setHeaderStyle(String[] headerStyle) { + this.headerStyle = headerStyle; + } + + public boolean isSortable() { + return sortable; + } + + public void setSortable(boolean sortable) { + this.sortable = sortable; + } + + public String getStyle() { + return style; + } + + public void setStyle(String style) { + this.style = style; + } + + public String getSubtitle() { + return subtitle; + } + + public void setSubtitle(String subtitle) { + this.subtitle = subtitle; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title, int colspan) + { + td tdtitle = new td("" + title + ""); + tdtitle.addAttribute("colspan", colspan+""); + tr trow = new tr(); + bigTable.addElement( + new tr().addElement(tdtitle.addAttribute("align","center")) + ); + } + + public Timestamp getFromDate() { + return fromDate; + } + + public void setFromDate(Timestamp fromDate) { + this.fromDate = fromDate; + } + + public Timestamp getToDate() { + return toDate; + } + + public void setToDate(Timestamp toDate) { + this.toDate = toDate; + } + + +} + diff --git a/posterita/posterita/src/main/org/posterita/core/TestStockInquiry.java b/posterita/posterita/src/main/org/posterita/core/TestStockInquiry.java new file mode 100644 index 0000000000..117493fe74 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/core/TestStockInquiry.java @@ -0,0 +1,25 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + **/ +package org.posterita.core; + + +public class TestStockInquiry { + +} diff --git a/posterita/posterita/src/main/org/posterita/core/ThumbnailGenerator.java b/posterita/posterita/src/main/org/posterita/core/ThumbnailGenerator.java new file mode 100644 index 0000000000..00e746c0db --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/core/ThumbnailGenerator.java @@ -0,0 +1,137 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Mar 14, 2006 by praveen + * + */ +package org.posterita.core; + +import java.awt.Color; +import java.awt.Graphics; +import java.awt.Image; +import java.awt.image.BufferedImage; +import java.awt.image.ConvolveOp; +import java.awt.image.Kernel; +import java.io.BufferedOutputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; + +import javax.imageio.ImageIO; +import javax.swing.ImageIcon; + +import org.posterita.exceptions.ThumbnailGenerationException; + +public class ThumbnailGenerator +{ + public static byte[] getThumbnail(byte[] data, double scaleFactor) throws ThumbnailGenerationException + { + if(data == null) + throw new ThumbnailGenerationException("Imag data cannot be null"); + Image input = new ImageIcon(data).getImage(); + int imgWidth = input.getWidth(null); + int imgHeight = input.getHeight(null); + + int scaledWidth = (int)((double)imgWidth * scaleFactor); + int scaledHeight = (int)((double)imgHeight * scaleFactor); + + return getThumbnail(data, scaledWidth, scaledHeight); + } + + public static byte[] getSquareThumbnail(byte[] data, int size) throws ThumbnailGenerationException + { + Image input = new ImageIcon(data).getImage(); + int imgWidth = input.getWidth(null); + int imgHeight = input.getHeight(null); + + int thumbWidth; + int thumbHeight; + + if(imgWidth > imgHeight) + { + double scale = ((double)size/(double)imgWidth); + thumbWidth = size; + thumbHeight = (int)(scale * (double)imgHeight); + } + else + { + double scale = ((double)size/(double)imgHeight); + thumbHeight = size; + thumbWidth = (int)(scale * (double)imgWidth); + } + + return getThumbnail(data, thumbWidth, thumbHeight); + } + + static String THUMBEXT = "jpg"; + // Original Code: http://blogs.cocoondev.org/mpo/archives/003584.html + public static byte[] getThumbnail(byte data[], int maxSize) throws ThumbnailGenerationException + { + Image i = new ImageIcon(data).getImage(); + + int iWidth = i.getWidth(null); + int iHeight = i.getHeight(null); + if (iWidth > iHeight) + return getThumbnail(data, maxSize,(maxSize*iHeight)/iWidth); + else + return getThumbnail(data, (maxSize*iWidth)/iHeight,maxSize); + } + + public static byte[] getThumbnail(byte data[], int width, int height) throws ThumbnailGenerationException + { + try + { + Image i = new ImageIcon(data).getImage(); + + Image resizedImage = i.getScaledInstance(width, height, Image.SCALE_SMOOTH); + + // This code ensures that all the + // pixels in the image are loaded. + Image temp = new ImageIcon(resizedImage).getImage(); + // Create the buffered image. + BufferedImage bufferedImage = new BufferedImage(temp.getWidth(null), temp.getHeight(null), BufferedImage.TYPE_INT_RGB); + // Copy image to buffered image. + Graphics g = bufferedImage.createGraphics(); + // Clear background and paint the image. + g.setColor(Color.white); + g.fillRect(0, 0, temp.getWidth(null),temp.getHeight(null)); + g.drawImage(temp, 0, 0, null); + g.dispose(); + + // soften + float softenFactor = 0.01f; + float[] softenArray = {0, softenFactor, 0, softenFactor, 1-(softenFactor*4), softenFactor, 0, softenFactor, 0}; + Kernel kernel = new Kernel(3, 3, softenArray); + ConvolveOp cOp = new ConvolveOp(kernel, ConvolveOp.EDGE_NO_OP, null); + bufferedImage = cOp.filter(bufferedImage, null); + + ByteArrayOutputStream outStream = new ByteArrayOutputStream(); + BufferedOutputStream bufOutStream = new BufferedOutputStream(outStream); + ImageIO.write(bufferedImage, THUMBEXT, bufOutStream); + + bufOutStream.flush(); + byte retData[] = outStream.toByteArray(); + bufOutStream.close(); + outStream.close(); + return retData; + } + catch(IOException ex) + { + throw new ThumbnailGenerationException("Could not generate thumbnail", ex); + } + } +} diff --git a/posterita/posterita/src/main/org/posterita/core/TimeSeriesChart.java b/posterita/posterita/src/main/org/posterita/core/TimeSeriesChart.java new file mode 100644 index 0000000000..3bc7c19b4d --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/core/TimeSeriesChart.java @@ -0,0 +1,256 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * 13-Jul-2006 09:59:29 by praveen + * + */ + +package org.posterita.core; + +import java.math.BigDecimal; +import java.sql.PreparedStatement; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; + +import org.compiere.util.DB; +import org.jfree.chart.ChartFactory; +import org.jfree.chart.JFreeChart; +import org.jfree.chart.labels.StandardXYItemLabelGenerator; +import org.jfree.chart.plot.XYPlot; +import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; +import org.jfree.chart.title.TextTitle; +import org.jfree.data.time.Day; +import org.jfree.data.time.TimeSeries; +import org.jfree.data.time.TimeSeriesCollection; + +import org.posterita.businesslogic.performanceanalysis.ReportManager; +import org.posterita.exceptions.OperationException; + +/** + * @author praveen + * + */ +public class TimeSeriesChart extends AbstractChart +{ + public static final String CHART_TYPE = "TimeSeries"; + + TimeSeriesCollection dataset = null; + boolean showShapes = false; + + public TimeSeriesChart(){}; + + public TimeSeriesChart(TimeSeriesCollection dataset,String title) + { + this.dataset = dataset; + this.title = title; + } + + public TimeSeriesChart(TimeSeriesCollection dataset,String title,String xLabel,String yLabel) + { + this.dataset = dataset; + this.title = title; + this.xLabel = xLabel; + this.yLabel = yLabel; + } + + public JFreeChart createChart() throws OperationException + { + if(dataset == null) + { + throw new OperationException("Cannot create Time series chart: cause -> dataset null!"); + } + + chart = ChartFactory.createTimeSeriesChart(title,xLabel,yLabel,dataset,showLegend,showTooltip,false); + + if(showShapes) + { + XYPlot plot = (XYPlot) chart.getPlot(); + XYLineAndShapeRenderer render = (XYLineAndShapeRenderer) plot.getRenderer(); + render.setBaseShapesVisible(true); + } + + //setting subtitle + if(subtitle!=null) + { + TextTitle title = new TextTitle(subtitle); + chart.addSubtitle(title); + } + + //displaying labels + if(showLabels) + { + XYPlot plot = (XYPlot) chart.getPlot(); + XYLineAndShapeRenderer render = (XYLineAndShapeRenderer) plot.getRenderer(); + render.setItemLabelGenerator(new StandardXYItemLabelGenerator()); + render.setItemLabelsVisible(true); + } + + return chart; + + } + + /** + * Takes a sql as input and generates a Timeseries that is added to + * the dataset. + * Note: The sql must return 3 columns only Series, date & value + * Column 1: Type -> String + * Column 2: Type -> String or Date. For String the format must be as dd-MM-yyyy + * Column 3: Type -> BigDecimal + * + * @param sql + */ + public void getDataSetFromSQL(String sql) throws OperationException + { + PreparedStatement pstmt = DB.prepareStatement(sql,null); + + ArrayList dataSource = ReportManager.getReportData(pstmt); + int count = 0; + + String seriesName = null; + TimeSeries series = null; + BigDecimal value = null; + int day = 0; + int month = 0; + int year = 0; + + TimeSeriesCollection timeSeriesCollection = new TimeSeriesCollection(); + + for (Object[] data : dataSource) + { + if(data.length!=3) + throw new OperationException("Unable to generate timeseries. Cause:Invalid sql, the return resultset must have 3 columns only"); + + count++; + if(count==1) + { + continue; + } + + seriesName = (String)data[0]; + String date = (String)data[1]; + value = (BigDecimal) data[2]; + String s[] = date.split("-"); + + if(s.length!=3) + throw new OperationException("Unable to generate timeseries. " + + "Cause:Invalid date format, the date returned should have the following format 'DD-MM-YYYY'"); + + SimpleDateFormat sdf = new SimpleDateFormat(); + Calendar cal = Calendar.getInstance(); + Date d = null; + + try + { + sdf.applyPattern("DD-MM-YYYY"); + d = sdf.parse(date); + } + catch (ParseException e1) + { + try + { + sdf.applyPattern("DD-MMM-YYYY"); + d = sdf.parse(date); + } + catch (ParseException e) + { + throw new OperationException("Unable to generate timeseries. " + + "Cause:Invalid date format, the date returned should have one of the following formats 'DD-MM-YYYY' or 'DD-MMM-YYYY'",e); + } + } + + + cal.setTime(d); + + day = cal.get(Calendar.DATE); + month = cal.get(Calendar.MONTH) + 1; + year = cal.get(Calendar.YEAR); + + + series = timeSeriesCollection.getSeries(seriesName); + + if(series == null) + { + series = new TimeSeries(seriesName,Day.class); + series.add(new Day(day,month,year),value); + + timeSeriesCollection.addSeries(series); + } + else + { + series.add(new Day(day,month,year),value); + }//if + + }//for + + dataset = timeSeriesCollection; + } + + public void getTimeSeriesFromSQL(String sql,String key) throws OperationException + { + PreparedStatement pstmt = DB.prepareStatement(sql,null); + + ArrayList dataSource = ReportManager.getReportData(pstmt); + TimeSeries series = new TimeSeries(key,Day.class); + int count = 0; + + for (Object[] data : dataSource) + { + if(data.length != 2) + throw new OperationException("Unable to generate timeseries. Cause:Invalid sql, the return resultset must have 2 columns only"); + + count++; + if(count==1)continue; + + series.add(new Day((Date)data[0]),(BigDecimal)data[1]); + } + + pstmt = null; + addSeries(series); + } + + + public void addSeries(TimeSeries series) + { + if(dataset==null) + dataset = new TimeSeriesCollection(); + + dataset.addSeries(series); + } + + public TimeSeriesCollection getDataset() { + return dataset; + } + + public void setDataset(TimeSeriesCollection dataset) { + this.dataset = dataset; + } + + public boolean isShowShapes() { + return showShapes; + } + + public void setShowShapes(boolean showShapes) { + this.showShapes = showShapes; + } + + + +} diff --git a/posterita/posterita/src/main/org/posterita/core/TimestampConvertor.java b/posterita/posterita/src/main/org/posterita/core/TimestampConvertor.java new file mode 100644 index 0000000000..8db3d6e2c9 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/core/TimestampConvertor.java @@ -0,0 +1,294 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 29-Jul-2005 by alok + * + */ + +package org.posterita.core; + +import java.sql.Timestamp; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; + +import org.posterita.exceptions.InvalidDateTimeException; +import org.posterita.exceptions.OperationException; + +public class TimestampConvertor +{ + + public static final String XML_DATE_PATTERN = "yyyy-MM-dd HH:mm:ss.S"; + public static final String DEFAULT_DATE_PATTERN1 = "dd/MM/yyyy HH:mm:ss"; + public static final String DEFAULT_DATE_PATTERN2 = "dd-MMM-yyyy HH:mm:ss"; + public static final String FYRACLE_DATETIME_PATTERN = "MM-dd-yyyy HH:mm:ss"; + public static final String FYRACLE_DATE_PATTERN = "MM-dd-yyyy"; + public static final String FYRACLEDB_DATETIME_PATTERN = "dd-MM-yyyy HH:mm:ss"; + public static final String NORM_DATE_TIME_PATTERN = "yyyy-MM-dd HH:mm"; + public static final String FLAT_DATE_PATTERN = "ddMMyyyy"; + public static final String REPORTS_DATE_PATTERN = "dd-MMM-yyyy HH:mm:ss"; + public static final String SYNC_DATE_TIME = "yyyy-MM-dd HH:mm"; + public static final String BIRTH_DATE = "dd/MM/yyyy"; + + public static Timestamp getTimestamp(String timeStr) throws OperationException + { + SimpleDateFormat sFormat = new SimpleDateFormat(XML_DATE_PATTERN); + + Date date = null; + try + { + date = sFormat.parse(timeStr); + } + catch (ParseException e) + { + throw new OperationException("Cannot convert to timestamp!" + timeStr); + } + + Timestamp stamp = new Timestamp(date.getTime()); + + return stamp; + + } + + public static Timestamp getTimestamp(String timeStr, String format) throws InvalidDateTimeException + { + SimpleDateFormat sFormat = new SimpleDateFormat(format); + + if(timeStr == null || timeStr.length() == 0) + throw new InvalidDateTimeException("String length is invalid"); + + Date date = null; + try + { + date = sFormat.parse(timeStr); + } + catch (ParseException e) + { + throw new InvalidDateTimeException("Cannot convert to timestamp!" + timeStr); + } + + Timestamp stamp = new Timestamp(date.getTime()); + + return stamp; + } + public static Timestamp getTimestampForSync(String timeStr) throws InvalidDateTimeException + { + return getTimestamp(timeStr, SYNC_DATE_TIME); + } + + public static Timestamp getTimestampFromFlatString(String timeStr) throws OperationException, InvalidDateTimeException + { + return getTimestamp(timeStr, FLAT_DATE_PATTERN); + } + + public static String getCurrentDateTime() + { + SimpleDateFormat sFormat = new SimpleDateFormat(NORM_DATE_TIME_PATTERN); + + Date now = new Date(); + + String strDate = sFormat.format(now); + + return strDate; + } + + /** + * @return Current date and time + */ + public static Timestamp getCurrentDateTimeTimestamp() + { + return new Timestamp(System.currentTimeMillis()); + } + + /** + * @return Current Date only + * @throws OperationException + */ + public static Timestamp getCurrentDateTimestamp() throws OperationException + { + // Does not clear hour + /*Calendar cal = Calendar.getInstance(); + cal.clear(Calendar.MILLISECOND); + cal.clear(Calendar.SECOND); + cal.clear(Calendar.MINUTE); + cal.clear(Calendar.HOUR);*/ + + try + { + Date now = new Date(); + SimpleDateFormat sFormat = new SimpleDateFormat(FLAT_DATE_PATTERN); + + String d = sFormat.format(now); + + Date nDate = sFormat.parse(d); + + return new Timestamp(nDate.getTime()); + } + catch(ParseException ex) + { + throw new OperationException("Could not retrieve current date"); + } + } + + + + public static String convertTimeStampToFyracle(String timeStr) throws OperationException + { + if(timeStr == null || timeStr.trim().length() == 0) + throw new OperationException("Time string cannot be null"); + + if(timeStr.length() < 8) + throw new OperationException("Time string is invalid, Time String: " + timeStr); + + int ind = timeStr.indexOf("-"); + if(ind != 2) + throw new OperationException("Time string is not good, Time String: " + timeStr); + + String timeStrSub = timeStr.substring(ind + 1); + + int ind2 = timeStrSub.indexOf("-"); + + if(ind2 == 2) + return convertTimeStampToFyracle(timeStr, DEFAULT_DATE_PATTERN1); + else if(ind2 == 3) + return convertTimeStampToFyracle(timeStr, DEFAULT_DATE_PATTERN2); + else + throw new OperationException("Time string is not valid, Time String: " + timeStr); + } + + public static String convertTimeStampToFyracle(String timeStr, String pattern) throws OperationException + { + SimpleDateFormat sFormat = new SimpleDateFormat(pattern); + SimpleDateFormat tFormat = new SimpleDateFormat(FYRACLE_DATETIME_PATTERN); + + Date date = null; + + try + { + date = sFormat.parse(timeStr); + String retVal = tFormat.format(date); + return retVal; + } + catch(ParseException ex) + { + throw new OperationException("Cannot convert to timestamp!" + timeStr); + } + } + + public static String changeTimestampPattern(String timeStr, String fromPattern, String toPattern) throws OperationException + { + SimpleDateFormat sFormat = new SimpleDateFormat(fromPattern); + SimpleDateFormat tFormat = new SimpleDateFormat(toPattern); + + Date date = null; + + try + { + date = sFormat.parse(timeStr); + String retVal = tFormat.format(date); + return retVal; + } + catch(ParseException ex) + { + throw new OperationException("Cannot convert to timestamp!" + timeStr); + } + } + + public static String convertTimeStampToFyracleDate(Timestamp tStamp) throws OperationException + { + SimpleDateFormat tFormat = new SimpleDateFormat(FYRACLE_DATE_PATTERN); + + try + { + String retVal = tFormat.format(tStamp); + return retVal; + } + catch(Exception ex) + { + throw new OperationException("Cannot convert to timestamp!" + tStamp.toString()); + } + } + + public static String convertTimeStamp(Timestamp time, String format) throws OperationException + { + try + { + SimpleDateFormat dateFormat = new SimpleDateFormat(format); + + String formatted = dateFormat.format(time); + return formatted; + } + catch (Exception e) + { + throw new OperationException("Cannot convert to timestamp!" + time.toString()); + } + } + + public static String reportTimeStampToFyracle(String timeStr) throws OperationException + { + SimpleDateFormat sFormat = new SimpleDateFormat(REPORTS_DATE_PATTERN); + SimpleDateFormat tFormat = new SimpleDateFormat(FYRACLEDB_DATETIME_PATTERN); + + Date date = null; + + try + { + date = sFormat.parse(timeStr); + String retVal = tFormat.format(date); + return retVal; + } + catch(ParseException ex) + { + throw new OperationException("Cannot convert to timestamp!" + timeStr); + } + } + + /** + * Format Timestamp according to default pattern + * @see DEFAULT_DATE_PATTERN1 + * @param timestamp + * @return formatted timestamp + */ + public static String format(Timestamp timestamp) + { + return format(timestamp, DEFAULT_DATE_PATTERN1); + } + + /** + * Format a Timestamp according to the pattern provided + * @param timestamp + * @param pattern + * @return Formated string for the Timestamp + */ + public static String format(Timestamp timestamp, String pattern) + { + if (timestamp == null) + { + throw new IllegalArgumentException("Timestamp cannot be null"); + } + + if (pattern == null) + { + throw new IllegalArgumentException("Pattern cannot be null"); + } + + SimpleDateFormat dateFormat = new SimpleDateFormat(pattern); + return dateFormat.format(timestamp); + } +} + \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/core/TmkJSPEnv.java b/posterita/posterita/src/main/org/posterita/core/TmkJSPEnv.java new file mode 100644 index 0000000000..1d4580f7a2 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/core/TmkJSPEnv.java @@ -0,0 +1,63 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + **/ +package org.posterita.core; + +import java.util.Properties; + +import javax.servlet.http.HttpServletRequest; + +import org.compiere.util.Env; +import org.compiere.wstore.JSPEnv; +import org.posterita.exceptions.TMKRuntimeException; +import org.posterita.lib.UdiConstants; + +/** + * JSP Environment Utilities + * + * @author Jorg Janke + * @version $Id: TmkJSPEnv.java,v 1.2 2006/12/15 06:32:14 vishee Exp $ + */ +public class TmkJSPEnv +{ + public static Properties getCtx(HttpServletRequest request) + { + Properties ctx = JSPEnv.getCtx(request); + + String user_org = Env.getContext(ctx,UdiConstants.ROLE_EDITABLE_ORGS_CTX_PARAM); + + if ((user_org == null) || (user_org.equals(""))) //FIXME + { + Env.setContext(ctx, UdiConstants.ROLE_EDITABLE_ORGS_CTX_PARAM, Env.getAD_Org_ID(ctx)); + } + + try //Required since our friend Jorg hardcoded 30 mins in JSPEnv.java + { + request.getSession().setMaxInactiveInterval(5*60*60); // 5 Hours + } + catch(Exception ex) + { + throw new TMKRuntimeException("Could not figure the application type for the current session"); + } + + return ctx; + + } +} diff --git a/posterita/posterita/src/main/org/posterita/core/TrxPrefix.java b/posterita/posterita/src/main/org/posterita/core/TrxPrefix.java new file mode 100644 index 0000000000..001faf50bf --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/core/TrxPrefix.java @@ -0,0 +1,38 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Created on 02-Dec-2005 + */ + + +package org.posterita.core; + + +public class TrxPrefix +{ + private static int count=0; + + public static synchronized String getPrefix() + { + count++; + return "POSTERITA"+count + "_" + System.currentTimeMillis(); + } + + +} diff --git a/posterita/posterita/src/main/org/posterita/core/UDIFilePropertiesManager.java b/posterita/posterita/src/main/org/posterita/core/UDIFilePropertiesManager.java new file mode 100644 index 0000000000..3603f22a9a --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/core/UDIFilePropertiesManager.java @@ -0,0 +1,49 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Created on 13-Oct-2005 + */ + + +package org.posterita.core; + +public class UDIFilePropertiesManager extends FilePropertiesManager +{ + static UDIFilePropertiesManager singleton; + + private UDIFilePropertiesManager() + { + + } + + public static UDIFilePropertiesManager getProperty() + { + if (singleton ==null) + singleton = new UDIFilePropertiesManager(); + + return singleton; + } + + protected String getFileName() + { + return "Udi"; + } + + +} diff --git a/posterita/posterita/src/main/org/posterita/core/UDIMap.java b/posterita/posterita/src/main/org/posterita/core/UDIMap.java new file mode 100644 index 0000000000..003bbf161b --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/core/UDIMap.java @@ -0,0 +1,49 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Aug 15, 2005 by praveen + * + */ +package org.posterita.core; + +import java.util.HashMap; + +import org.compiere.process.DocAction; + +public class UDIMap +{ + public static final HashMap docStatusMap; + + static + { + docStatusMap = new HashMap(); + docStatusMap.put(DocAction.STATUS_Approved,"Approved"); + docStatusMap.put(DocAction.STATUS_Completed,"Completed"); + docStatusMap.put(DocAction.STATUS_Closed,"Closed"); + docStatusMap.put(DocAction.STATUS_Drafted,"Drafted"); + docStatusMap.put(DocAction.STATUS_InProgress,"InProgress"); + docStatusMap.put(DocAction.STATUS_Invalid,"Invalid"); + docStatusMap.put(DocAction.STATUS_NotApproved,"Not Approved"); + docStatusMap.put(DocAction.STATUS_Reversed,"Reversed"); + docStatusMap.put(DocAction.STATUS_Unknown,"UnKnown"); + docStatusMap.put(DocAction.STATUS_Voided,"Voided"); + docStatusMap.put(DocAction.STATUS_WaitingConfirmation,"Waiting Confirmation"); + docStatusMap.put(DocAction.STATUS_WaitingPayment,"Waiting payment"); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/core/UDIPair.java b/posterita/posterita/src/main/org/posterita/core/UDIPair.java new file mode 100644 index 0000000000..1699a09786 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/core/UDIPair.java @@ -0,0 +1,65 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +package org.posterita.core; + +public class UDIPair implements Comparable +{ + private Integer ID; + private String value; + + public UDIPair(Integer ID, String value) + { + this.ID = ID; + this.value = value; + } + + public Integer getID() + { + return ID; + } + + public void setID(Integer id) + { + ID = id; + } + + public String getValue() + { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public int compareTo(Object o) + { + UDIPair pair = (UDIPair) o; + + return this.getValue().compareTo(pair.getValue()); + } + + public String toString() + { + String str ="ID:" +getID() + " Value:" +getValue(); + return str; + } + +} diff --git a/posterita/posterita/src/main/org/posterita/core/UDIPropertiesManager.java b/posterita/posterita/src/main/org/posterita/core/UDIPropertiesManager.java new file mode 100644 index 0000000000..6d1de2729f --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/core/UDIPropertiesManager.java @@ -0,0 +1,53 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 24-Jun-2005 by alok + * + */ +package org.posterita.core; + +import org.posterita.factory.DBPropertiesManager; +import org.posterita.factory.WebProperties; + +public class UDIPropertiesManager +{ + private static WebProperties singleton; + + private UDIPropertiesManager() + { + + } + + public static WebProperties getProperty() + { + if (singleton ==null) + singleton = new DBPropertiesManager(); + + + + return singleton; + } + + protected String getFileName() + { + + return "Udi"; + } + + +} diff --git a/posterita/posterita/src/main/org/posterita/core/UpdateUsers.java b/posterita/posterita/src/main/org/posterita/core/UpdateUsers.java new file mode 100644 index 0000000000..b73d06d212 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/core/UpdateUsers.java @@ -0,0 +1,60 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ +package org.posterita.core; + +import java.util.Properties; +import java.util.logging.Level; + +import org.compiere.Adempiere; +import org.compiere.model.MBPartner; +import org.compiere.model.MUser; +import org.compiere.util.CLogMgt; +import org.compiere.util.Env; + + +public class UpdateUsers { + + public static void main(String[] args) + { + Adempiere.startup(true); + CLogMgt.initialize(true); + CLogMgt.setLevel(Level.OFF); + + Properties ctx = Env.getCtx(); + Env.setContext(ctx, "#AD_Client_ID", "" + 1001932); + + int userIds[] = MUser.getAllIDs(MUser.Table_Name, " ad_client_id=1001932", null); + + MUser user; + MBPartner partner; + for (int i = 0; i < userIds.length; i++) + { + user = new MUser(ctx, userIds[i], null); + + if (user.getC_BPartner_ID()!=0) + { + partner = new MBPartner(ctx, user.getC_BPartner_ID(), null); + user.setName(partner.getName()); + user.save(); + } + + } + } +} diff --git a/posterita/posterita/src/main/org/posterita/core/WebFacade.java b/posterita/posterita/src/main/org/posterita/core/WebFacade.java new file mode 100644 index 0000000000..56b9c54770 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/core/WebFacade.java @@ -0,0 +1,26 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ +package org.posterita.core; + + +public class WebFacade +{ + +} diff --git a/posterita/posterita/src/main/org/posterita/core/action/ClientAction.java b/posterita/posterita/src/main/org/posterita/core/action/ClientAction.java new file mode 100644 index 0000000000..8115a3336d --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/core/action/ClientAction.java @@ -0,0 +1,127 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +* +* Created on Oct 30, 2006 by ashley +* +*/ + +/** + @author ashley + */ + +package org.posterita.core.action; + +import java.io.File; +import java.util.ArrayList; +import java.util.Properties; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.compiere.model.MCountry; +import org.compiere.util.Env; +import org.compiere.util.KeyNamePair; +import org.posterita.Constants; +import org.posterita.beans.UserBean; +import org.posterita.businesslogic.CurrencyManager; +import org.posterita.businesslogic.POSClientManager; +import org.posterita.core.KeyNamePairUtil; +import org.posterita.core.TmkJSPEnv; +import org.posterita.core.bean.ClientBean; +import org.posterita.exceptions.ClientAlreadyExistException; +import org.posterita.exceptions.OperationException; +import org.posterita.form.UserRegistrationForm; +import org.posterita.struts.core.BaseDispatchAction; +import org.posterita.struts.core.DefaultForm; + +import com.sun.corba.se.impl.orbutil.closure.Constant; + +public class ClientAction extends BaseDispatchAction +{ + + public static final String INIT_CREATE_CLIENT = "initCreateClient"; + public ActionForward initCreateClient(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception + { + Properties ctx = Env.getCtx(); //--> Not using TmkJSPEnv because it may be that no store is defined + ArrayList countriesKNPair = KeyNamePairUtil.getData(ctx, MCountry.Table_Name, "IsActive='Y'"); + ArrayList currenciesKNPair = CurrencyManager.getAllCurrencies(); + + request.getSession().setAttribute(Constants.COUNTRIES, countriesKNPair); + request.getSession().setAttribute(Constants.CURRENCIES, currenciesKNPair); + + return mapping.findForward(INIT_CREATE_CLIENT); + } + + public static final String CREATE_CLIENT = "createClient"; + public ActionForward createClient(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception + { + DefaultForm df = (DefaultForm)form; + + ClientBean clientBean = (ClientBean)df.getBean(); + + UserBean userBean = new UserBean(); + userBean.setName(clientBean.getUsername()); + userBean.setAddress1(clientBean.getAddress1()); + userBean.setCity(clientBean.getCity()); + userBean.setCountryId(clientBean.getCountryId()); + userBean.setEmail(clientBean.getEmail()); + request.getSession().setAttribute(Constants.USER_BEAN, userBean); + + /*request.setAttribute(Constants.EMAIL, clientBean.getEmail()); + request.setAttribute(Constants.USERNAME, clientBean.getUsername()); + request.setAttribute(Constants.ADDRESS1, clientBean.getAddress1()); + request.setAttribute(Constants.CITY, clientBean.getCity()); + request.setAttribute(Constants.COUNTRY_ID, clientBean.getCountryId());*/ + + + if (clientBean.getFile() == null) + { + clientBean.setFile(df.getFile()); + } + + if(!clientBean.getPassword().equals(clientBean.getConfirmPassword())) + { + postGlobalError("error.wrong.password.matching", request); + return mapping.getInputForward(); + } + + String storeContext; + try + { + storeContext = POSClientManager.createClient(clientBean); + } + catch(ClientAlreadyExistException ex) + { + postGlobalError("error.client.alreadyexist", request); + return mapping.getInputForward(); + } + catch(OperationException ex) + { + postGlobalError("error.client.create", ex.getMessage(), request); + return mapping.getInputForward(); + } + + String contextPath = "/RegisterUserAction.do?action=initRegisterUser"; + /*String contextPath = "/SetApplicationParametersAction.do?action=setApplicationParameters&applicationName=" + storeContext;*/ + return new ActionForward(contextPath); + } +} diff --git a/posterita/posterita/src/main/org/posterita/core/action/login/GenericLoginAction.java b/posterita/posterita/src/main/org/posterita/core/action/login/GenericLoginAction.java new file mode 100644 index 0000000000..272831ca67 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/core/action/login/GenericLoginAction.java @@ -0,0 +1,45 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + **/ + +/** + @author ashley + */ + +package org.posterita.core.action.login; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.posterita.struts.login.LoginAction; + +public class GenericLoginAction extends LoginAction +{ + + public ActionForward success(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception + { + + return super.success(mapping, form, request, response); + + } +} diff --git a/posterita/posterita/src/main/org/posterita/core/bean/ClientBean.java b/posterita/posterita/src/main/org/posterita/core/bean/ClientBean.java new file mode 100644 index 0000000000..62a423bf8d --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/core/bean/ClientBean.java @@ -0,0 +1,173 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +* +* Created on Oct 30, 2006 by ashley +* +*/ + +/** + @author ashley + */ + +package org.posterita.core.bean; + +import org.apache.struts.upload.FormFile; +import org.posterita.beans.UDIBean; + +public class ClientBean extends UDIBean +{ + public String getClientName() + { + return clientName; + } + + public void setClientName(String clientName) + { + this.clientName = clientName; + } + + public String getAddress1() + { + return address1; + } + + public void setAddress1(String address1) + { + this.address1 = address1; + } + + public Integer getCountryId() + { + return countryId; + } + + public void setCountryId(Integer countryId) + { + this.countryId = countryId; + } + + public Integer getCurrencyId() + { + return currencyId; + } + + public void setCurrencyId(Integer currencyId) + { + this.currencyId = currencyId; + } + + public String getEmail() + { + return email; + } + + public void setEmail(String email) + { + this.email = email; + } + + public String getOrgName() + { + return orgName; + } + + public void setOrgName(String orgName) + { + this.orgName = orgName; + } + + public String getPostalAddress() + { + return postalAddress; + } + + public void setPostalAddress(String postalAddress) + { + this.postalAddress = postalAddress; + } + + public String getConfirmPassword() + { + return confirmPassword; + } + + public void setConfirmPassword(String confirmPassword) + { + this.confirmPassword = confirmPassword; + } + + public String getPassword() + { + return password; + } + + public void setPassword(String password) + { + this.password = password; + } + + public String getUserPIN() + { + return userPIN; + } + + public void setUserPIN(String userPIN) + { + this.userPIN = userPIN; + } + + public String getRoleName() + { + return roleName; + } + + public void setRoleName(String roleName) + { + this.roleName = roleName; + } + + public String getUsername() + { + return username; + } + + public void setUsername(String username) + { + this.username = username; + } + + public String getCity() + { + return city; + } + + public void setCity(String city) + { + this.city = city; + } + + public FormFile getFile() + { + return file; + } + public void setFile(FormFile file) + { + this.file = file; + } +} diff --git a/posterita/posterita/src/main/org/posterita/core/bean/ElementBean.java b/posterita/posterita/src/main/org/posterita/core/bean/ElementBean.java new file mode 100644 index 0000000000..38eb4a3688 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/core/bean/ElementBean.java @@ -0,0 +1,87 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +* +* Created on Nov 15, 2006 by ashley +* +*/ + +/** + @author ashley + */ + +package org.posterita.core.bean; + +public class ElementBean +{ + protected String name; + protected String columnName; + protected String printName; + protected String description; + protected String help; + + public String getName() + { + return name; + } + + public void setName(String name) + { + this.name = name; + } + + public String getColumnName() + { + return columnName; + } + + public void setColumnName(String columnName) + { + this.columnName = columnName; + } + + public String getDescription() + { + return description; + } + + public void setDescription(String description) + { + this.description = description; + } + + public String getHelp() + { + return help; + } + + public void setHelp(String help) + { + this.help = help; + } + + public String getPrintName() + { + return printName; + } + + public void setPrintName(String printName) + { + this.printName = printName; + } +} diff --git a/posterita/posterita/src/main/org/posterita/core/businesslogic/ElementManager.java b/posterita/posterita/src/main/org/posterita/core/businesslogic/ElementManager.java new file mode 100644 index 0000000000..5336bd0c3b --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/core/businesslogic/ElementManager.java @@ -0,0 +1,217 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +* +* Created on Nov 15, 2006 by ashley +* +*/ + +/** + @author ashley + */ + +package org.posterita.core.businesslogic; + +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.util.Properties; + +import org.compiere.util.CLogger; +import org.compiere.util.DB; +import org.compiere.util.Env; +import org.compiere.util.Language; +import org.compiere.util.Msg; + +import org.posterita.lib.UdiConstants; +import org.posterita.core.bean.ElementBean; + +public class ElementManager +{ + protected transient static final CLogger log = CLogger.getCLogger (ElementManager.class); + private static ElementBean getUnknownElementBean(Properties ctx, String columnName) + { + ElementBean elementBean = new ElementBean(); + elementBean.setColumnName(columnName); + elementBean.setDescription("Undefined column with name: " + columnName); + elementBean.setHelp(elementBean.getDescription()); + elementBean.setName(columnName); + elementBean.setPrintName(columnName); + return elementBean; + } + + private static String getElement_TrlSql(Properties ctx, String columnName) + { + String language = Env.getContext(ctx, UdiConstants.LANGUAGE_CTX_PARAM); + + if (language == null || language.trim().length() == 0) + { + language = Language.AD_Language_en_US; + } + + String tableName = "AD_Element"; + StringBuffer whereClause = new StringBuffer("ColumnName='"); + whereClause.append(columnName); + whereClause.append("' "); + + if (!language.equals(Language.AD_Language_en_US)) + { + tableName = "AD_Element_Trl"; + whereClause = new StringBuffer(); + whereClause.append("AD_Element_ID= (select AD_Element_ID from AD_Element where ColumnName='" + columnName + "')"); + whereClause.append(" and AD_Language='"); + whereClause.append(language); + whereClause.append("'"); + } + + StringBuffer sql = new StringBuffer(); + sql.append("Select ColumnName, Name, PrintName, Description, Help from "); + sql.append(tableName); + sql.append(" where "); + sql.append(whereClause); + + return sql.toString(); + } + + public static String getMsg_trlSql(Properties ctx, String text) + { + String language = Env.getContext(ctx, UdiConstants.LANGUAGE_CTX_PARAM); + + if (language == null || language.trim().length() == 0) + { + language = Language.AD_Language_en_US; + } + + String tableName = "AD_Message"; + StringBuffer whereClause = new StringBuffer("value='"); + whereClause.append(text); + whereClause.append("' "); + + if (!language.equals(Language.AD_Language_en_US)) + { + tableName = "AD_Element_Trl"; + whereClause = new StringBuffer(); + whereClause.append("AD_Message_ID= (select AD_Message_ID from AD_Message where value='"); + whereClause.append(text); + whereClause.append("')"); + whereClause.append(" and AD_Language='"); + whereClause.append(language); + whereClause.append("'"); + } + + StringBuffer sql = new StringBuffer(); + sql.append("Select Value, MsgText, MsgText, MsgTip, MsgTip from "); + sql.append(tableName); + sql.append(" where "); + sql.append(whereClause); + + return sql.toString(); + } + + private static ElementBean getTrl(String sql) + { + PreparedStatement pstmt = DB.prepareStatement(sql, null); + + ElementBean retElementBean = null; + try + { + ResultSet rs = pstmt.executeQuery(); + if (rs.next()) + { + retElementBean = new ElementBean(); + retElementBean.setColumnName(rs.getString(1)); + retElementBean.setName(rs.getString(2)); + retElementBean.setPrintName(rs.getString(3)); + retElementBean.setDescription(rs.getString(4)); + retElementBean.setHelp(rs.getString(5)); + } + else + { + return null; + } + rs.close(); + } + catch (Exception ex) + { + log.severe("Could retrieve element translation with sql: " + sql); + } + finally + { + try + { + pstmt.close(); + } + catch (Exception ex){} + } + + return retElementBean; + } + + public static ElementBean getMsg1(Properties ctx, String text) + { + ElementBean elementBean = null; + + elementBean = getTrl(getElement_TrlSql(ctx, text)); + + if (elementBean == null) + { + elementBean = getTrl(getMsg_trlSql(ctx, text)); + } + + if (elementBean == null) + { + elementBean = getUnknownElementBean(ctx, text); + } + + return elementBean; + } + + public static ElementBean getMsg(Properties ctx, String text) + { + String language = Env.getContext(ctx, UdiConstants.LANGUAGE_CTX_PARAM); + + if (language == null || language.trim().length() == 0) + { + language = Language.AD_Language_en_US; + } + + String msg = Msg.getElement(language, text, true); + + if (msg == null || msg == "") + { + msg = Msg.translate(language, text); + } + + if (msg == null || msg == "") + { + msg = text; + } + + int ind = msg.indexOf(Env.NL); + if (ind != -1) + msg = msg.substring(0, ind); + + ElementBean elementBean = new ElementBean(); + elementBean.setColumnName(text); + elementBean.setDescription(msg); + elementBean.setHelp(msg); + elementBean.setName(msg); + elementBean.setPrintName(msg); + + return elementBean; + } +} diff --git a/posterita/posterita/src/main/org/posterita/core/businesslogic/ImportManager.java b/posterita/posterita/src/main/org/posterita/core/businesslogic/ImportManager.java new file mode 100644 index 0000000000..6a090c0d6c --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/core/businesslogic/ImportManager.java @@ -0,0 +1,108 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + **/ +/** + @author ashley + */ + +package org.posterita.core.businesslogic; + +import java.io.File; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.Properties; + +import org.compiere.impexp.ImpFormat; +import org.compiere.process.ImportAccount; +import org.compiere.process.ProcessInfo; +import org.compiere.process.ProcessInfoParameter; +import org.compiere.util.Trx; + +import org.posterita.businesslogic.ProcessManager; +import org.posterita.core.FileManager; +import org.posterita.exceptions.OperationException; + +public class ImportManager +{ + public static int importFile(Properties ctx, File impFile, String importFormat, String trxName) throws OperationException + { + if(impFile == null) + throw new OperationException("File to import cannot be null"); + if(!impFile.exists() || impFile.isDirectory()) + throw new OperationException("File does not exist or it is a directory, file: " + impFile); + if(importFormat == null || importFormat.trim().length() == 0) + throw new OperationException("Import format cannot be null"); + + ImpFormat impFormat = ImpFormat.load(importFormat); + + if(impFormat == null) + throw new OperationException("Could not load import format: " + importFormat); + + ArrayList fileLinesList = FileManager.readLines(impFile); + + Iterator fileLinesIter = fileLinesList.iterator(); + + int importedLines = 0; + while(fileLinesIter.hasNext()) + { + String line = fileLinesIter.next(); + if(impFormat.updateDB(ctx, line, trxName)) + importedLines++; + } + + return importedLines; + } + + public static void importAccounting(Properties ctx, int clientId, int elementId, boolean updateDefaultAccounts, boolean createNewCombination, boolean deleteOldImported, String trxName) throws OperationException + { + ImportAccount impAccount = new ImportAccount(); + int accountImportProcessId = ProcessManager.getProcessId(ImportAccount.class); + + String updDefAccts = (updateDefaultAccounts) ? "Y" : "N"; + String crNewCombinations = (createNewCombination) ? "Y" : "N"; + String delOldImp = (deleteOldImported) ? "Y" : "N"; + + ProcessInfo processInfo = new ProcessInfo("Import accounts", accountImportProcessId); + + ProcessInfoParameter clientParam = new ProcessInfoParameter("AD_Client_ID", new BigDecimal(clientId), new BigDecimal(clientId), "Client", "Client"); + ProcessInfoParameter elementParam = new ProcessInfoParameter("C_Element_ID", new BigDecimal(elementId), new BigDecimal(elementId), "Element", "Element"); + ProcessInfoParameter updDefAcctsParam = new ProcessInfoParameter("UpdateDefaultAccounts", updDefAccts, updDefAccts, "Update Default Accounts", "Update Default Accounts"); + ProcessInfoParameter createNewCombinationParam = new ProcessInfoParameter("CreateNewCombination", crNewCombinations, crNewCombinations, "Create New Combination", "Create New Combination"); + ProcessInfoParameter deleteOldParam = new ProcessInfoParameter("DeleteOldImported", delOldImp, delOldImp, "Delete Old Imported", "Delete Old Imported"); + + ProcessInfoParameter parameters[] = new ProcessInfoParameter[5]; + parameters[0] = clientParam; + parameters[1] = elementParam; + parameters[2] = updDefAcctsParam; + parameters[3] = createNewCombinationParam; + parameters[4] = deleteOldParam; + + processInfo.setParameter(parameters); + + Trx trx = null; + + if(trxName != null) + trx = Trx.get(trxName, false); + + if(!impAccount.startProcess(ctx, processInfo, trx)) + throw new OperationException("Could not run import accounting process"); + } +} diff --git a/posterita/posterita/src/main/org/posterita/core/exception/FileOpException.java b/posterita/posterita/src/main/org/posterita/core/exception/FileOpException.java new file mode 100644 index 0000000000..119003bbb1 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/core/exception/FileOpException.java @@ -0,0 +1,37 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + **/ + +package org.posterita.core.exception; + +public class FileOpException extends Exception +{ + private static final long serialVersionUID = 1L; + + public FileOpException(String msg) + { + super(msg); + } + + public FileOpException(String msg, Exception ex) + { + super(msg, ex); + } +} diff --git a/posterita/posterita/src/main/org/posterita/core/exception/IOOperationException.java b/posterita/posterita/src/main/org/posterita/core/exception/IOOperationException.java new file mode 100644 index 0000000000..ec46611784 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/core/exception/IOOperationException.java @@ -0,0 +1,46 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + **/ +/** + @author ashley + */ + +package org.posterita.core.exception; + +import org.posterita.exceptions.OperationException; + +public class IOOperationException extends OperationException +{ + + /** + * + */ + private static final long serialVersionUID = 1L; + + public IOOperationException(String msg) + { + super(msg); + } + + public IOOperationException(String msg, Exception ex) + { + super(msg, ex); + } +} diff --git a/posterita/posterita/src/main/org/posterita/core/form/ClientForm.java b/posterita/posterita/src/main/org/posterita/core/form/ClientForm.java new file mode 100644 index 0000000000..6ae9f6ba25 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/core/form/ClientForm.java @@ -0,0 +1,42 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +* +* Created on Oct 30, 2006 by ashley +* +*/ + +/** + @author ashley + */ + +package org.posterita.core.form; + +import org.posterita.struts.core.DefaultForm; +import org.posterita.core.bean.ClientBean; + +public class ClientForm extends DefaultForm +{ + private static final long serialVersionUID = 1L; + + public ClientForm() + { + this.setBean(new ClientBean()); + this.addRequiredFields(new String[]{"clientName", "address1", "countryId", "currencyId", "email", "orgName", "postalAddress", "confirmPassword", "password", "userPIN", "roleName", "username", "city","file"}); + } +} diff --git a/posterita/posterita/src/main/org/posterita/core/install/EnvSettings.java b/posterita/posterita/src/main/org/posterita/core/install/EnvSettings.java new file mode 100644 index 0000000000..62c7036bce --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/core/install/EnvSettings.java @@ -0,0 +1,151 @@ +package org.posterita.core.install; + +import java.io.File; +import java.net.InetAddress; +import java.net.UnknownHostException; + +import org.posterita.core.exception.FileOpException; + +public class EnvSettings +{ + public static boolean DEBUG = true; + public static final double JAVA_VERSION_1_5 = 1.5; + + public static final String PATH_SEPARATOR = System.getProperty("file.separator"); + + public static final String JAVA_HOME = "JAVA_HOME"; + public static final String COMPIERE_WEBSTORES = "COMPIERE_WEBSTORES"; + public static final String COMPIERE_DB_USER = "COMPIERE_DB_USER"; + public static final String COMPIERE_DB_NAME = "COMPIERE_DB_NAME"; + public static final String COMPIERE_DB_SYSTEM = "COMPIERE_DB_SYSTEM"; + public static final String COMPIERE_DB_PASSWORD = "COMPIERE_DB_PASSWORD"; + public static final String COMPIERE_HOME = "COMPIERE_HOME"; + public static final String COMPIERE_APPS_SERVER = "COMPIERE_APPS_SERVER"; + public static final String COMPIERE_WEB_ALIAS = "COMPIERE_WEB_ALIAS"; + public static final String COMPIERE_DB_TYPE = "COMPIERE_DB_TYPE"; + public static final String COMPIERE_DB_PORT = "COMPIERE_DB_PORT"; + public static final String COMPIERE_DB_SERVER = "COMPIERE_DB_SERVER"; + public static final String COMPIERE_DB_URL = "COMPIERE_DB_URL"; + public static final String COMPIERE_MAIL_SERVER = "COMPIERE_MAIL_SERVER"; + public static final String COMPIERE_APPS_DEPLOY = "COMPIERE_APPS_DEPLOY"; + public static final String COMPIERE_KEYSTORE = "COMPIERE_KEYSTORE"; + + public static final String TEMP_DIR = "TempDir"; + public static final String CONNECTION = "Connection"; + + public static final String OS_WINDOWS = "Windows"; + public static final String OS_LINUX = "Linux"; + + public static File getJDKHomeDir() throws FileOpException + { + String javaHome = System.getProperty("java.home"); + + if(javaHome.endsWith("jre")) // Implies running from JRE found within JDK Folder + { + int jInd = javaHome.lastIndexOf("jre"); + javaHome = javaHome.substring(0, jInd - 1); + } + + int index = javaHome.lastIndexOf(PATH_SEPARATOR); + index = index + 1; + + if(isOSWindows()) + { + javaHome = javaHome.toLowerCase(); + int pInd = javaHome.indexOf("progra~1"); + if(pInd > 0) + javaHome = javaHome.replaceAll("progra~1", "program files"); + } + + String jreFolder = javaHome.substring(index); + String jdkFolder = jreFolder.replaceAll("jre", "jdk"); + + File jdkDir = new File(javaHome.substring(0, index) + jdkFolder); + if(!jdkDir.exists()) + throw new FileOpException("JDK Folder does not exists, file: " + jdkDir.getAbsolutePath()); + if(!jdkDir.isDirectory()) + throw new FileOpException("Path is not a directory, file: " + jdkDir.getAbsolutePath()); + + return jdkDir; + } + + public static File getUserDesktopDir() throws FileOpException + { + String userHome = System.getProperty("user.home"); + + String desktopDirPath = userHome + PATH_SEPARATOR + "Desktop"; + + File desktopDir = new File(desktopDirPath); + + if(!(desktopDir.exists() && desktopDir.isDirectory())) + throw new FileOpException("Could not locate desktop directory"); + + return desktopDir; + } + + public static File getTempDir() throws FileOpException + { + String tempDirPath = System.getProperty("java.io.tmpdir"); + + File tempDir = new File(tempDirPath); + + if(!(tempDir.exists() && tempDir.isDirectory())) + throw new FileOpException("Could not locate Temporary Directory"); + + return tempDir; + } + + public static String getJavaMajorVersion() + { + String javaVersion = System.getProperty("java.version"); + javaVersion = javaVersion.substring(0, 3); + + return javaVersion; + } + + public static boolean isJavaVersionOk() + { + boolean versionOk = false; + + String javaVersion = getJavaMajorVersion(); + try + { + double version = Double.parseDouble(javaVersion); + if(version >= 1.5) + versionOk = true; + } + catch(NumberFormatException ex) + { + versionOk = false; + } + return versionOk; + } + + public static File getWorkingDir() + { + String workingDir = System.getProperty("user.dir"); + + return new File(workingDir); + } + + public static String getHostName() throws UnknownHostException + { + InetAddress iAdd = InetAddress.getLocalHost(); + return iAdd.getHostName(); + } + + public static String getHostAddress() throws UnknownHostException + { + InetAddress iAdd = InetAddress.getLocalHost(); + return iAdd.getHostAddress(); + } + + public static boolean isOSWindows() + { + String osName = System.getProperty("os.name"); + if(osName.startsWith(OS_WINDOWS)) + return true; + else + return false; + } +} diff --git a/posterita/posterita/src/main/org/posterita/core/install/POSInstall.java b/posterita/posterita/src/main/org/posterita/core/install/POSInstall.java new file mode 100644 index 0000000000..5e141453c8 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/core/install/POSInstall.java @@ -0,0 +1,423 @@ +package org.posterita.core.install; + +import java.io.BufferedInputStream; +import java.io.BufferedOutputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.FileWriter; +import java.io.IOException; +import java.io.InputStream; +import java.net.UnknownHostException; +import java.util.Enumeration; +import java.util.Properties; +import java.util.zip.ZipEntry; +import java.util.zip.ZipFile; + +import org.posterita.core.exception.FileOpException; + +public class POSInstall +{ + public static final boolean DEBUG = true; + private static final String DB_TYPE_ORACLE = "oracle"; +// private static final String DB_TYPE_FIREBIRD = "firebird"; + + private static final String DEFAULT_DB_NAME = "tmkpos"; + private static final String DB_PASSWORD = "compiere"; +// private static final String DB_SYSTEM_PASSWORD = "compiere"; + + private static final String START_SERVER_LINK_FILE = "Start Tamak ICT POS Server.lnk"; + private static final String STOP_SERVER_LINK_FILE = "Stop Tamak ICT POS Server.lnk"; + + private static final String INSTALLATIONSRC = "Compiere2"; + + private static final String INSTALLATION_PATH = "c:\\"; + private static final String FILE_SRC_DIR = "bin"; + + + private static void writeStream(File outFile, InputStream inStream) throws FileOpException + { + try + { + FileOutputStream fileOutStream = new FileOutputStream(outFile); + BufferedOutputStream bufferedOutStream = new BufferedOutputStream(fileOutStream); + BufferedInputStream bufferedInStream = new BufferedInputStream(inStream); + + byte buffer[] = new byte[1024]; + int read = -1; + + while((read = bufferedInStream.read(buffer)) != -1) + bufferedOutStream.write(buffer, 0, read); + bufferedOutStream.flush(); + bufferedOutStream.close(); + bufferedInStream.close(); + } + catch(IOException ex) + { + throw new FileOpException("Could not write file: " + outFile.getAbsolutePath(), ex); + } + } + + public static String getFileAsString(File inFile) throws FileOpException + { + try + { + FileInputStream fileInStream = new FileInputStream(inFile); + BufferedInputStream bufferedInStream = new BufferedInputStream(fileInStream); + ByteArrayOutputStream byteArrayOutStream = new ByteArrayOutputStream(); + + byte buffer[] = new byte[1024]; + int read; + + while((read = bufferedInStream.read(buffer)) != -1) + { + byteArrayOutStream.write(buffer, 0, read); + } + + byteArrayOutStream.flush(); + + String data = new String(byteArrayOutStream.toByteArray()); + byteArrayOutStream.close(); + bufferedInStream.close(); + fileInStream.close(); + + return data; + } + catch(IOException ex) + { + throw new FileOpException("Could not read file: " + inFile.getAbsolutePath(), ex); + } + + } + + public static void install(File srcFile, String installationPath) throws FileOpException + { + try + { + ZipFile zipFile = new ZipFile(srcFile); + + Enumeration zipEntryEnum = zipFile.entries(); + + while(zipEntryEnum.hasMoreElements()) + { + ZipEntry zipEntry = (ZipEntry)zipEntryEnum.nextElement(); + + if(zipEntry.isDirectory()) + { + File file = new File(installationPath + zipEntry.getName()); + if(DEBUG) + System.out.println("Creating directory: " + file.getAbsolutePath()); + if(!file.mkdirs()) + throw new FileOpException("Could not creat directory: " + file.getAbsolutePath()); + } + else + { + File file = new File(installationPath + zipEntry.getName()); + if(DEBUG) + System.out.println("Creating file: " + file.getAbsolutePath()); + InputStream inStream = zipFile.getInputStream(zipEntry); + writeStream(file, inStream); + inStream.close(); + } + } + } + catch(IOException ex) + { + throw new FileOpException("Could not create installation files", ex); + } + } + + /*private static void uninstall(File path) + { + File files[] = path.listFiles(); + + for(int i = 0; i < files.length; i++) + { + if(files[i].isDirectory()) + uninstall(files[i]); + else + files[i].delete(); + } + path.delete(); + }*/ + + private static void changeCompiereEnvSettings(File compEnvFile, File compHomeDir, String dbName, String dbType, String webstores) throws FileOpException + { + if(!(compEnvFile.exists() && compEnvFile.isFile())) + throw new FileOpException("Could not locate Compiere Environment settings, " + compEnvFile.getAbsolutePath()); + + Properties props = new Properties(); + FileInputStream fis = null; + FileOutputStream fileOutStream = null; + + try + { + fis = new FileInputStream(compEnvFile); + props.load(fis); + String hostName = EnvSettings.getHostName(); + + props.setProperty(EnvSettings.COMPIERE_APPS_SERVER, hostName); + props.setProperty(EnvSettings.COMPIERE_DB_SERVER, hostName); + props.setProperty(EnvSettings.COMPIERE_MAIL_SERVER, hostName); + props.setProperty(EnvSettings.COMPIERE_WEB_ALIAS, hostName); + + String jdbcConnString = ""; + if(dbType.equals(DB_TYPE_ORACLE)) + jdbcConnString = "jdbc:oracle:thin:@" + hostName + ":1521:" + dbName; + + props.setProperty(EnvSettings.COMPIERE_DB_URL, jdbcConnString); + props.setProperty(EnvSettings.COMPIERE_HOME, compHomeDir.getAbsolutePath()); + props.setProperty(EnvSettings.JAVA_HOME, EnvSettings.getJDKHomeDir().getAbsolutePath()); + props.setProperty(EnvSettings.COMPIERE_DB_TYPE, dbType); + props.setProperty(EnvSettings.COMPIERE_DB_NAME, dbName); + + String deployFolder = compHomeDir.getAbsolutePath() + + EnvSettings.PATH_SEPARATOR + "jboss" + + EnvSettings.PATH_SEPARATOR + "server" + + EnvSettings.PATH_SEPARATOR + "compiere" + + EnvSettings.PATH_SEPARATOR + "deploy"; + props.setProperty(EnvSettings.COMPIERE_APPS_DEPLOY, deployFolder); + props.setProperty(EnvSettings.COMPIERE_WEBSTORES, webstores); + + fileOutStream = new FileOutputStream(compEnvFile); + String comments = "Compiere"; + + String keystorePath = compHomeDir.getAbsolutePath() + "\\keystore\\myKeystore"; + + props.setProperty(EnvSettings.COMPIERE_KEYSTORE, keystorePath); + + props.store(fileOutStream, comments); + } + catch(IOException ex) + { + throw new FileOpException("Could not read Compiere Environment settings, " + compEnvFile.getAbsolutePath(), ex); + } + finally + { + if(fis != null) + { + try + { + fis.close(); + } + catch(Exception ex) + {} + } + + if (fileOutStream != null) + { + try + { + fileOutStream.close(); + } + catch(Exception e) + {} + } + } + } + + private static void changeEnviromentBatFile(File compEnvFile, String compHome) throws FileOpException + { + String envTemplateBatFilePath = compHome + EnvSettings.PATH_SEPARATOR + "utils" + EnvSettings.PATH_SEPARATOR + "myEnvironmentTemplate.bat"; + String oldEnvBatFilePath = compHome + EnvSettings.PATH_SEPARATOR + "utils" + EnvSettings.PATH_SEPARATOR + "myEnvironment.bat"; + FileInputStream fis = null; + + try + { + File oldEnvBatFile = new File(oldEnvBatFilePath); + oldEnvBatFile.delete(); + + Properties props = new Properties(); + fis = new FileInputStream(compEnvFile); + props.load(fis); + + String data = getFileAsString(new File(envTemplateBatFilePath)); + + Enumeration keysEnum = props.keys(); + while(keysEnum.hasMoreElements()) + { + String key = (String)keysEnum.nextElement(); + String value = (String)props.get(key); + + value = value.replaceAll("\\\\", "\\\\\\\\"); + + String fileKey = "@" + key + "@"; + data = data.replaceAll(fileKey, value); + } + + File newEnvBatFile = new File(oldEnvBatFilePath); + FileWriter fileWriter = new FileWriter(newEnvBatFile); + fileWriter.write(data); + fileWriter.flush(); + fileWriter.close(); + } + catch(IOException ex) + { + throw new FileOpException("Could not create environment settings bat file", ex); + } + + finally + { + if (fis != null) + { + try + { + fis.close(); + } + catch(Exception ex) + {} + } + } + + } + + private static void changeCompiereSettings(File compPropsFile, String dbType, String dbName) throws FileOpException + { + Properties props = new Properties(); + String dbTypeName = ""; + String dbPort = ""; + FileInputStream fis = null; + FileOutputStream fos = null; + + if(DB_TYPE_ORACLE.equals(dbType)) + { + dbTypeName = "Oracle"; + dbPort = "1521"; + } + else + { + dbTypeName = "Firebird"; + dbPort = "3050"; + } + + try + { + fis = new FileInputStream(compPropsFile); + props.load(fis); + + props.setProperty(EnvSettings.TEMP_DIR, EnvSettings.getTempDir().getAbsolutePath()); + String hostName = EnvSettings.getHostName(); + String connUrl = "xyzCConnection[name=" + + hostName + "{" + hostName + "-" + dbName + "-" + DB_PASSWORD + + "},AppsHost=" + hostName + ",AppsPort=1099,Profile=L,type=" + + dbTypeName + ",DBhost=" + hostName + ",DBport=" + dbPort + ",DBname=" + + dbName + ",BQ=false,FW=false,FWhost=,FWport=1630,UID=compiere,PWD=compiere]"; + props.setProperty(EnvSettings.CONNECTION, connUrl); + + fos = new FileOutputStream(compPropsFile); + props.store(fos, ""); + } + catch(IOException ex) + { + throw new FileOpException("Could not read data from properties file: " + compPropsFile.getAbsolutePath(), ex); + } + finally + { + if (fis != null) + { + try + { + fis.close(); + } + catch(Exception e) + {} + } + + if (fos != null) + { + try + + { + fos.close(); + } + catch(Exception e) + {} + } + } + } + + + private static void changeSettings(String installedPath) throws FileOpException + { + File compiereEnvProperties = new File(installedPath + EnvSettings.PATH_SEPARATOR + "CompiereEnv.properties"); + File compiereEnvPropertiesSave = new File(installedPath + EnvSettings.PATH_SEPARATOR + "CompiereEnv.properties.save"); + File compiereProperties = new File(installedPath + EnvSettings.PATH_SEPARATOR + "Compiere.properties"); + File compierePropertiesSave = new File(installedPath + EnvSettings.PATH_SEPARATOR + "Compiere.properties.save"); + changeCompiereEnvSettings(compiereEnvProperties, new File(installedPath), DEFAULT_DB_NAME, DB_TYPE_ORACLE, ""); + changeCompiereEnvSettings(compiereEnvPropertiesSave, new File(installedPath), DEFAULT_DB_NAME, DB_TYPE_ORACLE, ""); + changeCompiereSettings(compiereProperties, DB_TYPE_ORACLE, DEFAULT_DB_NAME); + changeCompiereSettings(compierePropertiesSave, DB_TYPE_ORACLE, DEFAULT_DB_NAME); + changeEnviromentBatFile(compiereEnvProperties, installedPath); + } + + private static void createShortcutFile() throws FileOpException, UnknownHostException + { + String desktop = EnvSettings.getUserDesktopDir().getAbsolutePath(); + String hostAddress = EnvSettings.getHostAddress(); + String shortcutFilePath = desktop + EnvSettings.PATH_SEPARATOR + "Tamak ICT POS.url"; + File outFile = new File(shortcutFilePath); + + try + { + FileWriter fileWriter = new FileWriter(outFile); + fileWriter.write("[InternetShortcut]\r\n"); + fileWriter.write("URL=http://" + hostAddress + "/posterita/" + "\r\n"); + fileWriter.flush(); + fileWriter.close(); + } + catch(IOException ex) + { + throw new FileOpException("Could not write url shortcut"); + } + + } + + private static void createShortcuts(String installedPath) throws FileOpException, UnknownHostException + { + String desktopPath = EnvSettings.getUserDesktopDir().getAbsolutePath(); + String startSeverLink = installedPath + EnvSettings.PATH_SEPARATOR + START_SERVER_LINK_FILE; + String deskStartServerLink = desktopPath + EnvSettings.PATH_SEPARATOR + START_SERVER_LINK_FILE; + String stopSeverLink = installedPath + EnvSettings.PATH_SEPARATOR + STOP_SERVER_LINK_FILE; + String deskStopServerLink = desktopPath + EnvSettings.PATH_SEPARATOR + STOP_SERVER_LINK_FILE; + + try + { + writeStream(new File(deskStartServerLink), new FileInputStream(startSeverLink)); + writeStream(new File(deskStopServerLink), new FileInputStream(stopSeverLink)); + createShortcutFile(); + } + catch(FileNotFoundException ex) + { + throw new FileOpException("Could not write shortcuts", ex); + } + } + + private static void installTamakICTPOS() throws FileOpException, UnknownHostException + { + String workingDir = EnvSettings.getWorkingDir().getAbsolutePath(); + + String srcFile = workingDir + EnvSettings.PATH_SEPARATOR + FILE_SRC_DIR + EnvSettings.PATH_SEPARATOR + INSTALLATIONSRC; + String installationPath = INSTALLATION_PATH; + install(new File(srcFile), installationPath); + String installedPath = installationPath + INSTALLATIONSRC; + changeSettings(installedPath); + createShortcuts(installedPath); + } + + public static void main(String args[]) + { + try + { + installTamakICTPOS(); + System.out.println("Installation successfull"); + } + catch(Exception ex) + { + System.out.println("Installation failed: " + ex.getMessage()); + if(DEBUG) + ex.printStackTrace(); + } + } +} diff --git a/posterita/posterita/src/main/org/posterita/core/utils/DisplayReportServlet.java b/posterita/posterita/src/main/org/posterita/core/utils/DisplayReportServlet.java new file mode 100644 index 0000000000..390124de27 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/core/utils/DisplayReportServlet.java @@ -0,0 +1,95 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * 03-Aug-2006 14:29:15 by praveen + * + */ + +package org.posterita.core.utils; + +import java.io.BufferedInputStream; +import java.io.BufferedOutputStream; +import java.io.File; +import java.io.FileInputStream; + +import javax.servlet.ServletException; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.compiere.util.MimeType; + +import org.posterita.businesslogic.performanceanalysis.ReportManager; + +public class DisplayReportServlet extends HttpServlet +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public void doGet(HttpServletRequest request,HttpServletResponse response) throws ServletException + { + String reportURI = request.getRequestURI(); + int index = reportURI.lastIndexOf("/"); + String reportName = reportURI.substring(index+1); + + String reportPath = ReportManager.getReportPath(reportName); + + File f = new File(reportPath); + + if(!f.exists()) + { + throw new ServletException("Unable to load " + reportName + ". Cause file not found."); + } + + String mimeType = null; + mimeType = MimeType.getMimeType(reportName); + + try + { + response.setContentType(mimeType); + + FileInputStream fis = new FileInputStream(f); + BufferedInputStream bis = new BufferedInputStream(fis); + BufferedOutputStream bos = new BufferedOutputStream(response.getOutputStream()); + + //Transfer bytes from bis to bos + byte[] buf = new byte[1024]; + int len; + while ((len = bis.read(buf)) > 0) + { + bos.write(buf, 0, len); + } + bis.close(); + + bos.flush(); + bos.close(); + + } + catch (Exception e) + { + throw new ServletException(e); + } + } + + public void doPost(HttpServletRequest request,HttpServletResponse response) throws ServletException + { + doGet(request,response); + } +} diff --git a/posterita/posterita/src/main/org/posterita/core/utils/Encrypter.java b/posterita/posterita/src/main/org/posterita/core/utils/Encrypter.java new file mode 100644 index 0000000000..75e7a2b436 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/core/utils/Encrypter.java @@ -0,0 +1,61 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + **/ +package org.posterita.core.utils; + +import org.posterita.core.Range; +import org.posterita.exceptions.EncryptionException; + +public class Encrypter +{ + + public static String encrypt(String str, int fromFirst, int toLast) throws EncryptionException + { + if (toLast < fromFirst) + throw new EncryptionException("To range cannot be less than from range!"); + + int strLength = str.length(); + + Range range = new Range(0, strLength); + + + if (!range.isInRange(fromFirst) || !range.isInRange(toLast)) + throw new EncryptionException("Cannot do encryption for " + str + " as the characters to encode are not in the range provided: " + fromFirst + " - " + toLast); + + String firstUnEncryptedCharacters = str.substring(0, fromFirst); + String lastUnEncryptedCharacters = str.substring(toLast, strLength); + + //String encryptedString = firstUnEncryptedCharacters; + StringBuffer encryptedString = new StringBuffer(); + encryptedString.append(firstUnEncryptedCharacters); + + + for (int i = 0; i < toLast-fromFirst; i++) + { + encryptedString.append("X"); + } + + encryptedString.append(lastUnEncryptedCharacters); + + + return encryptedString.toString(); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/core/utils/FormatBigDecimal.java b/posterita/posterita/src/main/org/posterita/core/utils/FormatBigDecimal.java new file mode 100644 index 0000000000..3e63f544d5 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/core/utils/FormatBigDecimal.java @@ -0,0 +1,46 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + **/ +package org.posterita.core.utils; + +import java.math.BigDecimal; + +public class FormatBigDecimal +{ + public static BigDecimal currency(BigDecimal bd) + { + return bd.setScale(2, BigDecimal.ROUND_HALF_UP); + } + + public static BigDecimal currency1(BigDecimal bd) + { + return bd.setScale(2, BigDecimal.ROUND_HALF_DOWN); + } + + public static BigDecimal currency(double d) + { + BigDecimal bd = new BigDecimal(d).setScale(2, BigDecimal.ROUND_HALF_UP); + return bd; + } + + + + +} diff --git a/posterita/posterita/src/main/org/posterita/core/utils/IOUtil.java b/posterita/posterita/src/main/org/posterita/core/utils/IOUtil.java new file mode 100644 index 0000000000..f2f38d8e08 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/core/utils/IOUtil.java @@ -0,0 +1,88 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + **/ + +/** + @author ashley + */ + +package org.posterita.core.utils; + +import java.io.BufferedInputStream; +import java.io.BufferedOutputStream; +import java.io.BufferedReader; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.Reader; + +import org.posterita.core.exception.IOOperationException; + +public class IOUtil +{ + + public static byte[] getByteArray(InputStream inStream) throws IOOperationException + { + try + { + BufferedInputStream bufferedInStream = new BufferedInputStream(inStream); + ByteArrayOutputStream outStream = new ByteArrayOutputStream(); + BufferedOutputStream bufferedOutStream = new BufferedOutputStream(outStream); + byte buffer[] = new byte[1024]; + int read = 0; + while((read = bufferedInStream.read(buffer)) != -1) + { + bufferedOutStream.write(buffer, 0, read); + } + + bufferedOutStream.flush(); + byte retData[] = outStream.toByteArray(); + bufferedOutStream.close(); + bufferedInStream.close(); + outStream.close(); + return retData; + } + catch(IOException ex) + { + throw new IOOperationException("Could not get data from InputStream", ex); + } + } + + public static StringBuffer getContent(Reader reader, String newLineChar) throws IOOperationException + { + try + { + StringBuffer retDataBuffer = new StringBuffer(1000); + BufferedReader bufferedReader = new BufferedReader(reader); + + String line; + + while((line = bufferedReader.readLine()) != null) + retDataBuffer.append(line + newLineChar); + + return retDataBuffer; + } + catch(IOException ex) + { + throw new IOOperationException("Could not read data from reader", ex); + } + + } +} diff --git a/posterita/posterita/src/main/org/posterita/core/utils/MonthConverter.java b/posterita/posterita/src/main/org/posterita/core/utils/MonthConverter.java new file mode 100644 index 0000000000..aefc6c12e9 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/core/utils/MonthConverter.java @@ -0,0 +1,76 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + **/ +package org.posterita.core.utils; + +public class MonthConverter +{ + + public static String getMonth(Integer month) + { + + switch (month) + { + + case 1: + return "January"; + + case 2: + return "February"; + + case 3: + return "March"; + + case 4: + return "April"; + + case 5: + return "May"; + + case 6: + return "June"; + + case 7: + return "July"; + + case 8: + return "August"; + + case 9: + return "September"; + + case 10: + return "October"; + + case 11: + return "November"; + + case 12: + return "December"; + + + default: + return "January"; + } + + + } + +} diff --git a/posterita/posterita/src/main/org/posterita/core/utils/NumberUtil.java b/posterita/posterita/src/main/org/posterita/core/utils/NumberUtil.java new file mode 100644 index 0000000000..09ba0c91ee --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/core/utils/NumberUtil.java @@ -0,0 +1,20 @@ +package org.posterita.core.utils; + +public class NumberUtil +{ + public static boolean isSquareNumber(int x) + { + return isSquareNumber((double)x); + } + + public static boolean isSquareNumber(double x) + { + double num = Math.sqrt(x); + int iNum = (int)num; + + if((double)iNum == num) + return true; + else + return false; + } +} diff --git a/posterita/posterita/src/main/org/posterita/core/utils/SimpleEmailLayout.java b/posterita/posterita/src/main/org/posterita/core/utils/SimpleEmailLayout.java new file mode 100644 index 0000000000..ba81d180e0 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/core/utils/SimpleEmailLayout.java @@ -0,0 +1,192 @@ +/* + * Copyright (c) 2004 Kaizensoft Ltd. All Rights Reserved. + * + * This software is the confidential and proprietary information of + * Kaizensoft Ltd. ("Confidential Information"). You shall not + * disclose such Confidential Information and shall use it only in + * accordance with the terms of the license agreement you entered into + * with Kaizensoft. + * + * KAIZENSOFT MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE + * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT + * NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR + * A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. KAIZENSOFT SHALL NOT + * BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, + * MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. + * + * Created on Nov 22, 2004 + */ + +package org.posterita.core.utils; + + +public class SimpleEmailLayout +{ + + public static final String header = + + "" + + "" + + "Email" + + ""+ + + "" + + "" + + "" + + "" + + "" + + + "" + + "" + + ""; + + public static final String contentSection = + + "" + + "" + + "" + + + "" + + "" + + "" + + + "" + + "" + + "" + + + "" + + "" + + "" + + "
    " + + "" + + "\"Tamak" + + "" + + + ""; + + + public static final String closeHeaderTitle = + "" + + "
    " + + " " + + "
    " + + "" + + "" + + "" + + "" + + "
    " + + ""; + + public static final String separator = closeHeaderTitle + contentSection; + + public static final String openTagTR = ""; + public static final String closeTagTR = ""; + public static final String openTagTD = ""; + + public static final String openTagFontWhite = ""; + public static final String closeTagFont = ""; + public static final String openTagFont = ""; + + + + public static final String openTagTR_TD = + openTagTR + + openTagTD + + "" ; + + public static final String closeTagTD_TR = + "" + + closeTagTD + + closeTagTR; + + public static final String space = + "" + + "" + + ""; + + public static final String closeAndStartTagTR_TD = closeTagTD_TR + openTagTR_TD; + + public static final String closeTagTR_space_StartTagTR = closeTagTD_TR + space + openTagTR_TD; + + + public static final String footer(String str) + { + + String footer = "
    "; + public static final String closeTagTD = "
    " + + " " + + "
    " + + "
    " + + "
    " + + "" + str + "" + + "
    " + + "" + + "Tamak.com" + + "" + + "
    " + + "" + + ""; + + return footer; + } + + public static final String openInnerTable() + { + String startInnerTable = openTagTR_TD + ""; + + return startInnerTable; + } + + + public static final String closeInnerTable() + { + String closeInnerTable = "
    " + closeTagTD_TR; + + return closeInnerTable; + } + + public static final String innerTableHeader(String[] args) + { + StringBuffer strBuffer = new StringBuffer(); + + strBuffer.append(""); + + + for (int i = 0; i < args.length; i++) + { + String field = args[i]; + + strBuffer.append( + SimpleEmailLayout.openTagTD + + SimpleEmailLayout.openTagFontWhite + field + SimpleEmailLayout.closeTagFont + + SimpleEmailLayout.closeTagTD); + } + + + strBuffer.append(SimpleEmailLayout.closeTagTR); + + return strBuffer.toString(); + } + + public static final String innerTableRow(String[] args) + { + StringBuffer strBuffer = new StringBuffer(); + + strBuffer.append(""); + + for (int i = 0; i < args.length; i++) + { + String field = args[i]; + + strBuffer.append( + SimpleEmailLayout.openTagTD + + SimpleEmailLayout.openTagFont + field + SimpleEmailLayout.closeTagFont + + SimpleEmailLayout.closeTagTD); + } + + strBuffer.append(SimpleEmailLayout.closeTagTR); + + return strBuffer.toString(); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/decorator/HistoryCsvExportWrapper.java b/posterita/posterita/src/main/org/posterita/decorator/HistoryCsvExportWrapper.java new file mode 100644 index 0000000000..10842f2281 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/decorator/HistoryCsvExportWrapper.java @@ -0,0 +1,33 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2008 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package org.posterita.decorator; + +import org.posterita.beans.POSHistoryBean; + +public class HistoryCsvExportWrapper extends HistoryWrapper +{ + public String getLinkPartnerName() + { + POSHistoryBean bean = (POSHistoryBean) this.getCurrentRowObject(); + + return bean.getPartnerName(); + } +} diff --git a/posterita/posterita/src/main/org/posterita/decorator/HistoryPdfExportWrapper.java b/posterita/posterita/src/main/org/posterita/decorator/HistoryPdfExportWrapper.java new file mode 100644 index 0000000000..39a78e9ef6 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/decorator/HistoryPdfExportWrapper.java @@ -0,0 +1,25 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2008 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +package org.posterita.decorator; + +public class HistoryPdfExportWrapper extends HistoryCsvExportWrapper +{ + +} diff --git a/posterita/posterita/src/main/org/posterita/decorator/HistoryRtfExportWrapper.java b/posterita/posterita/src/main/org/posterita/decorator/HistoryRtfExportWrapper.java new file mode 100644 index 0000000000..7024bea6ad --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/decorator/HistoryRtfExportWrapper.java @@ -0,0 +1,25 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2008 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +package org.posterita.decorator; + +public class HistoryRtfExportWrapper extends HistoryWrapper +{ + +} diff --git a/posterita/posterita/src/main/org/posterita/decorator/HistoryWrapper.java b/posterita/posterita/src/main/org/posterita/decorator/HistoryWrapper.java new file mode 100644 index 0000000000..9656ac8d39 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/decorator/HistoryWrapper.java @@ -0,0 +1,151 @@ +package org.posterita.decorator; + +import javax.servlet.http.HttpServletRequest; + +import org.compiere.model.MOrder; +import org.compiere.process.DocAction; +import org.compiere.util.Env; +import org.displaytag.decorator.TableDecorator; +import org.posterita.Constants; +import org.posterita.beans.InventoryBean; +import org.posterita.beans.POSHistoryBean; +import org.posterita.businesslogic.POSManager; +import org.posterita.core.bean.ElementBean; +import org.posterita.core.businesslogic.ElementManager; +import org.posterita.lib.UdiConstants; + +public class HistoryWrapper extends TableDecorator +{ + + public String getLinkPartnerName() + { + POSHistoryBean bean = (POSHistoryBean) this.getCurrentRowObject(); + + String url = "POSCustomerAction.do?action=viewPOSCustomer&bpartnerId=" + bean.getBpartnerId(); + + if ("No".equals(bean.getIsCustomer())) + url = "POSVendorAction.do?action=viewVendorDetails1&bpartnerId=" + bean.getBpartnerId(); + + + String urlLink = "" + bean.getPartnerName() + ""; + + return urlLink; + } + + public String getReprint() + { + POSHistoryBean bean = (POSHistoryBean) this.getCurrentRowObject(); + + HttpServletRequest req = (HttpServletRequest) this.getPageContext().getRequest(); + + String printing = POSManager.getDataFromCookie(req, "preference.printing"); + ElementBean msgBean = ElementManager.getMsg(Env.getCtx(), "reprint"); + + String link = "" + + msgBean.getName() + + ""; + + if (printing != null && !printing.equals("")) + { + if ("true".equals(printing)) + { + link = "" + + msgBean.getName() + + ""; + } + } + + return link; + } + + public String getPaymentRule() + { + POSHistoryBean bean = (POSHistoryBean) this.getCurrentRowObject(); + + String paymentRule = bean.getPaymentRule(); + String paymentRuleMsg = ""; + + if (MOrder.PAYMENTRULE_Cash.equals(paymentRule)) + { + paymentRuleMsg = Constants.PAYMENT_RULE_CASH_MSG; + } + else if (MOrder.PAYMENTRULE_CreditCard.equals(paymentRule)) + { + paymentRuleMsg = Constants.PAYMENT_RULE_CARD_MSG; + } + else if (MOrder.PAYMENTRULE_Check.equals(paymentRule)) + { + paymentRuleMsg = Constants.PAYMENT_RULE_CHEQUE_MSG; + } + else if (UdiConstants.PAYMENTRULE_MIXED.equals(paymentRule)) + { + paymentRuleMsg = Constants.PAYMENT_RULE_MIXED_MSG; + } + else if (MOrder.PAYMENTRULE_OnCredit.equals(paymentRule)) + { + paymentRuleMsg = Constants.PAYMENT_RULE_CREDIT_MSG; + } + + ElementBean msgBean = ElementManager.getMsg(Env.getCtx(), paymentRuleMsg); + + return msgBean.getName(); + } + + public String getDocStatus() + { + POSHistoryBean bean = (POSHistoryBean) this.getCurrentRowObject(); + + String docStatus = bean.getDocStatus(); + String docStatusMsg = ""; + + if (DocAction.STATUS_Drafted.equals(docStatus)) + docStatusMsg = Constants.DOC_STATUS_DRAFTED; + else + if (DocAction.STATUS_InProgress.equals(docStatus)) + docStatusMsg = Constants.DOC_STATUS_INPROGRESS; + else + if (DocAction.STATUS_Completed.equals(docStatus)) + docStatusMsg = Constants.DOC_STATUS_COMPLETED; + else + if (DocAction.STATUS_Closed.equals(docStatus)) + docStatusMsg = Constants.DOC_STATUS_CLOSED; + else + if (DocAction.STATUS_Invalid.equals(docStatus)) + docStatusMsg = Constants.DOC_STATUS_INVALID; + + ElementBean msgBean = ElementManager.getMsg(Env.getCtx(), docStatusMsg); + return msgBean.getName(); + } + + + public String getDelete() + { + InventoryBean bean = (InventoryBean) this.getCurrentRowObject(); + + String docStatus = bean.getDocStatus(); + + String link = ""; + + if (!DocAction.STATUS_Completed.equals(docStatus)) + { + link = "" + + "Delete" + + ""; + + } + return link; + } + + + public String getInventoryNo() + { + InventoryBean bean = (InventoryBean) this.getCurrentRowObject(); + + String link = "" + + bean.getInventoryNo() + + ""; + + return link; + } + +} diff --git a/posterita/posterita/src/main/org/posterita/decorator/InventoryHistoryWrapper.java b/posterita/posterita/src/main/org/posterita/decorator/InventoryHistoryWrapper.java new file mode 100644 index 0000000000..4fc0856a2f --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/decorator/InventoryHistoryWrapper.java @@ -0,0 +1,88 @@ +package org.posterita.decorator; + +import org.compiere.process.DocAction; +import org.compiere.util.Env; +import org.displaytag.decorator.TableDecorator; +import org.posterita.Constants; +import org.posterita.beans.InventoryBean; +import org.posterita.core.bean.ElementBean; +import org.posterita.core.businesslogic.ElementManager; + +public class InventoryHistoryWrapper extends TableDecorator +{ + public String getDocStatus() + { + InventoryBean bean = (InventoryBean) this.getCurrentRowObject(); + + String docStatus = bean.getDocStatus(); + String docStatusMsg = ""; + + if (DocAction.STATUS_Drafted.equals(docStatus)) + docStatusMsg = Constants.DOC_STATUS_DRAFTED; + else + if (DocAction.STATUS_InProgress.equals(docStatus)) + docStatusMsg = Constants.DOC_STATUS_INPROGRESS; + else + if (DocAction.STATUS_Completed.equals(docStatus)) + docStatusMsg = Constants.DOC_STATUS_COMPLETED; + else + if (DocAction.STATUS_Closed.equals(docStatus)) + docStatusMsg = Constants.DOC_STATUS_CLOSED; + else + if (DocAction.STATUS_Invalid.equals(docStatus)) + docStatusMsg = Constants.DOC_STATUS_INVALID; + else + if (DocAction.STATUS_Voided.equals(docStatus)) + docStatusMsg = Constants.DOC_STATUS_VOID; + + ElementBean msgBean = ElementManager.getMsg(Env.getCtx(), docStatusMsg); + return msgBean.getName(); + } + + + public String getDelete() + { + InventoryBean bean = (InventoryBean) this.getCurrentRowObject(); + + String docStatus = bean.getDocStatus(); + + String link = ""; + + if (!DocAction.STATUS_Completed.equals(docStatus) && !DocAction.STATUS_Closed.equals(docStatus)) + { + link = "" + + "Delete" + + ""; + + } + return link; + } + + public String getSelect() + { + InventoryBean bean = (InventoryBean) this.getCurrentRowObject(); + + String docStatus = bean.getDocStatus(); + + String link = ""; + + if (DocAction.STATUS_Drafted.equals(docStatus)) + { + link = ""; + + } + return link; + } + + + public String getInventoryNo() + { + InventoryBean bean = (InventoryBean) this.getCurrentRowObject(); + + String link = "" + + bean.getInventoryNo() + + ""; + + return link; + } +} diff --git a/posterita/posterita/src/main/org/posterita/decorator/InventoryMoveHistoryWrapper.java b/posterita/posterita/src/main/org/posterita/decorator/InventoryMoveHistoryWrapper.java new file mode 100644 index 0000000000..6b9b3357da --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/decorator/InventoryMoveHistoryWrapper.java @@ -0,0 +1,88 @@ +package org.posterita.decorator; + +import org.compiere.process.DocAction; +import org.compiere.util.Env; +import org.displaytag.decorator.TableDecorator; +import org.posterita.Constants; +import org.posterita.beans.StockMovementBean; +import org.posterita.core.bean.ElementBean; +import org.posterita.core.businesslogic.ElementManager; + +public class InventoryMoveHistoryWrapper extends TableDecorator +{ + public String getDocStatus() + { + StockMovementBean bean = (StockMovementBean) this.getCurrentRowObject(); + + String docStatus = bean.getDocStatus(); + String docStatusMsg = ""; + + if (DocAction.STATUS_Drafted.equals(docStatus)) + docStatusMsg = Constants.DOC_STATUS_DRAFTED; + else + if (DocAction.STATUS_InProgress.equals(docStatus)) + docStatusMsg = Constants.DOC_STATUS_INPROGRESS; + else + if (DocAction.STATUS_Completed.equals(docStatus)) + docStatusMsg = Constants.DOC_STATUS_COMPLETED; + else + if (DocAction.STATUS_Closed.equals(docStatus)) + docStatusMsg = Constants.DOC_STATUS_CLOSED; + else + if (DocAction.STATUS_Invalid.equals(docStatus)) + docStatusMsg = Constants.DOC_STATUS_INVALID; + else + if (DocAction.STATUS_Voided.equals(docStatus)) + docStatusMsg = Constants.DOC_STATUS_VOID; + + ElementBean msgBean = ElementManager.getMsg(Env.getCtx(), docStatusMsg); + return msgBean.getName(); + } + + public String getDelete() + { + StockMovementBean bean = (StockMovementBean) this.getCurrentRowObject(); + + String docStatus = bean.getDocStatus(); + + String link = ""; + + if (!DocAction.STATUS_Completed.equals(docStatus) && !DocAction.STATUS_Closed.equals(docStatus)) + { + link = "" + + "Delete" + + ""; + + } + return link; + } + + public String getEdit() + { + StockMovementBean bean = (StockMovementBean) this.getCurrentRowObject(); + + String docStatus = bean.getDocStatus(); + + String link = ""; + + if (!DocAction.STATUS_Completed.equals(docStatus)) + { + link = "" + + "Edit" + + ""; + + } + return link; + } + + public String getDocumentNo() + { + StockMovementBean bean = (StockMovementBean) this.getCurrentRowObject(); + + String link = "" + + bean.getDocumentNo() + + ""; + + return link; + } +} diff --git a/posterita/posterita/src/main/org/posterita/decorator/PaymentDecorator.java b/posterita/posterita/src/main/org/posterita/decorator/PaymentDecorator.java new file mode 100644 index 0000000000..44cb9b40ca --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/decorator/PaymentDecorator.java @@ -0,0 +1,50 @@ +package org.posterita.decorator; + +import javax.servlet.jsp.PageContext; + +import org.compiere.model.MOrder; +import org.compiere.util.Env; +import org.displaytag.decorator.DisplaytagColumnDecorator; +import org.displaytag.exception.DecoratorException; +import org.displaytag.properties.MediaTypeEnum; +import org.posterita.Constants; +import org.posterita.core.bean.ElementBean; +import org.posterita.core.businesslogic.ElementManager; +import org.posterita.lib.UdiConstants; + +public class PaymentDecorator implements DisplaytagColumnDecorator +{ + + public Object decorate(Object columnValue, PageContext pageContext, MediaTypeEnum media) throws DecoratorException + { + String paymentRule = (String) columnValue; + + ElementBean bean = ElementManager.getMsg(Env.getCtx(), getPaymentRuleDisplayMessage(paymentRule)); + + return bean.getName(); + } + + + public static String getPaymentRuleDisplayMessage(String paymentRule) + { + if (MOrder.PAYMENTRULE_Cash.equals(paymentRule)) + return Constants.PAYMENT_RULE_CASH_MSG; + else + if (MOrder.PAYMENTRULE_CreditCard.equals(paymentRule)) + return Constants.PAYMENT_RULE_CARD_MSG; + else + if (MOrder.PAYMENTRULE_Check.equals(paymentRule)) + return Constants.PAYMENT_RULE_CHEQUE_MSG; + else + if (UdiConstants.PAYMENTRULE_MIXED.equals(paymentRule)) + return Constants.PAYMENT_RULE_MIXED_MSG; + else + if (MOrder.PAYMENTRULE_OnCredit.equals(paymentRule)) + return Constants.PAYMENT_RULE_CREDIT_MSG; + + return ""; + } + + + +} diff --git a/posterita/posterita/src/main/org/posterita/doctype/UDIDocSubTypeSO.java b/posterita/posterita/src/main/org/posterita/doctype/UDIDocSubTypeSO.java new file mode 100644 index 0000000000..33535a4a90 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/doctype/UDIDocSubTypeSO.java @@ -0,0 +1,26 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Dec 26, 2006 + */ +package org.posterita.doctype; + +public interface UDIDocSubTypeSO +{ + public String getDocTypeSubSO(); +} diff --git a/posterita/posterita/src/main/org/posterita/doctype/UDIDocSubTypeSOValues.java b/posterita/posterita/src/main/org/posterita/doctype/UDIDocSubTypeSOValues.java new file mode 100644 index 0000000000..fe3427774b --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/doctype/UDIDocSubTypeSOValues.java @@ -0,0 +1,123 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Dec 26, 2006 + */ + +package org.posterita.doctype; + +import org.compiere.model.MDocType; + +public class UDIDocSubTypeSOValues +{ + private UDIDocSubTypeSOValues() + { + + } + + + public static UDIDocSubTypeSO DOCTYPESO_OnCreditOrder = new OnCreditOrder(); + public static UDIDocSubTypeSO DOCTYPESO_POSOrder = new POSOrder(); + public static UDIDocSubTypeSO DOCTYPESO_PrepayOrder = new PrepayOrder(); + public static UDIDocSubTypeSO DOCTYPESO_Proposal = new Proposal(); + public static final UDIDocSubTypeSO DOCTYPESO_Quotation = new Quotation(); + public static UDIDocSubTypeSO DOCTYPESO_ReturnMaterial = new ReturnMaterial(); + public static UDIDocSubTypeSO DOCTYPESO_StandardOrder = new StandardOrder(); + public static UDIDocSubTypeSO DOCTYPESO_WarehouseOrder = new WarehouseOrder(); + + public static class OnCreditOrder implements UDIDocSubTypeSO + { + + public String getDocTypeSubSO() + { + return MDocType.DOCSUBTYPESO_OnCreditOrder; + } + + } + + public static class POSOrder implements UDIDocSubTypeSO + { + + public String getDocTypeSubSO() + { + return MDocType.DOCSUBTYPESO_POSOrder; + } + + } + + public static class PrepayOrder implements UDIDocSubTypeSO + { + + public String getDocTypeSubSO() + { + return MDocType.DOCSUBTYPESO_PrepayOrder; + } + + } + + public static class Proposal implements UDIDocSubTypeSO + { + + public String getDocTypeSubSO() + { + return MDocType.DOCSUBTYPESO_Proposal; + } + + } + + public static class Quotation implements UDIDocSubTypeSO + { + + public String getDocTypeSubSO() + { + return MDocType.DOCSUBTYPESO_Quotation; + } + + } + + public static class ReturnMaterial implements UDIDocSubTypeSO + { + + public String getDocTypeSubSO() + { + return MDocType.DOCSUBTYPESO_ReturnMaterial; + } + + } + + public static class StandardOrder implements UDIDocSubTypeSO + { + + public String getDocTypeSubSO() + { + return MDocType.DOCSUBTYPESO_StandardOrder; + } + + } + + public static class WarehouseOrder implements UDIDocSubTypeSO + { + + public String getDocTypeSubSO() + { + return MDocType.DOCSUBTYPESO_WarehouseOrder; + } + + } + +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/AllocatedAmtMoreThanOpenAmtException.java b/posterita/posterita/src/main/org/posterita/exceptions/AllocatedAmtMoreThanOpenAmtException.java new file mode 100644 index 0000000000..3e96d1da3c --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/AllocatedAmtMoreThanOpenAmtException.java @@ -0,0 +1,37 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Dec 26, 2006 + */ + + +package org.posterita.exceptions; + + +public class AllocatedAmtMoreThanOpenAmtException extends OperationException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public AllocatedAmtMoreThanOpenAmtException(String message) + { + super(message); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/AllocationAlreadyExistsException.java b/posterita/posterita/src/main/org/posterita/exceptions/AllocationAlreadyExistsException.java new file mode 100644 index 0000000000..e87c04d3bc --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/AllocationAlreadyExistsException.java @@ -0,0 +1,34 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ +package org.posterita.exceptions; + + +public class AllocationAlreadyExistsException extends OperationException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public AllocationAlreadyExistsException(String exception) + { + super(exception); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/ApplicationException.java b/posterita/posterita/src/main/org/posterita/exceptions/ApplicationException.java new file mode 100644 index 0000000000..1dc5f8b2b4 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/ApplicationException.java @@ -0,0 +1,49 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + */ +package org.posterita.exceptions; + + + +/** + * @author fred + * + *To change the template for this generated type comment go to + * Window - Preferences - Java - Code Style - Code Templates + */ +public class ApplicationException extends Exception +{ + + /** + * + */ + private static final long serialVersionUID = 1L; + + public ApplicationException() + { + super(); + } + + public ApplicationException(String message) + { + super(message); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/AttachmentInvalidException.java b/posterita/posterita/src/main/org/posterita/exceptions/AttachmentInvalidException.java new file mode 100644 index 0000000000..b4094edd1d --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/AttachmentInvalidException.java @@ -0,0 +1,39 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +* Created on Mar 29, 2006 by ashley +* +*/ + +package org.posterita.exceptions; + +import org.posterita.exceptions.DataException; + +public class AttachmentInvalidException extends DataException +{ + + /** + * + */ + private static final long serialVersionUID = 1L; + + public AttachmentInvalidException(String msg) + { + super(msg); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/AttachmentNotFoundException.java b/posterita/posterita/src/main/org/posterita/exceptions/AttachmentNotFoundException.java new file mode 100644 index 0000000000..cb0be51656 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/AttachmentNotFoundException.java @@ -0,0 +1,36 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +* Created on May 8, 2006 by ashley +* +*/ + +package org.posterita.exceptions; + +public class AttachmentNotFoundException extends OperationException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public AttachmentNotFoundException(String msg) + { + super(msg); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/AttributeValueAlreadyExistsException.java b/posterita/posterita/src/main/org/posterita/exceptions/AttributeValueAlreadyExistsException.java new file mode 100644 index 0000000000..aa2c77d09b --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/AttributeValueAlreadyExistsException.java @@ -0,0 +1,35 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Aug 3, 2005 by praveen + * + */ +package org.posterita.exceptions; + +public class AttributeValueAlreadyExistsException extends OperationException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public AttributeValueAlreadyExistsException(String exception) + { + super(exception); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/AttributeValuesDifferentException.java b/posterita/posterita/src/main/org/posterita/exceptions/AttributeValuesDifferentException.java new file mode 100644 index 0000000000..af6766413b --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/AttributeValuesDifferentException.java @@ -0,0 +1,37 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +* Created on May 17, 2006 by ashley +* +*/ + +package org.posterita.exceptions; + +public class AttributeValuesDifferentException extends OperationException +{ + + /** + * + */ + private static final long serialVersionUID = 1L; + + public AttributeValuesDifferentException(String msg) + { + super(msg); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/BPGroupException.java b/posterita/posterita/src/main/org/posterita/exceptions/BPGroupException.java new file mode 100644 index 0000000000..bd2d39c825 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/BPGroupException.java @@ -0,0 +1,38 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +* Created on Apr 5, 2006 by ashley +* +*/ + +package org.posterita.exceptions; + +import org.posterita.exceptions.OperationException; + +public class BPGroupException extends OperationException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public BPGroupException(String msg) + { + super(msg); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/BPartnerAlreadyExistException.java b/posterita/posterita/src/main/org/posterita/exceptions/BPartnerAlreadyExistException.java new file mode 100644 index 0000000000..86ce0792ab --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/BPartnerAlreadyExistException.java @@ -0,0 +1,37 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +* Created on Apr 5, 2006 by ashley +* +*/ + +package org.posterita.exceptions; + + +public class BPartnerAlreadyExistException extends BPartnerException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public BPartnerAlreadyExistException(String msg) + { + super(msg); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/BPartnerAlreadyExistsException.java b/posterita/posterita/src/main/org/posterita/exceptions/BPartnerAlreadyExistsException.java new file mode 100644 index 0000000000..e0dd70a7d0 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/BPartnerAlreadyExistsException.java @@ -0,0 +1,36 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 01-Aug-2005 by alok + * + */ +package org.posterita.exceptions; + + +public class BPartnerAlreadyExistsException extends OperationException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public BPartnerAlreadyExistsException(String exception) + { + super(exception); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/BPartnerException.java b/posterita/posterita/src/main/org/posterita/exceptions/BPartnerException.java new file mode 100644 index 0000000000..09c29d6db5 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/BPartnerException.java @@ -0,0 +1,39 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +* Created on Apr 17, 2006 by ashley +* +*/ + +package org.posterita.exceptions; + +import org.posterita.exceptions.OperationException; + +public class BPartnerException extends OperationException +{ + + /** + * + */ + private static final long serialVersionUID = 1L; + + public BPartnerException(String msg) + { + super(msg); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/BPartnerInvalidException.java b/posterita/posterita/src/main/org/posterita/exceptions/BPartnerInvalidException.java new file mode 100644 index 0000000000..991cc13d2b --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/BPartnerInvalidException.java @@ -0,0 +1,38 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +* Created on Mar 29, 2006 by ashley +* +*/ + +package org.posterita.exceptions; + +import org.posterita.exceptions.DataException; + +public class BPartnerInvalidException extends DataException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public BPartnerInvalidException(String msg) + { + super(msg); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/BPartnerNoLocationException.java b/posterita/posterita/src/main/org/posterita/exceptions/BPartnerNoLocationException.java new file mode 100644 index 0000000000..20256de4e2 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/BPartnerNoLocationException.java @@ -0,0 +1,38 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +* +* Created on Nov 8, 2006 by ashley +* +*/ + +/** + @author ashley + */ + +package org.posterita.exceptions; + +public class BPartnerNoLocationException extends OperationException +{ + private static final long serialVersionUID = 1L; + + public BPartnerNoLocationException(String msg) + { + super(msg); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/BPartnerNotFoundException.java b/posterita/posterita/src/main/org/posterita/exceptions/BPartnerNotFoundException.java new file mode 100644 index 0000000000..92b717a4dc --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/BPartnerNotFoundException.java @@ -0,0 +1,38 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +* Created on Apr 17, 2006 by ashley +* +*/ + +package org.posterita.exceptions; + + +public class BPartnerNotFoundException extends BPartnerException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public BPartnerNotFoundException(String msg) + { + super(msg); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/BPartnerOverCreditLimitException.java b/posterita/posterita/src/main/org/posterita/exceptions/BPartnerOverCreditLimitException.java new file mode 100644 index 0000000000..81f484d04b --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/BPartnerOverCreditLimitException.java @@ -0,0 +1,35 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Nov 1, 2006 + */ + + +package org.posterita.exceptions; + + +public class BPartnerOverCreditLimitException extends OperationException +{ + + private static final long serialVersionUID = 1L; + + public BPartnerOverCreditLimitException(String exception) + { + super(exception); + } +} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/exceptions/BankAlreadyExistException.java b/posterita/posterita/src/main/org/posterita/exceptions/BankAlreadyExistException.java new file mode 100644 index 0000000000..0d16eb05f6 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/BankAlreadyExistException.java @@ -0,0 +1,39 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 01-Aug-2005 by alok + * + */ +package org.posterita.exceptions; + + +public class BankAlreadyExistException extends OperationException +{ + + /** + * + */ + private static final long serialVersionUID = 1L; + + public BankAlreadyExistException(String exception) + { + super(exception); + + } + +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/BarcodeAlreadyExistsException.java b/posterita/posterita/src/main/org/posterita/exceptions/BarcodeAlreadyExistsException.java new file mode 100644 index 0000000000..afb50bc2f1 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/BarcodeAlreadyExistsException.java @@ -0,0 +1,39 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Created on May 10, 2006 + */ + + +package org.posterita.exceptions; + + +public class BarcodeAlreadyExistsException extends OperationException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public BarcodeAlreadyExistsException(String exception) + { + super(exception); + } + +} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/exceptions/BirtEngineException.java b/posterita/posterita/src/main/org/posterita/exceptions/BirtEngineException.java new file mode 100644 index 0000000000..0072b40462 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/BirtEngineException.java @@ -0,0 +1,38 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Created on 17-Aug-2005 by Fred + **/ +package org.posterita.exceptions; + +import org.posterita.exceptions.ApplicationException; + + +public class BirtEngineException extends ApplicationException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public BirtEngineException(String message) + { + super(message); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/CSVDataInvalidException.java b/posterita/posterita/src/main/org/posterita/exceptions/CSVDataInvalidException.java new file mode 100644 index 0000000000..d19aa75d5d --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/CSVDataInvalidException.java @@ -0,0 +1,37 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +* Created on Nov 26, 2005 by ashley +* +*/ + +package org.posterita.exceptions; + + +public class CSVDataInvalidException extends DataException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public CSVDataInvalidException(String msg) + { + super(msg); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/CSVFileException.java b/posterita/posterita/src/main/org/posterita/exceptions/CSVFileException.java new file mode 100644 index 0000000000..e5366a71aa --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/CSVFileException.java @@ -0,0 +1,41 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Created on 14-Sep-2005 + */ + + +package org.posterita.exceptions; + + +public class CSVFileException extends OperationException +{ + + /** + * + */ + private static final long serialVersionUID = 1L; + + public CSVFileException(String exception) + { + super(exception); + + } + +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/CanNotAjdustTillException.java b/posterita/posterita/src/main/org/posterita/exceptions/CanNotAjdustTillException.java new file mode 100644 index 0000000000..e3d79424e0 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/CanNotAjdustTillException.java @@ -0,0 +1,37 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Aug 10, 2006 + */ + + +package org.posterita.exceptions; + + +public class CanNotAjdustTillException extends OperationException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public CanNotAjdustTillException(String exception) + { + super(exception); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/CanNotCloseTillException.java b/posterita/posterita/src/main/org/posterita/exceptions/CanNotCloseTillException.java new file mode 100644 index 0000000000..066f699b8a --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/CanNotCloseTillException.java @@ -0,0 +1,38 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Aug 3, 2006 + */ + + +package org.posterita.exceptions; + + +public class CanNotCloseTillException extends OperationException +{ + + /** + * + */ + private static final long serialVersionUID = 1L; + + public CanNotCloseTillException(String xception) + { + super(xception); + } +} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/exceptions/CanNotCreatePaymentAllocationException.java b/posterita/posterita/src/main/org/posterita/exceptions/CanNotCreatePaymentAllocationException.java new file mode 100644 index 0000000000..294ec79bce --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/CanNotCreatePaymentAllocationException.java @@ -0,0 +1,37 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Dec 8, 2006 + */ + + +package org.posterita.exceptions; + + +public class CanNotCreatePaymentAllocationException extends OperationException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public CanNotCreatePaymentAllocationException(String message) + { + super(message); + } +} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/exceptions/CanNotDeleteOrderException.java b/posterita/posterita/src/main/org/posterita/exceptions/CanNotDeleteOrderException.java new file mode 100644 index 0000000000..dfd6a383aa --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/CanNotDeleteOrderException.java @@ -0,0 +1,38 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Created on 20-Feb-2006 + */ + + +package org.posterita.exceptions; + + +public class CanNotDeleteOrderException extends OperationException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public CanNotDeleteOrderException(String msg) + { + super(msg); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/CanNotMoveStockException.java b/posterita/posterita/src/main/org/posterita/exceptions/CanNotMoveStockException.java new file mode 100644 index 0000000000..7adc000681 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/CanNotMoveStockException.java @@ -0,0 +1,39 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Created on 08-Feb-2006 + */ + + +package org.posterita.exceptions; + + +public class CanNotMoveStockException extends OperationException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public CanNotMoveStockException(String exception) + { + super(exception); + } +} + diff --git a/posterita/posterita/src/main/org/posterita/exceptions/CannotCreateInventoryLineException.java b/posterita/posterita/src/main/org/posterita/exceptions/CannotCreateInventoryLineException.java new file mode 100644 index 0000000000..b959509a3e --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/CannotCreateInventoryLineException.java @@ -0,0 +1,39 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Jan 22, 2007 + */ + + +package org.posterita.exceptions; + + + +public class CannotCreateInventoryLineException extends OperationException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public CannotCreateInventoryLineException(String exception) + { + super(exception); + } + +} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/exceptions/CannotDeactivatePaymentTermException.java b/posterita/posterita/src/main/org/posterita/exceptions/CannotDeactivatePaymentTermException.java new file mode 100644 index 0000000000..10399d89c4 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/CannotDeactivatePaymentTermException.java @@ -0,0 +1,38 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Jan 26, 2007 + */ + + +package org.posterita.exceptions; + + + +public class CannotDeactivatePaymentTermException extends OperationException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public CannotDeactivatePaymentTermException(String msg) + { + super(msg); + } +} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/exceptions/CannotInactivateProductException.java b/posterita/posterita/src/main/org/posterita/exceptions/CannotInactivateProductException.java new file mode 100644 index 0000000000..80c4df0527 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/CannotInactivateProductException.java @@ -0,0 +1,38 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Jul 17, 2006 + */ + + +package org.posterita.exceptions; + + +public class CannotInactivateProductException extends OperationException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public CannotInactivateProductException(String exception) + { + super(exception); + } + +} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/exceptions/CannotInactivateTaxException.java b/posterita/posterita/src/main/org/posterita/exceptions/CannotInactivateTaxException.java new file mode 100644 index 0000000000..381fed3b50 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/CannotInactivateTaxException.java @@ -0,0 +1,38 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + **/ + + +package org.posterita.exceptions; + + +public class CannotInactivateTaxException extends OperationException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public CannotInactivateTaxException(String exception) + { + super(exception); + } + +} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/exceptions/CashBookAlreadyAssignedException.java b/posterita/posterita/src/main/org/posterita/exceptions/CashBookAlreadyAssignedException.java new file mode 100644 index 0000000000..ea815f940f --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/CashBookAlreadyAssignedException.java @@ -0,0 +1,32 @@ +/****************************************************************************** + * Product: Posterita Web-Based POS and Adempiere Plugin * + * Copyright (C) 2008 Posterita Ltd * + * This file is part of POSterita * + * * + * POSterita is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * + *****************************************************************************/ +package org.posterita.exceptions; + +/** + * @author ashley + * Jun 4, 2008 + */ +public class CashBookAlreadyAssignedException extends OperationException +{ + public CashBookAlreadyAssignedException(String msg) + { + super(msg); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/ClientAlreadyExistException.java b/posterita/posterita/src/main/org/posterita/exceptions/ClientAlreadyExistException.java new file mode 100644 index 0000000000..191d507790 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/ClientAlreadyExistException.java @@ -0,0 +1,39 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +* +* Created on Oct 30, 2006 by ashley +* +*/ + +/** + @author ashley + */ + +package org.posterita.exceptions; + +public class ClientAlreadyExistException extends OperationException +{ + private static final long serialVersionUID = 1L; + + public ClientAlreadyExistException(String msg) + { + super(msg); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/CloseStatusNotFoundException.java b/posterita/posterita/src/main/org/posterita/exceptions/CloseStatusNotFoundException.java new file mode 100644 index 0000000000..a1cf09a8d1 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/CloseStatusNotFoundException.java @@ -0,0 +1,41 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + **/ + +/** + @author ashley + */ + +package org.posterita.exceptions; + +import org.posterita.exceptions.OperationException; + +public class CloseStatusNotFoundException extends OperationException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public CloseStatusNotFoundException(String msg) + { + super(msg); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/CreditCardExpiryInvalidException.java b/posterita/posterita/src/main/org/posterita/exceptions/CreditCardExpiryInvalidException.java new file mode 100644 index 0000000000..26419f6c43 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/CreditCardExpiryInvalidException.java @@ -0,0 +1,39 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +**/ + +/** + @author ashley + */ + +package org.posterita.exceptions; + +public class CreditCardExpiryInvalidException extends DataException +{ + + /** + * + */ + private static final long serialVersionUID = 1L; + + public CreditCardExpiryInvalidException(String msg) + { + super(msg); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/CreditCardNumberException.java b/posterita/posterita/src/main/org/posterita/exceptions/CreditCardNumberException.java new file mode 100644 index 0000000000..db30b15611 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/CreditCardNumberException.java @@ -0,0 +1,39 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * +**/ + +/** + @author ashley + */ + +package org.posterita.exceptions; + +public class CreditCardNumberException extends DataException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public CreditCardNumberException(String msg) + { + super(msg); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/CreditCardTypeNotSupportedException.java b/posterita/posterita/src/main/org/posterita/exceptions/CreditCardTypeNotSupportedException.java new file mode 100644 index 0000000000..3605a2a8f7 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/CreditCardTypeNotSupportedException.java @@ -0,0 +1,39 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + **/ + +/** + @author ashley + */ + +package org.posterita.exceptions; + +public class CreditCardTypeNotSupportedException extends DataException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public CreditCardTypeNotSupportedException(String msg) + { + super(msg); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/CreditCardVVInvalidException.java b/posterita/posterita/src/main/org/posterita/exceptions/CreditCardVVInvalidException.java new file mode 100644 index 0000000000..3a5e5e31ec --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/CreditCardVVInvalidException.java @@ -0,0 +1,39 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + **/ + +/** + @author ashley + */ + +package org.posterita.exceptions; + +public class CreditCardVVInvalidException extends DataException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public CreditCardVVInvalidException(String msg) + { + super(msg); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/CustomerNotImportedException.java b/posterita/posterita/src/main/org/posterita/exceptions/CustomerNotImportedException.java new file mode 100644 index 0000000000..722470e5f1 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/CustomerNotImportedException.java @@ -0,0 +1,24 @@ +package org.posterita.exceptions; + +public class CustomerNotImportedException extends OperationException +{ + public CustomerNotImportedException() + { + super(); + } + + public CustomerNotImportedException(Exception exception) + { + super(exception); + } + + public CustomerNotImportedException(String msg, Exception exception) + { + super(msg, exception); + } + + public CustomerNotImportedException(String exception) + { + super(exception); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/DataException.java b/posterita/posterita/src/main/org/posterita/exceptions/DataException.java new file mode 100644 index 0000000000..26a1452c55 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/DataException.java @@ -0,0 +1,41 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +package org.posterita.exceptions; + + +public class DataException extends ApplicationException +{ + + /** + * + */ + private static final long serialVersionUID = 1L; + + public DataException(String msg) + { + super(msg); + } + + public DataException(String message, Exception ex) + { + super(message); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/DefaultStoreException.java b/posterita/posterita/src/main/org/posterita/exceptions/DefaultStoreException.java new file mode 100644 index 0000000000..1bd20369f2 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/DefaultStoreException.java @@ -0,0 +1,38 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +* +* Created on Oct 12, 2006 by ashley +* +*/ + +/** + @author ashley + */ + +package org.posterita.exceptions; + +public class DefaultStoreException extends ApplicationException +{ + private static final long serialVersionUID = 1L; + + public DefaultStoreException(String msg) + { + super(msg); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/DeleteAttachmentException.java b/posterita/posterita/src/main/org/posterita/exceptions/DeleteAttachmentException.java new file mode 100644 index 0000000000..1ec70942f5 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/DeleteAttachmentException.java @@ -0,0 +1,31 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + **/ +package org.posterita.exceptions; + +public class DeleteAttachmentException extends OperationException +{ + private static final long serialVersionUID = 1L; + + public DeleteAttachmentException(String msg) + { + super(msg); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/DescriptionNotFoundException.java b/posterita/posterita/src/main/org/posterita/exceptions/DescriptionNotFoundException.java new file mode 100644 index 0000000000..b20d468b97 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/DescriptionNotFoundException.java @@ -0,0 +1,36 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Nov 23, 2005 by praveen + * + */ +package org.posterita.exceptions; + +public class DescriptionNotFoundException extends Exception +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public DescriptionNotFoundException(String msg) + { + super(msg); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/DiscountLimitException.java b/posterita/posterita/src/main/org/posterita/exceptions/DiscountLimitException.java new file mode 100644 index 0000000000..74834a22e5 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/DiscountLimitException.java @@ -0,0 +1,39 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * 19-Oct-2006 11:16:04 by praveen + * + */ + +package org.posterita.exceptions; + +public class DiscountLimitException extends Exception { + + private static final long serialVersionUID = 1L; + + public DiscountLimitException(String msg) + { + super(msg); + } + + public DiscountLimitException(Exception exception) + { + super(exception); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/DocumentDoesNotBelongToYouException.java b/posterita/posterita/src/main/org/posterita/exceptions/DocumentDoesNotBelongToYouException.java new file mode 100644 index 0000000000..37cbbf0335 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/DocumentDoesNotBelongToYouException.java @@ -0,0 +1,14 @@ +package org.posterita.exceptions; + +public class DocumentDoesNotBelongToYouException extends OperationException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public DocumentDoesNotBelongToYouException(String message) + { + super(message); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/DuplicatePINException.java b/posterita/posterita/src/main/org/posterita/exceptions/DuplicatePINException.java new file mode 100644 index 0000000000..bb82f3291d --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/DuplicatePINException.java @@ -0,0 +1,35 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Sep 25, 2006 + */ + + +package org.posterita.exceptions; + + +public class DuplicatePINException extends OperationException +{ + + private static final long serialVersionUID = 1L; + + public DuplicatePINException(String exception) + { + super(exception); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/DuplicateRoleException.java b/posterita/posterita/src/main/org/posterita/exceptions/DuplicateRoleException.java new file mode 100644 index 0000000000..35170d7ed7 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/DuplicateRoleException.java @@ -0,0 +1,15 @@ +package org.posterita.exceptions; + +public class DuplicateRoleException extends OperationException +{ + + /** + * + */ + private static final long serialVersionUID = 1L; + + public DuplicateRoleException(String ex) + { + super(ex); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/DuplicateUOMException.java b/posterita/posterita/src/main/org/posterita/exceptions/DuplicateUOMException.java new file mode 100644 index 0000000000..eca882dcd0 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/DuplicateUOMException.java @@ -0,0 +1,16 @@ +package org.posterita.exceptions; + +public class DuplicateUOMException extends OperationException +{ + + /** + * + */ + private static final long serialVersionUID = 1L; + + public DuplicateUOMException(String msg) + { + super(msg); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/DuplicateUserPinException.java b/posterita/posterita/src/main/org/posterita/exceptions/DuplicateUserPinException.java new file mode 100644 index 0000000000..e6e32f4e4f --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/DuplicateUserPinException.java @@ -0,0 +1,37 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Oct 6, 2006 + */ + + +package org.posterita.exceptions; + + +public class DuplicateUserPinException extends OperationException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public DuplicateUserPinException(String msg) + { + super(msg); + } +} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/exceptions/EMailInvalidException.java b/posterita/posterita/src/main/org/posterita/exceptions/EMailInvalidException.java new file mode 100644 index 0000000000..2fd8cbcca6 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/EMailInvalidException.java @@ -0,0 +1,36 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +* Created on Jan 17, 2006 by ashley +* +*/ + +package org.posterita.exceptions; + +public class EMailInvalidException extends OperationException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public EMailInvalidException(String msg) + { + super(msg); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/EMailMessageException.java b/posterita/posterita/src/main/org/posterita/exceptions/EMailMessageException.java new file mode 100644 index 0000000000..3b33350901 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/EMailMessageException.java @@ -0,0 +1,47 @@ +/* +* +* Copyright (c) 2006 Tamak ICT Ltd. All Rights Reserved. +* +* This software is the confidential and proprietary information of +* UDI Ltd. ("Confidential Information"). You shall not +* disclose such Confidential Information and shall use it only in +* accordance with the terms of the license agreement you entered into +* with UDI. +* +* UDI MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE +* SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT +* NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR +* A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. UDI SHALL NOT +* BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, +* MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. +* +* Created on Jun 1, 2006 by ashley +* +*/ + +/** + @author ashley + */ + +package org.posterita.exceptions; + +import org.posterita.exceptions.OperationException; + +public class EMailMessageException extends OperationException +{ + + /** + * + */ + private static final long serialVersionUID = 1L; + + public EMailMessageException(String msg) + { + super(msg); + } + + public EMailMessageException(String msg, Exception ex) + { + super(msg, ex); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/EMailMessageParsingException.java b/posterita/posterita/src/main/org/posterita/exceptions/EMailMessageParsingException.java new file mode 100644 index 0000000000..145702c829 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/EMailMessageParsingException.java @@ -0,0 +1,47 @@ +/* +* +* Copyright (c) 2006 Tamak ICT Ltd. All Rights Reserved. +* +* This software is the confidential and proprietary information of +* UDI Ltd. ("Confidential Information"). You shall not +* disclose such Confidential Information and shall use it only in +* accordance with the terms of the license agreement you entered into +* with UDI. +* +* UDI MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE +* SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT +* NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR +* A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. UDI SHALL NOT +* BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, +* MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. +* +* Created on Jun 5, 2006 by ashley +* +*/ + +/** + @author ashley + */ + +package org.posterita.exceptions; + +import org.posterita.exceptions.OperationException; + +public class EMailMessageParsingException extends OperationException +{ + + /** + * + */ + private static final long serialVersionUID = 1L; + + public EMailMessageParsingException(String msg) + { + super(msg); + } + + public EMailMessageParsingException(String msg, Exception ex) + { + super(msg, ex); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/EMailNotSentException.java b/posterita/posterita/src/main/org/posterita/exceptions/EMailNotSentException.java new file mode 100644 index 0000000000..5007734756 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/EMailNotSentException.java @@ -0,0 +1,36 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +* Created on Jan 17, 2006 by ashley +* +*/ + +package org.posterita.exceptions; + +public class EMailNotSentException extends OperationException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public EMailNotSentException(String msg) + { + super(msg); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/EMailServerConnectionException.java b/posterita/posterita/src/main/org/posterita/exceptions/EMailServerConnectionException.java new file mode 100644 index 0000000000..62d44ea5d7 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/EMailServerConnectionException.java @@ -0,0 +1,46 @@ +/* +* +* Copyright (c) 2006 Tamak ICT Ltd. All Rights Reserved. +* +* This software is the confidential and proprietary information of +* UDI Ltd. ("Confidential Information"). You shall not +* disclose such Confidential Information and shall use it only in +* accordance with the terms of the license agreement you entered into +* with UDI. +* +* UDI MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE +* SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT +* NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR +* A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. UDI SHALL NOT +* BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, +* MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. +* +* Created on May 31, 2006 by ashley +* +*/ + +/** + @author ashley + */ + +package org.posterita.exceptions; + +import org.posterita.exceptions.OperationException; + +public class EMailServerConnectionException extends OperationException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public EMailServerConnectionException(String msg) + { + super(msg); + } + + public EMailServerConnectionException(String msg, Exception ex) + { + super(msg, ex); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/EMailServerLoginException.java b/posterita/posterita/src/main/org/posterita/exceptions/EMailServerLoginException.java new file mode 100644 index 0000000000..ae6fb0199b --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/EMailServerLoginException.java @@ -0,0 +1,46 @@ +/* +* +* Copyright (c) 2006 Tamak ICT Ltd. All Rights Reserved. +* +* This software is the confidential and proprietary information of +* UDI Ltd. ("Confidential Information"). You shall not +* disclose such Confidential Information and shall use it only in +* accordance with the terms of the license agreement you entered into +* with UDI. +* +* UDI MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE +* SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT +* NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR +* A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. UDI SHALL NOT +* BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, +* MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. +* +* Created on May 31, 2006 by ashley +* +*/ + +/** + @author ashley + */ + +package org.posterita.exceptions; + +import org.posterita.exceptions.OperationException; + +public class EMailServerLoginException extends OperationException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public EMailServerLoginException(String msg) + { + super(msg); + } + + public EMailServerLoginException(String msg, Exception ex) + { + super(msg, ex); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/EMailServerMessageException.java b/posterita/posterita/src/main/org/posterita/exceptions/EMailServerMessageException.java new file mode 100644 index 0000000000..785b83c98f --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/EMailServerMessageException.java @@ -0,0 +1,47 @@ +/* +* +* Copyright (c) 2006 Tamak ICT Ltd. All Rights Reserved. +* +* This software is the confidential and proprietary information of +* UDI Ltd. ("Confidential Information"). You shall not +* disclose such Confidential Information and shall use it only in +* accordance with the terms of the license agreement you entered into +* with UDI. +* +* UDI MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE +* SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT +* NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR +* A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. UDI SHALL NOT +* BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, +* MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. +* +* Created on Jun 1, 2006 by ashley +* +*/ + +/** + @author ashley + */ + +package org.posterita.exceptions; + +import org.posterita.exceptions.OperationException; + +public class EMailServerMessageException extends OperationException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public EMailServerMessageException(String msg) + { + super(msg); + } + + public EMailServerMessageException(String msg, Exception ex) + { + super(msg, ex); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/EmailAlreadyExistsException.java b/posterita/posterita/src/main/org/posterita/exceptions/EmailAlreadyExistsException.java new file mode 100644 index 0000000000..b411cdff59 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/EmailAlreadyExistsException.java @@ -0,0 +1,34 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ +package org.posterita.exceptions; + + +public class EmailAlreadyExistsException extends OperationException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public EmailAlreadyExistsException(String exception) + { + super(exception); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/EmailNotFoundException.java b/posterita/posterita/src/main/org/posterita/exceptions/EmailNotFoundException.java new file mode 100644 index 0000000000..3f2cad84a9 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/EmailNotFoundException.java @@ -0,0 +1,35 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 17-Feb-2005 by fred + * + */ +package org.posterita.exceptions; + + +public class EmailNotFoundException extends ApplicationException +{ + + /** + * + */ + private static final long serialVersionUID = 1L; + + + +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/EmptyCartException.java b/posterita/posterita/src/main/org/posterita/exceptions/EmptyCartException.java new file mode 100644 index 0000000000..c55a2145e7 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/EmptyCartException.java @@ -0,0 +1,38 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Created on May 8, 2006 + */ + +package org.posterita.exceptions; + +public class EmptyCartException extends OperationException +{ + + /** + * + */ + private static final long serialVersionUID = 1L; + + public EmptyCartException(String string) + { + + } + +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/EncryptionException.java b/posterita/posterita/src/main/org/posterita/exceptions/EncryptionException.java new file mode 100644 index 0000000000..1ce7041f31 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/EncryptionException.java @@ -0,0 +1,37 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + **/ +package org.posterita.exceptions; + +public class EncryptionException extends OperationException +{ + + /** + * + */ + private static final long serialVersionUID = 1L; + + public EncryptionException(String message) + { + super(message); + + } + +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/FormattingException.java b/posterita/posterita/src/main/org/posterita/exceptions/FormattingException.java new file mode 100644 index 0000000000..28069d0e52 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/FormattingException.java @@ -0,0 +1,85 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Dec 26, 2006 + */ + +package org.posterita.exceptions; + +import org.posterita.formatter.Formatter; + + + +public class FormattingException extends RuntimeException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + private Throwable cause; + private Formatter formatter; + + public FormattingException(String message) + { + super(message); + } + + public FormattingException(String message, Throwable cause) + { + super(message); + + this.cause = cause; + } + + public Formatter getFormatter() + { + return formatter; + } + + public void setFormatter(Formatter formatter) + { + this.formatter = formatter; + } + + public void setCause(Throwable cause) + { + this.cause = cause; + } + + public Throwable getCause() + { + return cause; + } + + public String toString() + { + return super.toString() +(cause == null? "" : "\n Original Cause: \n" + cause.toString()); + } + + public void printStackTrace() + { + super.printStackTrace(); + + if (cause != null) + { + System.out.println("\n Original Cause: \n"); + cause.printStackTrace(); + } + } + +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/ImageAttachmentException.java b/posterita/posterita/src/main/org/posterita/exceptions/ImageAttachmentException.java new file mode 100644 index 0000000000..b13eb4e68b --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/ImageAttachmentException.java @@ -0,0 +1,38 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +* Created on Mar 29, 2006 by ashley +* +*/ + +package org.posterita.exceptions; + +import org.posterita.exceptions.OperationException; + +public class ImageAttachmentException extends OperationException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public ImageAttachmentException(String msg) + { + super(msg); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/ImportFileAlreadyExistException.java b/posterita/posterita/src/main/org/posterita/exceptions/ImportFileAlreadyExistException.java new file mode 100644 index 0000000000..9f26a4e450 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/ImportFileAlreadyExistException.java @@ -0,0 +1,37 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +* Created on Feb 28, 2006 by ashley +* +*/ + +package org.posterita.exceptions; + +public class ImportFileAlreadyExistException extends OperationException +{ + + /** + * + */ + private static final long serialVersionUID = 1L; + + public ImportFileAlreadyExistException(String msg) + { + super(msg); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/ImportFileNotFoundException.java b/posterita/posterita/src/main/org/posterita/exceptions/ImportFileNotFoundException.java new file mode 100644 index 0000000000..a47db3c5b8 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/ImportFileNotFoundException.java @@ -0,0 +1,37 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +* Created on Feb 28, 2006 by ashley +* +*/ + +package org.posterita.exceptions; + +public class ImportFileNotFoundException extends OperationException +{ + + /** + * + */ + private static final long serialVersionUID = 1L; + + public ImportFileNotFoundException(String msg) + { + super(msg); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/ImportProductException.java b/posterita/posterita/src/main/org/posterita/exceptions/ImportProductException.java new file mode 100644 index 0000000000..b27fc51f47 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/ImportProductException.java @@ -0,0 +1,16 @@ +package org.posterita.exceptions; + +public class ImportProductException extends OperationException +{ + + /** + * + */ + private static final long serialVersionUID = 1L; + + public ImportProductException(String msg) + { + super(msg); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/InputQuantityLessThanZeroException.java b/posterita/posterita/src/main/org/posterita/exceptions/InputQuantityLessThanZeroException.java new file mode 100644 index 0000000000..c0aa3be9a1 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/InputQuantityLessThanZeroException.java @@ -0,0 +1,35 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +package org.posterita.exceptions; + + +public class InputQuantityLessThanZeroException extends OperationException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public InputQuantityLessThanZeroException(String exception) + { + super(exception); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/InsufficientQtyException.java b/posterita/posterita/src/main/org/posterita/exceptions/InsufficientQtyException.java new file mode 100644 index 0000000000..1bfe60930c --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/InsufficientQtyException.java @@ -0,0 +1,37 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Dec 26, 2006 + */ + + +package org.posterita.exceptions; + + +public class InsufficientQtyException extends OperationException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public InsufficientQtyException(String message) + { + super(message); + } +} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/exceptions/InvalidAddressException.java b/posterita/posterita/src/main/org/posterita/exceptions/InvalidAddressException.java new file mode 100644 index 0000000000..b92826841e --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/InvalidAddressException.java @@ -0,0 +1,37 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Oct 4, 2006 + */ + + +package org.posterita.exceptions; + + +public class InvalidAddressException extends OperationException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public InvalidAddressException(String msg) + { + super(msg); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/InvalidBPartnerException.java b/posterita/posterita/src/main/org/posterita/exceptions/InvalidBPartnerException.java new file mode 100644 index 0000000000..5265b65930 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/InvalidBPartnerException.java @@ -0,0 +1,39 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +* Created on Apr 5, 2006 by ashley +* +*/ + +package org.posterita.exceptions; + +import org.posterita.exceptions.OperationException; + +public class InvalidBPartnerException extends OperationException +{ + + /** + * + */ + private static final long serialVersionUID = 1L; + + public InvalidBPartnerException(String msg) + { + super(msg); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/InvalidBankAccountException.java b/posterita/posterita/src/main/org/posterita/exceptions/InvalidBankAccountException.java new file mode 100644 index 0000000000..385c001434 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/InvalidBankAccountException.java @@ -0,0 +1,36 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Aug 11, 2005 by din + */ + +package org.posterita.exceptions; + +public class InvalidBankAccountException extends ApplicationException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public InvalidBankAccountException(String message) + { + + super(message); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/InvalidBankException.java b/posterita/posterita/src/main/org/posterita/exceptions/InvalidBankException.java new file mode 100644 index 0000000000..a6d30e4406 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/InvalidBankException.java @@ -0,0 +1,35 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Aug 24, 2005 by praveen + * + */ +package org.posterita.exceptions; + +public class InvalidBankException extends ApplicationException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public InvalidBankException(String message) + { + super(message); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/InvalidBarcodeException.java b/posterita/posterita/src/main/org/posterita/exceptions/InvalidBarcodeException.java new file mode 100644 index 0000000000..2bed731a29 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/InvalidBarcodeException.java @@ -0,0 +1,37 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Jun 6, 2006 + */ + + +package org.posterita.exceptions; + + +public class InvalidBarcodeException extends OperationException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + +public InvalidBarcodeException(String msg) + { + super(msg); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/InvalidConfirmPasswordException.java b/posterita/posterita/src/main/org/posterita/exceptions/InvalidConfirmPasswordException.java new file mode 100644 index 0000000000..af9be0f748 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/InvalidConfirmPasswordException.java @@ -0,0 +1,39 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Jun 6, 2006 + */ + + +package org.posterita.exceptions; + + +public class InvalidConfirmPasswordException extends OperationException +{ + + /** + * + */ + private static final long serialVersionUID = 1L; + + public InvalidConfirmPasswordException(String msg) + { + super(msg); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/InvalidContentTypeException.java b/posterita/posterita/src/main/org/posterita/exceptions/InvalidContentTypeException.java new file mode 100644 index 0000000000..0c75055d54 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/InvalidContentTypeException.java @@ -0,0 +1,41 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Mar 16, 2006 by praveen + * + */ +package org.posterita.exceptions; + +public class InvalidContentTypeException extends OperationException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public InvalidContentTypeException(Exception e) + { + super(e); + } + + public InvalidContentTypeException(String msg) + { + super(msg); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/InvalidDateTimeException.java b/posterita/posterita/src/main/org/posterita/exceptions/InvalidDateTimeException.java new file mode 100644 index 0000000000..8f35a5629e --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/InvalidDateTimeException.java @@ -0,0 +1,36 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + **/ + +/** + @author ashley + */ + +package org.posterita.exceptions; + +public class InvalidDateTimeException extends DataException +{ + private static final long serialVersionUID = 1L; + + public InvalidDateTimeException(String msg) + { + super(msg); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/InvalidEmailException.java b/posterita/posterita/src/main/org/posterita/exceptions/InvalidEmailException.java new file mode 100644 index 0000000000..ddbb4cd8a2 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/InvalidEmailException.java @@ -0,0 +1,30 @@ +/* + * Created on 2005/03/11 + * + * To change the template for this generated file go to + * Window - Preferences - Java - Code Style - Code Templates + */ +package org.posterita.exceptions; + +/** + * @author jane + * + *To change the template for this generated type comment go to + * Window - Preferences - Java - Code Style - Code Templates + */ +public class InvalidEmailException extends OperationException +{ + private static final long serialVersionUID = 1L; + + public InvalidEmailException(String exception) + { + super(exception); + } + + public InvalidEmailException(String msg, Exception ex) + { + super(msg, ex); + } + + +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/InvalidInvokeOrderStatusException.java b/posterita/posterita/src/main/org/posterita/exceptions/InvalidInvokeOrderStatusException.java new file mode 100644 index 0000000000..1ef8bc3dd9 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/InvalidInvokeOrderStatusException.java @@ -0,0 +1,53 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * 31-Aug-2006 17:23:19 by praveen + * + */ + +package org.posterita.exceptions; + +public class InvalidInvokeOrderStatusException extends OperationException +{ + private static final long serialVersionUID = 1L; + private String status = null; + + public InvalidInvokeOrderStatusException(String xception,String status) + { + super(xception); + this.status = status; + } + + public InvalidInvokeOrderStatusException(String xception) + { + super(xception); + } + + public InvalidInvokeOrderStatusException(Exception exception) + { + super(exception); + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/InvalidMessageStatusException.java b/posterita/posterita/src/main/org/posterita/exceptions/InvalidMessageStatusException.java new file mode 100644 index 0000000000..1919198ff2 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/InvalidMessageStatusException.java @@ -0,0 +1,35 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Aug 1, 2005 by din + */ + +package org.posterita.exceptions; + +public class InvalidMessageStatusException extends OperationException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public InvalidMessageStatusException(String xception) + { + super(xception); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/InvalidMonthException.java b/posterita/posterita/src/main/org/posterita/exceptions/InvalidMonthException.java new file mode 100644 index 0000000000..0a91d6c615 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/InvalidMonthException.java @@ -0,0 +1,35 @@ +/** + * Product: Posterita Web-Based POS (an Adempiere Plugin) + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Dec 26, 2006 + */ +package org.posterita.exceptions; + + +public class InvalidMonthException extends OperationException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public InvalidMonthException(String xception) + { + super("Invalid month"); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/InvalidNetDaysException.java b/posterita/posterita/src/main/org/posterita/exceptions/InvalidNetDaysException.java new file mode 100644 index 0000000000..95e129f656 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/InvalidNetDaysException.java @@ -0,0 +1,36 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Dec 11, 2006 + */ + + +package org.posterita.exceptions; + + +public class InvalidNetDaysException extends OperationException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + public InvalidNetDaysException(String ex) + { + super(ex); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/InvalidOrderIDException.java b/posterita/posterita/src/main/org/posterita/exceptions/InvalidOrderIDException.java new file mode 100644 index 0000000000..69abe0c5ea --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/InvalidOrderIDException.java @@ -0,0 +1,38 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * 31-Aug-2006 17:22:39 by praveen + * + */ + +package org.posterita.exceptions; + +public class InvalidOrderIDException extends OperationException +{ + private static final long serialVersionUID = 1L; + + public InvalidOrderIDException(String xception) + { + super(xception); + } + + public InvalidOrderIDException(Exception exception) + { + super(exception); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/InvalidOrderTypeException.java b/posterita/posterita/src/main/org/posterita/exceptions/InvalidOrderTypeException.java new file mode 100644 index 0000000000..94e8b8f1bf --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/InvalidOrderTypeException.java @@ -0,0 +1,38 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * 09-Oct-2006 13:59:43 by praveen + * + */ + +package org.posterita.exceptions; + +public class InvalidOrderTypeException extends OperationException +{ + private static final long serialVersionUID = 1L; + + public InvalidOrderTypeException(){} + + public InvalidOrderTypeException(String message){ + super(message); + } + + public InvalidOrderTypeException(Exception exception){ + super(exception); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/InvalidOrganisationTypeException.java b/posterita/posterita/src/main/org/posterita/exceptions/InvalidOrganisationTypeException.java new file mode 100644 index 0000000000..7ebcaee8de --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/InvalidOrganisationTypeException.java @@ -0,0 +1,36 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 14-Sep-2005 by vishee + * + */ + +package org.posterita.exceptions; + +public class InvalidOrganisationTypeException extends ApplicationException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public InvalidOrganisationTypeException(String message) + { + super(message); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/InvalidPINException.java b/posterita/posterita/src/main/org/posterita/exceptions/InvalidPINException.java new file mode 100644 index 0000000000..4bcd8a0ce1 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/InvalidPINException.java @@ -0,0 +1,35 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Sep 25, 2006 + */ + + +package org.posterita.exceptions; + + +public class InvalidPINException extends OperationException +{ + + private static final long serialVersionUID = 1L; + + public InvalidPINException(String exception) + { + super(exception); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/InvalidPasswordLengthException.java b/posterita/posterita/src/main/org/posterita/exceptions/InvalidPasswordLengthException.java new file mode 100644 index 0000000000..8d5dc91cf5 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/InvalidPasswordLengthException.java @@ -0,0 +1,37 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Jun 6, 2006 + */ + + +package org.posterita.exceptions; + + +public class InvalidPasswordLengthException extends OperationException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + +public InvalidPasswordLengthException(String msg) + { + super(msg); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/InvalidPeriodException.java b/posterita/posterita/src/main/org/posterita/exceptions/InvalidPeriodException.java new file mode 100644 index 0000000000..6b7910f5cf --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/InvalidPeriodException.java @@ -0,0 +1,34 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +package org.posterita.exceptions; + + +public class InvalidPeriodException extends OperationException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public InvalidPeriodException(String xception) + { + super(xception); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/InvalidProductQuantityException.java b/posterita/posterita/src/main/org/posterita/exceptions/InvalidProductQuantityException.java new file mode 100644 index 0000000000..69214157a5 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/InvalidProductQuantityException.java @@ -0,0 +1,34 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ +package org.posterita.exceptions; + + +public class InvalidProductQuantityException extends OperationException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public InvalidProductQuantityException(String exception) + { + super(exception); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/InvalidRequestUpdateException.java b/posterita/posterita/src/main/org/posterita/exceptions/InvalidRequestUpdateException.java new file mode 100644 index 0000000000..5eb2466ded --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/InvalidRequestUpdateException.java @@ -0,0 +1,46 @@ +/* +* +* Copyright (c) 2006 Tamak ICT Ltd. All Rights Reserved. +* +* This software is the confidential and proprietary information of +* UDI Ltd. ("Confidential Information"). You shall not +* disclose such Confidential Information and shall use it only in +* accordance with the terms of the license agreement you entered into +* with UDI. +* +* UDI MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE +* SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT +* NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR +* A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. UDI SHALL NOT +* BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, +* MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. +* +* Created on Jun 23, 2006 by ashley +* +*/ + +/** + @author ashley + */ + +package org.posterita.exceptions; + +import org.posterita.exceptions.DataException; + +public class InvalidRequestUpdateException extends DataException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public InvalidRequestUpdateException(String msg) + { + super(msg); + } + + public InvalidRequestUpdateException(String msg, Exception ex) + { + super(msg, ex); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/InvalidRoleException.java b/posterita/posterita/src/main/org/posterita/exceptions/InvalidRoleException.java new file mode 100644 index 0000000000..ebddf68dd3 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/InvalidRoleException.java @@ -0,0 +1,40 @@ +/** + * Product: Posterita Web-Based POS (an Adempiere Plugin) + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Dec 26, 2006 + */ +package org.posterita.exceptions; + + +/** + * @author vickram + * + * To change the template for this generated type comment go to + * Window - Preferences - Java - Code Style - Code Templates + */ +public class InvalidRoleException extends ApplicationException +{ + + /** + * + */ + private static final long serialVersionUID = 1L; + + + +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/InvalidTenderedAmountException.java b/posterita/posterita/src/main/org/posterita/exceptions/InvalidTenderedAmountException.java new file mode 100644 index 0000000000..94eee71214 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/InvalidTenderedAmountException.java @@ -0,0 +1,38 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Jul 4, 2006 + */ + + +package org.posterita.exceptions; + + +public class InvalidTenderedAmountException extends OperationException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public InvalidTenderedAmountException(String message) + { + super(message); + } +} + diff --git a/posterita/posterita/src/main/org/posterita/exceptions/InvalidTerminalCashBookException.java b/posterita/posterita/src/main/org/posterita/exceptions/InvalidTerminalCashBookException.java new file mode 100644 index 0000000000..0ff6bc8f86 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/InvalidTerminalCashBookException.java @@ -0,0 +1,32 @@ +/****************************************************************************** + * Product: Posterita Web-Based POS and Adempiere Plugin * + * Copyright (C) 2008 Posterita Ltd * + * This file is part of POSterita * + * * + * POSterita is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * + *****************************************************************************/ +package org.posterita.exceptions; + +/** + * @author ashley + * Jun 4, 2008 + */ +public class InvalidTerminalCashBookException extends OperationException +{ + public InvalidTerminalCashBookException(String msg) + { + super(msg); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/InvalidURLException.java b/posterita/posterita/src/main/org/posterita/exceptions/InvalidURLException.java new file mode 100644 index 0000000000..9d9cc0e928 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/InvalidURLException.java @@ -0,0 +1,42 @@ +/* +* +* Copyright (c) 2006 Tamak ICT Ltd. All Rights Reserved. +* +* This software is the confidential and proprietary information of +* UDI Ltd. ("Confidential Information"). You shall not +* disclose such Confidential Information and shall use it only in +* accordance with the terms of the license agreement you entered into +* with UDI. +* +* UDI MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE +* SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT +* NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR +* A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. UDI SHALL NOT +* BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, +* MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. +* +* Created on May 31, 2006 by ashley +* +*/ + +/** + @author ashley + */ + +package org.posterita.exceptions; + +import org.posterita.exceptions.DataException; + +public class InvalidURLException extends DataException +{ + + /** + * + */ + private static final long serialVersionUID = 1L; + + public InvalidURLException(String msg) + { + super(msg); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/InvalidYearException.java b/posterita/posterita/src/main/org/posterita/exceptions/InvalidYearException.java new file mode 100644 index 0000000000..fc7ad9d856 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/InvalidYearException.java @@ -0,0 +1,39 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Aug 9, 2005 by praveen + * + */ +package org.posterita.exceptions; + +public class InvalidYearException extends ApplicationException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + /** + * + */ + public InvalidYearException(String message) + { + super(message); + + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/KeywordsRequiredException.java b/posterita/posterita/src/main/org/posterita/exceptions/KeywordsRequiredException.java new file mode 100644 index 0000000000..fe26e2d3aa --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/KeywordsRequiredException.java @@ -0,0 +1,37 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +* Created on May 16, 2006 by ashley +* +*/ + +package org.posterita.exceptions; + +public class KeywordsRequiredException extends OperationException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public KeywordsRequiredException(String msg) + { + super(msg); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/LimitPriceViolatedException.java b/posterita/posterita/src/main/org/posterita/exceptions/LimitPriceViolatedException.java new file mode 100644 index 0000000000..e7cd51580c --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/LimitPriceViolatedException.java @@ -0,0 +1,38 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Jan 9, 2007 + */ + + +package org.posterita.exceptions; + + +public class LimitPriceViolatedException extends OperationException +{ + + /** + * + */ + private static final long serialVersionUID = 1L; + + public LimitPriceViolatedException(String exception) + { + super(exception); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/LogoException.java b/posterita/posterita/src/main/org/posterita/exceptions/LogoException.java new file mode 100644 index 0000000000..e170191da5 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/LogoException.java @@ -0,0 +1,38 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +* +* Created on Sep 22, 2006 by ashley +* +*/ + +/** + @author ashley + */ + +package org.posterita.exceptions; + +public class LogoException extends OperationException +{ + private static final long serialVersionUID = 1L; + + public LogoException(String msg) + { + super(msg); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/MandatoryException.java b/posterita/posterita/src/main/org/posterita/exceptions/MandatoryException.java new file mode 100644 index 0000000000..6d17b468d2 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/MandatoryException.java @@ -0,0 +1,37 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Nov 30, 2006 + */ + + +package org.posterita.exceptions; + + +public class MandatoryException extends BPartnerException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public MandatoryException(String msg) + { + super(msg); + } +} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/exceptions/MandatoryNameException.java b/posterita/posterita/src/main/org/posterita/exceptions/MandatoryNameException.java new file mode 100644 index 0000000000..a75ef6b107 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/MandatoryNameException.java @@ -0,0 +1,37 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Nov 30, 2006 + */ + + +package org.posterita.exceptions; + + +public class MandatoryNameException extends BPartnerException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public MandatoryNameException(String msg) + { + super(msg); + } +} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/exceptions/NoAccessToEditObjectException.java b/posterita/posterita/src/main/org/posterita/exceptions/NoAccessToEditObjectException.java new file mode 100644 index 0000000000..6575dd1ed9 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/NoAccessToEditObjectException.java @@ -0,0 +1,17 @@ +package org.posterita.exceptions; + +public class NoAccessToEditObjectException extends OperationException +{ + + /** + * + */ + private static final long serialVersionUID = 1L; + + public NoAccessToEditObjectException(String msg) + { + super(msg); + } + + +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/NoAllocateeInvoiceException.java b/posterita/posterita/src/main/org/posterita/exceptions/NoAllocateeInvoiceException.java new file mode 100644 index 0000000000..0ec57dc200 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/NoAllocateeInvoiceException.java @@ -0,0 +1,37 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Dec 12, 2006 + */ + + +package org.posterita.exceptions; + + +public class NoAllocateeInvoiceException extends OperationException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public NoAllocateeInvoiceException(String message) + { + super(message); + } +} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/exceptions/NoCashJournalPresentException.java b/posterita/posterita/src/main/org/posterita/exceptions/NoCashJournalPresentException.java new file mode 100644 index 0000000000..fba12d83aa --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/NoCashJournalPresentException.java @@ -0,0 +1,32 @@ +/****************************************************************************** + * Product: Posterita Web-Based POS and Adempiere Plugin * + * Copyright (C) 2008 Posterita Ltd * + * This file is part of POSterita * + * * + * POSterita is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * + *****************************************************************************/ +package org.posterita.exceptions; + +/** + * @author ashley + * Jun 3, 2008 + */ +public class NoCashJournalPresentException extends OperationException +{ + public NoCashJournalPresentException(String msg) + { + super(msg); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/NoCheckBoxSelectedException.java b/posterita/posterita/src/main/org/posterita/exceptions/NoCheckBoxSelectedException.java new file mode 100644 index 0000000000..965e9104b8 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/NoCheckBoxSelectedException.java @@ -0,0 +1,39 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Jan 26, 2007 + */ + + +package org.posterita.exceptions; + +import org.posterita.exceptions.OperationException; + + +public class NoCheckBoxSelectedException extends OperationException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public NoCheckBoxSelectedException(String exception) + { + super(exception); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/NoClientFoundException.java b/posterita/posterita/src/main/org/posterita/exceptions/NoClientFoundException.java new file mode 100644 index 0000000000..e9a4889bdd --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/NoClientFoundException.java @@ -0,0 +1,34 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + **/ +package org.posterita.exceptions; + + +public class NoClientFoundException extends OperationException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public NoClientFoundException(String exception) + { + super(exception); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/NoCustomerFoundException.java b/posterita/posterita/src/main/org/posterita/exceptions/NoCustomerFoundException.java new file mode 100644 index 0000000000..84be45a422 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/NoCustomerFoundException.java @@ -0,0 +1,38 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * 14-Dec-2006 13:02:58 by praveen + * + */ + +package org.posterita.exceptions; + +public class NoCustomerFoundException extends OperationException +{ + private static final long serialVersionUID = 1L; + + public NoCustomerFoundException(String xception) + { + super(xception); + } + + public NoCustomerFoundException(Exception xception) + { + super(xception); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/NoLocationFoundException.java b/posterita/posterita/src/main/org/posterita/exceptions/NoLocationFoundException.java new file mode 100644 index 0000000000..7975cb417f --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/NoLocationFoundException.java @@ -0,0 +1,35 @@ +/** + * Product: Posterita Web-Based POS (an Adempiere Plugin) + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Dec 26, 2006 + */ + +package org.posterita.exceptions; + +public class NoLocationFoundException extends OperationException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public NoLocationFoundException(String msg) + { + super(msg); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/NoOrderLineFoundException.java b/posterita/posterita/src/main/org/posterita/exceptions/NoOrderLineFoundException.java new file mode 100644 index 0000000000..96dafdbd75 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/NoOrderLineFoundException.java @@ -0,0 +1,38 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * 31-Aug-2006 17:21:30 by praveen + * + */ + +package org.posterita.exceptions; + +public class NoOrderLineFoundException extends OperationException +{ + private static final long serialVersionUID = 1L; + + public NoOrderLineFoundException(String xception) + { + super(xception); + } + + public NoOrderLineFoundException(Exception exception) + { + super(exception); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/NoOrderLineSelectedException.java b/posterita/posterita/src/main/org/posterita/exceptions/NoOrderLineSelectedException.java new file mode 100644 index 0000000000..03d172a537 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/NoOrderLineSelectedException.java @@ -0,0 +1,34 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ +package org.posterita.exceptions; + + +public class NoOrderLineSelectedException extends OperationException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public NoOrderLineSelectedException(String exception) + { + super(exception); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/NoPaymentAmountException.java b/posterita/posterita/src/main/org/posterita/exceptions/NoPaymentAmountException.java new file mode 100644 index 0000000000..a26e69b9fb --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/NoPaymentAmountException.java @@ -0,0 +1,37 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Nov 22, 2006 + */ + + +package org.posterita.exceptions; + + +public class NoPaymentAmountException extends OperationException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public NoPaymentAmountException(String message) + { + super(message); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/NoProductImageException.java b/posterita/posterita/src/main/org/posterita/exceptions/NoProductImageException.java new file mode 100644 index 0000000000..9f588d97a6 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/NoProductImageException.java @@ -0,0 +1,11 @@ +package org.posterita.exceptions; + +public class NoProductImageException extends OperationException +{ + private static final long serialVersionUID = 1L; + + public NoProductImageException(String msg) + { + super(msg); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/NoProductSelectedException.java b/posterita/posterita/src/main/org/posterita/exceptions/NoProductSelectedException.java new file mode 100644 index 0000000000..41c65c77d1 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/NoProductSelectedException.java @@ -0,0 +1,36 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 09-Aug-2005 by alok + * + */ +package org.posterita.exceptions; + + +public class NoProductSelectedException extends OperationException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public NoProductSelectedException(String str) + { + super(str); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/NoStockAvailableException.java b/posterita/posterita/src/main/org/posterita/exceptions/NoStockAvailableException.java new file mode 100644 index 0000000000..068ee3aa6a --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/NoStockAvailableException.java @@ -0,0 +1,56 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Created on 26-Sep-2005 + */ + + +package org.posterita.exceptions; + + +public class NoStockAvailableException extends OperationException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + private Object[] args; + + public NoStockAvailableException(String msg) + { + super(msg); + } + + public Object[] getArgs() + { + return args; + } + + + + public void setArgs(Object[] args) + { + this.args = args; + } + + public NoStockAvailableException(Object args[]) + { + setArgs(args); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/NotLoggedInException.java b/posterita/posterita/src/main/org/posterita/exceptions/NotLoggedInException.java new file mode 100644 index 0000000000..4f5efb013e --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/NotLoggedInException.java @@ -0,0 +1,34 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 16-Feb-2005 by fred + * + */ +package org.posterita.exceptions; + +public class NotLoggedInException extends ApplicationException +{ + + /** + * + */ + private static final long serialVersionUID = 1L; + + + +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/NullTransferAmountException.java b/posterita/posterita/src/main/org/posterita/exceptions/NullTransferAmountException.java new file mode 100644 index 0000000000..dda3366ee2 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/NullTransferAmountException.java @@ -0,0 +1,38 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Jul 14, 2006 + */ + + +package org.posterita.exceptions; + + +public class NullTransferAmountException extends OperationException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + +public NullTransferAmountException(String xception) + { + super(xception); + } + +} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/exceptions/OperationException.java b/posterita/posterita/src/main/org/posterita/exceptions/OperationException.java new file mode 100644 index 0000000000..3429376a14 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/OperationException.java @@ -0,0 +1,51 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ + +package org.posterita.exceptions; + +public class OperationException extends Exception +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public OperationException() + { + + } + + public OperationException(String xception) + { + super(xception); + } + + public OperationException(Exception exception) + { + super(exception); + } + + public OperationException(String msg, Exception exception) + { + super(msg,exception); + } + + +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/OrganisationAlreadyExistsException.java b/posterita/posterita/src/main/org/posterita/exceptions/OrganisationAlreadyExistsException.java new file mode 100644 index 0000000000..b2831bf7e2 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/OrganisationAlreadyExistsException.java @@ -0,0 +1,34 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ +package org.posterita.exceptions; + + +public class OrganisationAlreadyExistsException extends OperationException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public OrganisationAlreadyExistsException(String exception) + { + super(exception); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/POException.java b/posterita/posterita/src/main/org/posterita/exceptions/POException.java new file mode 100644 index 0000000000..7311dd53ef --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/POException.java @@ -0,0 +1,63 @@ +/****************************************************************************** + * Product: Posterita Web-Based POS and Adempiere Plugin * + * Copyright (C) 2008 Posterita Ltd * + * This file is part of POSterita * + * * + * POSterita is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * + *****************************************************************************/ +package org.posterita.exceptions; + +/** + * @author ashley + */ +public class POException extends RuntimeException +{ + private static final long serialVersionUID = 4178407778052352481L; + + /** + * + */ + public POException() + { + super(); + } + + /** + * @param message + * @param cause + */ + public POException(String message, Throwable cause) + { + super(message, cause); + } + + /** + * @param message + */ + public POException(String message) + { + super(message); + } + + /** + * @param cause + */ + public POException(Throwable cause) + { + super(cause); + } + + +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/POSTerminalException.java b/posterita/posterita/src/main/org/posterita/exceptions/POSTerminalException.java new file mode 100644 index 0000000000..120dd679fd --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/POSTerminalException.java @@ -0,0 +1,36 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + **/ + +/** + @author ashley + */ + +package org.posterita.exceptions; + +public class POSTerminalException extends OperationException +{ + private static final long serialVersionUID = 1L; + + public POSTerminalException(String msg) + { + super(msg); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/PayAmtNotEqualToAllocateAmtException.java b/posterita/posterita/src/main/org/posterita/exceptions/PayAmtNotEqualToAllocateAmtException.java new file mode 100644 index 0000000000..6eb96ae608 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/PayAmtNotEqualToAllocateAmtException.java @@ -0,0 +1,37 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Dec 26, 2006 + */ + + +package org.posterita.exceptions; + + +public class PayAmtNotEqualToAllocateAmtException extends OperationException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public PayAmtNotEqualToAllocateAmtException(String message) + { + super(message); + } +} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/exceptions/PaymentTermAlreadyExistsException.java b/posterita/posterita/src/main/org/posterita/exceptions/PaymentTermAlreadyExistsException.java new file mode 100644 index 0000000000..a0eb290fa5 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/PaymentTermAlreadyExistsException.java @@ -0,0 +1,40 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Nov 1, 2006 + */ + + +package org.posterita.exceptions; + +import org.posterita.exceptions.OperationException; + + +public class PaymentTermAlreadyExistsException extends OperationException +{ + + /** + * + */ + private static final long serialVersionUID = 1L; + + public PaymentTermAlreadyExistsException(String msg) + { + super(msg); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/PriceListAlreadyExistsException.java b/posterita/posterita/src/main/org/posterita/exceptions/PriceListAlreadyExistsException.java new file mode 100644 index 0000000000..d0483902a6 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/PriceListAlreadyExistsException.java @@ -0,0 +1,11 @@ +package org.posterita.exceptions; + +public class PriceListAlreadyExistsException extends OperationException +{ + + public PriceListAlreadyExistsException(String exception) + { + super(exception); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/ProductAlreadyExistException.java b/posterita/posterita/src/main/org/posterita/exceptions/ProductAlreadyExistException.java new file mode 100644 index 0000000000..b7ce33d666 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/ProductAlreadyExistException.java @@ -0,0 +1,37 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 09-Aug-2005 by alok + * + */ +package org.posterita.exceptions; + + +public class ProductAlreadyExistException extends OperationException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public ProductAlreadyExistException(String exception) + { + super(exception); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/ProductImageInvalidException.java b/posterita/posterita/src/main/org/posterita/exceptions/ProductImageInvalidException.java new file mode 100644 index 0000000000..1b6d596262 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/ProductImageInvalidException.java @@ -0,0 +1,42 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +* Created on May 2, 2006 by ashley +* +*/ + +package org.posterita.exceptions; + +public class ProductImageInvalidException extends OperationException +{ + + /** + * + */ + private static final long serialVersionUID = 1L; + + public ProductImageInvalidException(String msg) + { + super(msg); + } + + public ProductImageInvalidException(String msg, Exception ex) + { + super(msg, ex); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/ProductInStockException.java b/posterita/posterita/src/main/org/posterita/exceptions/ProductInStockException.java new file mode 100644 index 0000000000..42666b2dea --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/ProductInStockException.java @@ -0,0 +1,37 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 09-Aug-2005 by alok + * + */ +package org.posterita.exceptions; + + +public class ProductInStockException extends OperationException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public ProductInStockException(String exception) + { + super(exception); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/ProductNotFoundException.java b/posterita/posterita/src/main/org/posterita/exceptions/ProductNotFoundException.java new file mode 100644 index 0000000000..ae5dca8e64 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/ProductNotFoundException.java @@ -0,0 +1,37 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +* Created on Feb 24, 2006 by ashley +* +*/ + +package org.posterita.exceptions; + +public class ProductNotFoundException extends OperationException +{ + + /** + * + */ + private static final long serialVersionUID = 1L; + + public ProductNotFoundException(String msg) + { + super(msg); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/ProductNotImportedException.java b/posterita/posterita/src/main/org/posterita/exceptions/ProductNotImportedException.java new file mode 100644 index 0000000000..269d905a07 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/ProductNotImportedException.java @@ -0,0 +1,26 @@ +package org.posterita.exceptions; + +public class ProductNotImportedException extends OperationException +{ + + public ProductNotImportedException() + { + super(); + } + + public ProductNotImportedException(Exception exception) + { + super(exception); + } + + public ProductNotImportedException(String msg, Exception exception) + { + super(msg, exception); + } + + public ProductNotImportedException(String exception) + { + super(exception); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/ProductNotOnPriceListException.java b/posterita/posterita/src/main/org/posterita/exceptions/ProductNotOnPriceListException.java new file mode 100644 index 0000000000..1518325f8b --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/ProductNotOnPriceListException.java @@ -0,0 +1,38 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on May 30, 2006 + */ + + +package org.posterita.exceptions; + + +public class ProductNotOnPriceListException extends OperationException +{ + + /** + * + */ + private static final long serialVersionUID = 1L; + + public ProductNotOnPriceListException(String exception) + { + super(exception); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/QuantityNotAvailableException.java b/posterita/posterita/src/main/org/posterita/exceptions/QuantityNotAvailableException.java new file mode 100644 index 0000000000..267224c0de --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/QuantityNotAvailableException.java @@ -0,0 +1,50 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +package org.posterita.exceptions; + + +public class QuantityNotAvailableException extends OperationException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + private String message; + + public QuantityNotAvailableException() + { + + } + + public QuantityNotAvailableException(String exception) + { + super(exception); + } + + public void setMessage(String message) + { + this.message = message; + } + + public String getMessage() + { + return message; + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/ReloadFactoryException.java b/posterita/posterita/src/main/org/posterita/exceptions/ReloadFactoryException.java new file mode 100644 index 0000000000..ad6ed267c4 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/ReloadFactoryException.java @@ -0,0 +1,38 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +* +* Created on Nov 14, 2006 by ashley +* +*/ + +/** + @author ashley + */ + +package org.posterita.exceptions; + +public class ReloadFactoryException extends OperationException +{ + private static final long serialVersionUID = 1L; + + public ReloadFactoryException(String msg, Exception ex) + { + super(msg, ex); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/RequestOwnerNotFoundException.java b/posterita/posterita/src/main/org/posterita/exceptions/RequestOwnerNotFoundException.java new file mode 100644 index 0000000000..998cd8ed2c --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/RequestOwnerNotFoundException.java @@ -0,0 +1,42 @@ +/* +* +* Copyright (c) 2006 Tamak ICT Ltd. All Rights Reserved. +* +* This software is the confidential and proprietary information of +* UDI Ltd. ("Confidential Information"). You shall not +* disclose such Confidential Information and shall use it only in +* accordance with the terms of the license agreement you entered into +* with UDI. +* +* UDI MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE +* SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT +* NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR +* A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. UDI SHALL NOT +* BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, +* MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. +* +* Created on Jun 26, 2006 by ashley +* +*/ + +/** + @author ashley + */ + +package org.posterita.exceptions; + +import org.posterita.exceptions.OperationException; + +public class RequestOwnerNotFoundException extends OperationException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public RequestOwnerNotFoundException(String msg) + { + super(msg); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/RoleAlreadyExistsException.java b/posterita/posterita/src/main/org/posterita/exceptions/RoleAlreadyExistsException.java new file mode 100644 index 0000000000..98f7219c1e --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/RoleAlreadyExistsException.java @@ -0,0 +1,35 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Nov 14, 2005 by praveen + * + */ +package org.posterita.exceptions; + +public class RoleAlreadyExistsException extends OperationException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public RoleAlreadyExistsException(String msg) + { + super(msg); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/SequenceUpdateException.java b/posterita/posterita/src/main/org/posterita/exceptions/SequenceUpdateException.java new file mode 100644 index 0000000000..29f6881b14 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/SequenceUpdateException.java @@ -0,0 +1,38 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Oct 17, 2006 + */ + + +package org.posterita.exceptions; + + +public class SequenceUpdateException extends OperationException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public SequenceUpdateException(String msg) + { + super(msg); + } +} + diff --git a/posterita/posterita/src/main/org/posterita/exceptions/ShipmentAlreadyExistsException.java b/posterita/posterita/src/main/org/posterita/exceptions/ShipmentAlreadyExistsException.java new file mode 100644 index 0000000000..147efe23a2 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/ShipmentAlreadyExistsException.java @@ -0,0 +1,37 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 26-Sep-2005 by Vishee + * + */ + +package org.posterita.exceptions; + +public class ShipmentAlreadyExistsException extends ApplicationException +{ + + /** + * + */ + private static final long serialVersionUID = 1L; + + public ShipmentAlreadyExistsException(String message) + { + super(message); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/ShipperAlreadyExistsException.java b/posterita/posterita/src/main/org/posterita/exceptions/ShipperAlreadyExistsException.java new file mode 100644 index 0000000000..f46836f76b --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/ShipperAlreadyExistsException.java @@ -0,0 +1,35 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +package org.posterita.exceptions; + + +public class ShipperAlreadyExistsException extends OperationException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public ShipperAlreadyExistsException(String exception) + { + super(exception); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/StoreException.java b/posterita/posterita/src/main/org/posterita/exceptions/StoreException.java new file mode 100644 index 0000000000..d0d3bce666 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/StoreException.java @@ -0,0 +1,36 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + **/ + +/** + @author ashley + */ + +package org.posterita.exceptions; + +public class StoreException extends OperationException +{ + private static final long serialVersionUID = 1L; + + public StoreException(String msg) + { + super(msg); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/SurnameNotPresentException.java b/posterita/posterita/src/main/org/posterita/exceptions/SurnameNotPresentException.java new file mode 100644 index 0000000000..cbeae83506 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/SurnameNotPresentException.java @@ -0,0 +1,38 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Created on 16-Dec-2005 + */ + + +package org.posterita.exceptions; + + +public class SurnameNotPresentException extends OperationException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public SurnameNotPresentException(String exception) + { + super(exception); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/SystemException.java b/posterita/posterita/src/main/org/posterita/exceptions/SystemException.java new file mode 100644 index 0000000000..f3e1100204 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/SystemException.java @@ -0,0 +1,40 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ + +package org.posterita.exceptions; + + +public class SystemException extends Exception +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public SystemException(Exception e) + { + super(e); + } + + public SystemException(String xception) + { + super(xception); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/TMKRuntimeException.java b/posterita/posterita/src/main/org/posterita/exceptions/TMKRuntimeException.java new file mode 100644 index 0000000000..fed6b51a5f --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/TMKRuntimeException.java @@ -0,0 +1,34 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ +package org.posterita.exceptions; + + +public class TMKRuntimeException extends RuntimeException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public TMKRuntimeException(String exception) + { + super(exception); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/TaxNameAlreadyExistsException.java b/posterita/posterita/src/main/org/posterita/exceptions/TaxNameAlreadyExistsException.java new file mode 100644 index 0000000000..644ca5a447 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/TaxNameAlreadyExistsException.java @@ -0,0 +1,37 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Nov 28, 2006 + */ + + +package org.posterita.exceptions; + + +public class TaxNameAlreadyExistsException extends BPartnerException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public TaxNameAlreadyExistsException(String msg) + { + super(msg); + } +} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/exceptions/TaxRateAlreadyExistsException.java b/posterita/posterita/src/main/org/posterita/exceptions/TaxRateAlreadyExistsException.java new file mode 100644 index 0000000000..7e206f3571 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/TaxRateAlreadyExistsException.java @@ -0,0 +1,37 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Nov 28, 2006 + */ + + +package org.posterita.exceptions; + + +public class TaxRateAlreadyExistsException extends BPartnerException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public TaxRateAlreadyExistsException(String msg) + { + super(msg); + } +} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/exceptions/TaxRateNotDefineException.java b/posterita/posterita/src/main/org/posterita/exceptions/TaxRateNotDefineException.java new file mode 100644 index 0000000000..496a02e515 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/TaxRateNotDefineException.java @@ -0,0 +1,35 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Sep 26, 2006 + */ + + +package org.posterita.exceptions; + + +public class TaxRateNotDefineException extends OperationException +{ + + private static final long serialVersionUID = 1L; + + public TaxRateNotDefineException(String exception) + { + super(exception); + } +} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/exceptions/TerminalInactivateException.java b/posterita/posterita/src/main/org/posterita/exceptions/TerminalInactivateException.java new file mode 100644 index 0000000000..664e1c017b --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/TerminalInactivateException.java @@ -0,0 +1,32 @@ +/****************************************************************************** + * Product: Posterita Web-Based POS and Adempiere Plugin * + * Copyright (C) 2008 Posterita Ltd * + * This file is part of POSterita * + * * + * POSterita is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * + *****************************************************************************/ +package org.posterita.exceptions; + +/** + * @author ashley + * Jun 4, 2008 + */ +public class TerminalInactivateException extends OperationException +{ + public TerminalInactivateException(String msg) + { + super(msg); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/TerminalLockedException.java b/posterita/posterita/src/main/org/posterita/exceptions/TerminalLockedException.java new file mode 100644 index 0000000000..5212770291 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/TerminalLockedException.java @@ -0,0 +1,37 @@ +/****************************************************************************** + * Product: Posterita Web-Based POS and Adempiere Plugin * + * Copyright (C) 2008 Posterita Ltd * + * This file is part of POSterita * + * * + * POSterita is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * + *****************************************************************************/ +package org.posterita.exceptions; + +/** + * @author ashley + * May 30, 2008 + */ +public class TerminalLockedException extends OperationException +{ + public TerminalLockedException(String message) + { + super(message); + } + + public TerminalLockedException(String message, Exception exception) + { + super(message, exception); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/TerminalNotFoundException.java b/posterita/posterita/src/main/org/posterita/exceptions/TerminalNotFoundException.java new file mode 100644 index 0000000000..59fb07a4e9 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/TerminalNotFoundException.java @@ -0,0 +1,32 @@ +/****************************************************************************** + * Product: Posterita Web-Based POS and Adempiere Plugin * + * Copyright (C) 2008 Posterita Ltd * + * This file is part of POSterita * + * * + * POSterita is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * + *****************************************************************************/ +package org.posterita.exceptions; + +/** + * @author Ashley G Ramdass + * Apr 24, 2008 + */ +public class TerminalNotFoundException extends OperationException +{ + public TerminalNotFoundException(String msg) + { + super(msg); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/ThumbnailGenerationException.java b/posterita/posterita/src/main/org/posterita/exceptions/ThumbnailGenerationException.java new file mode 100644 index 0000000000..0a66b811fd --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/ThumbnailGenerationException.java @@ -0,0 +1,43 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +* Created on May 3, 2006 by ashley +* +*/ + +package org.posterita.exceptions; + +public class ThumbnailGenerationException extends OperationException +{ + + /** + * + */ + private static final long serialVersionUID = 1L; + + public ThumbnailGenerationException(String msg) + { + super(msg); + } + + public ThumbnailGenerationException(String msg, Exception ex) + { + super(msg, ex); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/TooManyAllocateInvoiceException.java b/posterita/posterita/src/main/org/posterita/exceptions/TooManyAllocateInvoiceException.java new file mode 100644 index 0000000000..ebdb6ebfea --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/TooManyAllocateInvoiceException.java @@ -0,0 +1,37 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Dec 8, 2006 + */ + + +package org.posterita.exceptions; + + +public class TooManyAllocateInvoiceException extends OperationException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public TooManyAllocateInvoiceException(String message) + { + super(message); + } +} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/exceptions/TotalQuantityLessThanZeroException.java b/posterita/posterita/src/main/org/posterita/exceptions/TotalQuantityLessThanZeroException.java new file mode 100644 index 0000000000..532a7f29fd --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/TotalQuantityLessThanZeroException.java @@ -0,0 +1,35 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +package org.posterita.exceptions; + + +public class TotalQuantityLessThanZeroException extends OperationException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public TotalQuantityLessThanZeroException(String exception) + { + super(exception); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/TrackingNumberNotfoundException.java b/posterita/posterita/src/main/org/posterita/exceptions/TrackingNumberNotfoundException.java new file mode 100644 index 0000000000..a38b0dc048 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/TrackingNumberNotfoundException.java @@ -0,0 +1,37 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Jun 9, 2006 + */ + + +package org.posterita.exceptions; + + +public class TrackingNumberNotfoundException extends OperationException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + +public TrackingNumberNotfoundException(String msg) + { + super(msg); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/TransferAmountExceedsTotalAmountException.java b/posterita/posterita/src/main/org/posterita/exceptions/TransferAmountExceedsTotalAmountException.java new file mode 100644 index 0000000000..aaac0aec08 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/TransferAmountExceedsTotalAmountException.java @@ -0,0 +1,38 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Jul 14, 2006 + */ + + +package org.posterita.exceptions; + + +public class TransferAmountExceedsTotalAmountException extends OperationException +{ + + /** + * + */ + private static final long serialVersionUID = 1L; + + public TransferAmountExceedsTotalAmountException(String xception) + { + super(xception); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/UOMNotFoundException.java b/posterita/posterita/src/main/org/posterita/exceptions/UOMNotFoundException.java new file mode 100644 index 0000000000..2901f58923 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/UOMNotFoundException.java @@ -0,0 +1,17 @@ +package org.posterita.exceptions; + + +public class UOMNotFoundException extends OperationException +{ + + /** + * + */ + private static final long serialVersionUID = 1L; + + + public UOMNotFoundException(String str) + { + super(str); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/UOMValuePrecisionNotValidException.java b/posterita/posterita/src/main/org/posterita/exceptions/UOMValuePrecisionNotValidException.java new file mode 100644 index 0000000000..a70ba8953e --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/UOMValuePrecisionNotValidException.java @@ -0,0 +1,21 @@ +package org.posterita.exceptions; + +/** + * This Exception corresponds to the situation where the entered + * value for some field has a precision which exceeds that field's UOM precision. + * + * @author sendy + * + */ +public class UOMValuePrecisionNotValidException extends OperationException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public UOMValuePrecisionNotValidException(String exception) + { + super(exception); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/UnitNumberAlreadyExistException.java b/posterita/posterita/src/main/org/posterita/exceptions/UnitNumberAlreadyExistException.java new file mode 100644 index 0000000000..ab8c9b2e76 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/UnitNumberAlreadyExistException.java @@ -0,0 +1,36 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +* Created on Jan 16, 2006 by ashley +* +*/ + +package org.posterita.exceptions; + +public class UnitNumberAlreadyExistException extends OperationException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public UnitNumberAlreadyExistException(String msg) + { + super(msg); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/UnsupportedDatabaseException.java b/posterita/posterita/src/main/org/posterita/exceptions/UnsupportedDatabaseException.java new file mode 100644 index 0000000000..67e27be7a4 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/UnsupportedDatabaseException.java @@ -0,0 +1,39 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + **/ + +/** + @author ashley + */ + +package org.posterita.exceptions; + +public class UnsupportedDatabaseException extends RuntimeException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public UnsupportedDatabaseException(String msg) + { + super(msg); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/UserAlreadyExistsException.java b/posterita/posterita/src/main/org/posterita/exceptions/UserAlreadyExistsException.java new file mode 100644 index 0000000000..8f431ee3dd --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/UserAlreadyExistsException.java @@ -0,0 +1,34 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ +package org.posterita.exceptions; + + +public class UserAlreadyExistsException extends OperationException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public UserAlreadyExistsException(String exception) + { + super(exception); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/UserException.java b/posterita/posterita/src/main/org/posterita/exceptions/UserException.java new file mode 100644 index 0000000000..257cc85f73 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/UserException.java @@ -0,0 +1,48 @@ +/* +* +* Copyright (c) 2006 Tamak ICT Ltd. All Rights Reserved. +* +* This software is the confidential and proprietary information of +* UDI Ltd. ("Confidential Information"). You shall not +* disclose such Confidential Information and shall use it only in +* accordance with the terms of the license agreement you entered into +* with UDI. +* +* UDI MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE +* SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT +* NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR +* A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. UDI SHALL NOT +* BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, +* MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. +* +* Created on Jun 5, 2006 by ashley +* +*/ + +/** + @author ashley + */ + +package org.posterita.exceptions; + +import org.posterita.exceptions.OperationException; + +public class UserException extends OperationException +{ + + /** + * + */ + private static final long serialVersionUID = 1L; + + public UserException(String msg) + { + super(msg); + } + + public UserException(String msg, Exception ex) + { + super(msg, ex); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/UserInactiveException.java b/posterita/posterita/src/main/org/posterita/exceptions/UserInactiveException.java new file mode 100644 index 0000000000..12ae6a798f --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/UserInactiveException.java @@ -0,0 +1,35 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 07-Apr-2005 by fred + * + */ +package org.posterita.exceptions; + + +public class UserInactiveException extends ApplicationException +{ + + /** + * + */ + private static final long serialVersionUID = 1L; + + + +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/UserInvalidException.java b/posterita/posterita/src/main/org/posterita/exceptions/UserInvalidException.java new file mode 100644 index 0000000000..b7911b2677 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/UserInvalidException.java @@ -0,0 +1,38 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +* Created on Mar 29, 2006 by ashley +* +*/ + +package org.posterita.exceptions; + +import org.posterita.exceptions.DataException; + +public class UserInvalidException extends DataException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public UserInvalidException(String msg) + { + super(msg); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/UserNotFoundException.java b/posterita/posterita/src/main/org/posterita/exceptions/UserNotFoundException.java new file mode 100644 index 0000000000..95eb36b39a --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/UserNotFoundException.java @@ -0,0 +1,35 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 17-Feb-2005 by fred + * + */ +package org.posterita.exceptions; + + +public class UserNotFoundException extends ApplicationException +{ + + /** + * + */ + private static final long serialVersionUID = 1L; + + + +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/WarehouseAlreadyExistsException.java b/posterita/posterita/src/main/org/posterita/exceptions/WarehouseAlreadyExistsException.java new file mode 100644 index 0000000000..feb781e945 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/WarehouseAlreadyExistsException.java @@ -0,0 +1,35 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ +package org.posterita.exceptions; + + +public class WarehouseAlreadyExistsException extends Exception +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public WarehouseAlreadyExistsException(String exception) + { + super(exception); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/WebstoreOrderProcessingException.java b/posterita/posterita/src/main/org/posterita/exceptions/WebstoreOrderProcessingException.java new file mode 100644 index 0000000000..bd20ea6fce --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/WebstoreOrderProcessingException.java @@ -0,0 +1,36 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +* Created on Jan 16, 2006 by ashley +* +*/ + +package org.posterita.exceptions; + +public class WebstoreOrderProcessingException extends OperationException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public WebstoreOrderProcessingException(String msg) + { + super(msg); + } +} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/WrongPasswordException.java b/posterita/posterita/src/main/org/posterita/exceptions/WrongPasswordException.java new file mode 100644 index 0000000000..8d14d0042f --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/exceptions/WrongPasswordException.java @@ -0,0 +1,26 @@ +/* + * Created on 2005/03/09 + * + * To change the template for this generated file go to + * Window - Preferences - Java - Code Style - Code Templates + */ +package org.posterita.exceptions; + +/** + * @author jane + * + * To change the template for this generated type comment go to + * Window - Preferences - Java - Code Style - Code Templates + */ +public class WrongPasswordException extends ApplicationException +{ + + /** + * + */ + private static final long serialVersionUID = 1L; + + + + +} diff --git a/posterita/posterita/src/main/org/posterita/factory/AbstractFactory.java b/posterita/posterita/src/main/org/posterita/factory/AbstractFactory.java new file mode 100644 index 0000000000..2a9479216c --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/factory/AbstractFactory.java @@ -0,0 +1,242 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Jul 11, 2005 by vishee + */ + +package org.posterita.factory; + +import java.lang.reflect.Constructor; +import java.lang.reflect.InvocationTargetException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Properties; +import java.util.Set; + +import org.compiere.model.PO; +import org.compiere.util.Env; + +import org.posterita.businesslogic.ClientManager; +import org.posterita.core.FactoryPropertiesManager; +import org.posterita.exceptions.OperationException; +import org.posterita.exceptions.ReloadFactoryException; +import org.posterita.lib.UdiConstants; + +public abstract class AbstractFactory +{ + private static final String KEY_SEPARATOR = "_"; + protected HashMap map; + protected static int[] clients; + + public static final String MENU_POSITION_TOP = "TOP"; + public static final String MENU_POSITION_LEFT = "LEFT"; + public static final String MENU_POSITION_RIGHT = "RIGHT"; + public static final String MENU_POSITION_DOWN = "DOWN"; + + + static + { + clients = ClientManager.getAvailableClientIds(); + } + + WebProperties pm = FactoryPropertiesManager.getProperty(); + + protected void initFactory(Properties ctx, AbstractFactory factory) throws OperationException + { + clients = ClientManager.getAvailableClientIds(); + if (Env.getAD_Client_ID(ctx) == 0) //--> Client Independent PO + { + if (factory == null) + { + loadFactory(ctx); + } + else + { + loadFactory(ctx, factory); + } + } + else + { + // Catering for multiple clients. All clients should have factory objects loaded. + for (int i = 0; i < clients.length; i++) + { + Properties nCtx = getCtxClone(ctx, clients[i]); + if (factory == null) + { + loadFactory(nCtx); + } + else + { + loadFactory(nCtx, factory); + } + } + } + } + + protected abstract void loadFactory(Properties ctx) throws OperationException; + + protected abstract void loadFactory(Properties ctx, AbstractFactory factory) throws OperationException; + + public static void reloadFactory(Properties ctx) throws ReloadFactoryException + { + + } + + /*private static Properties getCtxClone(Properties ctx) + { + return getCtxClone(ctx, Env.getAD_Client_ID(ctx)); + }*/ + + private static Properties getCtxClone(Properties ctx, int adClientId) + { + Properties nCtx = (Properties)ctx.clone(); + Env.setContext(nCtx, UdiConstants.CLIENT_ID_CTX_PARAM, adClientId); + Env.setContext(nCtx, UdiConstants.ORG_ID_CTX_PARAM, 0); + Env.setContext(nCtx, UdiConstants.ROLE_EDITABLE_ORGS_CTX_PARAM, 0); + Env.setContext(nCtx, UdiConstants.USER_ID_CTX_PARAM, 100); + return nCtx; + } + + protected void add(Properties ctx, String key, PO po) throws OperationException + { + if (map == null) + { + map = new HashMap(); + } + + String idStr = pm.get(ctx, key); + + if (idStr == null) + { + po.save(); // UDIPO + pm.put(ctx, key, ""+po.get_ID()); + } + else + { + Class cl; + Class params[]; + Constructor constructor; + Object[] args; + PO loadedPO; + try + { + cl = Class.forName(po.getClass().getName()); + params = new Class[]{Properties.class, int.class, String.class}; + + constructor = cl.getConstructor(params); + args = new Object[]{ctx,Integer.valueOf(idStr),null}; + loadedPO = (PO) constructor.newInstance(args); + setFields(ctx, po, loadedPO); + loadedPO.save(); + } + catch (ClassNotFoundException e) + { + throw new OperationException(e.getMessage()); + } + catch (SecurityException e) + { + throw new OperationException(e.getMessage()); + } + catch (NoSuchMethodException e) + { + throw new OperationException(e.getMessage()); + } + catch (IllegalArgumentException e) + { + throw new OperationException(e.getMessage()); + } + catch (InstantiationException e) + { + throw new OperationException(e.getMessage()); + } + catch (IllegalAccessException e) + { + throw new OperationException(e.getMessage()); + } + catch (InvocationTargetException e) + { + throw new OperationException(e.getMessage()); + } + + + if (loadedPO == null || loadedPO.get_ID() == 0) + { + po.save(); + pm.put(ctx, key, ""+po.get_ID()); + } + else + { + po = loadedPO; + } + } + + put(ctx, key, po); + } + + private void put(Properties ctx, String key, PO po) + { + int adClientId = Env.getAD_Client_ID(ctx); + String nKey = key + KEY_SEPARATOR + String.valueOf(adClientId); + map.put(nKey, po); + } + + public PO get(Properties ctx, String key) throws OperationException + { + if (map == null) + { + initFactory(ctx, null); + } + + int adClientId = Env.getAD_Client_ID(ctx); + String nKey = key + KEY_SEPARATOR + String.valueOf(adClientId); + PO retPO = map.get(nKey); + + if (retPO == null) + throw new OperationException("Could not get PO with key: " + key); + + return retPO; + } + + protected void setFields(Properties ctx, PO fromPO, PO toPO) throws SecurityException, NoSuchMethodException, IllegalArgumentException, IllegalAccessException, InvocationTargetException + { + + } + + public ArrayList getAllKeys(Properties ctx) throws OperationException + { + if (map == null) + loadFactory(ctx); + + Set keySet = map.keySet(); + + ArrayList keyList = new ArrayList(); + + for(Object objKey : keySet) + { + String key = (String)objKey; + int ind = key.lastIndexOf(KEY_SEPARATOR); + if(ind > 0) + { + key = key.substring(0, ind); + } + keyList.add(key); + } + + return keyList; + } +} diff --git a/posterita/posterita/src/main/org/posterita/factory/DBPropertiesManager.java b/posterita/posterita/src/main/org/posterita/factory/DBPropertiesManager.java new file mode 100644 index 0000000000..b42c1c0f9e --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/factory/DBPropertiesManager.java @@ -0,0 +1,88 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Created on 12-Oct-2005 + */ + + +package org.posterita.factory; + +import java.util.Properties; + +import org.compiere.util.Env; + +import org.posterita.exceptions.OperationException; +import org.posterita.model.MWebProperties; + + +public class DBPropertiesManager implements WebProperties +{ + + public void put(Properties ctx, String key, String value) + { + int [] propertieIds = MWebProperties.getAllIDs(MWebProperties.Table_Name," U_KEY='"+key+"' and AD_CLIENT_ID = "+Env.getAD_Client_ID(ctx),null); + + if(propertieIds.length==0) + { + MWebProperties webProperties = new MWebProperties(ctx,0,null); + webProperties.setU_Key(key); + webProperties.setU_Value(value); + webProperties.save(); + } + else + { + MWebProperties webProperties = new MWebProperties(ctx,propertieIds[0],null); + webProperties.setU_Value(value); + webProperties.save(); + } + } + + + public String get(Properties ctx, String key) throws OperationException + { + + int [] values; + + values = MWebProperties.getAllIDs(MWebProperties.Table_Name,"u_key ='"+key+"' and AD_CLIENT_ID = "+Env.getAD_Client_ID(ctx),null); + + if (values.length == 0) + { + return null; + } + + + MWebProperties webProperties = new MWebProperties(ctx,values[0],null); + + return webProperties.getU_Value(); + } + +// private boolean iskeyPresent(Properties ctx,String key) +// { +// boolean keyPresent = true; +// int [] propertieIds = MWebProperties.getAllIDs(MWebProperties.Table_Name," U_KEY='"+key+"' and AD_CLIENT_ID = "+Env.getAD_Client_ID(ctx),null); +// +// if(propertieIds.length==0) +// keyPresent = false; +// +// return keyPresent; +// } + + + +} diff --git a/posterita/posterita/src/main/org/posterita/factory/DunningFactory.java b/posterita/posterita/src/main/org/posterita/factory/DunningFactory.java new file mode 100644 index 0000000000..c23c1125d5 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/factory/DunningFactory.java @@ -0,0 +1,86 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Oct 30, 2006 + */ + + +package org.posterita.factory; + +import java.util.Properties; + +import org.posterita.businesslogic.administration.DunningManager; +import org.posterita.exceptions.OperationException; +import org.posterita.exceptions.ReloadFactoryException; + + +public class DunningFactory extends AbstractFactory +{ + public static final String DUNNING_ID = "dunning.id"; + public static final String DUNNING_NAME="Dunning"; + public static final String DESCRIPTION="Include due an non-due invoices"; + public static final String DUNNING_LEVEL_NAME="Statement"; + public static final String PRINT_TEXT = "Statement "; + public static final String PRINT_NOTE="Please review your statement and submit due payments."; + + + private static DunningFactory singleton; + private DunningFactory() throws OperationException + { + + } + + public static DunningFactory getFactoryInstance(Properties ctx) throws OperationException + { + if (singleton == null) + singleton = new DunningFactory(); + + Properties nCtx = (Properties)ctx.clone(); + singleton.loadFactory(nCtx); + + return singleton; + } + + protected void loadFactory(Properties ctx) throws OperationException + { + loadFactory(ctx, singleton); + } + + protected void loadFactory(Properties ctx, AbstractFactory factory) throws OperationException + { + factory.add(ctx,DUNNING_ID, + DunningManager.createDunningAndLevel + (ctx,DUNNING_NAME,DESCRIPTION,DUNNING_LEVEL_NAME,PRINT_TEXT,PRINT_NOTE,-9999)); + + } + + public static void reloadFactory(Properties ctx) throws ReloadFactoryException + { + try + { + DunningFactory nFactory = new DunningFactory(); + nFactory.initFactory(ctx, nFactory); + singleton = nFactory; + } + catch(OperationException ex) + { + throw new ReloadFactoryException("Could not reload DunningFactory", ex); + } + } + +} diff --git a/posterita/posterita/src/main/org/posterita/factory/GenericSystemObjectsFactory.java b/posterita/posterita/src/main/org/posterita/factory/GenericSystemObjectsFactory.java new file mode 100644 index 0000000000..87590a4ba8 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/factory/GenericSystemObjectsFactory.java @@ -0,0 +1,110 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + **/ +package org.posterita.factory; + +import java.util.Properties; + +import org.compiere.model.MAssetGroup; +import org.compiere.model.MDiscountSchema; +import org.compiere.model.MDiscountSchemaLine; +import org.compiere.model.MProductCategory; +import org.compiere.model.MTax; +import org.compiere.model.MTaxCategory; +import org.posterita.core.SystemObjects; +import org.posterita.exceptions.OperationException; +import org.posterita.exceptions.ReloadFactoryException; +import org.posterita.lib.UdiConstants; + + +public class GenericSystemObjectsFactory extends AbstractFactory +{ + + public static final String PRODUCT_CATEGORY_ID = "product.category.id"; + public static final String TAX_CATEGORY_DEFAULT_ID = "tax.category.default.id"; + + public static final String ASSET_GROUP_ID = "asset.group.id"; + public static final String TAX_DEFAULT_ID = "tax.default.id"; + public static final String DISCOUNT_SCHEMA_ID = "discount.schema.id"; + public static final String DISCOUNT_SCHEMA_LINE_ID = "discount.schema.line.id"; + + private static GenericSystemObjectsFactory genericSystemsObjectFactory; + private GenericSystemObjectsFactory() + { + + } + + public static GenericSystemObjectsFactory getFactoryInstance() + { + if (genericSystemsObjectFactory == null) + genericSystemsObjectFactory = new GenericSystemObjectsFactory(); + + return genericSystemsObjectFactory; + } + + protected void loadFactory(Properties ctx) throws OperationException + { + loadFactory(ctx, genericSystemsObjectFactory); + } + + protected void loadFactory(Properties ctx, AbstractFactory factory) throws OperationException + { + MAssetGroup assetGroup = SystemObjects.getAssetGroup(ctx, "Posterita Asset Group"); + factory.add(ctx, ASSET_GROUP_ID, assetGroup); + assetGroup = (MAssetGroup)factory.get(ctx, ASSET_GROUP_ID); + + MProductCategory productCategory = SystemObjects.getProductCategory(ctx, "Posterita Product Category"); + factory.add(ctx, PRODUCT_CATEGORY_ID, productCategory); + productCategory = (MProductCategory) factory.get(ctx, GenericSystemObjectsFactory.PRODUCT_CATEGORY_ID); + productCategory.setA_Asset_Group_ID(assetGroup.get_ID()); + productCategory.save(); + + factory.add(ctx, TAX_CATEGORY_DEFAULT_ID, SystemObjects.getTaxCategory(ctx, "Posterita Tax Category")); + MTaxCategory taxCategory = (MTaxCategory) factory.get(ctx, TAX_CATEGORY_DEFAULT_ID); + + MTax tax = SystemObjects.getTax(ctx, "Posterita TAx", UdiConstants.COUNTRY_MAURITIUS, "Posterita Tax"); + tax.setC_TaxCategory_ID(taxCategory.getC_TaxCategory_ID()); + tax.setIsTaxExempt(true); + tax.setSOPOType(MTax.SOPOTYPE_SalesTax); + factory.add(ctx, TAX_DEFAULT_ID, tax); + + MDiscountSchema discountSchema = SystemObjects.getDiscountSchema(ctx, "Posterita Discount Schema"); + factory.add(ctx, DISCOUNT_SCHEMA_ID, discountSchema); + discountSchema = (MDiscountSchema) factory.get(ctx, GenericSystemObjectsFactory.DISCOUNT_SCHEMA_ID); + + MDiscountSchemaLine discountSchemaLine = SystemObjects.getDiscountSchemaLine(ctx, discountSchema.getM_DiscountSchema_ID()); + factory.add(ctx, DISCOUNT_SCHEMA_LINE_ID, discountSchemaLine); + discountSchemaLine = (MDiscountSchemaLine)factory.get(ctx, GenericSystemObjectsFactory.DISCOUNT_SCHEMA_LINE_ID); + } + + public static void reloadFactory(Properties ctx) throws ReloadFactoryException + { + try + { + GenericSystemObjectsFactory nFactory = new GenericSystemObjectsFactory(); + nFactory.initFactory(ctx, nFactory); + genericSystemsObjectFactory = nFactory; + } + catch(OperationException ex) + { + throw new ReloadFactoryException("Could not reload GenericSystemObjectsFactory", ex); + } + } + +} diff --git a/posterita/posterita/src/main/org/posterita/factory/MenuGenerator.java b/posterita/posterita/src/main/org/posterita/factory/MenuGenerator.java new file mode 100644 index 0000000000..6dbfe133a7 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/factory/MenuGenerator.java @@ -0,0 +1,91 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +package org.posterita.factory; + +import java.util.Properties; + +import org.compiere.model.MRole; +import org.compiere.model.X_U_RoleMenu; +import org.compiere.util.Env; +import org.posterita.businesslogic.MenuManager; +import org.posterita.exceptions.OperationException; +import org.posterita.model.MRoleMenu; +import org.posterita.util.PoManager; + + +public class MenuGenerator +{ + public static void createMenus(Properties ctx, MRole role) throws OperationException + { + int menuIds[] = MenuManager.getMenuIdForOrganisation(ctx); + int roleId = role.get_ID(); + + for(int i = 0; i < menuIds.length; i++) + { + if(MenuGenerator.isRoleMenuPresent(ctx, roleId, menuIds[i])) + continue; + MRoleMenu roleMenu = new MRoleMenu(ctx, 0, null); + + roleMenu.setAD_Role_ID(roleId); + roleMenu.setU_WebMenu_ID(menuIds[i]); + PoManager.save(roleMenu); + } + } + + private static boolean isRoleMenuPresent(Properties ctx, int roleId, int menuId) + { + boolean present = true; + + String sqlWhereClause = ""; + int adClientId = Env.getAD_Client_ID(ctx); + int adOrgId = Env.getAD_Org_ID(ctx); + + sqlWhereClause += "AD_CLIENT_ID=" + adClientId + " and AD_ORG_ID=" + adOrgId + " and U_WEBMENU_ID=" + menuId + " and AD_ROLE_ID=" + roleId; + int ids[] = X_U_RoleMenu.getAllIDs(X_U_RoleMenu.Table_Name, sqlWhereClause, null); + + if(ids.length == 0) + present = false; + + return present; + } + + /** + * @param ctx + * @param role + * @throws OperationException + */ + public static void createSuperUserMenus(Properties ctx, MRole role) throws OperationException + { + int menuIds[] = MenuManager.getMenuIdForSuperUser(ctx); + + int roleId = role.get_ID(); + + for(int i = 0; i < menuIds.length; i++) + { + if(MenuGenerator.isRoleMenuPresent(ctx, roleId, menuIds[i])) + continue; + MRoleMenu roleMenu = new MRoleMenu(ctx, 0, null); + + roleMenu.setAD_Role_ID(roleId); + roleMenu.setU_WebMenu_ID(menuIds[i]); + PoManager.save(roleMenu); + } + } +} diff --git a/posterita/posterita/src/main/org/posterita/factory/POSMenuFactory.java b/posterita/posterita/src/main/org/posterita/factory/POSMenuFactory.java new file mode 100644 index 0000000000..4836e9b9be --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/factory/POSMenuFactory.java @@ -0,0 +1,735 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + **/ + +/** + @author ashley + */ + +package org.posterita.factory; + +import java.lang.reflect.InvocationTargetException; +import java.util.ArrayList; +import java.util.Properties; + +import org.compiere.model.MProcess; +import org.compiere.model.PO; +import org.compiere.util.Env; +import org.posterita.Constants; +import org.posterita.businesslogic.MenuManager; +import org.posterita.businesslogic.performanceanalysis.POSReportManager; +import org.posterita.exceptions.OperationException; +import org.posterita.lib.UdiConstants; +import org.posterita.model.MWebMenu; +import org.posterita.order.UDIOrderTypes; + +public class POSMenuFactory extends AbstractFactory +{ + + public static final String MENU_POSITION_TOP = "TOP"; + public static final String MENU_POSITION_LEFT = "LEFT"; + public static final String MENU_POSITION_RIGHT = "RIGHT"; + public static final String MENU_POSITION_DOWN = "DOWN"; + + public static final String PMENU_SALES_ID = "pmenu.order.id"; + + public static final String PMENU_CREDITSALES_ID = "pmenu.creditsales.id"; + public static final String PMENU_PURCHASES_ID = "pmenu.purchases.id"; + public static final String PMENU_STOCK_ID = "pmenu.stock.id"; + + + public static final String SMENU_POSORDER_ID = "smenu.posorder.id"; + public static final String SMENU_POSORDERWA_ID="smenu.posorderwa.id"; + public static final String SMENU_POSPARTIALORDER_ID = "smenu.pospartialorder.id"; + public static final String SMENU_INVOKEPOSPARTIALORDER_ID = "smenu.invokepospartialorder.id"; + public static final String SMENU_POSGOODRECNOTE_ID = "smenu.posgoodrecnote.id"; + public static final String SMENU_POSGOODRETNOTE_ID= "smenu.posgoodretnote.id"; + public static final String SMENU_CUSTRETORDER_ID="smenu.custretorder.id"; + public static final String SMENU_POSPARTIALHISTORYORDER_ID="smenu.pospartialposhistory.id"; + public static final String SMENU_CUSTRETOREDRFROMPOS_ID="smenu.custretorderfrompos.id"; + public static final String SMENU_POSORDERQUICK="smenu.posorderquick.id"; + public static final String SMENU_POSORDERCUSTOMERCOMPULSORY="smenu.posordercustomercompulsory.id"; + public static final String SMENU_CREDITORDER_ID = "smenu.creditorder.id"; + public static final String SMENU_SETTLE_PAYMENT_ID = "smenu.settlepayment.id"; + public static final String SMENU_CUSTOMER_RETURN_HISTORY_ID="smenu.customer.return.history.id"; + + + public static final String PMENU_REPORTS_ID="pmenu.reports.id"; + public static final String SMENU_POSSTOCKMOV="smenu.posstockmov.id"; + public static final String SMENU_SALESANALREP="smenu.salesanalrep.id"; + public static final String SMENU_FASTMOVITEMS="smenu.fastmovitems.id"; + public static final String SMENU_SLOWMOVITEMS="smenu.slowmovitems.id"; + public static final String SMENU_CUSTSALESREPORT="smenu.custsalesreport.id"; + public static final String SMENU_CASHBOOKREPORT="smenu.cashbookreport.id"; + public static final String SMENU_PERIODICASHBOOKDETAILS="smenu.periodiccashbookdetails.id"; + public static final String SMENU_NOIMAGEREPORT="smenu.noimagereport.id"; + + public static final String PMENU_ADMINISTRATION_ID="pmenu.administration.id"; + public static final String SMENU_USER_ID="smenu.user.id"; + + public static final String SMENU_VIEWROLE_ID="smenu.viewrole.id"; + public static final String SMENU_CREATEVENDOR_ID="smenu.createvendor.id"; + + public static final String SMENU_CURRENTTILLAMOUNT_ID="smenu.currenttillamout.id"; + public static final String SMENU_CLOSECASHBOOK_ID="smenu.closecashbook.id"; + public static final String SMENU_POSINFO_ID="smenu.posinfo.id"; + public static final String SMENU_MYSTOCK_ID="smenu.mystock.id"; + + public static final String SMENU_ORDERHISTORY_ID="smenu.orderhistory.id"; + public static final String SMENU_DOCUMENTHISTORY_ID="smenu.documenthistory.id"; + + public static final String SMENU_PRODUCTS="smenu.products.id"; + public static final String SMENU_BARCODE_PRINTING = "smenu.barcode.printing"; + public static final String SMENU_VIEW_BPINFO="smenu.view.bp.info.id"; + public static final String SMENU_CUSTOMER="smenu.customer.id"; + public static final String SMENU_EDIT_BULK_PRODUCT="smenu.edit.bulk.product.id"; + public static final String SMENU_EDIT_BULK_PRICE="smenu.edit.bulk.price.id"; + public static final String SMENU_EDIT_ATTRIBUTE_VALUE="smenu.edit.attribute.value.id"; + public static final String SMENU_ADJUST_CASH_BOOK="smenu.adjust.cashbook.id"; + public static final String SMENU_SYNCHRONIZE_COLLECTIONS="smenu.synchronize.collections.id"; + public static final String PMENU_LOGOUT_ID="pmenu.logout.id"; + public static final String SMENU_CLOSE_POS_TILL="smenu.close.pos.till.id"; + public static final String SMENU_OPEN_CASH_DRAWER = "smenu.opencashdrawer.id"; + public static final String SMENU_UPDATE_PRODUCT_BY_CSV = "smenu.update.produc.csv.id"; + + public static final String SMENU_CHECK_SEQUENCE = "smenu.checkSequence.id"; + public static final String SMENU_PRINT_DUNNING_LETTERS_ID = "smenu.printDunningLetters.id"; + public static final String SMENU_VIEW_PAYMENT_ALLOCATION = "smenu.viewpaymentallocation.id"; + public static final String SMENU_VIEW_PAYMENT_TERM = "smenu.viewpaymentterm.id"; + public static final String SMENU_GENERATE_COMMISSION_ID = "smenu.generatecommission.id"; + public static final String SMENU_VIEW_GENERATED_COMMISSION_ID = "smenu.viewgeneratedcommission.id"; + public static final String SMENU_VIEW_TAX="smenu.tax.id"; + public static final String SMENU_CREDITMEMOFROMPOS_ID="smenu.creditmemo.from.creditorder.id"; + public static final String SMENU_CREATE_UNALLOCATED_PAYMENT_ID="smenu.create.unallocated.payment.id"; + public static final String SMENU_CREDIT_MEMO_HISTORY_ID="smenu.credit.memo.history.id"; + + public static final String MODULE_NAME = "POS"; + + private static final String SMENU_CASH_SALES_NEW_ID = "smenu.cash.sales.new.id"; + private static final String SMENU_CASH_SALES_HISTORY_ID = "smenu.cash.sales.history.id"; + private static final String SMENU_CREDIT_SALES_HISTORY_ID = "smenu.credit.sales.history.id"; + private static final String SMENU_GOODSRECNOTEHISTORY_HISTORY_ID = "smenu.goods.received.note.history.id"; + private static final String SMENU_GOODSRETNOTEHISTORY_HISTORY_ID = "smenu.goods.returned.note.history.id"; + + private static final String SMENU_ADJUST_STOCK_ID = "smenu.adjust.stock.id"; + private static final String SMENU_INVENTORY_HISTORY_ID = "smenu.inventory.history.id"; + private static final String SMENU_ADJUST_INVENTORY_ID = "smenu.adjust.inventory.id"; + private static final String SMENU_TRANSFER_STOCK = "smenu.transfer.stock"; + private static final String SMENU_VIEW_PREFERENCES = "smenu.viewpreferences.id"; + private static final String SMENU_VIEW_BPARTNERS = "smenu.bpartners.id"; + private static final String SMENU_PRICE_CHECK = "smenu.price.check"; + private static final String SMENU_ORGANISATION = "smenu.organisation"; + + private static final String SMENU_POS_SALES_REPORT_ID = "smenu.pos.sales.report.id"; + private static final String SMENU_POS_PURCHASE_REPORT = "smenu.pos.purchase.report"; + private static final String SMENU_INVENTORY_MOVE = "smenu.inventory.move"; + private static final String SMENU_MOVE_CONFIRMATION = "smenu.move.confirmation"; + public static final String SMENU_BEST_SELLING_ITEMS = "smenu.best.selling.items"; + + public static final String SMENU_STOCK_SALES_REPORT = "smenu.stock.sales.report"; + + public static final String PMENU_HELP_ID="pmenu.help.id"; + public static final String SMENU_USER_MANUAL="smenu.user.manual"; + public static final String SMENU_CONTACTUS="smenu.contactus"; + private static final String SMENU_PRICE_LIST = "smenu.price.list"; + + private static final String PMENU_NEW_REPORTS_ID = "pmenu.new.reports.id"; + private static final String SMENU_REPORTS = "smenu.reports."; + + private static final String SMENU_CURRENCY = "smenu.currency"; + private static final String SMENU_DELETE_PRICE_ON_PRICELIST = "smenu.delete.price.on.pricelist"; + + public static final String SMENU_CASHBOOK = "smenu.cashbook"; + public static final String SMENU_TERMINAL = "smenu.terminal"; + + public static final String SMENU_SETTLE_GRN_PAYMENT_ID = "smenu.settle.grn.payment"; + public static final String SMENU_DEBTORS_ID = "smenu.debtors.id"; + public static final String SMENU_CREDITORS_ID = "smenu.creditors.id"; + private static final String SMENU_CREATE_UNALLOCATED_AP_PAYMENT_ID = "smenu.create.unallocated.ap.payment.id"; + public static final String SMENU_VIEW_AP_PAYMENT_ALLOCATION = "smenu.view.ap.payment.allocation.id"; + + + private static POSMenuFactory singleton; + + protected void loadFactory(Properties ctx) throws OperationException + { + loadFactory(ctx, singleton); + } + + @Override + protected void loadFactory(Properties ctx, AbstractFactory factory) throws OperationException + { + loadCashSalesMenu(ctx, factory); + // new configuration functionality requires only one screen for all types of orders. :( + loadCreditSalesMenu(ctx, factory); + loadPurchasesMenu(ctx, factory); + loadPerformanceAnalysisMenu(ctx, factory); + loadStockMenu(ctx, factory); + loadAdministrationMenu(ctx, factory); + loadHelpMenu(ctx, factory); + loadReportsMenu(ctx, factory); + + } + + + public static POSMenuFactory getFactoryInstance(Properties ctx) throws OperationException + { + if (singleton == null) + singleton = new POSMenuFactory(); + + Properties nCtx = (Properties)ctx.clone(); + nCtx.setProperty(UdiConstants.CLIENT_ID_CTX_PARAM, "0"); + nCtx.setProperty(UdiConstants.ORG_ID_CTX_PARAM, "0"); + singleton.loadFactory(nCtx); + + return singleton; + } + + + private void loadCashSalesMenu(Properties ctx, AbstractFactory factory) throws OperationException + { + MWebMenu pmenu_sales = MenuManager.createParentMenu(ctx, "pmenu.cash.sales", MODULE_NAME, 1000); + pmenu_sales.setPosition(MENU_POSITION_TOP); + pmenu_sales.setImageLink("images/pos/buttons/button_order.gif"); + + factory.add(ctx, PMENU_SALES_ID, pmenu_sales); + pmenu_sales = (MWebMenu)factory.get(ctx, PMENU_SALES_ID); + + /*factory.add(ctx, SMENU_POSORDER_ID, + MenuManager.createSubMenu(ctx, "smenu.cash.sales.multiple.payments", + "CreatePOSOrder.do", + MODULE_NAME, pmenu_sales.get_ID(), 1010, "sales.order")); + */ + factory.add(ctx, SMENU_POSORDERWA_ID, + MenuManager.createSubMenu(ctx, "smenu.cash.sales", + "LoadOrderScreen.do?action=loadOrderScreen&"+Constants.IS_SOTRX+"=true&orderType=POS%20Order", + MODULE_NAME, pmenu_sales.get_ID(), 1010, "sales.order")); + + /*factory.add(ctx, SMENU_POSORDERQUICK, + MenuManager.createSubMenu(ctx, "smenu.quick.cash.sales", + "CreatePOSOrder3.do", + MODULE_NAME, pmenu_sales.get_ID(), 1030, "sales.order")); + + + factory.add(ctx, SMENU_POSORDERCUSTOMERCOMPULSORY, + MenuManager.createSubMenu(ctx, "smenu.cash.sales.customer.complusory", + "CreatePOSOrder2.do", + MODULE_NAME, pmenu_sales.get_ID(), 1040, "sales.order"));*/ + + factory.add(ctx, SMENU_CASH_SALES_HISTORY_ID, + MenuManager.createSubMenu(ctx, "smenu.cash.sales.history", + "ViewPOSHistoryAction.do?action=getPOSHistory&orderType="+UDIOrderTypes.POS_ORDER.getOrderType(), + MODULE_NAME, pmenu_sales.get_ID(), 1050, "sales.order")); + + /*factory.add(ctx, SMENU_CASH_SALES_NEW_ID, + MenuManager.createSubMenu(ctx, "smenu.cash.sales.new", + "CreatePOSOrderScreen.do", + factory.add(ctx, SMENU_POSPARTIALORDER_ID, + MenuManager.createSubMenu(ctx, "smenu.prepare.order", + "CreatePartialPOSOrder.do", + MODULE_NAME, pmenu_sales.get_ID(), 1060, "prepared.order")); + + factory.add(ctx, SMENU_INVOKEPOSPARTIALORDER_ID, + MenuManager.createSubMenu(ctx, "smenu.complete.prepared.order", + "InvokePartialPOSOrder.do", + MODULE_NAME, pmenu_sales.get_ID(), 1070, "prepared.order")); + + factory.add(ctx, SMENU_POSPARTIALHISTORYORDER_ID, + MenuManager.createSubMenu(ctx, "smenu.prepared.order.history", + "ViewPartialPOSOrderHistoryAction.do?action=initPartialPOSHistory", + MODULE_NAME, pmenu_sales.get_ID(), 1080, "prepared.order")); + ;*/ + + factory.add(ctx, SMENU_CUSTRETORDER_ID, + MenuManager.createSubMenu(ctx, "smenu.customer.returned.order", + "LoadOrderScreen.do?action=loadOrderScreen&"+Constants.IS_SOTRX+"=true&orderType=Customer%20Returned%20Order", + MODULE_NAME, pmenu_sales.get_ID(), 1090,"returned.order")); + + factory.add(ctx, SMENU_CUSTOMER_RETURN_HISTORY_ID, + MenuManager.createSubMenu(ctx, "smenu.customer.return.history.id", + "ViewPOSHistoryAction.do?action=getPOSHistory&orderType=Customer%20Returned%20Order", + MODULE_NAME, pmenu_sales.get_ID(), 1170, "returned.order")); + + factory.add(ctx, SMENU_CUSTRETOREDRFROMPOS_ID, + MenuManager.createSubMenu(ctx, "smenu.invoke.customer.returned.order", + "GetCustomerReturnFromPOS.do", + MODULE_NAME, pmenu_sales.get_ID(), 1100,"returned.order")); + + + factory.add(ctx, SMENU_CURRENTTILLAMOUNT_ID, + MenuManager.createSubMenu(ctx, "smenu.current.money.in.terminal", + "GetCurrentTillAmount.do?action=getCurrentTillAmount", + MODULE_NAME, pmenu_sales.get_ID(), 1110,"till.management")); + + factory.add(ctx, SMENU_ADJUST_CASH_BOOK, + MenuManager.createSubMenu(ctx, "smenu.adjust.cashbook", + "AdjustCashBook.do", + MODULE_NAME, pmenu_sales.get_ID(), 1120,"cash.book")); + + factory.add(ctx, SMENU_PERIODICASHBOOKDETAILS, + MenuManager.createSubMenu(ctx, "smenu.cashbook.report", + "CashSummaryDate.do", + MODULE_NAME, pmenu_sales.get_ID(), 1130,"cash.book")); + + factory.add(ctx, SMENU_CASHBOOKREPORT, + MenuManager.createSubMenu(ctx, "smenu.cashbook.history", + "CashReportAction.do?action=initGetCashDetailsHistory", + MODULE_NAME, pmenu_sales.get_ID(), 1140,"cash.book")); + + factory.add(ctx, SMENU_CLOSE_POS_TILL, + MenuManager.createSubMenu(ctx, "smenu.close.till", + "InitClosePOSTillAction.do?action=initCloseTill", + MODULE_NAME, pmenu_sales.get_ID(), 1150,"till.management")); + + factory.add(ctx, SMENU_OPEN_CASH_DRAWER, + MenuManager.createSubMenu(ctx, "smenu.open.cashdrawer", + "javascript:openCashDrawer();", + MODULE_NAME, pmenu_sales.get_ID(), 1160,"till.management")); + + + } + + private void loadCreditSalesMenu(Properties ctx, AbstractFactory factory) throws OperationException + { + MWebMenu pmenu_creditsales = MenuManager.createParentMenu(ctx, "pmenu.credit.sales", MODULE_NAME, 2000); + pmenu_creditsales.setPosition(MENU_POSITION_TOP); + pmenu_creditsales.setImageLink("images/pos/buttons/button_order.gif"); + + factory.add(ctx, PMENU_CREDITSALES_ID, pmenu_creditsales); + pmenu_creditsales = (MWebMenu)factory.get(ctx, PMENU_CREDITSALES_ID); + + /*factory.add(ctx, SMENU_CREDITORDER_ID, + MenuManager.createSubMenu(ctx, "smenu.credit.sales", + "CreditSales.do", + MODULE_NAME, pmenu_creditsales.get_ID(), 2010));*/ + + factory.add(ctx, SMENU_CREDITMEMOFROMPOS_ID, + MenuManager.createSubMenu(ctx, "smenu.creditmemo.from.creditorder.id", + "InvokeCreditOrder.do", + MODULE_NAME, pmenu_creditsales.get_ID(), 2010)); + + factory.add(ctx, SMENU_CREDIT_MEMO_HISTORY_ID, + MenuManager.createSubMenu(ctx, "smenu.credit.memo.history.id", + "ViewPOSHistoryAction.do?action=getPOSHistory&orderType="+UDIOrderTypes.CREDIT_MEMO.getOrderType(), + MODULE_NAME, pmenu_creditsales.get_ID(), 2020)); + + factory.add(ctx, SMENU_SETTLE_PAYMENT_ID, + MenuManager.createSubMenu(ctx, "smenu.settle.payment.credit.sales", + "InitGetBpartnerPaymentStatus.do?action=initGetBpartnerPaymentStatus", + MODULE_NAME, pmenu_creditsales.get_ID(), 2030)); + + factory.add(ctx, SMENU_PRINT_DUNNING_LETTERS_ID, + MenuManager.createSubMenu(ctx, "smenu.dunning.letters", + "InitPrintDunningAction.do?action=initPrintDunning", + MODULE_NAME, pmenu_creditsales.get_ID(), 2040)); + + + factory.add(ctx, SMENU_VIEW_PAYMENT_ALLOCATION, + MenuManager.createSubMenu(ctx, "smenu.payment.allocation.history", + "ViewPaymentAllocation.do", + MODULE_NAME, pmenu_creditsales.get_ID(), 2050)); + + factory.add(ctx, SMENU_CREDIT_SALES_HISTORY_ID, + MenuManager.createSubMenu(ctx, "smenu.credit.sales.history", + "ViewPOSHistoryAction.do?action=getPOSHistory&orderType=" + UDIOrderTypes.CREDIT_ORDER.getOrderType(), + MODULE_NAME, pmenu_creditsales.get_ID(), 2060)); + + factory.add(ctx, SMENU_CREATE_UNALLOCATED_PAYMENT_ID, + MenuManager.createSubMenu(ctx, "smenu.create.unallocated.payment.id", + "CreateUnallocatedPayment.do", + MODULE_NAME, pmenu_creditsales.get_ID(), 2070)); + + factory.add(ctx, SMENU_DEBTORS_ID, + MenuManager.createSubMenu(ctx, "smenu.debtors.id", + "CreditorDebtorAction.do?action=getDebtors", + MODULE_NAME, pmenu_creditsales.get_ID(), 2080)); + } + + + private void loadPurchasesMenu(Properties ctx, AbstractFactory factory) throws OperationException + { + MWebMenu pmenu_purchases = MenuManager.createParentMenu(ctx, "pmenu.purchases", MODULE_NAME, 3000); + pmenu_purchases.setPosition(MENU_POSITION_TOP); + pmenu_purchases.setImageLink("images/pos/buttons/button_order.gif"); + + factory.add(ctx, PMENU_PURCHASES_ID, pmenu_purchases); + pmenu_purchases = (MWebMenu)factory.get(ctx, PMENU_PURCHASES_ID); + + factory.add(ctx, SMENU_POSGOODRECNOTE_ID, + MenuManager.createSubMenu(ctx, "smenu.goods.received.note", + "LoadOrderScreen.do?action=loadOrderScreen&"+Constants.IS_SOTRX+"=false&orderType=POS%20Goods%20Receive%20Note", + MODULE_NAME, pmenu_purchases.get_ID(), 3010)); + + factory.add(ctx, SMENU_POSGOODRETNOTE_ID, + MenuManager.createSubMenu(ctx, "smenu.goods.returned.note", + "LoadOrderScreen.do?action=loadOrderScreen&"+Constants.IS_SOTRX+"=false&orderType=POS%20Goods%20Returned%20Note", + MODULE_NAME, pmenu_purchases.get_ID(), 3020)); + + factory.add(ctx, SMENU_GOODSRECNOTEHISTORY_HISTORY_ID, + MenuManager.createSubMenu(ctx, "smenu.goods.received.note.history", + "ViewPOSHistoryAction.do?action=getPOSHistory&orderType=POS%20Goods%20Receive%20Note", + MODULE_NAME, pmenu_purchases.get_ID(), 3030)); + + factory.add(ctx, SMENU_GOODSRETNOTEHISTORY_HISTORY_ID, + MenuManager.createSubMenu(ctx, "smenu.goods.returned.note.history", + "ViewPOSHistoryAction.do?action=getPOSHistory&orderType=POS%20Goods%20Returned%20Note", + MODULE_NAME, pmenu_purchases.get_ID(), 3040)); + + factory.add(ctx, SMENU_SETTLE_GRN_PAYMENT_ID, + MenuManager.createSubMenu(ctx, "smenu.settle.payment.credit.purchase", + "InitGetBpartnerPaymentStatus.do?action=initGetCreditorPaymentStatus", + MODULE_NAME, pmenu_purchases.get_ID(), 3050)); + + factory.add(ctx, SMENU_CREDITORS_ID, + MenuManager.createSubMenu(ctx, "smenu.creditors.id", + "CreditorDebtorAction.do?action=getCreditors", + MODULE_NAME, pmenu_purchases.get_ID(), 3060)); + + factory.add(ctx, SMENU_CREATE_UNALLOCATED_AP_PAYMENT_ID, + MenuManager.createSubMenu(ctx, "smenu.create.unallocated.ap.payment.id", + "CreateUnallocatedAPPayment.do", + MODULE_NAME, pmenu_purchases.get_ID(), 3070)); + + factory.add(ctx, SMENU_VIEW_AP_PAYMENT_ALLOCATION, + MenuManager.createSubMenu(ctx, "smenu.ap.payment.allocation.history", + "ViewAPPaymentAllocation.do", + MODULE_NAME, pmenu_purchases.get_ID(), 3080)); + + + } + + + + private void loadPerformanceAnalysisMenu(Properties ctx, AbstractFactory factory) throws OperationException + { + MWebMenu pmenu_reports = MenuManager.createParentMenu(ctx, "pmenu.performance.analysis", MODULE_NAME, 4000); + pmenu_reports.setPosition(MENU_POSITION_TOP); + pmenu_reports.setImageLink("images/pos/buttons/button_reports.gif"); + + factory.add(ctx, PMENU_REPORTS_ID, pmenu_reports); + pmenu_reports = (MWebMenu)factory.get(ctx, PMENU_REPORTS_ID); + + factory.add(ctx, SMENU_CUSTSALESREPORT, + MenuManager.createSubMenu(ctx, "smenu.performance.analysis.report", + "CustomPOSReportAction.do?action=initCustomReport", + MODULE_NAME, pmenu_reports.get_ID(), 4010)); + + + factory.add(ctx, SMENU_POSINFO_ID, + MenuManager.createSubMenu(ctx, "smenu.sales.report.per.terminal", + "POSInfoReport.do", + MODULE_NAME, pmenu_reports.get_ID(), 4020)); + + factory.add(ctx, SMENU_ORDERHISTORY_ID, + MenuManager.createSubMenu(ctx, "smenu.order.history", + "InitPOSHistoryAction.do?action=initPOSHistory", + MODULE_NAME, pmenu_reports.get_ID(), 4030)); + + + factory.add(ctx, SMENU_DOCUMENTHISTORY_ID, + MenuManager.createSubMenu(ctx, "smenu.document.history", + "DocumentHistoryAction.do?action=initHistory", + MODULE_NAME, pmenu_reports.get_ID(), 4040)); + + factory.add(ctx, SMENU_VIEW_BPINFO, + MenuManager.createSubMenu(ctx, "smenu.bpartner.sales.details", + "ViewBPartnerInfoAction.do?action=getBpartnerInfo", + MODULE_NAME, pmenu_reports.get_ID(), 4050)); + + factory.add(ctx, SMENU_POS_SALES_REPORT_ID, + MenuManager.createSubMenu(ctx, "smenu.sales.report", + "SalesReport.do?action=getSalesReport&isSalesReport=true", + MODULE_NAME, pmenu_reports.get_ID(), 4060)); + + factory.add(ctx, SMENU_BEST_SELLING_ITEMS, + MenuManager.createSubMenu(ctx, SMENU_BEST_SELLING_ITEMS, + "POSReportAction.do?action=initBestSellingReport", + MODULE_NAME, pmenu_reports.get_ID(), 4070)); + + factory.add(ctx, SMENU_STOCK_SALES_REPORT, + MenuManager.createSubMenu(ctx, SMENU_STOCK_SALES_REPORT, + "ViewStockSales.do", + MODULE_NAME, pmenu_reports.get_ID(), 4080)); + + factory.add(ctx, SMENU_POS_PURCHASE_REPORT, + MenuManager.createSubMenu(ctx, SMENU_POS_PURCHASE_REPORT, + "SalesReport.do?action=getSalesReport&isSalesReport=false", + MODULE_NAME, pmenu_reports.get_ID(), 4090)); + + } + + + + private void loadStockMenu(Properties ctx, AbstractFactory factory) throws OperationException + { + MWebMenu pmenu_stock = MenuManager.createParentMenu(ctx, "pmenu.stock", MODULE_NAME, 5000); + pmenu_stock.setPosition(MENU_POSITION_TOP); + pmenu_stock.setImageLink("images/pos/buttons/button_order.gif"); + + factory.add(ctx, PMENU_STOCK_ID, pmenu_stock); + pmenu_stock = (MWebMenu)factory.get(ctx, PMENU_STOCK_ID); + + factory.add(ctx, SMENU_POSSTOCKMOV, + MenuManager.createSubMenu(ctx, "smenu.stock.movement", + "StockMovementReport.do", + MODULE_NAME, pmenu_stock.get_ID(), 5010)); + + + factory.add(ctx, SMENU_MYSTOCK_ID, + MenuManager.createSubMenu(ctx, "smenu.stock", + "GetPOSStockAction.do?action=initPOSStock", + MODULE_NAME, pmenu_stock.get_ID(), 5020)); + + + factory.add(ctx, SMENU_FASTMOVITEMS, + MenuManager.createSubMenu(ctx, "smenu.fast.moving.items", + "CustomFastMovingItemsReport.do", + MODULE_NAME, pmenu_stock.get_ID(), 5030)); + + factory.add(ctx, SMENU_SLOWMOVITEMS, + MenuManager.createSubMenu(ctx, "smenu.slow.moving.items", + "CustomSlowMovingItemsReport.do", + MODULE_NAME, pmenu_stock.get_ID(), 5040)); + + factory.add(ctx, SMENU_ADJUST_STOCK_ID, + MenuManager.createSubMenu(ctx, "smenu.adjust.stock.id", + "InventoryCartAction.do?action=newInventoryCart", + MODULE_NAME, pmenu_stock.get_ID(), 5040)); + + factory.add(ctx, SMENU_INVENTORY_HISTORY_ID, + MenuManager.createSubMenu(ctx, "smenu.inventory.history.id", + "ViewInventoryHistoryAction.do?action=viewInventoryHistory", + MODULE_NAME, pmenu_stock.get_ID(), 5050)); + + factory.add(ctx, SMENU_TRANSFER_STOCK, + MenuManager.createSubMenu(ctx, "smenu.transfer.stock", + "ViewStock.do?action=viewStock", + MODULE_NAME, pmenu_stock.get_ID(), 5060)); + + factory.add(ctx, SMENU_INVENTORY_MOVE, + MenuManager.createSubMenu(ctx, "smenu.inventory.move", + "StockMovementAction.do?action=viewMMovementHistory", + MODULE_NAME, pmenu_stock.get_ID(), 5070)); + + factory.add(ctx, SMENU_MOVE_CONFIRMATION, + MenuManager.createSubMenu(ctx, "smenu.move.confirmation", + "StockMovementAction.do?action=viewMoveConfirm", + MODULE_NAME, pmenu_stock.get_ID(), 5080)); + + } + + + private void loadAdministrationMenu(Properties ctx, AbstractFactory factory) throws OperationException + { + MWebMenu pmenu_administration = MenuManager.createParentMenu(ctx, "pmenu.administration", MODULE_NAME, 6000); + pmenu_administration.setPosition(MENU_POSITION_TOP); + pmenu_administration.setImageLink("images/pos/buttons/button_administration.gif"); + + factory.add(ctx, PMENU_ADMINISTRATION_ID, pmenu_administration); + pmenu_administration = (MWebMenu)factory.get(ctx, PMENU_ADMINISTRATION_ID); + + factory.add(ctx, SMENU_CUSTOMER, + MenuManager.createSubMenu(ctx, "smenu.customers", + //"ViewAllCustomers.do", + "POSCustomerAction.do?action=initSearchPOSCustomer", + MODULE_NAME, pmenu_administration.get_ID(), 6010)); + + factory.add(ctx, SMENU_CREATEVENDOR_ID, + MenuManager.createSubMenu(ctx, "smenu.vendors", + "SearchVendor.do?action=initSearchVendors", + MODULE_NAME, pmenu_administration.get_ID(), 6020)); + + + factory.add(ctx, SMENU_USER_ID, + MenuManager.createSubMenu(ctx, "smenu.users", + "ListPOSUsers.do", + MODULE_NAME, pmenu_administration.get_ID(), 6030)); + + + factory.add(ctx, SMENU_VIEWROLE_ID, + MenuManager.createSubMenu(ctx, "smenu.role", + "ListPOSRoles.do", + MODULE_NAME, pmenu_administration.get_ID(), 6040)); + + + factory.add(ctx, SMENU_PRODUCTS, + MenuManager.createSubMenu(ctx, "smenu.products", + "ViewAllPOSProduct.do", + MODULE_NAME, pmenu_administration.get_ID(), 6050)); + + factory.add(ctx, SMENU_BARCODE_PRINTING, + MenuManager.createSubMenu(ctx, SMENU_BARCODE_PRINTING, + "initProductBarcodeCart.do", + MODULE_NAME, pmenu_administration.get_ID(), 6060)); + + factory.add(ctx, SMENU_EDIT_ATTRIBUTE_VALUE, + MenuManager.createSubMenu(ctx, "smenu.edit.product.attribute.value", + "InitViewAttributesAction.do?action=initViewAttributeValues", + MODULE_NAME, pmenu_administration.get_ID(), 6070)); + + + factory.add(ctx, SMENU_CHECK_SEQUENCE, + MenuManager.createSubMenu(ctx, "smenu.check.repair.database.integrity", + "CheckSequenceAction.do?action=checkSequence", + MODULE_NAME, pmenu_administration.get_ID(), 6080)); + + + factory.add(ctx, SMENU_GENERATE_COMMISSION_ID, + MenuManager.createSubMenu(ctx, "smenu.generate.commission", + "GenerateCommission.do", + MODULE_NAME, pmenu_administration.get_ID(), 6090)); + + factory.add(ctx, SMENU_VIEW_GENERATED_COMMISSION_ID, + MenuManager.createSubMenu(ctx, "smenu.view.last.generated.commission", + "ViewCommissionAction.do?action=viewCommission", + MODULE_NAME, pmenu_administration.get_ID(), 6100)); + + factory.add(ctx, SMENU_VIEW_PAYMENT_TERM, + MenuManager.createSubMenu(ctx, "smenu.payment.term", + "ViewAllPaymentTermAction.do?action=viewAllPaymentTerms", + MODULE_NAME, pmenu_administration.get_ID(), 6110)); + + factory.add(ctx, SMENU_VIEW_TAX, + MenuManager.createSubMenu(ctx, "smenu.tax", + "TaxAction.do?action=viewAllTax", + MODULE_NAME, pmenu_administration.get_ID(), 6120)); + + factory.add(ctx, SMENU_VIEW_PREFERENCES, + MenuManager.createSubMenu(ctx, "smenu.preferences", + "ViewPreferences.do", + MODULE_NAME, pmenu_administration.get_ID(), 6130)); + + factory.add(ctx, SMENU_VIEW_BPARTNERS, + MenuManager.createSubMenu(ctx, "smenu.bpartners", + "BusinessPartners.do", + MODULE_NAME, pmenu_administration.get_ID(), 6140)); + + factory.add(ctx, SMENU_PRICE_CHECK, + MenuManager.createSubMenu(ctx, "smenu.price.check", + "PriceCheck.do", + MODULE_NAME, pmenu_administration.get_ID(), 6150)); + + factory.add(ctx, SMENU_ORGANISATION, + MenuManager.createSubMenu(ctx, "smenu.organisation", + "ListOrgs.do", + MODULE_NAME, pmenu_administration.get_ID(), 6160)); + + factory.add(ctx, SMENU_PRICE_LIST, + MenuManager.createSubMenu(ctx, SMENU_PRICE_LIST, + "ListPriceLists.do", + MODULE_NAME, pmenu_administration.get_ID(), 6170)); + + factory.add(ctx, SMENU_CURRENCY, + MenuManager.createSubMenu(ctx, SMENU_CURRENCY, + "ListCurrencies.do", + MODULE_NAME, pmenu_administration.get_ID(), 6180)); + + factory.add(ctx, SMENU_DELETE_PRICE_ON_PRICELIST, + MenuManager.createSubMenu(ctx, SMENU_DELETE_PRICE_ON_PRICELIST, + "PriceListAction.do?action=fromDeletePriceOnPriceList", + MODULE_NAME, pmenu_administration.get_ID(), 6190)); + + factory.add(ctx, SMENU_CASHBOOK, + MenuManager.createSubMenu(ctx, SMENU_CASHBOOK, + "SearchCashBookAction.do?action=initSearchCashBook", + MODULE_NAME, pmenu_administration.get_ID(), 6200)); + + factory.add(ctx, SMENU_TERMINAL, + MenuManager.createSubMenu(ctx, SMENU_TERMINAL, + "SearchTerminalAction.do?action=initSearchTerminal", + MODULE_NAME, pmenu_administration.get_ID(), 6210)); + } + + //---------------------------------------------------------------------// + private void loadHelpMenu(Properties ctx, AbstractFactory factory) throws OperationException + { + MWebMenu pmenu_help = MenuManager.createParentMenu(ctx, "pmenu.help", MODULE_NAME, 7000); + pmenu_help.setPosition(MENU_POSITION_TOP); + pmenu_help.setImageLink("images/pos/buttons/button_order.gif"); + + factory.add(ctx, PMENU_HELP_ID, pmenu_help); + pmenu_help = (MWebMenu)factory.get(ctx, PMENU_HELP_ID); + + factory.add(ctx, SMENU_USER_MANUAL, + MenuManager.createSubMenu(ctx, SMENU_USER_MANUAL, + "javascript:void window.open(\"http://www.posterita.org/mediawiki/index.php/User%60s_Manual\")", + MODULE_NAME, pmenu_help.get_ID(), 7010)); + + + factory.add(ctx, SMENU_CONTACTUS, + MenuManager.createSubMenu(ctx, SMENU_CONTACTUS, + "POSHelpAction.do?action=initContactUs", + MODULE_NAME, pmenu_help.get_ID(), 7020)); + } + + /** + * Reports are loaded based on the process access defined for a particular role. + * @param ctx context + * @param factory abstract factory + * @throws OperationException + */ + private void loadReportsMenu(Properties ctx, AbstractFactory factory) throws OperationException + { + MWebMenu pmenu_reports= MenuManager.createParentMenu(ctx, "pmenu.new.reports", MODULE_NAME, 8000); + pmenu_reports.setPosition(MENU_POSITION_TOP); + pmenu_reports.setImageLink("images/pos/buttons/button_order.gif"); + + factory.add(ctx,PMENU_NEW_REPORTS_ID, pmenu_reports); + pmenu_reports = (MWebMenu)factory.get(ctx, PMENU_NEW_REPORTS_ID); + + ArrayList processIds = POSReportManager.loadReports(ctx); + int sequence = 8010; + for (Integer id: processIds) + { + MProcess process = MProcess.get(ctx, id); + String menuName = process.getName(); + + factory.add(ctx, menuName, MenuManager.createSubMenu(ctx, menuName, + "GenerateReportAction.do?action=generateReportInput&processId=" + id, + MODULE_NAME, pmenu_reports.get_ID(), sequence)); + sequence += 10; + } +} + + public PO get(Properties ctx, String key) throws OperationException + { + Properties nCtx = (Properties)ctx.clone(); + Env.setContext(nCtx, UdiConstants.CLIENT_ID_CTX_PARAM, "0"); + Env.setContext(nCtx, UdiConstants.ORG_ID_CTX_PARAM, "0"); + return super.get(nCtx, key); + } + + protected void setFields(Properties ctx, PO fromPO, PO toPO) throws SecurityException, NoSuchMethodException, IllegalArgumentException, IllegalAccessException, InvocationTargetException + { + MWebMenu fromUMenu = (MWebMenu)fromPO; + MWebMenu toUMenu = (MWebMenu)toPO; + + toUMenu.setMenuLink(fromUMenu.getMenuLink()); + toUMenu.setName(fromUMenu.getName()); + toUMenu.setHasSubMenu(fromUMenu.isHasSubMenu()); + toUMenu.setModule(fromUMenu.getModule()); + toUMenu.setParentMenu_ID(fromUMenu.getParentMenu_ID()); + toUMenu.setImageLink(fromUMenu.getImageLink()); + toUMenu.setIsActive(fromUMenu.isActive()); + toUMenu.setPosition(fromUMenu.getPosition()); + toUMenu.setCategory(fromUMenu.getCategory()); + toUMenu.setSequence(fromUMenu.getSequence()); + } +} diff --git a/posterita/posterita/src/main/org/posterita/factory/ProcessFactory.java b/posterita/posterita/src/main/org/posterita/factory/ProcessFactory.java new file mode 100644 index 0000000000..6f995b8c7a --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/factory/ProcessFactory.java @@ -0,0 +1,93 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Jul 6, 2005 by vishee + */ + +package org.posterita.factory; + +import java.util.Properties; + +import org.compiere.model.MProcess; +import org.compiere.process.SvrProcess; +import org.posterita.exceptions.OperationException; + + + +public class ProcessFactory extends AbstractFactory +{ + + + private static ProcessFactory singleton; + + + private ProcessFactory() throws OperationException + { + super(); + + } + + public static ProcessFactory getFactoryInstance(Properties ctx) throws Exception + { + if (singleton ==null) + singleton = new ProcessFactory(); + + return singleton; + } + + + protected void loadFactory(Properties ctx) throws OperationException + { + loadFactory(ctx, singleton); + } + + + + /* + * key - the value retrieved from properties file for the name of the process + * className - the class from which the process will run (eg com.mu.process.MyProcess where MyProcess is the java file) + */ + private MProcess createProcess(Properties ctx, String className) throws OperationException + { + + MProcess mProcess = new MProcess(ctx,0, null); + mProcess.setClassname(className); + mProcess.setDescription(className); + mProcess.setName(className); + mProcess.setValue(className); + + + return mProcess; + + } + + public SvrProcess getSvrProcess(Properties ctx,String key) throws Exception + { + MProcess p = (MProcess) singleton.get(ctx, key); + Object arr[] = {}; + SvrProcess process = (SvrProcess) Class.forName(p.getClass().getName()).getConstructors()[0].newInstance(arr); // use better reflection + return process; + } + + @Override + protected void loadFactory(Properties ctx, AbstractFactory factory) throws OperationException + { + // TODO Auto-generated method stub + + } +} diff --git a/posterita/posterita/src/main/org/posterita/factory/SystemObjectsFactory.java b/posterita/posterita/src/main/org/posterita/factory/SystemObjectsFactory.java new file mode 100644 index 0000000000..26af960e4a --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/factory/SystemObjectsFactory.java @@ -0,0 +1,81 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ +package org.posterita.factory; + +import java.util.Properties; + +import org.compiere.model.MTax; +import org.compiere.model.MTaxCategory; +import org.posterita.core.SystemObjects; +import org.posterita.exceptions.OperationException; +import org.posterita.exceptions.ReloadFactoryException; +import org.posterita.lib.UdiConstants; + + +public class SystemObjectsFactory extends AbstractFactory +{ + public static final String DEFAULT_TAX_ID = "tax.default.id"; + public static final String TAX_CATEGORY_DEFAULT_ID = "taxCategory.default.id"; + private static SystemObjectsFactory systemObjectsFactory; + + private SystemObjectsFactory() throws OperationException + { + + } + + public static SystemObjectsFactory getFactoryInstance() throws OperationException + { + if (systemObjectsFactory == null) + systemObjectsFactory = new SystemObjectsFactory(); + + return systemObjectsFactory; + } + + + protected void loadFactory(Properties ctx) throws OperationException + { + loadFactory(ctx, systemObjectsFactory); + } + + protected void loadFactory(Properties ctx, AbstractFactory factory) throws OperationException + { + factory.add(ctx, TAX_CATEGORY_DEFAULT_ID, SystemObjects.getTaxCategory(ctx, "Default Tax Category")); + MTaxCategory taxCategory = (MTaxCategory) factory.get(ctx, TAX_CATEGORY_DEFAULT_ID); + + MTax tax = SystemObjects.getTax(ctx, "Udi tax", UdiConstants.COUNTRY_MAURITIUS, "default udi tax"); + tax.setC_TaxCategory_ID(taxCategory.get_ID()); + factory.add(ctx, DEFAULT_TAX_ID, tax); + } + + public static void reloadFactory(Properties ctx) throws ReloadFactoryException + { + try + { + SystemObjectsFactory nFactory = new SystemObjectsFactory(); + nFactory.initFactory(ctx, nFactory); + systemObjectsFactory = nFactory; + } + catch(OperationException ex) + { + throw new ReloadFactoryException("Could not reload SystemObjectsFactory", ex); + } + } + +} diff --git a/posterita/posterita/src/main/org/posterita/factory/UserFactory.java b/posterita/posterita/src/main/org/posterita/factory/UserFactory.java new file mode 100644 index 0000000000..dea71b99b6 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/factory/UserFactory.java @@ -0,0 +1,88 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +package org.posterita.factory; + +import java.util.Properties; + +import org.compiere.model.MBPartner; +import org.compiere.model.MOrg; +import org.compiere.model.MUser; +import org.compiere.model.PO; +import org.compiere.util.Env; +import org.posterita.core.SystemObjects; +import org.posterita.exceptions.OperationException; + + +public class UserFactory extends AbstractFactory +{ + private static UserFactory singleton; + + public static final String SUPER_USER_ID = "superUser.id"; + public static String UDI_ADMIN_ID = "udiAdmin.id"; + public static String HSAFAUTO_ADMIN_ID = "hsafAuto.admin.id"; + public static String HSAFWING_ADMIN_ID = "hsafWing.Admin.id"; + + private UserFactory() throws OperationException + { + + } + + public static UserFactory getFactoryInstance() throws OperationException + { + if (singleton == null) + singleton = new UserFactory(); + + return singleton; + } + + protected void loadFactory(Properties ctx) throws OperationException + { + loadFactory(ctx, singleton); + } + + protected void loadFactory(Properties ctx, AbstractFactory factory) throws OperationException + { + factory.add(ctx, SUPER_USER_ID, createUser(ctx, SystemObjects.getSuperUser(ctx))); + // singleton.add(UDI_ADMIN_ID, createUser(ctx, SystemObjects.getUdiAdmin(ctx))); + // singleton.add(HSAFAUTO_ADMIN_ID, createUser(ctx, SystemObjects.getHsafAuto(ctx))); + // singleton.add(HSAFWING_ADMIN_ID, createUser(ctx, SystemObjects.getHsafWing(ctx))); + + } + + private PO createUser(Properties ctx, MUser mUser) throws OperationException + { + MUser user = new MUser(ctx, 0, null); + user.setName(mUser.getName()); + user.setPassword(mUser.getPassword()); + user.setEMail(mUser.getEMail()); + + int ad_org_id = Env.getAD_Org_ID(ctx); + MOrg org = new MOrg(ctx, ad_org_id, null); + + // Is it necessary, taking business partner of the organisation. + // Should create a bpartner for this user. + // DefaultUser, Should maybe call a manager here. + MBPartner bpartner = new MBPartner(ctx, org.getLinkedC_BPartner_ID(null), null); + + user.setC_BPartner_ID(bpartner.get_ID()); + + return user; + } +} diff --git a/posterita/posterita/src/main/org/posterita/factory/WebComponentFactory.java b/posterita/posterita/src/main/org/posterita/factory/WebComponentFactory.java new file mode 100644 index 0000000000..11b787595f --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/factory/WebComponentFactory.java @@ -0,0 +1,290 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + */ +package org.posterita.factory; + +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.Properties; + +import org.apache.ecs.Element; +import org.apache.ecs.xhtml.input; +import org.apache.ecs.xhtml.label; +import org.apache.ecs.xhtml.option; +import org.apache.ecs.xhtml.script; +import org.apache.ecs.xhtml.select; +import org.apache.ecs.xhtml.td; +import org.apache.ecs.xhtml.tr; +import org.compiere.model.Lookup; +import org.compiere.model.MProcessPara; +import org.compiere.model.MRefList; +import org.compiere.model.MRefTable; +import org.compiere.model.PO; +import org.compiere.util.DB; +import org.compiere.util.DisplayType; +import org.compiere.util.Env; +import org.compiere.util.KeyNamePair; +import org.compiere.util.ValueNamePair; +import org.posterita.businesslogic.administration.RoleManager; + +/** + * Factory to load a web component which corresponds to the display + * type of a process parameter and populates it with the appropriate + * values as per the constraints of the parameter. + * + * @author sendy + * + */ +public class WebComponentFactory +{ + + public static org.apache.ecs.Element getWebComponent(Properties ctx, MProcessPara parameter) throws Exception + { + Element element = null; + label name = new label().addElement(parameter.getName()); + td label = new td().addElement(name); + td editor = new td().setAlign("left"); + + + input textFrom = new input(input.TYPE_TEXT, parameter.getColumnName()+ "From", ""); + input textTo = new input(input.TYPE_TEXT, parameter.getColumnName() + "To", ""); + input text = new input(input.TYPE_TEXT, parameter.getColumnName(), ""); + + int displayType = parameter.getAD_Reference_ID(); + + if (DisplayType.isLookup(displayType) || DisplayType.isID(displayType)) + { + option[] options = getOptions(ctx, parameter); + select select = new select(parameter.getColumnName(), options); + editor = editor.addElement(select); + } + else if (displayType == DisplayType.YesNo) + { + input inputCheck = new input(input.TYPE_CHECKBOX, parameter.getColumnName(), "Y"); + editor = editor.addElement(inputCheck); + } + else if (DisplayType.isNumeric(displayType) + || displayType == DisplayType.String) // SENDYFIXME need to add calculator for numeric + { + if (parameter.isRange()) + { + editor = editor.addElement(textFrom).addElement("-").addElement(textTo); + } + else + { + editor = editor.addElement(text); + } + } + else if (DisplayType.isDate(displayType)) + { + if (parameter.isRange()) + { + String idFrom = textFrom.getAttribute("name"); + textFrom.setID(idFrom); + script scriptFrom = getScript(idFrom); + input calendarFromBtn = getCalendarBtn(idFrom); + editor = editor.addElement(textFrom).addElement(calendarFromBtn).addElement(scriptFrom).addElement("-"); + + String idTo = textTo.getAttribute("name"); + textTo.setID(idTo); + script scriptTo = getScript(idTo); + input calendarToBtn = getCalendarBtn(idTo); + + editor = editor.addElement(textTo).addElement(calendarToBtn).addElement(scriptTo); + } + else + { + String id = text.getAttribute("name"); + text.setID(id); + script script = getScript(id); + input calendarBtn = getCalendarBtn(id); + + editor = editor.addElement(text).addElement(calendarBtn).addElement(script); + } + } + else // FIXME need to cater for other display types such as locator, location, etc + { + editor = editor.addElement(text); + } + + td tdContent = label.addElement(editor); + element = new tr().addElement(tdContent); + return element; + } + + private static option[] getOptions(Properties ctx, MProcessPara parameter) + throws Exception + { + int displayType = parameter.getAD_Reference_ID(); + String columnName = parameter.getColumnName(); + String tableName = null; + String whereClause = null; + String orderBy = null; + option[] options = null; + + Lookup lookup = parameter.getLookup(); + if (displayType == DisplayType.Table || displayType == DisplayType.Search) + { + int refValueId = parameter.getAD_Reference_Value_ID(); + + if (refValueId != 0) + { + MRefTable refTable = getRefTable(ctx, parameter.getAD_Reference_Value_ID(), null); + tableName = refTable.getAD_Table().getTableName(); + whereClause = refTable.getWhereClause(); + String validation = lookup.getValidation(); + + if (validation != null && !validation.equals("")) + { + whereClause += " AND " + validation; + } + orderBy = refTable.getOrderByClause(); + } + else + { + tableName = columnName.substring(0, columnName.length() - 3); + } + } + else if (displayType == DisplayType.TableDir + || displayType == DisplayType.Locator + || displayType == DisplayType.Location) + { + tableName = columnName.substring(0, columnName.length() - 3); + } + + if (displayType != DisplayType.List) // get key name pair from table + { + ArrayList keyNamePair = getKeyNamePair(ctx, parameter, + tableName, whereClause, orderBy, null); + options = new option[keyNamePair.size() + 1]; + int count = 1; + options[0] = new option(null); + + for (KeyNamePair pair : keyNamePair) + { + options[count] = new option(pair.getName(), pair.getKey()); + options[count].addElement(pair.getName()); + count++; + } + } + else // get value name list + { + ValueNamePair[] refListVNP = MRefList.getList(ctx, parameter + .getAD_Reference_Value_ID(), false); + options = new option[refListVNP.length + 1]; + int count = 1; + options[0] = new option(null); + + for (ValueNamePair pair : refListVNP) + { + options[count] = new option(pair.getName(), pair.getValue()); + options[count].addElement(pair.getName()); + count++; + } + } + + return options; + } + + private static input getCalendarBtn(String id) + { + input calendarBtn = new input(input.TYPE_BUTTON, "", ""); + calendarBtn.setID(id + "Btn"); + calendarBtn.setClass("calendar-icon float-left"); + + return calendarBtn; + } + + private static script getScript(String id) + { + script s = new script("function setDate(calendar){};" + + "Calendar.setup({ inputField : '" + id + + "', ifFormat : '%Y-%m-%d',showTime : true," + "button : '" + + id + "Btn', onUpdate : setDate });"); + return s; + } + + private static MRefTable getRefTable(Properties ctx, + int reference_Value_ID, String trxName) + { + String sql = "SELECT * from AD_Ref_Table where AD_Reference_ID = " + + reference_Value_ID; + + PreparedStatement pstmt = null; + ResultSet rs = null; + MRefTable refTable = null; + try + { + pstmt = DB.prepareStatement(sql, trxName); + rs = pstmt.executeQuery(); + + if (rs.next()) + { + refTable = new MRefTable(ctx, rs, trxName); + } + } + catch (SQLException e) + { + } + finally + { + DB.close(rs, pstmt); + rs = null; + pstmt = null; + } + return refTable; + } + + private static ArrayList getKeyNamePair(Properties ctx, + MProcessPara parameter, String tableName, String whereClause, + String orderBy, String trxName) + { + String orgs = RoleManager.getRoleViewableOrgAccess(ctx); + StringBuffer sql = new StringBuffer(); + + if (whereClause != null && !whereClause.equals("")) + { + sql.append(whereClause + " AND"); + } + sql.append(" isActive = 'Y'").append( + " AND AD_Client_ID IN (0," + Env.getAD_Client_ID(ctx) + ")") + .append(" AND AD_Org_ID IN (" + orgs + ")"); + + if (orderBy != null && !orderBy.equals("")) + { + sql.append(" Order by " + orderBy); + } + + int ids[] = PO.getAllIDs(tableName, sql.toString(), trxName); + ArrayList list = new ArrayList(); + + for (int id : ids) + { + Lookup lookup = parameter.getLookup(); + String value = lookup.getDisplay(id); + KeyNamePair pair = new KeyNamePair(id, value); + list.add(pair); + } + return list; + } + +} diff --git a/posterita/posterita/src/main/org/posterita/factory/WebProperties.java b/posterita/posterita/src/main/org/posterita/factory/WebProperties.java new file mode 100644 index 0000000000..f8e18d3df8 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/factory/WebProperties.java @@ -0,0 +1,35 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Created on 12-Oct-2005 + */ + + +package org.posterita.factory; + +import java.util.Properties; + +import org.posterita.exceptions.OperationException; + +public interface WebProperties +{ + public void put(Properties ctx, String key, String value) throws OperationException; + public String get(Properties ctx, String key) throws OperationException; + +} diff --git a/posterita/posterita/src/main/org/posterita/form/AttachmentForm.java b/posterita/posterita/src/main/org/posterita/form/AttachmentForm.java new file mode 100644 index 0000000000..2fc2a45925 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/AttachmentForm.java @@ -0,0 +1,39 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 26-Aug-2005 by alok + * + */ +package org.posterita.form; + +import org.posterita.beans.AttachmentBean; +import org.posterita.struts.core.DefaultForm; + +public class AttachmentForm extends DefaultForm +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public AttachmentForm() + { + setBean(new AttachmentBean()); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/form/AttributeForm.java b/posterita/posterita/src/main/org/posterita/form/AttributeForm.java new file mode 100644 index 0000000000..15b0de8ca3 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/AttributeForm.java @@ -0,0 +1,41 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Jun 15, 2006 + */ + + +package org.posterita.form; + +import org.posterita.beans.AttributeBean; +import org.posterita.struts.core.DefaultForm; + + +public class AttributeForm extends DefaultForm +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public AttributeForm() + { + setBean(new AttributeBean()); + } + +} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/form/AttributeValuesForm.java b/posterita/posterita/src/main/org/posterita/form/AttributeValuesForm.java new file mode 100644 index 0000000000..d838092163 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/AttributeValuesForm.java @@ -0,0 +1,39 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +* Created on May 23, 2006 by ashley +* +*/ + +package org.posterita.form; + +import org.posterita.beans.AttributeValueDetailBean; +import org.posterita.struts.core.DefaultForm; + +public class AttributeValuesForm extends DefaultForm +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public AttributeValuesForm() + { + setBean(new AttributeValueDetailBean()); + } +} diff --git a/posterita/posterita/src/main/org/posterita/form/BPartnerForm.java b/posterita/posterita/src/main/org/posterita/form/BPartnerForm.java new file mode 100644 index 0000000000..11564884a2 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/BPartnerForm.java @@ -0,0 +1,49 @@ +/** + * + * Copyright (c) 2008 Posterita. All Rights Reserved. + * + * This software is the confidential and proprietary information of + * Posterita. ("Confidential Information"). You shall not + * disclose such Confidential Information and shall use it only in + * accordance with the terms of the license agreement you entered into + * with Posterita. + * + * POSTERITA MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE + * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT + * NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR + * A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. POSTERITA SHALL NOT + * BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, + * MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. + * + * Aug 12, 2008 11:01:56 PM by praveen + * + */ + +package org.posterita.form; + +import javax.servlet.http.HttpServletRequest; + +import org.apache.struts.action.ActionErrors; +import org.apache.struts.action.ActionMapping; +import org.posterita.beans.BPartnerBean; +import org.posterita.struts.bPartner.BPartnerAction; +import org.posterita.struts.core.DefaultForm; + +public class BPartnerForm extends DefaultForm +{ + public BPartnerForm() + { + setBean(new BPartnerBean()); + } + + public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) + { + if(BPartnerAction.GET_CREDITOR_HISTORY.equals(this.action)) + { + // add required fields here + } + + return super.validate(mapping, request); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/form/BPartnerInfoForm.java b/posterita/posterita/src/main/org/posterita/form/BPartnerInfoForm.java new file mode 100644 index 0000000000..948ba2c066 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/BPartnerInfoForm.java @@ -0,0 +1,42 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Jul 26, 2006 + */ + + +package org.posterita.form; + +import org.posterita.beans.BPartnerInfoBean; +import org.posterita.struts.core.DefaultForm; + + +public class BPartnerInfoForm extends DefaultForm +{ + + /** + * + */ + private static final long serialVersionUID = 1L; + + public BPartnerInfoForm() + { + setBean(new BPartnerInfoBean()); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/form/BankForm.java b/posterita/posterita/src/main/org/posterita/form/BankForm.java new file mode 100644 index 0000000000..eea521bcd6 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/BankForm.java @@ -0,0 +1,40 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 26-Jul-2005 by alok + * + */ +package org.posterita.form; + +import org.posterita.beans.BankBean; +import org.posterita.struts.core.DefaultForm; + + +public class BankForm extends DefaultForm +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public BankForm() + { + setBean(new BankBean()); + addRequiredFields(new String[]{"bankName"}); + } +} diff --git a/posterita/posterita/src/main/org/posterita/form/BlackListForm.java b/posterita/posterita/src/main/org/posterita/form/BlackListForm.java new file mode 100644 index 0000000000..1fada75b88 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/BlackListForm.java @@ -0,0 +1,40 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 26-Jul-2005 by alok + * + */ +package org.posterita.form; + +import org.posterita.beans.BlackListedBean; +import org.posterita.struts.core.DefaultForm; + + +public class BlackListForm extends DefaultForm +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public BlackListForm() + { + setBean(new BlackListedBean()); + //addRequiredFields(new String[] {"bankName", "chequeNo"}); + } +} diff --git a/posterita/posterita/src/main/org/posterita/form/CashBookDetailForm.java b/posterita/posterita/src/main/org/posterita/form/CashBookDetailForm.java new file mode 100644 index 0000000000..b236ffca39 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/CashBookDetailForm.java @@ -0,0 +1,55 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Created on May 5, 2006 + */ + + +package org.posterita.form; + +import javax.servlet.http.HttpServletRequest; + +import org.apache.struts.action.ActionErrors; +import org.apache.struts.action.ActionMapping; +import org.posterita.beans.CashBookDetailBean; +import org.posterita.struts.core.DefaultForm; +import org.posterita.struts.pos.CashBookAction; + + +public class CashBookDetailForm extends DefaultForm +{ + private static final long serialVersionUID = 1L; + + public CashBookDetailForm() + { + setBean(new CashBookDetailBean()); + } + + public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) + { + // Add validation to the form for cash book adjustment + if(CashBookAction.ADJUST_CASH_BOOK_ACTION.equals(action)) + { + addRequiredFields(new String[]{"adjustmentAmount", "transferType", "description"}); + } + + return super.validate(mapping, request); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/form/CashBookForm.java b/posterita/posterita/src/main/org/posterita/form/CashBookForm.java new file mode 100644 index 0000000000..4e065c2a87 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/CashBookForm.java @@ -0,0 +1,36 @@ +/****************************************************************************** + * Product: Posterita Web-Based POS and Adempiere Plugin * + * Copyright (C) 2008 Posterita Ltd * + * This file is part of POSterita * + * * + * POSterita is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * + *****************************************************************************/ +package org.posterita.form; + +import org.posterita.beans.CashBookBean; +import org.posterita.struts.core.DefaultForm; + +/** + * @author Ashley G Ramdass + * May 27, 2008 + */ +public class CashBookForm extends DefaultForm +{ + + public CashBookForm() + { + super.setBean(new CashBookBean()); + } +} diff --git a/posterita/posterita/src/main/org/posterita/form/CashForm.java b/posterita/posterita/src/main/org/posterita/form/CashForm.java new file mode 100644 index 0000000000..9598d89877 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/CashForm.java @@ -0,0 +1,41 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +* +* Created on Sep 11, 2006 by ashley +* +*/ + +/** + @author ashley + */ + +package org.posterita.form; + +import org.posterita.beans.CashBean; +import org.posterita.struts.core.DefaultForm; + +public class CashForm extends DefaultForm +{ + private static final long serialVersionUID = 1L; + + public CashForm() + { + this.setBean(new CashBean()); + } +} diff --git a/posterita/posterita/src/main/org/posterita/form/ChangeDocumentStatusForm.java b/posterita/posterita/src/main/org/posterita/form/ChangeDocumentStatusForm.java new file mode 100644 index 0000000000..1ed9047bda --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/ChangeDocumentStatusForm.java @@ -0,0 +1,37 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ +package org.posterita.form; + +import org.posterita.beans.ChangeDocumentStatusBean; +import org.posterita.struts.core.DefaultForm; + + +public class ChangeDocumentStatusForm extends DefaultForm +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public ChangeDocumentStatusForm() + { + setBean(new ChangeDocumentStatusBean()); + } +} diff --git a/posterita/posterita/src/main/org/posterita/form/ChangePasswordForm.java b/posterita/posterita/src/main/org/posterita/form/ChangePasswordForm.java new file mode 100644 index 0000000000..be5ac9d6be --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/ChangePasswordForm.java @@ -0,0 +1,41 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Aug 29, 2005 by din + */ + +package org.posterita.form; + +import org.posterita.beans.ChangePasswordBean; +import org.posterita.struts.core.DefaultForm; + +public class ChangePasswordForm extends DefaultForm +{ + + /** + * + */ + private static final long serialVersionUID = 1L; + + public ChangePasswordForm() + { + setBean(new ChangePasswordBean()); + addRequiredFields(new String[] {"oldPassword","newPassword","confirmPassword"}); + addMatchFields("newPassword","confirmPassword"); + } +} diff --git a/posterita/posterita/src/main/org/posterita/form/CheckoutForm.java b/posterita/posterita/src/main/org/posterita/form/CheckoutForm.java new file mode 100644 index 0000000000..101f477a23 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/CheckoutForm.java @@ -0,0 +1,306 @@ +/** + * + * Copyright (c) 2008 Posterita. All Rights Reserved. + * + * This software is the confidential and proprietary information of + * Posterita. ("Confidential Information"). You shall not + * disclose such Confidential Information and shall use it only in + * accordance with the terms of the license agreement you entered into + * with Posterita. + * + * POSTERITA MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE + * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT + * NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR + * A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. TAMAK ICT SHALL NOT + * BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, + * MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. + * + * Mar 21, 2008 10:32:47 AM by praveen + * + */ + +package org.posterita.form; + +import javax.servlet.http.HttpServletRequest; + +import org.apache.struts.action.ActionErrors; +import org.apache.struts.action.ActionMapping; +import org.apache.struts.config.ActionConfig; +import org.posterita.beans.CheckoutBean; +import org.posterita.struts.core.DefaultForm; + +public class CheckoutForm extends DefaultForm +{ + private String amountTendered; + private String amountRefunded; + private String cardNo; + private String chequeNo; + private String cashAmt; + private String chequeAmt; + private String cardAmt; + private String bpartnerId; + private String tenderType; + private String[] discount; + private String[] discountedPrice; + private String[] isDiscOnInclUnitPrice; + private String[] discInclUnitPrice; + private String orderType; + private String discountLimit; + private String priceListId; + private String toBeShipped = "true"; + private String discountedTotal; + private String discountOnTotal; + private String discountOnTotalPercent; + private String overridePriceLimit; + private String totalDiscount; + private String[] isDiscOnPerc; + private String[] isDiscOnTotal; + private String[] qtyPerLine; + private String m_productId; + private String grandTotal; + + public CheckoutForm() + { + setBean(new CheckoutBean()); + } + + public void setRoleId(String roleId) { + this.roleId = roleId; + } + public String getRoleId() { + return roleId; + } + + public String getAmountTendered() { + return amountTendered; + } + public void setAmountTendered(String amountTendered) { + this.amountTendered = amountTendered; + } + public String getCardNo() { + return cardNo; + } + public void setCardNo(String cardNo) { + this.cardNo = cardNo; + } + public String getChequeNo() { + return chequeNo; + } + public void setChequeNo(String chequeNo) { + this.chequeNo = chequeNo; + } + public String getCashAmt() { + return cashAmt; + } + public void setCashAmt(String cashAmt) { + this.cashAmt = cashAmt; + } + public String getChequeAmt() { + return chequeAmt; + } + public void setChequeAmt(String chequeAmt) { + this.chequeAmt = chequeAmt; + } + public String getBpartnerId() { + return bpartnerId; + } + public void setBpartnerId(String bpartnerId) { + this.bpartnerId = bpartnerId; + } + public String getTenderType() { + return tenderType; + } + public void setTenderType(String tenderType) { + this.tenderType = tenderType; + } + + public String getOrderType() { + return orderType; + } + public void setOrderType(String orderType) { + this.orderType = orderType; + } + + public String getDiscountLimit() { + return discountLimit; + } + + public void setDiscountLimit(String discountLimit) { + this.discountLimit = discountLimit; + } + + public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) + { + ActionConfig config = (ActionConfig) request.getAttribute("org.apache.struts.action.mapping.instance"); + if(config != null && input != null) + { + config.setInput(input); + } + + ActionErrors errors = super.validate(mapping, request); + + if(errors!=null && !errors.isEmpty()) + { + reset(mapping, request); + } + + return errors; + } + + public String[] getDiscount() { + return discount; + } + + public void setDiscount(String[] discount) { + this.discount = discount; + } + + public String getAmountRefunded() { + return amountRefunded; + } + + public void setAmountRefunded(String amountRefunded) { + this.amountRefunded = amountRefunded; + } + + public String getCardAmt() { + return cardAmt; + } + + public void setCardAmt(String cardAmt) { + this.cardAmt = cardAmt; + } + + public String[] getDiscountedPrice() { + return discountedPrice; + } + + public void setDiscountedPrice(String[] discountedPrice) { + this.discountedPrice = discountedPrice; + } + + public String getPriceListId() { + return priceListId; + } + + public void setPriceListId(String priceListId) { + this.priceListId = priceListId; + } + + public String getToBeShipped() { + return toBeShipped; + } + + public void setToBeShipped(String toBeShipped) { + this.toBeShipped = toBeShipped; + } + + public String getDiscountedTotal() { + return discountedTotal; + } + + public void setDiscountedTotal(String discountedTotal) { + this.discountedTotal = discountedTotal; + } + + public String getDiscountOnTotal() { + return discountOnTotal; + } + + public void setDiscountOnTotal(String discountOnTotal) { + this.discountOnTotal = discountOnTotal; + } + + public String getOverridePriceLimit() { + return overridePriceLimit; + } + + public void setOverridePriceLimit(String overridePriceLimit) { + this.overridePriceLimit = overridePriceLimit; + } + + public String getTotalDiscount() { + return totalDiscount; + } + + public void setTotalDiscount(String totalDiscount) { + this.totalDiscount = totalDiscount; + } + + public String[] getIsDiscOnInclUnitPrice() { + return isDiscOnInclUnitPrice; + } + + public void setIsDiscOnInclUnitPrice(String[] isDiscOnInclUnitPrice) { + this.isDiscOnInclUnitPrice = isDiscOnInclUnitPrice; + } + + public String[] getDiscInclUnitPrice() { + return discInclUnitPrice; + } + + public void setDiscInclUnitPrice(String[] discInclUnitPrice) { + this.discInclUnitPrice = discInclUnitPrice; + } + + public String[] getIsDiscOnPerc() + { + return isDiscOnPerc; + } + + public void setIsDiscOnPerc(String[] isDiscOnPerc) + { + this.isDiscOnPerc = isDiscOnPerc; + } + + public String[] getIsDiscOnTotal() + { + return isDiscOnTotal; + } + + public void setIsDiscOnTotal(String[] isDiscOnTotal) + { + this.isDiscOnTotal = isDiscOnTotal; + } + + public String[] getQtyPerLine() + { + return qtyPerLine; + } + + public void setQtyPerLine(String[] qtyPerLine) + { + this.qtyPerLine = qtyPerLine; + } + + public String getDiscountOnTotalPercent() { + return discountOnTotalPercent; + } + + public void setDiscountOnTotalPercent(String discountOnTotalPercent) { + this.discountOnTotalPercent = discountOnTotalPercent; + } + + public String getM_productId() + { + return m_productId; + } + + public void setM_productId(String id) + { + m_productId = id; + } + + public String getGrandTotal() + { + return grandTotal; + } + + public void setGrandTotal(String grandTotal) + { + this.grandTotal = grandTotal; + } + + + +} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/form/CommissionForm.java b/posterita/posterita/src/main/org/posterita/form/CommissionForm.java new file mode 100644 index 0000000000..a46ae818aa --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/CommissionForm.java @@ -0,0 +1,37 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Nov 7, 2006 + */ + + +package org.posterita.form; + +import org.posterita.beans.CommissionBean; +import org.posterita.struts.core.DefaultForm; + + +public class CommissionForm extends DefaultForm +{ + private static final long serialVersionUID = 1L; + + public CommissionForm() + { + this.setBean(new CommissionBean()); + } +} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/form/CreateBPartnerForm.java b/posterita/posterita/src/main/org/posterita/form/CreateBPartnerForm.java new file mode 100644 index 0000000000..6316cc2c5c --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/CreateBPartnerForm.java @@ -0,0 +1,42 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 25-Jul-2005 by alok + * + */ +package org.posterita.form; + +import org.posterita.beans.BPartnerBean; +import org.posterita.struts.core.DefaultForm; + + +public class CreateBPartnerForm extends DefaultForm +{ + + /** + * + */ + private static final long serialVersionUID = 1L; + + public CreateBPartnerForm() + { + setBean( new BPartnerBean()); + addRequiredFields(new String[]{"partnerName","name2","address1"}); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/form/CreateBankAccountForm.java b/posterita/posterita/src/main/org/posterita/form/CreateBankAccountForm.java new file mode 100644 index 0000000000..6ad931862f --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/CreateBankAccountForm.java @@ -0,0 +1,40 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Jul 26, 2005 by praveen + * + */ +package org.posterita.form; + +import org.posterita.beans.BankAccountBean; +import org.posterita.struts.core.DefaultForm; + +public class CreateBankAccountForm extends DefaultForm +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public CreateBankAccountForm() + { + setBean(new BankAccountBean()); + addRequiredFields(new String[]{"bankId","accountNo","accountType","currentBalance"}); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/form/CreateLocatorForm.java b/posterita/posterita/src/main/org/posterita/form/CreateLocatorForm.java new file mode 100644 index 0000000000..9f6718e330 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/CreateLocatorForm.java @@ -0,0 +1,40 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 26-Jul-2005 by alok + * + */ +package org.posterita.form; + +import org.posterita.beans.LocatorBean; +import org.posterita.struts.core.DefaultForm; + + +public class CreateLocatorForm extends DefaultForm +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public CreateLocatorForm() + { + setBean(new LocatorBean()); + addRequiredFields(new String[]{"aisle","bin","level"}); + } +} diff --git a/posterita/posterita/src/main/org/posterita/form/CreateProductAttributeForm.java b/posterita/posterita/src/main/org/posterita/form/CreateProductAttributeForm.java new file mode 100644 index 0000000000..14527546f7 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/CreateProductAttributeForm.java @@ -0,0 +1,40 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Jul 28, 2005 by praveen + * + */ +package org.posterita.form; + +import org.posterita.beans.ProductAttributeBean; +import org.posterita.struts.core.DefaultForm; + +public class CreateProductAttributeForm extends DefaultForm +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public CreateProductAttributeForm() + { + setBean(new ProductAttributeBean()); + //addRequiredFields(new String[]{"attributeValue"}); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/form/CreateProductAttributeValueForm.java b/posterita/posterita/src/main/org/posterita/form/CreateProductAttributeValueForm.java new file mode 100644 index 0000000000..8bf7f3d4a7 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/CreateProductAttributeValueForm.java @@ -0,0 +1,40 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Jul 28, 2005 by praveen + * + */ +package org.posterita.form; + +import org.posterita.beans.ProductAttributeBean; +import org.posterita.struts.core.DefaultForm; + +public class CreateProductAttributeValueForm extends DefaultForm +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public CreateProductAttributeValueForm() + { + setBean(new ProductAttributeBean()); + addRequiredFields(new String[]{"attributeValue"}); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/form/CreateUserForm.java b/posterita/posterita/src/main/org/posterita/form/CreateUserForm.java new file mode 100644 index 0000000000..ebfe66e927 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/CreateUserForm.java @@ -0,0 +1,44 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Jul 29, 2005 by din + */ + +package org.posterita.form; + +import org.posterita.beans.UserBean; +import org.posterita.struts.core.DefaultForm; + + + +public class CreateUserForm extends DefaultForm +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public CreateUserForm() + { + setBean(new UserBean()); + addRequiredFields(new String[]{"username", "password", "confirmPassword","userPIN", "orgId"}); + addMatchFields("password","confirmPassword"); + //addEmailValidation("email"); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/form/CreditCardForm.java b/posterita/posterita/src/main/org/posterita/form/CreditCardForm.java new file mode 100644 index 0000000000..9264cc421c --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/CreditCardForm.java @@ -0,0 +1,43 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Created on 02-Sep-2005 + */ + + +package org.posterita.form; + +import org.posterita.beans.CustomerBean; +import org.posterita.struts.core.DefaultForm; + + +public class CreditCardForm extends DefaultForm +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public CreditCardForm() + { + + setBean(new CustomerBean()); + addRequiredFields(new String[]{"creditCardNumber", "cvv", "creditCardExpMonth", "creditCardExpYear"}); + } +} diff --git a/posterita/posterita/src/main/org/posterita/form/CurrencyForm.java b/posterita/posterita/src/main/org/posterita/form/CurrencyForm.java new file mode 100644 index 0000000000..3ebe2cf503 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/CurrencyForm.java @@ -0,0 +1,39 @@ +/* + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Servansingh + * */ + +package org.posterita.form; + +import org.posterita.beans.CurrencyBean; +import org.posterita.struts.core.DefaultForm; + + + +public class CurrencyForm extends DefaultForm +{ + private static final long serialVersionUID = 1L; + + public CurrencyForm() + { + setBean(new CurrencyBean()); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/form/CurrenrPOSBalanceForm.java b/posterita/posterita/src/main/org/posterita/form/CurrenrPOSBalanceForm.java new file mode 100644 index 0000000000..ab3c68060f --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/CurrenrPOSBalanceForm.java @@ -0,0 +1,41 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Created on May 5, 2006 + */ + + +package org.posterita.form; + +import org.posterita.beans.CurrentTillAmountBean; +import org.posterita.struts.core.DefaultForm; + + +public class CurrenrPOSBalanceForm extends DefaultForm +{ + /** + * + */ + private static final long serialVersionUID = 1L; + +public CurrenrPOSBalanceForm() + { + setBean(new CurrentTillAmountBean()); + } +} diff --git a/posterita/posterita/src/main/org/posterita/form/CustomerAndCreditCardForm.java b/posterita/posterita/src/main/org/posterita/form/CustomerAndCreditCardForm.java new file mode 100644 index 0000000000..b5e2ed6a84 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/CustomerAndCreditCardForm.java @@ -0,0 +1,46 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Created on 02-Sep-2005 + */ + + +package org.posterita.form; + +import org.posterita.beans.CustomerBean; +import org.posterita.struts.core.DefaultForm; + + +public class CustomerAndCreditCardForm extends DefaultForm +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public CustomerAndCreditCardForm() + { + setBean(new CustomerBean()); + + addRequiredFields(new String[]{"creditCardPayment","username","userSurname", "email", "address1","address2","city","countryId"}); + addCreditCardFieldsValidation("creditCardPayment"); + addCVVFieldsValidation("creditCardPayment"); + addCreditCardExpiryDateFieldsValidation("creditCardPayment"); + } +} diff --git a/posterita/posterita/src/main/org/posterita/form/CustomerForm.java b/posterita/posterita/src/main/org/posterita/form/CustomerForm.java new file mode 100644 index 0000000000..49d9e1daea --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/CustomerForm.java @@ -0,0 +1,48 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Created on 02-Sep-2005 + */ + + +package org.posterita.form; + +import org.posterita.beans.CustomerBean; +import org.posterita.struts.core.DefaultForm; + + +public class CustomerForm extends DefaultForm +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public CustomerForm() + { + + setBean(new CustomerBean()); + addRequiredFields(new String[]{ + "partnerName" + ,"surname" + ,"address1" + }); + + } +} diff --git a/posterita/posterita/src/main/org/posterita/form/DateFilterForm.java b/posterita/posterita/src/main/org/posterita/form/DateFilterForm.java new file mode 100644 index 0000000000..b7a829e6da --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/DateFilterForm.java @@ -0,0 +1,42 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +* +* Created on Sep 11, 2006 by ashley +* +*/ + +/** + @author ashley + */ + +package org.posterita.form; + +import org.posterita.beans.DateFilterBean; +import org.posterita.struts.core.DefaultForm; + +public class DateFilterForm extends DefaultForm +{ + private static final long serialVersionUID = 1L; + + public DateFilterForm() + { + this.setBean(new DateFilterBean()); + addRequiredFields(new String[]{"fromDate", "toDate"}); + } +} diff --git a/posterita/posterita/src/main/org/posterita/form/DocumentForm.java b/posterita/posterita/src/main/org/posterita/form/DocumentForm.java new file mode 100644 index 0000000000..6bb16182a6 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/DocumentForm.java @@ -0,0 +1,41 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 12-Aug-2005 by alok + * + */ +package org.posterita.form; + +import org.posterita.beans.DocumentBean; +import org.posterita.struts.core.DefaultForm; + + +public class DocumentForm extends DefaultForm +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public DocumentForm() + { + setBean(new DocumentBean()); + + } + +} diff --git a/posterita/posterita/src/main/org/posterita/form/DocumentHistoryForm.java b/posterita/posterita/src/main/org/posterita/form/DocumentHistoryForm.java new file mode 100644 index 0000000000..53d4883285 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/DocumentHistoryForm.java @@ -0,0 +1,41 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 25-Jul-2005 by alok + * + */ +package org.posterita.form; + +import org.posterita.beans.DocumentHistoryBean; +import org.posterita.struts.core.DefaultForm; + + +public class DocumentHistoryForm extends DefaultForm +{ + + /** + * + */ + private static final long serialVersionUID = 1L; + + public DocumentHistoryForm() + { + setBean( new DocumentHistoryBean()); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/form/DunningForm.java b/posterita/posterita/src/main/org/posterita/form/DunningForm.java new file mode 100644 index 0000000000..276ca021b0 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/DunningForm.java @@ -0,0 +1,42 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Oct 27, 2006 + */ + + +package org.posterita.form; + +import org.posterita.beans.DunningBean; +import org.posterita.struts.core.DefaultForm; + + +public class DunningForm extends DefaultForm +{ + + /** + * + */ + private static final long serialVersionUID = 1L; + + public DunningForm() + { + setBean( new DunningBean()); + } + +} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/form/EditAttributeForm.java b/posterita/posterita/src/main/org/posterita/form/EditAttributeForm.java new file mode 100644 index 0000000000..b5677fbd66 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/EditAttributeForm.java @@ -0,0 +1,40 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +* Created on May 24, 2006 by ashley +* +*/ + +package org.posterita.form; + +import org.posterita.beans.AttributeValueDetailBean; +import org.posterita.struts.core.DefaultForm; + +public class EditAttributeForm extends DefaultForm +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public EditAttributeForm() + { + this.setBean(new AttributeValueDetailBean()); + this.addRequiredFields(new String[]{"newName"}); + } +} diff --git a/posterita/posterita/src/main/org/posterita/form/EditPriceListForm.java b/posterita/posterita/src/main/org/posterita/form/EditPriceListForm.java new file mode 100644 index 0000000000..715f9472a1 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/EditPriceListForm.java @@ -0,0 +1,39 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Oct 20, 2005 by praveen + * + */ +package org.posterita.form; + +import org.posterita.beans.EditPriceBean; +import org.posterita.struts.core.DefaultForm; + +public class EditPriceListForm extends DefaultForm +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public EditPriceListForm() + { + setBean(new EditPriceBean()); + addRequiredFields(new String[]{"price"}); + } +} diff --git a/posterita/posterita/src/main/org/posterita/form/EditProductForm.java b/posterita/posterita/src/main/org/posterita/form/EditProductForm.java new file mode 100644 index 0000000000..4f186b1ec3 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/EditProductForm.java @@ -0,0 +1,41 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Aug 4, 2005 by praveen + * + */ +package org.posterita.form; + +import org.posterita.beans.ProductBean; +import org.posterita.struts.core.DefaultForm; + +public class EditProductForm extends DefaultForm +{ + + /** + * + */ + private static final long serialVersionUID = 1L; + + public EditProductForm() + { + setBean(new ProductBean()); + //addRequiredFields(new String[] {"productName","revenueRecognition","description"}); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/form/GarmentForm.java b/posterita/posterita/src/main/org/posterita/form/GarmentForm.java new file mode 100644 index 0000000000..4113912497 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/GarmentForm.java @@ -0,0 +1,41 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Jun 30, 2006 + */ + + +package org.posterita.form; + +import org.posterita.beans.ProductBean; +import org.posterita.struts.core.DefaultForm; + + +public class GarmentForm extends DefaultForm +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public GarmentForm() + { + setBean(new ProductBean()); + addRequiredFields(new String[] {"description","brandName","modelName","revenueRecognition","designName","colourName","purchasePriceStandard","salesPriceStandard"}); + } +} diff --git a/posterita/posterita/src/main/org/posterita/form/GeneralPaymentForm.java b/posterita/posterita/src/main/org/posterita/form/GeneralPaymentForm.java new file mode 100644 index 0000000000..adc5196f6d --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/GeneralPaymentForm.java @@ -0,0 +1,16 @@ +package org.posterita.form; + +import org.posterita.beans.PaymentBean; +import org.posterita.struts.core.DefaultForm; + +public class GeneralPaymentForm extends DefaultForm +{ + private static final long serialVersionUID = 1L; + + public GeneralPaymentForm() + { + setBean(new PaymentBean()); + addRequiredFields(new String[]{"amount","bpartnerId"}); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/form/GenericProductForm.java b/posterita/posterita/src/main/org/posterita/form/GenericProductForm.java new file mode 100644 index 0000000000..83622e125d --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/GenericProductForm.java @@ -0,0 +1,38 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package org.posterita.form; + +import org.posterita.beans.GenericProductBean; +import org.posterita.struts.core.DefaultForm; + + +public class GenericProductForm extends DefaultForm +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public GenericProductForm() + { + setBean(new GenericProductBean()); + } +} diff --git a/posterita/posterita/src/main/org/posterita/form/InOutHistoryForm.java b/posterita/posterita/src/main/org/posterita/form/InOutHistoryForm.java new file mode 100644 index 0000000000..7e53bc3d30 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/InOutHistoryForm.java @@ -0,0 +1,38 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Aug 16, 2005 by praveen + * + */ +package org.posterita.form; + +import org.posterita.beans.InOutHistoryBean; +import org.posterita.struts.core.DefaultForm; + +public class InOutHistoryForm extends DefaultForm +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public InOutHistoryForm() + { + setBean(new InOutHistoryBean()); + } +} diff --git a/posterita/posterita/src/main/org/posterita/form/InitCustomerForm.java b/posterita/posterita/src/main/org/posterita/form/InitCustomerForm.java new file mode 100644 index 0000000000..939e980658 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/InitCustomerForm.java @@ -0,0 +1,40 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Jan 16, 2007 + */ + + +package org.posterita.form; + +import org.posterita.beans.CustomerBean; +import org.posterita.struts.core.DefaultForm; + + +public class InitCustomerForm extends DefaultForm +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public InitCustomerForm() + { + setBean(new CustomerBean()); + } +} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/form/InventoryForm.java b/posterita/posterita/src/main/org/posterita/form/InventoryForm.java new file mode 100644 index 0000000000..acd773bb0f --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/InventoryForm.java @@ -0,0 +1,42 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Dec 8, 2006 + */ + + +package org.posterita.form; + +import org.posterita.beans.InventoryBean; +import org.posterita.struts.core.DefaultForm; + + +public class InventoryForm extends DefaultForm +{ + + /** + * + */ + private static final long serialVersionUID = 1L; + + public InventoryForm() + { + setBean( new InventoryBean()); + } + +} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/form/InventoryLineForm.java b/posterita/posterita/src/main/org/posterita/form/InventoryLineForm.java new file mode 100644 index 0000000000..a56b44f223 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/InventoryLineForm.java @@ -0,0 +1,17 @@ +package org.posterita.form; + +import org.posterita.beans.InventoryLineBean; +import org.posterita.struts.core.DefaultForm; + +public class InventoryLineForm extends DefaultForm +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public InventoryLineForm() + { + setBean( new InventoryLineBean()); + } +} diff --git a/posterita/posterita/src/main/org/posterita/form/InvoiceHistoryForm.java b/posterita/posterita/src/main/org/posterita/form/InvoiceHistoryForm.java new file mode 100644 index 0000000000..ec6ce344c5 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/InvoiceHistoryForm.java @@ -0,0 +1,38 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Aug 15, 2005 by praveen + * + */ +package org.posterita.form; + +import org.posterita.beans.InvoiceHistoryBean; +import org.posterita.struts.core.DefaultForm; + +public class InvoiceHistoryForm extends DefaultForm +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public InvoiceHistoryForm() + { + setBean(new InvoiceHistoryBean()); + } +} diff --git a/posterita/posterita/src/main/org/posterita/form/InvokeOrderForm.java b/posterita/posterita/src/main/org/posterita/form/InvokeOrderForm.java new file mode 100644 index 0000000000..71849dd110 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/InvokeOrderForm.java @@ -0,0 +1,41 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 11-Aug-2005 by alok + * + */ +package org.posterita.form; + +import org.posterita.beans.OrderLineBean; +import org.posterita.struts.core.DefaultForm; + + +public class InvokeOrderForm extends DefaultForm +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public InvokeOrderForm() + { + setBean(new OrderLineBean()); + addRequiredFields(new String[]{"documentNo"}); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/form/ItemForm.java b/posterita/posterita/src/main/org/posterita/form/ItemForm.java new file mode 100644 index 0000000000..0f68c2d794 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/ItemForm.java @@ -0,0 +1,38 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +package org.posterita.form; + +import org.posterita.beans.ItemBean; +import org.posterita.struts.core.DefaultForm; + + +public class ItemForm extends DefaultForm +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public ItemForm() + { + setBean(new ItemBean()); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/form/LoginForm.java b/posterita/posterita/src/main/org/posterita/form/LoginForm.java new file mode 100644 index 0000000000..f876931e07 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/LoginForm.java @@ -0,0 +1,41 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +package org.posterita.form; + +import org.posterita.beans.LoginBean; +import org.posterita.struts.core.DefaultForm; + + +public class LoginForm extends DefaultForm +{ + + /** + * + */ + private static final long serialVersionUID = 1L; + + public LoginForm() + { + setBean(new LoginBean()); + //addRequiredFields(new String[] {"username", "password"}); + } + + +} diff --git a/posterita/posterita/src/main/org/posterita/form/MenuItemForm.java b/posterita/posterita/src/main/org/posterita/form/MenuItemForm.java new file mode 100644 index 0000000000..8b2648220c --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/MenuItemForm.java @@ -0,0 +1,40 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 26-Jul-2005 by alok + * + */ +package org.posterita.form; + +import org.posterita.beans.MenuItemBean; +import org.posterita.struts.core.DefaultForm; + + +public class MenuItemForm extends DefaultForm +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public MenuItemForm() + { + setBean(new MenuItemBean()); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/form/OpenItemForm.java b/posterita/posterita/src/main/org/posterita/form/OpenItemForm.java new file mode 100644 index 0000000000..70b0e723c2 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/OpenItemForm.java @@ -0,0 +1,42 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Oct 17, 2006 + */ + + +package org.posterita.form; + +import org.posterita.beans.OpenItemBean; +import org.posterita.struts.core.DefaultForm; + + +public class OpenItemForm extends DefaultForm +{ + + /** + * + */ + private static final long serialVersionUID = 1L; + + public OpenItemForm() + { + setBean( new OpenItemBean()); + } + +} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/form/OrderForm.java b/posterita/posterita/src/main/org/posterita/form/OrderForm.java new file mode 100644 index 0000000000..2189fdcb17 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/OrderForm.java @@ -0,0 +1,39 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + **/ + +/** + @author ashley + */ + +package org.posterita.form; + +import org.posterita.beans.OrderBean; +import org.posterita.struts.core.DefaultForm; + +public class OrderForm extends DefaultForm +{ + private static final long serialVersionUID = 1L; + + public OrderForm() + { + this.setBean(new OrderBean()); + } +} diff --git a/posterita/posterita/src/main/org/posterita/form/OrderHistoryForm.java b/posterita/posterita/src/main/org/posterita/form/OrderHistoryForm.java new file mode 100644 index 0000000000..c95be9b137 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/OrderHistoryForm.java @@ -0,0 +1,40 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 04-Aug-2005 by alok + * + */ +package org.posterita.form; + +import org.posterita.beans.OrderHistoryBean; +import org.posterita.struts.core.DefaultForm; + + +public class OrderHistoryForm extends DefaultForm +{ + + /** + * + */ + private static final long serialVersionUID = 1L; + + public OrderHistoryForm() + { + setBean(new OrderHistoryBean()); + } +} diff --git a/posterita/posterita/src/main/org/posterita/form/OrderLineForm.java b/posterita/posterita/src/main/org/posterita/form/OrderLineForm.java new file mode 100644 index 0000000000..1fcb12f9ea --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/OrderLineForm.java @@ -0,0 +1,40 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 11-Aug-2005 by alok + * + */ +package org.posterita.form; + +import org.posterita.beans.OrderLineBean; +import org.posterita.struts.core.DefaultForm; + + +public class OrderLineForm extends DefaultForm +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public OrderLineForm() + { + setBean(new OrderLineBean()); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/form/OrgForm.java b/posterita/posterita/src/main/org/posterita/form/OrgForm.java new file mode 100644 index 0000000000..1f536a0f62 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/OrgForm.java @@ -0,0 +1,51 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ +package org.posterita.form; + +import javax.servlet.http.HttpServletRequest; + +import org.apache.struts.action.ActionErrors; +import org.apache.struts.action.ActionMapping; +import org.posterita.beans.OrgBean; +import org.posterita.struts.admin.OrganisationAction; +import org.posterita.struts.core.DefaultForm; + + +public class OrgForm extends DefaultForm +{ + private static final long serialVersionUID = 1L; + + public OrgForm() + { + setBean(new OrgBean()); + + } + + public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) + { + if(OrganisationAction.UPDATE_OR_CREATE_ORG.equals(action)) + { + addRequiredFields(new String[]{"orgName"}); + } + + return super.validate(mapping, request); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/form/POSDescriptionForm.java b/posterita/posterita/src/main/org/posterita/form/POSDescriptionForm.java new file mode 100644 index 0000000000..bc8553015f --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/POSDescriptionForm.java @@ -0,0 +1,42 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Created on May 5, 2006 + */ + + +package org.posterita.form; + +import org.posterita.beans.POSDescriptionBean; +import org.posterita.struts.core.DefaultForm; + + +public class POSDescriptionForm extends DefaultForm +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public POSDescriptionForm() + { + setBean(new POSDescriptionBean()); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/form/POSForm.java b/posterita/posterita/src/main/org/posterita/form/POSForm.java new file mode 100644 index 0000000000..487b69f68a --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/POSForm.java @@ -0,0 +1,43 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Created on 22-Mar-2006 + */ + + +package org.posterita.form; + + +import org.posterita.beans.POSBean; +import org.posterita.struts.core.DefaultForm; + + +public class POSForm extends DefaultForm +{ + /** + * + */ + private static final long serialVersionUID = 1L; + +public POSForm() + { + setBean(new POSBean()); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/form/POSHelpForm.java b/posterita/posterita/src/main/org/posterita/form/POSHelpForm.java new file mode 100644 index 0000000000..f3334d19ea --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/POSHelpForm.java @@ -0,0 +1,60 @@ +/** + * + * Copyright (c) 2008 Posterita. All Rights Reserved. + * + * This software is the confidential and proprietary information of + * Posterita. ("Confidential Information"). You shall not + * disclose such Confidential Information and shall use it only in + * accordance with the terms of the license agreement you entered into + * with Posterita. + * + * POSTERITA MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE + * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT + * NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR + * A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. TAMAK ICT SHALL NOT + * BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, + * MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. + * + * 6 Feb 2008 18:02:07 by shameem + * + */ + +package org.posterita.form; + +import javax.servlet.http.HttpServletRequest; + +import org.apache.struts.action.ActionErrors; +import org.apache.struts.action.ActionMapping; +import org.posterita.beans.POSHelpBean; +import org.posterita.pos.help.POSHelpAction; +import org.posterita.struts.core.DefaultForm; +import org.posterita.struts.pos.POSGoodsAction; +import org.posterita.struts.pos.POSProductAction; + +public class POSHelpForm extends DefaultForm +{ + private static final long serialVersionUID = 1L; + + public POSHelpForm() + { + setBean(new POSHelpBean()); + } + + public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) + { + if(POSHelpAction.INIT_CONTACT_US.equals(action)) + { + // no validation required + } + else if(POSHelpAction.SEND_EMAIL.equals(action)) + { + addRequiredFields(new String[] {"fromAddress","subject","textMessage"}); + } + else + { + + } + + return super.validate(mapping, request); + } +} diff --git a/posterita/posterita/src/main/org/posterita/form/POSHistoryForm.java b/posterita/posterita/src/main/org/posterita/form/POSHistoryForm.java new file mode 100644 index 0000000000..14d4be6ec0 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/POSHistoryForm.java @@ -0,0 +1,79 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on May 15, 2006 + */ + + +package org.posterita.form; + +import java.util.Calendar; + +import javax.servlet.http.HttpServletRequest; + +import org.apache.struts.action.ActionErrors; +import org.apache.struts.action.ActionMapping; +import org.posterita.beans.POSHistoryBean; +import org.posterita.exceptions.ApplicationException; +import org.posterita.exceptions.OperationException; +import org.posterita.struts.core.DefaultForm; +import org.posterita.struts.pos.CashAction; + + +public class POSHistoryForm extends DefaultForm +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public POSHistoryForm() throws OperationException + { + setBean(new POSHistoryBean()); + initForm(); + } + + private void initForm() throws OperationException + { + try + { + Calendar cal = Calendar.getInstance(); + POSHistoryBean bean = (POSHistoryBean) getBean(); + + bean.setMonth(Integer.valueOf(cal.get(Calendar.MONTH) + 1)); + bean.setYear(Integer.valueOf(cal.get(Calendar.YEAR))); + + month = bean.getMonth().toString(); + year = bean.getYear().toString(); + } + catch (ApplicationException e) + { + throw new OperationException(e); + } + } + + public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) + { + if( CashAction.GET_CASH_DETAILS_HISTORY.equals(action)) + { + addRequiredFields(new String[] {"cashBookId"}); + } + return super.validate(mapping, request); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/form/POSInfoForm.java b/posterita/posterita/src/main/org/posterita/form/POSInfoForm.java new file mode 100644 index 0000000000..0d0c343b1f --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/POSInfoForm.java @@ -0,0 +1,41 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Created on May 5, 2006 + */ + + +package org.posterita.form; + +import org.posterita.beans.POSInfoBean; +import org.posterita.struts.core.DefaultForm; + + +public class POSInfoForm extends DefaultForm +{ + /** + * + */ + private static final long serialVersionUID = 1L; + +public POSInfoForm() + { + setBean(new POSInfoBean()); + } +} diff --git a/posterita/posterita/src/main/org/posterita/form/POSOrderLineForm2.java b/posterita/posterita/src/main/org/posterita/form/POSOrderLineForm2.java new file mode 100644 index 0000000000..d54f0dba31 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/POSOrderLineForm2.java @@ -0,0 +1,42 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 11-Aug-2005 by alok + * + */ +package org.posterita.form; + +import org.posterita.beans.OrderLineBean; +import org.posterita.struts.core.DefaultForm; + + +public class POSOrderLineForm2 extends DefaultForm +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public POSOrderLineForm2() + { + setBean(new OrderLineBean()); + + addRequiredFields(new String[] {"bpartnerId"}); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/form/POSProductForm.java b/posterita/posterita/src/main/org/posterita/form/POSProductForm.java new file mode 100644 index 0000000000..ce9d931039 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/POSProductForm.java @@ -0,0 +1,42 @@ +package org.posterita.form; + +import javax.servlet.http.HttpServletRequest; + +import org.apache.struts.action.ActionErrors; +import org.apache.struts.action.ActionMapping; +import org.posterita.beans.ProductBean; +import org.posterita.struts.admin.OrganisationAction; +import org.posterita.struts.core.DefaultForm; +import org.posterita.struts.pos.POSGoodsAction; +import org.posterita.struts.pos.POSProductAction; + +public class POSProductForm extends DefaultForm +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public POSProductForm() + { + setBean(new ProductBean()); + } + + public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) + { + if(POSProductAction.VIEW_PRODUCT.equals(action) || POSProductAction.GET_CREATE_PRODUCT_FORM.equals(action)) + { + + } + else if (POSProductAction.CREATE_OR_UPDATE_PRODUCT.equals(action)) + { + addRequiredFields(new String[] {"productName","revenueRecognition","description"}); + } + else + { + addRequiredFields(new String[] {"productName","purchasePriceStandard","description","salesPriceStandard","salesPriceLimit","salesPriceList"}); + } + + return super.validate(mapping, request); + } +} diff --git a/posterita/posterita/src/main/org/posterita/form/POSReportForm.java b/posterita/posterita/src/main/org/posterita/form/POSReportForm.java new file mode 100644 index 0000000000..912dfdc0aa --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/POSReportForm.java @@ -0,0 +1,42 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Created on May 11, 2006 + */ + + +package org.posterita.form; + +import org.posterita.beans.POSReportBean; +import org.posterita.struts.core.DefaultForm; + + +public class POSReportForm extends DefaultForm +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public POSReportForm() + { + setBean(new POSReportBean()); + } + + } diff --git a/posterita/posterita/src/main/org/posterita/form/POSStockForm.java b/posterita/posterita/src/main/org/posterita/form/POSStockForm.java new file mode 100644 index 0000000000..9e976155ea --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/POSStockForm.java @@ -0,0 +1,42 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Created on May 8, 2006 + */ + + +package org.posterita.form; + +import org.posterita.beans.POSStockBean; +import org.posterita.struts.core.DefaultForm; + + +public class POSStockForm extends DefaultForm +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public POSStockForm() + { + setBean(new POSStockBean()); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/form/POSSupplierForm.java b/posterita/posterita/src/main/org/posterita/form/POSSupplierForm.java new file mode 100644 index 0000000000..7992f1ccc9 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/POSSupplierForm.java @@ -0,0 +1,42 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Created on May 8, 2006 + */ + + +package org.posterita.form; + +import org.posterita.beans.POSSupplierBean; +import org.posterita.struts.core.DefaultForm; + + +public class POSSupplierForm extends DefaultForm +{ + + /** + * + */ + private static final long serialVersionUID = 1L; + + public POSSupplierForm() + { + setBean(new POSSupplierBean()); + } +} diff --git a/posterita/posterita/src/main/org/posterita/form/PaymentAllocationForm.java b/posterita/posterita/src/main/org/posterita/form/PaymentAllocationForm.java new file mode 100644 index 0000000000..5dc9f3bede --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/PaymentAllocationForm.java @@ -0,0 +1,42 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Oct 30, 2006 + */ + + +package org.posterita.form; + +import org.posterita.beans.PaymentAllocationBean; +import org.posterita.struts.core.DefaultForm; + + +public class PaymentAllocationForm extends DefaultForm +{ + + /** + * + */ + private static final long serialVersionUID = 1L; + + public PaymentAllocationForm() + { + setBean( new PaymentAllocationBean()); + } + +} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/form/PaymentForm.java b/posterita/posterita/src/main/org/posterita/form/PaymentForm.java new file mode 100644 index 0000000000..f7c492fbf4 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/PaymentForm.java @@ -0,0 +1,38 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * 08-Dec-2006 14:08:03 by praveen + * + */ + +package org.posterita.form; + +import org.posterita.beans.PaymentBean; +import org.posterita.struts.core.DefaultForm; + +public class PaymentForm extends DefaultForm +{ + private static final long serialVersionUID = 1L; + + public PaymentForm() + { + setBean(new PaymentBean()); + addRequiredFields(new String[]{"amount", "allocateAmount"}); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/form/PaymentHistoryForm.java b/posterita/posterita/src/main/org/posterita/form/PaymentHistoryForm.java new file mode 100644 index 0000000000..da7e594264 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/PaymentHistoryForm.java @@ -0,0 +1,38 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Aug 15, 2005 by praveen + * + */ +package org.posterita.form; + +import org.posterita.beans.PaymentHistoryBean; +import org.posterita.struts.core.DefaultForm; + +public class PaymentHistoryForm extends DefaultForm +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public PaymentHistoryForm() + { + setBean(new PaymentHistoryBean()); + } +} diff --git a/posterita/posterita/src/main/org/posterita/form/PaymentTermForm.java b/posterita/posterita/src/main/org/posterita/form/PaymentTermForm.java new file mode 100644 index 0000000000..3f17a3610f --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/PaymentTermForm.java @@ -0,0 +1,61 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Nov 1, 2006 + */ + + +package org.posterita.form; + +import javax.servlet.http.HttpServletRequest; + +import org.apache.struts.action.ActionErrors; +import org.apache.struts.action.ActionMapping; + +import org.posterita.beans.PaymentTermBean; +import org.posterita.struts.core.DefaultForm; + + +public class PaymentTermForm extends DefaultForm +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public PaymentTermForm() + { + setBean(new PaymentTermBean()); + } + + public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) + { + //some custom validation + + if("true".equalsIgnoreCase(getFixedDueDate())) + { + addRequiredFields(new String[]{"paymentTermName","fixedMonthDay","fixedMonthOffset","fiedMonthCutoff"}); + } + else + { + addRequiredFields(new String[]{"paymentTermName","netDays"}); + } + + return super.validate(mapping, request); + } +} diff --git a/posterita/posterita/src/main/org/posterita/form/PaymentTermForm2.java b/posterita/posterita/src/main/org/posterita/form/PaymentTermForm2.java new file mode 100644 index 0000000000..92e81d4d56 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/PaymentTermForm2.java @@ -0,0 +1,42 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Dec 28, 2006 + */ + + +package org.posterita.form; + +import org.posterita.beans.PaymentTermBean; +import org.posterita.struts.core.DefaultForm; + + +public class PaymentTermForm2 extends DefaultForm +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public PaymentTermForm2() + { + setBean(new PaymentTermBean()); + } + + +} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/form/PriceCheckForm.java b/posterita/posterita/src/main/org/posterita/form/PriceCheckForm.java new file mode 100644 index 0000000000..50efbb09cc --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/PriceCheckForm.java @@ -0,0 +1,37 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + **/ + +package org.posterita.form; + +import org.posterita.struts.core.DefaultForm; + +public class PriceCheckForm extends DefaultForm +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public PriceCheckForm() + { + addRequiredFields(new String[]{"barCode"}); + } +} diff --git a/posterita/posterita/src/main/org/posterita/form/PriceListForm.java b/posterita/posterita/src/main/org/posterita/form/PriceListForm.java new file mode 100644 index 0000000000..6830c1878c --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/PriceListForm.java @@ -0,0 +1,54 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Aug 19, 2005 by praveen + * + */ +package org.posterita.form; + +import javax.servlet.http.HttpServletRequest; + +import org.apache.struts.action.ActionErrors; +import org.apache.struts.action.ActionMapping; +import org.posterita.beans.PriceListBean; +import org.posterita.struts.core.DefaultForm; +import org.posterita.struts.pos.PriceListAction; + +public class PriceListForm extends DefaultForm +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public PriceListForm() + { + setBean(new PriceListBean()); + } + + public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) + { + if(PriceListAction.CREATE_OR_UPDATE_PRICE_LIST.equalsIgnoreCase(action)) + { + addRequiredFields(new String[] {"name"}); + } + + return super.validate(mapping, request); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/form/ProductAttributeForm.java b/posterita/posterita/src/main/org/posterita/form/ProductAttributeForm.java new file mode 100644 index 0000000000..d52b076249 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/ProductAttributeForm.java @@ -0,0 +1,39 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Aug 1, 2005 by praveen + * + */ +package org.posterita.form; + +import org.posterita.beans.ProductAttributeBean; +import org.posterita.struts.core.DefaultForm; + +public class ProductAttributeForm extends DefaultForm +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public ProductAttributeForm() + { + setBean(new ProductAttributeBean()); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/form/ProductAttributeValueForm.java b/posterita/posterita/src/main/org/posterita/form/ProductAttributeValueForm.java new file mode 100644 index 0000000000..fb77ea3732 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/ProductAttributeValueForm.java @@ -0,0 +1,39 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Aug 1, 2005 by praveen + * + */ +package org.posterita.form; + +import org.posterita.beans.ProductAttributeBean; +import org.posterita.struts.core.DefaultForm; + +public class ProductAttributeValueForm extends DefaultForm +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public ProductAttributeValueForm() + { + setBean(new ProductAttributeBean()); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/form/ProductDetailInfoForm.java b/posterita/posterita/src/main/org/posterita/form/ProductDetailInfoForm.java new file mode 100644 index 0000000000..5450c915a6 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/ProductDetailInfoForm.java @@ -0,0 +1,40 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + **/ + +/** + @author ashley + */ + +package org.posterita.form; + +import org.posterita.beans.ProductDetailsBean; +import org.posterita.struts.core.DefaultForm; + +public class ProductDetailInfoForm extends DefaultForm +{ + private static final long serialVersionUID = 1L; + + public ProductDetailInfoForm() + { + this.setBean(new ProductDetailsBean()); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/form/ProductImageForm.java b/posterita/posterita/src/main/org/posterita/form/ProductImageForm.java new file mode 100644 index 0000000000..b756529f8a --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/ProductImageForm.java @@ -0,0 +1,39 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Mar 14, 2006 by praveen + * + */ +package org.posterita.form; + +import org.posterita.beans.ProductImageBean; +import org.posterita.struts.core.DefaultForm; + +public class ProductImageForm extends DefaultForm +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public ProductImageForm() + { + setBean(new ProductImageBean()); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/form/ProductKeywordsForm.java b/posterita/posterita/src/main/org/posterita/form/ProductKeywordsForm.java new file mode 100644 index 0000000000..31a9a5e036 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/ProductKeywordsForm.java @@ -0,0 +1,39 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +* Created on May 12, 2006 by ashley +* +*/ + +package org.posterita.form; + +import org.posterita.beans.ProductKeywordsBean; +import org.posterita.struts.core.DefaultForm; + +public class ProductKeywordsForm extends DefaultForm +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public ProductKeywordsForm() + { + setBean(new ProductKeywordsBean()); + } +} diff --git a/posterita/posterita/src/main/org/posterita/form/ProductRestrictionForm.java b/posterita/posterita/src/main/org/posterita/form/ProductRestrictionForm.java new file mode 100644 index 0000000000..78e03dc431 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/ProductRestrictionForm.java @@ -0,0 +1,38 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Aug 30, 2005 by praveen + * + */ +package org.posterita.form; + +import org.posterita.beans.ProductRestrictionBean; +import org.posterita.struts.core.DefaultForm; + +public class ProductRestrictionForm extends DefaultForm +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public ProductRestrictionForm() + { + setBean(new ProductRestrictionBean()); + } +} diff --git a/posterita/posterita/src/main/org/posterita/form/ProductSearchForm.java b/posterita/posterita/src/main/org/posterita/form/ProductSearchForm.java new file mode 100644 index 0000000000..15521f2867 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/ProductSearchForm.java @@ -0,0 +1,41 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +* Created on May 17, 2006 by ashley +* +*/ + +package org.posterita.form; + +import org.posterita.beans.ProductSearchBean; +import org.posterita.struts.core.DefaultForm; + +public class ProductSearchForm extends DefaultForm +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public ProductSearchForm() + { + //this.setIsActive("true"); + //this.setIsWebstoreFeatured("true"); + setBean(new ProductSearchBean()); + } +} diff --git a/posterita/posterita/src/main/org/posterita/form/ProductStatusForm.java b/posterita/posterita/src/main/org/posterita/form/ProductStatusForm.java new file mode 100644 index 0000000000..3d60c8af3a --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/ProductStatusForm.java @@ -0,0 +1,38 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Feb 9, 2006 by praveen + * + */ +package org.posterita.form; + +import org.posterita.beans.ProductStatusBean; +import org.posterita.struts.core.DefaultForm; + +public class ProductStatusForm extends DefaultForm +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public ProductStatusForm() + { + setBean(new ProductStatusBean()); + } +} diff --git a/posterita/posterita/src/main/org/posterita/form/RemoveSessionForm.java b/posterita/posterita/src/main/org/posterita/form/RemoveSessionForm.java new file mode 100644 index 0000000000..6aeabffa14 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/RemoveSessionForm.java @@ -0,0 +1,42 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Jan 26, 2007 + */ + + +package org.posterita.form; + +import org.posterita.beans.RemoveSessionBean; +import org.posterita.struts.core.DefaultForm; + + + +public class RemoveSessionForm extends DefaultForm +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public RemoveSessionForm() + { + setBean(new RemoveSessionBean()); + } + +} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/form/ReportForm.java b/posterita/posterita/src/main/org/posterita/form/ReportForm.java new file mode 100644 index 0000000000..856209ec8e --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/ReportForm.java @@ -0,0 +1,53 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +package org.posterita.form; + +import javax.servlet.http.HttpServletRequest; + +import org.apache.struts.action.ActionErrors; +import org.apache.struts.action.ActionMapping; +import org.posterita.beans.ReportBean; +import org.posterita.struts.core.DefaultForm; +import org.posterita.struts.pos.POSReportAction; + + +public class ReportForm extends DefaultForm +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public ReportForm() + { + //initForm(); + setBean(new ReportBean()); + } + + public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) + { + if (!POSReportAction.GET_STOCK_SALES_REPORT.equals(action) && !POSReportAction.CLEAR_STOCK_SALES_REPORT.equals(action)) + { + addRequiredFields(new String[]{"fromDate", "toDate"}); + } + + return super.validate(mapping, request); + } +} diff --git a/posterita/posterita/src/main/org/posterita/form/ReportImageForm.java b/posterita/posterita/src/main/org/posterita/form/ReportImageForm.java new file mode 100644 index 0000000000..3d8f00dc34 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/ReportImageForm.java @@ -0,0 +1,38 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +package org.posterita.form; + +import org.posterita.beans.ReportImageBean; +import org.posterita.struts.core.DefaultForm; + + +public class ReportImageForm extends DefaultForm +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public ReportImageForm() + { + setBean(new ReportImageBean()); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/form/ReportSummaryHistoryForm.java b/posterita/posterita/src/main/org/posterita/form/ReportSummaryHistoryForm.java new file mode 100644 index 0000000000..4297ae1311 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/ReportSummaryHistoryForm.java @@ -0,0 +1,40 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +* +* Created on Sep 11, 2006 by ashley +* +*/ + +/** + @author ashley + */ + +package org.posterita.form; + +import org.posterita.struts.core.DefaultForm; + +public class ReportSummaryHistoryForm extends DefaultForm +{ + + /** + * + */ + private static final long serialVersionUID = 1L; + +} diff --git a/posterita/posterita/src/main/org/posterita/form/RoleForm.java b/posterita/posterita/src/main/org/posterita/form/RoleForm.java new file mode 100644 index 0000000000..bec770dac5 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/RoleForm.java @@ -0,0 +1,56 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Aug 16, 2005 by praveen + * + */ +package org.posterita.form; + +import javax.servlet.http.HttpServletRequest; + +import org.apache.struts.action.ActionErrors; +import org.apache.struts.action.ActionMapping; +import org.posterita.beans.RoleBean; +import org.posterita.struts.admin.OrganisationAction; +import org.posterita.struts.core.DefaultForm; +import org.posterita.struts.pos.POSReportAction; +import org.posterita.struts.pos.POSRoleAction; + +public class RoleForm extends DefaultForm +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public RoleForm() + { + setBean(new RoleBean()); + } + + + public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) + { + if(POSRoleAction.CREATE_ROLE.equals(action) || POSRoleAction.EDIT_ROLE.equals(action)) + { + addRequiredFields(new String[]{"name"}); + } + + return super.validate(mapping, request); + } +} diff --git a/posterita/posterita/src/main/org/posterita/form/SalesAnalysisReportForm.java b/posterita/posterita/src/main/org/posterita/form/SalesAnalysisReportForm.java new file mode 100644 index 0000000000..a13a3b9c26 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/SalesAnalysisReportForm.java @@ -0,0 +1,39 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * 14-Jul-2006 13:57:30 by praveen + * + */ + +package org.posterita.form; + +import org.posterita.beans.SalesAnalysisReportBean; +import org.posterita.struts.core.DefaultForm; + +public class SalesAnalysisReportForm extends DefaultForm +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public SalesAnalysisReportForm() + { + setBean(new SalesAnalysisReportBean()); + } +} diff --git a/posterita/posterita/src/main/org/posterita/form/SalesDetailsForm.java b/posterita/posterita/src/main/org/posterita/form/SalesDetailsForm.java new file mode 100644 index 0000000000..7bc6763b2f --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/SalesDetailsForm.java @@ -0,0 +1,39 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +package org.posterita.form; + +import org.posterita.beans.SalesDetailsBean; +import org.posterita.struts.core.DefaultForm; + + +public class SalesDetailsForm extends DefaultForm +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public SalesDetailsForm() + { + //initForm(); + setBean(new SalesDetailsBean()); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/form/SalesReportForm.java b/posterita/posterita/src/main/org/posterita/form/SalesReportForm.java new file mode 100644 index 0000000000..bf61183015 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/SalesReportForm.java @@ -0,0 +1,39 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +package org.posterita.form; + +import org.posterita.beans.ReportBean; +import org.posterita.struts.core.DefaultForm; + + +public class SalesReportForm extends DefaultForm +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public SalesReportForm() + { + //initForm(); + setBean(new ReportBean()); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/form/SearchProductForm.java b/posterita/posterita/src/main/org/posterita/form/SearchProductForm.java new file mode 100644 index 0000000000..910b99de31 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/SearchProductForm.java @@ -0,0 +1,39 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +* Created on Apr 27, 2006 by ashley +* +*/ + +package org.posterita.form; + +import org.posterita.beans.StockBean; +import org.posterita.struts.core.DefaultForm; + +public class SearchProductForm extends DefaultForm +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public SearchProductForm() + { + setBean(new StockBean()); + } +} diff --git a/posterita/posterita/src/main/org/posterita/form/SellingItemForm.java b/posterita/posterita/src/main/org/posterita/form/SellingItemForm.java new file mode 100644 index 0000000000..94926e8bb6 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/SellingItemForm.java @@ -0,0 +1,35 @@ +/** + * + * Copyright (c) 2008 Posterita. All Rights Reserved. + * + * This software is the confidential and proprietary information of + * Posterita. ("Confidential Information"). You shall not + * disclose such Confidential Information and shall use it only in + * accordance with the terms of the license agreement you entered into + * with Posterita. + * + * POSTERITA MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE + * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT + * NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR + * A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. TAMAK ICT SHALL NOT + * BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, + * MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. + * + * 16 Jan 2008 13:10:40 by shameem + * + */ + +package org.posterita.form; + +import org.posterita.beans.ReportBean; +import org.posterita.struts.core.DefaultForm; + +public class SellingItemForm extends DefaultForm +{ + private static final long serialVersionUID = 1L; + + public SellingItemForm() + { + setBean(new ReportBean()); + } +} diff --git a/posterita/posterita/src/main/org/posterita/form/SetApplicationParametersForm.java b/posterita/posterita/src/main/org/posterita/form/SetApplicationParametersForm.java new file mode 100644 index 0000000000..3645e1cbc7 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/SetApplicationParametersForm.java @@ -0,0 +1,37 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * */ +package org.posterita.form; + +import org.posterita.beans.ApplicationParametersBean; +import org.posterita.struts.core.DefaultForm; + + +public class SetApplicationParametersForm extends DefaultForm +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public SetApplicationParametersForm() + { + setBean(new ApplicationParametersBean()); + } +} diff --git a/posterita/posterita/src/main/org/posterita/form/SingleDateFilterForm.java b/posterita/posterita/src/main/org/posterita/form/SingleDateFilterForm.java new file mode 100644 index 0000000000..7f1a64ce5e --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/SingleDateFilterForm.java @@ -0,0 +1,44 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Nov 7, 2006 + */ + + +package org.posterita.form; + +import org.posterita.beans.ReportBean; +import org.posterita.struts.core.DefaultForm; + + +public class SingleDateFilterForm extends DefaultForm +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public SingleDateFilterForm() + { + //initForm(); + setBean(new ReportBean()); + addRequiredFields(new String[]{"fromDate"}); + + } + +} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/form/StockEnquiryForm.java b/posterita/posterita/src/main/org/posterita/form/StockEnquiryForm.java new file mode 100644 index 0000000000..f970b739bb --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/StockEnquiryForm.java @@ -0,0 +1,36 @@ +/** + * + * Copyright (c) 2008 Posterita. All Rights Reserved. + * + * This software is the confidential and proprietary information of + * Posterita. ("Confidential Information"). You shall not + * disclose such Confidential Information and shall use it only in + * accordance with the terms of the license agreement you entered into + * with Posterita. + * + * POSTERITA MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE + * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT + * NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR + * A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. TAMAK ICT SHALL NOT + * BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, + * MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. + * + * 16 Jan 2008 13:12:10 by shameem + * + */ + +package org.posterita.form; + +import org.posterita.beans.ReportBean; +import org.posterita.struts.core.DefaultForm; + +public class StockEnquiryForm extends DefaultForm +{ + + private static final long serialVersionUID = 1L; + + public StockEnquiryForm() + { + setBean(new ReportBean()); + } +} diff --git a/posterita/posterita/src/main/org/posterita/form/StockForm.java b/posterita/posterita/src/main/org/posterita/form/StockForm.java new file mode 100644 index 0000000000..1b83cd5022 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/StockForm.java @@ -0,0 +1,38 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ +package org.posterita.form; + +import org.posterita.beans.StockBean; +import org.posterita.struts.core.DefaultForm; + + +public class StockForm extends DefaultForm +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public StockForm() + { + setBean(new StockBean()); + addRequiredFields(new String[] {"checkbox"}); + } +} diff --git a/posterita/posterita/src/main/org/posterita/form/StockMovementForm.java b/posterita/posterita/src/main/org/posterita/form/StockMovementForm.java new file mode 100644 index 0000000000..b2bf7f0c8f --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/StockMovementForm.java @@ -0,0 +1,15 @@ +package org.posterita.form; + +import org.posterita.beans.StockMovementBean; +import org.posterita.struts.core.DefaultForm; + +public class StockMovementForm extends DefaultForm +{ + private static final long serialVersionUID = 1L; + + public StockMovementForm() + { + setBean(new StockMovementBean()); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/form/SynchronizeCollectionsForm.java b/posterita/posterita/src/main/org/posterita/form/SynchronizeCollectionsForm.java new file mode 100644 index 0000000000..b3dcb5654a --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/SynchronizeCollectionsForm.java @@ -0,0 +1,38 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + **/ +/** + @author ashley + */ + +package org.posterita.form; + +import org.posterita.beans.SynchronizeCollectionBean; +import org.posterita.struts.core.DefaultForm; + +public class SynchronizeCollectionsForm extends DefaultForm +{ + private static final long serialVersionUID = 1L; + + public SynchronizeCollectionsForm() + { + this.setBean(new SynchronizeCollectionBean()); + } +} diff --git a/posterita/posterita/src/main/org/posterita/form/TaxForm.java b/posterita/posterita/src/main/org/posterita/form/TaxForm.java new file mode 100644 index 0000000000..c4c8b5869c --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/TaxForm.java @@ -0,0 +1,41 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Nov 28, 2006 + */ + + +package org.posterita.form; + +import org.posterita.beans.TaxBean; +import org.posterita.struts.core.DefaultForm; + + +public class TaxForm extends DefaultForm +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public TaxForm() + { + setBean(new TaxBean()); + // addRequiredFields(new String[] {"taxName","taxRate"}); + } +} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/form/TerminalForm.java b/posterita/posterita/src/main/org/posterita/form/TerminalForm.java new file mode 100644 index 0000000000..207fa000ce --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/TerminalForm.java @@ -0,0 +1,50 @@ +/****************************************************************************** + * Product: Posterita Web-Based POS and Adempiere Plugin * + * Copyright (C) 2008 Posterita Ltd * + * This file is part of POSterita * + * * + * POSterita is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * + *****************************************************************************/ +package org.posterita.form; + +import javax.servlet.http.HttpServletRequest; + +import org.apache.struts.action.ActionErrors; +import org.apache.struts.action.ActionMapping; +import org.posterita.beans.TerminalBean; +import org.posterita.struts.core.DefaultForm; +import org.posterita.struts.pos.TerminalAction; + +/** + * @author Ashley G Ramdass + * Apr 14, 2008 + */ +public class TerminalForm extends DefaultForm +{ + public TerminalForm() + { + super.setBean(new TerminalBean()); + } + + public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) + { + if(TerminalAction.CREATE_TERMINAL.equals(action) || TerminalAction.SAVE_TERMINAL.equals(action)) + { + addRequiredFields(new String[]{"name", "orgId", "bpartnerId", "purchasePriceListId", "salesPriceListId", "warehouseId", "cashBookId", "cardBankAccountId", "checkBankAccountId", "cashbookTransferType"}); + } + + return super.validate(mapping, request); + } +} diff --git a/posterita/posterita/src/main/org/posterita/form/UOMForm.java b/posterita/posterita/src/main/org/posterita/form/UOMForm.java new file mode 100644 index 0000000000..63674fa7d0 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/UOMForm.java @@ -0,0 +1,8 @@ +package org.posterita.form; + +import org.posterita.struts.core.DefaultForm; + +public class UOMForm extends DefaultForm +{ + +} diff --git a/posterita/posterita/src/main/org/posterita/form/UserForm.java b/posterita/posterita/src/main/org/posterita/form/UserForm.java new file mode 100644 index 0000000000..2ef8dcbd50 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/UserForm.java @@ -0,0 +1,60 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +package org.posterita.form; + +import javax.servlet.http.HttpServletRequest; + +import org.apache.struts.action.ActionErrors; +import org.apache.struts.action.ActionMapping; +import org.posterita.Constants; +import org.posterita.beans.UserBean; +import org.posterita.struts.core.DefaultForm; +import org.posterita.struts.login.LoginAction; + + +public class UserForm extends DefaultForm +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public UserForm() + { + setBean(new UserBean()); + + } + + public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) + { + if(Constants.PASSWORD.equals(action)) + { + addRequiredFields(new String[]{"username"}); + } + else + { + addRequiredFields(new String[]{"password", "confirmPassword","userPIN", "orgId"}); + addMatchFields("password","confirmPassword"); + } + + return super.validate(mapping, request); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/form/UserRegistrationForm.java b/posterita/posterita/src/main/org/posterita/form/UserRegistrationForm.java new file mode 100644 index 0000000000..02003363bb --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/UserRegistrationForm.java @@ -0,0 +1,52 @@ +/* + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Servansingh + * */ + +package org.posterita.form; + +import javax.servlet.http.HttpServletRequest; +import org.apache.struts.action.ActionErrors; +import org.apache.struts.action.ActionMapping; +import org.posterita.beans.UserBean; +import org.posterita.struts.core.DefaultForm; +import org.posterita.struts.user.UserRegistrationAction; + + + +public class UserRegistrationForm extends DefaultForm +{ + private static final long serialVersionUID = 1L; + + public UserRegistrationForm() + { + setBean(new UserBean()); + } + + public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) + { + if(UserRegistrationAction.REGISTER_USER.equals(action)) + { + addRequiredFields(new String[]{"name", "userSurname", "address1","city", "email"}); + } + + return super.validate(mapping, request); + } +} diff --git a/posterita/posterita/src/main/org/posterita/form/VendorForm.java b/posterita/posterita/src/main/org/posterita/form/VendorForm.java new file mode 100644 index 0000000000..d728dea7de --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/VendorForm.java @@ -0,0 +1,19 @@ +package org.posterita.form; + +import org.posterita.beans.VendorBean; +import org.posterita.struts.core.DefaultForm; + +public class VendorForm extends DefaultForm +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public VendorForm() + { + setBean(new VendorBean()); + addRequiredFields(new String[]{"partnerName"}); + + } +} diff --git a/posterita/posterita/src/main/org/posterita/form/ViewBPartnerForm.java b/posterita/posterita/src/main/org/posterita/form/ViewBPartnerForm.java new file mode 100644 index 0000000000..d1efc12b0a --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/ViewBPartnerForm.java @@ -0,0 +1,38 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Aug 22, 2005 by din + */ + +package org.posterita.form; + +import org.posterita.beans.BPartnerBean; +import org.posterita.struts.core.DefaultForm; + +public class ViewBPartnerForm extends DefaultForm +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public ViewBPartnerForm() + { + setBean(new BPartnerBean()); + } +} diff --git a/posterita/posterita/src/main/org/posterita/form/ViewProductForm.java b/posterita/posterita/src/main/org/posterita/form/ViewProductForm.java new file mode 100644 index 0000000000..e8b0280e9f --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/ViewProductForm.java @@ -0,0 +1,40 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Jul 17, 2006 + */ + + +package org.posterita.form; + +import org.posterita.beans.ProductBean; +import org.posterita.struts.core.DefaultForm; + + +public class ViewProductForm extends DefaultForm +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public ViewProductForm() + { + setBean(new ProductBean()); + } +} diff --git a/posterita/posterita/src/main/org/posterita/form/ViewTaxForm.java b/posterita/posterita/src/main/org/posterita/form/ViewTaxForm.java new file mode 100644 index 0000000000..bb83285f8d --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/form/ViewTaxForm.java @@ -0,0 +1,40 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Nov 30, 2006 + */ + + +package org.posterita.form; + +import org.posterita.beans.TaxBean; +import org.posterita.struts.core.DefaultForm; + + +public class ViewTaxForm extends DefaultForm +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public ViewTaxForm() + { + setBean(new TaxBean()); + } +} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/formatter/ArrayListFormatter.java b/posterita/posterita/src/main/org/posterita/formatter/ArrayListFormatter.java new file mode 100644 index 0000000000..d5804b57dd --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/formatter/ArrayListFormatter.java @@ -0,0 +1,51 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 26-Aug-2005 by alok + * + */ + +package org.posterita.formatter; + +import java.util.ArrayList; + + +public class ArrayListFormatter extends Formatter +{ + + public Object format(Object target) + { + if (target == null) + return new ArrayList(); + + return target; + } + + public Object unformat(Object target) + { + ArrayList temp = (ArrayList) target; + + if (target == null || temp.size() == 0 ) + return null; + + return target; + } + + + +} diff --git a/posterita/posterita/src/main/org/posterita/formatter/BigDecimalArrayFormatter.java b/posterita/posterita/src/main/org/posterita/formatter/BigDecimalArrayFormatter.java new file mode 100644 index 0000000000..64ff52d949 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/formatter/BigDecimalArrayFormatter.java @@ -0,0 +1,49 @@ +package org.posterita.formatter; + +import java.math.BigDecimal; + +public class BigDecimalArrayFormatter extends Formatter +{ + // return String[] + public Object format(Object value) + { + if (value == null) + return new String[]{}; + + BigDecimal values[] = (BigDecimal[])value; + + String retVal[] = new String[values.length]; + + for (int i = 0; i < values.length; i++) + { + retVal[i] = values[i].toPlainString(); + } + + return retVal; + } + + // return BigDecimal[] + public Object unformat(Object object) + { + if (object == null) + { + return null; + } + + String values[] = (String[])object; + + if (values.length == 0) + { + return null; + } + + BigDecimal retVal[] = new BigDecimal[values.length]; + + for (int i = 0; i < values.length; i++) + { + retVal[i] = new BigDecimal(values[i]); + } + + return retVal; + } +} diff --git a/posterita/posterita/src/main/org/posterita/formatter/BigDecimalFormatter.java b/posterita/posterita/src/main/org/posterita/formatter/BigDecimalFormatter.java new file mode 100644 index 0000000000..643787eb65 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/formatter/BigDecimalFormatter.java @@ -0,0 +1,57 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * 18-Aug-2006 16:45:26 by praveen + * + */ + +package org.posterita.formatter; + +import java.math.BigDecimal; + +public class BigDecimalFormatter extends Formatter +{ + + //converts a BigDecimal to String + public Object format(Object value) + { + if(value == null) + { + return ""; + } + + BigDecimal valuebd = (BigDecimal) value; + + BigDecimal db = valuebd.setScale(4, BigDecimal.ROUND_HALF_UP); + + return db.toString(); + } + + //converts a String to BigDecimal + public Object unformat(Object object) + { + String string = (String) object; + if(string == null || string.trim().length() <1) + return null; + + BigDecimal bd = new BigDecimal(string).setScale(4, BigDecimal.ROUND_HALF_UP); + + return bd; + } + +} diff --git a/posterita/posterita/src/main/org/posterita/formatter/BooleanArrayFormatter.java b/posterita/posterita/src/main/org/posterita/formatter/BooleanArrayFormatter.java new file mode 100644 index 0000000000..5135e61d21 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/formatter/BooleanArrayFormatter.java @@ -0,0 +1,49 @@ +package org.posterita.formatter; + + +public class BooleanArrayFormatter extends Formatter +{ + + public Object format(Object value) + { + if (value == null) + return new String[]{}; + + Boolean values[] = (Boolean[])value; + + String retVal[] = new String[values.length]; + + for (int i = 0; i < values.length; i++) + { + retVal[i] = values[i].toString(); + } + + return retVal; + } + + // return Boolean[] + public Object unformat(Object object) + { + if (object == null) + { + return null; + } + + String values[] = (String[])object; + + if (values.length == 0) + { + return null; + } + + Boolean retVal[] = new Boolean[values.length]; + + for (int i = 0; i < values.length; i++) + { + retVal[i] = new Boolean(values[i]); + } + + return retVal; + } + +} diff --git a/posterita/posterita/src/main/org/posterita/formatter/BooleanFormatter.java b/posterita/posterita/src/main/org/posterita/formatter/BooleanFormatter.java new file mode 100644 index 0000000000..69221d258e --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/formatter/BooleanFormatter.java @@ -0,0 +1,50 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 26-Jul-2005 by alok + * + */ +package org.posterita.formatter; + + +public class BooleanFormatter extends Formatter +{ + + //converts Boolean to String + public Object format(Object target) + { + if (target == null) + return Boolean.toString(false); + + Boolean bool = (Boolean) target; + return bool.toString(); + } + + //convert String to Boolean + public Object unformat(Object target) + { + String string = (String) target; + + if(string == null || string.trim().length() <1) + return Boolean.valueOf(false); + + return Boolean.valueOf(string); + + } + +} diff --git a/posterita/posterita/src/main/org/posterita/formatter/DefaultFormatter.java b/posterita/posterita/src/main/org/posterita/formatter/DefaultFormatter.java new file mode 100644 index 0000000000..2bde2bb1bc --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/formatter/DefaultFormatter.java @@ -0,0 +1,42 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 26-Aug-2005 by alok + * + */ + +package org.posterita.formatter; + + +public class DefaultFormatter extends Formatter +{ + + public Object format(Object target) + { + if (target == null) + return ""; + else + return target.toString(); + } + + public Object unformat(Object target) + { + return target; + } + +} diff --git a/posterita/posterita/src/main/org/posterita/formatter/DoubleFormatter.java b/posterita/posterita/src/main/org/posterita/formatter/DoubleFormatter.java new file mode 100644 index 0000000000..5329fbe5c1 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/formatter/DoubleFormatter.java @@ -0,0 +1,48 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 26-Aug-2005 by alok + * + */ +package org.posterita.formatter; + + +public class DoubleFormatter extends Formatter +{ + + public Object format(Object value) + { + if (value == null) + return ""; + + Double dbl = (Double) value; + return dbl.toString(); + + + } + + public Object unformat(Object object) + { + String string = (String) object; + if(string == null || string.trim().length() <1) + return null; + + return new Double(string); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/formatter/Formatter.java b/posterita/posterita/src/main/org/posterita/formatter/Formatter.java new file mode 100644 index 0000000000..5d806a317f --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/formatter/Formatter.java @@ -0,0 +1,76 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 26-Aug-2005 by alok + * + */ +package org.posterita.formatter; + +import java.math.BigDecimal; +import java.util.ArrayList; + +import org.posterita.core.JulianDate; +import org.posterita.core.SimpleCalendarDate; +import org.posterita.exceptions.FormattingException; + + +public abstract class Formatter +{ + + public String getErrorKey() + { + return "error.key"; + } + + public static Formatter getFormatter(Class type) + { + if (type == null) + return new DefaultFormatter(); + if (String.class.isAssignableFrom(type)) + return new StringFormatter(); + if (Integer.class.isAssignableFrom(type)) + return new IntegerFormatter(); + if (Long.class.isAssignableFrom(type)) + return new LongFormatter(); + if (ArrayList.class.isAssignableFrom(type)) + return new ArrayListFormatter(); + if (Double.class.isAssignableFrom(type)) + return new DoubleFormatter(); + if (String[].class.isAssignableFrom(type)) + return new StringArrayFormatter(); + if (JulianDate.class.isAssignableFrom(type)) + return new JulianDateFormatter(); + if (SimpleCalendarDate.class.isAssignableFrom(type)) + return new SimpleCalendarDateFormatter(); + if (Boolean.class.isAssignableFrom(type)) + return new BooleanFormatter(); + if (Boolean[].class.isAssignableFrom(type)) + return new BooleanArrayFormatter(); + if (BigDecimal.class.isAssignableFrom(type)) + return new BigDecimalFormatter(); + if (BigDecimal[].class.isAssignableFrom(type)) + return new BigDecimalArrayFormatter(); + + return new DefaultFormatter(); + } + + public abstract Object format(Object target) throws FormattingException; + + public abstract Object unformat(Object target) throws FormattingException; + +} diff --git a/posterita/posterita/src/main/org/posterita/formatter/IntegerFormatter.java b/posterita/posterita/src/main/org/posterita/formatter/IntegerFormatter.java new file mode 100644 index 0000000000..13a4f77767 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/formatter/IntegerFormatter.java @@ -0,0 +1,56 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 26-Aug-2005 by alok + * + */ +package org.posterita.formatter; + + +public class IntegerFormatter extends Formatter +{ + + public Object format(Object value) + { + if (value == null) + return ""; + + Integer integer = (Integer) value; + + return integer.toString(); + } + + public Object unformat(Object value) throws NumberFormatException + { + if (value != null) + { + String string = value.toString(); + + if (string.trim().length() <1) + { + return null; + } + return Integer.valueOf(string); + } + else + { + return value; + } + } + +} diff --git a/posterita/posterita/src/main/org/posterita/formatter/JulianDateFormatter.java b/posterita/posterita/src/main/org/posterita/formatter/JulianDateFormatter.java new file mode 100644 index 0000000000..6179d6ba17 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/formatter/JulianDateFormatter.java @@ -0,0 +1,82 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 26-Aug-2005 by alok + * + */ + +package org.posterita.formatter; + +import java.text.DateFormat; +import java.text.ParseException; +import java.util.Date; + +import org.posterita.core.JulianDate; + + +public class JulianDateFormatter extends Formatter +{ + public Object format(Object value) + { + if (value==null) + return ""; + + JulianDate julianDate = (JulianDate) value; + + DateFormat mediumDF = DateFormat.getDateInstance(DateFormat.MEDIUM); + + String string = mediumDF.format(julianDate.getJavaDate()); + + return string; + } + + + + /* (non-Javadoc) + * @see com.shortletting.formatter.Formatter#unformat(java.lang.Object) + */ + public Object unformat(Object target) + { + if (target == null) + return null; + String value = (String) target; + + DateFormat mediumDF = DateFormat.getDateInstance(DateFormat.MEDIUM); + + Date date = new Date(); + + try + { + date = mediumDF.parse(value); + } + catch (ParseException e) + { + //throw new RunTimeException("Fatal Error converting dates"); + /* + * @TODO silent exception needs to be logged. + */ + e.printStackTrace(); + } + + JulianDate julDate = new JulianDate(date); + + return julDate; + } + + +} diff --git a/posterita/posterita/src/main/org/posterita/formatter/LongFormatter.java b/posterita/posterita/src/main/org/posterita/formatter/LongFormatter.java new file mode 100644 index 0000000000..71ea4d7ae9 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/formatter/LongFormatter.java @@ -0,0 +1,48 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 26-Aug-2005 by alok + * + */ +package org.posterita.formatter; + + +public class LongFormatter extends Formatter +{ + + public Object format(Object value) + { + if (value == null) + return ""; + + Long dbl = (Long) value; + return dbl.toString(); + + + } + + public Object unformat(Object object) + { + String string = (String) object; + if(string == null || string.trim().length() <1) + return null; + + return new Long(string); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/formatter/PriceFormatter.java b/posterita/posterita/src/main/org/posterita/formatter/PriceFormatter.java new file mode 100644 index 0000000000..a785f63a8b --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/formatter/PriceFormatter.java @@ -0,0 +1,42 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +* Created on Feb 3, 2006 by ashley +* +*/ + +package org.posterita.formatter; + +import java.math.BigDecimal; +import java.text.DecimalFormat; + +public class PriceFormatter +{ + + + public static String format(BigDecimal price, String priceFormat) + { + DecimalFormat format = new DecimalFormat(priceFormat); + + double dblPrice = price.doubleValue(); + + String strPrice = format.format(dblPrice); + + return strPrice; + } +} diff --git a/posterita/posterita/src/main/org/posterita/formatter/PrintFormatter.java b/posterita/posterita/src/main/org/posterita/formatter/PrintFormatter.java new file mode 100644 index 0000000000..737d037120 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/formatter/PrintFormatter.java @@ -0,0 +1,70 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Aug 24, 2006 + */ + + +package org.posterita.formatter; + +import java.util.Properties; + +import org.compiere.model.MAttributeInstance; +import org.compiere.model.MAttributeValue; +import org.compiere.model.MProduct; + + +public class PrintFormatter extends Formatter +{ + + public Object format(Object target) + { + if(target==null) + return null; + + MProduct product = (MProduct)target; + int attributeSetInstanceId = product.getM_AttributeSetInstance_ID(); + Properties ctx = product.getCtx(); + + String whereClause="AD_CLIENT_ID="+product.getAD_Client_ID()+" and M_ATTRIBUTESETINSTANCE_ID="+attributeSetInstanceId; + int [] attributeValuesIds = MAttributeInstance.getAllIDs(MAttributeInstance.Table_Name,whereClause,null); + + MAttributeValue attrValue=null; + + String productName=""; + + for(int i=0;i keyNamePairs = new ArrayList(); + + int ad_client_id = Env.getAD_Client_ID(ctx); + + String sql = "select attrIns.m_attributevalue_id,attrVal.name ATTRIBUTE_VALUE " + + "from M_PRODUCT prod,M_ATTRIBUTEINSTANCE attrIns ,M_attribute attr,M_attributeValue attrVal " + + "where prod.M_ATTRIBUTESETINSTANCE_id = attrIns.M_ATTRIBUTESETINSTANCE_id " + + "and attr.m_attribute_id = attrIns.m_attribute_id " + + "and attrIns.m_attributevalue_id = attrVal.m_attributevalue_id " + + "and attr.name = '" + attributeName + "' " + + "and attr.AD_CLIENT_ID = " + ad_client_id; + + PreparedStatement pstmt = null; + + System.out.println("Query for attributeValueKeyNamePair : " + sql); + + try + { + pstmt = DB.prepareStatement(sql, null); + ResultSet rs = pstmt.executeQuery(); + KeyNamePair pair = null; + + + while(rs.next()) + { + pair = new KeyNamePair(rs.getInt(1),rs.getString(2)); + keyNamePairs.add(pair); + } + + rs.close(); + } + catch (SQLException e) + { + throw new SystemException(e); + } + finally + { + try + { + pstmt.close(); + } + catch (Exception ex) + { + } + + pstmt = null; + } + + return keyNamePairs; + } +} diff --git a/posterita/posterita/src/main/org/posterita/keyname/BPartnerKeyNamePair.java b/posterita/posterita/src/main/org/posterita/keyname/BPartnerKeyNamePair.java new file mode 100644 index 0000000000..ddae3243c3 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/keyname/BPartnerKeyNamePair.java @@ -0,0 +1,52 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Oct 6, 2005 by praveen + * + */ +package org.posterita.keyname; + +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.Properties; + +import org.compiere.model.MBPartner; +import org.compiere.util.Env; + +import org.posterita.core.KeyNamePairUtil; +import org.posterita.exceptions.OperationException; + + +public class BPartnerKeyNamePair extends KeyNamePairUtil +{ + public static ArrayList getKeyNamePairs(Properties ctx) throws OperationException + { + String sql = "ad_client_id=" + Env.getAD_Client_ID(ctx) + " and ad_org_id=" + Env.getAD_Org_ID(ctx) + " and isactive = 'Y'"; + + try + { + return getData(ctx, MBPartner.Table_Name, sql); + } + catch (SQLException e) + { + throw new OperationException(e.getMessage()); + } + } + +} + diff --git a/posterita/posterita/src/main/org/posterita/keyname/BankKeyNamePair.java b/posterita/posterita/src/main/org/posterita/keyname/BankKeyNamePair.java new file mode 100644 index 0000000000..e2e209e727 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/keyname/BankKeyNamePair.java @@ -0,0 +1,48 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ +package org.posterita.keyname; + +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.Properties; + +import org.compiere.util.Env; + +import org.posterita.core.KeyNamePairUtil; +import org.posterita.exceptions.OperationException; +import org.posterita.model.MBank; + + +public class BankKeyNamePair extends KeyNamePairUtil +{ + public static ArrayList getKeyNamePairs(Properties ctx) throws OperationException + { + String sql = "ad_client_id=" + Env.getAD_Client_ID(ctx) + " and ad_org_id=" + Env.getAD_Org_ID(ctx) + " and isactive = 'Y'"; + + try + { + return getData(ctx, MBank.Table_Name, sql); + } + catch (SQLException e) + { + throw new OperationException(e.getMessage()); + } + } +} diff --git a/posterita/posterita/src/main/org/posterita/keyname/CBPartnerKeyNamePair.java b/posterita/posterita/src/main/org/posterita/keyname/CBPartnerKeyNamePair.java new file mode 100644 index 0000000000..7e93c70cf0 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/keyname/CBPartnerKeyNamePair.java @@ -0,0 +1,108 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Oct 6, 2005 by praveen + * + */ +package org.posterita.keyname; + +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.Properties; + +import org.compiere.model.MOrg; +import org.compiere.util.DB; +import org.compiere.util.Env; +import org.compiere.util.KeyNamePair; + +import org.posterita.exceptions.SystemException; + + +public class CBPartnerKeyNamePair +{ + public static ArrayList getKeyNamePairs(Properties ctx) throws SystemException + { + ArrayList bpList = new ArrayList(); + + int ad_client_id = Env.getAD_Client_ID(ctx); + int ad_org_id = Env.getAD_Org_ID(ctx); + + MOrg org = new MOrg(ctx,ad_org_id,null); + + String orgType = ""; + + /* if(org.isAutomobile()) + { + orgType = " and isAutomobile = 'Y'"; + } + else + { + orgType = " and isMotorcycle = 'Y'"; + }*/ + + String sql = "select bp.C_BPARTNER_ID,bp.NAME" + + " from AD_ORG org, C_BPARTNER bp" + + " where org.AD_CLIENT_ID = " + ad_client_id + + " and org.isRetailer = 'Y'" + + " and org.AD_CLIENT_ID = bp.AD_CLIENT_ID" + + " and org.AD_ORG_ID = bp.AD_ORG_ID" + + " and bp.isactive = 'Y'"; + + sql = sql + orgType; + + PreparedStatement pstmt = null; + + pstmt = DB.prepareStatement(sql,null); + ResultSet rs; + KeyNamePair pair = null; + + try + { + rs = pstmt.executeQuery(); + + while (rs.next()) + { + pair = new KeyNamePair(rs.getInt(1),rs.getString(2)); + bpList.add(pair); + } + + rs.close(); + } + catch (SQLException e) + { + throw new SystemException(e.getMessage()); + } + finally + { + try + { + pstmt.close(); + } + catch(Exception e) + {} + + pstmt = null; + } + + return bpList; + } + +} + diff --git a/posterita/posterita/src/main/org/posterita/keyname/LocatorKeyNamePair.java b/posterita/posterita/src/main/org/posterita/keyname/LocatorKeyNamePair.java new file mode 100644 index 0000000000..7d87f0af41 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/keyname/LocatorKeyNamePair.java @@ -0,0 +1,102 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +* Created on Sep 22, 2005 by ashley +* +*/ + +package org.posterita.keyname; + +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.Properties; + +import org.compiere.model.MLocator; +import org.compiere.util.DB; +import org.compiere.util.Env; +import org.compiere.util.KeyNamePair; + +import org.posterita.exceptions.OperationException; + +public class LocatorKeyNamePair +{ + public static ArrayList getKeyNamePair(Properties ctx) throws OperationException + { + ArrayList list = new ArrayList(); + + PreparedStatement prepStmt = null; + + try + { + int adOrgId = Env.getAD_Org_ID(ctx); + int adClientId = Env.getAD_Client_ID(ctx); + + String sqlStatement = "select M_LOCATOR_ID, VALUE from " + MLocator.Table_Name + " where AD_ORG_ID=" + adOrgId + " and AD_CLIENT_ID=" + adClientId + " and isactive = 'Y'"; + + prepStmt = DB.prepareStatement(sqlStatement, null); + ResultSet rs = prepStmt.executeQuery(); + + while(rs.next()) + { + int id = rs.getInt(1); + String name = rs.getString(2); + + KeyNamePair keyPair = new KeyNamePair(id, name); + list.add(keyPair); + } + } + catch (SQLException e) + { + throw new OperationException(e.getMessage()); + } + + return list; + } + + public static KeyNamePair getKeyNamePair(Properties ctx, int locatorId) throws OperationException + { + PreparedStatement prepStmt = null; + KeyNamePair keyPair = null; + try + { + int adOrgId = Env.getAD_Org_ID(ctx); + int adClientId = Env.getAD_Client_ID(ctx); + + String sqlStatement = "select M_LOCATOR_ID, VALUE from " + MLocator.Table_Name + " where AD_ORG_ID=" + adOrgId + " and AD_CLIENT_ID=" + adClientId + " and M_LOCATOR_ID=" + locatorId; + + prepStmt = DB.prepareStatement(sqlStatement, null); + ResultSet rs = prepStmt.executeQuery(); + + while(rs.next()) + { + int id = rs.getInt(1); + String name = rs.getString(2); + + keyPair = new KeyNamePair(id, name); + } + } + catch (SQLException e) + { + throw new OperationException(e.getMessage()); + } + + return keyPair; + } +} diff --git a/posterita/posterita/src/main/org/posterita/keyname/MenuKeyNamePair.java b/posterita/posterita/src/main/org/posterita/keyname/MenuKeyNamePair.java new file mode 100644 index 0000000000..cebd24433e --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/keyname/MenuKeyNamePair.java @@ -0,0 +1,53 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Created on Jul 28, 2005 by Fred + */ + +package org.posterita.keyname; + +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.Properties; + +import org.compiere.model.X_U_WebMenu; +import org.compiere.util.Env; + +import org.posterita.core.KeyNamePairUtil; +import org.posterita.exceptions.OperationException; + +public class MenuKeyNamePair extends KeyNamePairUtil +{ + public static ArrayList getKeyNamePairs(Properties ctx) throws OperationException + + { + String sql = "ad_client_id=" + Env.getAD_Client_ID(ctx) + "and ad_org_id="+ Env.getAD_Org_ID(ctx) + " and parentmenu_id is not null order by parentmenu_id"; + //+ " and isClosable= 'Y' "; + try + { + return getData(ctx, X_U_WebMenu.Table_Name,sql); + } + catch (SQLException e) + { + throw new OperationException(e.getMessage()); + } + } + + +} diff --git a/posterita/posterita/src/main/org/posterita/keyname/OrgKeyNamePair.java b/posterita/posterita/src/main/org/posterita/keyname/OrgKeyNamePair.java new file mode 100644 index 0000000000..aaf7e4f411 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/keyname/OrgKeyNamePair.java @@ -0,0 +1,62 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Aug 2, 2005 by din + */ + +package org.posterita.keyname; + +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.Properties; + +import org.compiere.model.X_AD_Org; +import org.compiere.util.Env; + +import org.posterita.businesslogic.OrganisationManager; +import org.posterita.core.KeyNamePairUtil; +import org.posterita.exceptions.OperationException; + +public class OrgKeyNamePair extends KeyNamePairUtil +{ + public static ArrayList getKeyNamePairs(Properties ctx) throws OperationException + { + String isAuto = "N"; + String isMoto = "N"; + + /* if(OrganisationManager.getMyOrg(ctx).isAutomobile()) + { + isAuto = "Y"; + } + + if(OrganisationManager.getMyOrg(ctx).isMotorcycle()) + { + isMoto = "Y"; + }*/ + + String sql = "AD_CLIENT_ID =" + Env.getAD_Client_ID(ctx) + "and ISAUTOMOBILE ='"+ isAuto +"' and ISMOTORCYCLE ='"+ isMoto +"'" + " and isactive = 'Y'"; + try + { + return getData(ctx, X_AD_Org.Table_Name,sql); + } + catch (SQLException e) + { + throw new OperationException(e.getMessage()); + } + } +} diff --git a/posterita/posterita/src/main/org/posterita/keyname/PriceListVersionKeyNamePair.java b/posterita/posterita/src/main/org/posterita/keyname/PriceListVersionKeyNamePair.java new file mode 100644 index 0000000000..c71ccd146a --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/keyname/PriceListVersionKeyNamePair.java @@ -0,0 +1,47 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Aug 19, 2005 by praveen + * + */ +package org.posterita.keyname; + +import java.util.ArrayList; +import java.util.Properties; + +import org.compiere.model.MPriceListVersion; +import org.compiere.util.Env; +import org.compiere.util.KeyNamePair; + +public class PriceListVersionKeyNamePair +{ + public static ArrayList getKeyNamePairs(Properties ctx) + { + ArrayList list = new ArrayList(); + int id[] = MPriceListVersion.getAllIDs(MPriceListVersion.Table_Name,"AD_Client_id = "+Env.getAD_Client_ID(ctx),null); + + for(int i=0; i getKeyNamePairs(Properties ctx, int attributeId, int productcategoryId) throws OperationException + { + String sql = "ad_client_id=" + Env.getAD_Client_ID(ctx) + " and m_attribute_id=" + attributeId + " and m_product_category_id=" + productcategoryId + " and isactive = 'Y'"; + + try + { + return getData(ctx, MAttributeValue.Table_Name, sql); + } + catch (SQLException e) + { + throw new OperationException(e.getMessage()); + } + } + +} diff --git a/posterita/posterita/src/main/org/posterita/keyname/RegionKeyNamePair.java b/posterita/posterita/src/main/org/posterita/keyname/RegionKeyNamePair.java new file mode 100644 index 0000000000..aba9278260 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/keyname/RegionKeyNamePair.java @@ -0,0 +1,48 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ +package org.posterita.keyname; + +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.Properties; + +import org.compiere.model.MRegion; + +import org.posterita.core.KeyNamePairUtil; +import org.posterita.exceptions.OperationException; +import org.posterita.lib.UdiConstants; + + +public class RegionKeyNamePair extends KeyNamePairUtil +{ + public static ArrayList getKeyNamePairs(Properties ctx) throws OperationException + { + String sql = "c_country_id = " + UdiConstants.COUNTRY_SOUTH_AFRICA + " and isactive = 'Y'"; + + try + { + return getData(ctx, MRegion.Table_Name,sql); + } + catch (SQLException e) + { + throw new OperationException(e.getMessage()); + } + } +} diff --git a/posterita/posterita/src/main/org/posterita/keyname/RoleKeyNamePair.java b/posterita/posterita/src/main/org/posterita/keyname/RoleKeyNamePair.java new file mode 100644 index 0000000000..8ced214270 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/keyname/RoleKeyNamePair.java @@ -0,0 +1,50 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Aug 1, 2005 by din + */ + +package org.posterita.keyname; + +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.Properties; + +import org.compiere.model.MRole; +import org.compiere.util.Env; + +import org.posterita.core.KeyNamePairUtil; +import org.posterita.exceptions.OperationException; + +public class RoleKeyNamePair extends KeyNamePairUtil +{ + public static ArrayList getKeyName(Properties ctx) throws OperationException + { + String sql = "ad_client_id=" + Env.getAD_Client_ID(ctx) + "and ad_org_id=" + Env.getAD_Org_ID(ctx) + " and isactive = 'Y'"; + + try + { + return getData(ctx, MRole.Table_Name,sql); + } + catch (SQLException e) + { + throw new OperationException(e.getMessage()); + } + + } +} diff --git a/posterita/posterita/src/main/org/posterita/keyname/SalesRepKeyNamePair.java b/posterita/posterita/src/main/org/posterita/keyname/SalesRepKeyNamePair.java new file mode 100644 index 0000000000..024fbe8172 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/keyname/SalesRepKeyNamePair.java @@ -0,0 +1,104 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Oct 6, 2005 by praveen + * + */ +package org.posterita.keyname; + +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.Properties; + +import org.compiere.model.MOrg; +import org.compiere.util.DB; +import org.compiere.util.Env; +import org.compiere.util.KeyNamePair; + +import org.posterita.exceptions.SystemException; + + +public class SalesRepKeyNamePair +{ + /** + * returns an arraylist of keyname pairs. + * key -> user_id + * name -> username + */ + public static ArrayList getKeyNamePairs(Properties ctx) throws SystemException + { + ArrayList srList = new ArrayList(); + + int ad_client_id = Env.getAD_Client_ID(ctx); + int ad_org_id = Env.getAD_Org_ID(ctx); + + new MOrg(ctx,ad_org_id,null); + + + String sql = "select c_bpartner_id,name " + + "from c_bpartner " + + "where issalesrep = 'Y' " + + "and isactive = 'Y' " + + "and ad_client_id = ? " + + "and ad_org_id = ? "; + + + PreparedStatement pstmt = null; + + pstmt = DB.prepareStatement(sql, null); + ResultSet rs; + KeyNamePair pair = null; + + try + { + pstmt.setInt(1,ad_client_id); + pstmt.setInt(2,ad_org_id); + + rs = pstmt.executeQuery(); + + while (rs.next()) + { + pair = new KeyNamePair(rs.getInt(1),rs.getString(2)); + srList.add(pair); + } + + rs.close(); + } + catch (SQLException e) + { + throw new SystemException(e.getMessage()); + } + finally + { + try + { + pstmt.close(); + } + catch(Exception e) + {} + + pstmt = null; + } + + return srList; + } + +} + diff --git a/posterita/posterita/src/main/org/posterita/keyname/WarehouseKeyNamePair.java b/posterita/posterita/src/main/org/posterita/keyname/WarehouseKeyNamePair.java new file mode 100644 index 0000000000..9f44840e5c --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/keyname/WarehouseKeyNamePair.java @@ -0,0 +1,71 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 29-Jul-2005 by alok + * + */ +package org.posterita.keyname; + +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.Properties; + +import org.compiere.util.Env; + +import org.posterita.core.KeyNamePairUtil; +import org.posterita.exceptions.OperationException; + + +public class WarehouseKeyNamePair extends KeyNamePairUtil +{ + public static ArrayList getKeyNamePair(Properties ctx) throws OperationException + { + ArrayList list = new ArrayList(); + + try + { + list = getData(ctx,"M_WAREHOUSE","AD_ORG_ID="+ Env.getAD_Org_ID(ctx) + " and ad_client_Id=" + Env.getAD_Client_ID(ctx)+ " and isactive = 'Y'"); + } + catch (SQLException e) + { + throw new OperationException(e.getMessage()); + } + + return list; + + } + + public static ArrayList getKeyNamePair(Properties ctx,int warehouseId) throws OperationException + { + ArrayList list = new ArrayList(); + + + + try + { + list = getData(ctx,"M_WAREHOUSE","AD_ORG_ID="+ Env.getAD_Org_ID(ctx) + " and ad_client_Id=" + Env.getAD_Client_ID(ctx)+ " and isactive = 'Y' and m_warehouse_id<>"+warehouseId); + } + catch (SQLException e) + { + throw new OperationException(e.getMessage()); + } + + return list; + + } +} diff --git a/posterita/posterita/src/main/org/posterita/lib/PropertiesConstant.java b/posterita/posterita/src/main/org/posterita/lib/PropertiesConstant.java new file mode 100644 index 0000000000..bf9766a6e1 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/lib/PropertiesConstant.java @@ -0,0 +1,131 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 25-Mar-2005 by fred + * + */ +package org.posterita.lib; + + +public class PropertiesConstant +{ + public static final String LOGO_HOME="logo.home"; + public static final String UDI_HOME = "udi.home"; + +/* public static final String CLIENT_NAME = "client.name"; + public static final String CLIENT_ID = "client.id"; + public static final String NTIER_HOME = "ntier.home"; + public static final String DCS_HOME = "dcs.home"; + //public static final String HONDA_HEAD_OFFICE_AUTO_ID = "honda.headoffice.auto.id"; + public static final String HONDA_HEAD_OFFICE_MOTO_ID = "honda.headoffice.moto.id"; + + public static final String AUTO_METALLIC_PRICE_ID = "auto.metallic.price.list.id"; + public static final String MOTO_METALLIC_PRICE_ID = "wing.metallic.price.list.id"; + public static final String PRODUCT_CATEGORY_CAR = "productCategory.car.id"; + public static final String FACTORY_HOME = "factory.home"; + + + public static final String CSV_HOME="csv.home"; + + public static final String ATTRIBUTE_SET_CAR = "car.attributeSet.id"; + public static final String BPARTNER_HSAF_ID = "bpartner.hsaf.id"; + public static final String USER_ROLE_SUPER_USER_ID = "user.role.superUser.id"; + public static final String ROLE_MENU_SUPER_USER_ID = "role.menu.superUser.id"; + public static final String SUPER_USER_ID = "superUser.id"; + public static final String USER_ROLE_UDI_ADMIN_ID = "user.role.udiAdmin.id"; + public static final String ROLE_MENU_UDI_ADMIN_ID = "role.menu.udiAdmin.id"; + public static final String UDI_ADMIN_ID = "udiAdmin.id"; + //public static final String HSAFAUTO_ADMIN_ID = "hsafAuto.admin.id"; + public static final String HSAFWING_ADMIN_ID = "hsafWing.Admin.id"; + public static final String ATTRIBUTE_SET_VIN_NO="vinNo.attributeVinNo.id"; + public static final String MODEL_ATTRIBUTE = "attribute.model.id"; + public static final String COLOUR_ATTRIBUTE = "attribute.colour.id"; + public static final String TRX_ATTRIBUTE = "attribute.transmisson.id"; + public static final String YEAR_ATTRIBUTE = "attribute.year.id"; + public static final String VIN_NO_ATTRIBUTE = "attribute.vinNo.id"; + public static final String UOM_EACH = "uom.each"; + public static final String TAX_CATEGORY_DEFAULT = "taxCategory.default.id"; + public static final String DEFAULT_BPGROUP = "default.bpartner.group"; + + //ROLES + public static final String ROLE_DEALER_PRINCIPAL_ID = "role.dealer.principal.id"; + public static final String ROLE_SALES_MANAGER_ID = "role.sales.manager.id"; + public static final String ROLE_SALES_PERSON_ID = "role.sales.person.id"; + public static final String ROLE_STOCK_CONTROLLER_ID = "role.stock.controller.id"; + public static final String ROLE_TEST_ID = "role.test.id"; + public static final String ROLE_SYSTEM_ADMINISTRATOR_ID = "role.system.administrator.id"; + public static final String ROLE_UDI_ADMIN_ID = "role.udiAdmin.id"; + public static final String ROLE_HSAFAUTO_ADMIN_ID = "role.hsafAutoAdmin.id"; + public static final String ROLE_HSAFWING_ADMIN_ID = "role.hsafWingAdmin.id"; + //MENUS + public static final String PMENU_HOME_ID = "pmenu.home.id"; + public static final String PMENU_CREATEMENU_ID = "pmenu.createmenu.id"; + //testing + public static final String SMENU_ORGANISATION_ID = "smenu.organisation.id"; + //end of test + public static final String SMENU_WAREHOUSE_ID= "smenu.warehouse.id"; + public static final String SMENU_CREATEUSER_ID= "smenu.createuser.id"; + public static final String PMENU_STOCK_INQUIRY_ID = "pmenu.stock.inquiry.id"; + public static final String SMENU_INQUIRY_ID = "smenu.inquiry.id"; + public static final String SMENU_MY_STOCK_ID = "smenu.my.stock.id"; + + public static final String PMENU_DEALER_ORDER_ID = "pmenu.dealer.order.id"; + public static final String SMENU_CREATE_ORDER_ID = "smenu.create.order.id"; + + public static final String PMENU_NATIS_RELEASE_ID = "pmenu.natis.release.id"; + public static final String SMENU_RELEASE_VEHICLE_ID = "smenu.release.vehicle.id"; + + public static final String PMENU_ALLOCATIONS_ID = "pmenu.allocations.id"; + + public static final String PMENU_DEALER_TRANSFER_ID = "pmenu.dealer.transfer.id"; + public static final String PMENU_DEALER_ADMIN_ID = "pmenu.dealer.admin.id"; + public static final String PMENU_MESSAGES_ID = "pmenu.messages.id"; + public static final String SMENU_MESSAGESINBOX_ID="smenu.messagesinbox.id"; + public static final String SMENU_MESSAGESSENT_ID = "smenu.messagessent.id"; + public static final String SMENU_MESSAGESCOMPOSE_ID = "smenu.messagescompose.id"; + public static final String PMENU_LOGOUT_ID = "pmenu.logout.id"; + public static final String CAR_ASSET_GRP = "car.assetgroup.id"; + + public static final String SSL_CERT_PATH = "ssl.cert.path"; + public static final String NATIS_POST_PROCESSOR = "natis.post.processor"; + public static final String NATIS_OPERATIONAL_MODE = "natis.operational.mode"; + public static final String NATIS_URL = "natis.url"; + public static final String SMTP_SERVER = "smtp.server"; + + public static final String FTP_SERVER_URL = "ftp.server.url"; + public static final String FTP_USERNAME = "ftp.user.name"; + public static final String FTP_PASSWORD = "ftp.user.password"; + + public static final String NATIS_AUTOMATION_TIME = "natis.automation.time"; + + public static final String FTP_IMPORT_AUTOMATION = "ftp.import.automation"; + public static final String FTP_IMPORT_TIME = "ftp.import.time"; + + public static final String WEBSTORE_AUTOMATED_IMPORT = "webstore.automated.import"; + public static final String WEBSTORE_AUTOMATED_TIME = "webstore.automated.time"; + public static final String WEBSTORE_IMAGE_FOLDER_TOBEPROCESSED = "webstore.folder.tobeprocessed"; + public static final String WEBSTORE_IMAGE_FOLDER_PROCESSED = "webstore.folder.processed"; + public static final String WEBSTORE_IMAGE_FOLDER_ERRORS = "webstore.folder.errors"; + public static final String WEBSTORE_IMAGE_COLLECTION_FOLDER = "webstore.collection.folder"; + public static final String WEBSTORE_IMAGE_INACTIVE_FOLDER = "webstore.inactive.folder"; + + public static final String APPLICATION_TYPE = "application.type"; + public static final String SMTP_AUTH = "smtp.authorisation"; + public static final String SMTP_USERNAME = "smtp.username"; + public static final String SMTP_PASSWORD = "smtp.password"; +*/} diff --git a/posterita/posterita/src/main/org/posterita/lib/UdiConstants.java b/posterita/posterita/src/main/org/posterita/lib/UdiConstants.java new file mode 100644 index 0000000000..b8e7afd4c8 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/lib/UdiConstants.java @@ -0,0 +1,97 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ +package org.posterita.lib; + +import org.compiere.util.Env; + + +public class UdiConstants +{ + public static final String ACCOUNTING_FILE="/config/accounting/AccountingUS.csv"; + //public static int CURRENCY_EURO=102; + public static final int CURRENCY_USD=100; + public static final int COUNTRY_SOUTH_AFRICA=305; + public static final int COUNTRY_MAURITIUS = 245; + public static final int COUNTRY_US = 100; + public static final int CURRENCY_RUPEES = 280; + + public static final int UOM_EACH_ID = 100; + + public static String POS_VERSION = ""; + public static String INVALID_LICENSING_REASON = ""; + + public static final String THUMBNAIL_IMAGE_PREFIX = "THUMB-"; + public static final String FULL_IMAGE_PREFIX = "FULL-"; + public static final String FULL_IMAGE = "fullImage"; + public static final String THUMBNAIL = "thumbnail"; + public static final String DEFAULT_IMAGE = "Default"; + public static final String IMAGE_EXTENSION = ".jpg"; + public static final String IMPORT_AUTOMATATION_ON = "ON"; + + public static final String CLIENT_ID_CTX_PARAM = "#AD_Client_ID"; + public static final String ORG_ID_CTX_PARAM = "#AD_Org_ID"; + public static final String AD_ROLE_ID = "#AD_Role_ID"; + public static final String CSS = "webParam5"; + public static final String FORWARD = "webParam6"; + public static final String MODULE_NAME_CTX_PARAM = "#ModuleName"; + //public static final String WEBPARAM6 = "webParam6"; + public static final String PRICELIST_CTX_PARAM = "#M_PriceList_ID"; + public static final String PRICELIST_VERSION_CTX_PARAM = "#M_Pricelist_Version_ID"; + public static final String PRODUCT_CATEGORY_CTX_PARAM = "#M_Product_Category_ID"; + public static final String USER_ID_CTX_PARAM = "#AD_User_ID"; + public static final String ROLE_EDITABLE_ORGS_CTX_PARAM = "#Role_Editable_Org_Access"; + public static final String ROLE_VIEWABLE_ORGS_CTX_PARAM = "#Role_Viewable_Org_Access"; + public static final String LANGUAGE_CTX_PARAM = "#AD_Language"; + public static final String WSTORE_CTX_PARAM = "#W_Store_ID"; + + public static final String DEFAULT_FORWARD = "pos"; + + public static final String WEBSTORE_DEFAULT_AD_ORG_ID_CTX_PARAM = "#AD_Org_ID_WebStoreDefault"; + + public static final String WAREHOUSE_CTX_PARAM = "#M_Warehouse_ID"; + + public static final String WEBSTORE_APP_SUFFIX = "WEBSTORE"; + + public static final String REQUEST_UPDATE_EMAIL_PREFIX = "`EMAIL`"; + public static final String REQUEST_UPDATE_EMAIL_EXT = ".txt"; + + public static final String PRINTFORMAT_ITEM_LOGO = "Logo"; + public static final String FIDELITY_BACKGROUND_IMAGE = "Fidelity"; + + + public static final String PAYMENTRULE_MIXED = "M"; + + + public static final String SHIPMENT_CHARGE = "Shipment Charge"; + + public static final String TERMINAL_ID = Env.POS_ID; + public static final String U_POSTERMINAL_ID = "#U_POSTerminal_ID"; + public static final String POS_PURCHASE_PL = "#POSPurchasePL"; + public static final String POS_PURCHASE_PL_VERSION = "#POSPurchasePLVersion"; + public static final String WEB_USER_ROLE = "WebStoreUserRole"; + public static final String ORIGINAL_IMAGE = "originalImage"; + public static final String TAMAK_ADMIN_ROLE = "posterita Admin"; + public static final String TAMAK_USER_ROLE = "posterita User"; + public static final String WEBSTORE_USER_ROLE = "WebStoreUserRole"; + + + public static final String EMAIL_FOOTER_MESSAGE = "Powered by Tamak ICT - CRM Module for Compiere ERP/CRM"; + +} diff --git a/posterita/posterita/src/main/org/posterita/model/MBPartnerProduct.java b/posterita/posterita/src/main/org/posterita/model/MBPartnerProduct.java new file mode 100644 index 0000000000..71c4dbb3cf --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/model/MBPartnerProduct.java @@ -0,0 +1,52 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Created on May 10, 2006 + */ + + +package org.posterita.model; + +import java.sql.ResultSet; +import java.util.Properties; + +import org.compiere.model.X_C_BPartner_Product; + + +public class MBPartnerProduct extends X_C_BPartner_Product +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + + public MBPartnerProduct(Properties ctx, int C_BpartnerProduct_ID, String m_trxName) + { + super(ctx, C_BpartnerProduct_ID, m_trxName); + + } + + public MBPartnerProduct(Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } + + +} diff --git a/posterita/posterita/src/main/org/posterita/model/MBank.java b/posterita/posterita/src/main/org/posterita/model/MBank.java new file mode 100644 index 0000000000..c5f6a6b2cb --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/model/MBank.java @@ -0,0 +1,51 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 07-Jul-2005 by alok + * + */ +package org.posterita.model; + +import java.sql.ResultSet; +import java.util.Properties; + +import org.compiere.model.X_C_Bank; + + +public class MBank extends X_C_Bank +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public MBank(Properties ctx, int C_Bank_ID, String m_trxName) + { + super(ctx, C_Bank_ID, m_trxName); + + } + public MBank(Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } + + + + + +} diff --git a/posterita/posterita/src/main/org/posterita/model/MBlackListCheque.java b/posterita/posterita/src/main/org/posterita/model/MBlackListCheque.java new file mode 100644 index 0000000000..027ac58fa4 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/model/MBlackListCheque.java @@ -0,0 +1,47 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 07-Jul-2005 by alok + * + */ +package org.posterita.model; + +import java.sql.ResultSet; +import java.util.Properties; + +import org.compiere.model.X_U_BlackListCheque; + +public class MBlackListCheque extends X_U_BlackListCheque +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public MBlackListCheque(Properties ctx, int U_BlackListCheque_ID, String trxName) + { + super(ctx, U_BlackListCheque_ID, trxName); + } + + public MBlackListCheque(Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } + + +} diff --git a/posterita/posterita/src/main/org/posterita/model/MMAttachment.java b/posterita/posterita/src/main/org/posterita/model/MMAttachment.java new file mode 100644 index 0000000000..6af9c714fc --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/model/MMAttachment.java @@ -0,0 +1,81 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +* Created on May 10, 2006 by ashley +* +*/ + +package org.posterita.model; + +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.util.Properties; + +import org.compiere.model.MAttachment; +import org.compiere.util.DB; + +import org.posterita.exceptions.OperationException; + +public class MMAttachment extends MAttachment +{ + + /** + * + */ + private static final long serialVersionUID = 1L; + + @SuppressWarnings("unused") + private MMAttachment(Properties ctx, int AD_Table_ID, int Record_ID, String trxName) + { + super(ctx, AD_Table_ID, Record_ID, trxName); + } + + public static MAttachment get (Properties ctx, int AD_Table_ID, int Record_ID, String trxName) throws OperationException + { + MAttachment retValue = null; + PreparedStatement pstmt = null; + String sql = "SELECT * FROM AD_Attachment WHERE AD_Table_ID=? AND Record_ID=?"; + try + { + pstmt = DB.prepareStatement (sql, trxName); + pstmt.setInt (1, AD_Table_ID); + pstmt.setInt (2, Record_ID); + ResultSet rs = pstmt.executeQuery (); + if (rs.next ()) + retValue = new MAttachment (ctx, rs, trxName); + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + throw new OperationException("Cannot get attachment!!!", e); + } + try + { + if (pstmt != null) + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + return retValue; + } // get +} diff --git a/posterita/posterita/src/main/org/posterita/model/MRevenueRecognition.java b/posterita/posterita/src/main/org/posterita/model/MRevenueRecognition.java new file mode 100644 index 0000000000..e9c7fb668a --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/model/MRevenueRecognition.java @@ -0,0 +1,50 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Jun 12, 2006 + */ + + +package org.posterita.model; + +import java.sql.ResultSet; +import java.util.Properties; + +import org.compiere.model.X_C_RevenueRecognition; + + +public class MRevenueRecognition extends X_C_RevenueRecognition +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public MRevenueRecognition(Properties ctx, int C_REVENUERECOGNITION_ID, String trxName) + { + super(ctx, C_REVENUERECOGNITION_ID, trxName); + } + + public MRevenueRecognition(Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } + +} + + diff --git a/posterita/posterita/src/main/org/posterita/model/MRoleMenu.java b/posterita/posterita/src/main/org/posterita/model/MRoleMenu.java new file mode 100644 index 0000000000..09e4c118c3 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/model/MRoleMenu.java @@ -0,0 +1,41 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +package org.posterita.model; + +import java.sql.ResultSet; +import java.util.Properties; + +import org.compiere.model.X_U_RoleMenu; + + +public class MRoleMenu extends X_U_RoleMenu +{ + + public MRoleMenu(Properties ctx, int U_RoleMenu_ID, String trxName) + { + super(ctx, U_RoleMenu_ID, trxName); + } + + public MRoleMenu(Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/model/MWebMenu.java b/posterita/posterita/src/main/org/posterita/model/MWebMenu.java new file mode 100644 index 0000000000..36f5639f34 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/model/MWebMenu.java @@ -0,0 +1,41 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +package org.posterita.model; + +import java.sql.ResultSet; +import java.util.Properties; + +import org.compiere.model.X_U_WebMenu; + + +public class MWebMenu extends X_U_WebMenu +{ + + public MWebMenu(Properties ctx, int U_WebMenu_ID, String trxName) + { + super(ctx, U_WebMenu_ID, trxName); + } + + public MWebMenu(Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/model/MWebProperties.java b/posterita/posterita/src/main/org/posterita/model/MWebProperties.java new file mode 100644 index 0000000000..30d0db4200 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/model/MWebProperties.java @@ -0,0 +1,52 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Created on 12-Oct-2005 + */ + + +package org.posterita.model; + +import java.sql.ResultSet; +import java.util.Properties; + +import org.compiere.model.X_U_Web_Properties; + + +public class MWebProperties extends X_U_Web_Properties +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + + public MWebProperties(Properties ctx, int uWebProperties , String trxName) + { + super(ctx,uWebProperties,trxName); + } + + public MWebProperties(Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } + + + +} diff --git a/posterita/posterita/src/main/org/posterita/order/UDIOrderType.java b/posterita/posterita/src/main/org/posterita/order/UDIOrderType.java new file mode 100644 index 0000000000..a29436670a --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/order/UDIOrderType.java @@ -0,0 +1,26 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ +package org.posterita.order; + + +public interface UDIOrderType +{ + public String getOrderType(); +} diff --git a/posterita/posterita/src/main/org/posterita/order/UDIOrderTypes.java b/posterita/posterita/src/main/org/posterita/order/UDIOrderTypes.java new file mode 100644 index 0000000000..61f4c4d524 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/order/UDIOrderTypes.java @@ -0,0 +1,142 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +package org.posterita.order; + + +public class UDIOrderTypes +{ + private UDIOrderTypes() + { + + } + + public static final UDIOrderType CREDIT_ORDER = new CreditOrder(); + + public static final UDIOrderType CREDIT_ORDER_NO_SHIPMENT = new CreditOrderNoShipment(); + + public static final UDIOrderType CUSTOMER_RETURN_ORDER = new CustomerReturnOrder(); + + public static final UDIOrderType POS_ORDER = new POSOrder(); + + public static final UDIOrderType POS_GOODS_RECEIVE_NOTE = new POSGoodsReceiveNote(); + + public static final UDIOrderType POS_GOODS_RETURN_NOTE = new POSGoodsReturnNote(); + + public static final UDIOrderType WEBSTORE_ORDER = new WebstoreOrder(); + + public static final UDIOrderType CREDIT_MEMO = new CreditMemo(); + + + + public static class POSGoodsReceiveNote implements UDIOrderType + { + + public String getOrderType() + { + return "POS Goods Receive Note"; + } + + } + + public static class CreditMemo implements UDIOrderType + { + + public String getOrderType() + { + return "Credit Memo"; + } + + } + + public static class POSGoodsReturnNote implements UDIOrderType + { + + public String getOrderType() + { + return "POS Goods Returned Note"; + } + + } + + public static class POSOrder implements UDIOrderType + { + + public String getOrderType() + { + return "POS Order"; + } + + } + + public static class CustomerOrder implements UDIOrderType + { + + public String getOrderType() + { + return "Customer Order"; + } + + } + + public static class AllocationOrder implements UDIOrderType + { + public String getOrderType() + { + return "Allocation Order"; + } + + } + + public static class CreditOrder implements UDIOrderType + { + public String getOrderType() + { + return "Credit Order"; + } + } + + public static class CreditOrderNoShipment implements UDIOrderType + { + public String getOrderType() + { + return "Credit Order no Shipment"; + } + } + + public static class CustomerReturnOrder implements UDIOrderType + { + + public String getOrderType() + { + return "Customer Returned Order"; + } + + } + + public static class WebstoreOrder implements UDIOrderType + { + + public String getOrderType() + { + return "Webstore Order"; + } + + } +} diff --git a/posterita/posterita/src/main/org/posterita/pos/help/POSHelpAction.java b/posterita/posterita/src/main/org/posterita/pos/help/POSHelpAction.java new file mode 100644 index 0000000000..3bd9fac91e --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/pos/help/POSHelpAction.java @@ -0,0 +1,101 @@ +/** + * + * Copyright (c) 2008 Posterita. All Rights Reserved. + * + * This software is the confidential and proprietary information of + * Posterita. ("Confidential Information"). You shall not + * disclose such Confidential Information and shall use it only in + * accordance with the terms of the license agreement you entered into + * with Posterita. + * + * POSTERITA MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE + * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT + * NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR + * A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. TAMAK ICT SHALL NOT + * BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, + * MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. + * + * 6 Feb 2008 17:25:51 by shameem + * + */ + +package org.posterita.pos.help; + +import java.io.FileNotFoundException; +import java.text.ParseException; +import java.util.Properties; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.posterita.beans.POSHelpBean; +import org.posterita.core.TmkJSPEnv; +import org.posterita.exceptions.ApplicationException; +import org.posterita.exceptions.OperationException; +import org.posterita.form.POSHelpForm; +import org.posterita.struts.core.BaseDispatchAction; + +import com.lowagie.text.DocumentException; + +public class POSHelpAction extends BaseDispatchAction +{ + public static final String INIT_CONTACT_US= "initContactUs"; + public ActionForward initContactUs(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException, ParseException, FileNotFoundException, DocumentException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + return mapping.findForward(INIT_CONTACT_US); + } + + public static final String SEND_EMAIL = "sendEmail"; + + public ActionForward sendEmail(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException, ParseException, FileNotFoundException, DocumentException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx =TmkJSPEnv.getCtx(request); + boolean Ok = false; + + POSHelpForm hf = (POSHelpForm) form; + POSHelpBean bean = (POSHelpBean) hf.getBean(); + + if(bean.getFromAddress().equals("")) + { + postGlobalError("error.required.email",request); + return mapping.getInputForward(); + } + + if(bean.getSubject().equals("")) + { + postGlobalError("email.subject.error",request); + return mapping.getInputForward(); + } + + if(bean.getTextMessage().equals("")) + { + postGlobalError("email.message.error",request); + return mapping.getInputForward(); + } + + + Ok = POSHelpManager.sendEmail(ctx, bean.getFromAddress(), bean.getToAddresses(), bean.getSubject(), bean.getTextMessage()); + + if(Ok == false) + { + postGlobalError("email.send.error",request); + return mapping.getInputForward(); + } + else + { + return mapping.findForward(SEND_EMAIL); + } + + } +} diff --git a/posterita/posterita/src/main/org/posterita/pos/help/POSHelpManager.java b/posterita/posterita/src/main/org/posterita/pos/help/POSHelpManager.java new file mode 100644 index 0000000000..50a4a604b8 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/pos/help/POSHelpManager.java @@ -0,0 +1,61 @@ +/** + * + * Copyright (c) 2008 Posterita. All Rights Reserved. + * + * This software is the confidential and proprietary information of + * Posterita. ("Confidential Information"). You shall not + * disclose such Confidential Information and shall use it only in + * accordance with the terms of the license agreement you entered into + * with Posterita. + * + * POSTERITA MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE + * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT + * NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR + * A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. TAMAK ICT SHALL NOT + * BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, + * MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. + * + * 11 Feb 2008 10:20:44 by shameem + * + */ + +package org.posterita.pos.help; + +import java.util.Properties; +import java.util.logging.Level; + +import javax.mail.Message; +import javax.mail.Session; +import javax.mail.Transport; +import javax.mail.internet.InternetAddress; +import javax.mail.internet.MimeMessage; + +import org.compiere.model.MClient; +import org.compiere.util.EMail; +import org.compiere.util.Env; + +public class POSHelpManager +{ + + public static boolean sendEmail(Properties ctx, String from, String to, String subject, String body) + { + String emailAddress = to; + + MClient client = MClient.get(ctx); + + EMail email = client.createEMail(emailAddress, subject, body); + email.setFrom(from); + if (email != null) + { + if (EMail.SENT_OK.equals (email.send ())) + { + return true; + } + } + + client.get_Logger().log(Level.SEVERE, "Unable to sent email"); + + return false; + + } +} diff --git a/posterita/posterita/src/main/org/posterita/pos/taglib/AjaxTag.java b/posterita/posterita/src/main/org/posterita/pos/taglib/AjaxTag.java new file mode 100644 index 0000000000..6eae32e6ba --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/pos/taglib/AjaxTag.java @@ -0,0 +1,34 @@ +/****************************************************************************** + * Product: Posterita Web-Based POS and Adempiere Plugin * + * Copyright (C) 2008 Posterita Ltd * + * This file is part of POSterita * + * * + * POSterita is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * + *****************************************************************************/ +package org.posterita.pos.taglib; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +/** + * @author Ashley G Ramdass + * Apr 28, 2008 + */ +public interface AjaxTag +{ + public static final String AJAX_ACTION = "AjaxAction.do"; + + public abstract void processRequest(HttpServletRequest request, HttpServletResponse response); +} diff --git a/posterita/posterita/src/main/org/posterita/pos/taglib/BPartnerSearchTag.java b/posterita/posterita/src/main/org/posterita/pos/taglib/BPartnerSearchTag.java new file mode 100644 index 0000000000..c11f5155f4 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/pos/taglib/BPartnerSearchTag.java @@ -0,0 +1,423 @@ +/****************************************************************************** + * Product: Posterita Web-Based POS and Adempiere Plugin * + * Copyright (C) 2008 Posterita Ltd * + * This file is part of POSterita * + * * + * POSterita is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * + *****************************************************************************/ +package org.posterita.pos.taglib; + +import java.io.OutputStream; +import java.io.PrintWriter; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.util.ArrayList; +import java.util.Properties; +import java.util.logging.Level; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.jsp.JspException; +import javax.servlet.jsp.JspWriter; +import javax.servlet.jsp.tagext.TagSupport; + +import org.apache.commons.beanutils.BeanUtils; +import org.apache.ecs.xhtml.div; +import org.apache.ecs.xhtml.input; +import org.apache.ecs.xhtml.script; +import org.compiere.model.I_C_BPartner; +import org.compiere.model.MBPartner; +import org.compiere.util.CLogger; +import org.compiere.util.DB; +import org.compiere.util.Env; +import org.posterita.core.TmkJSPEnv; +import org.posterita.core.businesslogic.ElementManager; +import org.posterita.struts.core.AjaxAction; + +/** + * @author Ashley G Ramdass + * Apr 22, 2008 + */ +public class BPartnerSearchTag extends TagSupport implements AjaxTag +{ + private static final CLogger log = CLogger.getCLogger(BPartnerSearchTag.class); + private static final String REQUEST_PARAM = "bpValue"; + private String name = ""; + private String property = ""; + private boolean disabled = false; + private boolean isCustomer = false; + private boolean isVendor = false; + private boolean isEmployee = false; + private boolean showNonActive = false; + private int size = 20; + private String queryId = ""; + private String resultId = ""; + private String searchTerm; + private int bpartnerId = 0; + private String bpartnerValue = ""; + + + public int doStartTag() throws JspException + { + JspWriter out = pageContext.getOut(); + bpartnerId = 0; + bpartnerValue = ""; + try + { + HttpServletRequest request = (HttpServletRequest)pageContext.getRequest(); + + Object form = request.getAttribute(name); + + if (form == null) + { + form = request.getSession().getAttribute(name); + } + + String value = (String)BeanUtils.getSimpleProperty(form, property); + if (value != null && value.trim().length() > 0) + { + bpartnerId = Integer.parseInt(value); + } + + if (bpartnerId > 0) + { + MBPartner bPartner = new MBPartner(TmkJSPEnv.getCtx((HttpServletRequest)pageContext.getRequest()), bpartnerId, null); + bpartnerValue = bPartner.getName(); + } + } + catch (Exception ex) + { + log.log(Level.SEVERE, "Could not get value of BPartner", ex); + bpartnerId = -1; + } + + queryId = property + "Query"; + resultId = property + "SearchResult"; + + input bpInput = new input(); + bpInput.setID(property); + bpInput.setName(property); + bpInput.setType(input.TYPE_HIDDEN); + if (bpartnerId > 0) + { + bpInput.setValue(bpartnerId); + } + + input queryInput = new input(); + queryInput.setType(input.TYPE_TEXT); + queryInput.setID(queryId); + queryInput.setValue(bpartnerValue); + queryInput.setDisabled(disabled); + queryInput.setSize(size); + + div resultDiv = new div(); + resultDiv.setID(resultId); + resultDiv.setClass("autocomplete"); + + div mainDiv = new div(); + mainDiv.addElement(bpInput); + mainDiv.addElement(queryInput); + mainDiv.addElement(resultDiv); + mainDiv.addElement(getAjaxScript()); + + try + { + out.write(mainDiv.toString()); + } + catch (Exception ex) + { + throw new JspException(ex); + } + + return SKIP_BODY; + } + + public int doEndTag() throws JspException + { + return EVAL_PAGE; + } + + private script getAjaxScript() + { + script ajaxScript = new script(); + + StringBuffer src = new StringBuffer(400); + src.append("// auto complete for customer\n"); + src.append("$('").append(queryId).append("').Autocompleter = new Ajax.Autocompleter('") + .append(queryId).append("','").append(resultId).append("',\n"); + src.append("'").append(AJAX_ACTION).append("',{\n"); + src.append("paramName:'").append(REQUEST_PARAM).append("',\n"); + src.append("parameters: 'action=processRequest&").append(AjaxAction.PROCESS_REQUEST_PARAM).append("=BPartnerSearchTag") + .append("&isCustomer=").append(isCustomer).append("&isVendor=").append(isVendor).append("&isEmployee=").append(isEmployee).append("',\n"); + src.append("frequency:TROTTLE_TIME,\n"); + src.append("onShow:function(element, update){\n"); + src.append(" if(!update.style.position || update.style.position=='absolute') {\n"); + src.append(" update.style.position = 'absolute';\n"); + src.append(" Position.clone(element, update, {setHeight: false, offsetTop: element.offsetHeight});\n"); + src.append(" }\n"); + src.append(" update.style.display = 'block';\n"); + src.append("},\n"); + src.append("afterUpdateElement:function(e1,e2) {\n"); + src.append(" var id = $('").append(property).append("');\n"); + src.append(" var text = $('").append(queryId).append("');\n"); + src.append(" if(e2.value != '-1')\n"); + src.append(" {\n"); + src.append(" if(e2.value)\n"); + src.append(" {\n"); + //src.append(" alert(e2.value);"); + src.append(" id.value = e2.value;\n"); + src.append(" text.value = e2.getAttribute('name');\n"); + src.append(" }\n"); + src.append(" else\n"); + src.append(" {\n"); + //src.append(" alert('Setting blank');"); + src.append(" id.value = '';\n"); + src.append(" }\n"); + src.append(" }\n"); + src.append(" else\n"); + src.append(" {\n"); + //src.append(" alert('set blank');"); + src.append(" id.value = '';\n"); + src.append(" text.value = '';\n"); + src.append(" }//if\n"); + src.append("}\n"); + src.append("});\n"); + + ajaxScript.setTagText(src.toString()); + return ajaxScript; + } + + + private ArrayList getBPartnerList(Properties ctx) + { + ArrayList bpartnerList = new ArrayList(); + + StringBuffer sqlStmt = new StringBuffer(); + sqlStmt.append("SELECT * FROM C_BPartner WHERE AD_Client_ID=? AND IsActive='Y' AND IsCustomer=? "); + sqlStmt.append("AND IsVendor=? AND IsEmployee=? "); + + if (searchTerm != null && searchTerm.trim().length() != 0) + { + sqlStmt.append("AND UPPER(Name) LIKE '%").append(searchTerm.toUpperCase()).append("%' "); + } + + sqlStmt.append("ORDER BY Name"); + + PreparedStatement pstmt = null; + ResultSet rs = null; + + try + { + int param = 1; + pstmt = DB.prepareStatement(sqlStmt.toString(), null); + pstmt.setInt(param++, Env.getAD_Client_ID(ctx)); + pstmt.setString(param++, isCustomer ? "Y" : "N"); + pstmt.setString(param++, isVendor ? "Y" : "N"); + pstmt.setString(param++, isEmployee ? "Y" : "N"); + + rs = pstmt.executeQuery(); + + while (rs.next()) + { + MBPartner bPartner = new MBPartner(ctx, rs, null); + bpartnerList.add(bPartner); + } + } + catch (Exception ex) + { + log.log(Level.SEVERE, "Could not retrieve BPartners", ex); + } + finally + { + DB.close(rs, pstmt); + } + return bpartnerList; + } + + private void writeOutput(Properties ctx, OutputStream outStream, ArrayList bpartnerList) + { + PrintWriter writer = new PrintWriter(outStream); + + if (bpartnerList == null || bpartnerList.size() == 0) + { + writer.write("
      "); + writer.write("
    • "); + writer.write("
    "); + writer.write("
    "); + } + else + { + writer.write("
      "); + for (I_C_BPartner bpartner : bpartnerList) + { + writer.write("
    • "); + writer.write(bpartner.getName()); + writer.write("
    • "); + } + writer.write("
    "); + } + + writer.flush(); + writer.close(); + } + + public void processRequest(HttpServletRequest request, HttpServletResponse response) + { + Properties ctx = TmkJSPEnv.getCtx(request); + isCustomer = Boolean.parseBoolean(request.getParameter("isCustomer")); + isVendor = Boolean.parseBoolean(request.getParameter("isVendor")); + isEmployee = Boolean.parseBoolean(request.getParameter("isEmployee")); + searchTerm = request.getParameter(REQUEST_PARAM); + + try + { + ArrayList bpartnerList = getBPartnerList(ctx); + writeOutput(ctx, response.getOutputStream(), bpartnerList); + response.getOutputStream().flush(); + } + catch (Exception ex) + { + log.log(Level.SEVERE, "Could not write output", ex); + } + } + + /** + * @return the isCustomer + */ + public boolean getIsCustomer() + { + return isCustomer; + } + + /** + * @param isCustomer the isCustomer to set + */ + public void setIsCustomer(boolean isCustomer) + { + this.isCustomer = isCustomer; + } + + /** + * @return the isVendor + */ + public boolean getIsVendor() + { + return isVendor; + } + + /** + * @param isVendor the isVendor to set + */ + public void setIsVendor(boolean isVendor) + { + this.isVendor = isVendor; + } + + /** + * @return the isEmployee + */ + public boolean getIsEmployee() + { + return isEmployee; + } + + /** + * @param isEmployee the isEmployee to set + */ + public void setIsEmployee(boolean isEmployee) + { + this.isEmployee = isEmployee; + } + + /** + * @return the showNonActive + */ + public boolean getIsShowNonActive() + { + return showNonActive; + } + + /** + * @param showNonActive the showNonActive to set + */ + public void setIsShowNonActive(boolean showNonActive) + { + this.showNonActive = showNonActive; + } + + /** + * @return the id + */ + public String getProperty() + { + return property; + } + + /** + * @param id the id to set + */ + public void setProperty(String id) + { + this.property = id; + } + + /** + * @return the name + */ + public String getName() + { + return name; + } + + /** + * @param name the name to set + */ + public void setName(String name) + { + this.name = name; + } + + /** + * @return the disabled + */ + public boolean isDisabled() + { + return disabled; + } + + /** + * @param disabled the disabled to set + */ + public void setDisabled(boolean disabled) + { + this.disabled = disabled; + } + + /** + * @return the size + */ + public int getSize() + { + return size; + } + + /** + * @param size the size to set + */ + public void setSize(int size) + { + this.size = size; + } +} diff --git a/posterita/posterita/src/main/org/posterita/pos/taglib/MessageTag.java b/posterita/posterita/src/main/org/posterita/pos/taglib/MessageTag.java new file mode 100644 index 0000000000..84908ebfdd --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/pos/taglib/MessageTag.java @@ -0,0 +1,128 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Created on Nov 15, 2006 by ashley + */ + +/** + * @author ashley + */ + +package org.posterita.pos.taglib; + +import java.util.Properties; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.jsp.JspException; +import javax.servlet.jsp.JspWriter; +import javax.servlet.jsp.tagext.TagSupport; + +import org.compiere.wstore.JSPEnv; + +import org.posterita.core.bean.ElementBean; +import org.posterita.core.businesslogic.ElementManager; + +public class MessageTag extends TagSupport +{ + private static final long serialVersionUID = 1L; + + private String key; + private boolean printing = false; + private boolean textOnly = false; + + public int doStartTag() throws JspException + { + Properties ctx = JSPEnv.getCtx((HttpServletRequest)pageContext.getRequest()); + + ElementBean elementBean = ElementManager.getMsg(ctx, key); + + String disp = ""; + + if (isPrinting()) + { + disp = elementBean.getPrintName(); + } + else + { + disp = elementBean.getName(); + } + + try + { + JspWriter out = pageContext.getOut(); + if (this.isTextOnly()) + { + out.write(elementBean.getName()); + } + else + { + String help = ((elementBean.getHelp() != null) ? elementBean.getHelp() : ""); + out.print(""); + out.print(disp); + out.print(""); + } + } + catch (Exception e) + { + throw new JspException(e); + } + + return (SKIP_BODY); + } + + public int doEndTag() throws JspException + { + return EVAL_PAGE; + } + + public String getKey() + { + return key; + } + + public void setKey(String key) + { + this.key = key; + } + + public boolean isPrinting() + { + return printing; + } + + public void setPrinting(boolean printing) + { + this.printing = printing; + } + + public boolean isTextOnly() + { + return textOnly; + } + + public void setTextOnly(boolean textOnly) + { + this.textOnly = textOnly; + } +} diff --git a/posterita/posterita/src/main/org/posterita/process/SetupWebPOS.java b/posterita/posterita/src/main/org/posterita/process/SetupWebPOS.java new file mode 100644 index 0000000000..4c2c94f0a1 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/process/SetupWebPOS.java @@ -0,0 +1,341 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program 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 General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + * Autor: Victor Perez victor.perez@e-evolution.con www.e-evolution.com * + *****************************************************************************/ + +package org.posterita.process; + +import java.math.BigDecimal; +import java.util.Iterator; +import java.util.logging.Level; + +import org.compiere.model.MRole; +import org.compiere.model.MRoleMenu; +import org.compiere.model.MUser; +import org.compiere.process.ProcessInfoParameter; +import org.compiere.process.SvrProcess; +import org.compiere.util.Env; +import org.posterita.factory.POSMenuFactory; +import org.posterita.model.MWebMenu; +import org.posterita.util.PoManager; + + + + +/** + * Setup Web POS in Adempiere + * @author victor.perez@e-evolution + */ +public class SetupWebPOS extends SvrProcess +{ + + + private int p_AD_Org_ID = 0; + private int p_C_CashBook_ID = 0; + private int p_M_PriceList_Version_ID = 0; + private int p_PriceList_Version_ID = 0; + private int p_M_DiscountSchema_ID = 0; + private int p_C_Bank_ID = 0; + private int p_C_BankAccount_ID = 0 ; + private int p_C_TaxCategory_ID = 0 ; + private int p_M_Locator_ID = 0; + private int p_C_BPartner_ID = 0; + private int p_SalesRep_ID = 0; + private int p_AD_Role_ID = 0; + private String p_userPIN = ""; + private String p_POS_Name = "Terminal 1"; + private String p_HostAddress = ""; + + private int AD_Client_ID = 0; + + + + /** + * Prepare + */ + protected void prepare() + { + AD_Client_ID = Env.getAD_Client_ID(getCtx()); + ProcessInfoParameter[] para = getParameter(); + for (int i = 0; i < para.length; i++) + { + String name = para[i].getParameterName(); + + if (para[i].getParameter() == null) + ; + else if (name.equals("AD_Org_ID")) + { + p_AD_Org_ID = para[i].getParameterAsInt(); + } + else if (name.equals("C_CashBook_ID")) + { + p_C_CashBook_ID = para[i].getParameterAsInt(); + } + else if (name.equals("M_PriceList_Version_ID")) + { + p_M_PriceList_Version_ID = para[i].getParameterAsInt(); + } + else if (name.equals("PriceList_Version_ID")) + { + p_PriceList_Version_ID = para[i].getParameterAsInt(); + } + else if (name.equals("M_DiscountSchema_ID")) + { + p_M_DiscountSchema_ID = para[i].getParameterAsInt(); + } + else if (name.equals("C_Bank_ID")) + { + p_C_Bank_ID = para[i].getParameterAsInt(); + } + else if (name.equals("C_BankAccount_ID")) + { + p_C_BankAccount_ID = para[i].getParameterAsInt(); + } + else if (name.equals("C_TaxCategory_ID")) + { + p_C_TaxCategory_ID = para[i].getParameterAsInt(); + } + else if (name.equals("M_Locator_ID")) + { + p_M_Locator_ID = para[i].getParameterAsInt(); + } + else if (name.equals("C_BPartner_ID")) + { + p_C_BPartner_ID = para[i].getParameterAsInt(); + } + else if (name.equals("SalesRep_ID")) + { + p_SalesRep_ID = para[i].getParameterAsInt(); + } + else if (name.equals("AD_Role_ID")) + { + p_AD_Role_ID = para[i].getParameterAsInt(); + } + else if (name.equals("UserPIN")) + { + p_userPIN = (String)para[i].getParameter(); + } + else if (name.equals("Name")) + { + p_POS_Name = (String)para[i].getParameter(); + } + else if (name.equals("HostAddress")) + { + p_HostAddress = (String)para[i].getParameter(); + } + else + { + log.log(Level.SEVERE, "Unknown Parameter: " + name); + } + } + + } + + + /** + * Process create a new Terminal POS + * @return info + * @throws Exception + */ + protected String doIt() throws Exception + { + CreatePOS(); + createAdmin(); + return "@OK@"; + } + + /** + * Create new terminal web POS + */ + public void CreatePOS() throws Exception + { + // Need to refactor correctly with new terminal @ashley + /*log.info("Creating POS Terminal..."); + MPriceListVersion purchasepricelistversion = new MPriceListVersion(getCtx(), p_PriceList_Version_ID, get_TrxName()); + MPOS posTerminal = null; + int pos_id = DB.getSQLValue(get_TrxName(), "SELECT C_POS_ID FROM C_POS WHERE AD_Client_ID=" + AD_Client_ID + " AND Name='"+p_POS_Name + "'"); + if(pos_id != 0) + { + posTerminal = new MPOS(getCtx(), pos_id , get_TrxName()); + } + else + { + posTerminal = new MPOS(getCtx(), 0 , get_TrxName()); + } + + + posTerminal = new MPOS(getCtx(), 0, get_TrxName()); + posTerminal.setName(p_POS_Name); + posTerminal.setAD_Org_ID(p_AD_Org_ID); + posTerminal.setC_CashBook_ID(p_C_CashBook_ID); + MPriceListVersion pricelistversion = new MPriceListVersion(getCtx(), p_M_PriceList_Version_ID, get_TrxName()); + posTerminal.setM_PriceList_ID(pricelistversion.getM_PriceList_ID()); + MLocator locator = new MLocator (getCtx(), p_M_Locator_ID, get_TrxName()); + posTerminal.setM_Warehouse_ID(locator.getM_Warehouse_ID()); + posTerminal.setC_BPartnerCashTrx_ID(p_C_BPartner_ID); + posTerminal.setSalesRep_ID(p_SalesRep_ID); + posTerminal.setM_PriceList_ID(purchasepricelistversion.getM_PriceList_ID()); + if(!posTerminal.save()) + throw new IllegalArgumentException("can not create POS Terminal"); + + log.info("Creating Web store configuration..."); + MClient client = new MClient(getCtx(), AD_Client_ID, get_TrxName()); + MStore store = null; + int store_id = DB.getSQLValue(get_TrxName(), "SELECT W_STORE_ID FROM W_STORE WHERE AD_Client_ID=" + AD_Client_ID + " AND IsActive='Y' AND Name='"+client.getName() + " POS" + "'"); + if(store_id != 0) + { + store = new MStore(getCtx(), store_id , get_TrxName()); + } + else + { + store = new MStore(getCtx(), 0, get_TrxName()); + } + + store.setName(client.getName() + " POS"); + store.setM_PriceList_ID(purchasepricelistversion.getM_PriceList_ID()); + store.setWebContext(client.getName() + "pos"); + store.setSalesRep_ID(p_SalesRep_ID); + store.setAD_Org_ID(p_AD_Org_ID); + store.setWebParam5("posteritaWarmsCSS.jsp"); + store.setWebParam6("pos"); + store.setURL(p_HostAddress); + store.setM_Warehouse_ID(locator.getM_Warehouse_ID()); + if(!store.save()) + throw new IllegalArgumentException("can not create Web Store");*/ + + return ; + + } + + /** + * Create Admin Role POS web + */ + public void createAdmin() throws Exception + { + + MRole role = new MRole(getCtx(), p_AD_Role_ID, get_TrxName()); + role.setUserDiscount(BigDecimal.valueOf(0.00)); + role.setIsPersonalAccess(true); + role.setIsAccessAllOrgs(false); + role.setUserLevel(MRole.USERLEVEL_Organization); + role.save(); + + /*if(!role.isAccessAllOrgs()) + { + MRoleOrgAccess orgAccess = new MRoleOrgAccess(role,Env.getAD_Org_ID(getCtx())); + orgAccess.save(); + }*/ + + + + MUser user = new MUser(getCtx(), p_SalesRep_ID, get_TrxName()); + user.setIsFullBPAccess(true); + if(p_userPIN!=null) + { + int id[] = MUser.getAllIDs(MUser.Table_Name," AD_Client_ID=" + Env.getAD_Client_ID(getCtx()) + " and userPin='"+p_userPIN + "'",null); + + if(id.length>0) + throw new IllegalArgumentException("User Pin Already exists"); + else + user.setUserPIN(p_userPIN); + } + + user.save(); + + /*int [] commissionIds = MCommission.getAllIDs(MCommission.Table_Name," AD_CLIENT_ID="+Env.getAD_Client_ID(getCtx())+" and C_BPARTNER_ID="+user.getC_BPartner_ID()+" and isActive='Y'",null); + if(commissionIds!=null && commissionIds.length>1) + throw new IllegalArgumentException("Sales rep has more than one commission"+ commissionIds.length); + + MCommission com; + MCommissionLine comLine; + if(commissionIds==null || commissionIds.length<1) + { + com = new MCommission(getCtx(),0,get_TrxName()); + comLine = new MCommissionLine(getCtx(),0,get_TrxName()); + } + else + { + com = new MCommission(getCtx(),commissionIds[0],get_TrxName()); + MCommissionLine [] line =com.getLines(); + if(line.length!=1) + throw new IllegalArgumentException("either No commissionLine or more than One commission Line has bean defined for this bPartner"); + comLine = new MCommissionLine(getCtx(),line[0].get_ID(),get_TrxName()); + } + int [] chargeIds = MCharge.getAllIDs(MCharge.Table_Name, " AD_Client_ID = " + AD_Client_ID + " AND IsDefault='Y'", get_TrxName()); + if(chargeIds.length<1) + { + MCharge charge = new MCharge(getCtx(),0,get_TrxName()); + charge.setName(Msg.translate(getCtx(), "Commission")); + charge.setChargeAmt(new BigDecimal(0)); + //charge.setC_TaxCategory_ID(); + charge.save(); + com.setC_Charge_ID( charge.getC_Charge_ID()); + } + else + { + com.setC_Charge_ID( chargeIds[0]); + } + + + + com.setC_Charge_ID( chargeIds[0]); + com.setName(user.getName()); + com.setC_BPartner_ID(user.getC_BPartner_ID()); + com.setFrequencyType(com.FREQUENCYTYPE_Monthly); + MClient client = new MClient(getCtx(), AD_Client_ID , get_TrxName()); + com.setC_Currency_ID(client.getAcctSchema().getC_Currency_ID()); + com.setDocBasisType(com.DOCBASISTYPE_Receipt); + com.setListDetails(true); + com.save(); + + + + comLine.setC_Commission_ID(com.get_ID()); + comLine.setAmtMultiplier(Env.ZERO); + comLine.setDescription(Msg.translate(getCtx(), "Commission")); + comLine.setCommissionOrders(true); + comLine.setIsPositiveOnly(true); + comLine.setAmtSubtract(Env.ZERO); + comLine.save();*/ + + + String whereClause = " AD_Role_ID=" + role.get_ID(); + + int roleMenuIds[] = MRoleMenu.getAllIDs(MRoleMenu.Table_Name, whereClause, get_TrxName()); + + for(int i = 0; i < roleMenuIds.length; i++) + { + MRoleMenu roleMenu = new MRoleMenu(getCtx(), roleMenuIds[i], get_TrxName()); + roleMenu.delete(true); + } + + + POSMenuFactory posMFactory = POSMenuFactory.getFactoryInstance(getCtx()); + Iterator keyIter = posMFactory.getAllKeys(getCtx()).iterator(); + + while(keyIter.hasNext()) + { + String key = (String)keyIter.next(); + MWebMenu menu = (MWebMenu)posMFactory.get(getCtx(), key); + MRoleMenu roleMenu = new MRoleMenu(getCtx(), 0, get_TrxName()); + roleMenu.setAD_Role_ID(role.get_ID()); + roleMenu.setU_WebMenu_ID(menu.get_ID()); + PoManager.save(roleMenu); + } + + return; + } +} diff --git a/posterita/posterita/src/main/org/posterita/struts/admin/CheckSequenceAction.java b/posterita/posterita/src/main/org/posterita/struts/admin/CheckSequenceAction.java new file mode 100644 index 0000000000..6100034d93 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/admin/CheckSequenceAction.java @@ -0,0 +1,67 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Created on 09-Feb-2006 + */ + + +package org.posterita.struts.admin; + +import java.util.Properties; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.posterita.core.TmkJSPEnv; + +import org.posterita.businesslogic.administration.CheckSequenceManager; +import org.posterita.exceptions.SequenceUpdateException; +import org.posterita.struts.core.BaseDispatchAction; + + +public class CheckSequenceAction extends BaseDispatchAction +{ + public static final String CHECK_SEQUENCE="checkSequence"; + public ActionForward checkSequence(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws Exception + { + ActionForward fwd = init(mapping,form,request,response); + + if (fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + try + { + CheckSequenceManager.runProcess(ctx); + } + catch(SequenceUpdateException e) + { + postGlobalError("error.update.sequence",request); + return mapping.getInputForward(); + } + + + return mapping.findForward(CHECK_SEQUENCE); + + } +} diff --git a/posterita/posterita/src/main/org/posterita/struts/admin/OrganisationAction.java b/posterita/posterita/src/main/org/posterita/struts/admin/OrganisationAction.java new file mode 100644 index 0000000000..6050fc8aef --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/admin/OrganisationAction.java @@ -0,0 +1,139 @@ +package org.posterita.struts.admin; + +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.Properties; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.compiere.util.Trx; +import org.posterita.Constants; +import org.posterita.beans.OrgBean; +import org.posterita.businesslogic.OrganisationManager; +import org.posterita.core.TmkJSPEnv; +import org.posterita.exceptions.ApplicationException; +import org.posterita.exceptions.OperationException; +import org.posterita.exceptions.WarehouseAlreadyExistsException; +import org.posterita.form.OrgForm; +import org.posterita.struts.core.BaseDispatchAction; + +public class OrganisationAction extends BaseDispatchAction +{ + + public static final String UPDATE_OR_CREATE_ORG = "updateOrCreateOrg"; + public ActionForward updateOrCreateOrg(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException, SQLException, WarehouseAlreadyExistsException + { + ActionForward fwd = init(mapping,form,request,response); + if (fwd!=null) + { + return fwd; + } + + Properties ctx = TmkJSPEnv.getCtx(request); + OrgForm of = (OrgForm) form; + OrgBean bean = (OrgBean) of.getBean(); + + Trx trx = Trx.get(Trx.createTrxName(), true); + + try + { + trx.start(); + OrganisationManager.updateOrCreateOrganisation(ctx, bean, trx.getTrxName()); + trx.commit(); + } + catch (OperationException e) + { + trx.rollback(); + postGlobalError("error.process", e.getMessage(), request); + } + finally + { + trx.close(); + } + ArrayList list = OrganisationManager.getOrganisations(ctx, bean.getOrgName(), null); + + request.getSession().setAttribute(Constants.ALL_ORGS, list); + return mapping.findForward(LIST_ORGS); + } + + public static final String LIST_ORGS = "listOrgs"; + public ActionForward listOrgs(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException, SQLException + { + ActionForward fwd = init(mapping,form,request,response); + if (fwd!=null) + { + return fwd; + } + + Properties ctx = TmkJSPEnv.getCtx(request); + OrgForm of = (OrgForm) form; + OrgBean bean = (OrgBean) of.getBean(); + + String orgName = bean.getOrgName(); + ArrayList list = OrganisationManager.getOrganisations(ctx, orgName, null); + + request.getSession().setAttribute(Constants.ALL_ORGS, list); + return mapping.findForward(LIST_ORGS); + } + + public static final String ACTIVATE_ORG = "activateOrg"; + public ActionForward activateOrg(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd = init(mapping,form,request,response); + if (fwd!=null) + { + return fwd; + } + + Properties ctx = TmkJSPEnv.getCtx(request); + OrgForm of = (OrgForm) form; + OrgBean bean = (OrgBean) of.getBean(); + + Trx trx = Trx.get(Trx.createTrxName(), true); + + try + { + trx.start(); + OrganisationManager.activateOrganisation(ctx, bean, trx.getTrxName()); + trx.commit(); + } + catch (OperationException e) + { + trx.rollback(); + postGlobalError("error.process", e.getMessage(), request); + } + finally + { + trx.close(); + } + ArrayList list = new ArrayList(); + list.add(OrganisationManager.getOrganisation(ctx, bean.getOrgId())); + + request.getSession().setAttribute(Constants.ALL_ORGS, list); + return mapping.findForward(LIST_ORGS); + } + + public static final String VIEW_ORG = "viewOrg"; + public ActionForward viewOrg(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException, SQLException + { + ActionForward fwd = init(mapping,form,request,response); + if (fwd!=null) + { + return fwd; + } + + Properties ctx = TmkJSPEnv.getCtx(request); + OrgForm of = (OrgForm) form; + + OrgBean bean = (OrgBean) of.getBean(); + bean = OrganisationManager.getOrganisation(ctx, bean.getOrgId()); + of.populate(bean); + + request.getSession().setAttribute(Constants.ORG_ID,bean.getOrgId()); + return mapping.findForward(UPDATE_OR_CREATE_ORG); + } +} diff --git a/posterita/posterita/src/main/org/posterita/struts/admin/RoleAction.java b/posterita/posterita/src/main/org/posterita/struts/admin/RoleAction.java new file mode 100644 index 0000000000..3eec984603 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/admin/RoleAction.java @@ -0,0 +1,196 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Aug 16, 2005 by praveen + * + */ +package org.posterita.struts.admin; + +import java.util.ArrayList; +import java.util.Properties; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.compiere.model.MRole; +import org.compiere.util.Trx; +import org.posterita.core.TmkJSPEnv; + +import org.posterita.Constants; +import org.posterita.beans.RoleBean; +import org.posterita.businesslogic.MenuManager; +import org.posterita.businesslogic.administration.RoleManager; +import org.posterita.core.MenuItem; +import org.posterita.core.TrxPrefix; +import org.posterita.exceptions.ApplicationException; +import org.posterita.exceptions.OperationException; +import org.posterita.exceptions.RoleAlreadyExistsException; +import org.posterita.exceptions.SystemException; +import org.posterita.struts.core.BaseDispatchAction; +import org.posterita.struts.core.DefaultForm; + +public class RoleAction extends BaseDispatchAction +{ + public static final String CREATE_ROLE = "createRole"; + public static final String INIT_ROLE = "initRole"; + public static final String LIST_ROLES = "listRoles"; + public static final String VIEW_ROLE = "viewRole"; + public static final String DELETE_ROLE = "deleteRole"; + + public ActionForward createRole(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws Exception + { + ActionForward fwd = init(mapping,form,request,response); + + if (fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + DefaultForm df = (DefaultForm) form; + + RoleBean bean = (RoleBean) df.getBean(); + + + //Create Role and assign menus + MRole role; + + Trx trx = Trx.get(TrxPrefix.getPrefix(), true); + trx.start(); + try + { + role = RoleManager.createRole(ctx,bean.getOrgId(), bean.getName(),bean.getIsAccessAllOrgs(), bean.getCheckBox(), bean.getUserDiscount(), bean.getIsOverwritePriceLimit() , bean.getIsDiscountAllowedOnTotal(), bean.getIsDiscountUptoLimitPrice(), bean.getCanCreateOrder(), bean.getCanAlterOrder(), bean.getCanViewOrder(), trx.getTrxName()); + ArrayList menus = MenuManager.getMenus(ctx, role.get_ID()); + MenuItem rootItem = MenuManager.buildMenuTree(ctx, menus); + + request.getSession().setAttribute(Constants.ROLE,bean); + request.getSession().setAttribute(Constants.ROLE_MENUS, rootItem.getSubMenus()); + trx.commit(); + } + catch (RoleAlreadyExistsException e) + { + trx.rollback(); + postGlobalError("error.role.already.exists",request); + return mapping.getInputForward(); + } + finally + { + trx.close(); + } + + return mapping.findForward(CREATE_ROLE); + + } + + public ActionForward initRole(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws Exception + { + ActionForward fwd = init(mapping,form,request,response); + + if (fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + //ArrayList menuList = MenuKeyNamePair.getKeyNamePairs(ctx); + + //String menu = MenuItem.getMenu(ctx, null); + + //request.getSession().setAttribute(Constants.MENUS,menu); + + ArrayList menus = MenuManager.getMenusForOrganisationType(ctx); + MenuItem rootItem = MenuManager.buildMenuTree(ctx, menus); + + //request.getSession().setAttribute(Constants.ROLE,bean); + request.getSession().setAttribute(Constants.ROLE_MENUS, rootItem.getSubMenus()); + + return mapping.findForward(CREATE_ROLE); + + } + + public ActionForward listRoles(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, SystemException, OperationException + { + ActionForward fwd = init(mapping,form,request,response); + + if (fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + ArrayList roles = RoleManager.getAllRoles(ctx); + + request.getSession().setAttribute(Constants.ALL_ROLES,roles); + + return mapping.findForward(LIST_ROLES); + + } + + public ActionForward deleteRole(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, SystemException, OperationException + { + ActionForward fwd = init(mapping,form,request,response); + + if (fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + DefaultForm df = (DefaultForm) form; + + Integer roleId = Integer.valueOf(df.getRoleId()); + + RoleManager.deleteRole(ctx,roleId.intValue()); + + return mapping.findForward(DELETE_ROLE); + } + + + public ActionForward viewRole(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, SystemException, OperationException + { + ActionForward fwd = init(mapping,form,request,response); + + if (fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + DefaultForm df = (DefaultForm) form; + + Integer roleId = Integer.valueOf(df.getRoleId()); + + RoleBean bean = RoleManager.getRole(ctx,roleId.intValue()); + + //ArrayList menus = MenuItem.getMenu(ctx,roleId.intValue()); + + //request.getSession().setAttribute(Constants.MENUS,menus); + + ArrayList menus = MenuManager.getMenus(ctx, roleId.intValue()); + MenuItem rootItem = MenuManager.buildMenuTree(ctx, menus); + + request.getSession().setAttribute(Constants.ROLE,bean); + request.getSession().setAttribute(Constants.ROLE_MENUS, rootItem.getSubMenus()); + + request.getSession().setAttribute(Constants.ROLE,bean); + + return mapping.findForward(VIEW_ROLE); + + } + + + +} diff --git a/posterita/posterita/src/main/org/posterita/struts/attachment/AttachmentAction.java b/posterita/posterita/src/main/org/posterita/struts/attachment/AttachmentAction.java new file mode 100644 index 0000000000..1f16aaa74d --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/attachment/AttachmentAction.java @@ -0,0 +1,126 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 26-Aug-2005 by alok + * + */ +package org.posterita.struts.attachment; + +import java.io.FileNotFoundException; +import java.util.Properties; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.apache.struts.upload.FormFile; +import org.compiere.util.Trx; +import org.posterita.core.TmkJSPEnv; + +import org.posterita.Constants; +import org.posterita.beans.AttachmentBean; +import org.posterita.businesslogic.core.AttachmentManager; +import org.posterita.core.TrxPrefix; +import org.posterita.exceptions.ApplicationException; +import org.posterita.exceptions.OperationException; +import org.posterita.struts.core.BaseDispatchAction; +import org.posterita.struts.core.DefaultForm; + +public class AttachmentAction extends BaseDispatchAction +{ + public static final String CREATE_ATTACHMENT = "createAttachment"; + public ActionForward createAttachment(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + DefaultForm df = (DefaultForm) form; + + AttachmentBean bean = (AttachmentBean) df.getBean(); + + FormFile logo = (FormFile) df.getLogo(); + + Trx trx = Trx.get(Trx.createTrxName(TrxPrefix.getPrefix()), true); + + + try + { + trx.start(); + AttachmentManager.attachImage(ctx,logo,bean.getLogoName()); + trx.commit(); + } + catch (FileNotFoundException e) + { + trx.rollback(); + postGlobalError("error.source.file.notpresent", request); + mapping.getInputForward(); + } + catch (OperationException e) + { + trx.rollback(); + postGlobalError("error.file.save", request); + mapping.getInputForward(); + } + finally + { + trx.close(); + } + + return mapping.findForward(CREATE_ATTACHMENT); + + } + + public static final String GET_ATTACHMENT = "getAttachment"; + + public ActionForward getAttachment(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd = init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + DefaultForm df = (DefaultForm) form; + AttachmentBean bean = (AttachmentBean) df.getBean(); + String logo = AttachmentManager.getImage(ctx,bean.getLogoName()); + + request.getSession().setAttribute(Constants.GET_LOGO,logo); + + return mapping.findForward(GET_ATTACHMENT); + + } + +} + + + + + + + + + + + + + + diff --git a/posterita/posterita/src/main/org/posterita/struts/attachment/ImageAttachmentAction.java b/posterita/posterita/src/main/org/posterita/struts/attachment/ImageAttachmentAction.java new file mode 100644 index 0000000000..07e5a51c3b --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/attachment/ImageAttachmentAction.java @@ -0,0 +1,54 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Mar 13, 2006 by praveen + * + */ +package org.posterita.struts.attachment; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; + +import org.posterita.exceptions.ApplicationException; +import org.posterita.struts.core.BaseDispatchAction; + +public class ImageAttachmentAction extends BaseDispatchAction +{ + public ActionForward getImage(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException + { + ActionForward fwd = init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + return null; + } + + public ActionForward getThumbnailImage(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException + { + ActionForward fwd = init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + return null; + } + +} diff --git a/posterita/posterita/src/main/org/posterita/struts/attributes/AttributesAction.java b/posterita/posterita/src/main/org/posterita/struts/attributes/AttributesAction.java new file mode 100644 index 0000000000..83304780e7 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/attributes/AttributesAction.java @@ -0,0 +1,134 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 26-Aug-2005 by alok + * + */ + +package org.posterita.struts.attributes; + +import java.util.ArrayList; +import java.util.Properties; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.compiere.util.KeyNamePair; +import org.compiere.util.Trx; +import org.posterita.Constants; +import org.posterita.beans.AttributeValueDetailBean; +import org.posterita.businesslogic.AttributeValuesManager; +import org.posterita.core.TmkJSPEnv; +import org.posterita.core.TrxPrefix; +import org.posterita.struts.core.BaseDispatchAction; +import org.posterita.struts.core.DefaultForm; + +public class AttributesAction extends BaseDispatchAction +{ + public static final String INIT_VIEW_ATTRIBUTEVALUES = "initViewAttributeValues"; + public ActionForward initViewAttributeValues(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws Exception + { + ActionForward fwd = init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + ArrayList attributeList = AttributeValuesManager.getAttributes(ctx); + + request.getSession().setAttribute(Constants.ATTRIBUTE_LIST, attributeList); + + return mapping.findForward(INIT_VIEW_ATTRIBUTEVALUES); + } + + public static final String LIST_ATTRIBUTEVALUES = "listAttributeValues"; + public ActionForward listAttributeValues(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws Exception + { + ActionForward fwd = init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + DefaultForm df = (DefaultForm)form; + + AttributeValueDetailBean attrValBean = (AttributeValueDetailBean)df.getBean(); + + ArrayList attributeValuesList =null; + if(attrValBean.getAttributeId()!=null) + { + attributeValuesList= AttributeValuesManager.getAttributeValues(ctx, attrValBean.getAttributeId().intValue()); + request.setAttribute(Constants.ATTRIBUTE_VALUES_LIST, attributeValuesList); + } + + return mapping.findForward(LIST_ATTRIBUTEVALUES); + } + + + + public static final String INITEDIT_ATTRIBUTEVALUE = "initEditAttributeValue"; + public ActionForward initEditAttributeValue(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws Exception + { + ActionForward fwd = init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + return mapping.findForward(INITEDIT_ATTRIBUTEVALUE); + } + + /*public static final String EDIT_ATTRIBUTEVALUE = "editAttributeValue"; + public ActionForward editAttributeValue(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws Exception + { + ActionForward fwd = init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + DefaultForm df = (DefaultForm)form; + + AttributeValueDetailBean attrBean = (AttributeValueDetailBean)df.getBean(); + + Trx trx = Trx.get(TrxPrefix.getPrefix(), true); + trx.start(); + + try + { + int newAttrValueId = AttributeValuesManager.changeAttributeValue(ctx, attrBean.getAttributeValueId().intValue(), attrBean.getNewName(), trx.getTrxName()); + WBProductManager.updateProductsAttribute(ctx, attrBean.getAttributeValueId().intValue(), newAttrValueId, attrBean.getAttributeId().intValue(), trx.getTrxName()); + trx.commit(); + } + catch(Exception ex) + { + trx.rollback(); + postGlobalError("error.updating.attribute", request); + return mapping.getInputForward(); + } + finally + { + trx.close(); + } + + + return mapping.findForward(EDIT_ATTRIBUTEVALUE); + } */ + +} diff --git a/posterita/posterita/src/main/org/posterita/struts/bPartner/BPartnerAction.java b/posterita/posterita/src/main/org/posterita/struts/bPartner/BPartnerAction.java new file mode 100644 index 0000000000..b27ac9904f --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/bPartner/BPartnerAction.java @@ -0,0 +1,301 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 25-Jul-2005 by alok + * + */ +package org.posterita.struts.bPartner; + +import java.util.ArrayList; +import java.util.Properties; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.compiere.model.MOrg; +import org.compiere.util.Trx; + +import org.posterita.Constants; +import org.posterita.beans.BPartnerBean; +import org.posterita.beans.StatementOfAccountBean; +import org.posterita.businesslogic.OrganisationManager; +import org.posterita.businesslogic.administration.BPartnerManager; +import org.posterita.core.TmkJSPEnv; +import org.posterita.core.TrxPrefix; +import org.posterita.exceptions.ApplicationException; +import org.posterita.exceptions.BPartnerAlreadyExistsException; +import org.posterita.exceptions.OperationException; +import org.posterita.form.BPartnerForm; +import org.posterita.form.CreateBPartnerForm; +import org.posterita.keyname.RegionKeyNamePair; +import org.posterita.lib.UdiConstants; +import org.posterita.struts.core.BaseDispatchAction; +import org.posterita.struts.core.DefaultForm; + + +public class BPartnerAction extends BaseDispatchAction +{ + public static final String CREATE_BPARTNER = "createBPartner"; + public static final String GET_REGION = "getRegion"; + + public ActionForward getRegion(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd = init(mapping,form,request,response); + + if(fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + ArrayList region = RegionKeyNamePair.getKeyNamePairs(ctx); + request.getSession().setAttribute(Constants.REGIONS,region); + + return mapping.findForward(GET_REGION); + + } + + public ActionForward createBPartner(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + DefaultForm df = (DefaultForm) form; + + BPartnerBean bean = (BPartnerBean) df.getBean(); + + Properties ctx = TmkJSPEnv.getCtx(request); + + MOrg parentOrg = OrganisationManager.getMyOrg(ctx); + + Trx trx = Trx.get(TrxPrefix.getPrefix(), true); + trx.start(); + + try + { + int countryId =UdiConstants.COUNTRY_SOUTH_AFRICA; + BPartnerManager.createBPartner(ctx, parentOrg.get_ID(), parentOrg.getLinkedC_BPartner_ID(null), bean.getPartnerName(),bean.getName2(),bean.getIsCustomer().booleanValue(),bean.getIsVendor().booleanValue(),bean.getIsEmployee().booleanValue(),bean.getIsSalesRep().booleanValue(),bean.getAddress1(),bean.getAddress2(),bean.getPostalAddress(), bean.getRegionId(), bean.getCity(),bean.getPhone(),bean.getFax(),countryId, true, true, trx.getTrxName()); + + request.getSession().setAttribute(Constants.BUSINESSPARTNER,bean); + trx.commit(); + } + catch(BPartnerAlreadyExistsException exp) + { + trx.rollback(); + postGlobalError("error.bp.alreadyexist", request); + return mapping.getInputForward(); + } + finally + { + trx.close(); + } + + + return mapping.findForward(CREATE_BPARTNER); + } + + + + //------------------------------------------------------------------------------------------------------- + + public static final String INIT_EDIT_BPARTNER_DETAILS = "initEditBpartnerDetails"; + public ActionForward initEditBpartnerDetails(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd = init(mapping, form, request, response); + if (fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + CreateBPartnerForm bPf = (CreateBPartnerForm) form; + + int bPartnerId = Integer.parseInt(bPf.getBpartnerId()); + + Trx trx = Trx.get(TrxPrefix.getPrefix(), true); + + BPartnerBean bean = new BPartnerBean(); + + try + { + trx.start(); + bean = BPartnerManager.getBpartner(ctx,bPartnerId, trx.getTrxName()); + trx.commit(); + } + catch (OperationException e) + { + trx.rollback(); + postGlobalError("error.get.partner.detail", request); + mapping.getInputForward(); + } + finally + { + trx.close(); + } + + bPf.populate(bean); + + ArrayList region = RegionKeyNamePair.getKeyNamePairs(ctx); + request.getSession().setAttribute(Constants.REGIONS,region); + + return mapping.findForward(INIT_EDIT_BPARTNER_DETAILS); + } + + public static final String EDIT_BPARTNER_DETAILS = "editBpartnerDetails"; + public ActionForward editBpartnerDetails(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd = init(mapping, form, request, response); + if (fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + DefaultForm df = (DefaultForm) form; + BPartnerBean bean = (BPartnerBean) df.getBean(); + + + BPartnerManager.editBPartner(ctx, bean.getOrgId() , bean.getBpartnerId().intValue(), bean.getPartnerName(),bean.getName2(),bean.getIsCustomer().booleanValue(),bean.getIsVendor().booleanValue(),bean.getIsEmployee().booleanValue(),bean.getIsSalesRep().booleanValue(),bean.getAddress1(),bean.getAddress2(),bean.getPostalAddress(),bean.getCity(),bean.getPhone(),null,bean.getFax(),0,null); + + + return mapping.findForward(EDIT_BPARTNER_DETAILS); + } + + public static final String ACTIVATE_BPARTNER = "activateBPartner"; + public ActionForward activateBPartner(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException + { + ActionForward fwd = init(mapping, form, request, response); + if (fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + DefaultForm df = (DefaultForm) form; + + int bpartnerId = Integer.parseInt(df.getBpartnerId()); + boolean isActive = Boolean.parseBoolean(df.getIsActive()); + + Trx trx = Trx.get(TrxPrefix.getPrefix(), true); + + + try + { + trx.start(); + BPartnerManager.activateBPartner(ctx,bpartnerId,isActive,trx.getTrxName()); + trx.commit(); + } + catch (OperationException e) + { + trx.rollback(); + postGlobalError("error.activate.partner", request); + mapping.getInputForward(); + } + finally + { + trx.close(); + } + + return mapping.findForward(ACTIVATE_BPARTNER); + } + + public static final String SEARCH_BPARTNER = "searchBPartner"; + public ActionForward searchBPartner(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd = init(mapping, form, request, response); + if (fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + DefaultForm df = (DefaultForm) form; + + ArrayList bplist = new ArrayList(); + + bplist = BPartnerManager.searchBpartners(ctx,df.getName(),null); + + request.getSession().setAttribute(Constants.ALLBUSINESSPARTNERS,bplist); + return mapping.findForward(SEARCH_BPARTNER); + } + + public static final String GET_CREDITORS = "getCreditors"; + public ActionForward getCreditors(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd = init(mapping, form, request, response); + if (fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + ArrayList bplist = BPartnerManager.getCreditorsDebtors(ctx, true, null); + + request.getSession().setAttribute(Constants.CREDITORS,bplist); + return mapping.findForward(GET_CREDITORS); + } + + public static final String GET_DEBTORS = "getDebtors"; + public ActionForward getDebtors(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd = init(mapping, form, request, response); + if (fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + ArrayList bplist = BPartnerManager.getCreditorsDebtors(ctx, false, null); + + request.getSession().setAttribute(Constants.DEBTORS,bplist); + return mapping.findForward(GET_DEBTORS); + } + + public static final String GET_CREDITOR_HISTORY = "getCreditorHistory"; + public ActionForward getCreditorHistory(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd = init(mapping, form, request, response); + if (fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + BPartnerForm pf = (BPartnerForm) form; + BPartnerBean bean = (BPartnerBean)pf.getBean(); + + int c_bpartner_id = bean.getBpartnerId(); + + ArrayList history = BPartnerManager.getCreditorsHistory(ctx, c_bpartner_id, null, null, null); + request.getSession().setAttribute(Constants.CREDITOR_HISTORY, history); + request.getSession().setAttribute(Constants.BPARTNER, bean); + + return mapping.findForward(GET_CREDITOR_HISTORY); + } + + public static final String GET_DEBTOR_HISTORY = "getDebtorHistory"; + public ActionForward getDebtorHistory(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd = init(mapping, form, request, response); + if (fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + BPartnerForm pf = (BPartnerForm) form; + BPartnerBean bean = (BPartnerBean)pf.getBean(); + + int c_bpartner_id = bean.getBpartnerId(); + + ArrayList history = BPartnerManager.getDebtorsHistory(ctx, c_bpartner_id, null, null, null); + request.getSession().setAttribute(Constants.DEBTOR_HISTORY, history); + request.getSession().setAttribute(Constants.BPARTNER, bean); + + return mapping.findForward(GET_DEBTOR_HISTORY); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/struts/bPartner/ViewBPartnerAction.java b/posterita/posterita/src/main/org/posterita/struts/bPartner/ViewBPartnerAction.java new file mode 100644 index 0000000000..55a2ce36fb --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/bPartner/ViewBPartnerAction.java @@ -0,0 +1,138 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Aug 18, 2005 by Alok + */ + +package org.posterita.struts.bPartner; + +import java.util.ArrayList; +import java.util.Properties; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.compiere.util.Trx; +import org.posterita.core.TmkJSPEnv; + +import org.posterita.Constants; +import org.posterita.beans.BPartnerBean; +import org.posterita.businesslogic.administration.BPartnerManager; +import org.posterita.core.TrxPrefix; +import org.posterita.exceptions.ApplicationException; +import org.posterita.exceptions.OperationException; +import org.posterita.struts.core.BaseDispatchAction; +import org.posterita.struts.core.DefaultForm; + +public class ViewBPartnerAction extends BaseDispatchAction +{ + public static final String GET_ALL_BPARTNERS = "getAllBpartners"; + public ActionForward getAllBpartners(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException + { + ActionForward fwd = init(mapping,form,request,response); + if (fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + Trx trx = Trx.get(TrxPrefix.getPrefix(), true); + + + ArrayList bpartners = new ArrayList(); + + try + { + trx.start(); + bpartners = BPartnerManager.getAllBpartners(ctx, trx.getTrxName()); + trx.commit(); + } + catch (OperationException e) + { + trx.rollback(); + postGlobalError("error.getall.partners", request); + mapping.getInputForward(); + } + finally + { + trx.close(); + } + + request.getSession().setAttribute(Constants.ALLBUSINESSPARTNERS, bpartners); + + return mapping.findForward(GET_ALL_BPARTNERS); + + } + + public static final String VIEW_BPARTNER_DETAILS = "viewBpartnerDetails"; + public ActionForward viewBpartnerDetails(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException + { + ActionForward fwd = init(mapping, form, request, response); + if (fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + DefaultForm df = (DefaultForm) form; + BPartnerBean bean = (BPartnerBean) df.getBean(); + + ArrayList bpartners = (ArrayList) request.getSession().getAttribute(Constants.ALLBUSINESSPARTNERS); + + Trx trx = Trx.get(TrxPrefix.getPrefix(), true); + + + try + { + trx.start(); + + if(bpartners == null) + bpartners = BPartnerManager.getAllBpartners(ctx, trx.getTrxName()); + + trx.commit(); + } + catch (OperationException e) + { + trx.rollback(); + postGlobalError("error.get.partner.detail", request); + mapping.getInputForward(); + } + finally + { + trx.close(); + } + + try + { + bean = BPartnerManager.getBpartner(ctx, bean.getBpartnerId(), trx.getTrxName()); + } + catch (OperationException e) + { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + request.getSession().setAttribute(Constants.BUSINESSPARTNERSDETAILS, bean); + + + return mapping.findForward(VIEW_BPARTNER_DETAILS); + + } + +} diff --git a/posterita/posterita/src/main/org/posterita/struts/core/AjaxAction.java b/posterita/posterita/src/main/org/posterita/struts/core/AjaxAction.java new file mode 100644 index 0000000000..35a426f8a6 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/core/AjaxAction.java @@ -0,0 +1,53 @@ +/****************************************************************************** + * Product: Posterita Web-Based POS and Adempiere Plugin * + * Copyright (C) 2008 Posterita Ltd * + * This file is part of POSterita * + * * + * POSterita is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * + *****************************************************************************/ +package org.posterita.struts.core; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.posterita.pos.taglib.AjaxTag; + +/** + * @author Ashley G Ramdass + * Apr 22, 2008 + */ +public class AjaxAction extends BaseDispatchAction +{ + public static final String PROCESS_REQUEST_PARAM = "RequestProcessor"; + public static final String AJAX_TAG_PACKAGE = "org.posterita.pos.taglib"; + + public ActionForward processRequest(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) + { + try + { + String tagClass = request.getParameter(PROCESS_REQUEST_PARAM); + AjaxTag tag = (AjaxTag)Class.forName(AJAX_TAG_PACKAGE + "." + tagClass).newInstance(); + tag.processRequest(request, response); + } + catch (Exception ex) + { + + } + return null; + } +} diff --git a/posterita/posterita/src/main/org/posterita/struts/core/BaseAction.java b/posterita/posterita/src/main/org/posterita/struts/core/BaseAction.java new file mode 100644 index 0000000000..1c7342dcf6 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/core/BaseAction.java @@ -0,0 +1,151 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 25-Jul-2005 by alok + * + */ + +package org.posterita.struts.core; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.Globals; +import org.apache.struts.action.Action; +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.apache.struts.action.ActionMessage; +import org.apache.struts.action.ActionMessages; +import org.apache.struts.action.ActionServlet; +import org.apache.struts.config.ModuleConfig; +import org.apache.struts.util.RequestUtils; + +import org.posterita.exceptions.ApplicationException; +import org.posterita.user.WebUserInfo; + + +public class BaseAction extends Action +{ + + public static final String LOGIN_HOME = "loginHome"; + public ActionForward init(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException + { + WebUserInfo userInfo = (WebUserInfo) request.getSession().getAttribute(WebUserInfo.NAME); + + if (userInfo == null) + return mapping.findForward(LOGIN_HOME); + else + return null; + + + + } + + protected void postGlobalError(String errorKey, HttpServletRequest request) + { + postGlobalError(errorKey, null, request); + } + + protected void postComplexGlobalError(String errorKey, Object[] args,HttpServletRequest request) + { + + ActionMessage message = (args.length == 0 ? + new ActionMessage(errorKey): + new ActionMessage(errorKey, args)); + + ActionMessages messages = new ActionMessages(); + messages.add(ActionMessages.GLOBAL_MESSAGE, message); + saveErrors(request, messages); + + + + } + + protected void postGlobalError(String errorKey, Object arg, HttpServletRequest request) + { + //TODO Replace this code + ActionMessage message = (arg == null ? + new ActionMessage(errorKey): + new ActionMessage(errorKey, arg)); + + ActionMessages messages = new ActionMessages(); + messages.add(ActionMessages.GLOBAL_MESSAGE, message); + saveErrors(request, messages); + + // workflow + //TODO Integrate this code when workflow works + //WorkFlowManager.removeLastWorkFlowAction(request); + } + + protected void postGlobalMessage(String msgKey, Object arg, HttpServletRequest request) + { + //TODO Replace this code + ActionMessage message = (arg == null ? + new ActionMessage(msgKey): + new ActionMessage(msgKey, arg)); + + ActionMessages messages = new ActionMessages(); + messages.add(ActionMessages.GLOBAL_MESSAGE, message); + saveMessages(request, messages); + + // workflow + //TODO Integrate this code when workflow works + //WorkFlowManager.removeLastWorkFlowAction(request); + } + + protected ActionForm getForm(String formName, String path, HttpServletRequest request) + { + return getForm(formName, path, request, getServlet()); + } + + protected ActionForm getForm(String formName, String path, HttpServletRequest request, ActionServlet servlet) + { + // check if the form is in the request scope + ActionForm form = (ActionForm) request.getAttribute(formName); + + // check if the form is in the session scope + if (form == null) + { + form = (ActionForm) request.getSession().getAttribute(formName); + } + // if not found in any of these create one and set it in the appropriate scope. + if(form == null) + { + ModuleConfig appConfig = (ModuleConfig) request.getAttribute(Globals.MODULE_KEY); + + ActionMapping mapping = (ActionMapping) appConfig.findActionConfig(path); + + form = RequestUtils.createActionForm(request,mapping,appConfig, servlet); + + String key = mapping.getAttribute(); + + if (!key.equals(formName)) + throw new RuntimeException("error.baseAction.InvalidFormName"); + + if(mapping.getScope().equals("request")) + request.setAttribute(key, form); + else + request.getSession().setAttribute(key, form); + + } + return form; + + } + +} diff --git a/posterita/posterita/src/main/org/posterita/struts/core/BaseDispatchAction.java b/posterita/posterita/src/main/org/posterita/struts/core/BaseDispatchAction.java new file mode 100644 index 0000000000..d8b6e40f82 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/core/BaseDispatchAction.java @@ -0,0 +1,141 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 25-Jul-2005 by alok + * + */ + +package org.posterita.struts.core; + +import java.util.ArrayList; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.apache.struts.action.ActionMessage; +import org.apache.struts.action.ActionMessages; +import org.apache.struts.actions.DispatchAction; +import org.compiere.util.WebSessionCtx; +import org.displaytag.tags.TableTagParameters; +import org.displaytag.util.ParamEncoder; +import org.posterita.Constants; +import org.posterita.core.MenuItem; +import org.posterita.exceptions.ApplicationException; + +public class BaseDispatchAction extends DispatchAction +{ + BaseAction act = new BaseAction(); + + public static final String LOGIN_HOME = "loginHome"; + public static final String APPLICATION_ERROR = "applicationError"; + public static final String CHOOSE_APPLICATION = "chooseApplication"; + public ActionForward init(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException + { + Object webSessionCtx = request.getSession().getAttribute(WebSessionCtx.NAME); + + DefaultForm df = (DefaultForm) form; + + if (df != null) + if ((request.getSession().getAttribute(Constants.MENUS) != null) && (df.getMenuId() != null)) + { + MenuItem menuItem = (MenuItem) request.getSession().getAttribute(Constants.MENUS); + + Integer menuId = Integer.valueOf(df.getMenuId()); + ArrayList list = menuItem.getBreadCrumb(menuId.intValue()); + + request.getSession().setAttribute(Constants.BREADCRUMB, list); + } + + + if (webSessionCtx == null) // Session Timeout + { + return mapping.findForward(CHOOSE_APPLICATION); + } + else + return null; + } + + + + protected void postGlobalError(String errorKey, HttpServletRequest request) + { + act.postGlobalError(errorKey, null, request); + } + + protected void postGlobalError(String errorKey, Object arg, HttpServletRequest request) + { + act.postGlobalError(errorKey, arg, request); + } + + protected void postGlobalMessage(String msgKey, HttpServletRequest request) + { + act.postGlobalMessage(msgKey, null, request); + } + + protected ActionForm getForm(String formName, String path, HttpServletRequest request) + { + return act.getForm(formName, path, request, getServlet()); + } + + + public Object getAttribute(HttpServletRequest request, Class vo) + { + Object object = request.getSession().getAttribute(getClass().getName()+vo.getName()); + request.getSession().setAttribute(getClass().getName()+vo.getName(),null); + return object; + } + + protected void postComplexGlobalError(String errorKey, Object[] args,HttpServletRequest request) + { + + ActionMessage message = (args.length == 0 ? + new ActionMessage(errorKey): + new ActionMessage(errorKey, args)); + + ActionMessages messages = new ActionMessages(); + messages.add(ActionMessages.GLOBAL_MESSAGE, message); + saveErrors(request, messages); + } + + /** + * Checks whether the request is an action on the display tag table (Paging, sorting) + * @param request Server Request + * @return True if the request is a display tag action + */ + protected boolean isDisplayTagAction(HttpServletRequest request) + { + String tableId = request.getParameter(Constants.DISPLAYTAG_TABLE_ID); + + if (tableId == null || tableId.trim().length() == 0) + { + return false; + } + + String strOrder = request.getParameter(new ParamEncoder(tableId).encodeParameterName(TableTagParameters.PARAMETER_ORDER)); + String strPage = request.getParameter(new ParamEncoder(tableId).encodeParameterName(TableTagParameters.PARAMETER_PAGE)); + String strSort = request.getParameter(new ParamEncoder(tableId).encodeParameterName(TableTagParameters.PARAMETER_SORT)); + + return ((strOrder != null && strOrder.trim().length() > 0) + || (strPage != null && strPage.trim().length() > 0) + || (strSort != null && strSort.trim().length() > 0)); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/struts/core/BaseForm.java b/posterita/posterita/src/main/org/posterita/struts/core/BaseForm.java new file mode 100644 index 0000000000..8131b328f9 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/core/BaseForm.java @@ -0,0 +1,983 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 25-Jul-2005 by alok + * + */ +package org.posterita.struts.core; + +import java.lang.reflect.InvocationTargetException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; + +import javax.servlet.http.HttpServletRequest; + +import org.apache.commons.beanutils.PropertyUtils; +import org.apache.struts.Globals; +import org.apache.struts.action.ActionErrors; +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionMapping; +import org.apache.struts.action.ActionMessage; +import org.apache.struts.util.MessageResources; +import org.compiere.model.MPayment; + +import org.posterita.core.EmailValidator; +import org.posterita.core.JulianDate; +import org.posterita.core.Range; +import org.posterita.exceptions.ApplicationException; +import org.posterita.exceptions.FormattingException; +import org.posterita.formatter.Formatter; + + + +/** + * An abstract base class for ActionForms that adds support for automatic formatting + * and unformatting of string values and for the transfer of the resulting values + * between itself and the given bean. The populate() method provides + * and entry point to this functionality, while the keysToSkip method allows + * subclasses to specify fields that should not be populated. + *

    + * + * Additional methods are provided to allow subclasses to override formatting defaults. + * The DefaultString() method allows callers to specify overrides for the default + * string used to represent a null for a given property. Similarly, + * the setFormatterype() method allows callers to specify a + * formatting type other than the default for a given property. + *

    + * Developers can also specify validation rules by invoking addRange() + * to add a range validation or addRequiredFields() to add required field validations + * for an array of property names. + * + */ +public class BaseForm extends ActionForm +{ + /** + * + */ + private static final long serialVersionUID = 1L; + private Map defaultStringMap = new HashMap(); + private Map formatMap = new HashMap(); + MessageResources resources = null; + + public final static int TO_OBJECT = 0; + public final static int TO_STRING = 1; + public final static int MIN_LENGTH = 6; + + public final static String REQUIRED = "required"; + public final static String RANGE = "range"; + public final static String STRING_NUMBER="stringNumber"; + public final static String EMAIL_VALID = "emailValid"; + public final static String MIN_LENGTH_VALID = "minLengthValid"; + public final static String MATCH_FIELDS = "matchFields"; + public final static String DATE_FIELDS_VALID = "dateValid"; + public final static String IMAGE_FILE_EXT_VALID = "imageFileValid"; + public static final String YEAR_VALID = "yearValid"; + public static final String CREDITCARD_VALID = "creditcardValid"; + public static final String CVV_VALID = "cvvValid"; + public static final String EXPIRY_DATE_VALID = "expiryDateValid"; + private static final String ACCOUNT_VALID = "accountValid"; + private int currentYear = java.util.Calendar.getInstance().get(java.util.Calendar.YEAR); + private int currentMonth = java.util.Calendar.getInstance().get(java.util.Calendar.MONTH) + 1; + + private transient Object bean; + private Map validationMap = new HashMap(); + + public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) + { + /* + * This is where you need to get the country specific details. + */ + + resources = (MessageResources)request.getAttribute(Globals.MESSAGES_KEY); + + ActionErrors errors = populate(this.bean, TO_OBJECT); + return errors; + + } + + public ActionErrors populate(Object vo) + { + return populate(vo,TO_STRING); + } + + /* + * field1 does not contain the value of the field but contains the name of the field. + */ + public void addMatchFields(String key, String otherFieldName) + { + addValidationRule(key, MATCH_FIELDS, otherFieldName); + } + + public void addDateFieldsValidation(String key, String otherKey) + { + addValidationRule(key, DATE_FIELDS_VALID, otherKey); + } + + public void addCreditCardFieldsValidation(String key) + { + addValidationRule(key, CREDITCARD_VALID, Boolean.TRUE); + } + + public void addAccountFieldValidation(String key) + { + addValidationRule(key, ACCOUNT_VALID, Boolean.TRUE); + } + + public void addCVVFieldsValidation(String key) + { + addValidationRule(key, CVV_VALID, Boolean.TRUE); + } + + public void addCreditCardExpiryDateFieldsValidation(String key) + { + addValidationRule(key, EXPIRY_DATE_VALID, Boolean.TRUE); + } + + @SuppressWarnings("unchecked") + public void addValidationRule(String key, String rule, Object value) + { + Map values =(Map) validationMap.get(key); + if (values == null) + { + values = new HashMap(); + validationMap.put(key,values); + } + + values.put(rule, value); + } + + + public void addRequiredFields(String[] keys) + { + for (int i=0; i< keys.length; i++) + { + addValidationRule(keys[i],REQUIRED, Boolean.TRUE); + } + } + + + public void addRange(String key, Comparable min, Comparable max) + { + Range range = new Range(min,max); + addValidationRule(key,RANGE, range); + } + + public void addEmailValidation(String key) + { + addValidationRule(key,EMAIL_VALID,Boolean.TRUE); + } + + public void addYearValidation(String key) + { + addValidationRule(key, YEAR_VALID, Boolean.TRUE ); + } + + public void addValidateCustomerNumber(String key) + { + addValidationRule(key,STRING_NUMBER,Boolean.TRUE); + } + + + public void addImageFileExtensionValidation(String key) + { + addValidationRule(key, IMAGE_FILE_EXT_VALID, Boolean.TRUE); + } + + public void addMinLengthValidation(String key, Integer min, Integer max) + { + Range range = new Range(min, max); + addValidationRule(key,MIN_LENGTH_VALID,range); + } + + public Object getBean() throws ApplicationException + { + return bean; + } + + public void setBean(Object bean) + { + this.bean = bean; + } + + + + public ActionErrors populate(Object vo, int mode) + { + String errorMsg = "Unable to format values from bean: "+ vo; + + //Object source = (mode == TO_STRING ? bean : this); + Object target = (mode == TO_STRING ? vo : this); + + + Map valueMap = mapRepresentation(target, mode); + + ActionErrors errors = new ActionErrors(); + + + if(mode == TO_STRING) + { + setBean(vo); + } + + Iterator keyIter = valueMap.keySet().iterator(); + + while(keyIter.hasNext()) + { + String currKey = (String) keyIter.next(); + Object currValue = valueMap.get(currKey); + + try + { + ActionErrors currErrors = populateProperty(vo,currKey, currValue, mode, valueMap); + errors.add(currErrors); + + } + catch(InstantiationException ie) + { + throw new FormattingException(errorMsg, ie); + } + catch(IllegalAccessException iae) + { + throw new FormattingException(errorMsg, iae); + } + catch(InvocationTargetException ite) + { + throw new FormattingException(errorMsg,ite); + } + catch(NoSuchMethodException nsme) + { + //throw new FormattingException(errorMsg,nsme); + // There can be some assymetry in the form and the bean so do not treat this as an exception. + } + } + + return errors; + } + + /** + * @param target + * @param mode + * @return + */ + public Map mapRepresentation(Object vo, int mode) + { + String errorMsg = "Unable to format values from bean: "+ vo; + + + Map valueMap = null; + + try + { + valueMap = PropertyUtils.describe(vo); + } + catch(IllegalAccessException iae) + { + throw new FormattingException(errorMsg, iae); + } + catch(InvocationTargetException ite) + { + throw new FormattingException(errorMsg, ite); + } + catch(NoSuchMethodException nsme) + { + throw new FormattingException(errorMsg,nsme); + } + + Iterator keyIter = keysToSkip().iterator(); + + while(keyIter.hasNext()) + { + String key = (String) keyIter.next(); + valueMap.remove(key); + } + + return valueMap; + } + + protected Object convert(Class type, String key, Object obj, int mode) + throws InstantiationException, IllegalAccessException, NoSuchMethodException, InvocationTargetException, NumberFormatException + { + Object convertedObj = null; + Formatter formatter = getFormatter(key, type); + + try + { + switch(mode) + { + case TO_OBJECT: + convertedObj = formatter.unformat(obj); + break; + case TO_STRING: + if (obj == null) + convertedObj = (String) defaultStringMap.get(key); + else + convertedObj = formatter.format(obj); + + /** + * This let's the toDate being converted into endDay, endMonth and endYear + * note that the String here are sensitive. + */ + + if (key.equals("toDate")) + { + JulianDate dateValue = (JulianDate) obj; + if (dateValue != null) + { + PropertyUtils.setSimpleProperty(this, "endDay", ""+dateValue.getDay()); + PropertyUtils.setSimpleProperty(this, "endMonth", ""+dateValue.getMonth()); + PropertyUtils.setSimpleProperty(this, "endYear", ""+dateValue.getYear()); + } + else + { + PropertyUtils.setSimpleProperty(this, "endDay", ""); + PropertyUtils.setSimpleProperty(this, "endMonth", ""); + PropertyUtils.setSimpleProperty(this, "endYear", ""); + } + + } + if (key.equals("fromDate")) + { + JulianDate dateValue = (JulianDate) obj; + if (dateValue != null) + { + PropertyUtils.setSimpleProperty(this, "startDay", ""+dateValue.getDay()); + PropertyUtils.setSimpleProperty(this, "startMonth", ""+dateValue.getMonth()); + PropertyUtils.setSimpleProperty(this, "startYear", ""+dateValue.getYear()); + } + else + { + PropertyUtils.setSimpleProperty(this, "startDay", ""); + PropertyUtils.setSimpleProperty(this, "startMonth", ""); + PropertyUtils.setSimpleProperty(this, "startYear", ""); + } + } + + break; + + default: + throw new RuntimeException("Unknown mode:" + mode); + + } + } + catch(FormattingException e) + { + e.setFormatter(formatter); + throw e; + } + + return convertedObj; + } + + + protected Object getKeyStringValue(String key, int mode) + { + Object target = (mode == TO_STRING ? this.bean : this); + Map valueMap = mapRepresentation(target, mode); + + Object currValue = valueMap.get(key); + + return currValue; + + } + + + protected ActionErrors populateProperty(Object vo, String key, Object obj, int mode, Map valueMap) + throws InstantiationException, IllegalAccessException, NoSuchMethodException, InvocationTargetException + { + + Object target = (mode == TO_STRING? this : vo); + Class type = PropertyUtils.getPropertyType(vo, key); + ActionErrors errors = new ActionErrors(); + + Object value = null; + + if (mode == TO_STRING) + { + value = convert(type, key, obj, mode); + } + else + { + try + { + String errorKey = null; + + value = convert(type, key, obj, mode); + + errorKey = validateRequired(key, obj); + + if (errorKey == null) + errorKey = validateRange(key, value); + if (errorKey == null) + errorKey = validateEmail(key,value); + if (errorKey == null) + errorKey = validateLength(key, obj); + if (errorKey == null) + errorKey = validateImageFileExtension(key, obj); + if (errorKey == null) + errorKey = validateMatchFields(key,value, vo, valueMap); + if (errorKey == null) + errorKey = validateCustomerNumber(key, value); + if (errorKey == null) + errorKey = validateMatchFields(key,value, vo, valueMap); + if (errorKey == null) + errorKey = validateDateFields(key,value, vo, valueMap); + if (errorKey == null) + errorKey = validateCreditCardExpiryDateFields(key,value, vo, valueMap); + if (errorKey !=null) + errors.add(key, new ActionMessage(errorKey,key)); + + //This part is placed here because validateCreditCardField method may return an errorKey + //As we are reusing the same variable to store an error message + //the error is added above in the ActionMessage and then variable errorKey is reused here + errorKey = validateCVVField(key,value, vo, valueMap); + if (errorKey !=null) + errors.add(key, new ActionMessage(errorKey,key)); + + errorKey = validateAccountField(key,value, vo, valueMap); + if (errorKey !=null) + errors.add(key, new ActionMessage(errorKey,key)); + + errorKey = validateCreditCardField(key,value, vo, valueMap); + if (errorKey !=null) + errors.add(key, new ActionMessage(errorKey,key)); + + + } + catch(FormattingException e) + { + String errorKey = e.getFormatter().getErrorKey(); + errors.add(key, new ActionMessage(errorKey, key)); + } + catch (NumberFormatException nfe) + { + String errorKey; + + if (resources.getMessage("error.numberformatexception."+key) == null) + errorKey = "error.numberformatexception"; + else + errorKey = "error.numberformatexception."+key; + + errors.add(key, new ActionMessage(errorKey,key)); + } + + } + + PropertyUtils.setSimpleProperty(target, key, value); + + return errors; + + } + + private String validateAccountField(String key, Object value, Object vo, Map valueMap) + { + Map rules = (Map) validationMap.get(key); + + if (rules == null) + return null; + + if (!rules.containsKey(ACCOUNT_VALID)) + return null; + + if (value == null) + return null; + + + if (value.equals(MPayment.TENDERTYPE_CreditCard)) + { + String accountName = (String) valueMap.get("accountName"); + + if (accountName == null || accountName.equals("")) + return "error.required.accountName"; + } + + return null; + + + } + + private String validateCreditCardExpiryDateFields(String key, Object value, Object vo, Map valueMap) + { + Map rules = (Map) validationMap.get(key); + + if (rules == null) + return null; + + if (!rules.containsKey(EXPIRY_DATE_VALID)) + return null; + + if (value == null) + return null; + + + if (value.equals(MPayment.TENDERTYPE_CreditCard)) + { + String creditCardExpYear = (String) valueMap.get("creditCardExpYear"); + + if (creditCardExpYear == null || creditCardExpYear.equals("")) + return "error.required.creditCardExpYear"; + + if (Integer.parseInt(creditCardExpYear) == currentYear) + { + + + String creditCardExpMonth = (String) valueMap.get("creditCardExpMonth"); + + if (creditCardExpMonth == null || creditCardExpMonth.equals("")) + return "error.required.creditCardExpMonth"; + + if (Integer.parseInt(creditCardExpMonth) < currentMonth) + return "error.creditCardExpMonth"; + } + + } + + return null; + + } + + private String validateCustomerNumber(String key, Object value) + { + + Map rules = (Map) validationMap.get(key); + + if(rules == null) + return null; + + Boolean bool = (Boolean) rules.get(STRING_NUMBER); + + if (bool == null) + { + return null; + } + + String str = (String) value; + + boolean isNumber = true; + try + { + // Double numb = new Double(str); + } + catch(NumberFormatException e) + { + isNumber = false; + } + + + if (!isNumber) + { + + if (resources.getMessage("error.customer.id.numberformat."+key) == null) + return "error.customer.id.numberformat"; + else + return "error.customer.id.numberformat."+key; + } + else + + if (str.length()!=13) + { + + if (resources.getMessage("error.customer.id.length."+key) == null) + return "error.customer.id.length"; + else + return "error.customer.id.length."+key; + } + else + return null; + + } + + + private String validateRange(String key, Object value) + { + + Map rules = (Map) validationMap.get(key); + + if(rules == null) + return null; + + Range range = (Range) rules.get(RANGE); + + if (range == null) + { + return null; + } + + if(!range.isInRange((Comparable) value)) + { + if (resources.getMessage("error.range."+key) == null) + return "error.range"; + else + return "error.range."+key; + } + else + return null; + } + + private String validateEmail(String key, Object value) + { + Map rules = (Map) validationMap.get(key); + + if(rules == null) + return null; + + Boolean email_valid = (Boolean) rules.get(EMAIL_VALID); + + if (email_valid == null) + return null; + + String email = (String) value; + if(!EmailValidator.isValidEmail(email)) + return "error.email"; + else + return null; + + } + + private String validateImageFileExtension(String key, Object value) + { + Map rules = (Map) validationMap.get(key); + + if (rules == null) + return null; + + Boolean imageFile_valid = (Boolean) rules.get(IMAGE_FILE_EXT_VALID); + + if (imageFile_valid == null) + return null; + + //String imageFile = (String) value; + + /* if(!FileExtensionChecker.isValidFileExtention(imageFile)) + return "error.fileNotSupportedException"; + else*/ + return null; + + } + + private String validateMatchFields(String key, Object value, Object vo, Map valueMap) throws InstantiationException, IllegalAccessException, NoSuchMethodException, InvocationTargetException + { + Map rules = (Map) validationMap.get(key); + + if((rules == null)) + return null; + + if (!rules.containsKey(MATCH_FIELDS)) + return null; + + String otherField = (String) rules.get(MATCH_FIELDS); + + Class typeOfOtherField = PropertyUtils.getPropertyType(vo, otherField); + String currOtherFieldValue = (String) valueMap.get(otherField); + + if (otherField == null) + { + return null; + } + else + { + Object obj = convert(typeOfOtherField, otherField, currOtherFieldValue, TO_OBJECT); + if(!value.equals(obj)) + { + if (resources.getMessage("error.match."+key) == null) + return "error.match"; + else + return "error.match."+key; + } + else + return null; + + } + } + + private String validateLength(String key, Object value) + { + Map rules = (Map) validationMap.get(key); + + if(rules == null) + return null; + + Range range = (Range) rules.get(MIN_LENGTH_VALID); + + if (range == null) + return null; + + String str = (String) value; + Integer len = Integer.valueOf(str.length()); + + if(!range.isInRange(len)) + { + if (resources.getMessage("error.minlength."+key) == null) + return "error.minlength"; + else + return "error.minlength."+key; + } + else + return null; + + } + +// private String validateYear(String key, Object obj) +// { +// Map rules = (Map) validationMap.get(key); +// +// if (rules == null) +// return null; +// +// Boolean year_valid = (Boolean) rules.get(YEAR_VALID); +// +// String year = (String) obj; +// +// if (year.length()!= 4) +// return "error.year.length.invalid"; +// +// return null; +// +// +// } + + private String validateRequired(String key, Object obj) + { + // This was added because of the String[] + if (obj!=null && !String.class.isAssignableFrom(obj.getClass())) + { + return null; + } + + String value = (String) obj; + Map rules = (Map) validationMap.get(key); + + if(rules == null) + return null; + + Boolean required = (Boolean) rules.get(REQUIRED); + + if (required == null) + return null; + + boolean isRequired = required.booleanValue(); + boolean isBlank =(value == null || value.trim().equals("")); + + if(isRequired && isBlank) + { + if (resources.getMessage("error.required."+key) == null) + return "error.required"; + else + return "error.required."+key; + } + + else + return null; + } + + private String validateCreditCardField(String key, Object value, Object vo, Map valueMap) throws InstantiationException, IllegalAccessException, NoSuchMethodException, InvocationTargetException + { + Map rules = (Map) validationMap.get(key); + + if (rules == null) + return null; + + if (!rules.containsKey(CREDITCARD_VALID)) + return null; + + if (value == null) + return null; + + if (value.equals(MPayment.TENDERTYPE_CreditCard)) + { + String creditCardNumber = (String) valueMap.get("creditCardNumber"); + + if (creditCardNumber == null || creditCardNumber.equals("")) + return "error.required.creditCardNumber"; + + } + + return null; + + } + + private String validateCVVField(String key, Object value, Object vo, Map valueMap) throws InstantiationException, IllegalAccessException, NoSuchMethodException, InvocationTargetException + { + Map rules = (Map) validationMap.get(key); + + if (rules == null) + return null; + + if (!rules.containsKey(CVV_VALID)) + return null; + + if (value == null) + return null; + + if (value.equals(MPayment.TENDERTYPE_CreditCard)) + { + String cvv = (String) valueMap.get("cvv"); + + if (cvv == null || cvv.equals("")) + return "error.required.cvv"; + + } + + return null; + + } + + private String validateDateFields(String key, Object value, Object vo, Map valueMap) throws InstantiationException, IllegalAccessException, NoSuchMethodException, InvocationTargetException + { + Map rules = (Map) validationMap.get(key); + + if (rules == null) + return null; + + if (!rules.containsKey(DATE_FIELDS_VALID)) + return null; + + String otherKey = (String) rules.get(DATE_FIELDS_VALID); + + String otherValue = (String) valueMap.get(otherKey); + + if (value == null && otherValue == null) + return null; + + if (value == null) + return "error.date.prior.today"; + + if (otherValue == null) + return "error.date.prior.today"; + + Class otherType = PropertyUtils.getPropertyType(vo, otherKey); + + + JulianDate toDate = (JulianDate) convert(otherType, otherKey, otherValue, TO_OBJECT); + + JulianDate fromDate = (JulianDate) value; + + Range range = new Range(JulianDate.getToday(), toDate); + + if (!range.isInRange(fromDate)) + return "error.date.prior.today"; + else + return null; + + } + + + protected Formatter getFormatter(String key, Class type) + { + Formatter formatType = (Formatter) formatMap.get(key); + + if (formatType == null) + { + return Formatter.getFormatter(type); + } + + return formatType; + } + + public void setDefaultString(String key, String value) + { + defaultStringMap.put(key,value); + } + /* + * This is where you can override the way things are formatted. + */ + public void setFormatterType(String key, Class type) + { + if(!Formatter.class.isAssignableFrom(type)) + throw new FormattingException(type + "must be a Formatter"); + + formatMap.put(key,type); + } + + protected Map mapRepresentation(Object bean) + { + String errorMsg = "Unable to format values from bean: " + bean; + Map valueMap = null; + + try + { + valueMap = PropertyUtils.describe(bean); + } + catch(IllegalAccessException iae) + { + throw new FormattingException(errorMsg,iae); + } + catch(InvocationTargetException ite) + { + throw new FormattingException(errorMsg,ite); + } + catch(NoSuchMethodException nsme) + { + throw new FormattingException(errorMsg,nsme); + } + + Iterator keyIter = keysToSkip().iterator(); + + while(keyIter.hasNext()) + { + String key = (String) keyIter.next(); + valueMap.remove(key); + } + return valueMap; + } + + protected ArrayList keysToSkip() + { + ArrayList keysToSkip = new ArrayList(); + + // Don't popluate "class" field inherited from Object + + keysToSkip.add("class"); + keysToSkip.add("servletWrapper"); + keysToSkip.add("multipartRequestHandler"); + keysToSkip.add("bean"); + keysToSkip.add("properties"); + keysToSkip.add("checkBoxLists"); +// keysToSkip.add("file"); + keysToSkip.add("minValue"); + keysToSkip.add("maxValue"); + + + return keysToSkip; + } + + + // + protected String action; + protected String input; + + public String getAction() { + return action; + } + + public void setAction(String action) { + this.action = action; + } + + public String getInput() { + return input; + } + + public void setInput(String input) { + this.input = input; + } + + + +} diff --git a/posterita/posterita/src/main/org/posterita/struts/core/DefaultForm.java b/posterita/posterita/src/main/org/posterita/struts/core/DefaultForm.java new file mode 100644 index 0000000000..6d42b19e27 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/core/DefaultForm.java @@ -0,0 +1,5794 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +package org.posterita.struts.core; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Calendar; + +import org.apache.struts.upload.FormFile; +import org.compiere.model.MInOut; +import org.posterita.beans.AttributeValuesPair; +import org.posterita.beans.OrderLineBean; +import org.posterita.beans.PaymentBean; +import org.posterita.beans.PriceListBean; +import org.posterita.beans.ProductBean; +import org.posterita.beans.ProductImageBean; +import org.posterita.beans.RoleBean; +import org.posterita.beans.StockMovementBean; +import org.posterita.beans.UDIBean; + + +public class DefaultForm extends BaseForm +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + protected String aaCardnumber; + protected String blackListedId; + protected String blackListedBankName; + protected String blackListedChequeNo; + + protected String forward; + protected String accountNo; + protected String accountType; + protected String accountName; + protected String address1; + protected String address2; + protected String agreement; + protected String aisle; + protected String allocationId; + protected String allocationStatus; + protected String attribute; + protected String attributeId; + protected String attributeSetId; + protected String attributeSetInstanceId; + protected Integer [] sernoAttributeSetInstanceIds; + protected String attributeValue; + protected String attributeValueId; + protected String bankId; + protected String bankName; + protected String basePriceListId; + protected String bin; + protected String bpartnerId; + + protected String customSize; + protected String discountedLinePrice; + protected String documentId; + protected String documentNo; + protected String documentType; + protected String email; + protected String endDay = "" + Calendar.getInstance().get(Calendar.DATE); + protected String endHour; + protected String endMinute; + protected String endMonth = "" + (Calendar.getInstance().get(Calendar.MONTH) + 1); + protected String endYear="" + Calendar.getInstance().get(Calendar.YEAR); + protected String engineNo; + protected String engineNumber; + protected String fax; + protected String grossProfit; + protected String grossProfitPercentage; + protected FormFile file; + protected FormFile image; + protected String day; + protected String fromDate; + protected String fromOrderLineId; + protected String grandTotal; + protected String id; + protected String inclPrice; + protected String index; + protected String invoiceId; + protected String isAccessAllOrgs= "false"; + protected String isActive="false"; + protected String isApproved; + protected String isAvailableForBackOrder="true"; + protected String isAutomobile; + protected String isCreatePriceList = "false"; + protected String isCustomer="true"; + protected String isDefault = "false"; + protected String isDeleteOldRecords="false"; + protected String isDelivered; + protected String isEmployee="true"; + protected String isInvoiced; + protected String isMandatory; + protected String isMotorcycle; + protected String isNatisReleased; + protected String isOverridePinOk; + + protected String isPresentForProduct; + protected String isPublic="false"; + protected String isQtyReserved; + protected String isTaxIncluded = "false"; + + protected Integer [] checkBox; + protected String checkNo; + protected String city; + protected String colour; + protected String compiereDocStatus; + protected String confirmEmail; + protected String confirmPassword; + protected String counterOrderStatusInfo; + protected String counterOrgID; + protected String counterOrgName; + protected String currentBalance; + protected String custIdNumber; + protected String dateCreated; + protected String dateOrdered; + protected String datePromised; + protected String dateTrx; + protected String description; + protected String isDiscountOnInclUnitPrice = "false"; + protected String discountedInclUnitPrice; + protected String docStatus; + protected String docStatusCode; + + protected String isDiscountAllowed; + protected String isAllowedOverridePriceLimit; + protected String isReceipt; + protected String isRetailer ="true"; + protected String isSalesRep="false"; + protected String isSoTrx; + protected String isVendor="true"; + protected String isVisible; + protected String isWholesaler="true"; + protected String level; + protected String limitPrice; + protected String listPriceIncl; + protected String stdPriceIncl; + protected String limitPriceIncl; + protected String lineNo; + protected ArrayList list; + protected String listPrice; + protected String locationId; + protected String locatorId; + protected FormFile logo; + protected String logoName; + protected String lockingTime; + protected String maintenanceContractNumber; + protected String make; + protected String makeAttributeValueId; + protected String menuId; + protected String menuItemName; + protected String menuLink; + protected String message; + protected String messageID; + protected String mobile; + protected String model; + protected String modelGroup; + protected String month; + protected String moveConfirmId; + protected String movementDate; + protected String movementDescription; + protected String movementId; + protected String movementLineId; + protected String name; + protected String natisApplicationDate; + protected String natisControlNumber; + protected String natisReleaseId; + protected String newEmail; + protected String newPassword; + protected String oldPassword; + + protected PaymentBean paymentBeanIndex; + protected String orderId; + protected String orderLineId; + protected ArrayList orderLineBean; + protected OrderLineBean orderLineIndexed; + protected ArrayList orderLineList = new ArrayList(); + protected String orderStatusInfo; + protected String orderType; + protected String orgId; + protected String allocatedAmount; + protected String OrgID; + protected String orgFromId; + protected String orgFromName; + protected String orgToId; + protected String orgToName; + protected String orgName; + protected String orgType; + protected String orgUser; + protected String parentMenuId; + protected String partnerId; + protected String partnerName=""; + protected String password; + protected String payAmt; + protected String paymentId; + protected String phone; + protected String phone2; + protected String poReference; + protected String POReference; + protected String postalAddress; + protected String postalAddress1; + protected String postalCity; + protected String postalCode; + protected String postalPostalCode; + protected String prefOrderLineId; + protected String price; + protected String priceEntered; + protected String priceList; + protected PriceListBean priceListBean; + protected ArrayList priceListBeanList = new ArrayList(); + protected String priceListName; + protected String salesPriceListId; + protected String purchasePriceListId; + protected String priceListId; + protected String priceListVersionId; + + protected AttributeValuesPair productAttributes; + protected String productAttributeSetInstanceId; + protected String productCategoryId; + protected String productId; + protected ProductBean productBean; + protected ArrayList productBeanList = new ArrayList(); + protected String productName; + protected String qty; + protected String qtyOnHand; + protected String qtyToMove; + protected String qtyReserved; + protected String [] qtyTargeted; + protected String quantity; + protected String read; + protected String refNo; + protected String reference; + protected Integer refToQuote; + protected String region; + protected String regionId; + protected String registerNumber; + protected String reserveStatus; + protected String roleId; + protected String roleName; + protected String routingNumber; + protected String sernoAttributeSetInstance; + protected String sotrxFlag; + protected String startDay = "" + Calendar.getInstance().get(Calendar.DATE); + protected String startHour; + protected String startMinute; + protected String startMonth= "" + (Calendar.getInstance().get(Calendar.MONTH) + 1); + protected String startYear="" + Calendar.getInstance().get(Calendar.YEAR); + protected String stdPrice; + protected String stdPurchasePrice; + protected String stdSalesPrice; + protected String subject; + protected String submit; + protected String subTotal; + protected String surname; + protected Integer[] targetId; + protected String termsAgreement; + protected String toDate; + protected String toOrderLineId; + protected String totalLines; + protected String transmission; + protected String transmissionAttributeValueId; + protected String userId; + protected String username; + protected String value; + protected String vinNumber; + protected String warehouseId; + protected String warehouseName; + protected String warehouseType; + protected String year; + protected String yearAttributeValueId; + protected String first; + protected String licensingDistrictId; + protected String licensingDistrict; + protected String tradeInOrderlineId; + protected String passportNo; + protected String companyRegNo; + protected ArrayList showroomTrafficBean; + + protected String sales; + protected String traffic; + protected String prospects; + + protected String modelId; + protected String trxId; + protected String trx; + protected String modelCode; + protected String modelCodeId; + protected String dealerCode; + protected String dealerCodeId; + protected String name2; + protected String isAllocationWarehouse="false"; + protected String canAlterOrder; + protected String canCreateOrder; + protected String canViewOrder; + protected String salesRepId; + + protected String imagePath; + protected String imageTitle; + protected String altText; + protected String dateFrom; + protected String dateTo; + + protected String weekNo; + protected String startDate; + protected String endDate; + protected String financeOption; + protected String status; + + protected String newVinNumber; + protected String countryOfImpCode; + protected String enginePower; + protected String mainColourCode; + protected String natisModelNo; + protected String noOfWheels; + protected String tare; + protected String unitNumber; + protected Integer unitsPerPack; + protected String isTradeIn = "true"; + + protected String attributesetinstanceIdFrom; + protected String attributesetinstanceIdTo; + protected String releasedBy; + protected Integer productIds[]; + protected String ETA; + protected String ETAFilter; + + protected String engineCapacity; + protected String colourCodeHES; + protected String colourName; + protected String natisModelDescription; + protected Integer orderIds[]; + + protected String colourCodeMatchId; + protected String modelMatchID; + protected String natisModelDesc; + protected String modelDesc; + protected String trans; + protected String showActiveOnly = "true"; + protected String updateAttrValueId; + protected String active; + protected String visible; + protected String beginingBalance; + protected String statementDifference; + protected String endingBalance; + protected String amount; + protected String trxType; + protected String amountGiven; + protected String amountRefunded; + protected String cashBookId; + protected String cashId; + protected String cashLineId; + protected String cashBookName; + protected String chequeNo; + protected String creditCardType; + protected String creditCardNumber; + protected String creditCardNumberEncrypted; + protected String creditCardExpMonth; + protected String creditCardExpMonthName; + protected String creditCardExpYear; + protected Integer orderLineIds[]; + protected Integer [] posOrderLineIds; + protected Integer [] bpartnerIds; + protected Integer [] invoiceIds; + + private String qtySmall; + private String qtyMedium; + private String qtyLarge; + private String qtyXLarge; + private String clientName; + protected String transferAmount; + protected String cashBookIds; + protected String designAttributeValueId; + protected String modelAttributeValueId; + protected String sizeAttributeValueId; + protected String colourAttributeValueId; + protected String shoppingCartItemId; + protected String keyword; + protected String searchText; + protected String backOrder; + + protected String fieldName; + protected String applicationName; + protected String storeId; + protected String isWebstoreFeatured="false"; + protected String isNotWebstoreFeatured; + protected String imageName; + + protected String posId; + protected String purchasePriceList; + protected String purchasePriceLimit; + protected String purchasePriceStandard; + protected String salesPriceList; + protected String salesPriceLimit; + protected String salesPriceStandard; + protected String barCode; + protected String trackingNo; + protected String reportType; + protected String noOfProductsRequired; + protected String qtyAndItem; + protected String [] discountPercent; + protected String [] actualPrice; + protected String userSurname; + protected String countryId; + protected String countryName; + + protected String newName; + protected ArrayList productsList = new ArrayList(); + protected ProductImageBean productsIndexed; + protected String paymentByCash; + protected String paymentByCard; + protected String paymentByChq; + protected String isSales; + protected String isSOPriceList; + protected String ifAdd="true"; + + protected String brandName; + protected String modelName; + protected String designName; + protected String sizeName; + protected String productCategory; + protected String productClassification; + protected String [] sizes; + protected String revenueRecognition; + protected String cvv; + protected String creditCardPayment; + protected String shipmentMethod = MInOut.DELIVERYVIARULE_Pickup; + protected String shipTo; + protected String billTo; + protected String shipperId; + protected String paymentMethod; + + protected String revenueRecoId; + protected String isTextileProduct; + protected String qtyFilter; + protected ArrayList attributeValueList; + protected String [] attributeValueIds; + protected String attributeSetName; + protected String attributeName; + + + protected String requestId; + protected String fromAddress; + protected String toAddresses; + protected String ccAddresses; + protected String bccAddresses; + protected String textMessage; + protected String toUserId; + protected String priority; + protected String title; + protected String chargeId; + protected String statusId; + protected String totalActualPrice; + protected String productType="I"; + protected String qtyNumberFilter; + protected String taxCategoryId; + protected String taxCategoryName; + protected String endingBalanceAsString; + protected String beginingBalanceAsString; + protected String vendorName; + protected String timePeriod; + protected String chartType; + protected String salesGroup; + protected String taxRate; + protected String state; + protected String accountId; + protected String dateRange; + protected String reportName; + protected String orderGrandTotal; + protected String transferAllAmount; + protected String adjustmentAmount; + + protected String differenceAmt; + protected String tillGrandTotal; + protected String cashTotal; + protected String cardTotal; + protected String chequeTotal; + protected String creatingFromOrder; + protected String transferType; + protected String priceQtyFilter; + protected String deliveryViaRule; + protected String userPIN; + protected String paymentRule; + protected String cardDifference; + protected String chequeDifference; + + + protected String isSelfService; + protected String documentNote; + protected String currencySymbole; + protected String userDiscount; + + + + + protected String invoiceDate; + protected String netDays; + protected String daysDue; + protected String dueDate; + protected String discountDate; + protected String discountAmt; + protected String invoiceGrandTotal; + protected String paidAmt; + protected String openAmt; + protected String currencyId; + protected String paymentTermId; + protected String invoiceScheduleId; + + protected String invoicedAmt; + protected String pastDue91_plus; + protected String pastDue61_90; + protected String pastDue31_60; + protected String pastDue1_30; + protected String pastDue8_30; + protected String pastDue1_7; + protected String pastDueAmt; + protected String dueAmt; + protected String due0; + protected String due1_7; + protected String due8_30; + protected String due0_30; + protected String due31_60; + protected String due61_90; + protected String due91_PLUS; + + + protected String paymentAmt; + protected String overUnderPayment; + protected String writeOffAmt; + + protected String invoiceNo; + protected String paymentTermName; + + protected String dunningLevelId; + protected String dunningLevelName; + protected String dunningPrintText; + protected String dunningPrintNote; + protected String BP_Group_ID ; + protected String dunningId; + protected String dunningName; + protected String creditLimit; + protected String creditStatus; + protected String creditUsed; + public String docBasisType; + protected String amtMultiplier; + protected String frequencyType; + protected String commissionAmtId; + protected String subtractAmt; + + protected String taxName; + protected String taxId; + protected String isTaxExempted; + + protected Integer [] paymentIds; + + + protected String inventoryLineId; + protected String inventoryId; + protected String qtyBook; + protected String qtyCount; + protected String qtyCsv; + + protected String afterDelivery; + protected String fixedDueDate; + protected String nextBusinessday; + protected String fixedMonthDay; + protected String fixedMonthOffset; + protected String fiedMonthCutoff; + protected String toBeShipped; + protected String discountDay1; + protected String discountDay2; + protected String discountAmt1; + protected String discountAmt2; + protected String [] allocateAmount; + protected String group1; + protected String group2; + protected Integer [] inventoryIds; + + + protected String isFullAccess; + + protected String historyType; + + protected String birthdate; + protected String openDrawer="true"; + protected String uomId; + protected String uom; + protected String isOverwritePriceLimit; + protected String isDiscountUptoLimitPrice; + protected String isDiscountAllowedOnTotal; + protected String isChecked; + protected String fullDetails; + protected String unitPrice; + protected String unitPurchasePrice; + protected String totalGrossProfit; + protected String totalGrossProfitPercentage; + + protected StockMovementBean stock; + protected ArrayList stockList = new ArrayList(); + protected String stockValue; + private String noOfPack; + + // Additional fields required for user registration + protected String company = ""; + protected String industry = ""; + protected String comments = ""; + + protected String roundOffFactor; + protected String stdPrecision; + protected String isoCode; + protected String curSymbol; + + protected String terminalId; + protected String cashbookTransferType; + protected String checkTransferType; + protected String cardTransferType; + protected String cardBankAccountId; + protected String checkBankAccountId; + protected String templateBPartnerId; + protected String cashbookTransferCashbookId; + protected String cashbookTransferBankAccountId; + protected String checkTransferCashbookId; + protected String checkTransferBankAccountId; + protected String cardTransferCashbookId; + protected String cardTransferBankAccountId; + protected String autoLock; + protected String locked; + protected String isDiscountOnPercentage = "false"; + protected String isDiscountOnTotal = "false"; + protected String isAllowToView; + protected String isAllowToEdit; + protected String isAllowToCreate; + protected String isAllowToDelete; + protected String webMenuId; + protected String isSalesReport; + protected String receiptFooterMsg; + protected String branch; + protected String saleRepName; + + protected String readOnly = "false"; + + public String getIsoCode() { + return isoCode; + } + + public void setIsoCode(String isoCode) { + this.isoCode = isoCode; + } + + public String getCurSymbol() { + return curSymbol; + } + + public void setCurSymbol(String curSymbol) { + this.curSymbol = curSymbol; + } + + public String getStdPrecision() { + return stdPrecision; + } + + public void setStdPrecision(String stdPrecision) { + this.stdPrecision = stdPrecision; + } + + public String getHistoryType() + { + return historyType; + } + + public void setHistoryType(String historyType) + { + this.historyType = historyType; + } + + public Integer[] getPaymentIds() + { + return paymentIds; + } + + public void setPaymentIds(Integer[] paymentIds) + { + this.paymentIds = paymentIds; + } + + public DefaultForm() + { + setBean(new UDIBean()); + } + + public String getOrderGrandTotal() + { + return orderGrandTotal; + } + + public void setOrderGrandTotal(String orderGrandTotal) + { + this.orderGrandTotal = orderGrandTotal; + } + + public String getSalesGroup() + { + return salesGroup; + } + + public void setSalesGroup(String salesGroup) + { + this.salesGroup = salesGroup; + } + + public String getBeginingBalanceAsString() + { + return beginingBalanceAsString; + } + + public void setBeginingBalanceAsString(String beginingBalanceAsString) + { + this.beginingBalanceAsString = beginingBalanceAsString; + } + + public String getEndingBalanceAsString() + { + return endingBalanceAsString; + } + + public void setEndingBalanceAsString(String endingBalanceAsString) + { + this.endingBalanceAsString = endingBalanceAsString; + } + + public String getAttributeName() + { + return attributeName; + } + + public void setAttributeName(String attributeName) + { + this.attributeName = attributeName; + } + + public String getAttributeSetName() + { + return attributeSetName; + } + + public void setAttributeSetName(String attributeSetName) + { + this.attributeSetName = attributeSetName; + } + + public String getBillTo() + { + return billTo; + } + + public void setBillTo(String billTo) + { + this.billTo = billTo; + } + + public String getShipmentMethod() + { + return shipmentMethod; + } + + public void setShipmentMethod(String shipmentMethod) + { + this.shipmentMethod = shipmentMethod; + } + + public String getShipTo() + { + return shipTo; + } + + public void setShipTo(String shipTo) + { + this.shipTo = shipTo; + } + public String[] getActualPrice() + { + return actualPrice; + } + + public void setActualPrice(String[] actualPrice) + { + this.actualPrice = actualPrice; + } + + public String[] getDiscountPercent() + { + return discountPercent; + } + + public void setDiscountPercent(String[] discountPercent) + { + this.discountPercent = discountPercent; + } + + public String getQtyAndItem() + { + return qtyAndItem; + } + + public void setQtyAndItem(String qtyAndItem) + { + this.qtyAndItem = qtyAndItem; + } + + public String getIsTradeIn() + { + return isTradeIn; + } + + public void setIsTradeIn(String isTradeIn) + { + this.isTradeIn = isTradeIn; + } + + public String getLicensingDistrictId() { + return licensingDistrictId; + } + public void setLicensingDistrictId(String licensingDistrictId) { + this.licensingDistrictId = licensingDistrictId; + } + public String getIsAvailableForBackOrder() { + return isAvailableForBackOrder; + } + public void setIsAvailableForBackOrder(String isAvailableForBackOrder) { + this.isAvailableForBackOrder = isAvailableForBackOrder; + } + public String getAaCardnumber() { + return aaCardnumber; + } + public String getAccountNo() { + return accountNo; + } + public String getAccountType() { + return accountType; + } + public String getAddress1() { + return address1; + } + public String getAddress2() { + return address2; + } + + public String getAgreement() + { + return agreement; + } + public String getAisle() { + return aisle; + } + + + public String getAllocationId() + { + return allocationId; + } + + + + public String getAllocationStatus() + { + return allocationStatus; + } + public String getAttribute() { + return attribute; + } + public String getAttributeId() { + return attributeId; + } + public String getAttributeSetId() { + return attributeSetId; + } + public String getAttributeSetInstanceId() + { + return attributeSetInstanceId; + } + public String getAttributeValue() { + return attributeValue; + } + public String getBankId() { + return bankId; + } + public String getBankName() { + return bankName; + } + public String getBin() { + return bin; + } + public String getBpartnerId() { + return bpartnerId; + } + + public Integer[] getCheckBox() + { + return checkBox; + } + + public String getCheckNo() { + return checkNo; + } + public String getCity() { + return city; + } + public String getColour() { + return colour; + } + public String getColourAttributeValueId() { + return colourAttributeValueId; + } + + public String getCompiereDocStatus() + { + return compiereDocStatus; + } + + public String getConfirmEmail() { + return confirmEmail; + } + public String getConfirmPassword() { + return confirmPassword; + } + public String getCounterOrderStatusInfo() { + return counterOrderStatusInfo; + } + public String getCounterOrgID() { + return counterOrgID; + } + public String getCounterOrgName() { + return counterOrgName; + } + public String getCurrentBalance() { + return currentBalance; + } + public String getCustIdNumber() { + return custIdNumber; + } + public String getDateCreated() { + return dateCreated; + } + public String getDateOrdered() { + return dateOrdered; + } + public String getDatePromised() { + return datePromised; + } + public String getDateTrx() { + return dateTrx; + } + + public String getDescription() { + return description; + } + + public String getDocStatus() { + return docStatus; + } + public String getDocStatusCode() { + return docStatusCode; + } + public String getDocumentId() { + return documentId; + } + public String getDocumentNo() { + return documentNo; + } + public String getDocumentType() { + return documentType; + } + public String getEmail() { + return email; + } + + public String getEndDay() { + return endDay; + } + public String getEndHour() { + return endHour; + } + public String getEndMinute() { + return endMinute; + } + public String getEndMonth() { + return endMonth; + } + public String getEndYear() { + return endYear; + } + + + public String getEngineNo() { + return engineNo; + } + + + public String getEngineNumber() + { + return engineNumber; + } + public FormFile getFile() + { + return file; + } + + public String getFromDate() { + return fromDate; + } + + public String getFromOrderLineId() + { + return fromOrderLineId; + } + + public String getGrandTotal() { + return grandTotal; + } + public String getId() { + return id; + } + + public String getInvoiceId() { + return invoiceId; + } + public String getIsAccessAllOrgs() { + return isAccessAllOrgs; + } + public String getIsActive() { + return isActive; + } + public String getIsApproved() { + return isApproved; + } + public String getIsAutomobile() { + return isAutomobile; + } + public String getIsCustomer() { + return isCustomer; + } + public String getIsDefault() { + return isDefault; + } + public String getIsDelivered() { + return isDelivered; + } + public String getIsEmployee() { + return isEmployee; + } + public String getIsInvoiced() { + return isInvoiced; + } + public String getIsMotorcycle() { + return isMotorcycle; + } + public String getIsNatisReleased() { + return isNatisReleased; + } + public String getIsPublic() { + return isPublic; + } + + + public String getIsQtyReserved() { + return isQtyReserved; + } + + public String getIsReceipt() { + return isReceipt; + } + public String getIsRetailer() { + return isRetailer; + } + public String getIsSalesRep() { + return isSalesRep; + } + public String getIsSoTrx() { + return isSoTrx; + } + public String getIsVendor() { + return isVendor; + } + public String getIsWholesaler() { + return isWholesaler; + } + public String getLevel() { + return level; + } + public ArrayList getList() + { + return list; + } + + public String getLocationId() { + return locationId; + } + + + public String getLocatorId() + { + return locatorId; + } + + public FormFile getLogo() + { + return logo; + } + public String getLogoName() + { + return logoName; + } + public String getMaintenanceContractNumber() { + return maintenanceContractNumber; + } + + public String getMake() + { + return make; + } + + public String getMakeAttributeValueId() + { + return makeAttributeValueId; + } + + public String getMenuId() { + return menuId; + } + public String getMenuItemName() { + return menuItemName; + } + public String getMenuLink() { + return menuLink; + } + public String getMessage() { + return message; + } + public String getMessageID() { + return messageID; + } + public String getMobile() { + return mobile; + } + public String getModel() { + return model; + } + public String getModelAttributeValueId() { + return modelAttributeValueId; + } + + public String getModelGroup() { + return modelGroup; + } + public String getMonth() { + return month; + } + + public String getMovementDate() + { + return movementDate; + } + + public String getMovementDescription() + { + return movementDescription; + } + public String getName() { + return name; + } + public String getNatisApplicationDate() + { + return natisApplicationDate; + } + public String getNatisControlNumber() + { + return natisControlNumber; + } + public String getNatisReleaseId() + { + return natisReleaseId; + } + public String getNewEmail() { + return newEmail; + } + public String getNewPassword() { + return newPassword; + } + public String getOldPassword() { + return oldPassword; + } + public String getOrderId() { + return orderId; + } + public ArrayList getOrderLineBean() + { + return orderLineBean; + } + + public String getOrderLineId() + { + return orderLineId; + } + + + public String getOrderStatusInfo() { + return orderStatusInfo; + } + + + public String getOrderType() + { + return orderType; + } + public String getOrgId() + { + return orgId; + } + public String getOrgID() { + return OrgID; + } + public String getOrgName() { + return orgName; + } + public String getOrgType() { + return orgType; + } + public String getOrgUser() { + return orgUser; + } + public String getParentMenuId() { + return parentMenuId; + } + public String getPartnerId() { + return partnerId; + } + public String getPartnerName() { + return partnerName; + } + public String getPassword() { + return password; + } + public String getPayAmt() { + return payAmt; + } + public String getPaymentId() { + return paymentId; + } + + public String getPhone1() { + return phone; + } + public String getPhoneNo() { + return phone2; + } + public String getPoReference() { + return poReference; + } + public String getPOReference() + { + return POReference; + } + + public String getPostalAddress() { + return postalAddress; + } + public String getPostalAddress1() { + return postalAddress1; + } + public String getPostalCity() { + return postalCity; + } + public String getPostalCode() { + return postalCode; + } + public String getPostalPostalCode() { + return postalPostalCode; + } + public String getPrefOrderLineId() + { + return prefOrderLineId; + } + + public String getPriceEntered() + { + return priceEntered; + } + + public String getPriceListVersionId() { + return priceListVersionId; + } + public AttributeValuesPair getProductAttributes() + { + return productAttributes; + } + + public String getProductAttributeSetInstanceId() + { + return productAttributeSetInstanceId; + } + + public String getProductCategoryId() + { + return productCategoryId; + } + + public String getProductId() + { + return productId; + } + + public String getProductName() + { + return productName; + } + + public String getQty() { + return qty; + } + public String getQtyReserved() + { + return qtyReserved; + } + + public String[] getQtyTargeted() { + return qtyTargeted; + } + + public String getQuantity() + { + return quantity; + } + + public String getRead() { + return read; + } + + + public Integer getRefToQuote() + { + return refToQuote; + } + public String getRegion() { + return region; + } + + public String getRegionId() { + return regionId; + } + public String getRegisterNumber() + { + return registerNumber; + } + + public String getReserveStatus() + { + return reserveStatus; + } + public String getRoleId() { + return roleId; + } + public String getRoleName() { + return roleName; + } + public String getRoutingNumber() { + return routingNumber; + } + + public String getSernoAttributeSetInstance() + { + return sernoAttributeSetInstance; + } + + public String getSotrxFlag() + { + return sotrxFlag; + } + public String getStartDay() { + return startDay; + } + public String getStartHour() { + return startHour; + } + public String getStartMinute() { + return startMinute; + } + public String getStartMonth() { + return startMonth; + } + public String getStartYear() { + return startYear; + } + public String getStdPurchasePrice() { + return stdPurchasePrice; + } + public String getStdSalesPrice() { + return stdSalesPrice; + } + public String getSubject() { + return subject; + } + + public String getSubmit() + { + return submit; + } + public String getSurname() { + return surname; + } + + public Integer[] getTargetId() { + return targetId; + } + public String getTermsAgreement() + { + return termsAgreement; + } + + public String getToDate() { + return toDate; + } + + public String getToOrderLineId() + { + return toOrderLineId; + } + + public String getTotalLines() + { + return totalLines; + } + + public String getTransmission() { + return transmission; + } + public String getTransmissionAttributeValueId() { + return transmissionAttributeValueId; + } + public String getUserId() { + return userId; + } + + public String getUsername() { + return username; + } + public String getValue() { + return value; + } + + public String getVinNumber() + { + return vinNumber; + } + public String getWarehouseId() { + return warehouseId; + } + public String getWarehouseName() { + return warehouseName; + } + + public String getWarehouseType() + { + return warehouseType; + } + public String getYear() { + return year; + } + + public void setAisle(String aisle) { + this.aisle = aisle; + } + + + public void setAllocationId(String allocationId) + { + this.allocationId = allocationId; + } + + public void setAllocationStatus(String allocationStatus) + { + this.allocationStatus = allocationStatus; + } + public void setAttribute(String attribute) { + this.attribute = attribute; + } + public void setAttributeId(String attributeId) { + this.attributeId = attributeId; + } + public void setAttributeSetId(String attributeSetId) { + this.attributeSetId = attributeSetId; + } + public void setAttributeSetInstanceId(String attributeSetInstanceId) + { + this.attributeSetInstanceId = attributeSetInstanceId; + } + public void setAttributeValue(String attributeValue) { + this.attributeValue = attributeValue; + } + public void setBankId(String bankId) { + this.bankId = bankId; + } + public void setBankName(String bankName) { + this.bankName = bankName; + } + public void setBin(String bin) { + this.bin = bin; + } + public void setBpartnerId(String partnerId) { + bpartnerId = partnerId; + } + public void setCheckBox(Integer[] checkBox) + { + this.checkBox = checkBox; + } + + public String getYearAttributeValueId() { + return yearAttributeValueId; + } + public void setAaCardnumber(String aaCardnumber) { + this.aaCardnumber = aaCardnumber; + } + public void setAccountNo(String accountNo) { + this.accountNo = accountNo; + } + public void setAccountType(String accountType) { + this.accountType = accountType; + } + public void setAddress1(String address1) { + this.address1 = address1; + } + public void setAddress2(String address2) { + this.address2 = address2; + } + + public void setAgreement(String agreement) + { + this.agreement = agreement; + } + + public void setCheckNo(String checkNo) { + this.checkNo = checkNo; + } + public void setCity(String city) { + this.city = city; + } + public void setColour(String colour) { + this.colour = colour; + } + public void setColourAttributeValueId(String colourAttributeValueId) { + this.colourAttributeValueId = colourAttributeValueId; + } + + public void setCompiereDocStatus(String compiereDocStatus) + { + this.compiereDocStatus = compiereDocStatus; + } + public void setConfirmEmail(String confirmEmail) { + this.confirmEmail = confirmEmail; + } + public void setConfirmPassword(String confirmPassword) { + this.confirmPassword = confirmPassword; + } + public void setCounterOrderStatusInfo(String counterOrderStatusInfo) { + this.counterOrderStatusInfo = counterOrderStatusInfo; + } + public void setCounterOrgID(String counterOrgID) { + this.counterOrgID = counterOrgID; + } + public void setCounterOrgName(String counterOrgName) { + this.counterOrgName = counterOrgName; + } + public void setCurrentBalance(String currentBalance) { + this.currentBalance = currentBalance; + } + public void setCustIdNumber(String custIdNumber) { + this.custIdNumber = custIdNumber; + } + public void setDateCreated(String dateCreated) { + this.dateCreated = dateCreated; + } + public void setDateOrdered(String dateOrdered) { + this.dateOrdered = dateOrdered; + } + public void setDatePromised(String datePromised) { + this.datePromised = datePromised; + } + public void setDateTrx(String dateTrx) { + this.dateTrx = dateTrx; + } + public void setDescription(String description) { + this.description = description; + } + public void setDocStatus(String docStatus) { + this.docStatus = docStatus; + } + public void setDocStatusCode(String docStatusCode) { + this.docStatusCode = docStatusCode; + } + public void setDocumentId(String documentId) { + this.documentId = documentId; + } + public void setDocumentNo(String documentNo) { + this.documentNo = documentNo; + } + public void setDocumentType(String documentType) { + this.documentType = documentType; + } + public void setEmail(String email) { + this.email = email; + } + public void setEndDay(String endDay) { + this.endDay = endDay; + } + public void setEndHour(String endHour) { + this.endHour = endHour; + } + public void setEndMinute(String endMinute) { + this.endMinute = endMinute; + } + public void setEndMonth(String endMonth) { + this.endMonth = endMonth; + } + public void setEndYear(String endYear) { + this.endYear = endYear; + } + public void setEngineNo(String engineNo) { + this.engineNo = engineNo; + } + public void setEngineNumber(String engineNumber) + { + this.engineNumber = engineNumber; + } + + public void setFile(FormFile file) + { + this.file = file; + } + + public void setFromDate(String fromDate) { + this.fromDate = fromDate; + } + + public void setFromOrderLineId(String fromOrderLineId) + { + this.fromOrderLineId = fromOrderLineId; + } + + public void setGrandTotal(String grandTotal) { + this.grandTotal = grandTotal; + } + public void setId(String id) { + this.id = id; + } + public void setInvoiceId(String invoiceId) { + this.invoiceId = invoiceId; + } + public void setIsAccessAllOrgs(String isAccessAllOrgs) { + this.isAccessAllOrgs = isAccessAllOrgs; + } + + public void setIsActive(String isActive) { + this.isActive = isActive; + } + public void setIsApproved(String isApproved) { + this.isApproved = isApproved; + } + public void setIsAutomobile(String isAutomobile) { + this.isAutomobile = isAutomobile; + } + public void setIsCustomer(String isCustomer) { + this.isCustomer = isCustomer; + } + public void setIsDefault(String isDefault) { + this.isDefault = isDefault; + } + public void setIsDelivered(String isDelivered) { + this.isDelivered = isDelivered; + } + public void setIsEmployee(String isEmployee) { + this.isEmployee = isEmployee; + } + public void setIsInvoiced(String isInvoiced) { + this.isInvoiced = isInvoiced; + } + public void setIsMotorcycle(String isMotorcycle) { + this.isMotorcycle = isMotorcycle; + } + public void setIsNatisReleased(String isNatisReleased) { + this.isNatisReleased = isNatisReleased; + } + public void setIsPublic(String isPublic) { + this.isPublic = isPublic; + } + public void setIsQtyReserved(String isQtyReserved) { + this.isQtyReserved = isQtyReserved; + } + + public void setIsReceipt(String isReceipt) { + this.isReceipt = isReceipt; + } + public void setIsRetailer(String isRetailer) { + this.isRetailer = isRetailer; + } + public void setIsSalesRep(String isSalesRep) { + this.isSalesRep = isSalesRep; + } + public void setIsSoTrx(String isSoTrx) { + this.isSoTrx = isSoTrx; + } + public void setIsVendor(String isVendor) { + this.isVendor = isVendor; + } + public void setIsWholesaler(String isWholesaler) { + this.isWholesaler = isWholesaler; + } + public void setLevel(String level) { + this.level = level; + } + public void setList(ArrayList list) + { + this.list = list; + } + + public void setLocationId(String locationId) { + this.locationId = locationId; + } + + public void setLocatorId(String locatorId) + { + this.locatorId = locatorId; + } + + public void setLogo(FormFile logo) + { + this.logo = logo; + } + public void setLogoName(String logoName) + { + this.logoName = logoName; + } + public void setMaintenanceContractNumber(String maintenanceContractNumber) { + this.maintenanceContractNumber = maintenanceContractNumber; + } + + public void setMake(String make) + { + this.make = make; + } + + public void setMakeAttributeValueId(String makeAttributeValueId) + { + this.makeAttributeValueId = makeAttributeValueId; + } + + public void setMenuId(String menuId) { + this.menuId = menuId; + } + public void setMenuItemName(String menuItemName) { + this.menuItemName = menuItemName; + } + public void setMenuLink(String menuLink) { + this.menuLink = menuLink; + } + public void setMessage(String message) { + this.message = message; + } + public void setMessageID(String messageID) { + this.messageID = messageID; + } + public void setMobile(String mobile) { + this.mobile = mobile; + } + public void setModel(String model) { + this.model = model; + } + public void setModelAttributeValueId(String modelAttributeValueId) { + this.modelAttributeValueId = modelAttributeValueId; + } + public void setModelGroup(String modelGroup) { + this.modelGroup = modelGroup; + } + public void setMonth(String month) { + this.month = month; + } + + public void setMovementDate(String movementDate) + { + this.movementDate = movementDate; + } + + public void setMovementDescription(String movementDescription) + { + this.movementDescription = movementDescription; + } + public void setName(String name) { + this.name = name; + } + public void setNatisApplicationDate(String natisApplicationDate) + { + this.natisApplicationDate = natisApplicationDate; + } + public void setNatisControlNumber(String natisControlNumber) + { + this.natisControlNumber = natisControlNumber; + } + public void setNatisReleaseId(String natisReleaseId) + { + this.natisReleaseId = natisReleaseId; + } + public void setNewEmail(String newEmail) { + this.newEmail = newEmail; + } + public void setNewPassword(String newPassword) { + this.newPassword = newPassword; + } + public void setOldPassword(String oldPassword) { + this.oldPassword = oldPassword; + } + public void setOrderId(String orderId) { + this.orderId = orderId; + } + public void setOrderLineBean(ArrayList orderLineBean) + { + this.orderLineBean = orderLineBean; + } + + public void setOrderLineId(String orderLineId) + { + this.orderLineId = orderLineId; + } + + + + public void setOrderStatusInfo(String orderStatusInfo) { + this.orderStatusInfo = orderStatusInfo; + } + + public void setOrderType(String orderType) + { + this.orderType = orderType; + } + public void setOrgId(String orgId) + { + this.orgId = orgId; + } + public void setOrgID(String orgID) { + OrgID = orgID; + } + public void setOrgName(String orgName) { + this.orgName = orgName; + } + public void setOrgType(String orgType) { + this.orgType = orgType; + } + public void setOrgUser(String orgUser) { + this.orgUser = orgUser; + } + public void setParentMenuId(String parentMenuId) { + this.parentMenuId = parentMenuId; + } + public void setPartnerId(String partnerId) { + this.partnerId = partnerId; + } + public void setPartnerName(String partnerName) { + this.partnerName = partnerName; + } + public void setPassword(String password) { + this.password = password; + } + public void setPayAmt(String payAmt) { + this.payAmt = payAmt; + } + public void setPaymentId(String paymentId) { + this.paymentId = paymentId; + } + public void setPhone1(String phone1) { + this.phone = phone1; + } + public void setPhoneNo(String phoneNo) { + this.phone2 = phoneNo; + } + public void setPoReference(String poReference) { + this.poReference = poReference; + } + public void setPOReference(String reference) + { + POReference = reference; + } + + public void setPostalAddress(String postalAddress) { + this.postalAddress = postalAddress; + } + public void setPostalAddress1(String postalAddress1) { + this.postalAddress1 = postalAddress1; + } + public void setPostalCity(String postalCity) { + this.postalCity = postalCity; + } + public void setPostalCode(String postalCode) { + this.postalCode = postalCode; + } + public void setPostalPostalCode(String postalPostalCode) { + this.postalPostalCode = postalPostalCode; + } + + public void setPrefOrderLineId(String prefOrderLineId) + { + this.prefOrderLineId = prefOrderLineId; + } + + public void setPriceEntered(String priceEntered) + { + this.priceEntered = priceEntered; + } + + public void setPriceListVersionId(String priceListVersionId) { + this.priceListVersionId = priceListVersionId; + } + public void setProductAttributes(AttributeValuesPair productAttributes) + { + this.productAttributes = productAttributes; + } + + public void setProductAttributeSetInstanceId(String productAttributeSetInstanceId) + { + this.productAttributeSetInstanceId = productAttributeSetInstanceId; + } + + public void setProductCategoryId(String productCategoryId) + { + this.productCategoryId = productCategoryId; + } + + public void setProductId(String productId) + { + this.productId = productId; + } + + public void setProductName(String productName) + { + this.productName = productName; + } + public void setQty(String qty) { + this.qty = qty; + } + public void setQtyReserved(String qtyReserved) + { + this.qtyReserved = qtyReserved; + } + public void setQtyTargeted(String[] qtyTargeted) { + this.qtyTargeted = qtyTargeted; + } + + + public void setQuantity(String quantity) + { + this.quantity = quantity; + } + + public void setRead(String read) { + this.read = read; + } + public void setRefToQuote(Integer refToQuote) + { + this.refToQuote = refToQuote; + } + public void setRegion(String region) { + this.region = region; + } + + + public void setRegionId(String regionId) { + this.regionId = regionId; + } + public void setRegisterNumber(String registerNumber) + { + this.registerNumber = registerNumber; + } + + public void setReserveStatus(String reserveStatus) + { + this.reserveStatus = reserveStatus; + } + public void setRoleId(String roleId) { + this.roleId = roleId; + } + public void setRoleName(String roleName) { + this.roleName = roleName; + } + public String getPrice() { + return price; + } + public void setPrice(String price) { + this.price = price; + } + public String getPriceList() { + return priceList; + } + public void setPriceList(String priceList) { + this.priceList = priceList; + } + + public void setRoutingNumber(String routingNumber) { + this.routingNumber = routingNumber; + } + + public void setSernoAttributeSetInstance(String sernoAttributeSetInstance) + { + this.sernoAttributeSetInstance = sernoAttributeSetInstance; + } + + public void setSotrxFlag(String sotrxFlag) + { + this.sotrxFlag = sotrxFlag; + } + public void setStartDay(String startDay) { + this.startDay = startDay; + } + public void setStartHour(String startHour) { + this.startHour = startHour; + } + public void setStartMinute(String startMinute) { + this.startMinute = startMinute; + } + public void setStartMonth(String startMonth) { + this.startMonth = startMonth; + } + public void setStartYear(String startYear) { + this.startYear = startYear; + } + public void setStdPurchasePrice(String stdPurchasePrice) { + this.stdPurchasePrice = stdPurchasePrice; + } + public void setStdSalesPrice(String stdSalesPrice) { + this.stdSalesPrice = stdSalesPrice; + } + public void setSubject(String subject) { + this.subject = subject; + } + + public void setSubmit(String submit) + { + this.submit = submit; + } + public void setSurname(String surname) { + this.surname = surname; + } + public void setTargetId(Integer[] targetId) { + this.targetId = targetId; + } + public void setTermsAgreement(String termsAgreement) + { + this.termsAgreement = termsAgreement; + } + public void setToDate(String toDate) { + this.toDate = toDate; + } + + public void setToOrderLineId(String toOrderLineId) + { + this.toOrderLineId = toOrderLineId; + } + + public void setTotalLines(String totalLines) + { + this.totalLines = totalLines; + } + public void setTransmission(String transmission) { + this.transmission = transmission; + } + public void setTransmissionAttributeValueId( + String transmissionAttributeValueId) { + this.transmissionAttributeValueId = transmissionAttributeValueId; + } + public void setUserId(String userId) { + this.userId = userId; + } + + public void setUsername(String username) { + this.username = username; + } + public void setValue(String value) { + this.value = value; + } + public void setVinNumber(String vinNumber) + { + this.vinNumber = vinNumber; + } + public void setWarehouseId(String warehouseId) { + this.warehouseId = warehouseId; + } + public void setWarehouseName(String warehouseName) { + this.warehouseName = warehouseName; + } + + public void setWarehouseType(String warehouseType) + { + this.warehouseType = warehouseType; + } + + public void setYear(String year) { + this.year = year; + } + public void setYearAttributeValueId(String yearAttributeValueId) { + this.yearAttributeValueId = yearAttributeValueId; + } + + public String getFirst() + { + return first; + } + + public void setFirst(String first) + { + this.first = first; + } + + public String getLicensingDistrict() + { + return licensingDistrict; + } + + public void setLicensingDistrict(String licensingDistrict) + { + this.licensingDistrict = licensingDistrict; + } + + public String getCompanyRegNo() + { + return companyRegNo; + } + + public void setCompanyRegNo(String companyRegNo) + { + this.companyRegNo = companyRegNo; + } + + public String getPassportNo() + { + return passportNo; + } + + public void setPassportNo(String passportNo) + { + this.passportNo = passportNo; + } + + public String getTradeInOrderlineId() + { + return tradeInOrderlineId; + } + + public void setTradeInOrderlineId(String tradeInOrderlineId) + { + this.tradeInOrderlineId = tradeInOrderlineId; + } + + public String getProspects() + { + return prospects; + } + + public void setProspects(String prospects) + { + this.prospects = prospects; + } + + public String getSales() + { + return sales; + } + + public void setSales(String sales) + { + this.sales = sales; + } + + public ArrayList getShowroomTrafficBean() + { + return showroomTrafficBean; + } + + public void setShowroomTrafficBean(ArrayList showroomTrafficBean) + { + this.showroomTrafficBean = showroomTrafficBean; + } + + + + public String getTraffic() + { + return traffic; + } + + public void setTraffic(String traffic) + { + this.traffic = traffic; + } + + + + public String getModelCode() { + return modelCode; + } + public void setModelCode(String modelCode) { + this.modelCode = modelCode; + } + public String getModelCodeId() { + return modelCodeId; + } + public void setModelCodeId(String modelCodeId) { + this.modelCodeId = modelCodeId; + } + public String getModelId() { + return modelId; + } + public void setModelId(String modelId) { + this.modelId = modelId; + } + public String getTrx() { + return trx; + } + public void setTrx(String trx) { + this.trx = trx; + } + public String getTrxId() { + return trxId; + } + public void setTrxId(String trxId) { + this.trxId = trxId; + } + public String getDealerCode() { + return dealerCode; + } + public void setDealerCode(String dealerCode) { + this.dealerCode = dealerCode; + } + public String getDealerCodeId() { + return dealerCodeId; + } + public void setDealerCodeId(String dealerCodeId) { + this.dealerCodeId = dealerCodeId; + } + public String getName2() + { + return name2; + } + public void setName2(String name2) + { + this.name2 = name2; + } + public String getIsAllocationWarehouse() { + return isAllocationWarehouse; + } + public void setIsAllocationWarehouse(String isAllocationWarehouse) { + this.isAllocationWarehouse = isAllocationWarehouse; + } + + + public String getCanAlterOrder() { + return canAlterOrder; + } + public void setCanAlterOrder(String canAlterOrder) { + this.canAlterOrder = canAlterOrder; + } + public String getCanCreateOrder() { + return canCreateOrder; + } + public void setCanCreateOrder(String canCreateOrder) { + this.canCreateOrder = canCreateOrder; + } + public String getCanViewOrder() { + return canViewOrder; + } + public void setCanViewOrder(String canViewOrder) { + this.canViewOrder = canViewOrder; + } + public String getSalesRepId() { + return salesRepId; + } + public void setSalesRepId(String salesRepId) { + this.salesRepId = salesRepId; + } + public String getAltText() { + return altText; + } + public void setAltText(String altText) { + this.altText = altText; + } + public String getDateFrom() { + return dateFrom; + } + public void setDateFrom(String dateFrom) { + this.dateFrom = dateFrom; + } + public String getDateTo() { + return dateTo; + } + public void setDateTo(String dateTo) { + this.dateTo = dateTo; + } + public String getImagePath() { + return imagePath; + } + public void setImagePath(String imagePath) { + this.imagePath = imagePath; + } + public String getImageTitle() { + return imageTitle; + } + public void setImageTitle(String imageTitle) { + this.imageTitle = imageTitle; + } + + public String getEndDate() + { + return endDate; + } + public void setEndDate(String endDate) + { + this.endDate = endDate; + } + public String getStartDate() + { + return startDate; + } + public void setStartDate(String startDate) + { + this.startDate = startDate; + } + public String getWeekNo() + { + return weekNo; + } + public void setWeekNo(String weekNo) + { + this.weekNo = weekNo; + } + public String getFax() + { + return fax; + } + public void setFax(String fax) + { + this.fax = fax; + } + + public String getFinanceOption() + { + return financeOption; + } + public void setFinanceOption(String financeOption) + { + this.financeOption = financeOption; + } + public String getStatus() + { + return status; + } + public void setStatus(String status) + { + this.status = status; + } + + + + public String getCountryOfImpCode() + { + return countryOfImpCode; + } + + + + public void setCountryOfImpCode(String countryOfImpCode) + { + this.countryOfImpCode = countryOfImpCode; + } + + + + public String getEnginePower() + { + return enginePower; + } + + + + public void setEnginePower(String enginePower) + { + this.enginePower = enginePower; + } + + + + public String getMainColourCode() + { + return mainColourCode; + } + + + + public void setMainColourCode(String mainColourCode) + { + this.mainColourCode = mainColourCode; + } + + + + public String getNatisModelNo() + { + return natisModelNo; + } + + + + public void setNatisModelNo(String natisModelNo) + { + this.natisModelNo = natisModelNo; + } + + + + public String getNewVinNumber() + { + return newVinNumber; + } + + + + public void setNewVinNumber(String newVinNumber) + { + this.newVinNumber = newVinNumber; + } + + + + public String getNoOfWheels() + { + return noOfWheels; + } + + + + public void setNoOfWheels(String noOfWheels) + { + this.noOfWheels = noOfWheels; + } + + + + public String getTare() + { + return tare; + } + + + + public void setTare(String tare) + { + this.tare = tare; + } + + + + public String getUnitNumber() + { + return unitNumber; + } + + + + public void setUnitNumber(String unitNumber) + { + this.unitNumber = unitNumber; + } + + public String getAttributesetinstanceIdFrom() { + return attributesetinstanceIdFrom; + } + public void setAttributesetinstanceIdFrom(String attributesetinstanceIdFrom) { + this.attributesetinstanceIdFrom = attributesetinstanceIdFrom; + } + public String getAttributesetinstanceIdTo() { + return attributesetinstanceIdTo; + } + public void setAttributesetinstanceIdTo(String attributesetinstanceIdTo) { + this.attributesetinstanceIdTo = attributesetinstanceIdTo; + } + + public String getReleasedBy() { + return releasedBy; + } + public void setReleasedBy(String releasedBy) { + this.releasedBy = releasedBy; + } + + public Integer[] getProductIds() { + return productIds; + } + public void setProductIds(Integer[] productIds) { + this.productIds = productIds; + } + public String getColourCodeHES() + { + return colourCodeHES; + } + + + + public void setColourCodeHES(String colourCodeHES) + { + this.colourCodeHES = colourCodeHES; + } + public String getNatisModelDescription() + { + return natisModelDescription; + } + + + + public void setNatisModelDescription(String natisModelDescription) + { + this.natisModelDescription = natisModelDescription; + } + + public String getETA() + { + return ETA; + } + public void setETA(String eta) + { + ETA = eta; + } + + public String getETAFilter() + { + return ETAFilter; + } + public void setETAFilter(String filter) + { + ETAFilter = filter; + } + + + public String getEngineCapacity() + { + return engineCapacity; + } + + public void setEngineCapacity(String engineCapacity) + { + this.engineCapacity = engineCapacity; + } + + public Integer[] getOrderIds() + { + return orderIds; + } + public void setOrderIds(Integer[] orderIds) { + this.orderIds = orderIds; + } + + public Integer[] getSernoAttributeSetInstanceIds() + { + return sernoAttributeSetInstanceIds; + } + public void setSernoAttributeSetInstanceIds( + Integer[] sernoAttributeSetInstanceIds) + { + this.sernoAttributeSetInstanceIds = sernoAttributeSetInstanceIds; + } + + + public String getModelDesc() + { + return modelDesc; + } + + public void setModelDesc(String modelDesc) + { + this.modelDesc = modelDesc; + } + + public String getModelMatchID() + { + return modelMatchID; + } + + public void setModelMatchID(String modelMatchID) + { + this.modelMatchID = modelMatchID; + } + + public String getNatisModelDesc() + { + return natisModelDesc; + } + + public void setNatisModelDesc(String natisModelDesc) + { + this.natisModelDesc = natisModelDesc; + } + + public String getTrans() + { + return trans; + } + + public void setTrans(String trans) + { + this.trans = trans; + } + public String getAttributeValueId() { + return attributeValueId; + } + public void setAttributeValueId(String attributeValueId) { + this.attributeValueId = attributeValueId; + } + public String getShowActiveOnly() { + return showActiveOnly; + } + public void setShowActiveOnly(String showActiveOnly) { + this.showActiveOnly = showActiveOnly; + } + public String getUpdateAttrValueId() { + return updateAttrValueId; + } + public void setUpdateAttrValueId(String updateAttrValueId) { + this.updateAttrValueId = updateAttrValueId; + } + + public String getIsVisible() + { + return isVisible; + } + + public void setIsVisible(String isVisible) + { + this.isVisible = isVisible; + } + + public String getActive() + { + return active; + } + + public void setActive(String active) + { + this.active = active; + } + + public String getVisible() + { + return visible; + } + + public void setVisible(String visible) + { + this.visible = visible; + } + + public String getColourName() + { + return colourName; + } + + public void setColourName(String colourName) + { + this.colourName = colourName; + } + + public String getColourCodeMatchId() + { + return colourCodeMatchId; + } + + public void setColourCodeMatchId(String colourCodeMatchId) + { + this.colourCodeMatchId = colourCodeMatchId; + } + + + + public String getBeginingBalance() + { + return beginingBalance; + } + + public void setBeginingBalance(String beginingBalance) + { + this.beginingBalance = beginingBalance; + } + + public String getEndingBalance() + { + return endingBalance; + } + + public void setEndingBalance(String endingBalance) + { + this.endingBalance = endingBalance; + } + + public String getStatementDifference() + { + return statementDifference; + } + + public void setStatementDifference(String statementDifference) + { + this.statementDifference = statementDifference; + } + + public String getAmount() + { + return amount; + } + + + public void setAmount(String amount) + { + this.amount = amount; + } + + + public String getTrxType() + { + return trxType; + } + + + public void setTrxType(String trxType) + { + this.trxType = trxType; + } + + + + public String getAmountGiven() { + return amountGiven; + } + + public void setAmountGiven(String amountGiven) { + this.amountGiven = amountGiven; + } + + public String getAmountRefunded() + { + return amountRefunded; + } + + public void setAmountRefunded(String amountRefunded) + { + this.amountRefunded = amountRefunded; + } + + + + public String getCashBookId() + { + return cashBookId; + } + + public void setCashBookId(String cashBookId) + { + this.cashBookId = cashBookId; + } + + public String getCashBookName() + { + return cashBookName; + } + + + public void setCashBookName(String cashBookName) + { + this.cashBookName = cashBookName; + } + + + + public String getChequeNo() + { + return chequeNo; + } + + public void setChequeNo(String chequeNo) + { + this.chequeNo = chequeNo; + } + + public String getCreditCardExpMonth() + { + return creditCardExpMonth; + } + + public void setCreditCardExpMonth(String creditCardExpMonth) + { + this.creditCardExpMonth = creditCardExpMonth; + } + + public String getCreditCardExpYear() + { + return creditCardExpYear; + } + + public void setCreditCardExpYear(String creditCardExpYear) + { + this.creditCardExpYear = creditCardExpYear; + } + + public String getCreditCardNumber() + { + return creditCardNumber; + } + + public void setCreditCardNumber(String creditCardNumber) + { + this.creditCardNumber = creditCardNumber; + } + + public String getCreditCardType() + { + return creditCardType; + } + + public void setCreditCardType(String creditCardType) + { + this.creditCardType = creditCardType; + } + + + + public Integer[] getOrderLineIds() + { + return orderLineIds; + } + + public void setOrderLineIds(Integer[] orderLineIds) + { + this.orderLineIds = orderLineIds; + } + + + public Integer[] getPosOrderLineIds() + { + return posOrderLineIds; + } + + public void setPosOrderLineIds(Integer[] posOrderLineIds) + { + this.posOrderLineIds = posOrderLineIds; + } + public String getQtyLarge() + { + return qtyLarge; + } + + public void setQtyLarge(String qtyLarge) + { + this.qtyLarge = qtyLarge; + } + + public String getQtyMedium() + { + return qtyMedium; + } + + public void setQtyMedium(String qtyMedium) + { + this.qtyMedium = qtyMedium; + } + + public String getQtySmall() + { + return qtySmall; + } + + public void setQtySmall(String qtySmall) + { + this.qtySmall = qtySmall; + } + + public String getQtyXLarge() + { + return qtyXLarge; + } + + public void setQtyXLarge(String qtyXLarge) + { + this.qtyXLarge = qtyXLarge; + } + + public String getClientName() + { + return clientName; + } + + public void setClientName(String clientName) + { + this.clientName = clientName; + } + + + + public String getCashBookIds() { + return cashBookIds; + } + public void setCashBookIds(String cashBookIds) { + this.cashBookIds = cashBookIds; + } + public String getTransferAmount() { + return transferAmount; + } + public void setTransferAmount(String transferAmount) { + this.transferAmount = transferAmount; + } + public String getApplicationName() { + return applicationName; + } + public void setApplicationName(String applicationName) { + this.applicationName = applicationName; + } + + + public String getPosId() { + return this.posId; + } + + public String getBackOrder() + { + return backOrder; + } + + public void setBackOrder(String backOrder) + { + this.backOrder = backOrder; + } + + public String getDesignAttributeValueId() + { + return designAttributeValueId; + } + + public void setDesignAttributeValueId(String designAttributeValueId) + { + this.designAttributeValueId = designAttributeValueId; + } + + public String getFieldName() + { + return fieldName; + } + + public void setFieldName(String fieldName) + { + this.fieldName = fieldName; + } + + public String getKeyword() + { + return keyword; + } + + public void setKeyword(String keyword) + { + this.keyword = keyword; + } + + public String getSearchText() + { + return searchText; + } + + public void setSearchText(String searchText) + { + this.searchText = searchText; + } + + public String getShoppingCartItemId() + { + return shoppingCartItemId; + } + + public void setShoppingCartItemId(String shoppingCartItemId) + { + this.shoppingCartItemId = shoppingCartItemId; + } + + public String getSizeAttributeValueId() + { + return sizeAttributeValueId; + } + + public void setSizeAttributeValueId(String sizeAttributeValueId) + { + this.sizeAttributeValueId = sizeAttributeValueId; + } + + public String getIsNotWebstoreFeatured() + { + return isNotWebstoreFeatured; + } + + public void setIsNotWebstoreFeatured(String isNotWebstoreFeatured) + { + this.isNotWebstoreFeatured = isNotWebstoreFeatured; + } + + public String getIsWebstoreFeatured() + { + return isWebstoreFeatured; + } + + public void setIsWebstoreFeatured(String isWebstoreFeatured) + { + this.isWebstoreFeatured = isWebstoreFeatured; + } + + public String getImageName() + { + return imageName; + } + + public void setImageName(String imageName) + { + this.imageName = imageName; + } + + public ProductImageBean getProductsIndexed() + { + return productsIndexed; + } + + public ProductImageBean getProductsIndexed(int index) + { + while (index >= productsList.size()) + productsList.add(new ProductImageBean()); + return (ProductImageBean) productsList.get(index); + } + + public void setProductsIndexed(ProductImageBean productsIndexed) + { + this.productsIndexed = productsIndexed; + } + + public void setProductsIndexed(int index, ProductImageBean value) + { + productsList.add(index, value); + } + public void setPosId(String posId) { + this.posId = posId; + } + + public String getBarCode() { + return barCode; + } + public void setBarCode(String barCode) { + this.barCode = barCode; + } + public String getPurchasePriceStandard() { + return purchasePriceStandard; + } + public void setPurchasePriceStandard(String purchasePriceStandard) { + this.purchasePriceStandard = purchasePriceStandard; + } + + + public String getPurchasePriceLimit() { + return purchasePriceLimit; + } + public void setPurchasePriceLimit(String purchasePriceLimit) { + this.purchasePriceLimit = purchasePriceLimit; + } + public String getPurchasePriceList() { + return purchasePriceList; + } + public void setPurchasePriceList(String purchasePriceList) { + this.purchasePriceList = purchasePriceList; + } + public String getSalesPriceLimit() { + return salesPriceLimit; + } + public void setSalesPriceLimit(String salesPriceLimit) { + this.salesPriceLimit = salesPriceLimit; + } + public String getSalesPriceList() { + return salesPriceList; + } + public void setSalesPriceList(String salesPriceList) { + this.salesPriceList = salesPriceList; + } + public String getSalesPriceStandard() { + return salesPriceStandard; + } + public void setSalesPriceStandard(String salesPriceStandard) { + this.salesPriceStandard = salesPriceStandard; + } + public String getNoOfProductsRequired() { + return noOfProductsRequired; + } + public void setNoOfProductsRequired(String noOfProductsRequired) { + this.noOfProductsRequired = noOfProductsRequired; + } + public String getReportType() { + return reportType; + } + public void setReportType(String reportType) { + this.reportType = reportType; + } + + public String getUserSurname() { + return userSurname; + } + public void setUserSurname(String userSurname) { + this.userSurname = userSurname; + } + public String getCountryId() { + return countryId; + } + public void setCountryId(String countryId) { + this.countryId = countryId; + } + public String getCountryName() { + return countryName; + } + public void setCountryName(String countryName) { + this.countryName = countryName; + } + + public ArrayList getProductsList() + { + return productsList; + } + + public void setProductsList(ArrayList productsList) + { + this.productsList = productsList; + } + + public String getNewName() + { + return newName; + } + + public void setNewName(String newName) + { + this.newName = newName; + } + public String getPaymentByCard() { + return paymentByCard; + } + public void setPaymentByCard(String paymentByCard) { + this.paymentByCard = paymentByCard; + } + public String getPaymentByCash() { + return paymentByCash; + } + public void setPaymentByCash(String paymentByCash) { + this.paymentByCash = paymentByCash; + } + public String getPaymentByChq() { + return paymentByChq; + } + public void setPaymentByChq(String paymentByChq) { + this.paymentByChq = paymentByChq; + } + public String getIsSales() { + return isSales; + } + public void setIsSales(String isSales) { + this.isSales = isSales; + } + public String getProductClassification() { + return productClassification; + } + + public void setProductClassification(String productClassification) { + this.productClassification = productClassification; + } + + + public String getTrackingNo() { + return trackingNo; + } + + + public void setTrackingNo(String trackingNo) { + this.trackingNo = trackingNo; + } + + public String[] getSizes() + { + return sizes; + } + public void setSizes(String[] sizes) + { + this.sizes = sizes; + } + + public String getRevenueRecognition() + { + return revenueRecognition; + } + public void setRevenueRecognition(String revenueRecognition) + { + this.revenueRecognition = revenueRecognition; + } + public String getBrandName() + { + return brandName; + } + + public void setBrandName(String brandName) + { + this.brandName = brandName; + } + public String getDesignName() + { + return designName; + } + + public void setDesignName(String designName) { + this.designName = designName; + } + + public String getModelName() { + return modelName; + } + + + public void setModelName(String modelName) { + this.modelName = modelName; + } + + public String getProductCategory() { + return productCategory; + } + + public void setProductCategory(String productCategory) + { + this.productCategory = productCategory; + } + + public String getSizeName() + { + return sizeName; + } + + public String getRevenueRecoId() + { + return revenueRecoId; + } + + + public void setRevenueRecoId(String revenueRecoId) + { + this.revenueRecoId = revenueRecoId; + } + + + public void setSizeName(String sizeName) + { + this.sizeName = sizeName; + } + + + + public String getIsTextileProduct() + { + return isTextileProduct; + } + + + public void setIsTextileProduct(String isTextileProduct) + { + this.isTextileProduct = isTextileProduct; + } + + + public String getQtyFilter() + { + return qtyFilter; + } + + + public void setQtyFilter(String qtyFilter) + { + this.qtyFilter = qtyFilter; + } + public ArrayList getAttributeValueList() { + return attributeValueList; + } + public void setAttributeValueList(ArrayList attributeValueList) { + this.attributeValueList = attributeValueList; + } + public String[] getAttributeValueIds() { + return attributeValueIds; + } + public void setAttributeValueIds(String[] attributeValueIds) { + this.attributeValueIds = attributeValueIds; + } + + + + public String getCvv() + { + return cvv; + } + + public void setCvv(String cvv) + { + this.cvv = cvv; + } + + + + + public String getCreditCardPayment() + { + return creditCardPayment; + } + + + + + public void setCreditCardPayment(String creditCardPayment) + { + this.creditCardPayment = creditCardPayment; + } + + + + + + + + + public String getRequestId() + { + return requestId; + } + + public void setRequestId(String requestId) + { + this.requestId = requestId; + } + + + + + public String getBccAddresses() + { + return bccAddresses; + } + + + + + public void setBccAddresses(String bccAddresses) + { + this.bccAddresses = bccAddresses; + } + + + + + public String getCcAddresses() + { + return ccAddresses; + } + + + + + public void setCcAddresses(String ccAddresses) + { + this.ccAddresses = ccAddresses; + } + + + + + public String getFromAddress() + { + return fromAddress; + } + + + + + public void setFromAddress(String fromAddress) + { + this.fromAddress = fromAddress; + } + + + + + public String getTextMessage() + { + return textMessage; + } + + + + + public void setTextMessage(String textMessage) + { + this.textMessage = textMessage; + } + + + + + public String getToAddresses() + { + return toAddresses; + } + + + + + public void setToAddresses(String toAddresses) + { + this.toAddresses = toAddresses; + } + + + + + public String getShipperId() + { + return shipperId; + } + + + + + public void setShipperId(String shipperId) + { + this.shipperId = shipperId; + } + + + + + public String getAccountName() + { + return accountName; + } + + + + + public void setAccountName(String accountName) + { + this.accountName = accountName; + } + + + + + public String getCreditCardExpMonthName() + { + return creditCardExpMonthName; + } + + + + + public void setCreditCardExpMonthName(String creditCardExpMonthName) + { + this.creditCardExpMonthName = creditCardExpMonthName; + } + + + + + public String getCreditCardNumberEncrypted() + { + return creditCardNumberEncrypted; + } + + + + + public void setCreditCardNumberEncrypted(String creditCardNumberEncrypted) + { + this.creditCardNumberEncrypted = creditCardNumberEncrypted; + } + + + + + public String getPaymentMethod() + { + return paymentMethod; + } + + + + + public void setPaymentMethod(String paymentMethod) + { + this.paymentMethod = paymentMethod; + } + + + public String getToUserId() + { + return toUserId; + } + + + + + public void setToUserId(String toUserId) + { + this.toUserId = toUserId; + } + + + + + public String getPriority() + { + return priority; + } + + public void setPriority(String priority) + { + this.priority = priority; + } + public String getTitle() + { + return title; + } + public void setTitle(String title) + { + this.title = title; + } + public String getChargeId() + { + return chargeId; + } + public void setChargeId(String chargeId) + { + this.chargeId = chargeId; + } + public String getStatusId() + { + return statusId; + } + public void setStatusId(String statusId) + { + this.statusId = statusId; + } + public String getProductType() + { + return productType; + } + public void setProductType(String productType) + { + this.productType = productType; + } + public String getQtyNumberFilter() + { + return qtyNumberFilter; + } + public void setQtyNumberFilter(String qtyNumberFilter) + { + this.qtyNumberFilter = qtyNumberFilter; + } + public String getTaxCategoryId() + { + return taxCategoryId; + } + public void setTaxCategoryId(String taxCategoryId) + { + this.taxCategoryId = taxCategoryId; + } + public String getTaxCategoryName() + { + return taxCategoryName; + } + public void setTaxCategoryName(String taxCategoryName) + { + this.taxCategoryName = taxCategoryName; + } + public String getTotalActualPrice() + { + return totalActualPrice; + } + public void setTotalActualPrice(String totalActualPrice) + { + this.totalActualPrice = totalActualPrice; + } + public String getIfAdd() { + return ifAdd; + } + public void setIfAdd(String ifAdd) { + this.ifAdd = ifAdd; + } + public String getVendorName() { + return vendorName; + } + public void setVendorName(String vendorName) { + this.vendorName = vendorName; + } + public String getTimePeriod() { + return timePeriod; + } + public void setTimePeriod(String timePeriod) { + this.timePeriod = timePeriod; + } + + public String getChartType() { + return chartType; + } + public void setChartType(String chartType) { + this.chartType = chartType; + } + + public String getTaxRate() { + return taxRate; + } + + + public void setTaxRate(String taxRate) { + this.taxRate = taxRate; + } + + + public String getState() + { + return state; + } + public void setState(String state) + { + this.state = state; + } + + public String getAccountId() { + return accountId; + } + public void setAccountId(String accountId) { + this.accountId = accountId; + } + public String getDateRange() { + return dateRange; + } + public void setDateRange(String dateRange) { + this.dateRange = dateRange; + } + public String getReportName() { + return reportName; + } + public void setReportName(String reportName) { + this.reportName = reportName; + } + + + public String getTransferAllAmount() { + return transferAllAmount; + } + + + public void setTransferAllAmount(String transferAllAmount) { + this.transferAllAmount = transferAllAmount; + } + + + public String getAdjustmentAmount() { + return adjustmentAmount; + } + + + public void setAdjustmentAmount(String adjustmentAmount) { + this.adjustmentAmount = adjustmentAmount; + } + + + public String getDifferenceAmt() { + return differenceAmt; + } + + + public void setDifferenceAmt(String differenceAmt) { + this.differenceAmt = differenceAmt; + } + + + public String getCardTotal() { + return cardTotal; + } + + + public void setCardTotal(String cardTotal) { + this.cardTotal = cardTotal; + } + + + public String getCashTotal() { + return cashTotal; + } + + + public void setCashTotal(String cashTotal) { + this.cashTotal = cashTotal; + } + + + public String getChequeTotal() { + return chequeTotal; + } + + + public void setChequeTotal(String chequeTotal) { + this.chequeTotal = chequeTotal; + } + + + public String getTillGrandTotal() { + return tillGrandTotal; + } + + + public void setTillGrandTotal(String tillGrandTotal) { + this.tillGrandTotal = tillGrandTotal; + } + + + public String getCreatingFromOrder() { + return creatingFromOrder; + } + + + public void setCreatingFromOrder(String creatingFromOrder) { + this.creatingFromOrder = creatingFromOrder; + } + + + public String getTransferType() { + return transferType; + } + + + public void setTransferType(String transferType) { + this.transferType = transferType; + } +public String getCustomSize() { + return customSize; + } + + + public void setCustomSize(String customSize) { + this.customSize = customSize; + } + + + public String getPriceQtyFilter() { + return priceQtyFilter; + } + + public String getDeliveryViaRule() + { + return deliveryViaRule; + } + + + public void setPriceQtyFilter(String priceQtyFilter) { + this.priceQtyFilter = priceQtyFilter; + } + + public void setDeliveryViaRule(String deliveryViaRule) + { + this.deliveryViaRule = deliveryViaRule; + } + + + public String getCashId() + { + return cashId; + } + + + public void setCashId(String cashId) + { + this.cashId = cashId; + } + + + public String getCashLineId() + { + return cashLineId; + } + + + public void setCashLineId(String cashLineId) + { + this.cashLineId = cashLineId; + } + public String getUserPIN() { + return userPIN; + } + + + public void setUserPIN(String userPIN) { + this.userPIN = userPIN; + } + + public String getPaymentRule() { + return paymentRule; + } + + + public void setPaymentRule(String paymentRule) { + this.paymentRule = paymentRule; + } + + public String getIsSelfService() + { + return isSelfService; + } + + + public void setIsSelfService(String isSelfService) + { + this.isSelfService = isSelfService; + } + + + public String getCardDifference() { + return cardDifference; + } + + + public void setCardDifference(String cardDifference) { + this.cardDifference = cardDifference; + } + + + public String getChequeDifference() { + return chequeDifference; + } + + + public void setChequeDifference(String chequeDifference) { + this.chequeDifference = chequeDifference; + } + + + + public String getDocumentNote() + { + return documentNote; + } + + + public void setDocumentNote(String documentNote) + { + this.documentNote = documentNote; + } + + + public String getCurrencySymbole() { + return currencySymbole; + } + + + public void setCurrencySymbole(String currencySymbole) { + this.currencySymbole = currencySymbole; + } + +public String getUserDiscount() { + return userDiscount; + } + + + public void setUserDiscount(String userDiscount) { + this.userDiscount = userDiscount; + } + + + public String getOpenAmt() { + return openAmt; + } + + + public void setOpenAmt(String openAmt) { + this.openAmt = openAmt; + } + + + public String getOverUnderPayment() { + return overUnderPayment; + } + + + public void setOverUnderPayment(String overUnderPayment) { + this.overUnderPayment = overUnderPayment; + } + + + public String getPaidAmt() { + return paidAmt; + } + + + public void setPaidAmt(String paidAmt) { + this.paidAmt = paidAmt; + } + + + public String getPaymentAmt() { + return paymentAmt; + } + + + public void setPaymentAmt(String paymentAmt) { + this.paymentAmt = paymentAmt; + } + + + public String getWriteOffAmt() { + return writeOffAmt; + } + + + public void setWriteOffAmt(String writeOffAmt) { + this.writeOffAmt = writeOffAmt; + } + + + + public String getCurrencyId() { + return currencyId; + } + + + public void setCurrencyId(String currencyId) { + this.currencyId = currencyId; + } + + + public String getDaysDue() { + return daysDue; + } + + + public void setDaysDue(String daysDue) { + this.daysDue = daysDue; + } + + + public String getDiscountAmt() { + return discountAmt; + } + + + public void setDiscountAmt(String discountAmt) { + this.discountAmt = discountAmt; + } + + + public String getDiscountDate() { + return discountDate; + } + + + public void setDiscountDate(String discountDate) { + this.discountDate = discountDate; + } + + + public String getDue0() { + return due0; + } + + + public void setDue0(String due0) { + this.due0 = due0; + } + + + public String getDue0_30() { + return due0_30; + } + + + public void setDue0_30(String due0_30) { + this.due0_30 = due0_30; + } + + + public String getDue1_7() { + return due1_7; + } + + + public void setDue1_7(String due1_7) { + this.due1_7 = due1_7; + } + + + public String getDue31_60() { + return due31_60; + } + + + public void setDue31_60(String due31_60) { + this.due31_60 = due31_60; + } + + + public String getDue61_90() { + return due61_90; + } + + + public void setDue61_90(String due61_90) { + this.due61_90 = due61_90; + } + + + public String getDue8_30() { + return due8_30; + } + + + public void setDue8_30(String due8_30) { + this.due8_30 = due8_30; + } + + + public String getDue91_PLUS() { + return due91_PLUS; + } + + + public void setDue91_PLUS(String due91_PLUS) { + this.due91_PLUS = due91_PLUS; + } + + + public String getDueAmt() { + return dueAmt; + } + + + public void setDueAmt(String dueAmt) { + this.dueAmt = dueAmt; + } + + + public String getDueDate() { + return dueDate; + } + + + public void setDueDate(String dueDate) { + this.dueDate = dueDate; + } + + + public String getInvoicedAmt() { + return invoicedAmt; + } + + + public void setInvoicedAmt(String invoicedAmt) { + this.invoicedAmt = invoicedAmt; + } + + + public String getInvoiceDate() { + return invoiceDate; + } + + + public void setInvoiceDate(String invoiceDate) { + this.invoiceDate = invoiceDate; + } + + + public String getInvoiceGrandTotal() { + return invoiceGrandTotal; + } + + + public void setInvoiceGrandTotal(String invoiceGrandTotal) { + this.invoiceGrandTotal = invoiceGrandTotal; + } + + + public String getInvoiceScheduleId() { + return invoiceScheduleId; + } + + + public void setInvoiceScheduleId(String invoiceScheduleId) { + this.invoiceScheduleId = invoiceScheduleId; + } + + + public String getNetDays() { + return netDays; + } + + + public void setNetDays(String netDays) { + this.netDays = netDays; + } + + + public String getPastDue1_30() { + return pastDue1_30; + } + + + public void setPastDue1_30(String pastDue1_30) { + this.pastDue1_30 = pastDue1_30; + } + + + public String getPastDue1_7() { + return pastDue1_7; + } + + + public void setPastDue1_7(String pastDue1_7) { + this.pastDue1_7 = pastDue1_7; + } + + + public String getPastDue31_60() { + return pastDue31_60; + } + + + public void setPastDue31_60(String pastDue31_60) { + this.pastDue31_60 = pastDue31_60; + } + + + public String getPastDue61_90() { + return pastDue61_90; + } + + + public void setPastDue61_90(String pastDue61_90) { + this.pastDue61_90 = pastDue61_90; + } + + + public String getPastDue8_30() { + return pastDue8_30; + } + + + public void setPastDue8_30(String pastDue8_30) { + this.pastDue8_30 = pastDue8_30; + } + + + public String getPastDue91_plus() { + return pastDue91_plus; + } + + + public void setPastDue91_plus(String pastDue91_plus) { + this.pastDue91_plus = pastDue91_plus; + } + + + public String getPastDueAmt() { + return pastDueAmt; + } + + + public void setPastDueAmt(String pastDueAmt) { + this.pastDueAmt = pastDueAmt; + } + + + public String getPaymentTermId() { + return paymentTermId; + } + + + public void setPaymentTermId(String paymentTermId) { + this.paymentTermId = paymentTermId; + } + + + public FormFile getImage() + { + return image; + } + + + public void setImage(FormFile image) + { + this.image = image; + } + + + public String getBlackListedId() + { + return blackListedId; + } + + + public void setBlackListedId(String blackListedId) + { + this.blackListedId = blackListedId; + } + + + public String getBlackListedBankName() + { + return blackListedBankName; + } + + + public void setBlackListedBankName(String blackListedBankName) + { + this.blackListedBankName = blackListedBankName; + } + + + public String getBlackListedChequeNo() + { + return blackListedChequeNo; + } + + + public void setBlackListedChequeNo(String blackListedChequeNo) + { + this.blackListedChequeNo = blackListedChequeNo; + } + + public String getInvoiceNo() + { + + return invoiceNo; + } + public void setInvoiceNo(String invoiceNo) + { + this.invoiceNo = invoiceNo; + } + + + + + + + public Integer[] getBpartnerIds() { + return bpartnerIds; + } + + + public void setBpartnerIds(Integer[] bpartnerIds) { + this.bpartnerIds = bpartnerIds; + } + + + public String getPaymentTermName() { + return paymentTermName; + } + + + public void setPaymentTermName(String paymentTermName) { + this.paymentTermName = paymentTermName; + } + + + public String getBP_Group_ID() { + return BP_Group_ID; + } + + + public void setBP_Group_ID(String group_ID) { + BP_Group_ID = group_ID; + } + + + public String getDunningLevelId() { + return dunningLevelId; + } + + + public void setDunningLevelId(String dunningLevelId) { + this.dunningLevelId = dunningLevelId; + } + + + public String getDunningLevelName() { + return dunningLevelName; + } + + + public void setDunningLevelName(String dunningLevelName) { + this.dunningLevelName = dunningLevelName; + } + + + public String getDunningPrintNote() { + return dunningPrintNote; + } + + + public void setDunningPrintNote(String dunningPrintNote) { + this.dunningPrintNote = dunningPrintNote; + } + + + public String getDunningPrintText() { + return dunningPrintText; + } + + + public void setDunningPrintText(String dunningPrintText) { + this.dunningPrintText = dunningPrintText; + } + + + + + public String getDunningId() { + return dunningId; + } + + + public void setDunningId(String dunningId) { + this.dunningId = dunningId; + } + + + public String getDunningName() { + return dunningName; + } + + + public void setDunningName(String dunningName) { + this.dunningName = dunningName; + } + + + public String getCreditLimit() { + return creditLimit; + } + + + public void setCreditLimit(String creditLimit) { + this.creditLimit = creditLimit; + } + + + public String getCreditStatus() { + return creditStatus; + } + + + public void setCreditStatus(String creditStatus) { + this.creditStatus = creditStatus; + } + + + public String getCreditUsed() { + return creditUsed; + } + + + public void setCreditUsed(String creditUsed) { + this.creditUsed = creditUsed; + } + + + public String getDocBasisType() { + return docBasisType; + } + + + public void setDocBasisType(String docBasisType) { + this.docBasisType = docBasisType; + } + + + public String getAmtMultiplier() { + return amtMultiplier; + } + + + public void setAmtMultiplier(String amtMultiplier) { + this.amtMultiplier = amtMultiplier; + } + + + public String getFrequencyType() { + return frequencyType; + } + + + public void setFrequencyType(String frequencyType) { + this.frequencyType = frequencyType; + } + + + public String getCommissionAmtId() { + return commissionAmtId; + } + + + public void setCommissionAmtId(String commissionAmtId) { + this.commissionAmtId = commissionAmtId; + } + + + public String getSubtractAmt() { + return subtractAmt; + } + + + public void setSubtractAmt(String subtractAmt) { + this.subtractAmt = subtractAmt; + } + + + public String getForward() { + return forward; + } + + + public void setForward(String forward) { + this.forward = forward; + } + + + public String getIsTaxExempted() { + return isTaxExempted; + } + + + public void setIsTaxExempted(String isTaxExempted) { + this.isTaxExempted = isTaxExempted; + } + + + public String getTaxId() { + return taxId; + } + + + public void setTaxId(String taxId) { + this.taxId = taxId; + } + + + public String getTaxName() { + return taxName; + } + + + public void setTaxName(String taxName) { + this.taxName = taxName; + } + + + public Integer[] getInvoiceIds() { + return invoiceIds; + } + + + public void setInvoiceIds(Integer[] invoiceIds) { + this.invoiceIds = invoiceIds; + } + + + public String getInventoryId() { + return inventoryId; + } + + + public void setInventoryId(String inventoryId) { + this.inventoryId = inventoryId; + } + + + public String getInventoryLineId() { + return inventoryLineId; + } + + + public void setInventoryLineId(String inventoryLineId) { + this.inventoryLineId = inventoryLineId; + } + + + public String getQtyBook() { + return qtyBook; + } + + + public void setQtyBook(String qtyBook) { + this.qtyBook = qtyBook; + } + + + public String getQtyCount() { + return qtyCount; + } + + + public void setQtyCount(String qtyCount) { + this.qtyCount = qtyCount; + } + + + public String getAfterDelivery() { + return afterDelivery; + } + + + public void setAfterDelivery(String afterDelivery) { + this.afterDelivery = afterDelivery; + } + + + public String getFiedMonthCutoff() { + return fiedMonthCutoff; + } + + + public void setFiedMonthCutoff(String fiedMonthCutoff) { + this.fiedMonthCutoff = fiedMonthCutoff; + } + + + public String getFixedDueDate() { + return fixedDueDate; + } + + + public void setFixedDueDate(String fixedDueDate) { + this.fixedDueDate = fixedDueDate; + } + + + public String getFixedMonthDay() { + return fixedMonthDay; + } + + + public void setFixedMonthDay(String fixedMonthDay) { + this.fixedMonthDay = fixedMonthDay; + } + + + public String getFixedMonthOffset() { + return fixedMonthOffset; + } + + + public void setFixedMonthOffset(String fixedMonthOffset) { + this.fixedMonthOffset = fixedMonthOffset; + } + + + public String getNextBusinessday() { + return nextBusinessday; + } + + + public void setNextBusinessday(String nextBusinessday) { + this.nextBusinessday = nextBusinessday; + } + + + public String getPhone() { + return phone; + } + + + public void setPhone(String phone) { + this.phone = phone; + } + + + public String getPhone2() { + return phone2; + } + + + public void setPhone2(String phone2) { + this.phone2 = phone2; + } + + public String getToBeShipped() { + return toBeShipped; + } + + + public void setToBeShipped(String toBeShipped) { + this.toBeShipped = toBeShipped; + } + + + public String getDiscountAmt1() { + return discountAmt1; + } + + + public void setDiscountAmt1(String discountAmt1) { + this.discountAmt1 = discountAmt1; + } + + + public String getDiscountAmt2() { + return discountAmt2; + } + + + public void setDiscountAmt2(String discountAmt2) { + this.discountAmt2 = discountAmt2; + } + + + public String getDiscountDay1() { + return discountDay1; + } + + + public void setDiscountDay1(String discountDay1) { + this.discountDay1 = discountDay1; + } + + + public String getDiscountDay2() { + return discountDay2; + } + + + public void setDiscountDay2(String discountDay2) { + this.discountDay2 = discountDay2; + } + + + + + + + + public PaymentBean getPaymentBeanIndex() { + return paymentBeanIndex; + } + + + public void setPaymentBeanIndex(PaymentBean paymentBeanIndex) { + this.paymentBeanIndex = paymentBeanIndex; + } + + + public String getAllocatedAmount() { + return allocatedAmount; + } + + + public void setAllocatedAmount(String allocatedAmount) { + this.allocatedAmount = allocatedAmount; + } + + + public String getGroup1() { + return group1; + } + + + public void setGroup1(String group1) { + this.group1 = group1; + } + + + public String getGroup2() { + return group2; + } + + + public void setGroup2(String group2) { + this.group2 = group2; + } + + + + public String getIsFullAccess() { + return isFullAccess; + } + + + public void setIsFullAccess(String isFullAccess) { + this.isFullAccess = isFullAccess; + } + + + public Integer[] getInventoryIds() + { + return inventoryIds; + } + + + public void setInventoryIds(Integer[] inventoryIds) + { + this.inventoryIds = inventoryIds; + } + + + public String[] getAllocateAmount() { + return allocateAmount; + } + + + public void setAllocateAmount(String[] allocateAmount) { + this.allocateAmount = allocateAmount; + } + + + public String getBirthdate() { + return birthdate; + } + + + public void setBirthdate(String birthdate) { + this.birthdate = birthdate; + } + + + public String getDay() { + return day; + } + + + public void setDay(String day) { + this.day = day; + } + + + public String getOpenDrawer() { + return openDrawer; + } + + + public void setOpenDrawer(String openDrawer) { + this.openDrawer = openDrawer; + } + + + public String getStoreId() { + return storeId; + } + + + public void setStoreId(String storeId) { + this.storeId = storeId; + } + + + public String getUomId() { + return uomId; + } + + + public void setUomId(String uomId) { + this.uomId = uomId; + } + + + public String getIsOverwritePriceLimit() { + return isOverwritePriceLimit; + } + + + public void setIsOverwritePriceLimit(String isOverwritePriceLimit) { + this.isOverwritePriceLimit = isOverwritePriceLimit; + } + + + public String getIsChecked() { + return isChecked; + } + + + public void setIsChecked(String isChecked) { + this.isChecked = isChecked; + } + + //============================================================= + + + public void setOrderLineIndexed(int index, OrderLineBean value) + { + orderLineList.add(index, value); + } + + public void setOrderLineIndexed(OrderLineBean orderLineIndexed) + { + this.orderLineIndexed = orderLineIndexed; + } + + public void setOrderLineList(ArrayList orderLineList) + { + this.orderLineList = orderLineList; + } + + public OrderLineBean getOrderLineIndexed() + { + return orderLineIndexed; + } + + public OrderLineBean getOrderLineIndexed(int index) + { + while (index >= orderLineList.size()) + orderLineList.add(new OrderLineBean()); + return (OrderLineBean) orderLineList.get(index); + } + + public ArrayList getOrderLineList() + { + return orderLineList; + } + + //============================================================= + + protected RoleBean roleOrgAccessIndexed; + protected ArrayList roleOrgAccessList = new ArrayList(); + + + + + + public RoleBean getRoleOrgAccessIndexed() + { + return roleOrgAccessIndexed; + } + + public void setRoleOrgAccessIndexed(int index, RoleBean roleOrgAccessIndexed) + { + this.roleOrgAccessList.add(index, roleOrgAccessIndexed); + } + + public void setRoleOrgAccessIndexed(RoleBean roleOrgAccessIndexed) + { + this.roleOrgAccessIndexed = roleOrgAccessIndexed; + } + + + public ArrayList getRoleOrgAccessList() + { + return roleOrgAccessList; + } + + + public void setRoleOrgAccessList(ArrayList roleOrgAccessList) + { + this.roleOrgAccessList = roleOrgAccessList; + } + + public RoleBean getRoleOrgAccessIndexed(int index) + { + while (index >= roleOrgAccessList.size()) + roleOrgAccessList.add(new RoleBean()); + return (RoleBean) roleOrgAccessList.get(index); + } + + public String getFullDetails() + { + return fullDetails; + } + + public void setFullDetails(String fullDetails) + { + this.fullDetails = fullDetails; + } + + public String getOrgFromId() + { + return orgFromId; + } + + public void setOrgFromId(String orgFromId) + { + this.orgFromId = orgFromId; + } + + public String getOrgToId() + { + return orgToId; + } + + public void setOrgToId(String orgToId) + { + this.orgToId = orgToId; + } + + public String getQtyOnHand() + { + return qtyOnHand; + } + + public void setQtyOnHand(String qtyOnHand) + { + this.qtyOnHand = qtyOnHand; + } + + public String getQtyToMove() + { + return qtyToMove; + } + + public void setQtyToMove(String qtyToMove) + { + this.qtyToMove = qtyToMove; + } + + public String getUom() + { + return uom; + } + + public void setUom(String uom) + { + this.uom = uom; + } + + + public String getUnitPrice() + { + return unitPrice; + } + + + public void setUnitPrice(String unitPrice) + { + this.unitPrice = unitPrice; + } + + + public StockMovementBean getStock() + { + return stock; + } + + public void setStock(StockMovementBean stockBean) + { + this.stock = stockBean; + } + + public void setStock(int index,StockMovementBean stockBean) + { + this.stockList.add(index, stockBean); + } + + public StockMovementBean getStock(int index) + { + while (index >= stockList.size()) + { + stockList.add(new StockMovementBean()); + } + return (StockMovementBean) stockList.get(index); + } + + public ArrayList getStockList() + { + return stockList; + } + + public void setStockList(ArrayList stockList) + { + this.stockList = stockList; + } + + public String getGrossProfit() + { + return grossProfit; + } + + public void setGrossProfit(String grossProfit) + { + this.grossProfit = grossProfit; + } + + public String getRefNo() + { + return refNo; + } + + public void setRefNo(String refNo) + { + this.refNo = refNo; + } + + public String getMovementId() + { + return movementId; + } + + public void setMovementId(String movementId) + { + this.movementId = movementId; + } + + + public String getIndex() + { + return index; + } + + + public void setIndex(String index) + { + this.index = index; + } + + + public String getOrgFromName() + { + return orgFromName; + } + + + public void setOrgFromName(String orgFromName) + { + this.orgFromName = orgFromName; + } + + + public String getOrgToName() + { + return orgToName; + } + + + public void setOrgToName(String orgToName) + { + this.orgToName = orgToName; + } + + public String getMoveConfirmId() + { + return moveConfirmId; + } + + public void setMoveConfirmId(String moveConfirmId) + { + this.moveConfirmId = moveConfirmId; + } + + public String getLineNo() + { + return lineNo; + } + + public void setLineNo(String lineNo) + { + this.lineNo = lineNo; + } + + public String getMovementLineId() { + return movementLineId; + } + + public void setMovementLineId(String movementLineId) { + this.movementLineId = movementLineId; + } + + + public String getCompany() { + return company; + } + + public void setCompany(String company) { + this.company = company; + } + + public String getIndustry() { + return industry; + } + + public void setIndustry(String industry) { + this.industry = industry; + } + + public String getComments() { + return comments; + } + + public void setComments(String comments) { + this.comments = comments; + } + + + public String getIsSOPriceList() { + return isSOPriceList; + } + + public void setIsSOPriceList(String isSOPriceList) { + this.isSOPriceList = isSOPriceList; + } + + public String getIsMandatory() { + return isMandatory; + } + + public void setIsMandatory(String isMandatory) { + this.isMandatory = isMandatory; + } + + public String getIsPresentForProduct() { + return isPresentForProduct; + } + + public void setIsPresentForProduct(String isPresentForProduct) { + this.isPresentForProduct = isPresentForProduct; + } + + public String getPriceListId() { + return priceListId; + } + + public void setPriceListId(String priceListId) { + this.priceListId = priceListId; + } + + public String getLimitPrice() { + return limitPrice; + } + + public void setLimitPrice(String limitPrice) { + this.limitPrice = limitPrice; + } + + public String getStdPrice() { + return stdPrice; + } + + public void setStdPrice(String stdPrice) { + this.stdPrice = stdPrice; + } + + public String getListPrice() { + return listPrice; + } + + public void setListPrice(String listPrice) { + this.listPrice = listPrice; + } + + public PriceListBean getPriceListBean() { + return priceListBean; + } + + public void setPriceListBean(PriceListBean priceListBean) { + this.priceListBean = priceListBean; + } + + public ArrayList getPriceListBeanList() { + return priceListBeanList; + } + + public void setPriceListBeanList(ArrayList priceListBeanList) { + this.priceListBeanList = priceListBeanList; + } + + public void setPriceListBean(int index, PriceListBean bean) + { + this.priceListBeanList.add(index, bean); + } + + public PriceListBean getPriceListBean(int index) + { + while (index >= priceListBeanList.size()) + { + priceListBeanList.add(new PriceListBean()); + } + return (PriceListBean) priceListBeanList.get(index); + + } + + public ProductBean getProductBean() { + return productBean; + } + + public void setProductBean(ProductBean productBean) { + this.productBean = productBean; + } + + public ArrayList getProductBeanList() { + return productBeanList; + } + + public void setProductBeanList(ArrayList productBeanList) { + this.productBeanList = productBeanList; + } + public void setProductBean(int index, ProductBean bean) + { + this.productBeanList.add(index, bean); + } + + public ProductBean getProductBean(int index) + { + while (index >= productBeanList.size()) + { + productBeanList.add(new ProductBean()); + } + return (ProductBean) productBeanList.get(index); + + } + + public String getListPriceIncl() { + return listPriceIncl; + } + + public void setListPriceIncl(String listPriceIncl) { + this.listPriceIncl = listPriceIncl; + } + + public String getStdPriceIncl() { + return stdPriceIncl; + } + + public void setStdPriceIncl(String stdPriceIncl) { + this.stdPriceIncl = stdPriceIncl; + } + + public String getLimitPriceIncl() { + return limitPriceIncl; + } + + public void setLimitPriceIncl(String limitPriceIncl) { + this.limitPriceIncl = limitPriceIncl; + + } + + public String getSalesPriceListId() { + return salesPriceListId; + } + + public void setSalesPriceListId(String salesPriceListId) { + this.salesPriceListId = salesPriceListId; + } + + public String getPurchasePriceListId() { + return purchasePriceListId; + } + + public void setPurchasePriceListId(String purchasePriceListId) { + this.purchasePriceListId = purchasePriceListId; + } + + public void setRoundOffFactor(String roundOffFactor) { + this.roundOffFactor = roundOffFactor; + } + + public String getRoundOffFactor() { + return roundOffFactor; + } + + public String getBasePriceListId() { + return basePriceListId; + } + + public void setBasePriceListId(String basePriceListId) { + this.basePriceListId = basePriceListId; + } + + public String getIsDeleteOldRecords() { + return isDeleteOldRecords; + } + + public void setIsDeleteOldRecords(String isDeleteOldRecords) { + this.isDeleteOldRecords = isDeleteOldRecords; + } + + public String getSubTotal() { + return subTotal; + } + + public void setSubTotal(String subTotal) { + this.subTotal = subTotal; + } + + public String getIsDiscountAllowed() { + return isDiscountAllowed; + } + + public void setIsDiscountAllowed(String isDiscountAllowed) { + this.isDiscountAllowed = isDiscountAllowed; + } + + public String getIsAllowedOverridePriceLimit() { + return isAllowedOverridePriceLimit; + } + + public void setIsAllowedOverridePriceLimit(String isAllowedOverridePriceLimit) { + this.isAllowedOverridePriceLimit = isAllowedOverridePriceLimit; + } + + public String getPriceListName() { + return priceListName; + } + + public void setPriceListName(String priceListName) { + this.priceListName = priceListName; + } + + public String getIsCreatePriceList() { + return isCreatePriceList; + } + + public void setIsCreatePriceList(String isCreatePriceList) { + this.isCreatePriceList = isCreatePriceList; + } + + public String getInclPrice() { + return inclPrice; + } + + public void setInclPrice(String inclPrice) { + this.inclPrice = inclPrice; + } + + public String getQtyCsv() + { + return qtyCsv; + } + + public void setQtyCsv(String qtyCsv) + { + this.qtyCsv = qtyCsv; + } + + public String getReadOnly() + { + return readOnly; + } + + public void setReadOnly(String readOnly) + { + this.readOnly = readOnly; + } + + public void setReadOnly(boolean readOnly) + { + this.readOnly = Boolean.toString(readOnly); + } + + public String getTerminalId() + { + return terminalId; + } + + public void setTerminalId(String terminalId) + { + this.terminalId = terminalId; + } + + public String getCashbookTransferType() + { + return cashbookTransferType; + } + + public void setCashbookTransferType(String cashbookTransferType) + { + this.cashbookTransferType = cashbookTransferType; + } + + public String getCheckTransferType() + { + return checkTransferType; + } + + public void setCheckTransferType(String checkTransferType) + { + this.checkTransferType = checkTransferType; + } + + public String getCardTransferType() + { + return cardTransferType; + } + + public void setCardTransferType(String cardTransferType) + { + this.cardTransferType = cardTransferType; + } + + public String getCardBankAccountId() + { + return cardBankAccountId; + } + + public void setCardBankAccountId(String cardBankAccountId) + { + this.cardBankAccountId = cardBankAccountId; + } + + public String getCheckBankAccountId() + { + return checkBankAccountId; + } + + public void setCheckBankAccountId(String checkBankAccountId) + { + this.checkBankAccountId = checkBankAccountId; + } + + public String getTemplateBPartnerId() + { + return templateBPartnerId; + } + + public void setTemplateBPartnerId(String templateBPartnerId) + { + this.templateBPartnerId = templateBPartnerId; + } + + public String getCashbookTransferCashbookId() + { + return cashbookTransferCashbookId; + } + + public void setCashbookTransferCashbookId(String cashTransferCashbookId) + { + this.cashbookTransferCashbookId = cashTransferCashbookId; + } + + public String getCashbookTransferBankAccountId() + { + return cashbookTransferBankAccountId; + } + + public void setCashbookTransferBankAccountId(String cashTransferBankAccountId) + { + this.cashbookTransferBankAccountId = cashTransferBankAccountId; + } + + public String getCheckTransferCashbookId() + { + return checkTransferCashbookId; + } + + public void setCheckTransferCashbookId(String checkTransferCashbookId) + { + this.checkTransferCashbookId = checkTransferCashbookId; + } + + public String getCheckTransferBankAccountId() + { + return checkTransferBankAccountId; + } + + public void setCheckTransferBankAccountId(String checkTransferBankAccountId) + { + this.checkTransferBankAccountId = checkTransferBankAccountId; + } + + public String getCardTransferCashbookId() + { + return cardTransferCashbookId; + } + + public void setCardTransferCashbookId(String cardTransferCashbookId) + { + this.cardTransferCashbookId = cardTransferCashbookId; + } + + public String getCardTransferBankAccountId() + { + return cardTransferBankAccountId; + } + + public void setCardTransferBankAccountId(String cardTransferBankAccountId) + { + this.cardTransferBankAccountId = cardTransferBankAccountId; + } + + public String getAutoLock() + { + return autoLock; + } + + public void setAutoLock(String autoLock) + { + this.autoLock = autoLock; + } + + public String getLocked() + { + return locked; + } + + public void setLocked(String locked) + { + this.locked = locked; + } + + public static long getSerialVersionUID() + { + return serialVersionUID; + } + + /** + * @return the lockingTime + */ + public String getLockingTime() + { + return lockingTime; + } + + /** + * @param lockingTime the lockingTime to set + */ + public void setLockingTime(String lockingTime) + { + this.lockingTime = lockingTime; + } + + public String getIsDiscountOnPercentage() + { + return isDiscountOnPercentage; + } + + public void setIsDiscountOnPercentage(String isDiscountOnPercentage) + { + this.isDiscountOnPercentage = isDiscountOnPercentage; + } + + public String getIsDiscountOnTotal() + { + return isDiscountOnTotal; + } + + public void setIsDiscountOnTotal(String isDiscountOnTotal) + { + this.isDiscountOnTotal = isDiscountOnTotal; + } + + public String getDiscountedLinePrice() { + return discountedLinePrice; + } + + public void setDiscountedLinePrice(String discountedLinePrice) { + this.discountedLinePrice = discountedLinePrice; + } + + public String getIsOverridePinOk() { + return isOverridePinOk; + } + + public void setIsOverridePinOk(String isOverridePinOk) { + this.isOverridePinOk = isOverridePinOk; + } + + public String getIsTaxIncluded() { + return isTaxIncluded; + } + + public void setIsTaxIncluded(String isTaxIncluded) { + this.isTaxIncluded = isTaxIncluded; + } + + public String getIsDiscountOnInclUnitPrice() { + return isDiscountOnInclUnitPrice; + } + + public void setIsDiscountOnInclUnitPrice(String isDiscountOnInclUnitPrice) { + this.isDiscountOnInclUnitPrice = isDiscountOnInclUnitPrice; + } + + public String getDiscountedInclUnitPrice() { + return discountedInclUnitPrice; + } + + public void setDiscountedInclUnitPrice(String discountedInclUnitPrice) { + this.discountedInclUnitPrice = discountedInclUnitPrice; + } + + public String getUnitPurchasePrice() + { + return unitPurchasePrice; + } + + public void setUnitPurchasePrice(String unitPurchasePrice) + { + this.unitPurchasePrice = unitPurchasePrice; + } + + public String getTotalGrossProfit() + { + return totalGrossProfit; + } + + public void setTotalGrossProfit(String totalGrossProfit) + { + this.totalGrossProfit = totalGrossProfit; + } + + public String getGrossProfitPercentage() + { + return grossProfitPercentage; + } + + public void setGrossProfitPercentage(String grossProfitPercentage) + { + this.grossProfitPercentage = grossProfitPercentage; + } + + public String getTotalGrossProfitPercentage() + { + return totalGrossProfitPercentage; + } + + public void setTotalGrossProfitPercentage(String totalGrossProfitPercentage) + { + this.totalGrossProfitPercentage = totalGrossProfitPercentage; + } + + public String getIsAllowToView() + { + return isAllowToView; + } + + public void setIsAllowToView(String isAllowToView) + { + this.isAllowToView = isAllowToView; + } + + public String getIsAllowToEdit() + { + return isAllowToEdit; + } + + public void setIsAllowToEdit(String isAllowToEdit) + { + this.isAllowToEdit = isAllowToEdit; + } + + public String getIsAllowToCreate() + { + return isAllowToCreate; + } + + public void setIsAllowToCreate(String isAllowToCreate) + { + this.isAllowToCreate = isAllowToCreate; + } + + public String getIsAllowToDelete() + { + return isAllowToDelete; + } + + public void setIsAllowToDelete(String isAllowToDelete) + { + this.isAllowToDelete = isAllowToDelete; + } + + public String getWebMenuId() + { + return webMenuId; + } + + public void setWebMenuId(String webMenuId) + { + this.webMenuId = webMenuId; + } + + public String getIsSalesReport() + { + return isSalesReport; + } + + public void setIsSalesReport(String isSalesReport) + { + this.isSalesReport = isSalesReport; + } + + public String getIsDiscountUptoLimitPrice() + { + return isDiscountUptoLimitPrice; + } + + public void setIsDiscountUptoLimitPrice(String isDiscountUptoLimitPrice) + { + this.isDiscountUptoLimitPrice = isDiscountUptoLimitPrice; + } + + public String getIsDiscountAllowedOnTotal() + { + return isDiscountAllowedOnTotal; + } + + public void setIsDiscountAllowedOnTotal(String isDiscountAllowedOnTotal) + { + this.isDiscountAllowedOnTotal = isDiscountAllowedOnTotal; + } + + public String getReceiptFooterMsg() + { + return receiptFooterMsg; + } + + public void setReceiptFooterMsg(String receiptFooterMsg) + { + this.receiptFooterMsg = receiptFooterMsg; + } + public String getStockValue() + { + return stockValue; + } + + public void setStockValue(String stockValue) + { + this.stockValue = stockValue; + } + + public String getBranch() + { + return branch; + } + + public void setBranch(String branch) + { + this.branch = branch; + } + + public String getSalesRepName() + { + return saleRepName; + } + + public void setSalesRepName(String salesRepName) + { + this.saleRepName = salesRepName; + } + + public String getNoOfPack() + { + return noOfPack; + } + + public void setNoOfPack(String noOfPack) + { + this.noOfPack = noOfPack; + } + + public String getReference() + { + return reference; + } + + public void setReference(String reference) + { + this.reference = reference; + } + + public Integer getUnitsPerPack() + { + return unitsPerPack; + } + + public void setUnitsPerPack(Integer unitsPerPack) + { + this.unitsPerPack = unitsPerPack; + } +} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/struts/customer/CustomerAction.java b/posterita/posterita/src/main/org/posterita/struts/customer/CustomerAction.java new file mode 100644 index 0000000000..044e7f1ed3 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/customer/CustomerAction.java @@ -0,0 +1,816 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Created on 02-Sep-2005 + */ + + +package org.posterita.struts.customer; + +import java.io.IOException; +import java.io.OutputStream; +import java.io.PrintWriter; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.Properties; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.compiere.model.MBPartner; +import org.compiere.util.KeyNamePair; +import org.compiere.util.Trx; +import org.posterita.Constants; +import org.posterita.beans.CustomerBean; +import org.posterita.beans.PriceListBean; +import org.posterita.businesslogic.CustomerCart; +import org.posterita.businesslogic.PaymentTermManager; +import org.posterita.businesslogic.administration.BarcodeManager; +import org.posterita.businesslogic.administration.CustomerManager; +import org.posterita.businesslogic.administration.PriceListManager; +import org.posterita.businesslogic.performanceanalysis.ReportManager; +import org.posterita.core.EmailValidator; +import org.posterita.core.TmkJSPEnv; +import org.posterita.core.TrxPrefix; +import org.posterita.exceptions.ApplicationException; +import org.posterita.exceptions.BPartnerNotFoundException; +import org.posterita.exceptions.NoAccessToEditObjectException; +import org.posterita.exceptions.NoCustomerFoundException; +import org.posterita.exceptions.OperationException; +import org.posterita.exceptions.SurnameNotPresentException; +import org.posterita.exceptions.SystemException; +import org.posterita.form.CustomerForm; +import org.posterita.form.InitCustomerForm; +import org.posterita.struts.core.BaseDispatchAction; +import org.posterita.struts.core.DefaultForm; + + +public class CustomerAction extends BaseDispatchAction +{ + public static final String CREATE_CUSTOMER = "createCustomer"; + public static final String RETURN_TO_ORDER = "returnToOrder"; + + public ActionForward createCustomer(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd = init(mapping,form,request,response); + if (fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + CustomerBean bean = (CustomerBean)request.getSession().getAttribute(Constants.CUSTOMER_DETAILS); + + String email = bean.getEmail(); + + if( email != null ) + { + boolean isValid = EmailValidator.isValidEmail(email); + if( !isValid ) + { + postGlobalError("errors.invalid","email", request); + return mapping.getInputForward(); + } + } + + Trx trx = Trx.get(TrxPrefix.getPrefix(), true); + trx.start(); + try + { + MBPartner partner = CustomerManager.saveCustomer(ctx,bean.getBpartnerId() ,bean, trx.getTrxName()); + Integer customerId = Integer.valueOf(partner.get_ID()); + request.getSession().setAttribute(Constants.CUSTOMER_ID, customerId); + trx.commit(); + } + catch (SurnameNotPresentException e) + { + trx.rollback(); + postGlobalError("error.required.Surname", request); + return mapping.getInputForward(); + } + finally + { + trx.close(); + } + + if(bean.getCreatingFromOrder()) + return new ActionForward("RETURN_TO_ORDER"); + else + return mapping.findForward(CREATE_CUSTOMER); + } + + public static final String CREATE_POS_ORDER = "createPOSOrder"; + public static final String CREATE_CREDIT_ORDER = "initCreateCreditOrder"; + public static final String CREATE_POS_ORDER2 = "createPOSOrder2"; + public static final String CREATE_POS_ORDER3 = "createPOSOrder3"; + public static final String CREATE_POS_ORDER_WA = "createPOSOrderWA"; + public static final String SAVE_POS_CUSTOMER = "savePOSCustomer"; + public static final String CREATE_PAYMENT = "createPayment"; + public ActionForward savePOSCustomer(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd = init(mapping,form,request,response); + if (fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + DefaultForm df = (DefaultForm)form; + String creatingForOrder=(String)request.getSession().getAttribute(Constants.CREATING_FROM_ORDER); + CustomerBean bean = (CustomerBean)df.getBean(); + bean.setRegionId(Integer.valueOf(1000001));//FIXME why do we need regionId? Is it compulsory? + + String email = bean.getEmail(); + + if( email != null ) + { + boolean isValid = EmailValidator.isValidEmail(email); + if( !isValid ) + { + postGlobalError("errors.invalid","email", request); + return mapping.getInputForward(); + } + } + if(bean.getBpartnerId()==null) + { + bean.setBpartnerId(0); + } + + Trx trx = Trx.get(TrxPrefix.getPrefix(), true); + trx.start(); + try + { + MBPartner partner = CustomerManager.saveCustomer(ctx, bean.getBpartnerId(), bean, trx.getTrxName()); + + request.getSession().setAttribute(Constants.CUSTOMER_ID, partner.get_ID()); + trx.commit(); + } + catch (SurnameNotPresentException e) + { + trx.rollback(); + postGlobalError("error.required.Surname", request); + return mapping.getInputForward(); + } + catch (NoAccessToEditObjectException e) + { + trx.rollback(); + postGlobalError("error.no.edit.access", request); + return mapping.getInputForward(); + } + finally + { + trx.close(); + } + + if (creatingForOrder == null) + return mapping.findForward(SAVE_POS_CUSTOMER); + + if (creatingForOrder.equals(Constants.POS_ORDER)) + return mapping.findForward(CREATE_POS_ORDER); + else + if (creatingForOrder.equals(Constants.CREDIT_ORDER)) + return mapping.findForward(CREATE_CREDIT_ORDER); + else + if (creatingForOrder.equals(Constants.CREATE_PAYMENT)) + return mapping.findForward(CREATE_PAYMENT); + else + if (creatingForOrder.equals(Constants.POS_ORDER_CUSTOMER_COMPULSORY)) + return mapping.findForward(CREATE_POS_ORDER2); + else + if (creatingForOrder.equals(Constants.QUICK_POS_ORDER)) + return mapping.findForward(CREATE_POS_ORDER3); + else + if (creatingForOrder.equals(Constants.POS_ORDER_WITHOUT_ADVANCED)) + return mapping.findForward(CREATE_POS_ORDER_WA); + + return mapping.findForward(SAVE_POS_CUSTOMER); + } + + public static final String GET_EXISTING_CUSTOMERS = "getExistingCustomers"; + public ActionForward getExistingCustomers(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException, SQLException + { + ActionForward fwd = init(mapping,form,request,response); + if (fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + ArrayList customers = CustomerManager.getAllCustomers(ctx,false); + + request.getSession().setAttribute(Constants.ALL_CUSTOMERS, customers); + + return mapping.findForward(GET_EXISTING_CUSTOMERS); + } + + + public static final String GET_EXISTING_POS_CUSTOMERS = "getExistingPOSCustomers"; + public ActionForward getExistingPOSCustomers(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException, SQLException + { + ActionForward fwd = init(mapping,form,request,response); + if (fwd!=null) + return fwd; + + + Properties ctx=TmkJSPEnv.getCtx(request); + + ArrayList customers = CustomerManager.getAllCustomers(ctx,true); + + request.getSession().setAttribute(Constants.ALL_CUSTOMERS, customers); + + return mapping.findForward(GET_EXISTING_POS_CUSTOMERS); + } + + + public static final String GET_CUSTOMER_DETAILS = "getCustomerDetails"; + public ActionForward getCustomerDetails(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws Exception + { + ActionForward fwd = init(mapping,form,request,response); + if (fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + DefaultForm df = (DefaultForm) form; + + Integer partnerId = Integer.valueOf(df.getBpartnerId()); + + CustomerBean customerBean = CustomerManager.getCustomerDetails(ctx, partnerId.intValue()); + + request.getSession().setAttribute(Constants.CUSTOMER_DETAILS, customerBean); + + return mapping.findForward(GET_CUSTOMER_DETAILS); + } + + + public static final String INIT_CREATE_POS_CUSTOMER_ACTION = "initCreatePOSCustomer"; + public ActionForward initCreatePOSCustomer(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException, SystemException + { + ActionForward fwd = init(mapping,form,request,response); + + if(fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + InitCustomerForm cf = (InitCustomerForm) form; + + CustomerBean bean = (CustomerBean) cf.getBean(); + bean.setBpartnerId(0); + String creatingFromOrder= cf.getCreatingFromOrder(); + cf.populate(bean); + + + ArrayList list = PaymentTermManager.getAllActivePaymentTerm(ctx); + request.getSession().setAttribute (Constants.PAYMENT_TERM,list); + + request.getSession().setAttribute(Constants.CREATING_FROM_ORDER, creatingFromOrder); + + return mapping.findForward(INIT_CREATE_POS_CUSTOMER_ACTION); + } + + public static final String GET_ALL_CUSTOMER = "getAllPOSCustomer"; + public ActionForward getAllPOSCustomer(ActionMapping mapping, ActionForm form,HttpServletRequest request,HttpServletResponse response) throws Exception + { + + ActionForward fwd=init(mapping,form,request,response); + if (fwd!=null) + return fwd; + Properties ctx = TmkJSPEnv.getCtx(request); + + ArrayList customerList = CustomerManager.searchPOSCustomer(ctx, "", "", "","", ""); + + //ArrayList customerList = CustomerManager.getAllPosCustomer(ctx); + + request.getSession().setAttribute(Constants.ALL_CUSTOMERS,customerList); + + return mapping.findForward(GET_ALL_CUSTOMER); + } + + + public static final String INIT_EDIT_POS_CUSTOMER = "initEditPOSCustomer"; + public ActionForward initEditPOSCustomer(ActionMapping mapping, ActionForm form,HttpServletRequest request,HttpServletResponse response) throws Exception + { + + ActionForward fwd=init(mapping,form,request,response); + if (fwd!=null) + return fwd; + Properties ctx = TmkJSPEnv.getCtx(request); + + CustomerForm f = (CustomerForm) form; + f.validate(mapping,request); + + CustomerBean bean = (CustomerBean) f.getBean(); + Integer bpartnerId = bean.getBpartnerId(); + if(bpartnerId==null) + { + throw new OperationException("Cannot edit customer. Cause customer id cannot be null!"); + } + + + bean = CustomerManager.getCustomerDetails(ctx,bpartnerId); + f.populate(bean); + ArrayList list = PaymentTermManager.getAllActivePaymentTerm(ctx); + ArrayList activePriceLists = PriceListManager.getPriceLists(ctx,0,"",true,null,null,true,null); + ArrayList priceListsKNP = PriceListManager.getKeyNamePair(ctx, activePriceLists); + + request.getSession().setAttribute(Constants.USER_PRICE_LISTS, priceListsKNP); + request.getSession().setAttribute (Constants.PAYMENT_TERM,list); + + return mapping.findForward(INIT_EDIT_POS_CUSTOMER); + } + + + public static final String VIEW_POS_CUSTOMER = "viewPOSCustomer"; + public ActionForward viewPOSCustomer(ActionMapping mapping, ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException,Exception + { + + ActionForward fwd=init(mapping,form,request,response); + if (fwd!=null) + return fwd; + Properties ctx = TmkJSPEnv.getCtx(request); + CustomerForm f = (CustomerForm) form; + f.validate(mapping,request); + + CustomerBean bean = (CustomerBean) f.getBean(); + Integer bpartnerId = bean.getBpartnerId(); + if(bpartnerId==null) + { + throw new OperationException("Cannot load customer details. Cause customer id cannot be null!"); + } + + bean = CustomerManager.getCustomerDetails(ctx,bpartnerId); + request.getSession().setAttribute(Constants.CUSTOMER_DETAILS,bean); + + return mapping.findForward(VIEW_POS_CUSTOMER); + } + + public static final String ACTIVATE_POS_CUSTOMER = "activatePOSCustomer"; + @SuppressWarnings("unchecked") + public ActionForward activatePOSCustomer(ActionMapping mapping, ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + + ActionForward fwd=init(mapping,form,request,response); + if (fwd!=null) + return fwd; + Properties ctx = TmkJSPEnv.getCtx(request); + CustomerForm f = (CustomerForm) form; + f.validate(mapping,request); + + CustomerBean bean = (CustomerBean) f.getBean(); + Integer bpartnerId = bean.getBpartnerId(); + if(bpartnerId==null) + { + throw new OperationException("Cannot activate customer. Cause customer id cannot be null!"); + } + + //since customer is a business partner we call the BPartnerManager's activate method + + Trx trx = Trx.get(TrxPrefix.getPrefix(), true); + + + try + { + trx.start(); + CustomerManager.activateCustomer(ctx,bpartnerId.intValue(), trx.getTrxName()); + trx.commit(); + } + catch (OperationException e) + { + trx.rollback(); + postGlobalError("error.activate.customer", request); + mapping.getInputForward(); + } + finally + { + trx.rollback(); + } + + ArrayList list = (ArrayList) request.getSession().getAttribute(Constants.ALL_CUSTOMERS); + //ArrayList customerBeanList = list; + + ArrayList newList = CustomerManager.updateCustomerListStatus(list, bpartnerId, true); + + request.getSession().setAttribute(Constants.ALL_CUSTOMERS, newList); + + + return mapping.findForward(ACTIVATE_POS_CUSTOMER); + } + + public static final String DEACTIVATE_POS_CUSTOMER = "deactivatePOSCustomer"; + @SuppressWarnings("unchecked") + public ActionForward deactivatePOSCustomer(ActionMapping mapping, ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + + ActionForward fwd=init(mapping,form,request,response); + if (fwd!=null) + return fwd; + Properties ctx = TmkJSPEnv.getCtx(request); + CustomerForm f = (CustomerForm) form; + f.validate(mapping,request); + + CustomerBean bean = (CustomerBean) f.getBean(); + Integer bpartnerId = bean.getBpartnerId(); + if(bpartnerId==null) + { + throw new OperationException("Cannot deactivate customer. Cause customer id cannot be null!"); + } + + + Trx trx = Trx.get(TrxPrefix.getPrefix(), true); + + //since customer is a business partner we call the BPartnerManager's deactivate method + try + { + trx.start(); + CustomerManager.deactivateCustomer(ctx,bpartnerId.intValue(), trx.getTrxName()); + trx.commit(); + } + catch (OperationException e) + { + trx.rollback(); + postGlobalError("error.deactivate.customer", request); + mapping.getInputForward(); + } + finally + { + trx.close(); + } + + ArrayList list = (ArrayList) request.getSession().getAttribute(Constants.ALL_CUSTOMERS); + //ArrayList customerBeanList = list; + + ArrayList newList = CustomerManager.updateCustomerListStatus(list, bpartnerId, false); + + request.getSession().setAttribute(Constants.ALL_CUSTOMERS, newList); + + return mapping.findForward(DEACTIVATE_POS_CUSTOMER); + } + + public static final String GENERATE_CARD ="generateFidelityCard"; + public ActionForward generateFidelityCard(ActionMapping mapping, ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException, IOException, Exception + { + ActionForward fwd = init(mapping,form,request,response); + if (fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + ArrayList customerList =null; + CustomerCart cart = (CustomerCart) request.getSession().getAttribute(Constants.CUSTOMER_CART); + + if(cart != null) + { + customerList = cart.getCustomers(); + + } + else + { + customerList = new ArrayList(); + } + + String reportName = null; + try + { + reportName = CustomerManager.fidelityCard(ctx,customerList); + } + catch (NoCustomerFoundException e) + { + postGlobalError("error.print.fidelity.card",request); + return new ActionForward("/ViewAllCartCustomers.do"); + } + + String uri = ReportManager.getReportURI(reportName,request); + + response.sendRedirect(uri); + //ReportManager.writeReport(reportName, response); + + + return null; + } + + public static final String INIT_SEARCH_POS_CUSTOMER = "initSearchPOSCustomer"; + public ActionForward initSearchPOSCustomer(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd=init(mapping,form,request,response); + if (fwd!=null) + return fwd; + + request.getSession().removeAttribute(Constants.ALL_CUSTOMERS); + + return mapping.findForward(INIT_SEARCH_POS_CUSTOMER); + } + + + public static final String SEARCH_POS_CUSTOMER = "searchPOSCustomer"; + public ActionForward searchPOSCustomer(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception + { + ActionForward fwd=init(mapping,form,request,response); + if (fwd!=null) + return fwd; + Properties ctx = TmkJSPEnv.getCtx(request); + + DefaultForm df = (DefaultForm)form; + + String customerName = df.getPartnerName(); + + ArrayList customerList = CustomerManager.searchPOSCustomer(ctx, customerName, df.getDay(), df.getMonth(),df.getYear(), df.getIsActive()); + + request.getSession().setAttribute(Constants.ALL_CUSTOMERS,customerList); + + return mapping.findForward(SEARCH_POS_CUSTOMER); + } + + public static final String ADD_ALL_CUSTOMERS = "addAllCustomers"; + public ActionForward addAllCustomers(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd=init(mapping,form,request,response); + if (fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + CustomerCart cart = (CustomerCart)request.getSession().getAttribute(Constants.CUSTOMER_CART); + + ArrayList customerList = (ArrayList) request.getSession().getAttribute(Constants.ALL_CUSTOMERS); + + if(customerList==null) + { + return mapping.findForward(SEARCH_POS_CUSTOMER); + } + + if(cart == null) + { + cart = new CustomerCart(ctx); + } + + for(CustomerBean bean : customerList) + { + Integer customerId = bean.getBpartnerId(); + if(customerId == null) continue; + + if(! cart.hasCustomer(customerId.intValue())) + { + cart.addCustomer(customerId.intValue()); + } + + } + + request.getSession().setAttribute(Constants.CUSTOMER_CART, cart); + return mapping.findForward(SEARCH_POS_CUSTOMER); + } + +// used for create pos order to get customer name from id + public ActionForward getNameByID(ActionMapping mapping, ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException, Exception + { + + ActionForward fwd=init(mapping,form,request,response); + if (fwd!=null) + return fwd; + Properties ctx = TmkJSPEnv.getCtx(request); + CustomerForm f = (CustomerForm) form; + + String errormsg = ""; + String bpartner = f.getBpartnerId(); + + + + if(bpartner == null||bpartner.length()==0) + { + errormsg = "alert('Invalid Customer ID. ID cannot be empty');"; + return sendData(errormsg,response); + } + + Integer bpartnerId = null; + try + { + bpartnerId = Integer.valueOf(bpartner); + } + catch (NumberFormatException e2) + { + errormsg = "alert('Please enter numeric value for Customer ID!');defaultCustomer();"; + return sendData(errormsg,response); + } + + String customerName = ""; + + try + { + CustomerBean bean = CustomerManager.getCustomerDetails(ctx,bpartnerId); + + String firstname = (bean.getPartnerName() == null) ? "" : bean.getPartnerName(); + String lastname = (bean.getSurname() == null) ? "" : bean.getSurname(); + + customerName = firstname + " " + lastname; + customerName = customerName.trim(); + + String data = "setCustomerName('"+ customerName +"');"; + + return sendData(data,response); + } + catch (BPartnerNotFoundException e1) + { + errormsg = "alert('Could not find customer! Please try again with proper Customer ID');defaultCustomer();"; + return sendData(errormsg,response); + } + + } + + private ActionForward sendData(String data,HttpServletResponse response) throws OperationException + { + try + { + response.setContentType("text/plain"); + PrintWriter out = response.getWriter(); + out.print(data); + + out.flush(); + out.close(); + } + catch (IOException e) + { + throw new OperationException(e); + } + return null; + } + + public static final String ADD_TO_CART = "addToCart"; + public ActionForward addToCart(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException, IOException + { + Properties ctx = TmkJSPEnv.getCtx(request); + DefaultForm df = (DefaultForm) form; + //CustomerBean bean = (CustomerBean) df.getBean(); + + int customerId = Integer.parseInt(df.getBpartnerId()); + + CustomerCart cart = (CustomerCart) request.getSession().getAttribute(Constants.CUSTOMER_CART); + + if( cart == null ) + { + cart = new CustomerCart( ctx ); + } + + if ( ! cart.hasCustomer (customerId ) ) + { + cart.addCustomer( customerId ); + } + + request.getSession().setAttribute(Constants.CUSTOMER_CART, cart); + + String script = "setCartCounter("+ cart.getNoOfCustomers() +");customerAdded("+ customerId +")"; + + PrintWriter writer = response.getWriter(); + writer.print( script ); + writer.flush(); + writer.close(); + + return null; + } + + public ActionForward clearCart (ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException, IOException + { + HttpSession session = request.getSession(); + session.removeAttribute(Constants.CUSTOMER_CART); + + request.getSession().getAttribute(Constants.CUSTOMER_CART); + + String script = "clearAll();"; + PrintWriter writer = response.getWriter(); + writer.print( script ); + writer.flush(); + writer.close(); + + return null; + } + + public static final String VIEW_CART = "viewCart"; + public ActionForward viewCart (ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException, IOException, Exception + { + HttpSession session = request.getSession(); + CustomerCart cart = (CustomerCart) session.getAttribute(Constants.CUSTOMER_CART); + + ArrayList customerList =null; + + if(cart != null) + { + customerList = cart.getCustomers(); + + } + else + { + customerList = new ArrayList(); + } + + session.setAttribute(Constants.ALL_CART_CUSTOMERS, customerList); + + return mapping.findForward(VIEW_CART); + } + + public static final String REMOVE = "remove"; + public ActionForward remove(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException, IOException, Exception + { + DefaultForm df = (DefaultForm) form; + + int customerId = Integer.parseInt(df.getBpartnerId()); + CustomerCart cart = (CustomerCart) request.getSession().getAttribute(Constants.CUSTOMER_CART); + + if( cart != null ) + { + cart.removeCustomer(customerId); + ArrayList customerList = cart.getCustomers(); + request.getSession().setAttribute(Constants.CUSTOMER_CART, cart); + request.getSession().setAttribute(Constants.ALL_CART_CUSTOMERS, customerList); + } + + return mapping.findForward(VIEW_CART); + } + + public static final String REMOVE_FROM_CART = "removeFromCart"; + public ActionForward removeFromCart(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException, IOException + { + Properties ctx = TmkJSPEnv.getCtx(request); + DefaultForm df = (DefaultForm) form; + //CustomerBean bean = (CustomerBean) df.getBean(); + + int customerId = Integer.parseInt(df.getBpartnerId()); + + CustomerCart cart = (CustomerCart) request.getSession().getAttribute(Constants.CUSTOMER_CART); + + if( cart == null ) + { + cart = new CustomerCart( ctx ); + } + + if ( cart.hasCustomer (customerId ) ) + { + cart.removeCustomer( customerId ); + } + + request.getSession().setAttribute(Constants.CUSTOMER_CART, cart); + + String script = "setCartCounter("+ cart.getNoOfCustomers() +");customerRemoved("+ customerId +")"; + + PrintWriter writer = response.getWriter(); + writer.print( script ); + writer.flush(); + writer.close(); + + return null; + } + + public static final String GENERATE_CUSTOMER_BARCODE ="generateCustomerBarcode"; + public ActionForward generateCustomerBarcode(ActionMapping mapping, ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException, IOException, Exception + { + ActionForward fwd = init(mapping,form,request,response); + if (fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + ArrayList customerList =null; + CustomerCart cart = (CustomerCart) request.getSession().getAttribute(Constants.CUSTOMER_CART); + + if(cart != null) + { + customerList = cart.getCustomers(); + + } + else + { + customerList = new ArrayList(); + } + + Trx trx = Trx.get(TrxPrefix.getPrefix(), true); + byte printData[] = null; + + String barcodeData = BarcodeManager.printCustomerBarcode(ctx, cart, trx.getTrxName()); + + response.setContentType("application/octet-stream"); + printData = barcodeData.getBytes(); + + OutputStream os = response.getOutputStream(); + os.write(printData); + os.flush(); + os.close(); + + return mapping.findForward("/POSCustomerAction.do?action=viewCart"); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/struts/customer/SalesAction.java b/posterita/posterita/src/main/org/posterita/struts/customer/SalesAction.java new file mode 100644 index 0000000000..c942249930 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/customer/SalesAction.java @@ -0,0 +1,94 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Nov 16, 2005 by praveen + * + */ +package org.posterita.struts.customer; + +import java.util.ArrayList; +import java.util.Properties; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.posterita.core.TmkJSPEnv; + +import org.posterita.Constants; +import org.posterita.exceptions.ApplicationException; +import org.posterita.exceptions.OperationException; +import org.posterita.exceptions.SystemException; +import org.posterita.keyname.SalesRepKeyNamePair; +import org.posterita.struts.core.BaseDispatchAction; +import org.posterita.struts.core.DefaultForm; + +public class SalesAction extends BaseDispatchAction +{ + public static final String INIT_SALES = "initSales"; + public ActionForward initSales(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException, SystemException + { + ActionForward fwd = init(mapping,form,request,response); + + if(fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + //CustomerBean bean = new CustomerBean(); + //get sales reps + ArrayList salesRep = SalesRepKeyNamePair.getKeyNamePairs(ctx); + request.getSession().setAttribute(Constants.SALES_REP,salesRep); + + return mapping.findForward(INIT_SALES); + } + + public static String INIT_SALES_FOR_EXISTING_CUSTOMER = "initSalesForExistingCustomer"; + public ActionForward initSalesForExistingCustomer(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException, SystemException + { + ActionForward fwd = init(mapping,form,request,response); + + if(fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + DefaultForm df = (DefaultForm) form; + + Integer customerId = Integer.valueOf(df.getBpartnerId()); + + request.getSession().setAttribute(Constants.CUSTOMER_ID, customerId); + + ArrayList salesRep = SalesRepKeyNamePair.getKeyNamePairs(ctx); + + Boolean canTradeIn = Boolean.valueOf(true); + request.getSession().setAttribute(Constants.SALES_REP,salesRep); + request.getSession().setAttribute(Constants.CAN_TRADE_IN, canTradeIn); + + return mapping.findForward(INIT_SALES); + } + + public static final String CREATE_TRADE_IN_ORDER = "createTradeInOrder"; + public static final String CREATE_NATIS_ORDER = "createNatisOrder"; + + + public static final String PURCHASE_TRADE_IN_VEHICLE_AND_CREATE_CUSTOMER_ORDER = "purchaseTradeInVehicleAndCreateCustomerOrder"; + +} diff --git a/posterita/posterita/src/main/org/posterita/struts/inOut/ViewMinOutAction.java b/posterita/posterita/src/main/org/posterita/struts/inOut/ViewMinOutAction.java new file mode 100644 index 0000000000..de64bc0fea --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/inOut/ViewMinOutAction.java @@ -0,0 +1,107 @@ +/* +* +* Copyright (c) 2005 UDI Ltd. All Rights Reserved. +* +* This software is the confidential and proprietary information of +* UDI Ltd. ("Confidential Information"). You shall not +* disclose such Confidential Information and shall use it only in +* accordance with the terms of the license agreement you entered into +* with UDI. +* +* UDI MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE +* SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT +* NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR +* A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. UDI SHALL NOT +* BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, +* MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. +* +*/ +package org.posterita.struts.inOut; + +import java.util.Properties; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.Globals; +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.apache.struts.config.ActionConfig; +import org.apache.struts.config.ForwardConfig; +import org.apache.struts.util.MessageResources; +import org.compiere.model.MInOut; +import org.posterita.core.TmkJSPEnv; + +import org.posterita.Constants; +import org.posterita.beans.DocumentBean; +import org.posterita.beans.WebDocumentBean; +import org.posterita.businesslogic.MinOutManager; +import org.posterita.exceptions.ApplicationException; +import org.posterita.exceptions.OperationException; +import org.posterita.struts.core.BaseAction; +import org.posterita.struts.core.DefaultForm; + + +public class ViewMinOutAction extends BaseAction +{ + public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws OperationException, ApplicationException + { + + MessageResources resources = (MessageResources) request.getAttribute(Globals.MESSAGES_KEY); + + String operationException = resources.getMessage("error.operationException"); + + Properties ctx = TmkJSPEnv.getCtx(request); + + DefaultForm df = (DefaultForm) form; + DocumentBean bean = (DocumentBean) df.getBean(); + Integer minoutId = bean.getDocumentId(); + + // retrieve from cache + WebDocumentBean webBean = null; + + MInOut inout = null; + if (minoutId!= null) + { + inout = new MInOut(ctx, minoutId.intValue(), null); + webBean = MinOutManager.getWebMinOutBean(ctx, inout); + request.getSession().setAttribute(Constants.WEB_MINOUT_BEAN, webBean); + + } + + //int orgID = Env.getAD_Org_ID(ctx); + + if (webBean == null) + webBean = (WebDocumentBean) request.getSession().getAttribute(Constants.WEB_MINOUT_BEAN); + + if (webBean == null) + throw new OperationException(operationException); + + request.getSession().setAttribute(Constants.ME_LOCATION, webBean.getMeLocation()); + request.getSession().setAttribute(Constants.YOU_LOCATION, webBean.getYouLocation()); + request.getSession().setAttribute(Constants.YOU_BP_LOCATION, webBean.getYoubpLocation()); + request.getSession().setAttribute(Constants.ME, webBean.getMe()); + request.getSession().setAttribute(Constants.YOU,webBean.getYou()); + request.getSession().setAttribute(Constants.MINOUT_LINES_COLLECTION, webBean.getLines()); + request.getSession().setAttribute(Constants.MINOUT, webBean.getMinOut()); + request.getSession().setAttribute(Constants.MINVOICE, webBean.getInvoice()); + request.getSession().setAttribute(Constants.SIMPLE_COMMAND,webBean.getSimpleCommand()); + request.getSession().setAttribute(Constants.COMPLEX_COMMAND,webBean.getComplexCommand()); + request.getSession().setAttribute(Constants.WEB_DOCUMENT_HEADER_BEAN, webBean.getHeaderBean()); + + ForwardConfig forwardConfig = getForward(ctx,webBean,mapping,form); + + ActionForward forward = new ActionForward(forwardConfig.getPath()); + + return forward; + } + + private ForwardConfig getForward(Properties ctx, WebDocumentBean webBean, ActionMapping mapping, ActionForm form) + { + + ActionConfig config = mapping.getModuleConfig().findActionConfig("/ViewMinOutAction"); + + return config.findForwardConfig(Constants.VIEW_MINOUT); + } +} diff --git a/posterita/posterita/src/main/org/posterita/struts/invoice/ViewInvoiceAction.java b/posterita/posterita/src/main/org/posterita/struts/invoice/ViewInvoiceAction.java new file mode 100644 index 0000000000..de257d269e --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/invoice/ViewInvoiceAction.java @@ -0,0 +1,190 @@ +/* +* +* Copyright (c) 2007 - 2008 Posterita Ltd. All Rights Reserved. +* +* This software is the confidential and proprietary information of +* UDI Ltd. ("Confidential Information"). You shall not +* disclose such Confidential Information and shall use it only in +* accordance with the terms of the license agreement you entered into +* with UDI. +* +* UDI MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE +* SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT +* NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR +* A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. UDI SHALL NOT +* BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, +* MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. +* +*/ +package org.posterita.struts.invoice; + +import java.util.Properties; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.Globals; +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.apache.struts.config.ActionConfig; +import org.apache.struts.config.ForwardConfig; +import org.apache.struts.util.MessageResources; +import org.compiere.model.MDocType; +import org.compiere.model.MInvoice; +import org.compiere.model.MOrder; +import org.compiere.process.DocumentEngine; +import org.compiere.util.Env; +import org.posterita.Constants; +import org.posterita.beans.DocumentBean; +import org.posterita.beans.WebDocumentBean; +import org.posterita.businesslogic.InvoiceManager; +import org.posterita.core.TmkJSPEnv; +import org.posterita.exceptions.ApplicationException; +import org.posterita.exceptions.OperationException; +import org.posterita.order.UDIOrderTypes; +import org.posterita.struts.core.BaseAction; +import org.posterita.struts.core.DefaultForm; + + +public class ViewInvoiceAction extends BaseAction +{ + + public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws OperationException, ApplicationException + { + ActionForward fwd = init(mapping, form, request, response); + + if (fwd != null) + return fwd; + + MessageResources resources = (MessageResources) request.getAttribute(Globals.MESSAGES_KEY); + + //String securityException = resources.getMessage("error.securityException"); + String operationException = resources.getMessage("error.operationException"); + + Properties ctx = TmkJSPEnv.getCtx(request); + + DefaultForm df = (DefaultForm) form; + DocumentBean bean = (DocumentBean) df.getBean(); + Integer invoiceId = bean.getDocumentId(); + + // retrieve from cache + WebDocumentBean webBean = null; + + MInvoice invoice = null; + if (invoiceId!= null && (invoiceId.intValue()!=0)) + { + invoice = new MInvoice(ctx, invoiceId.intValue(), null); + webBean = InvoiceManager.getWebInvoiceBean(invoice); + request.getSession().setAttribute(Constants.WEB_INVOICE_BEAN, webBean); + } + + //int orgID = Env.getAD_Org_ID(ctx); + + if (webBean == null) + webBean = (WebDocumentBean) request.getSession().getAttribute(Constants.WEB_INVOICE_BEAN); + + if (webBean == null) + throw new OperationException(operationException); + + request.getSession().setAttribute(Constants.ME_LOCATION, webBean.getMeLocation()); + request.getSession().setAttribute(Constants.YOU_LOCATION, webBean.getYouLocation()); + request.getSession().setAttribute(Constants.YOU_BP_LOCATION, webBean.getYoubpLocation()); + request.getSession().setAttribute(Constants.ME, webBean.getMe()); + request.getSession().setAttribute(Constants.YOU,webBean.getYou()); + request.getSession().setAttribute(Constants.MINVOICE, webBean.getInvoice()); + request.getSession().setAttribute(Constants.MORDER, webBean.getOrder()); + request.getSession().setAttribute(Constants.MINVOICE_LINES_COLLECTION,webBean.getLines()); + request.getSession().setAttribute(Constants.SIMPLE_COMMAND,webBean.getSimpleCommand()); + request.getSession().setAttribute(Constants.COMPLEX_COMMAND,webBean.getComplexCommand()); + request.getSession().setAttribute(Constants.WEB_DOCUMENT_HEADER_BEAN, webBean.getHeaderBean()); + request.getSession().setAttribute(Constants.INVOICE_TAX,webBean.getTotalTax()); + request.getSession().setAttribute(Constants.TOTAL_LINES,webBean.getTotalLines()); + request.getSession().setAttribute(Constants.GRAND_TOTAL,webBean.getGrandTotal()); + request.setAttribute(Constants.CURRENCY_SYMBOLE,webBean.getCurrencySymbole()); + + + ForwardConfig forwardConfig = getForward(ctx,webBean,mapping,form); + + ActionForward forward = new ActionForward(forwardConfig.getPath()); + + return forward; + } + + private ForwardConfig getForward(Properties ctx, WebDocumentBean webBean, ActionMapping mapping, ActionForm form) throws OperationException + { + ActionConfig config = mapping.getModuleConfig().findActionConfig("/ViewInvoiceAction"); + + MInvoice invoice = webBean.getInvoice(); + + //vendor invoice -- isSoTrx is false + //customer invoice -- isSoTrx true + + if (webBean.getOrder().getOrderType().equals(UDIOrderTypes.WEBSTORE_ORDER.getOrderType())) + { + //Webstore CI--customer invoice + if (invoice.isSOTrx()) + return getWebstoreCI_Forward(webBean,config); + } + else + { + //VI--vendor invoice + if (!invoice.isSOTrx()) + return getVI_Forward(webBean,config); + + //CI--customer invoice + if (invoice.isSOTrx()) + return getCI_Forward(webBean,config); + } + + // DEFAULT + return config.findForwardConfig(Constants.FINISHED_DO); + + } + + public ForwardConfig getVI_Forward(WebDocumentBean invoiceBean, ActionConfig config) throws OperationException + { + return config.findForwardConfig(Constants.WEBSTORE_INVOICE); + } + + public ForwardConfig getWebstoreCI_Forward(WebDocumentBean invoiceBean, ActionConfig config) throws OperationException + { + MInvoice invoice = invoiceBean.getInvoice(); + + String status = invoice.getDocStatus(); + + if(status.equals(DocumentEngine.STATUS_Completed)) + { + return config.findForwardConfig(Constants.WEBSTORE_INVOICE); + } + + return config.findForwardConfig(Constants.WEBSTORE_INVOICE); + } + + public ForwardConfig getCI_Forward(WebDocumentBean invoiceBean, ActionConfig config) throws OperationException + { + MInvoice invoice = invoiceBean.getInvoice(); + + MOrder order = new MOrder(invoice.getCtx(), invoice.getC_Order_ID(), null); + + + int[] docTypes = MDocType.getAllIDs(MDocType.Table_Name, " ad_client_id="+ Env.getAD_Client_ID(invoice.getCtx()) + " and DOCSUBTYPESO='" + MDocType.DOCSUBTYPESO_POSOrder+ "'", null ); + + + //POS order + if (order.getC_DocType_ID() == docTypes[0]) + return config.findForwardConfig(Constants.PAID_INVOICE); + + String status = invoice.getDocStatus(); + + if (!invoice.isActive()) + return config.findForwardConfig(Constants.CANCEL_INVOICE); + + if(status.equals(DocumentEngine.STATUS_Completed)) + { + return config.findForwardConfig(Constants.WEBSTORE_INVOICE); + } + return config.findForwardConfig(Constants.UNPAID_INVOICE); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/struts/login/ChangePasswordAction.java b/posterita/posterita/src/main/org/posterita/struts/login/ChangePasswordAction.java new file mode 100644 index 0000000000..6f2f5bb636 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/login/ChangePasswordAction.java @@ -0,0 +1,78 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Aug 29, 2005 by din + */ + +package org.posterita.struts.login; + + + +import java.util.Properties; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.posterita.core.TmkJSPEnv; + +import org.posterita.Constants; +import org.posterita.beans.ChangePasswordBean; +import org.posterita.businesslogic.LoginManager; +import org.posterita.exceptions.WrongPasswordException; +import org.posterita.struts.core.BaseDispatchAction; +import org.posterita.struts.core.DefaultForm; +import org.posterita.user.WebUserInfo; + + + + public class ChangePasswordAction extends BaseDispatchAction + { + + public ActionForward change(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception + { + ActionForward fwd = init(mapping,form,request,response); + if (fwd!=null) + return fwd; + + DefaultForm df = (DefaultForm) form; + ChangePasswordBean bean = (ChangePasswordBean) df.getBean(); + Properties ctx = TmkJSPEnv.getCtx(request); + + WebUserInfo userInfo = (WebUserInfo) request.getSession().getAttribute(WebUserInfo.NAME); + + try + { + LoginManager.changePassword(ctx, bean, userInfo); + } + + catch(WrongPasswordException e) + { + postGlobalError("admin.wrongPasswordError",request); + return (new ActionForward(mapping.getInput())); + + } + + + return mapping.findForward(Constants.CHANGE); + + } + + } + + diff --git a/posterita/posterita/src/main/org/posterita/struts/login/GoToHomePageAction.java b/posterita/posterita/src/main/org/posterita/struts/login/GoToHomePageAction.java new file mode 100644 index 0000000000..cfd3097ab0 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/login/GoToHomePageAction.java @@ -0,0 +1,111 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Oct 26, 2005 by praveen + * + */ +package org.posterita.struts.login; + +import java.util.ArrayList; +import java.util.Properties; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.compiere.model.MStore; +import org.compiere.util.Env; +import org.posterita.Constants; +import org.posterita.beans.ApplicationParametersBean; +import org.posterita.businesslogic.StoreManager; +import org.posterita.businesslogic.core.ApplicationManager; +import org.posterita.core.TmkJSPEnv; +import org.posterita.lib.UdiConstants; +import org.posterita.struts.core.BaseDispatchAction; +import org.posterita.struts.core.DefaultForm; + +public class GoToHomePageAction extends BaseDispatchAction +{ + public static String GO_TO_HOMEPAGE = "goToHomePage"; + public ActionForward goToHomePage(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception + { + ActionForward fwd = init(mapping,form,request,response); + if (fwd!=null) + return fwd; + + try + { + Properties ctx = Env.getCtx(); + MStore store = StoreManager.getDefaultStore(ctx); + ApplicationManager.setApplicationParametersInContext(ctx, store.get_ID()); + request.getSession().setAttribute(Constants.APP_NAME, store.getName()); + ctx = TmkJSPEnv.getCtx(request); + String forward = Env.getContext(ctx, UdiConstants.DEFAULT_FORWARD); + + return mapping.findForward(forward); + } + catch(Exception ex) + { + postGlobalError("error.store.default", ex.getMessage(), request); + return mapping.findForward(CHOOSE_APPLICATION); + } + } + + public static final String CHOOSE_APPLICATION = "chooseApplication"; + public ActionForward setApplicationParameters(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception + { + DefaultForm df = (DefaultForm) form; + ApplicationParametersBean bean = (ApplicationParametersBean) df.getBean(); + + Integer storeId = bean.getStoreId(); + + // Store not defined, should go to default store or choose from different stores + if (storeId == null) + { + return goToHomePage(mapping, form, request, response); + } + + Properties ctx = TmkJSPEnv.getCtx(request); // Get default context from system + + MStore store = new MStore(ctx, storeId, null); + + if (store.get_ID() == 0) + { + //TODO: Add error message showing no store error to user + mapping.findForward(CHOOSE_APPLICATION); + } + + request.getSession().setAttribute(Constants.APP_NAME, store.getName()); + ApplicationManager.setApplicationParametersInContext(ctx, storeId); + + ctx = TmkJSPEnv.getCtx(request); + + return mapping.findForward(UdiConstants.DEFAULT_FORWARD); + } + + public static final String INIT_CHOOSE_APPLICATION = "initChooseApplication"; + public ActionForward initChooseApplication(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception + { + ArrayList appList = ApplicationManager.getAvailableApplications(); + servlet.getServletContext().setAttribute(Constants.WEB_APPLICATIONS, appList); + + return mapping.findForward(INIT_CHOOSE_APPLICATION); + } +} diff --git a/posterita/posterita/src/main/org/posterita/struts/login/LoginAction.java b/posterita/posterita/src/main/org/posterita/struts/login/LoginAction.java new file mode 100644 index 0000000000..d5d67ea0c7 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/login/LoginAction.java @@ -0,0 +1,472 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 25-Jul-2005 by alok + * + */ +package org.posterita.struts.login; + +import java.util.ArrayList; +import java.util.Properties; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; + +import org.apache.struts.Globals; +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.apache.struts.util.MessageResources; +import org.compiere.model.MSession; +import org.compiere.util.Env; +import org.compiere.util.KeyNamePair; +import org.compiere.util.WebUser; +import org.posterita.Constants; +import org.posterita.beans.ChangePasswordBean; +import org.posterita.beans.LoginBean; +import org.posterita.beans.TerminalBean; +import org.posterita.beans.UserBean; +import org.posterita.businesslogic.LoginManager; +import org.posterita.businesslogic.MenuManager; +import org.posterita.businesslogic.POSManager; +import org.posterita.businesslogic.POSTerminalManager; +import org.posterita.businesslogic.administration.RoleManager; +import org.posterita.businesslogic.core.ApplicationManager; +import org.posterita.core.Configuration; +import org.posterita.core.MenuItem; +import org.posterita.core.SessionStorage; +import org.posterita.core.TmkJSPEnv; +import org.posterita.exceptions.EmailNotFoundException; +import org.posterita.exceptions.InvalidPasswordLengthException; +import org.posterita.exceptions.InvalidRoleException; +import org.posterita.exceptions.NotLoggedInException; +import org.posterita.exceptions.UserInactiveException; +import org.posterita.exceptions.UserNotFoundException; +import org.posterita.exceptions.WrongPasswordException; +import org.posterita.lib.UdiConstants; +import org.posterita.model.MWebMenu; +import org.posterita.struts.core.BaseDispatchAction; +import org.posterita.struts.core.DefaultForm; +import org.posterita.user.WebUserInfo; + +public class LoginAction extends BaseDispatchAction +{ + + LoginManager bd = new LoginManager(); + Properties ctx = null; + + public static final String LOGIN_USER = "loginUser"; + public ActionForward loginUser(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception + { + ActionForward fwd = init(mapping, form, request, response); + if (fwd !=null) + return fwd; + + DefaultForm df = (DefaultForm) form; + LoginBean bean = (LoginBean) df.getBean(); + ctx = TmkJSPEnv.getCtx(request); + + WebUserInfo wuInfo = null; + MenuItem menus = null; + ArrayList topMenusList; + ArrayList leftMenusList; + + try + { + //Checking username and password + + //TODO + wuInfo = bd.loginUser(ctx, bean); + + Configuration config = Configuration.getConfiguration(request); + + ArrayList menuList = MenuManager.getMenus(ctx, request); + + //filter menulist based on configuration + for(MWebMenu menu : menuList) + { + String name = menu.getName(); + + if("smenu.credit.sales".equalsIgnoreCase(name) && !config.isAllowCreditSales()) + { + menuList.remove(menu); + continue; + } + + if("smenu.customer.returned.order".equalsIgnoreCase(name) && !config.isAllowCustomerReturnOrder()) + { + menuList.remove(menu); + continue; + } + } + + + menus = MenuManager.buildMenuTree(ctx, menuList); + topMenusList = menus.getTopMenus(); + leftMenusList = menus.getLeftMenus(); + + //Adding the switch user menu + Object userId = request.getSession().getAttribute(Constants.ADMIN_USER_ID); + + if(userId != null) + { + MWebMenu menu = new MWebMenu(ctx,0,null); + menu.setName("Switch User"); + menu.setMenuLink("LoginUserAction.do?action=loginUser&userId=" + userId); + + //MenuItem menuItem = new MenuItem(menu); + leftMenusList.add(new MenuItem(menu)); + } + + + } + catch(UserNotFoundException unfe) + { + postGlobalError("login.passwordError",request); + return (mapping.getInputForward()); + } + catch(NotLoggedInException e) + { + postGlobalError("login.passwordError",request); + return (mapping.getInputForward()); + } + catch(InvalidRoleException ire) + { + postGlobalError("error.role.invalid", request); + return (mapping.getInputForward()); + } + catch(UserInactiveException unae) + { + postGlobalError("login.userInactive",request); + return (mapping.getInputForward()); + } + + HttpSession session = request.getSession(); + MSession cSession = MSession.get (ctx, request.getRemoteAddr(), request.getRemoteHost(), session.getId()); + + if (cSession != null) + cSession.setWebStoreSession(true); + + //Set breadcrumb to empty + + request.getSession().setAttribute(Constants.BREADCRUMB, null); + + request.getSession().setAttribute(WebUserInfo.NAME, wuInfo); + request.getSession().setAttribute(Constants.MENUS, menus); + request.getSession().setAttribute(Constants.TOP_MENUS, topMenusList); + request.getSession().setAttribute(Constants.LEFT_MENUS, leftMenusList); + SessionStorage.putOrg(ctx, request); + + + return mapping.findForward(LOGIN_USER); + + } + + public static final String LOGOUT = "logout"; + public ActionForward logout(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception + { + HttpSession session = request.getSession(); + Properties ctx = TmkJSPEnv.getCtx(request); + + WebUserInfo wuInfo = (WebUserInfo)session.getAttribute(WebUserInfo.NAME); + + int storeId = Env.getContextAsInt(ctx, UdiConstants.WSTORE_CTX_PARAM); + + if (wuInfo != null) + { + WebUser wu = wuInfo.getUser(); + if (wu != null) + wu.logout(); + + session.removeAttribute(WebUserInfo.NAME); + session.setMaxInactiveInterval(0); + } + + try + { + ApplicationManager.setApplicationParametersInContext(ctx, storeId); + return mapping.findForward(UdiConstants.DEFAULT_FORWARD); + } + catch(Exception ex) + { + postGlobalError("error.store.default", ex.getMessage(), request); + return mapping.findForward(CHOOSE_APPLICATION); + } + } + + public static final String SUCCESS = "success"; + public static final String CHOOSEPOS = "choosePOS"; + public static final String CREATEPOSORDER = "createPOSOrder"; + public ActionForward success(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception + { + DefaultForm df = (DefaultForm) form; + LoginBean bean = (LoginBean) df.getBean(); + + Properties ctx = TmkJSPEnv.getCtx(request); + + HttpSession session = request.getSession(); + WebUserInfo info = null; + WebUser wu; + + try + { + wu = bd.checkLoginPassword(ctx, bean); + + info = bd.login(ctx, wu); + + + + MSession cSession = MSession.get (ctx, request.getRemoteAddr(), request.getRemoteHost(), session.getId()); + + if (cSession != null) + cSession.setWebStoreSession(true); + + session.setAttribute (WebUserInfo.NAME, info); + + SessionStorage.putMenus(ctx, request); + + + } + catch(UserNotFoundException unfe) + { + postGlobalError("login.passwordError",request); + return (mapping.getInputForward()); + } + catch(NotLoggedInException e) + { + postGlobalError("login.passwordError",request); + return (mapping.getInputForward()); + } + catch(InvalidRoleException ire) + { + postGlobalError("error.role.invalid", request); + return (mapping.getInputForward()); + } + catch(UserInactiveException unae) + { + postGlobalError("login.userInactive",request); + return (mapping.getInputForward()); + } + + // Should be removed after backward compatibility achieved + POSTerminalManager.migrateOldPOSTerminal(ctx); + + String strPosId = POSTerminalManager.getTerminalFromCookie(request); + int posId = 0; + boolean isValidPOSId = false; + + if(strPosId != null) + { + try + { + posId = Integer.parseInt(strPosId); + isValidPOSId = POSTerminalManager.isPOSTerminalAccessible(ctx, posId); + } + catch(Exception ex) + {} + } + + if(!isValidPOSId) + { + int adOrgId = Env.getAD_Org_ID(ctx); + ArrayList list = POSTerminalManager.getAllActiveTerminals(ctx, adOrgId, null); + request.getSession().setAttribute(Constants.POSTERMINALS,list); + return mapping.findForward(CHOOSEPOS); + } + else + { + SessionStorage.setPOSTerminal(ctx, posId, request); + String currSymboleSales = POSTerminalManager.getDefaultSalesCurrency(ctx).getCurSymbol(); + String currSymbolePurchase=POSTerminalManager.getDefaultPurchaseCurrency(ctx).getCurSymbol(); + request.getSession().setAttribute(Constants.CURRENCY_SYMBOLE,currSymboleSales); + request.getSession().setAttribute(Constants.CURRENCY_SYMBOLE_PURCHASE,currSymbolePurchase); + return mapping.findForward(CREATEPOSORDER); + } + } + + public ActionForward password(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception + { + DefaultForm df = (DefaultForm) form; + UserBean bean = (UserBean) df.getBean(); + Properties ctx = TmkJSPEnv.getCtx(request); + boolean ok = false; + + MessageResources resources = (MessageResources) request.getAttribute(Globals.MESSAGES_KEY); + + String subject = resources.getMessage("login.password.emailTitle"); + String content = resources.getMessage("login.password.emailSubject"); + + try + { + ok = bd.sendPassword(ctx, bean, subject, content); + } + catch(EmailNotFoundException e) + { + postGlobalError("login.emailNotFound",request); + return (new ActionForward(mapping.getInput())); + } + catch(UserNotFoundException une) + { + postGlobalError("login.userNotFound",request); + return (new ActionForward(mapping.getInput())); + + } + + if(ok == false) + { + postGlobalError("email.send.error",request); + return mapping.getInputForward(); + } + else + { + return mapping.findForward(Constants.PASSWORD); + } + } + + public static final String CHANGE_USER_PASSWORD="changeUserPassword"; + public ActionForward changeUserPassword(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception + { + ActionForward fwd = init(mapping, form, request, response); + if (fwd !=null) + return fwd; + + DefaultForm df = (DefaultForm) form; + ChangePasswordBean bean = (ChangePasswordBean) df.getBean(); + Properties ctx = TmkJSPEnv.getCtx(request); + + WebUserInfo userInfo = (WebUserInfo) request.getSession().getAttribute(WebUserInfo.NAME); + + try + { + LoginManager.changePassword(ctx,bean,userInfo); + } + catch(InvalidPasswordLengthException e2) + { + postGlobalError("error.wrong.password.length", request); + return mapping.getInputForward(); + } + catch(WrongPasswordException e) + { + postGlobalError("admin.wrongPasswordError",request); + return (new ActionForward(mapping.getInput())); + } + + return mapping.findForward(CHANGE_USER_PASSWORD); + } + + + + //----------------------------------Refactoring LoginAction----------------------------------- + + public static final String VALIDATE_USER = "validateUser"; + /** + * We check whether the name & password supplied is valid + * Result: + * If valid we forward to choose role + * else we forward to login page witn appropriate login error + */ + public ActionForward validateUser(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception + { + Properties ctx = TmkJSPEnv.getCtx(request); + + DefaultForm df = (DefaultForm) form; + LoginBean bean = (LoginBean) df.getBean(); + + HttpSession session = request.getSession(); + WebUserInfo info = null; + WebUser wu = null; + + // validate user + try + { + wu = bd.checkLoginPassword(ctx, bean); + + info = bd.login(ctx, wu); + + MSession cSession = MSession.get (ctx, request.getRemoteAddr(), request.getRemoteHost(), session.getId()); + + if (cSession != null) + cSession.setWebStoreSession(true); + + session.setAttribute (WebUserInfo.NAME, info); + + ArrayList myRoles = RoleManager.getMyRoles(ctx); + + if(myRoles.size() == 1) + { + KeyNamePair pair = (KeyNamePair) myRoles.get(0); + + Env.setContext(ctx,"#AD_Role_ID", pair.getKey()); + + SessionStorage.putMenus(ctx,request); + SessionStorage.putOrg(ctx, request); + + return mapping.findForward(LOGIN_SUCCESS); + } + + + } + catch(UserNotFoundException unfe) + { + postGlobalError("login.passwordError",request); + return (mapping.getInputForward()); + } + catch(NotLoggedInException e) + { + postGlobalError("login.passwordError",request); + return (mapping.getInputForward()); + } + catch(InvalidRoleException ire) + { + postGlobalError("error.role.invalid", request); + return (mapping.getInputForward()); + } + catch(UserInactiveException unae) + { + postGlobalError("login.userInactive",request); + return (mapping.getInputForward()); + } + + return mapping.findForward(INIT_CHOOSE_ROLE); + } + + + public static final String INIT_CHOOSE_ROLE = "initChooseRole"; + /** + * We get all the roles assign to the user and all orgs + * accessible by the user + */ + + + + + public static final String LOGIN_SUCCESS = "loginSuccess"; + /** + * We load all the menus + */ + public ActionForward loginSuccess(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception + { + ActionForward fwd = init(mapping, form, request, response); + if (fwd !=null) + return fwd; + + return mapping.findForward(LOGIN_SUCCESS); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/struts/login/POSLoginAction.java b/posterita/posterita/src/main/org/posterita/struts/login/POSLoginAction.java new file mode 100644 index 0000000000..3872f4a870 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/login/POSLoginAction.java @@ -0,0 +1,209 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Sep 25, 2006 + */ + + +package org.posterita.struts.login; + +import java.util.ArrayList; +import java.util.Properties; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.compiere.model.MSession; +import org.compiere.util.Env; +import org.compiere.util.WebUser; +import org.posterita.Constants; +import org.posterita.beans.LoginBean; +import org.posterita.beans.TerminalBean; +import org.posterita.businesslogic.LoginManager; +import org.posterita.businesslogic.MenuManager; +import org.posterita.businesslogic.POSManager; +import org.posterita.businesslogic.POSTerminalManager; +import org.posterita.core.Configuration; +import org.posterita.core.SessionStorage; +import org.posterita.core.TmkJSPEnv; +import org.posterita.exceptions.ApplicationException; +import org.posterita.exceptions.DuplicatePINException; +import org.posterita.exceptions.InvalidPINException; +import org.posterita.exceptions.InvalidRoleException; +import org.posterita.exceptions.NotLoggedInException; +import org.posterita.exceptions.OperationException; +import org.posterita.exceptions.UserInactiveException; +import org.posterita.exceptions.UserNotFoundException; +import org.posterita.model.MWebMenu; +import org.posterita.struts.core.BaseDispatchAction; +import org.posterita.struts.core.DefaultForm; +import org.posterita.user.WebUserInfo; + + +public class POSLoginAction extends BaseDispatchAction +{ + LoginManager bd = new LoginManager(); + public static final String SUCCESS = "success"; + public static final String CHOOSEPOS = "choosePOS"; + public static final String CREATEPOSORDER = "createPOSOrder"; + public static final String CREATEPOSORDERSCREEN = "createPOSOrderScreen"; + // public static final String SUCCESS_WSTORE_USER = "successWStoreUser"; + public ActionForward success(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + DefaultForm df = (DefaultForm) form; + LoginBean bean = (LoginBean) df.getBean(); + + Properties ctx = TmkJSPEnv.getCtx(request); + + HttpSession session = request.getSession(); + WebUserInfo info = null; + WebUser wu; + + try + { + if(bean.getUserPIN()!=null) + { + bean=bd.getUserNameFromPIN(ctx,bean.getUserPIN()); + } + + wu = bd.checkLoginPassword(ctx, bean);/////////////// + + info = bd.login(ctx, wu); + + MSession cSession = MSession.get (ctx, request.getRemoteAddr(), request.getRemoteHost(), session.getId()); + + if (cSession != null) + cSession.setWebStoreSession(false); + + session.setAttribute (WebUserInfo.NAME, info); + + Configuration config = Configuration.getConfiguration(request); + config.save(response); + + SessionStorage.putMenus(ctx, request); + } + catch(InvalidPINException e) + { + postGlobalError("error.invalid.pin",request); + return (mapping.getInputForward()); + } + catch(DuplicatePINException e) + { + postGlobalError("error.duplicate.pin",request); + return (mapping.getInputForward()); + } + catch(UserNotFoundException unfe) + { + postGlobalError("login.passwordError",request); + return (mapping.getInputForward()); + } + catch(NotLoggedInException e) + { + postGlobalError("login.passwordError",request); + return (mapping.getInputForward()); + } + catch(InvalidRoleException ire) + { + postGlobalError("error.role.invalid", request); + return (mapping.getInputForward()); + } + catch(UserInactiveException unae) + { + postGlobalError("login.userInactive",request); + return (mapping.getInputForward()); + } + + // Should be removed after backward compatibility achieved + POSTerminalManager.migrateOldPOSTerminal(ctx); + + + String strTerminalId = POSTerminalManager.getTerminalFromCookie(request); + boolean isValidPOSId = false; + int terminalId = 0; + + if(strTerminalId != null) + { + try + { + terminalId= Integer.parseInt(strTerminalId); + isValidPOSId = POSTerminalManager.isPOSTerminalAccessible(ctx, terminalId); + } + catch(Exception ex) + {} + } + + if(!isValidPOSId) + { + int adOrgId = Env.getAD_Org_ID(ctx); + ArrayList list = POSTerminalManager.getAllActiveTerminals(ctx, adOrgId, null); + request.getSession().setAttribute(Constants.POSTERMINALS, list); + return mapping.findForward(CHOOSEPOS); + } + else + { + SessionStorage.putLoginSession(ctx, request, response, terminalId); + boolean isCashSalesAllowed = MenuManager.isCashSalesAllowed(ctx, Env.getAD_Role_ID(ctx)); + + if(isCashSalesAllowed) + { + return mapping.findForward(CREATEPOSORDERSCREEN); + } + else + { + return mapping.findForward(CREATEPOSORDER); + } + } + } + + public ActionForward choosePOS(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + DefaultForm df = (DefaultForm) form; + + String strTerminalId = df.getPosId(); + + int terminalId = 0; + + try + { + terminalId = Integer.parseInt(strTerminalId); + } + catch (Exception ex) + { + throw new OperationException("Invalid terminal"); + } + + SessionStorage.putLoginSession(ctx, request, response, terminalId); + + return mapping.findForward(CHOOSEPOS); + } + +} + diff --git a/posterita/posterita/src/main/org/posterita/struts/menu/CloseMenuAction.java b/posterita/posterita/src/main/org/posterita/struts/menu/CloseMenuAction.java new file mode 100644 index 0000000000..b571a5092f --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/menu/CloseMenuAction.java @@ -0,0 +1,89 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Jul 28, 2005 by din + */ + +package org.posterita.struts.menu; + +import java.util.ArrayList; +import java.util.Properties; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; + +import org.posterita.Constants; +import org.posterita.beans.MenuItemBean; +import org.posterita.businesslogic.MenuManager; +import org.posterita.core.TmkJSPEnv; +import org.posterita.exceptions.ApplicationException; +import org.posterita.exceptions.OperationException; +import org.posterita.exceptions.SystemException; +import org.posterita.keyname.MenuKeyNamePair; +import org.posterita.struts.core.BaseDispatchAction; +import org.posterita.struts.core.DefaultForm; + +public class CloseMenuAction extends BaseDispatchAction +{ + + public static final String CLOSE_MENU= "closeMenuItems"; + public ActionForward closeMenuItems(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, SystemException, OperationException + { + ActionForward fwd = init(mapping, form, request, response); + + if (fwd != null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + DefaultForm df = (DefaultForm) form; + + MenuItemBean bean = (MenuItemBean) df.getBean(); + + MenuManager.saveMenu(ctx,bean); + + request.getSession().setAttribute(Constants.MENUS,bean); + + return mapping.findForward(CLOSE_MENU); + } + + public static final String INIT_MENU= "initMenuItems"; + public ActionForward initMenuItems(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, SystemException, OperationException + { + ActionForward fwd = init(mapping, form, request, response); + + if (fwd != null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + ArrayList menus = MenuKeyNamePair.getKeyNamePairs(ctx); + + + + request.getSession().setAttribute(Constants.MENUS, menus); + + return mapping.findForward(INIT_MENU); + } + } + + diff --git a/posterita/posterita/src/main/org/posterita/struts/menu/MenuAction.java b/posterita/posterita/src/main/org/posterita/struts/menu/MenuAction.java new file mode 100644 index 0000000000..787906dc11 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/menu/MenuAction.java @@ -0,0 +1,275 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +package org.posterita.struts.menu; + +import java.awt.Menu; +import java.io.PrintWriter; +import java.io.StringWriter; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Properties; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.compiere.model.PO; +import org.posterita.Constants; +import org.posterita.beans.MenuItemBean; +import org.posterita.businesslogic.MenuManager; +import org.posterita.core.MenuItem; +import org.posterita.core.TmkJSPEnv; +import org.posterita.core.bean.ElementBean; +import org.posterita.core.businesslogic.ElementManager; +import org.posterita.exceptions.ApplicationException; +import org.posterita.exceptions.OperationException; +import org.posterita.factory.POSMenuFactory; +import org.posterita.struts.core.BaseDispatchAction; +import org.posterita.struts.core.DefaultForm; + + + +public class MenuAction extends BaseDispatchAction +{ + public static final String GET_MENU_ITEMS = "getMenuItems"; + public static final String GET_POS_MENU_ITEMS = "getPOSMenuItems"; + + public ActionForward getMenuItems(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd = init(mapping, form, request, response); + + if (fwd != null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + DefaultForm df = (DefaultForm) form; + + MenuItemBean bean = (MenuItemBean) df.getBean(); + + MenuItem rootMenuItem = (MenuItem)request.getSession().getAttribute(Constants.MENUS); + + if(rootMenuItem == null) + { + //TODO: Display error message or should kick to right store + return mapping.findForward(CHOOSE_APPLICATION); + } + + ArrayList subMenus = new ArrayList(); + if(bean.getMenuId()==null) + { + PO po = POSMenuFactory.getFactoryInstance(ctx).get(ctx, POSMenuFactory.PMENU_SALES_ID); + bean.setMenuId(po.get_ID()); + } + + if(bean.getMenuId()!= null) + { + subMenus = rootMenuItem.getSubMenus(bean.getMenuId().intValue()); + } + + //subgrouping menus + ArrayList menuItems = subMenus; + HashMap> categoryMap = new HashMap>(); + + StringWriter sw = new StringWriter(); + PrintWriter out = new PrintWriter(sw); + ElementBean elementBean = null; + + String category = ""; + String imgSrc = "images/newUI/"; + ArrayList list = null; + ArrayList categories = new ArrayList(); + + //group menus + for(MenuItem menuItem : menuItems) + { + category = menuItem.getCategory(); + category = (category==null)? "" : category; + + if(!categories.contains(category)) + { + categories.add(category); + } + + list = categoryMap.get(category); + + if(list==null) + { + list = new ArrayList(); + } + + list.add(menuItem); + categoryMap.put(category,list); + + } + + //display groups + + Iterator iter = categories.iterator(); + + + while(iter.hasNext()) + { + //---------------------------------------------------------------------------------------------------------------------- + imgSrc = "images/newUI/"; + out.print("

    "); + out.print("
    "); + out.print(""); + out.print(""); + out.print("
    "); //top + out.print("
    "); + out.print("
    "); + out.print("
    "); + out.print("

    "); + + category = iter.next(); + list = categoryMap.get(category); + + if((category != null)&&(category.length() != 0)) + { + if(category.contains("order")) + { + imgSrc = imgSrc + "hicon-salesorder.gif"; + } + else if(category.contains("cash")) + { + imgSrc = imgSrc + "hicon-cashbook.gif"; + } + else if(category.contains("till")) + { + imgSrc = imgSrc + "hicon-tillmgt.gif"; + } + else + { + imgSrc = imgSrc + "spacer.gif"; + } + out.print(""); + + elementBean = ElementManager.getMsg(ctx,category); + out.print(elementBean.getName()); + }//if + else + { + out.print(""); + } + + out.print("

    "); + out.print("
    "); //salesOrder + + out.print(""); + out.print("
    "); //posSubNavContainer + out.print("
    "); //center-content + out.print("
    "); + out.print(""); + out.print(""); + out.print("
    "); + + if((category != null)&&(category.length() != 0)) + { + out.print("
    "); //liquid-round + }//if + + } + + out.flush(); + + String menu = sw.toString(); + + request.getSession().setAttribute(Constants.MENU_ITEMS, menu); + return mapping.findForward(GET_POS_MENU_ITEMS); + } + + public static final String INIT_EDIT_LINKSTATUS = "initEditLinkStatus"; + public ActionForward initEditLinkStatus(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd = init(mapping, form, request, response); + + if (fwd != null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + ArrayList menuKeyNamePairs = MenuManager.getClosableMenus(ctx); + + request.getSession().setAttribute(Constants.MENU_LIST, menuKeyNamePairs); + + return mapping.findForward(INIT_EDIT_LINKSTATUS); + } + + public static final String SELECT_LINK_TO_EDIT = "selectLinkToEdit"; + public ActionForward selectLinkToEdit(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd = init(mapping, form, request, response); + + if (fwd != null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + DefaultForm df = (DefaultForm) form; + + MenuItemBean bean = (MenuItemBean) df.getBean(); + + MenuItemBean bean2 = MenuManager.getMenu(ctx, bean.getMenuId().intValue()); + + df.populate(bean2); + + return mapping.findForward(SELECT_LINK_TO_EDIT); + } + + public static final String EDIT_MENU = "editMenu"; + public ActionForward editMenu(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws OperationException, ApplicationException + { + ActionForward fwd = init(mapping, form, request, response); + + if (fwd != null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + DefaultForm df = (DefaultForm) form; + + MenuItemBean bean = (MenuItemBean) df.getBean(); + + MenuItemBean editedMenu = MenuManager.editMenu(ctx, bean); + + request.getSession().setAttribute(Constants.MENU, editedMenu); + + return mapping.findForward(EDIT_MENU); + } + +} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/struts/order/CompletePOSOrderAction.java b/posterita/posterita/src/main/org/posterita/struts/order/CompletePOSOrderAction.java new file mode 100644 index 0000000000..53195712f4 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/order/CompletePOSOrderAction.java @@ -0,0 +1,72 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Created on 27-Mar-2006 + */ + + +package org.posterita.struts.order; + +import java.util.Properties; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.compiere.model.MOrder; + +import org.posterita.Constants; +import org.posterita.beans.WebDocumentBean; +import org.posterita.businesslogic.OrderReferenceManager; +import org.posterita.businesslogic.POSManager; +import org.posterita.core.TmkJSPEnv; +import org.posterita.exceptions.ApplicationException; +import org.posterita.exceptions.OperationException; + + +public class CompletePOSOrderAction extends ViewOrderAction +{ + + public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws OperationException, ApplicationException + { + ActionForward fwd = init(mapping, form, request, response); + + if (fwd != null) + return fwd; + Properties ctx = TmkJSPEnv.getCtx(request); + + WebDocumentBean webBean = null; + + Integer posOrderId=(Integer) request.getSession().getAttribute(Constants.CURRENT_POS_ORDER_ID); + + request.getSession().setAttribute(Constants.CURRENT_POS_ORDER_ID,posOrderId); + + MOrder completedPOSOrder=POSManager.completePOSOrder(ctx,posOrderId, null); + webBean = OrderReferenceManager.getWebOrderBean(ctx,completedPOSOrder); + + + request.getSession().setAttribute(Constants.WEB_ORDER_BEAN, webBean); + + return super.execute(mapping,form,request,response); + } + + +} diff --git a/posterita/posterita/src/main/org/posterita/struts/order/ViewOrderAction.java b/posterita/posterita/src/main/org/posterita/struts/order/ViewOrderAction.java new file mode 100644 index 0000000000..0b31d0e623 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/order/ViewOrderAction.java @@ -0,0 +1,307 @@ +/* + * Created on Mar 4, 2005 + * + * To change the template for this generated file go to + * Window - Preferences - Java - Code Style - Code Templates + */ +package org.posterita.struts.order; + +import java.util.Properties; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.Globals; +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.apache.struts.config.ActionConfig; +import org.apache.struts.config.ForwardConfig; +import org.apache.struts.util.MessageResources; +import org.compiere.model.MOrder; +import org.compiere.model.MUser; +import org.compiere.process.DocumentEngine; +import org.compiere.util.Env; + +import org.posterita.Constants; +import org.posterita.beans.DocumentBean; +import org.posterita.beans.WebDocumentBean; +import org.posterita.businesslogic.OrderReferenceManager; +import org.posterita.core.TmkJSPEnv; +import org.posterita.exceptions.ApplicationException; +import org.posterita.exceptions.OperationException; +import org.posterita.order.UDIOrderTypes; +import org.posterita.struts.core.BaseAction; +import org.posterita.struts.core.DefaultForm; + + +public class ViewOrderAction extends BaseAction +{ + + public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws OperationException, ApplicationException + { + + MessageResources resources = (MessageResources) request.getAttribute(Globals.MESSAGES_KEY); + + //String securityException = resources.getMessage("error.securityException"); + String operationException = resources.getMessage("error.operationException"); + + Properties ctx = TmkJSPEnv.getCtx(request); + + DefaultForm df = (DefaultForm) form; + DocumentBean bean = (DocumentBean) df.getBean(); + Integer orderID = bean.getDocumentId(); + + // retrieve from cache + WebDocumentBean webBean = null; + + MOrder order = null; + if (orderID!= null) + { + order = new MOrder(ctx, orderID.intValue(), null); + webBean = OrderReferenceManager.getWebOrderBean(ctx,order); + request.getSession().setAttribute(Constants.WEB_ORDER_BEAN, webBean); + } + + + if (webBean == null) + webBean = (WebDocumentBean) request.getSession().getAttribute(Constants.WEB_ORDER_BEAN); + + if (webBean == null) + throw new OperationException(operationException); + + request.getSession().setAttribute(Constants.ME_LOCATION, webBean.getMeLocation()); + request.getSession().setAttribute(Constants.YOU_LOCATION, webBean.getYouLocation()); + request.getSession().setAttribute(Constants.YOU_BP_LOCATION, webBean.getYoubpLocation()); + request.getSession().setAttribute(Constants.ME, webBean.getMe()); + request.getSession().setAttribute(Constants.YOU,webBean.getYou()); + request.getSession().setAttribute(Constants.MORDER, webBean.getOrder()); + request.getSession().setAttribute(Constants.MORDER_LINES_COLLECTION,webBean.getLines()); + request.getSession().setAttribute(Constants.SIMPLE_COMMAND,webBean.getSimpleCommand()); + request.getSession().setAttribute(Constants.COMPLEX_COMMAND,webBean.getComplexCommand()); + request.getSession().setAttribute(Constants.WEB_DOCUMENT_HEADER_BEAN, webBean.getHeaderBean()); + request.getSession().setAttribute(Constants.ORDER_TAX,webBean.getTotalTax()); + request.getSession().setAttribute(Constants.TOTAL_LINES,webBean.getTotalLines()); + request.getSession().setAttribute(Constants.GRAND_TOTAL,webBean.getGrandTotal()); + request.getSession().setAttribute(Constants.ALLOCATION,webBean.getAllocations()); + request.getSession().setAttribute(Constants.SALES_REP, webBean.getSalesRep()); + request.getSession().setAttribute(Constants.IS_PAID, webBean.getIsPaid()); + + ForwardConfig forwardConfig = getForward(ctx,webBean,mapping,form); + + ActionForward forward = new ActionForward(forwardConfig.getPath()); + + return forward; + } + + + private ForwardConfig getForward(Properties ctx, WebDocumentBean webBean, ActionMapping mapping, ActionForm form) throws OperationException + { + ActionConfig config = mapping.getModuleConfig().findActionConfig("/ViewOrderAction"); + + MOrder order = webBean.getOrder(); + + String orderType = order.getOrderType(); + + webBean.setCtx(ctx); + + if (orderType == null) + throw new OperationException("Cannot determine type of order. Type is null"); + + + //Tamak POS Order + if(orderType.equals(UDIOrderTypes.POS_ORDER.getOrderType())) + return getCustomerOrderForward(webBean,config); + + + + //Material Return Order + if(orderType.equals(UDIOrderTypes.CUSTOMER_RETURN_ORDER.getOrderType())) + return getMROForward(webBean, config); + + // WEBSTORE ORDER + if (orderType.equals(UDIOrderTypes.WEBSTORE_ORDER.getOrderType())) + return getWebstoreOrderForward(ctx, webBean,config); + + // DEFAULT + return config.findForwardConfig(Constants.FINISHED_DO); + } + + + + + + + public ForwardConfig getAllocationOrderForward(WebDocumentBean bean, ActionConfig config) + { + MOrder order = bean.getOrder(); + + String docStatus = order.getDocStatus(); + + if (!order.isActive()) + return config.findForwardConfig(Constants.CANCEL_DO); + + if (docStatus.equals(DocumentEngine.STATUS_Drafted)) + return config.findForwardConfig(Constants.UNFINISHED_AL); + + if (docStatus.equals(DocumentEngine.STATUS_InProgress)) + return config.findForwardConfig(Constants.SWAP_VIN); + + if (docStatus.equals(DocumentEngine.STATUS_Voided)) + return config.findForwardConfig(Constants.UNFINISHED_AL); + + return config.findForwardConfig(Constants.GENERATE_INVOICE); + } + + // same as for customer order + private ForwardConfig getUsedCarPurchaseOrderForward(WebDocumentBean webBean, ActionConfig config) throws OperationException + { + MOrder order = webBean.getOrder(); + + String status = order.getDocStatus(); + + if (status.equals(DocumentEngine.STATUS_Completed)) + return config.findForwardConfig(Constants.PROGRESS_TI); + + if (!order.isActive()) + return config.findForwardConfig(Constants.CANCEL_DO); + + + return config.findForwardConfig(Constants.PROGRESS_TI); + } + + + private ForwardConfig getCustomerOrderForward(WebDocumentBean webBean, ActionConfig config) throws OperationException + { + MOrder order = webBean.getOrder(); + + String status = order.getDocStatus(); + + + if (status.equals(DocumentEngine.STATUS_Drafted)) + { + return config.findForwardConfig(Constants.UNFINISHED_NR); + } + + if(status.equals(DocumentEngine.STATUS_InProgress)) + return config.findForwardConfig(Constants.PROGRESS_NR); + + if (status.equals(DocumentEngine.STATUS_Completed)) + return config.findForwardConfig(Constants.FINISHED_NR); + + + if (!order.isActive()) + return config.findForwardConfig(Constants.CANCEL_DO); + + return config.findForwardConfig(Constants.UNFINISHED_NR); + } + + private ForwardConfig getMROForward(WebDocumentBean webBean, ActionConfig config) + { + MOrder order = webBean.getOrder(); + + if (order.isSOTrx()) + return getSO_MROForward(webBean, config); + + return getPO_MROForward(webBean, config); + } + + + + + private ForwardConfig getSO_MROForward(WebDocumentBean webBean, ActionConfig config) + { + MOrder order = webBean.getOrder(); + + if (!order.isActive()) + { + return config.findForwardConfig(Constants.CANCEL_DO); + } + + return config.findForwardConfig(Constants.PROGRESS_DT); + } + + private ForwardConfig getPO_MROForward(WebDocumentBean orderBean, ActionConfig config) + { + MOrder order = orderBean.getOrder(); + + + if (order == null) + { + + return config.findForwardConfig(Constants.CANCEL_DO); + } + + String status = order.getDocStatus(); + + if (status.equals(DocumentEngine.STATUS_Drafted)) + { + //orderStatusMessage = "status drafted"; + } + + if (!order.isActive()) + return config.findForwardConfig(Constants.CANCEL_DO); + + + return config.findForwardConfig(Constants.PROGRESS_DT); + + } + + private ForwardConfig getWebstoreOrderForward(Properties ctx, WebDocumentBean webBean, ActionConfig config) throws OperationException + { + + int userId = Env.getAD_User_ID(ctx); + new MUser(ctx, userId, null); + + + return getWebstoreSOForward(webBean, config); + } + + public ForwardConfig getWebstoreSOForward(WebDocumentBean orderBean, ActionConfig config) throws OperationException + { + + MOrder order = orderBean.getOrder(); + + + if (order == null) + throw new OperationException("Order cannot be NULL!"); + + + return config.findForwardConfig(Constants.WEBSTORE_PROGRESS_DO); + } + + + public ForwardConfig getPO_SCO_Forward(WebDocumentBean webBean, ActionConfig config) + { + MOrder order = webBean.getOrder(); + + if (order == null) + { + return config.findForwardConfig(Constants.CANCEL_SCO); + } + + if (!order.isActive()) + { + return config.findForwardConfig(Constants.CANCEL_SCO); + } + + + String status = order.getDocStatus(); + + if (status.equals(DocumentEngine.STATUS_Drafted)) + { + return config.findForwardConfig(Constants.UNFINISHED_SCO); + } + + + if (status.equals(DocumentEngine.STATUS_Voided)) + { + return config.findForwardConfig(Constants.PROGRESS_SCO); + } + + + return config.findForwardConfig(Constants.PROGRESS_SCO); + + } + +} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/BarcodeAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/BarcodeAction.java new file mode 100644 index 0000000000..ed129cba4a --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/pos/BarcodeAction.java @@ -0,0 +1,363 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * 17-Aug-2006 13:49:29 by praveen + * + */ + +package org.posterita.struts.pos; + +import java.io.IOException; +import java.io.OutputStream; +import java.io.PrintWriter; +import java.math.BigDecimal; +import java.text.ParseException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.Properties; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.apache.struts.action.ActionMessage; +import org.apache.struts.action.ActionMessages; +import org.apache.struts.util.MessageResources; +import org.compiere.util.Env; +import org.compiere.util.Trx; +import org.posterita.Constants; +import org.posterita.beans.ItemBean; +import org.posterita.beans.OrderLineBean; +import org.posterita.beans.ShoppingCartBean; +import org.posterita.businesslogic.ProductCart; +import org.posterita.businesslogic.ShoppingcartManager; +import org.posterita.businesslogic.administration.BarcodeManager; +import org.posterita.businesslogic.administration.PriceListManager; +import org.posterita.businesslogic.stock.StockManager; +import org.posterita.core.TmkJSPEnv; +import org.posterita.core.TrxPrefix; +import org.posterita.exceptions.ApplicationException; +import org.posterita.exceptions.InputQuantityLessThanZeroException; +import org.posterita.exceptions.OperationException; +import org.posterita.exceptions.ProductNotFoundException; +import org.posterita.exceptions.ProductNotOnPriceListException; +import org.posterita.exceptions.QuantityNotAvailableException; +import org.posterita.exceptions.UOMValuePrecisionNotValidException; +import org.posterita.form.OrderLineForm; +import org.posterita.lib.UdiConstants; +import org.posterita.struts.core.DefaultForm; + +import com.lowagie.text.DocumentException; + +public class BarcodeAction extends POSDispatchAction +{ + public ActionForward getBarcodeImage(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd = init(mapping, form, request, response); + if (fwd !=null) + return fwd; + + DefaultForm df = (DefaultForm) form; + String barcode = df.getBarCode(); + + if(barcode!=null) + { + //send image + BarcodeManager.writeBarcode(barcode,response); + } + + return null; + + } + + //------------------------------------------------------------------------------------------// + /** + * BARCODE IMPLEMENTATION + */ + + public static final String INCREMENT_QTY = "incrementQty"; + public ActionForward incrementQty(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception + { + // Bug fix for null pointer + OrderLineForm of = (OrderLineForm) form; + if(of.getQuantity() == null) + { + of.setQuantity("1"); + } + + addToBarcodeCart(mapping,form,request,response); + return getBarcodeCart(mapping,form,request,response); + } + + public static final String DECREMENT_QTY = "decrementQty"; + public ActionForward decrementQty(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception + { + // Bug fix for null pointer + OrderLineForm of = (OrderLineForm) form; + if(of.getQuantity() == null) + { + of.setQuantity("1"); + } + + addToBarcodeCart(mapping,form,request,response); + return getBarcodeCart(mapping,form,request,response); + } + + public ActionForward addProduct(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException, IOException, ParseException + { + // Bug fix for null pointer + OrderLineForm of = (OrderLineForm) form; + if(of.getQuantity() == null) + { + of.setQuantity("1"); + } + + addToBarcodeCart(mapping,form,request,response); + + return getBarcodeCart(mapping,form,request,response); + } + + public static final String UPDATE_QTY = "updateQty"; + public ActionForward updateQty(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception + { + Properties ctx=TmkJSPEnv.getCtx(request); + + // Bug fix for null pointer + OrderLineForm of = (OrderLineForm) form; + if(of.getQuantity() == null) + { + of.setQuantity("1"); + } + + OrderLineBean bean = (OrderLineBean) of.getBean(); + Integer product_id = bean.getProductId(); + BigDecimal quantity = bean.getQuantity(); + Integer priceListId = bean.getPriceListId(); + + ArrayList items = (ArrayList) request.getSession().getAttribute(Constants.BARCODE_CART_ITEMS); + StockManager.updateItemFromPOSList(ctx, priceListId, items, product_id, quantity); + + return getBarcodeCart(mapping,form,request,response); + } + + public static final String ADD_TO_BARCODE_CART = "addToBarcodeCart"; + public ActionForward addToBarcodeCart(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException + { + Properties ctx = TmkJSPEnv.getCtx(request); + DefaultForm df = (DefaultForm) form; + OrderLineBean bean = (OrderLineBean) df.getBean(); + + + String barcodeCart = Constants.BARCODE_CART; + String barcodeCartItems = Constants.BARCODE_CART_ITEMS; + + + ShoppingCartBean cartBean = (ShoppingCartBean) request.getSession().getAttribute(barcodeCart); + + try + { + if(bean.getProductId()==null && bean.getBarCode()==null) + { + postGlobalError("error.barcode.required", request); + return mapping.getInputForward(); + } + + BigDecimal qty = bean.getQuantity(); + if(qty != null && qty.doubleValue() < 0.0) + { + throw new InputQuantityLessThanZeroException(""); + } + + cartBean = StockManager.addToPOSCart(ctx, bean, cartBean, false,Boolean.parseBoolean(bean.getIfAdd())); + } + catch (InputQuantityLessThanZeroException e) + { + postGlobalError("error.invalid.inputQty", request); + return mapping.getInputForward(); + } + catch (ProductNotFoundException e) + { + postGlobalError("error.product.not.found", e.getMessage(), request); + return mapping.getInputForward(); + } + catch(QuantityNotAvailableException e) + { + postGlobalError("error.quantity.notAvailable", e.getMessage(), request); + return mapping.getInputForward(); + } + + catch(ProductNotOnPriceListException e) + { + postGlobalError("error.product.price.not.found", e.getMessage(), request); + return mapping.getInputForward(); + } + + catch (UOMValuePrecisionNotValidException e) + { + postGlobalError("error.precision", e.getMessage(), request); + return mapping.getInputForward(); + } + + + + int priceListId = Env.getContextAsInt(ctx, UdiConstants.PRICELIST_CTX_PARAM); + String currSymboleSales = PriceListManager.getCurrency(ctx, priceListId); + request.setAttribute(Constants.CURRENCY_SYMBOLE,currSymboleSales); + + request.getSession().setAttribute(barcodeCart, cartBean); + request.getSession().setAttribute(barcodeCartItems, cartBean.getItems()); + + df.setQtyAndItem(""); + + return mapping.findForward(ADD_TO_BARCODE_CART); + } + + public ActionForward getBarcodeCart(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws OperationException, IOException, ParseException + { + DefaultForm df = (DefaultForm) form; + String orderType = df.getOrderType(); + + String shoppingcartHTML = ShoppingcartManager.getBarcodecartAsHTML(request); + + PrintWriter writer = response.getWriter(); + writer.write(shoppingcartHTML); + + + ActionMessages errors = (ActionMessages) request.getAttribute("org.apache.struts.action.ERROR"); + if(errors != null && !errors.isEmpty()) + { + MessageResources messageResources = getResources(request); + + Iterator iter = errors.get(); + while(iter.hasNext()) + { + ActionMessage message = iter.next(); + String key = message.getKey(); + Object[] values = message.getValues(); + + String errMsg = messageResources.getMessage(key, values); + writer.write(""); + } + + } + + writer.close(); + + return null; + } + + + public static final String COPY_PRODUCT_TO_SHOPPING_CART = "copyProductToShoppingCart"; + public ActionForward copyProductToShoppingCart(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException, IOException, ParseException + { + ActionForward fwd=init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + HttpSession session = request.getSession(); + ProductCart cart = (ProductCart) session.getAttribute(Constants.PRODUCT_CART); + String shoppingcartHTML = ShoppingcartManager.copyShoppingCartAsHTML(ctx, cart); + + request.getSession().setAttribute(Constants.BARCODE_CART, cart); + request.getSession().setAttribute(Constants.BARCODE_CART_ITEMS, cart.getProducts()); + + return new ActionForward("/initProductBarcodeCart.do"); + } + + public static final String RELOAD_BARCODE_CART = "reloadBarcodeCart"; + public ActionForward reloadBarcodeCart(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws OperationException, IOException, ParseException, ApplicationException + { + ActionForward fwd=init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + DefaultForm df = (DefaultForm) form; + OrderLineBean bean = (OrderLineBean) df.getBean(); + + String barcodeCart = Constants.BARCODE_CART; + String barcodeCartItems = Constants.BARCODE_CART_ITEMS; + + ShoppingCartBean cartBean = (ShoppingCartBean) request.getSession().getAttribute(barcodeCart); + ArrayList itemBeans= cartBean.getItems(); + + String priceListIdAsStr = request.getParameter("priceListId"); + String productIdAsStr = request.getParameter("productId"); + int productId = Integer.parseInt(productIdAsStr); + int priceListId = Integer.parseInt(priceListIdAsStr); + + BigDecimal qty = BigDecimal.ZERO; + + for(int i=0; iblackListedList = BlackListedManager.getAllBlackListed(ctx); + request.getSession().setAttribute(Constants.BLACKLISTED_LISTS , blackListedList); + return mapping.findForward(GET_ALL_BLACKLISTED); + } + + public static final String INIT_SEARCH_CHEQUE="initSearchCheque"; + public ActionForward initSearchCheque(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws OperationException, ApplicationException + { + ArrayList Blacklist = new ArrayList(); + request.getSession().setAttribute(Constants.BLACKLISTED_LISTS, Blacklist); + + return mapping.findForward(INIT_SEARCH_CHEQUE); + } + + public static final String SEARCH_CHEQUE="searchCheque"; + public ActionForward searchCheque(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws OperationException, ApplicationException + { + ActionForward fwd=init(mapping,form,request,response); + if (fwd!=null) + return fwd; + Properties ctx = TmkJSPEnv.getCtx(request); + + DefaultForm df = (DefaultForm)form; + + //BlackListedBean bean = (BlackListedBean)df.getBean(); + + ArrayList Blacklist = BlackListedManager.searchChequeNo(ctx, df.getChequeNo()); + + request.getSession().setAttribute(Constants.BLACKLISTED_LISTS, Blacklist); + + return mapping.findForward(SEARCH_CHEQUE); + + } + + public static final String INIT_EDIT_CHEQUE="initEditCheque"; + public ActionForward initEditCheque(ActionMapping mapping, ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd=init(mapping,form,request,response); + if (fwd!=null) + return fwd; + Properties ctx = TmkJSPEnv.getCtx(request); + + BlackListForm f = (BlackListForm) form; + f.validate(mapping,request); + + BlackListedBean bean = (BlackListedBean) f.getBean(); + Integer blacklistedID = bean.getBlackListedId(); + + if(blacklistedID==null) + { + throw new OperationException("Cannot edit Cheques. Cause BlacklistedID id cannot be null!"); + } + + bean= BlackListedManager.getBlackListedDetails(ctx, blacklistedID); + f.populate(bean); + + return mapping.findForward(INIT_EDIT_CHEQUE); + } + + + public static final String EDIT_CHEQUE = "editCheque"; + public ActionForward editCheque(ActionMapping mapping, ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + + ActionForward fwd=init(mapping,form,request,response); + if (fwd!=null) + return fwd; + Properties ctx = TmkJSPEnv.getCtx(request); + BlackListForm f = (BlackListForm) form; + BlackListedBean bean=(BlackListedBean)f.getBean(); + + Integer blacklistedID = bean.getBlackListedId(); + if(blacklistedID==null) + { + throw new OperationException("Cannot load Cheque details. Cause BlacklistedId cannot be null!"); + } + + Trx trx = Trx.get(TrxPrefix.getPrefix(), true); + trx.start(); + + try + { + BlackListedManager.editBlackListed(ctx, bean, trx.getTrxName()); + trx.commit(); + } + catch(OperationException ex) + { + trx.rollback(); + throw ex; + } + finally + { + trx.close(); + } + request.getSession().setAttribute(Constants.BLACKLISTED_DETAILS,bean); + return mapping.findForward(EDIT_CHEQUE); + } + + + public static final String DEACTIVATE_CHEQUE = "deactivateCheque"; + public ActionForward deactivateCheque(ActionMapping mapping, ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + + ActionForward fwd=init(mapping,form,request,response); + if (fwd!=null) + return fwd; + Properties ctx = TmkJSPEnv.getCtx(request); + BlackListForm f=(BlackListForm)form; + f.validate(mapping,request); + + BlackListedBean bean=(BlackListedBean)f.getBean(); + Integer blackListedId = bean.getBlackListedId(); + + if(blackListedId==null) + { + throw new OperationException("Cannot deactivate Blacklisted Cheques. Cause BlackListed id cannot be null!"); + } + + + Trx trx = Trx.get(TrxPrefix.getPrefix(), true); + + try + { + trx.start(); + BlackListedManager.deactivateBListedCheque(ctx, blackListedId.intValue(), trx.getTrxName()); + trx.commit(); + } + catch (OperationException e) + { + trx.rollback(); + postGlobalError("error.deactivate.customer", request); + mapping.getInputForward(); + } + finally + { + trx.close(); + } + + return mapping.findForward(DEACTIVATE_CHEQUE); + } + + +} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/BpartnerInfoAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/BpartnerInfoAction.java new file mode 100644 index 0000000000..753a9ea75a --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/pos/BpartnerInfoAction.java @@ -0,0 +1,98 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Jul 26, 2006 + */ + + +package org.posterita.struts.pos; + +import java.util.ArrayList; +import java.util.Properties; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; + +import org.posterita.Constants; +import org.posterita.beans.BPartnerInfoBean; +import org.posterita.businesslogic.MenuManager; +import org.posterita.businesslogic.POSBpartnerInfoManager; +import org.posterita.core.TmkJSPEnv; +import org.posterita.exceptions.ApplicationException; +import org.posterita.exceptions.OperationException; +import org.posterita.factory.POSMenuFactory; +import org.posterita.struts.core.DefaultForm; + + +public class BpartnerInfoAction extends POSDispatchAction +{ + public static final String GET_BPARTNER_INFO = "getBpartnerInfo"; + public ActionForward getBpartnerInfo(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx=TmkJSPEnv.getCtx(request); + DefaultForm df= (DefaultForm) form; + + BPartnerInfoBean bean=(BPartnerInfoBean) df.getBean(); + + ArrayList list = POSBpartnerInfoManager.getPartnerInfo(ctx,bean.getPartnerName(),bean.getIsCustomer()); + + request.getSession().setAttribute(Constants.BUSINESSPARTNER,list); + request.getSession().removeAttribute(Constants.DEBTORS); + + return mapping.findForward(GET_BPARTNER_INFO); + } + + + public static final String GET_BPARTNER_TRX_DETAILS = "getBpartnerTrxDetails"; + public ActionForward getBpartnerTrxDetails(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx=TmkJSPEnv.getCtx(request); + DefaultForm df= (DefaultForm) form; + + BPartnerInfoBean bean=(BPartnerInfoBean) df.getBean(); + + boolean access=MenuManager.getRoleMenuAccess(ctx,POSMenuFactory.SMENU_VIEW_BPINFO); + if(access==false) + { + postGlobalError("error.access.not.allowed",request); + return new ActionForward(bean.getForward()); + } + + ArrayList list = POSBpartnerInfoManager.getbPartnerTrxDetails(ctx,bean.getBpartnerId(),bean.getIsCustomer()); + ArrayList orderList=POSBpartnerInfoManager.getBpartnerOrderHistory(ctx,bean.getBpartnerId()); + ArrayList infoList = POSBpartnerInfoManager.getPartnerInfo(ctx,bean.getBpartnerId(),bean.getIsCustomer()); + + request.getSession().setAttribute(Constants.BUSINESSPARTNERINFO,infoList); + request.getSession().setAttribute(Constants.BUSINESSPARTNER_TRX_DETAILS,list); + request.getSession().setAttribute(Constants.BUSINESSPARTNER_ORDER_DETAILS,orderList); + + return mapping.findForward(GET_BPARTNER_TRX_DETAILS); + } +} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/CashAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/CashAction.java new file mode 100644 index 0000000000..92c61fa298 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/pos/CashAction.java @@ -0,0 +1,184 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +* +* Created on Sep 11, 2006 by ashley +* +*/ + +/** + @author ashley + */ + +package org.posterita.struts.pos; + +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.util.ArrayList; +import java.util.Properties; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.compiere.model.MAttachment; +import org.compiere.model.MCash; +import org.posterita.Constants; +import org.posterita.beans.CashBean; +import org.posterita.beans.CashBookBean; +import org.posterita.beans.CashLineBean; +import org.posterita.beans.CashSummaryBean; +import org.posterita.beans.CloseTillBean; +import org.posterita.beans.DateFilterBean; +import org.posterita.beans.POSHistoryBean; +import org.posterita.businesslogic.CashManager; +import org.posterita.businesslogic.POSTerminalManager; +import org.posterita.businesslogic.performanceanalysis.POSReportManager; +import org.posterita.core.TmkJSPEnv; +import org.posterita.exceptions.ApplicationException; +import org.posterita.exceptions.OperationException; +import org.posterita.form.POSHistoryForm; +import org.posterita.struts.core.DefaultForm; + +public class CashAction extends POSDispatchAction +{ + + public static final String INIT_GET_CASH_DETAILS_HISTORY = "initGetCashDetailsHistory"; + public ActionForward initGetCashDetailsHistory(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd=init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + POSHistoryForm historyForm = new POSHistoryForm(); + POSHistoryBean bean = (POSHistoryBean)historyForm.getBean(); + + int cashBookId = POSTerminalManager.getCashBookId(ctx); + bean.setCashBookId(cashBookId); + + getCashDetailsHistory(mapping, historyForm, request, response); + ArrayList cashBooks = CashManager.getCashBooks(ctx, null); + + request.getSession().setAttribute(Constants.ACCESSIBLE_CASHBOOKS, cashBooks); + + return mapping.findForward(INIT_GET_CASH_DETAILS_HISTORY); + } + + public static final String GET_CASH_DETAILS_HISTORY = "getCashDetailsHistory"; + public ActionForward getCashDetailsHistory(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd=init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + DefaultForm df = (DefaultForm)form; + + Properties ctx = TmkJSPEnv.getCtx(request); + + POSHistoryBean historyBean = (POSHistoryBean)df.getBean(); + + ArrayList cashList = CashManager.getCashDetails(ctx, historyBean.getCashBookId(), historyBean.getMonth(), historyBean.getYear(), null); + + request.getSession().setAttribute(Constants.CASH_DETAILS, cashList); + + return mapping.findForward(GET_CASH_DETAILS_HISTORY); + } + + public static final String GET_CASHLINE_DETAILS = "getCashLineDetails"; + public ActionForward getCashLineDetails(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd=init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + DefaultForm df = (DefaultForm)form; + + Properties ctx = TmkJSPEnv.getCtx(request); + + CashBean cashBean = (CashBean)df.getBean(); + + CashSummaryBean cashSummaryBean = CashManager.getCashSummary(ctx, cashBean.getCashId(), null); + ArrayList cashLineList = CashManager.getCashLineHistory(ctx, cashBean.getCashId(), null); + + int cash_id = cashBean.getCashId(); + MAttachment attachment = MAttachment.get(ctx, MCash.Table_ID, cash_id); + CloseTillBean closeTillBean = null; + if(attachment != null) + { + try + { + byte[] data = attachment.getEntryData(0); + if(data != null) + { + ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(data)); + Object obj = ois.readObject(); + closeTillBean = (CloseTillBean) obj; + } + } + catch (IOException e) + { + // TODO Auto-generated catch block + e.printStackTrace(); + } + catch (ClassNotFoundException e) + { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + if(closeTillBean != null) + { + String printData = POSReportManager.endOfTheDayHTMLReport(ctx, closeTillBean); + request.setAttribute(Constants.CLOSE_TILL_PRINT_DATA, printData); + } + + request.setAttribute(Constants.CASH_LINE_DETAILS, cashLineList); + request.setAttribute(Constants.CASH_SUMMARY, cashSummaryBean); + + return mapping.findForward(GET_CASHLINE_DETAILS); + } + + public static final String GET_CASH_SUMMARY_BY_DATE = "getCashSummaryByDate"; + public ActionForward getCashSummaryByDate(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd=init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + DefaultForm df = (DefaultForm)form; + + Properties ctx = TmkJSPEnv.getCtx(request); + + DateFilterBean dateBean = (DateFilterBean)df.getBean(); + + CashSummaryBean cashSummaryBean = CashManager.getCashSummary(ctx, dateBean.getFromDate(), dateBean.getToDate(), null); + + ArrayList cashLineList = CashManager.getCashLineHistory(ctx, dateBean.getFromDate(), dateBean.getToDate(), null); + + request.setAttribute(Constants.CASH_LINE_DETAILS, cashLineList); + request.setAttribute(Constants.CASH_SUMMARY, cashSummaryBean); + + return mapping.findForward(GET_CASH_SUMMARY_BY_DATE); + } +} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/CashBookAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/CashBookAction.java new file mode 100644 index 0000000000..85a32cccba --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/pos/CashBookAction.java @@ -0,0 +1,651 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Created on 22-Mar-2006 + */ + + +package org.posterita.struts.pos; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.ObjectOutputStream; +import java.io.OutputStream; +import java.math.BigDecimal; +import java.sql.SQLException; +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.Properties; +import java.util.logging.Level; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.compiere.model.MAttachment; +import org.compiere.model.MCash; +import org.compiere.model.MCashBook; +import org.compiere.model.MCashLine; +import org.compiere.model.MCurrency; +import org.compiere.util.CLogger; +import org.compiere.util.Env; +import org.compiere.util.KeyNamePair; +import org.compiere.util.Trx; +import org.posterita.Constants; +import org.posterita.beans.CashBookBean; +import org.posterita.beans.CashBookDetailBean; +import org.posterita.beans.CloseTillBean; +import org.posterita.beans.CurrentTillAmountBean; +import org.posterita.beans.UDIBean; +import org.posterita.businesslogic.CashManager; +import org.posterita.businesslogic.ClientManager; +import org.posterita.businesslogic.OrganisationManager; +import org.posterita.businesslogic.POSManager; +import org.posterita.businesslogic.POSTerminalManager; +import org.posterita.businesslogic.PrintManager; +import org.posterita.businesslogic.core.AccountingManager; +import org.posterita.businesslogic.performanceanalysis.POSReportManager; +import org.posterita.businesslogic.performanceanalysis.ReportManager; +import org.posterita.core.TmkJSPEnv; +import org.posterita.core.TrxPrefix; +import org.posterita.exceptions.ApplicationException; +import org.posterita.exceptions.CanNotAjdustTillException; +import org.posterita.exceptions.CanNotCloseTillException; +import org.posterita.exceptions.CashBookAlreadyAssignedException; +import org.posterita.exceptions.NoCashJournalPresentException; +import org.posterita.exceptions.NullTransferAmountException; +import org.posterita.exceptions.OperationException; +import org.posterita.exceptions.TerminalLockedException; +import org.posterita.exceptions.TransferAmountExceedsTotalAmountException; +import org.posterita.form.CashBookForm; +import org.posterita.struts.core.BaseDispatchAction; +import org.posterita.struts.core.DefaultForm; +import org.posterita.util.PoManager; +import org.posterita.util.TmkPrinterConstants; + + +public class CashBookAction extends BaseDispatchAction +{ + /** Logger */ + private static final CLogger logger = CLogger.getCLogger(CashBookAction.class); + + public static final String GET_CASH_BOOK_DETAILS="getCashBookDetails"; + public ActionForward getCashBookDetails(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd=init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + CashBookDetailBean bean = CashManager.getCashBookDetails(ctx, null); + + // Keeping compatibility with view + ArrayList list = new ArrayList(); + list.add(bean); + + request.getSession().setAttribute(Constants.CASH_BOOK, list); + + return mapping.findForward(GET_CASH_BOOK_DETAILS); + } + + + + public static final String ADJUST_CASH_BOOK_ACTION="adjustCashBookAction"; + public ActionForward adjustCashBookAction(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd=init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + DefaultForm df = (DefaultForm)form; + CashBookDetailBean bean = (CashBookDetailBean)df.getBean(); + Properties ctx = TmkJSPEnv.getCtx(request); + + Trx trx = Trx.get(TrxPrefix.getPrefix(),true); + MCashLine cashLine = null; + + try + { + trx.start(); + cashLine = CashManager.adjustCashBook(ctx, bean, trx.getTrxName()); + trx.commit(); + } + catch(NullTransferAmountException e) + { + postGlobalError("error.no.transfer.amount",request); + return mapping.getInputForward(); + } + + catch(TransferAmountExceedsTotalAmountException e) + { + postGlobalError("error.transferAmt.exceeds.endingBalance",request); + return mapping.getInputForward(); + } + catch(CanNotAjdustTillException e) + { + postGlobalError("error.cannot.adjust.till",request); + return mapping.getInputForward(); + } + catch(NumberFormatException e) + { + postGlobalError("error.invalid.number",request); + return mapping.getInputForward(); + } + finally + { + trx.rollback(); + trx.close(); + } + + // Keeping compatibility with view + ArrayList list = new ArrayList(); + list.add(bean); + + // Printing + if (cashLine != null) + { + PrintManager.printAdjustCashbookReport(ctx, cashLine); + } + + request.getSession().setAttribute(Constants.CASH_BOOK,list); + + return mapping.findForward(ADJUST_CASH_BOOK_ACTION); + } + + public static final String INIT_CLOSE_TILL="initCloseTill"; + public ActionForward initCloseTill(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd=init(mapping,form,request,response); + if(fwd!=null) + return fwd; + Properties ctx = TmkJSPEnv.getCtx(request); + + CurrentTillAmountBean tillBean = POSManager.getCurrentTillAmount(ctx); + request.setAttribute(Constants.CURRENT_TILL_AMOUNT_POS,tillBean); + MCurrency currency = POSTerminalManager.getCurrencyOfTerminalCashBook(ctx); + request.setAttribute(Constants.CURRENCY_SYMBOLE,currency.getCurSymbol()); + return mapping.findForward(INIT_CLOSE_TILL); + + } + + public static final String CLOSE_TILL="closeTill"; + public ActionForward closeTill(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException, SQLException, IOException + { + ActionForward fwd=init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + DefaultForm df = (DefaultForm)form; + CashBookDetailBean bean =(CashBookDetailBean)df.getBean(); + + Properties ctx = TmkJSPEnv.getCtx(request); + CurrentTillAmountBean tillBean=null; + + tillBean = POSManager.getCurrentTillAmount(ctx); + + Trx trx = Trx.get(TrxPrefix.getPrefix(),true); + + try + { + trx.start(); + bean = CashManager.CloseTill(ctx, bean, trx.getTrxName()); + trx.commit(); + } + catch (NoCashJournalPresentException exception) + { + trx.rollback(); + postGlobalError("error.no.cashjournal.present",request); + return mapping.getInputForward(); + } + catch(NullTransferAmountException e) + { + trx.rollback(); + postGlobalError("error.no.transfer.amount",request); + return mapping.getInputForward(); + } + catch(CanNotCloseTillException e) + { + trx.rollback(); + postGlobalError("error.till.already.close",request); + return mapping.getInputForward(); + } + catch (TerminalLockedException exception) + { + trx.rollback(); + postGlobalError("error.terminal.locked", request); + } + catch(NumberFormatException e) + { + trx.rollback(); + postGlobalError("error.invalid.number",request); + return mapping.getInputForward(); + } + catch(OperationException e) + { + trx.rollback(); + throw e; + } + finally + { + trx.close(); + } + + String currency = POSTerminalManager.getDefaultSalesCurrency(ctx) + .getCurSymbol(); + + CloseTillBean closeTillBean = new CloseTillBean(); + closeTillBean.setTillName(tillBean.getPosName()); + closeTillBean.setCurrency(currency); + closeTillBean.setBeginningBalance(bean.getBeginingBalance()); + closeTillBean.setNetCashTrx(bean.getStatementDifference()); + closeTillBean.setBalanceEntered(bean.getTransferAmount()); + closeTillBean.setDifference(bean.getDifferenceAmt()); + closeTillBean.setEndingBalance(bean.getEndingBalance()); + closeTillBean.setCashTotal(tillBean.getCashTotal()); + closeTillBean.setCardTotal(tillBean.getCardTotal()); + closeTillBean.setChequeTotal(tillBean.getChequeTotal()); + closeTillBean.setGrandTotal(tillBean.getTillGrandTotal()); + closeTillBean.setCardAmtEntered(bean.getCardTotal()); + closeTillBean.setCardDifference(bean.getCardDifference()); + closeTillBean.setChequeAmtEntered(bean.getChequeTotal()); + closeTillBean.setChequeDifference(bean.getChequeDifference()); + + //save the CloseTillBean as attachment + int cash_id = bean.getCash_id(); + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + ObjectOutputStream oos = new ObjectOutputStream(bos); + oos.writeObject(closeTillBean); + byte[] attachmentData = bos.toByteArray(); + MAttachment attachment = new MAttachment(ctx,MCash.Table_ID,cash_id,null); + attachment.addEntry("Close Till Data", attachmentData); + PoManager.save(attachment); + + String reportName = POSReportManager.endOfTheDayPDF(ctx,closeTillBean); //generates report + String reportURI = ReportManager.getReportURI(reportName,request); //resolves report path + + request.getSession().setAttribute(Constants.END_OF_THE_DAY_DETAILS,closeTillBean); //session as being used for printing + request.setAttribute(Constants.REPORT_URL,reportURI); + + return mapping.findForward(CLOSE_TILL); + } + + public static final String OPEN_CASH_DRAWER="openCashDrawer"; + + public ActionForward openCashDrawer(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx=TmkJSPEnv.getCtx(request); + + PrintManager.openCashDrawer(ctx); + + return null; + + } + + //--------------------------------------------------------------- + public ActionForward getClosedTillData(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + CloseTillBean bean = (CloseTillBean)request.getSession().getAttribute(Constants.END_OF_THE_DAY_DETAILS); + + if (bean == null) + { + throw new OperationException("Till amount details not available"); + } + + request.getSession().setAttribute(Constants.END_OF_THE_DAY_DETAILS, null); // remove end of day details + + String printingType = POSManager.getPrintingTypeFromCookie(request); + + if (printingType == null) + { + printingType = TmkPrinterConstants.SLIP_PRINTER_9PIN; + } + + if (TmkPrinterConstants.NORMAL_PRINTER.equalsIgnoreCase(printingType)) + { + String reportName = POSReportManager.endOfTheDayPDF(ctx,bean); //generates report + response.setContentType("application/pdf"); + ReportManager.writeReport(reportName, response); + return null; + } + else if (TmkPrinterConstants.SLIP_PRINTER_THERMAL.equals(printingType) + || TmkPrinterConstants.SLIP_PRINTER_9PIN.equals(printingType)) + { + int length = TmkPrinterConstants.PRINTER_9PIN_WIDTH; + if (TmkPrinterConstants.SLIP_PRINTER_THERMAL.equals(printingType)) + { + length = TmkPrinterConstants.PRINTER_SLIP_WIDTH; + } + + String printData = ""; + try + { + //Timestamp ts = new Timestamp(System.currentTimeMillis()); + String data = POSReportManager.endOfTheDayReport(ctx,bean); + // int terminalId = POSTerminalManager.getTerminalId(ctx); + // String salesData = POSReportManager.getDailySalesReport(ctx, ts, terminalId, length, null); + // printData = data + salesData; + printData = data; + } + catch (Exception ex) + { + printData = "Could not get data for the report"; + } + + try + { + response.setContentType("application/octet-stream"); + OutputStream os = response.getOutputStream(); + os.write(printData.getBytes()); + os.flush(); + os.close(); + } + catch (Exception ex) + { + logger.log(Level.SEVERE, "Failed to write to response", ex); + throw new OperationException(ex); + } + } + else + { + logger.log(Level.SEVERE, "Printing Type not defined, PrintingType: " + printingType); + return null; + } + return null; + } + + + //----------------- + + private void populateData(HttpServletRequest request, String trxName) + { + Properties ctx = TmkJSPEnv.getCtx(request); + + ArrayList accessibleOrgs = OrganisationManager.getUserOrgPairs(ctx, false); + request.getSession().setAttribute(Constants.ACCESSIBLE_ORGS, accessibleOrgs); + } + + public static final String INIT_SEARCH_CASHBOOK = "initSearchCashBook"; + public ActionForward initSearchCashBook(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd = init(mapping,form,request,response); + if(fwd != null) + return fwd; + + request.getSession().setAttribute(Constants.CASHBOOKS, null); + + return mapping.findForward(INIT_SEARCH_CASHBOOK); + } + + + public static final String SEARCH_CASHBOOK = "searchCashBook"; + public ActionForward searchCashBook(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd = init(mapping,form,request,response); + if(fwd != null) + return fwd; + + Properties ctx=TmkJSPEnv.getCtx(request); + DefaultForm df = (DefaultForm)form; + UDIBean bean = (UDIBean)df.getBean(); + + String searchText = bean.getSearchText(); + + ArrayList cashbookList = CashManager.getCashBooks(ctx, searchText, null); + + request.getSession().setAttribute(Constants.CASHBOOKS, cashbookList); + + return mapping.findForward(SEARCH_CASHBOOK); + } + + public static final String VIEW_CASHBOOK = "viewCashBook"; + public ActionForward viewCashBook(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd = init(mapping,form,request,response); + if(fwd != null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + CashBookForm cashBookForm = (CashBookForm)form; + CashBookBean cashBookBean = (CashBookBean)cashBookForm.getBean(); + + populateData(request, null); + + cashBookBean = CashManager.getCashBook(ctx, cashBookBean.getCashBookId(), null); + + cashBookForm.populate(cashBookBean); + cashBookForm.setAction(VIEW_CASHBOOK); + cashBookForm.setReadOnly(true); + + return mapping.findForward(VIEW_CASHBOOK); + } + + public static final String INIT_CREATE_CASHBOOK = "initCreateCashBook"; + public ActionForward initCreateCashBook(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd = init(mapping,form,request,response); + if(fwd != null) + return fwd; + + + Properties ctx = TmkJSPEnv.getCtx(request); + DefaultForm df = (DefaultForm)form; + + int defaultCurrencyId = AccountingManager.getCurrencyId(ctx, Env.getAD_Client_ID(ctx), null); + + CashBookBean cashBookBean = new CashBookBean(); + cashBookBean.setCurrencyId(defaultCurrencyId); + cashBookBean.setIsDefault(false); + cashBookBean.setIsActive(true); + + int orgId = Env.getAD_Org_ID(ctx); + + populateData(request, null); + cashBookBean.setOrgId(orgId); + df.populate(cashBookBean); + df.setAction(CREATE_CASHBOOK); + df.setReadOnly(false); + + return mapping.findForward(INIT_CREATE_CASHBOOK); + } + + public static final String CREATE_CASHBOOK = "createCashBook"; + public ActionForward createCashBook(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd = init(mapping,form,request,response); + if(fwd != null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + CashBookForm cashBookForm = (CashBookForm)form; + CashBookBean cashBookBean = (CashBookBean)cashBookForm.getBean(); + + Trx trx = Trx.get(Trx.createTrxName(), true); + trx.start(); + + try + { + if (cashBookBean.getCurrencyId() == null || cashBookBean.getCurrencyId() == 0) + { + // Needed till the ability to chose currency when creating a cash book is not enabled. + // This is the case for the moment since there is no way to define conversion rates + int defaultCurrencyId = AccountingManager.getCurrencyId(ctx, Env.getAD_Client_ID(ctx), null); + cashBookBean.setCurrencyId(defaultCurrencyId); + } + + MCashBook cashBook = CashManager.createUpdateCashBook(ctx, cashBookBean, trx.getTrxName()); + cashBookBean.setCashBookId(cashBook.get_ID()); + trx.commit(); + } + catch (CashBookAlreadyAssignedException cashBookAlreadyAssignedException) + { + postGlobalError("error.deactivate.cashbook", request); + return mapping.getInputForward(); + } + catch (Exception ex) + { + postGlobalError("error.operation", request); + return mapping.getInputForward(); + } + finally + { + trx.rollback(); + trx.close(); + } + + cashBookForm.populate(cashBookBean); + viewCashBook(mapping, form, request, response); + + return mapping.findForward(CREATE_CASHBOOK); + } + + public static final String EDIT_CASHBOOK = "editCashBook"; + public ActionForward editCashBook(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd = init(mapping,form,request,response); + if(fwd != null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + CashBookForm cashBookForm = (CashBookForm)form; + CashBookBean cashBookBean = (CashBookBean)cashBookForm.getBean(); + + populateData(request, null); + cashBookBean = CashManager.getCashBook(ctx, cashBookBean.getCashBookId(), null); + cashBookForm.populate(cashBookBean); + cashBookForm.setAction(SAVE_CASHBOOK); + cashBookForm.setReadOnly(false); + return mapping.findForward(EDIT_CASHBOOK); + } + + public static final String SAVE_CASHBOOK = "saveCashBook"; + public ActionForward saveCashBook(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException + { + return createCashBook(mapping, form, request, response); + } + + public static final String COPY_CASHBOOK = "copyCashBook"; + public ActionForward copyCashBook(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd = init(mapping,form,request,response); + if(fwd != null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + CashBookForm cashBookForm = (CashBookForm)form; + CashBookBean cashBookBean = (CashBookBean)cashBookForm.getBean(); + + populateData(request, null); + + cashBookBean = CashManager.getCashBook(ctx, cashBookBean.getCashBookId(), null); + cashBookBean.setCashBookId(0); + + cashBookForm.populate(cashBookBean); + cashBookForm.setAction(SAVE_CASHBOOK); + cashBookForm.setReadOnly(false); + + return mapping.findForward(COPY_CASHBOOK); + } + + + public static final String ACTIVATE_CASHBOOK = "activateCashBook"; + public ActionForward activateCashBook(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd = init(mapping,form,request,response); + if(fwd != null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + CashBookForm cashBookForm = (CashBookForm)form; + CashBookBean cashBookBean = (CashBookBean)cashBookForm.getBean(); + + Trx trx = Trx.get(Trx.createTrxName(), true); + trx.start(); + + try + { + CashManager.updateCashBookStatus(ctx, cashBookBean.getCashBookId(), true, trx.getTrxName()); + trx.commit(); + } + catch (Exception ex) + { + postGlobalError("error.operation", request); + } + finally + { + trx.rollback(); + trx.close(); + } + + searchCashBook(mapping, form, request, response); + + return mapping.findForward(SEARCH_CASHBOOK); + } + + + public static final String DEACTIVATE_CASHBOOK = "deactivateCashBook"; + public ActionForward deactivateCashBook(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd = init(mapping,form,request,response); + if(fwd != null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + CashBookForm cashBookForm = (CashBookForm)form; + CashBookBean cashBookBean = (CashBookBean)cashBookForm.getBean(); + + Trx trx = Trx.get(Trx.createTrxName(), true); + trx.start(); + + try + { + CashManager.updateCashBookStatus(ctx, cashBookBean.getCashBookId(), false, trx.getTrxName()); + trx.commit(); + } + catch (CashBookAlreadyAssignedException cashBookAlreadyAssignedException) + { + postGlobalError("error.deactivate.cashbook", request); + } + catch (Exception ex) + { + postGlobalError("error.operation", request); + } + finally + { + trx.rollback(); + trx.close(); + } + + searchCashBook(mapping, form, request, response); + + return mapping.findForward(SEARCH_CASHBOOK); + } +} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/CommissionAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/CommissionAction.java new file mode 100644 index 0000000000..80b0f8d5de --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/pos/CommissionAction.java @@ -0,0 +1,115 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Nov 7, 2006 + */ + + +package org.posterita.struts.pos; + +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.Properties; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.compiere.model.MCurrency; +import org.posterita.Constants; +import org.posterita.beans.CommissionBean; +import org.posterita.beans.ReportBean; +import org.posterita.businesslogic.POSTerminalManager; +import org.posterita.businesslogic.administration.CommissionManager; +import org.posterita.businesslogic.performanceanalysis.ReportDateManager; +import org.posterita.businesslogic.performanceanalysis.ReportManager; +import org.posterita.core.TmkJSPEnv; +import org.posterita.exceptions.ApplicationException; +import org.posterita.exceptions.OperationException; +import org.posterita.struts.core.DefaultForm; + + +public class CommissionAction extends POSDispatchAction +{ + + public static final String GENERATE_COMMISSION="generateCommission"; + public ActionForward generateCommission(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + DefaultForm df= (DefaultForm) form; + + ReportBean bean = (ReportBean) df.getBean(); + MCurrency currency = POSTerminalManager.getCurrencyOfTerminalCashBook(ctx); + request.setAttribute(Constants.CURRENCY_SYMBOLE,currency.getCurSymbol()); + + Timestamp fromdate = ReportDateManager.getFromDate(bean); + CommissionManager.generateCommission(ctx,fromdate); + ArrayList list=CommissionManager.getCommissionAmt(ctx); + String reportName = CommissionManager.getCommissionAmtAsCSV(ctx, list); + String reportURI = ReportManager.getReportURI(reportName, request); + + request.getSession().setAttribute(Constants.COMMISSION_AMT,list); + request.getSession().setAttribute(Constants.REPORT_URL, reportURI); + + return mapping.findForward(GENERATE_COMMISSION); + } + + public static final String VIEW_COMMISSION="viewCommission"; + public ActionForward viewCommission(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + ArrayList list=CommissionManager.getCommissionAmt(ctx); + String reportName = CommissionManager.getCommissionAmtAsCSV(ctx, list); + String reportURI = ReportManager.getReportURI(reportName, request); + + request.getSession().setAttribute(Constants.COMMISSION_AMT,list); + request.getSession().setAttribute(Constants.REPORT_URL, reportURI); + + return mapping.findForward(VIEW_COMMISSION); + } + + + public static final String VIEW_COMMISSION_DETAILS="viewCommissionDetails"; + public ActionForward viewCommissionDetails(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + DefaultForm df= (DefaultForm) form; + + CommissionBean bean = (CommissionBean) df.getBean(); + + ArrayList list=CommissionManager.getCommissionDetails(ctx,bean.getCommissionAmtId()); + request.getSession().setAttribute(Constants.COMMISSION_AMT_DETAILS,list); + + return mapping.findForward(VIEW_COMMISSION_DETAILS); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/CreditOrderAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/CreditOrderAction.java new file mode 100644 index 0000000000..76cc45b166 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/pos/CreditOrderAction.java @@ -0,0 +1,792 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Oct 13, 2006 + */ + + +package org.posterita.struts.pos; + +import java.io.IOException; +import java.io.PrintWriter; +import java.math.BigDecimal; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Properties; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.compiere.model.MCurrency; +import org.compiere.model.MInOut; +import org.compiere.model.MInvoice; +import org.compiere.model.MOrder; +import org.compiere.model.MPayment; +import org.compiere.util.Env; +import org.compiere.util.Trx; +import org.compiere.util.WebUser; +import org.posterita.Constants; +import org.posterita.beans.AgingBean; +import org.posterita.beans.BPartnerInfoBean; +import org.posterita.beans.DocumentHistoryBean; +import org.posterita.beans.LoginBean; +import org.posterita.beans.OpenItemBean; +import org.posterita.beans.OrderLineBean; +import org.posterita.beans.PaymentAllocationBean; +import org.posterita.beans.PaymentTypeBean; +import org.posterita.beans.ShoppingCartBean; +import org.posterita.beans.WebDocumentBean; +import org.posterita.businesslogic.LoginManager; +import org.posterita.businesslogic.MenuManager; +import org.posterita.businesslogic.OrderManager; +import org.posterita.businesslogic.OrderReferenceManager; +import org.posterita.businesslogic.POSBpartnerInfoManager; +import org.posterita.businesslogic.POSManager; +import org.posterita.businesslogic.POSTerminalManager; +import org.posterita.businesslogic.PaymentAllocationManager; +import org.posterita.businesslogic.PaymentManager; +import org.posterita.businesslogic.PaymentTermManager; +import org.posterita.businesslogic.administration.BPartnerManager; +import org.posterita.businesslogic.administration.RoleManager; +import org.posterita.businesslogic.creditsales.CreditOrderManager; +import org.posterita.core.SessionStorage; +import org.posterita.core.TmkJSPEnv; +import org.posterita.core.TrxPrefix; +import org.posterita.exceptions.ApplicationException; +import org.posterita.exceptions.BPartnerNotFoundException; +import org.posterita.exceptions.BPartnerOverCreditLimitException; +import org.posterita.exceptions.CanNotCreatePaymentAllocationException; +import org.posterita.exceptions.DiscountLimitException; +import org.posterita.exceptions.DuplicatePINException; +import org.posterita.exceptions.InsufficientQtyException; +import org.posterita.exceptions.InvalidAddressException; +import org.posterita.exceptions.InvalidPINException; +import org.posterita.exceptions.LimitPriceViolatedException; +import org.posterita.exceptions.MandatoryException; +import org.posterita.exceptions.NoAllocateeInvoiceException; +import org.posterita.exceptions.NoPaymentAmountException; +import org.posterita.exceptions.NotLoggedInException; +import org.posterita.exceptions.OperationException; +import org.posterita.exceptions.TooManyAllocateInvoiceException; +import org.posterita.exceptions.UserInactiveException; +import org.posterita.exceptions.UserNotFoundException; +import org.posterita.factory.POSMenuFactory; +import org.posterita.form.DocumentHistoryForm; +import org.posterita.form.OpenItemForm; +import org.posterita.struts.core.DefaultForm; + + +public class CreditOrderAction extends POSDispatchAction +{ + + + public static final String GET_BPARTNER_PAYMENT_STATUS="getBpartnerPaymentStatus"; + public ActionForward getBpartnerPaymentStatus(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx=TmkJSPEnv.getCtx(request); + DefaultForm df= (DefaultForm) form; + OpenItemBean bean=(OpenItemBean) df.getBean(); + boolean access=MenuManager.getRoleMenuAccess(ctx,POSMenuFactory.SMENU_SETTLE_PAYMENT_ID); + if(access==false) + { + postGlobalError("error.access.not.allowed",request); + return new ActionForward(bean.getForward()); + } + + ArrayList openItemList = null; + ArrayList agingList = null; + ArrayList paymentList = null; + try + { + openItemList=CreditOrderManager.getOpenItems(ctx,bean.getBpartnerId()); + agingList = CreditOrderManager.getAging(ctx,bean.getBpartnerId()); + paymentList = CreditOrderManager.getUnallocatedPayments(ctx,bean.getBpartnerId()); + + } + catch(BPartnerNotFoundException e) + { + postGlobalError("error.customer.not.exists",request); + return mapping.getInputForward(); + } + + + request.getSession().setAttribute(Constants.OPEN_ITEMS,openItemList); + request.getSession().setAttribute(Constants.AGING_ITEMS,agingList); + request.getSession().setAttribute(Constants.UNALLOCATED_PAYMENTS,paymentList); + return mapping.findForward(GET_BPARTNER_PAYMENT_STATUS); + } + + + public static final String MATCH_INVOICE = "matchInvoice"; + public ActionForward matchInvoice(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx=TmkJSPEnv.getCtx(request); + DefaultForm df= (DefaultForm) form; + OpenItemBean bean=(OpenItemBean) df.getBean(); + + Trx trx = Trx.get(TrxPrefix.getPrefix(),true); + try + { + trx.start(); + PaymentAllocationManager.allocate(ctx,bean.getInvoiceIds(),bean.getPaymentIds(),trx.getTrxName()); + trx.commit(); + } + + catch(TooManyAllocateInvoiceException e) + { + trx.rollback(); + postGlobalError("error.too.many.invoice",request); + return mapping.getInputForward(); + } + catch(CanNotCreatePaymentAllocationException e1) + { + trx.rollback(); + postGlobalError("error.allocation.amt.exceeds.openamt",request); + return mapping.getInputForward(); + } + catch(NoAllocateeInvoiceException e2) + { + trx.rollback(); + postGlobalError("error.no.invoice.to.allocate",request); + return mapping.getInputForward(); + } + finally + { + trx.close(); + } + + ArrayList openItemList=CreditOrderManager.getOpenItems(ctx,bean.getBpartnerId()); + ArrayList agingList = CreditOrderManager.getAging(ctx,bean.getBpartnerId()); + ArrayList paymentList = CreditOrderManager.getUnallocatedPayments(ctx,bean.getBpartnerId()); + + request.getSession().setAttribute(Constants.UNALLOCATED_PAYMENTS,paymentList); + request.getSession().setAttribute(Constants.OPEN_ITEMS,openItemList); + request.getSession().setAttribute(Constants.AGING_ITEMS,agingList); + + df.setInvoiceIds(null); + df.setPaymentIds(null); + + return mapping.findForward(MATCH_INVOICE); + } + + + public static final String INIT_GET_BPARTNER_PAYMENT_STATUS = "initGetBpartnerPaymentStatus"; + public ActionForward initGetBpartnerPaymentStatus(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx=TmkJSPEnv.getCtx(request); + + //DefaultForm df= (DefaultForm) form; + ArrayList list = POSBpartnerInfoManager.getPartnerInfo(ctx,true); + request.getSession().removeAttribute(Constants.UNALLOCATED_PAYMENTS); + request.getSession().removeAttribute(Constants.OPEN_ITEMS); + request.getSession().removeAttribute(Constants.AGING_ITEMS); + request.getSession().setAttribute(Constants.BUSINESSPARTNER,list); + return mapping.findForward(INIT_GET_BPARTNER_PAYMENT_STATUS); + } + + + public static final String INIT_CREATE_PAYMENT = "initCreatePayment"; + public ActionForward initCreatePayment(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + // Properties ctx=TmkJSPEnv.getCtx(request); + DefaultForm df= (DefaultForm) form; + OpenItemBean bean=(OpenItemBean) df.getBean(); + request.getSession().setAttribute(Constants.CREDIT_INVOICE_INFO,bean); + return mapping.findForward(INIT_CREATE_PAYMENT); + } + + public static final String CREATE_PAYMENT = "createPayment"; + public ActionForward createPayment(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx=TmkJSPEnv.getCtx(request); + DefaultForm df= (DefaultForm) form; + OpenItemBean bean=(OpenItemBean) df.getBean(); + Trx trx = Trx.get(TrxPrefix.getPrefix(),true); + PaymentTypeBean pBean =null; + + HashMap map = new HashMap(); + map.put("Cash",MPayment.TENDERTYPE_Cash); + map.put("Card",MPayment.TENDERTYPE_CreditCard); + map.put("Cheque",MPayment.TENDERTYPE_Check); + + bean.setTenderType(map.get(bean.getTrxType())); + + try + { + trx.start(); + + pBean = CreditOrderManager.createPayment(ctx,bean,trx.getTrxName()); + + MCurrency currency = POSTerminalManager.getCurrencyOfTerminalCashBook(ctx); + request.setAttribute(Constants.CURRENCY_SYMBOLE,currency.getCurSymbol()); + + trx.commit(); + if(!pBean.getPaymentType().equalsIgnoreCase("cash")) + { + MPayment payment = new MPayment(ctx,pBean.getId(),null); + PaymentManager.completePayment(ctx,payment); + request.getSession().removeAttribute(Constants.OPEN_ITEMS); + request.getSession().removeAttribute(Constants.AGING_ITEMS); + trx.close(); + return new ActionForward("/ViewWebstorePaymentAction.do?action=viewOrder&documentId="+payment.get_ID()); + } + } + catch(NoPaymentAmountException ex) + { + trx.rollback(); + postGlobalError("error.paymentamount.mandatory",request); + return mapping.getInputForward(); + } + catch(OperationException e) + { + trx.rollback(); + } + finally + { + trx.close(); + } + + request.getSession().removeAttribute(Constants.OPEN_ITEMS); + request.getSession().removeAttribute(Constants.AGING_ITEMS); + + + return new ActionForward("/ViewWebstoreCashPaymentAction.do?action=viewOrder&documentId="+pBean.getId()); + //return mapping.findForward(CREATE_PAYMENT); + } + + + public static final String GET_PAYMENT_DETAILS_FOR_INVOICE = "getPaymentDetailsForInvoice"; + public ActionForward getPaymentDetailsForInvoice(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx=TmkJSPEnv.getCtx(request); + DefaultForm df= (DefaultForm) form; + OpenItemBean bean=(OpenItemBean) df.getBean(); + ArrayList cashPaymentList = CreditOrderManager.getAllCashPaymentForInvoice(ctx,bean.getInvoiceId()); + ArrayList cardChqPaymentList=CreditOrderManager.getAllPaymentForInvoice(ctx,bean.getInvoiceId()); + request.getSession().setAttribute(Constants.CASH_PAYMENT_LIST,cashPaymentList); + request.getSession().setAttribute(Constants.CARD_CHQ_PAYMENT_LIST,cardChqPaymentList); + request.getSession().setAttribute(Constants.INVOICE_GRAND_TOTAL,bean.getPaidAmt()); + return mapping.findForward(GET_PAYMENT_DETAILS_FOR_INVOICE); + } + + + + + public static final String GET_CRDITORDER_DISC_DETAILS="getCreditOrderDiscDetails"; + public ActionForward getCreditOrderDiscDetails(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + + DefaultForm df= (DefaultForm) form; + OrderLineBean bean=(OrderLineBean) df.getBean(); + Properties ctx=TmkJSPEnv.getCtx(request); + Integer bPartnerId = bean.getBpartnerId(); + MOrder order=null; + String toBeShipped=bean.getToBeShipped(); + if(toBeShipped==null) + { + toBeShipped=(String)request.getSession().getAttribute(Constants.TO_BE_SHIPPED); + bean.setToBeShipped(toBeShipped); + } + if(toBeShipped==null) + { + toBeShipped="true"; + } + + if(bPartnerId==null) + { + postGlobalError("error.required.bpartnerId",request); + return mapping.getInputForward(); + } + if(BPartnerManager.isBPartnerPresent(ctx,bPartnerId,null) == false) + { + postGlobalError("error.customer.not.exists",request); + return mapping.getInputForward(); + } + + if(bean.getOrderId()!=null) + { + order = new MOrder(ctx, bean.getOrderId(), null); + } + + df.populate(new OrderLineBean()); + + ShoppingCartBean cartBean = (ShoppingCartBean) request.getSession().getAttribute(Constants.CREDIT_ORDER_SHOPPING_CART); + if(cartBean==null) + { + postGlobalError("error.pos.shoppingcart.empty",request); + return mapping.getInputForward(); + } + request.getSession().setAttribute(Constants.CREDIT_ORDER_SHOPPING_CART, cartBean); + request.getSession().setAttribute(Constants.PRESENT_CREDIT_ORDER,order); + request.getSession().setAttribute(Constants.CREDITORDER_BPARTNER,bPartnerId); + request.getSession().setAttribute(Constants.TO_BE_SHIPPED,bean.getToBeShipped()); + request.getSession().setAttribute(Constants.CREDIT_ORDER_SHOPPING_CART_ITEMS, cartBean.getItems()); + return mapping.findForward(GET_CRDITORDER_DISC_DETAILS); + } + + public static final String CREATE_CREDIT_ORDER="createCreditOrder"; + public ActionForward createCreditOrder(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx=TmkJSPEnv.getCtx(request); + DefaultForm df= (DefaultForm) form; + OrderLineBean bean=(OrderLineBean) df.getBean(); + + ShoppingCartBean cartBean = (ShoppingCartBean) request.getSession().getAttribute(Constants.SHOPPING_ORDER_CART); + + if(cartBean==null ||cartBean.getItems() == null||cartBean.getItems().size()==0) + { + postGlobalError("error.pos.shoppingcart.empty",request); + return mapping.getInputForward(); + } + + String toBeShipped=bean.getToBeShipped(); + if(toBeShipped==null) + { + toBeShipped=(String)request.getSession().getAttribute(Constants.TO_BE_SHIPPED); + bean.setToBeShipped(toBeShipped); + } + if(toBeShipped==null) + { + toBeShipped="true"; + } + + Integer bPartnerId = bean.getBpartnerId(); + if(bPartnerId==null) + { + bPartnerId = (Integer) request.getSession().getAttribute(Constants.CREDITORDER_BPARTNER); + bean.setBpartnerId(bPartnerId); + } + + if(bPartnerId==null) + { + postGlobalError("error.required.bpartnerId",request); + return mapping.getInputForward(); + } + + if(BPartnerManager.isBPartnerPresent(ctx,bean.getBpartnerId(),null) == false) + { + postGlobalError("error.customer.not.exists",request); + return mapping.getInputForward(); + } + + BigDecimal discountAllowed = (BigDecimal) request.getSession().getAttribute( Constants.DISCOUNT_ALLOWED ); + bean.setUserDiscount( discountAllowed ); + MOrder previousOrder= null; + previousOrder=(MOrder)request.getSession().getAttribute(Constants.PRESENT_CREDIT_ORDER); + + if(previousOrder!=null) + { + bean.setOrderId(Integer.valueOf(previousOrder.get_ID())); + } + else + { + bean.setOrderId(null); + } + + Trx trx = Trx.get(TrxPrefix.getPrefix(),true); + + MOrder creditOrder=null; + try + { + trx.start(); + creditOrder= CreditOrderManager.createCreditOrder(ctx,bean,cartBean.getItems(),trx.getTrxName()); + trx.commit(); + } + catch (DiscountLimitException e) + { + trx.rollback(); + postGlobalError("error.discountLimit.exceeded",request); + return mapping.getInputForward(); + } + catch(BPartnerOverCreditLimitException e1) + { + trx.rollback(); + postGlobalError("error.bpartner.over.credit.limit",e1.getMessage(),request); + return mapping.getInputForward(); + } + + catch(MandatoryException e2) + { + trx.rollback(); + postGlobalError("error.bpartner.no.payment.term",request); + return mapping.getInputForward(); + } + catch(InsufficientQtyException e3) + { + trx.rollback(); + postGlobalError("error.insufficient.qty",e3.getMessage(),request); + return mapping.getInputForward(); + } + catch(LimitPriceViolatedException e3) + { + trx.rollback(); + postGlobalError("error.limit.price.violated",e3.getMessage(),request); + return mapping.getInputForward(); + } + + catch(OperationException e) + { + trx.rollback(); + throw e; + } + finally + { + trx.close(); + request.getSession().removeAttribute( Constants.DISCOUNT_ALLOWED ); + } + bean.setOrderId(Integer.valueOf(creditOrder.get_ID())); + df.populate(new OrderLineBean()); + WebDocumentBean webBean =null; + try + { + webBean = OrderReferenceManager.getWebOrderBean(ctx, creditOrder); + } + catch(InvalidAddressException e) + { + postGlobalError("error.invalid.address",request); + return mapping.getInputForward(); + } + + ArrayList list = POSManager.populateOrderLines(ctx,creditOrder); + WebDocumentBean documentBean=POSManager.calculateOrderTotals(list); + request.getSession().setAttribute(Constants.CURRENT_POS_ORDER_ID,Integer.valueOf(creditOrder.get_ID())); + request.getSession().setAttribute(Constants.PRESENT_CREDIT_ORDER,creditOrder); + request.getSession().setAttribute(Constants.ORDER_LINE_BEAN,bean); + request.getSession().setAttribute(Constants.CREDITORDER_BPARTNER,bPartnerId); + request.setAttribute(Constants.POS_ORDER_LINES,list); + request.getSession().removeAttribute(Constants.PRESENT_CREDIT_ORDER); + request.getSession().removeAttribute(Constants.PRESENT_CREDIT_ORDER_ID); + SessionStorage.putCompleteOrderInfo(ctx,request,webBean,documentBean); + return mapping.findForward(CREATE_CREDIT_ORDER); + } + + + public static final String COMPLETE_CREDIT_ORDER="completeCreditOrder"; + public ActionForward completeCreditOrder(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx=TmkJSPEnv.getCtx(request); + DefaultForm df= (DefaultForm) form; + OrderLineBean b = (OrderLineBean) df.getBean(); + + OrderLineBean bean=(OrderLineBean) request.getSession().getAttribute(Constants.ORDER_LINE_BEAN); + bean.setAmountGiven(b.getAmountGiven()); + bean.setAmountRefunded(b.getAmountRefunded()); + + Integer orderId = (Integer) request.getSession().getAttribute(Constants.CURRENT_POS_ORDER_ID); + + if (orderId == null) + { + return mapping.getInputForward(); + } + MOrder completedCreditOrder=null; + + if(OrderManager.isOrderEmpty(ctx,orderId.intValue(),null)) + { + postGlobalError("error.pos.no.orderline",request); + request.getSession().removeAttribute(Constants.SHOPPING_CART); + request.getSession().removeAttribute(Constants.SHOPPING_CART_ITEMS); + + return mapping.getInputForward(); + } + + Trx trx = Trx.get(TrxPrefix.getPrefix(),true); + try + { + trx.start(); + completedCreditOrder=CreditOrderManager.completeCreditOrder(ctx,orderId.intValue(), trx.getTrxName()); + trx.commit(); + } + catch(BPartnerOverCreditLimitException e1) + { + trx.rollback(); + postGlobalError("error.bpartner.over.credit.limit",e1.getMessage(),request); + return mapping.getInputForward(); + } + catch(OperationException e2) + { + trx.rollback(); + throw e2; + } + finally + { + trx.close(); + } + + + df.populate(new OrderLineBean()); + WebDocumentBean webBean = OrderReferenceManager.getWebOrderBean(ctx, completedCreditOrder); + ArrayList list = POSManager.populateOrderLines(ctx,completedCreditOrder); + WebDocumentBean documentBean=POSManager.calculateOrderTotals(list); + request.getSession().setAttribute(Constants.CURRENT_POS_ORDER_ID,completedCreditOrder.get_ID()); + request.setAttribute(Constants.POS_ORDER_LINES,list); + SessionStorage.putCompleteOrderInfo(ctx,request,webBean,documentBean); + request.getSession().removeAttribute(Constants.ALL_CUSTOMERS); + request.getSession().removeAttribute(Constants.SHOPPING_CART); + request.getSession().removeAttribute(Constants.SHOPPING_CART_ITEMS); + request.getSession().removeAttribute(Constants.CURRENT_POS_ORDER_ID); + request.getSession().removeAttribute(Constants.CREDITORDER_BPARTNER); + request.getSession().removeAttribute(Constants.SHIPMENT_REQUIRED); + request.getSession().removeAttribute(Constants.TO_BE_SHIPPED); + // String reportName = POSReportManager.getInvoicePDFReport(ctx,completedCreditOrder.getC_Invoice_ID(),null); + // String reportURI = ReportManager.getReportURI(reportName,request); + //request.getSession().setAttribute(Constants.REPORT_URL,reportURI); + return mapping.findForward(COMPLETE_CREDIT_ORDER); + } + + public ActionForward validateAdvanceOrderPIN(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws IOException, OperationException + { + Properties ctx=TmkJSPEnv.getCtx(request); + + DefaultForm df = (DefaultForm) form; + String userPIN = df.getUserPIN(); + + LoginBean bean = null; + LoginManager loginManager = new LoginManager(); + String script = null; + + try + { + bean = loginManager.getUserNameFromPIN(ctx, userPIN); + WebUser wu = loginManager.checkLoginPassword(ctx, bean); + + int roleId = Env.getAD_Role_ID(ctx); + + BigDecimal discountAllowed = RoleManager.getDiscountAllowed(ctx, roleId, null); + + if(discountAllowed != Env.ZERO) + { + script = "setAction(document.forms[0],'GetCreditOrderDiscDetailsAction.do','getCreditOrderDiscDetails');" + + "disableButtons();"; + + request.getSession().setAttribute(Constants.DISCOUNT_ALLOWED, discountAllowed); + } + else + { + script = "PINError('It seems that you are not authorised to give discounts.');"; + } + } + catch (DuplicatePINException e) + { + script = "PINError('It seems that you are not authorised to give discounts.');"; + } + catch (InvalidPINException e) + { + script = "PINError('It seems that you are not authorised to give discounts.');"; + } + catch (UserNotFoundException e) + { + + } + catch (UserInactiveException e) + { + + } + catch (NotLoggedInException e) + { + + } + catch (SQLException e) + { + throw new OperationException(e); + } + catch (OperationException e) + { + throw new OperationException(e); + } + + PrintWriter writer = response.getWriter(); + writer.print( script ); + writer.flush(); + writer.close(); + + return null; + } + + + public static final String GET_ALLOCATION_DETAILS_FOR_PARTNER = "getAllocationDetailsForPartner"; + public ActionForward getAllocationDetailsForPartner(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx=TmkJSPEnv.getCtx(request); + DefaultForm df= (DefaultForm) form; + PaymentAllocationBean bean=(PaymentAllocationBean) df.getBean(); + ArrayList allocationList = CreditOrderManager.viewAllocation(ctx,bean.getPartnerName(),bean.getInvoiceNo(),bean.getIsCustomer(),bean.getIsVendor()); + request.getSession().setAttribute(Constants.PAYMENT_ALLOCATIONS,allocationList); + return mapping.findForward(GET_ALLOCATION_DETAILS_FOR_PARTNER); + } + + public static final String INIT_CREATE_CREDIT_ORDER = "initCreateCreditOrder"; + public ActionForward initCreateCreditOrder(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx=TmkJSPEnv.getCtx(request); + + ArrayList list = PaymentTermManager.getAllActivePaymentTerm(ctx); + request.getSession().setAttribute (Constants.PAYMENT_TERM,list); + return mapping.findForward(INIT_CREATE_CREDIT_ORDER); + } + + + public static final String CREATE_SHIPMENT_CREDIT_ORDER = "createShipmentForCreditOrder"; + public ActionForward createShipmentForCreditOrder(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx=TmkJSPEnv.getCtx(request); + DocumentHistoryForm dhf = (DocumentHistoryForm) form; + DocumentHistoryBean bean = (DocumentHistoryBean) dhf.getBean(); + MInOut shipment=CreditOrderManager.createAndCompleteShipment(ctx,bean.getInvoiceId()); + return new ActionForward("/ViewMinOutAction.do?action=viewOrder&documentId="+shipment.get_ID()); + } + + + + public static final String GET_MULTIPLE_INVOICE_FOR_PAYMENT = "getMultipleInvoicesForPayment"; + public ActionForward getMultipleInvoicesForPayment(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx=TmkJSPEnv.getCtx(request); + OpenItemForm oif= (OpenItemForm) form; + OpenItemBean bean=(OpenItemBean) oif.getBean(); + ArrayList list=null; + try + { + list= PaymentAllocationManager.getInvoiceToAllocate(ctx,bean.getInvoiceIds(),null); + } + catch(NoAllocateeInvoiceException e2) + { + postGlobalError("error.no.invoice.to.allocate",request); + return mapping.getInputForward(); + } + request.getSession().setAttribute (Constants.INVOICE_FOR_ALLOCATION,list); + return mapping.findForward(GET_MULTIPLE_INVOICE_FOR_PAYMENT); + } + + //---------------------------------------------------------------------------------------------- + // Methods related to purchasing + public static final String INIT_GET_CREDITOR_PAYMENT_STATUS = "initGetCreditorPaymentStatus"; + public ActionForward initGetCreditorPaymentStatus(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx=TmkJSPEnv.getCtx(request); + + //DefaultForm df= (DefaultForm) form; + ArrayList list = POSBpartnerInfoManager.getPartnerInfo(ctx,true); + request.getSession().removeAttribute(Constants.UNALLOCATED_PAYMENTS); + request.getSession().removeAttribute(Constants.OPEN_ITEMS); + request.getSession().removeAttribute(Constants.AGING_ITEMS); + request.getSession().setAttribute(Constants.BUSINESSPARTNER,list); + return mapping.findForward(INIT_GET_CREDITOR_PAYMENT_STATUS); + } + + public static final String GET_CREDITOR_PAYMENT_STATUS = "getCreditorPaymentStatus"; + public ActionForward getCreditorPaymentStatus(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx=TmkJSPEnv.getCtx(request); + DefaultForm df= (DefaultForm) form; + OpenItemBean bean=(OpenItemBean) df.getBean(); + boolean access=MenuManager.getRoleMenuAccess(ctx,POSMenuFactory.SMENU_SETTLE_GRN_PAYMENT_ID); + if(access==false) + { + postGlobalError("error.access.not.allowed",request); + return new ActionForward(bean.getForward()); + } + + ArrayList openItemList = null; + ArrayList agingList = null; + ArrayList paymentList = null; + + try + { + openItemList = CreditOrderManager.getOpenItems(ctx,bean.getBpartnerId()); + agingList = CreditOrderManager.getAging(ctx,bean.getBpartnerId()); + paymentList = CreditOrderManager.getUnallocatedPayments(ctx,bean.getBpartnerId()); + + } + catch(BPartnerNotFoundException e) + { + postGlobalError("error.vendor.not.exists",request); + mapping.findForward(GET_CREDITOR_PAYMENT_STATUS); + } + + + request.getSession().setAttribute(Constants.OPEN_ITEMS,openItemList); + request.getSession().setAttribute(Constants.AGING_ITEMS,agingList); + request.getSession().setAttribute(Constants.UNALLOCATED_PAYMENTS,paymentList); + + return mapping.findForward(GET_CREDITOR_PAYMENT_STATUS); + } +} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/CurrencyAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/CurrencyAction.java new file mode 100644 index 0000000000..d49d18fae5 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/pos/CurrencyAction.java @@ -0,0 +1,268 @@ +package org.posterita.struts.pos; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.Properties; +import java.util.logging.Level; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.compiere.model.MCurrency; +import org.compiere.util.CLogger; +import org.compiere.util.Trx; +import org.posterita.Constants; +import org.posterita.beans.CurrencyBean; +import org.posterita.core.TmkJSPEnv; +import org.posterita.core.TrxPrefix; +import org.posterita.exceptions.ApplicationException; +import org.posterita.exceptions.OperationException; +import org.posterita.form.CurrencyForm; +import org.posterita.struts.core.BaseDispatchAction; +import org.posterita.util.PoManager; + +public class CurrencyAction extends BaseDispatchAction +{ + private static CLogger logger = CLogger.getCLogger(CurrencyAction.class); + + public static final String VIEW_CURRENCY = "viewCurrency"; + public ActionForward updateCurrency(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd = init(mapping, form, request, response); + + if (fwd != null) + { + return fwd; + } + + CurrencyForm currencyForm = (CurrencyForm) form; + CurrencyBean currencyBean = (CurrencyBean) currencyForm.getBean(); + + Properties ctx = TmkJSPEnv.getCtx(request); + Trx trx = Trx.get(TrxPrefix.getPrefix(),true); + + try + { + trx.start(); + if((currencyBean.getCurrencyId() != 0) && (currencyBean.getCurrencyId() != null)) + { + MCurrency currency = MCurrency.get(ctx, currencyBean.getCurrencyId()); + + if(currencyBean.getRoundOffFactor().doubleValue() < 0) + { + postGlobalError("error.round.off.cannot.be.negative", request); + return mapping.getInputForward(); + } + + currency.setRoundOffFactor(currencyBean.getRoundOffFactor()); + currency.setStdPrecision(currencyBean.getStdPrecision()); + currency.setIsActive(currencyBean.getIsActive()); + PoManager.save(currency); + } + trx.commit(); + //postGlobalMessage("success.currency.updated.successfully", request); + } + + catch(OperationException e) + { + trx.rollback(); + logger.log(Level.SEVERE, e.getMessage()); + postGlobalError("error.process", e.getMessage(), request); + } + + finally + { + trx.close(); + } + + request.getSession().removeAttribute(Constants.CURRENCY_LIST); + request.getSession().setAttribute(Constants.CURRENCY, currencyBean); + return mapping.getInputForward(); + } + + + public static final String LIST_CURRENCIES = "listCurrencies"; + public ActionForward listCurrencies(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd = init(mapping, form, request, response); + + if (fwd != null) + { + return fwd; + } + + CurrencyForm currencyForm = (CurrencyForm) form; + CurrencyBean currencyBean = (CurrencyBean) currencyForm.getBean(); + + Properties ctx = TmkJSPEnv.getCtx(request); + Trx trx = Trx.get(TrxPrefix.getPrefix(),true); + ArrayList list = new ArrayList(); + list = getAllCurrencies(ctx, currencyBean.getIsoCode(), trx.getTrxName()); + + request.getSession().setAttribute(Constants.CURRENCY_LIST, list); + return mapping.findForward(LIST_CURRENCIES); + + } + + public static final String UPDATE_CURRENCY = "updateCurrency"; + public ActionForward viewCurrency(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException, IOException + { + ActionForward fwd = init(mapping, form, request, response); + + if (fwd != null) + { + return fwd; + } + + Properties ctx = TmkJSPEnv.getCtx(request); + Trx trx = Trx.get(TrxPrefix.getPrefix(),true); + Integer currencyId = Integer.valueOf(request.getParameter("currencyId")); + String next =request.getParameter("isNext"); + Boolean isNext= null; + if ("true".equals(next)) + { + isNext = true; + } + else if ("false".equals(next)) + { + isNext = false; + } + + CurrencyForm currencyForm = (CurrencyForm)form; + + ArrayList list = (ArrayList) request.getSession().getAttribute(Constants.CURRENCY_LIST); + + CurrencyBean currencyBean = new CurrencyBean(); + currencyBean = getCurrencyBean(ctx, list, currencyId, isNext, trx.getTrxName()); + currencyForm.populate(currencyBean); + + request.getSession().setAttribute(Constants.CURRENCY, currencyBean); + + return mapping.findForward(UPDATE_CURRENCY); + } + + /** + * Retrieves all currencies or search for currency by ISO_Code + * @param ctx Context + * @param isoCode Currency ISO Code. Search for currency by ISO Code + * @param trxName Transaction Name + * @return ArrayList of type CurrencyBean + */ + public ArrayList getAllCurrencies(Properties ctx, String isoCode, String trxName) + { + String whereClause = "C_Currency_Id IS NOT NULL ORDER BY ISO_CODE"; + + if(isoCode != null) + { + whereClause = "ISO_CODE = '" + isoCode.toUpperCase() + "'"; + } + + int[] currencyIds = MCurrency.getAllIDs(MCurrency.Table_Name, whereClause, null); + + ArrayList list = new ArrayList(); + + if((currencyIds == null) || (currencyIds.length == 0)) + { + return list; + } + + for(int id : currencyIds) + { + CurrencyBean currencyBean = new CurrencyBean(); + MCurrency currency = new MCurrency(ctx, id, trxName ); + currencyBean.setCurrencyId(currency.getC_Currency_ID()); + currencyBean.setIsActive(currency.isActive()); + currencyBean.setIsoCode(currency.getISO_Code()); + currencyBean.setCurSymbol(currency.getCurSymbol()); + currencyBean.setRoundOffFactor(currency.getRoundOffFactor()); + currencyBean.setStdPrecision(currency.getStdPrecision()); + currencyBean.setDescription(currency.getDescription()); + + list.add(currencyBean); + } + + return list; + } + + /** + * Get a specific currencyBean from an ArrayList of CurrencyBean + * @param ctx Context + * @param list Arraylist of type CurrencyBean + * @param currencyId + * @param isNext used to keep track of next CurrencyBean relative to bean having currencyId + * @return CurrencyBean + * @throws OperationException + */ + public static CurrencyBean getCurrencyBean(Properties ctx, + ArrayList list, Integer currencyId, Boolean isNext, String trxName) throws OperationException + { + int index = -1; + + if (currencyId == null || currencyId == 0) + { + return new CurrencyBean(); + } + else + { + if (list != null) + { + Iterator iter = list.iterator(); + + while (iter.hasNext()) + { + CurrencyBean currBean = iter.next(); + if (currBean.getCurrencyId().equals(currencyId)) + { + index = list.indexOf(currBean); + } + } + if (index != -1) + { + if (isNext!=null) + { + if (isNext) + { + int nextIndex = (index + 1)%list.size(); + index = nextIndex; + } + else + { + int previousIndex = (index-1)%list.size(); + if (previousIndex < 0) + { + previousIndex += list.size(); + } + index = previousIndex; + } + } + return list.get(index); + } + else + { + throw new OperationException("no currency not found in search list"); + } + } + else + { + return getCurrencyBean(ctx, currencyId, trxName); + } + } + } + + + public static CurrencyBean getCurrencyBean(Properties ctx, Integer currencyId, String trxName) + { + CurrencyBean currencyBean = new CurrencyBean(); + MCurrency currency = MCurrency.get(ctx, currencyId); + currencyBean.setCurrencyId(currency.getC_Currency_ID()); + currencyBean.setIsActive(currency.isActive()); + currencyBean.setCurSymbol(currency.getCurSymbol()); + currencyBean.setIsoCode(currency.getISO_Code()); + currencyBean.setStdPrecision(currency.getStdPrecision()); + currencyBean.setRoundOffFactor(currency.getRoundOffFactor()); + + return currencyBean; + } +} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/CustomPOSReportAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/CustomPOSReportAction.java new file mode 100644 index 0000000000..e62690903e --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/pos/CustomPOSReportAction.java @@ -0,0 +1,361 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * 24-Jul-2006 15:53:04 by praveen + * + */ + +package org.posterita.struts.pos; + +import java.sql.Timestamp; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.Properties; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.apache.struts.action.ActionMessage; +import org.apache.struts.action.ActionMessages; +import org.compiere.model.MAttribute; +import org.compiere.model.MAttributeSet; +import org.compiere.model.MElementValue; +import org.compiere.util.Env; +import org.posterita.Constants; +import org.posterita.beans.ReportBean; +import org.posterita.businesslogic.performanceanalysis.CSVReportManager; +import org.posterita.businesslogic.performanceanalysis.CustomPOSReportManager; +import org.posterita.businesslogic.performanceanalysis.ReportDateManager; +import org.posterita.businesslogic.performanceanalysis.ReportManager; +import org.posterita.core.BarChart; +import org.posterita.core.PieChart; +import org.posterita.core.RandomStringGenerator; +import org.posterita.core.SessionStorage; +import org.posterita.core.TabularReport; +import org.posterita.core.TimeSeriesChart; +import org.posterita.core.TimestampConvertor; +import org.posterita.core.TmkJSPEnv; +import org.posterita.exceptions.ApplicationException; +import org.posterita.exceptions.OperationException; +import org.posterita.form.SalesReportForm; + +public class CustomPOSReportAction extends POSDispatchAction +{ + public static final String INIT_CUSTOM_REPORT = "initCustomReport"; + public ActionForward initCustomReport(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + SalesReportForm reportForm = (SalesReportForm) form; + + //setting defaults + String chartType = PieChart.CHART_TYPE; + String accountId = "41000"; + String timePeriod = ReportDateManager.TODAY; + String salesGroup = Constants.REVENUE_RECOGNITION; + String dateRange = Constants.FIXED_DATE_RANGE; + + reportForm.setChartType(chartType); + reportForm.setAccountId(accountId); + reportForm.setTimePeriod(timePeriod); + reportForm.setSalesGroup(salesGroup); + reportForm.setDateRange(dateRange); + reportForm.setFromDate(""); + reportForm.setToDate(""); + + reportForm.validate(mapping,request); + + ReportBean reportBean = (ReportBean) reportForm.getBean(); + + SessionStorage.putSalesGroupFilter(ctx,request,reportBean); + + return mapping.findForward(INIT_CUSTOM_REPORT); + } + + + public static final String GET_CUSTOM_REPORT = "getCustomReport"; + public ActionForward getCustomReport(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + SalesReportForm reportForm = (SalesReportForm) form; + ReportBean bean = (ReportBean) reportForm.getBean(); + + //validate form + ActionMessages messages = validate(form); + if(!messages.isEmpty()) + { + saveErrors(request, messages); + return mapping.getInputForward(); + } + + final Integer TAX_DUE = Constants.TAX_DUE; + final Integer TAX_CREDIT = Constants.TAX_CREDIT; + final Integer PROFIT_MARGIN = Constants.PROFIT_MARGIN; + + Timestamp fromDate = null; + Timestamp toDate = null; + String dateRange = bean.getDateRange(); + String timePeriod = bean.getTimePeriod(); + String chartType = bean.getChartType(); + String salesGroup = bean.getSalesGroup(); + String priceQtyFilter = bean.getPriceQtyFilter(); + Integer account_id = bean.getAccountId(); + + String filename = RandomStringGenerator.randomstring(); + String reportPath = ReportManager.getReportPath(filename); + + String title = ""; + String subtitle = ""; + int height = 600; + int width = 700; + + //setting from and to dates + if(dateRange.endsWith(Constants.FIXED_DATE_RANGE)) + { + if(timePeriod == null) + { + throw new OperationException("Invalid Parameter for timePeriod. TimePeriod is null"); + } + + fromDate = ReportDateManager.getStartDateForPeriod(timePeriod); + toDate = ReportDateManager.getEndDateForPeriod(timePeriod); + + subtitle = "For " + timePeriod; + } + else if(dateRange.endsWith(Constants.CUSTOM_DATE_RANGE)) + { + fromDate = ReportDateManager.getFromDate(bean); + toDate = ReportDateManager.getToDate(bean); + + subtitle = "For period:"+fromDate+" to "+toDate; + } + else + { + throw new OperationException("Invalid Parameter for dateRange :" + dateRange); + } + + //setting title + String str = null; + boolean isProfitMargin = (account_id.equals( PROFIT_MARGIN )); + + if(isProfitMargin) + { + str = "Profit Margin"; + } + else + { + int[] ids = MElementValue.getAllIDs(MElementValue.Table_Name,"AD_CLIENT_ID ="+ Env.getAD_Client_ID(ctx) + " AND VALUE ='"+ account_id + "'",null); + + if(ids==null || ids.length==0) + { + throw new OperationException("Unable to resolve account type!"); + } + else + { + MElementValue elementValue = new MElementValue(ctx,ids[0],null); + str = elementValue.getName(); + }//else + }//else + + + + boolean isTaxDue = (account_id.equals( TAX_DUE )); + boolean isTaxCredit = (account_id.equals( TAX_CREDIT )); + + if(isTaxCredit || isTaxDue) + { + title = str; + } + else + { + title = str + " by "; + + if( + salesGroup.equalsIgnoreCase(Constants.REVENUE_RECOGNITION)|| + salesGroup.equalsIgnoreCase(Constants.ATTRIBUTESET) || + salesGroup.equalsIgnoreCase(Constants.PRODUCT) || + salesGroup.equalsIgnoreCase(Constants.GROUP1) || + salesGroup.equalsIgnoreCase(Constants.GROUP2) || + salesGroup.equalsIgnoreCase(Constants.CUSTOMER) + ) + { + title = title + salesGroup; + } + else + { + String[] s = salesGroup.split("_"); + + if(s.length!=2) + { + throw new OperationException("Cannot generate sql. Unknown salesGroup parameter:"+salesGroup); + } + + int attributeSetId = Integer.parseInt(s[0]); + int attributeId = Integer.parseInt(s[1]); + + String attributeSetName = null; + String attributeName = null; + + attributeSetName = MAttributeSet.get(ctx,attributeSetId).getName(); + attributeName = new MAttribute(ctx,attributeId,null).getName(); + + title = title + attributeName + " For " + attributeSetName; + + }//else + + }//else + + + //drawing chart + if(chartType.equals(PieChart.CHART_TYPE)) + { + PieChart pieChart = CustomPOSReportManager.generatePieChart(ctx,title,subtitle,account_id.intValue(), fromDate, toDate, salesGroup,priceQtyFilter); + pieChart.saveChartAsJPEG(reportPath+".jpg",width,height); + } + else if(chartType.equals(BarChart.CHART_TYPE)) + { + BarChart barChart = CustomPOSReportManager.generateBarChart(ctx,title,subtitle,account_id.intValue(), fromDate, toDate,salesGroup,priceQtyFilter); + barChart.saveChartAsJPEG(reportPath+".jpg",width,height); + } + else if(chartType.equals(TimeSeriesChart.CHART_TYPE)) + { + //draw timeseries + TimeSeriesChart timeSeriesChart = CustomPOSReportManager.generateTimeSeriesChart(ctx,title,subtitle,account_id.intValue(), fromDate, toDate,salesGroup,priceQtyFilter); + timeSeriesChart.saveChartAsJPEG(reportPath+".jpg",width,height); + } + else if(chartType.equals("Tabular")) + { + //constructing the table + TabularReport tReport = CustomPOSReportManager.generateTabularReport( ctx, title, subtitle, account_id.intValue(), fromDate, toDate, salesGroup, priceQtyFilter ); + + String csvReport = CSVReportManager.generateCSVReport(ctx,tReport.getReportData()); + String csvURI = ReportManager.getReportURI(csvReport,request); + + request.getSession().removeAttribute(Constants.REPORT_URL); + request.getSession().setAttribute(Constants.TABULAR_REPORT_DATA,tReport.toString()); + request.getSession().setAttribute(Constants.CSV_FILE,csvURI); + request.getSession().setAttribute(Constants.DISPLAY_REPORT,""); + + //------------------------------------------------------------------------------------------------------------------- + tReport = CustomPOSReportManager.generateTabularReportGroupByDate(ctx,title,subtitle,account_id.intValue(), fromDate, toDate,salesGroup,priceQtyFilter); + csvReport = CSVReportManager.generateCSVReport(ctx,tReport.getReportData()); + csvURI = ReportManager.getReportURI(csvReport,request); + + request.getSession().removeAttribute(Constants.REPORT_URL); + request.getSession().setAttribute(Constants.TABULAR_REPORT_DATA2,tReport.toString()); + request.getSession().setAttribute(Constants.CSV_FILE2,csvURI); + request.getSession().setAttribute(Constants.DISPLAY_REPORT,""); + + return mapping.findForward(GET_CUSTOM_REPORT); + + + } + else + { + throw new OperationException("Invalid Chart type:" + chartType); + } + + String imgURL = ReportManager.getReportURI(filename+".jpg",request); + + request.getSession().setAttribute(Constants.REPORT_URL,imgURL); + request.getSession().removeAttribute(Constants.TABULAR_REPORT_DATA); + request.getSession().setAttribute(Constants.DISPLAY_REPORT,""); + + + + return mapping.findForward(GET_CUSTOM_REPORT); + } + + + //---------------------------------------------------------------------------------------------------- + public static ActionMessages validate(ActionForm form) throws OperationException, ApplicationException + { + ActionMessages messages = new ActionMessages(); + ActionMessage message = null; + boolean error = false; + + SalesReportForm reportForm = (SalesReportForm) form; + ReportBean bean = (ReportBean) reportForm.getBean(); + + String fromDate = bean.getFromDate(); + String toDate = bean.getToDate(); + String dateRange = bean.getDateRange(); + String timePeriod = bean.getTimePeriod(); + + + if(dateRange.endsWith(Constants.FIXED_DATE_RANGE)) + { + if(timePeriod == null) + { + throw new OperationException("Invalid Parameter for timePeriod. Time Period is null."); + } + } + else if(dateRange.endsWith(Constants.CUSTOM_DATE_RANGE)) + { + + if((fromDate == null)||(fromDate == "")) + { + message = new ActionMessage("error.required.fromDate"); + messages.add(ActionMessages.GLOBAL_MESSAGE, message); + error = true; + } + + if((toDate == null)||(toDate == "")) + { + message = new ActionMessage("error.required.toDate"); + messages.add(ActionMessages.GLOBAL_MESSAGE, message); + error = true; + } + + if(!error) + { + + + Timestamp date1 = ReportDateManager.getFromDate(bean); + Timestamp date2 = ReportDateManager.getToDate(bean); + + if(date2.getTime()<= date1.getTime()) + { + message = new ActionMessage("error.invalid.period"); + messages.add(ActionMessages.GLOBAL_MESSAGE, message); + error = true; + } + } + } + else + { + throw new OperationException("Invalid Parameter for dateRange :" + dateRange); + } + + return messages; + + } + + +} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/CustomerReturnOrderAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/CustomerReturnOrderAction.java new file mode 100644 index 0000000000..518e4480cf --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/pos/CustomerReturnOrderAction.java @@ -0,0 +1,78 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * 22-Sep-2006 11:43:05 by praveen + * + */ + +package org.posterita.struts.pos; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; + +import org.posterita.exceptions.ApplicationException; + +public class CustomerReturnOrderAction extends POSDispatchAction +{ + public static final String CREATE_CUSTOMER_RETURN_ORDER = "createCustomerReturnOrder"; + public static final String ADD_TO_SHOPPING_CART = "addToShoppingCart"; + public static final String INCREMENT_QTY = "incrementQty"; + public static final String DECREMENT_QTY = "decrementQty"; + public static final String DELETE_ORDERLINE = "deleteOrderline"; + + public ActionForward addToShoppingCart(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + return mapping.findForward(ADD_TO_SHOPPING_CART); + } + + public ActionForward incrementQty(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + return mapping.findForward(INCREMENT_QTY); + } + + public ActionForward decrementQty(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + return mapping.findForward(DECREMENT_QTY); + } + + public ActionForward deleteOrderline(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + return mapping.findForward(DELETE_ORDERLINE); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/DocumentAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/DocumentAction.java new file mode 100644 index 0000000000..960702ae48 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/pos/DocumentAction.java @@ -0,0 +1,292 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +* +* Created on Oct 17, 2006 by ashley +* +*/ + +/** + @author ashley + */ + +package org.posterita.struts.pos; + +import java.io.File; +import java.io.IOException; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.text.ParseException; +import java.util.ArrayList; +import java.util.Properties; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.compiere.model.MInventory; +import org.compiere.print.ReportEngine; +import org.compiere.util.DB; +import org.compiere.util.Env; +import org.compiere.utils.DBUtils; +import org.posterita.Constants; +import org.posterita.beans.DocumentBean; +import org.posterita.beans.InventoryBean; +import org.posterita.businesslogic.stock.InventoryManager; +import org.posterita.businesslogic.performanceanalysis.ReportManager; +import org.posterita.core.RandomStringGenerator; +import org.posterita.core.TabularReport; +import org.posterita.core.TmkJSPEnv; +import org.posterita.exceptions.ApplicationException; +import org.posterita.exceptions.OperationException; +import org.posterita.form.InventoryForm; +import org.posterita.struts.core.DefaultForm; + +import com.lowagie.text.DocumentException; + +public class DocumentAction extends POSDispatchAction +{ + public static final String VIEW_ORDER_DOCUMENT_PDF = "viewOrderDocumentPDF"; + public ActionForward viewOrderDocumentPDF(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + DefaultForm df= (DefaultForm) form; + + DocumentBean bean = (DocumentBean) df.getBean(); + String reportName = RandomStringGenerator.randomstring() + ".pdf"; + String reportPath = ReportManager.getReportPath(reportName); + + ReportEngine reportEngine = ReportEngine.get(ctx, ReportEngine.ORDER, bean.getDocumentId().intValue()); + reportEngine.createPDF(new File(reportPath)); + + String reportURI = ReportManager.getReportURI(reportPath,request); + request.setAttribute(Constants.DOCUMENT_PDF, reportURI); + + return mapping.findForward(VIEW_ORDER_DOCUMENT_PDF); + } + + public static final String VIEW_INVOICE_DOCUMENT_PDF = "viewInvoiceDocumentPDF"; + public ActionForward viewInvoiceDocumentPDF(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + DefaultForm df= (DefaultForm) form; + + DocumentBean bean = (DocumentBean) df.getBean(); + String reportName = RandomStringGenerator.randomstring() + ".pdf"; + String reportPath = ReportManager.getReportPath(reportName); + + ReportEngine reportEngine = ReportEngine.get(ctx, ReportEngine.INVOICE, bean.getDocumentId().intValue()); + reportEngine.createPDF(new File(reportPath)); + + String reportURI = ReportManager.getReportURI(reportPath,request); + request.setAttribute(Constants.DOCUMENT_PDF, reportURI); + + return mapping.findForward(VIEW_INVOICE_DOCUMENT_PDF); + } + + public static final String VIEW_SHIPMENT_DOCUMENT_PDF = "viewShipmentDocumentPDF"; + public ActionForward viewShipmentDocumentPDF(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + DefaultForm df= (DefaultForm) form; + + DocumentBean bean = (DocumentBean) df.getBean(); + String reportName = RandomStringGenerator.randomstring() + ".pdf"; + String reportPath = ReportManager.getReportPath(reportName); + + ReportEngine reportEngine = ReportEngine.get(ctx, ReportEngine.SHIPMENT, bean.getDocumentId().intValue()); + reportEngine.createPDF(new File(reportPath)); + + String reportURI = ReportManager.getReportURI(reportPath,request); + request.setAttribute(Constants.DOCUMENT_PDF, reportURI); + + return mapping.findForward(VIEW_SHIPMENT_DOCUMENT_PDF); + } + + public static String VIEW_PAYMENT_DOCUMENT_PDF = "viewPaymentDocumentPDF"; + public ActionForward viewPaymentDocumentPDF(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + DefaultForm df= (DefaultForm) form; + + DocumentBean bean = (DocumentBean) df.getBean(); + String reportName = RandomStringGenerator.randomstring() + ".pdf"; + String reportPath = ReportManager.getReportPath(reportName); + + ReportEngine reportEngine = ReportEngine.get(ctx, ReportEngine.REMITTANCE, bean.getDocumentId().intValue()); + reportEngine.createPDF(new File(reportPath)); + + String reportURI = ReportManager.getReportURI(reportPath,request); + request.setAttribute(Constants.DOCUMENT_PDF, reportURI); + + return mapping.findForward(VIEW_SHIPMENT_DOCUMENT_PDF); + } + + + + +/* public static String VIEW_PAYMENT_DOCUMENT_PDF = "viewPaymentDocumentPDF"; + public ActionForward viewPaymentDocumentPDF(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + DefaultForm df= (DefaultForm) form; + + DocumentBean bean = (DocumentBean) df.getBean(); + + String pdfPath = POSReportManager.getPaymentPDFReport(ctx, bean.getDocumentId(), null); + pdfPath = ReportManager.getReportURI(pdfPath,request); + + request.setAttribute(Constants.DOCUMENT_PDF, pdfPath); + + return mapping.findForward(VIEW_PAYMENT_DOCUMENT_PDF); + } +*/ + + /*public static String VIEW_INVOICEFROMORDER_DOCUMENT_PDF = "viewInvoiceFromOrderDocumentPDF"; + public ActionForward viewInvoiceFromOrderDocumentPDF(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + DefaultForm df= (DefaultForm) form; + + DocumentBean bean = (DocumentBean) df.getBean(); + + String pdfPath = POSReportManager.getInvoiceFromOrderPDFReport(ctx, bean.getDocumentId(), null); + pdfPath = ReportManager.getReportURI(pdfPath,request); + + request.setAttribute(Constants.DOCUMENT_PDF, pdfPath); + + return mapping.findForward(VIEW_INVOICEFROMORDER_DOCUMENT_PDF); + }*/ + + /*========================================================================*/ + + public static final String VIEW_INVENTORY_DOCUMENT_PDF = "viewInventoryDocumentPDF"; + + /** + * Generate Inventory Document after Inventory count + * @param mapping + * @param form + * @param request + * @param response + * @throws ApplicationException + * @throws OperationException + * @throws DocumentException + * @throws IOException + * @return + * @throws SQLException + * @throws ParseException + */ + + public ActionForward viewInventoryDocumentPDF(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException, DocumentException, IOException, SQLException, ParseException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + InventoryForm If = (InventoryForm)form; + InventoryBean bean = (InventoryBean) If.getBean(); + + ArrayList reportData = InventoryManager.getInventoryReportData(ctx, bean.getInventoryId(), null); + + String title = ""; + + MInventory inv = MInventory.get(ctx, bean.getInventoryId()); + + if(inv.getDescription() == null) + { + title = "Inventory Adjustment Report"; + } + else + { + title = inv.getDescription(); + } + + String subtitle = null; + + String sql = "Select Name from AD_Org where AD_org_ID=?"; + PreparedStatement pstmt = null; + ResultSet rs = null; + + pstmt = DB.prepareStatement(sql.toString(), null); + pstmt.setInt(1, Env.getAD_Org_ID(ctx)); + + try + { + rs = pstmt.executeQuery(); + + if (rs.next()) + { + subtitle = rs.getString(1); + } + + } + catch(SQLException e) + { + throw new OperationException(e); + } + finally + { + DBUtils.close(rs); + DBUtils.close(pstmt); + } + + //constructing the table + TabularReport tReport = new TabularReport(reportData); + tReport.setSortable(false); + tReport.setStyle("display"); + tReport.setTitle(title); + tReport.setSubtitle(subtitle); + tReport.createReport(); + + response.setContentType("x-application/pdf"); + response.setHeader("Content-Disposition","inline;filename=Inventory"+System.currentTimeMillis()+".pdf"); + response.getOutputStream().write(tReport.getPDFData()); + + return null; + } + +} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/DunningAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/DunningAction.java new file mode 100644 index 0000000000..d88ca91438 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/pos/DunningAction.java @@ -0,0 +1,80 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Oct 27, 2006 + */ + + +package org.posterita.struts.pos; + +import java.util.ArrayList; +import java.util.Properties; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; + +import org.posterita.Constants; +import org.posterita.beans.DunningBean; +import org.posterita.businesslogic.POSBpartnerInfoManager; +import org.posterita.businesslogic.administration.DunningManager; +import org.posterita.core.TmkJSPEnv; +import org.posterita.exceptions.ApplicationException; +import org.posterita.exceptions.OperationException; +import org.posterita.struts.core.DefaultForm; + + +public class DunningAction extends POSDispatchAction +{ + + public static final String INIT_PRINT_DUNNING = "initPrintDunning"; + public ActionForward initPrintDunning(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx=TmkJSPEnv.getCtx(request); + DunningManager.associateAllBpartnerWithDunning(ctx); + ArrayList list = POSBpartnerInfoManager.getPartnerInfo(ctx,true); + + request.getSession().setAttribute(Constants.DEBTORS,list); + request.getSession().removeAttribute(Constants.BUSINESSPARTNER); + + return mapping.findForward(INIT_PRINT_DUNNING); + } + + public static final String PRINT_DUNNING_LETTERS="printDunningLetters"; + public ActionForward printDunningLetters(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx=TmkJSPEnv.getCtx(request); + DefaultForm df= (DefaultForm) form; + DunningBean bean=(DunningBean) df.getBean(); + + DunningManager.printDunningLetters(ctx,bean); + return mapping.findForward(PRINT_DUNNING_LETTERS); + } + +} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/EditBulkProductFromFileAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/EditBulkProductFromFileAction.java new file mode 100644 index 0000000000..258521634f --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/pos/EditBulkProductFromFileAction.java @@ -0,0 +1,265 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Sep 28, 2006 + */ + + +package org.posterita.struts.pos; + +import java.io.IOException; +import java.io.PrintWriter; +import java.util.ArrayList; +import java.util.Properties; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.compiere.util.Trx; + +import org.posterita.Constants; +import org.posterita.beans.ProductBean; +import org.posterita.businesslogic.EditBulkProductFromFileManager; +import org.posterita.businesslogic.POSProductManager; +import org.posterita.businesslogic.ProductCart; +import org.posterita.businesslogic.performanceanalysis.ReportManager; +import org.posterita.core.TmkJSPEnv; +import org.posterita.core.TrxPrefix; +import org.posterita.exceptions.ApplicationException; +import org.posterita.exceptions.BarcodeAlreadyExistsException; +import org.posterita.exceptions.OperationException; +import org.posterita.exceptions.ProductAlreadyExistException; +import org.posterita.exceptions.ProductNotFoundException; +import org.posterita.exceptions.TaxRateNotDefineException; +import org.posterita.struts.core.DefaultForm; + + +public class EditBulkProductFromFileAction extends POSDispatchAction +{ + + /*public static final String VIEW_ALL_POS_PRODUCTS_FOR_UPDATE="viewAllPOSProductsForUpdate"; + public ActionForward viewAllPOSProductsForUpdate(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd=init(mapping,form,request,response); + if(fwd!=null) + return fwd; + Properties ctx=TmkJSPEnv.getCtx(request); + DefaultForm df = (DefaultForm)form; + ProductBean bean = (ProductBean) df.getBean(); + ArrayList list=null; + + try + { + list = new ArrayList(); + list = POSProductManager.viewAllProducts(ctx,bean.getProductName(),null); + + } + catch(ProductNotFoundException e1) + { + postGlobalError("error.product.not.defined.client",request); + + } + + request.setAttribute(Constants.POS_PRODUCTS_FOR_UPDATE,list); + return mapping.findForward(VIEW_ALL_POS_PRODUCTS_FOR_UPDATE); + } + + public static final String CREATE_CSV_FILE="createCSVFile"; + public ActionForward createCSVFile(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx=TmkJSPEnv.getCtx(request); + + ProductCart cart = (ProductCart) request.getSession().getAttribute(Constants.PRODUCT_CART); + + if(cart==null) + { + postGlobalError("error.pos.shoppingcart.empty",request); + return new ActionForward("/jsp/pos/viewAllPOSProductsForUpdate.jsp"); + } + String fileName= EditBulkProductFromFileManager.createCSVFile(ctx, cart.getProductIDs()); + String fileURI = ReportManager.getReportURI(fileName,request); + + request.getSession().setAttribute(Constants.FILE_FOR_UPDATE,fileURI); + return mapping.findForward(CREATE_CSV_FILE); + } + + public static final String UPDATE_ALL_PRODUCTS="updateAllProducts"; + public ActionForward updateAllProducts(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd = init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + request.getSession().removeAttribute(Constants.PRODUCT_CREATED); + DefaultForm df = (DefaultForm) form; + + Trx trx = Trx.get(TrxPrefix.getPrefix(),true); + + try + { + trx.start(); + EditBulkProductFromFileManager.updateAllProducts(ctx,df.getFile(),trx.getTrxName()); + trx.commit(); + } + catch(ProductAlreadyExistException e) + { + trx.rollback(); + postGlobalError("error.duplicate.product",e.getMessage(),request); + return mapping.getInputForward(); + + } + catch(BarcodeAlreadyExistsException e) + { + trx.rollback(); + postGlobalError("error.duplicate.barcode",e.getMessage(),request); + return mapping.getInputForward(); + } + catch(NumberFormatException e) + { + trx.rollback(); + postGlobalError("error.invalid.number",request); + return mapping.getInputForward(); + } + catch(TaxRateNotDefineException e) + { + trx.rollback(); + postGlobalError("tax.rate.not.defined",e.getMessage(),request); + return mapping.getInputForward(); + } + catch(Exception e) + { + trx.rollback(); + postGlobalError("error.in.file",request); + return mapping.getInputForward(); + } + finally + { + trx.close(); + } + + return mapping.findForward(UPDATE_ALL_PRODUCTS); + + } + + public static final String VIEW_CART = "viewCart"; + public ActionForward viewCart(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException, IOException + { + ActionForward fwd = init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + ProductCart cart = (ProductCart) request.getSession().getAttribute(Constants.PRODUCT_CART); + + if( cart == null ) + { + throw new OperationException( "Cart is empty" ); + } + + ArrayList productList = EditBulkProductFromFileManager.getProductList( ctx, cart.getProductIDs() ); + request.getSession().setAttribute( Constants.PRODUCT_CART_ITEMS, productList ); + + return mapping.findForward(VIEW_CART); + } + + public static final String REMOVE = "remove"; + public ActionForward remove(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException, IOException + { + ActionForward fwd = init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + DefaultForm df = (DefaultForm) form; + ProductBean bean = (ProductBean) df.getBean(); + + Integer productId = bean.getProductId(); + + ProductCart cart = (ProductCart) request.getSession().getAttribute(Constants.PRODUCT_CART); + + if( cart == null ) + { + throw new OperationException( "Cart is empty" ); + } + + cart.removeProduct( productId.intValue() ); + + ArrayList productList = EditBulkProductFromFileManager.getProductList( ctx, cart.getProductIDs() ); + request.getSession().setAttribute( Constants.PRODUCT_CART_ITEMS, productList ); + request.getSession().setAttribute( Constants.PRODUCT_CART, cart); + + return mapping.findForward(REMOVE); + } + + + //------------------------------------------------------------------------------------------------------------------------------------------------ + public static final String ADD_TO_CART = "addToCart"; + public ActionForward addToCart(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException, IOException + { + Properties ctx = TmkJSPEnv.getCtx(request); + DefaultForm df = (DefaultForm) form; + ProductBean bean = (ProductBean) df.getBean(); + + Integer productId = bean.getProductId(); + + ProductCart cart = (ProductCart) request.getSession().getAttribute(Constants.PRODUCT_CART); + + if( cart == null ) + { + cart = new ProductCart( ctx ); + } + + cart = EditBulkProductFromFileManager.addToCart( ctx, cart, productId.intValue() ); + request.getSession().setAttribute(Constants.PRODUCT_CART, cart); + + String script = "setCartCounter("+ cart.getNoOfProducts() +");productAdded("+ productId +")"; + + PrintWriter writer = response.getWriter(); + writer.print( script ); + writer.flush(); + writer.close(); + + return null; + } + + public ActionForward clearCart (ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException, IOException + { + HttpSession session = request.getSession(); + session.removeAttribute(Constants.PRODUCT_CART); + + String script = "clearAll();"; + PrintWriter writer = response.getWriter(); + writer.print( script ); + writer.flush(); + writer.close(); + + return null; + } + */ +} + diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/FastMovingItemReportAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/FastMovingItemReportAction.java new file mode 100644 index 0000000000..dd7a13a665 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/pos/FastMovingItemReportAction.java @@ -0,0 +1,126 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 25-Jul-2005 by alok + * + */ + +package org.posterita.struts.pos; + +import java.sql.Timestamp; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.Properties; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; + +import org.posterita.Constants; +import org.posterita.beans.ReportBean; +import org.posterita.businesslogic.performanceanalysis.POSReportManager; +import org.posterita.businesslogic.performanceanalysis.ReportDateManager; +import org.posterita.core.TimestampConvertor; +import org.posterita.core.TmkJSPEnv; +import org.posterita.exceptions.ApplicationException; +import org.posterita.exceptions.OperationException; +import org.posterita.struts.core.DefaultForm; + +public class FastMovingItemReportAction extends POSDispatchAction +{ + public static final String GET_CURRENT_DAY_REPORT = "getCurrentDayReport"; + public ActionForward getCurrentDayReport(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + Calendar cal = Calendar.getInstance(); + + Timestamp toDate = new Timestamp(cal.getTimeInMillis()); + + cal.set(Calendar.HOUR_OF_DAY,0); + cal.set(Calendar.MINUTE,0); + cal.set(Calendar.SECOND,0); + cal.set(Calendar.MILLISECOND,0); + + Timestamp fromDate = new Timestamp(cal.getTimeInMillis()); + + ArrayList list=POSReportManager.getMaxMinSoldProducts(ctx,"desc",fromDate,toDate); + request.getSession().setAttribute(Constants.MAX_SOLD_ITEMS,list); + + return mapping.findForward(GET_CURRENT_DAY_REPORT); + } + + public static final String GET_CURRENT_MONTH_REPORT = "getCurrentMonthReport"; + public ActionForward getCurrentMonthReport(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + Calendar cal = Calendar.getInstance(); + + Timestamp toDate = new Timestamp(cal.getTimeInMillis()); + + cal.set(Calendar.DATE,1); + cal.set(Calendar.HOUR_OF_DAY,0); + cal.set(Calendar.MINUTE,0); + cal.set(Calendar.SECOND,0); + cal.set(Calendar.MILLISECOND,0); + + Timestamp fromDate = new Timestamp(cal.getTimeInMillis()); + + ArrayList list=POSReportManager.getMaxMinSoldProducts(ctx,"desc",fromDate,toDate); + request.getSession().setAttribute(Constants.MAX_SOLD_ITEMS,list); + + return mapping.findForward(GET_CURRENT_MONTH_REPORT); + } + + public static final String GET_CUSTOM_REPORT = "getCustomReport"; + public ActionForward getCustomReport(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws OperationException, ApplicationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + + Properties ctx = TmkJSPEnv.getCtx(request); + DefaultForm df= (DefaultForm) form; + + ReportBean bean = (ReportBean) df.getBean(); + Timestamp fromDate = ReportDateManager.getFromDate(bean); + Timestamp toDate = ReportDateManager.getToDate(bean); + + ArrayList list=POSReportManager.getMaxMinSoldProducts(ctx,"desc",fromDate,toDate); + request.getSession().setAttribute(Constants.MAX_SOLD_ITEMS,list); + + return mapping.findForward(GET_CUSTOM_REPORT); + } + + +} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/GetReportAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/GetReportAction.java new file mode 100644 index 0000000000..556cad2b30 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/pos/GetReportAction.java @@ -0,0 +1,103 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * 31-Jul-2006 10:08:46 by praveen + * + */ + +package org.posterita.struts.pos; + +import java.io.BufferedInputStream; +import java.io.BufferedOutputStream; +import java.io.File; +import java.io.FileInputStream; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.compiere.util.MimeType; + +import org.posterita.businesslogic.performanceanalysis.ReportManager; +import org.posterita.exceptions.OperationException; +import org.posterita.struts.core.DefaultForm; + +public class GetReportAction extends POSAction +{ + public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws OperationException + { + + DefaultForm df = (DefaultForm) form; + String reportName = df.getReportName(); + + if(reportName==null) + { + throw new OperationException("Invalid parameter! ReportName cannot be null."); + } + + String mimeType = null; + + if(reportName.endsWith(".csv")) + { + mimeType = "text/comma-separated-values"; + } + else + { + mimeType = MimeType.getMimeType(reportName); + } + + String reportPath = ReportManager.getReportPath(reportName); + + File f = new File(reportPath); + + if(!f.exists()) + { + throw new OperationException("Unable to load " + reportName + ". Cause file not found."); + } + + try + { + response.setContentType(mimeType); + + FileInputStream fis = new FileInputStream(f); + BufferedInputStream bis = new BufferedInputStream(fis); + BufferedOutputStream bos = new BufferedOutputStream(response.getOutputStream()); + + //Transfer bytes from bis to bos + byte[] buf = new byte[1024]; + int len; + while ((len = bis.read(buf)) > 0) + { + bos.write(buf, 0, len); + } + bis.close(); + + bos.flush(); + bos.close(); + + } + catch (Exception e) + { + throw new OperationException(e); + } + + return null; + } +} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/GoodsReceiveNoteAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/GoodsReceiveNoteAction.java new file mode 100644 index 0000000000..f344f0c1fb --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/pos/GoodsReceiveNoteAction.java @@ -0,0 +1,90 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * 22-Sep-2006 11:41:54 by praveen + * + */ + +package org.posterita.struts.pos; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; + +import org.posterita.exceptions.ApplicationException; + +public class GoodsReceiveNoteAction extends POSDispatchAction +{ + public static final String CREATE_GOODS_RECEIVE_NOTE = "createGoodsReceiveNote"; + public static final String ADD_TO_SHOPPING_CART = "addToShoppingCart"; + public static final String DELETE_ORDERLINES = "deleteOrderlines"; + + public static final String INCREMENT_QTY = "incrementQty"; + public static final String DECREMENT_QTY = "decrementQty"; + public static final String DELETE_ORDERLINE = "deleteOrderline"; + + public ActionForward addToShoppingCart(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + return mapping.findForward(ADD_TO_SHOPPING_CART); + } + + public ActionForward deleteOrderlines(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + return mapping.findForward(DELETE_ORDERLINES); + } + + //----------------------------------------------------------------------------------------------------------- + + public ActionForward incrementQty(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + return mapping.findForward(INCREMENT_QTY); + } + + public ActionForward decrementQty(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + return mapping.findForward(DECREMENT_QTY); + } + + public ActionForward deleteOrderline(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + return mapping.findForward(DELETE_ORDERLINE); + } +} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/GoodsReturnNoteAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/GoodsReturnNoteAction.java new file mode 100644 index 0000000000..cbeb8303f8 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/pos/GoodsReturnNoteAction.java @@ -0,0 +1,77 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * 22-Sep-2006 11:42:25 by praveen + * + */ + +package org.posterita.struts.pos; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; + +import org.posterita.exceptions.ApplicationException; + +public class GoodsReturnNoteAction extends POSDispatchAction +{ + public static final String CREATE_GOODS_RETURN_NOTE = "createGoodsReturnNote"; + public static final String ADD_TO_SHOPPING_CART = "addToShoppingCart"; + public static final String INCREMENT_QTY = "incrementQty"; + public static final String DECREMENT_QTY = "decrementQty"; + public static final String DELETE_ORDERLINE = "deleteOrderline"; + + public ActionForward addToShoppingCart(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + return mapping.findForward(ADD_TO_SHOPPING_CART); + } + + public ActionForward incrementQty(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + return mapping.findForward(INCREMENT_QTY); + } + + public ActionForward decrementQty(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + return mapping.findForward(DECREMENT_QTY); + } + + public ActionForward deleteOrderline(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + return mapping.findForward(DELETE_ORDERLINE); + } +} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/ImportCustomerAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/ImportCustomerAction.java new file mode 100644 index 0000000000..3d3dae6117 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/pos/ImportCustomerAction.java @@ -0,0 +1,85 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + **/ + +package org.posterita.struts.pos; + +import java.util.ArrayList; +import java.util.Properties; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.compiere.util.Trx; + +import org.posterita.Constants; +import org.posterita.beans.CustomerBean; +import org.posterita.businesslogic.administration.ImportCustomerManager; +import org.posterita.businesslogic.performanceanalysis.ReportManager; +import org.posterita.core.TmkJSPEnv; +import org.posterita.core.TrxPrefix; +import org.posterita.exceptions.ApplicationException; +import org.posterita.exceptions.BarcodeAlreadyExistsException; +import org.posterita.exceptions.OperationException; +import org.posterita.exceptions.ProductAlreadyExistException; +import org.posterita.struts.core.BaseDispatchAction; +import org.posterita.struts.core.DefaultForm; + + +public class ImportCustomerAction extends BaseDispatchAction +{ + public static final String IMPORT_POS_CUSTOMER ="importPOSCustomer"; + public ActionForward importPOSCustomer(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd = init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + DefaultForm df = (DefaultForm) form; + + ArrayList list = new ArrayList(); + + try + { + list=ImportCustomerManager.importCustomer(ctx, df.getFile(), null); + } + + catch(Exception e) + { + String message = e.getMessage(); + int index = message.indexOf("csv"); + String filename = message.substring(0,index+3); + String error = message.substring(index+3); + postGlobalError("error.process", error, request); + String csvURI = ReportManager.getReportURI(filename,request); + request.getSession().setAttribute(Constants.IMPORT_FAIL_CSV_FILE, csvURI); + return mapping.getInputForward(); + } + + request.getSession().setAttribute(Constants.CUSTOMER_CREATED,list); + // return mapping.findForward(IMPORT_POS_CUSTOMER); + return mapping.getInputForward(); + + } +} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/ImportPOSProductAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/ImportPOSProductAction.java new file mode 100644 index 0000000000..a9cc3933ef --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/pos/ImportPOSProductAction.java @@ -0,0 +1,118 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on May 16, 2006 + */ + + +package org.posterita.struts.pos; + +import java.io.FileWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Properties; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.posterita.Constants; +import org.posterita.beans.ProductBean; +import org.posterita.businesslogic.ImportPosProductManager; +import org.posterita.businesslogic.POSTerminalManager; +import org.posterita.businesslogic.StoreManager; +import org.posterita.businesslogic.performanceanalysis.ReportManager; +import org.posterita.core.TmkJSPEnv; +import org.posterita.exceptions.ApplicationException; +import org.posterita.exceptions.OperationException; +import org.posterita.struts.core.BaseDispatchAction; +import org.posterita.struts.core.DefaultForm; + + +public class ImportPOSProductAction extends BaseDispatchAction +{ + public static final String IMPORT_POS_PRODUCT ="importPOSProducts"; + public ActionForward importPOSProducts(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException, IOException + { + ActionForward fwd = init(mapping,form,request,response); + if (fwd!=null) + { + return fwd; + } + + Properties ctx = TmkJSPEnv.getCtx(request); + request.getSession().removeAttribute(Constants.PRODUCT_CREATED); + DefaultForm df = (DefaultForm) form; + ArrayList list=new ArrayList(); + request.getSession().removeAttribute(Constants.IMPORT_FAIL_CSV_FILE); + String salesPListId = df.getSalesPriceListId(); + String purchasePListId = df.getPurchasePriceListId(); + + int purchasePriceListId = StoreManager.getPriceListId(ctx); + int salesPriceListId = POSTerminalManager.getSOPriceListId(ctx); + + if (salesPListId != null) + { + try + { + int soPriceListId = Integer.valueOf(salesPListId); + salesPriceListId = soPriceListId; + } + catch (NumberFormatException e) + { + + } + } + if (purchasePListId != null) + { + try + { + int poPriceListId = Integer.valueOf(purchasePListId); + purchasePriceListId = poPriceListId; + } + catch (NumberFormatException e) + { + } + } + try + { + list=ImportPosProductManager.importSingleProducts(ctx,df.getFile(), salesPriceListId, purchasePriceListId, null); + } + catch(Exception e) + { + + String message = e.getMessage(); + int index = message.indexOf("csv"); + String filename = message.substring(0,index+3); + String error = message.substring(index+3); + postGlobalError("error.process", error, request); + String csvURI = ReportManager.getReportURI(filename,request); + request.getSession().setAttribute(Constants.IMPORT_FAIL_CSV_FILE, csvURI); + return mapping.getInputForward(); + } + finally + { + } + + request.getSession().setAttribute(Constants.PRODUCT_CREATED,list); + return mapping.findForward(IMPORT_POS_PRODUCT); + + } +} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/InventoryAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/InventoryAction.java new file mode 100644 index 0000000000..9d2d5f77fb --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/pos/InventoryAction.java @@ -0,0 +1,472 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Dec 4, 2006 + */ + + +package org.posterita.struts.pos; + +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Properties; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.compiere.model.MInventory; +import org.compiere.process.DocumentEngine; +import org.compiere.util.Env; +import org.compiere.util.Trx; +import org.posterita.Constants; +import org.posterita.beans.InventoryBean; +import org.posterita.beans.InventoryCartBean; +import org.posterita.beans.InventoryLineBean; +import org.posterita.businesslogic.performanceanalysis.ReportManager; +import org.posterita.businesslogic.stock.InventoryCartManager; +import org.posterita.businesslogic.stock.InventoryManager; +import org.posterita.businesslogic.stock.StockManager; +import org.posterita.core.TmkJSPEnv; +import org.posterita.core.TrxPrefix; +import org.posterita.exceptions.ApplicationException; +import org.posterita.exceptions.CannotCreateInventoryLineException; +import org.posterita.exceptions.NoCheckBoxSelectedException; +import org.posterita.exceptions.OperationException; +import org.posterita.exceptions.ProductNotFoundException; +import org.posterita.form.InventoryForm; +import org.posterita.form.InventoryLineForm; +import org.posterita.struts.core.BaseDispatchAction; +import org.posterita.struts.core.DefaultForm; + + +public class InventoryAction extends BaseDispatchAction +{ + + public static final String CREATE_INVENTORY="createInventory"; + public ActionForward createInventory(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx =TmkJSPEnv.getCtx(request); + InventoryForm If = (InventoryForm)form; + InventoryBean bean = (InventoryBean) If.getBean(); + MInventory inventory=null; + + if(bean.getBarCode()!=null && bean.getProductId()==null) + { + int productId=StockManager.getProductIdFromBarCode(ctx,bean.getBarCode()); + bean.setProductId(productId); + } + + + Trx trx = Trx.get(TrxPrefix.getPrefix(),true); + try + { + if(bean.getInventoryId()==null || bean.getInventoryId()==0) + { + inventory=InventoryManager.createInventory(ctx,bean.getDescription(),null); + bean.setInventoryId(inventory.get_ID()); + } + if(bean.getDescription()!=null) + { + MInventory inventory2=new MInventory(ctx,bean.getInventoryId(),null); + inventory2.setDescription(bean.getDescription()); + inventory2.save(); + } + + + InventoryManager.addInventoryLine(ctx,bean.getInventoryId(),bean.getProductId(), new BigDecimal(0), new BigDecimal(1), true,null); + trx.commit(); + } + catch(CannotCreateInventoryLineException e) + { + trx.rollback(); + ArrayList list = InventoryManager.getInventoryLines(ctx,bean.getInventoryId()); + request.setAttribute(Constants.INVENTORY_LINE_LIST,list); + request.setAttribute(Constants.INVENTORY_ID,bean.getInventoryId()); + postGlobalError("error.cannot.create.inventory.line",request); + return mapping.getInputForward(); + } + catch(ProductNotFoundException e) + { + postGlobalError("error.product.name.required",request); + ArrayList list = InventoryManager.getInventoryLines(ctx,bean.getInventoryId()); + request.setAttribute(Constants.INVENTORY_LINE_LIST,list); + request.setAttribute(Constants.INVENTORY_ID,bean.getInventoryId()); + return mapping.getInputForward(); + } + + catch(OperationException e) + { + trx.rollback(); + ArrayList list = InventoryManager.getInventoryLines(ctx,bean.getInventoryId()); + request.setAttribute(Constants.INVENTORY_LINE_LIST,list); + request.setAttribute(Constants.INVENTORY_ID,bean.getInventoryId()); + throw new OperationException(e); + } + finally + { + trx.close(); + } + + If.populate(bean); + + ArrayList list = InventoryManager.getInventoryLines(ctx,bean.getInventoryId()); + request.setAttribute(Constants.INVENTORY_LINE_LIST,list); + request.setAttribute(Constants.INVENTORY_ID,bean.getInventoryId()); + + return mapping.findForward(CREATE_INVENTORY); + } + + public static final String SAVE_COUNT_QTY="saveCountQty"; + public ActionForward saveCountQty(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx =TmkJSPEnv.getCtx(request); + InventoryForm If = (InventoryForm)form; + InventoryBean bean = (InventoryBean) If.getBean(); + Trx trx = Trx.get(TrxPrefix.getPrefix(),true); + try + { + InventoryManager.saveCountQtyInInventoryLine(ctx,bean.getInventoryLineId(), bean.getQtyCsv(), bean.getQtyCount(), trx.getTrxName()); + trx.commit(); + } + catch(OperationException e) + { + trx.rollback(); + ArrayList list = InventoryManager.getInventoryLines(ctx,bean.getInventoryId()); + request.setAttribute(Constants.INVENTORY_LINE_LIST,list); + request.setAttribute(Constants.INVENTORY_ID,bean.getInventoryId()); + throw new OperationException(e); + } + finally + { + trx.close(); + } + + ArrayList list = InventoryManager.getInventoryLines(ctx,bean.getInventoryId()); + request.setAttribute(Constants.INVENTORY_LINE_LIST,list); + request.setAttribute(Constants.WHOLE_INVENTORY_LINE_LIST,list); + return mapping.findForward(SAVE_COUNT_QTY); + } + + + public static final String COMPLETE_INVENTORY="completeInventory"; + public ActionForward completeInventory(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx =TmkJSPEnv.getCtx(request); + InventoryForm If = (InventoryForm)form; + InventoryBean bean = (InventoryBean) If.getBean(); + InventoryManager.completeStockAdjustment(ctx,bean.getInventoryId()); + + ArrayList list = InventoryManager.getInventoryLines(ctx,bean.getInventoryId()); + request.setAttribute(Constants.COMPLETED_INVENTORY_LINE_LIST,list); + request.removeAttribute(Constants.INVENTORY_LINE_LIST); + request.removeAttribute(Constants.WHOLE_INVENTORY_LINE_LIST); + return mapping.findForward(COMPLETE_INVENTORY); + } + + + public static final String VIEW_INVENTORY_HISTORY="viewInventoryHistory"; + public ActionForward viewInventoryHistory(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + DefaultForm If = (DefaultForm)form; + + Properties ctx =TmkJSPEnv.getCtx(request); + ArrayList list = InventoryManager.viewInventoryHistory(ctx); + request.setAttribute(Constants.INVENTORY_HISTORY_LIST,list); + return mapping.findForward(VIEW_INVENTORY_HISTORY); + } + + public ActionForward getInventoryHistory(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + DefaultForm If = (DefaultForm)form; + InventoryBean bean = (InventoryBean) If.getBean(); + + Properties ctx =TmkJSPEnv.getCtx(request); + ArrayList list = InventoryManager.viewInventory(ctx, bean.getDocStatus(), bean.getMonth(), bean.getYear()); + request.setAttribute(Constants.INVENTORY_HISTORY_LIST,list); + return mapping.findForward(VIEW_INVENTORY_HISTORY); + } + + public ActionForward searchProductInInventory(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + DefaultForm If = (DefaultForm)form; + InventoryBean bean = (InventoryBean) If.getBean(); + ArrayList list = null; + + Properties ctx =TmkJSPEnv.getCtx(request); + try + { + list = InventoryManager.searchProductInInventory(ctx, bean.getProductId(), bean.getBarCode()); + } + catch(Exception e) + { + postComplexGlobalError("error.notfound", new Object[]{e.getMessage()}, request); + } + request.setAttribute(Constants.INVENTORY_HISTORY_LIST, list); + return mapping.findForward(VIEW_INVENTORY_HISTORY); + } + + public static final String DELETE_INVENTORY="deleteInventory"; + public ActionForward deleteInventory(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx =TmkJSPEnv.getCtx(request); + InventoryForm If = (InventoryForm)form; + InventoryBean bean = (InventoryBean) If.getBean(); + InventoryManager.deleteInventory(ctx,bean.getInventoryId().intValue()); + InventoryCartManager.clearInventorycart(ctx, request); + ArrayList list = InventoryManager.viewInventoryHistory(ctx); + request.setAttribute(Constants.INVENTORY_HISTORY_LIST,list); + return mapping.findForward(DELETE_INVENTORY); + } + + public static final String DELETE_INVENTORY_LINE="deleteInventoryLine"; + public ActionForward deleteInventoryLine(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx =TmkJSPEnv.getCtx(request); + InventoryForm If = (InventoryForm)form; + InventoryBean bean = (InventoryBean) If.getBean(); + InventoryManager.deleteInventoryLine(ctx,bean.getInventoryId().intValue(),bean.getInventoryLineId().intValue()); + ArrayList list = InventoryManager.getInventoryLines(ctx,bean.getInventoryId()); + request.setAttribute(Constants.INVENTORY_LINE_LIST,list); + request.setAttribute(Constants.INVENTORY_ID,bean.getInventoryId()); + + return mapping.findForward(DELETE_INVENTORY_LINE); + } + + public static final String VIEW_INVENTORY="viewInventory"; + public ActionForward viewInventory(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx =TmkJSPEnv.getCtx(request); + InventoryLineForm If = (InventoryLineForm)form; + InventoryLineBean bean = (InventoryLineBean) If.getBean(); + + ArrayList list = InventoryManager.getInventoryLines(ctx,bean.getInventoryId()); + If.populate(bean); + if(InventoryManager.getInventoryDocStatus(ctx,bean.getInventoryId()).equals(DocumentEngine.STATUS_Drafted)) + { + InventoryCartBean cartBean = null; + + for (InventoryLineBean inventoryLineBean : list) + { + cartBean = StockManager.addToInventoryCart(ctx, inventoryLineBean, cartBean, false, true); + bean.setDocStatus(inventoryLineBean.getDocStatus()); + bean.setDocumentNo(inventoryLineBean.getDocumentNo()); + } + + If.populate(bean); + request.getSession().setAttribute(Constants.INVENTORY_CART_ITEMS, cartBean.getItems()); + request.getSession().setAttribute(Constants.INVENTORY_CART, cartBean); + request.getSession().setAttribute(Constants.INVENTORY_ID,bean.getInventoryId()); + + Env.setContext(ctx, Constants.INVENTORY_ID, bean.getInventoryId()); + Env.setContext(ctx, Constants.DESCRIPTION, bean.getDescription()); + request.getSession().setAttribute(Constants.DOC_NO, bean.getDocumentNo()); + request.getSession().setAttribute(Constants.DOC_STATUS, bean.getDocStatus()); + + return new ActionForward("/initInventoryCart.do"); + } + else + { + request.setAttribute(Constants.COMPLETED_INVENTORY_LINE_LIST,list); + return new ActionForward("/CompletedAdjustmentStock.do"); + } + + } + + public static final String CREATE_WHOLE_INVENTORY="createWholeInventory"; + public ActionForward createWholeInventory(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx =TmkJSPEnv.getCtx(request); + InventoryForm If = (InventoryForm)form; + InventoryBean bean = (InventoryBean) If.getBean(); + MInventory inventory=null; + Trx trx = Trx.get(TrxPrefix.getPrefix(),true); + try + { trx.start(); + if(bean.getInventoryId()==null || bean.getInventoryId()==0) + { + inventory=InventoryManager.createInventory(ctx,bean.getDescription(),trx.getTrxName()); + bean.setInventoryId(inventory.get_ID()); + } + + InventoryManager.addAllProductsInventoryLine(ctx,bean.getInventoryId(),trx.getTrxName()); + + trx.commit(); + } + catch(OperationException e) + { + trx.rollback(); + ArrayList list = InventoryManager.getInventoryLines(ctx,bean.getInventoryId()); + request.setAttribute(Constants.INVENTORY_LINE_LIST,list); + request.setAttribute(Constants.INVENTORY_ID,bean.getInventoryId()); + throw new OperationException(e); + } + finally + { + trx.close(); + } + + ArrayList list = InventoryManager.getInventoryLines(ctx, inventory.getM_Inventory_ID()); + InventoryCartBean cartBean = null; + + for (InventoryLineBean inventoryLineBean : list) + { + cartBean = StockManager.addToInventoryCart(ctx, inventoryLineBean, cartBean, false, true); + } + + request.getSession().setAttribute(Constants.INVENTORY_CART_ITEMS, cartBean.getItems()); + request.getSession().setAttribute(Constants.INVENTORY_CART, cartBean); + request.getSession().setAttribute(Constants.INVENTORY_ID,bean.getInventoryId()); + + Env.setContext(ctx, Constants.INVENTORY_ID, inventory.getM_Inventory_ID()); + Env.setContext(ctx, Constants.DESCRIPTION, inventory.getDescription()); + request.getSession().setAttribute(Constants.DOC_NO, inventory.getDocumentNo()); + request.getSession().setAttribute(Constants.DOC_STATUS, inventory.getDocStatus()); + + return new ActionForward("/initInventoryCart.do"); + } + + public static final String CREATE_CSV_FILE_FOR_INVENTORY="createCSVFileForInventory"; + public ActionForward createCSVFileForInventory(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException, IOException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx =TmkJSPEnv.getCtx(request); + InventoryForm If = (InventoryForm)form; + InventoryBean bean = (InventoryBean) If.getBean(); + ArrayList list = InventoryManager.getInventoryLines(ctx,bean.getInventoryId()); + String reportName = InventoryManager.createCSVForInventory(ctx,list); + String reportURI=ReportManager.getReportURI(reportName,request); + response.sendRedirect(reportURI); + return null; + + } + + + public static final String MERGE_INVENTORY_TO_CREATE_ONE="mergeInventoryToCreateOne"; + public ActionForward mergeInventoryToCreateOne(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException, IOException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx =TmkJSPEnv.getCtx(request); + InventoryForm If = (InventoryForm)form; + InventoryBean bean = (InventoryBean) If.getBean(); + Trx trx = Trx.get(TrxPrefix.getPrefix(),true); + + MInventory inventory =null; + try + { + inventory = InventoryManager.mergeInventory(ctx,bean,null); + trx.commit(); + } + catch(NoCheckBoxSelectedException e) + { + trx.rollback(); + ArrayList list = InventoryManager.viewInventoryHistory(ctx); + request.setAttribute(Constants.INVENTORY_HISTORY_LIST,list); + postGlobalError("error.no.checkbox.selected",request); + return mapping.getInputForward(); + } + catch(CannotCreateInventoryLineException e1) + { + trx.rollback(); + ArrayList list = InventoryManager.viewInventoryHistory(ctx); + request.setAttribute(Constants.INVENTORY_HISTORY_LIST,list); + postGlobalError("error.cannot.create.inventory.line",request); + return mapping.getInputForward(); + } + + catch(OperationException e2) + { + trx.rollback(); + throw new OperationException(e2); + } + finally + { + trx.close(); + } + + ArrayList list = InventoryManager.getInventoryLines(ctx, inventory.getM_Inventory_ID()); + InventoryCartBean cartBean = null; + + for (InventoryLineBean inventoryLineBean : list) + { + cartBean = StockManager.addToInventoryCart(ctx, inventoryLineBean, cartBean, false, true); + } + + request.getSession().setAttribute(Constants.INVENTORY_CART_ITEMS, cartBean.getItems()); + request.getSession().setAttribute(Constants.INVENTORY_CART, cartBean); + request.getSession().setAttribute(Constants.INVENTORY_ID, inventory.getM_Inventory_ID()); + + Env.setContext(ctx, Constants.INVENTORY_ID, inventory.getM_Inventory_ID()); + Env.setContext(ctx, Constants.DESCRIPTION, inventory.getDescription()); + request.getSession().setAttribute(Constants.DOC_NO, inventory.getDocumentNo()); + request.getSession().setAttribute(Constants.DOC_STATUS, inventory.getDocStatus()); + + return new ActionForward("/initInventoryCart.do"); + + } +} + \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/InventoryCartAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/InventoryCartAction.java new file mode 100644 index 0000000000..14b9de5b46 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/pos/InventoryCartAction.java @@ -0,0 +1,674 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * + * @author shameem + */ + +package org.posterita.struts.pos; + +import java.io.IOException; +import java.io.OutputStream; +import java.io.PrintWriter; +import java.math.BigDecimal; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.text.ParseException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.Properties; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.apache.struts.action.ActionMessage; +import org.apache.struts.action.ActionMessages; +import org.apache.struts.upload.FormFile; +import org.apache.struts.util.MessageResources; +import org.compiere.model.MInventory; +import org.compiere.model.MInventoryLine; +import org.compiere.util.CLogger; +import org.compiere.util.DB; +import org.compiere.util.Env; +import org.compiere.util.Trx; +import org.compiere.utils.DBUtils; +import org.posterita.Constants; +import org.posterita.beans.InventoryCartBean; +import org.posterita.beans.InventoryLineBean; +import org.posterita.beans.ItemBean; +import org.posterita.businesslogic.POSTerminalManager; +import org.posterita.businesslogic.performanceanalysis.ReportManager; +import org.posterita.businesslogic.stock.InventoryCartManager; +import org.posterita.businesslogic.stock.InventoryManager; +import org.posterita.businesslogic.stock.StockManager; +import org.posterita.core.TabularReport; +import org.posterita.core.TmkJSPEnv; +import org.posterita.core.TrxPrefix; +import org.posterita.exceptions.ApplicationException; +import org.posterita.exceptions.CannotCreateInventoryLineException; +import org.posterita.exceptions.InputQuantityLessThanZeroException; +import org.posterita.exceptions.OperationException; +import org.posterita.exceptions.ProductNotFoundException; +import org.posterita.exceptions.ProductNotOnPriceListException; +import org.posterita.exceptions.QuantityNotAvailableException; +import org.posterita.exceptions.UOMValuePrecisionNotValidException; +import org.posterita.form.InventoryLineForm; +import org.posterita.struts.core.DefaultForm; + +import com.lowagie.text.DocumentException; + +public class InventoryCartAction extends POSDispatchAction +{ + private static final CLogger logger = CLogger.getCLogger(InventoryCartAction.class); + + public static final String INCREMENT_QTY = "incrementQty"; + public ActionForward incrementQty(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception + { + // Bug fix for null pointer + InventoryLineForm of = (InventoryLineForm) form; + if(of.getQuantity() == null) + { + of.setQuantity("1"); + } + + addToInventoryCart(mapping,form,request,response); + return getInventoryCart(mapping,form,request,response); + } + + public static final String DECREMENT_QTY = "decrementQty"; + public ActionForward decrementQty(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception + { + // Bug fix for null pointer + InventoryLineForm of = (InventoryLineForm) form; + if(of.getQuantity() == null) + { + of.setQuantity("1"); + } + + addToInventoryCart(mapping,form,request,response); + return getInventoryCart(mapping,form,request,response); + } + + public ActionForward addProduct(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException, IOException, ParseException + { + // Bug fix for null pointer + InventoryLineForm of = (InventoryLineForm) form; + if(of.getQtyCount() == null) + { + of.setQtyCount("1"); + } + + addToInventoryCart(mapping,form,request,response); + + return getInventoryCart(mapping,form,request,response); + } + + public static final String UPDATE_QTY = "updateQty"; + public ActionForward updateQty(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception + { + Properties ctx=TmkJSPEnv.getCtx(request); + + // Bug fix for null pointer + InventoryLineForm of = (InventoryLineForm) form; + if(of.getQtyCount() == null) + { + of.setQtyCount("1"); + } + + InventoryLineBean bean = (InventoryLineBean) of.getBean(); + Integer product_id = bean.getProductId(); + bean.setQtyCount(new BigDecimal(of.getQtyCount())); + Integer priceListId = bean.getPriceListId(); + of.populate(bean); + + ArrayList items = (ArrayList) request.getSession().getAttribute(Constants.INVENTORY_CART_ITEMS); + StockManager.updateItemFromInventoryList(ctx, priceListId, items, product_id, bean.getQtyCount().intValue()); + request.getSession().setAttribute(Constants.INVENTORY_CART_ITEMS, items); + + return getInventoryCart(mapping, form, request, response); + } + + + public static final String ADD_TO_INVENTORY_CART = "addToInventoryCart"; + public ActionForward addToInventoryCart(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException + { + Properties ctx = TmkJSPEnv.getCtx(request); + InventoryLineForm df = (InventoryLineForm) form; + InventoryLineBean bean = (InventoryLineBean) df.getBean(); + + String inventoryCart = Constants.INVENTORY_CART; + String inventoryCartItems = Constants.INVENTORY_CART_ITEMS; + + InventoryCartBean cartBean = (InventoryCartBean) request.getSession().getAttribute(inventoryCart); + + try + { + if(bean.getProductId()==null && bean.getBarCode()==null) + { + postGlobalError("error.barcode.required", request); + return mapping.getInputForward(); + } + + BigDecimal qty = bean.getQtyCount(); + if(qty != null && qty.doubleValue() < 0.0) + { + throw new InputQuantityLessThanZeroException(""); + } + + cartBean = StockManager.addToInventoryCart(ctx, bean, cartBean,true,Boolean.parseBoolean(bean.getIfAdd())); + } + catch (InputQuantityLessThanZeroException e) + { + postGlobalError("error.invalid.inputQty", request); + return mapping.getInputForward(); + } + catch (ProductNotFoundException e) + { + postGlobalError("error.product.not.found", e.getMessage(), request); + return mapping.getInputForward(); + } + catch(QuantityNotAvailableException e) + { + postGlobalError("error.quantity.notAvailable", e.getMessage(), request); + return mapping.getInputForward(); + } + + catch(ProductNotOnPriceListException e) + { + postGlobalError("error.product.price.not.found", e.getMessage(), request); + return mapping.getInputForward(); + } + + catch (UOMValuePrecisionNotValidException e) + { + postGlobalError("error.precision", e.getMessage(), request); + return mapping.getInputForward(); + } + + String currSymboleSales = POSTerminalManager.getDefaultSalesCurrency(ctx).getCurSymbol(); + request.setAttribute(Constants.CURRENCY_SYMBOLE,currSymboleSales); + + + request.getSession().setAttribute(inventoryCart, cartBean); + request.getSession().setAttribute(inventoryCartItems, cartBean.getItems()); + + df.setQtyAndItem(""); + + return mapping.findForward(ADD_TO_INVENTORY_CART); + } + + public ActionForward getInventoryCart(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws OperationException, IOException, ParseException + { + DefaultForm df = (DefaultForm) form; + + String shoppingcartHTML = InventoryCartManager.getInventoryCartAsHTML(request); + + PrintWriter writer = response.getWriter(); + writer.write(shoppingcartHTML); + + + ActionMessages errors = (ActionMessages) request.getAttribute("org.apache.struts.action.ERROR"); + if(errors != null && !errors.isEmpty()) + { + MessageResources messageResources = getResources(request); + + Iterator iter = errors.get(); + while(iter.hasNext()) + { + ActionMessage message = iter.next(); + String key = message.getKey(); + Object[] values = message.getValues(); + + String errMsg = messageResources.getMessage(key, values); + writer.write(""); + } + + } + + writer.close(); + + return null; + } + + public static final String RELOAD_CART = "reloadCart"; + public ActionForward reloadCart(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception + { + return getInventoryCart(mapping,form,request,response); + } + + public ActionForward clearCart(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception + { + + Properties ctx = TmkJSPEnv.getCtx(request); + Object inventoryIdAsStr = request.getSession().getAttribute(Constants.INVENTORY_ID); + Integer inventoryId = 0; + + if(inventoryIdAsStr != null) + { + inventoryId = Integer.parseInt(inventoryIdAsStr.toString()); + } + + + if(inventoryId != 0) + { + MInventory inventory = new MInventory(ctx, inventoryId,null); + inventory.delete(true); + } + + InventoryCartManager.clearInventorycart(ctx, request); + + return getInventoryCart(mapping, form, request, response); + } + + public static final String AUTO_SAVE_INVENTORY_LINES = "autoSaveInventoryLines"; + public ActionForward autoSaveInventoryLines(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException, IOException + { + ActionForward fwd=init(mapping,form,request,response); + + if(fwd!=null) + { + return fwd; + } + + String inventoryCart = Constants.INVENTORY_CART; + String inventoryCartItems = Constants.INVENTORY_CART_ITEMS; + + InventoryCartBean cartBean = (InventoryCartBean) request.getSession().getAttribute(inventoryCart); + + Properties ctx=TmkJSPEnv.getCtx(request); + + String description = request.getParameter("description"); + String priceListIdAsStr = request.getParameter("priceListId"); + String inventoryIdAsStr = request.getParameter("inventoryId"); + int priceListId = Integer.parseInt(priceListIdAsStr); + int inventoryId = Integer.parseInt(inventoryIdAsStr); + + DefaultForm df = (DefaultForm)form; + InventoryLineBean bean = (InventoryLineBean) df.getBean(); + bean.setPriceListId(priceListId); + bean.setDescription(description); + bean.setInventoryId(inventoryId); + df.populate(bean); + + String docNo = null; + String docStatus = null; + String docInfo = null; + + MInventory inventory=null; + Trx trx = Trx.get(TrxPrefix.getPrefix(),true); + + ArrayList items = (ArrayList) request.getSession().getAttribute(Constants.INVENTORY_CART_ITEMS); + + if(bean.getInventoryId() == null || bean.getInventoryId() == 0) + { + inventory= InventoryCartManager.createInventory(ctx,bean.getDescription(),null); + docNo = inventory.getDocumentNo(); + docStatus = inventory.getDocStatus(); + docInfo = inventory.getDocumentInfo(); + bean.setDocumentNo(docNo); + bean.setInventoryId(inventory.get_ID()); + } + else + { + MInventory inventory2 = new MInventory(ctx, bean.getInventoryId(),null); + inventory2.setDescription(description); + docNo = inventory2.getDocumentNo(); + docStatus = inventory2.getDocStatus(); + docInfo = inventory2.getDocumentInfo(); + inventory2.save(); + + InventoryCartManager.deleteInventoryLines(ctx, inventory2.getM_Inventory_ID()); + } + + + try + { + trx.start(); + + for (ItemBean itemBean : items) + { + InventoryCartManager.addInventoryLine(ctx, bean.getInventoryId(), itemBean.getProductId() , itemBean.getQtyBook(), itemBean.getQtyCount(), itemBean.getQtyCsv(), true, trx.getTrxName()); + } + + trx.commit(); + } + catch(CannotCreateInventoryLineException e) + { + trx.rollback(); + ArrayList list = InventoryManager.getInventoryLines(ctx,bean.getInventoryId()); + request.getSession().setAttribute(Constants.INVENTORY_LINE_LIST,list); + request.getSession().setAttribute(Constants.INVENTORY_ID,bean.getInventoryId()); + postGlobalError("error.cannot.create.inventory.line",request); + return mapping.getInputForward(); + } + catch(ProductNotFoundException e) + { + postGlobalError("error.product.name.required",request); + ArrayList list = InventoryManager.getInventoryLines(ctx,bean.getInventoryId()); + request.getSession().setAttribute(Constants.INVENTORY_LINE_LIST,list); + request.getSession().setAttribute(Constants.INVENTORY_ID,bean.getInventoryId()); + return mapping.getInputForward(); + } + + catch(OperationException e) + { + trx.rollback(); + ArrayList list = InventoryManager.getInventoryLines(ctx,bean.getInventoryId()); + request.setAttribute(Constants.INVENTORY_LINE_LIST,list); + request.setAttribute(Constants.INVENTORY_ID,bean.getInventoryId()); + throw new OperationException(e); + } + finally + { + trx.close(); + } + + df.populate(bean); + ArrayList list = InventoryManager.getInventoryLines(ctx,bean.getInventoryId()); + request.getSession().setAttribute(Constants.DOC_NO, docNo); + request.getSession().setAttribute(Constants.DOC_STATUS, docStatus); + request.getSession().setAttribute(Constants.INVENTORY_LINE_LIST,list); + request.getSession().setAttribute(Constants.INVENTORY_ID, bean.getInventoryId()); + request.getSession().setAttribute(Constants.DESCRIPTION, description); + + Env.setContext(ctx, Constants.INVENTORY_ID, bean.getInventoryId()); + Env.setContext(ctx, Constants.DESCRIPTION, description); + + request.getSession().setAttribute(Constants.INVENTORY_ID, bean.getInventoryId()); + + if((MInventory.DOCSTATUS_Drafted).equals(docStatus)) + { + docStatus = "DRAFTED"; + } + + if((MInventory.DOCSTATUS_Completed).equals(docStatus)) + { + docStatus = "COMPLETED"; + } + + if((MInventory.DOCSTATUS_Closed).equals(docStatus)) + { + docStatus = "CLOSED"; + } + + StringBuffer sb = new StringBuffer(); + sb.append("{"); + sb.append("inventoryID: \"" + bean.getInventoryId() + "\""); + sb.append(", docNo: \"" + docNo + "\""); + sb.append(", docStatus: \"" + docStatus + "\""); + sb.append(", docInfo: \"" + docInfo + "\""); + sb.append(", description: \"" + bean.getDescription() + "\""); + sb.append("}"); + + PrintWriter writer = response.getWriter(); + writer.print( sb.toString() ); + writer.flush(); + writer.close(); + + return null; + } + + public static final String GENERATE_INVENTORY_CSV = "generateInventoryCSV"; + public ActionForward generateInventoryCSV(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException, IOException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx =TmkJSPEnv.getCtx(request); + InventoryLineForm If = (InventoryLineForm)form; + InventoryLineBean bean = (InventoryLineBean) If.getBean(); + + ArrayList items = (ArrayList) request.getSession().getAttribute(Constants.INVENTORY_CART_ITEMS); + String reportName = InventoryCartManager.createCSVForInventory(ctx,items); + String reportURI = ReportManager.getReportURI(reportName,request); + response.sendRedirect(reportURI); + + return null; + + } + + public ActionForward printInventory(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException, IOException, SQLException, DocumentException, ParseException + { + Properties ctx = TmkJSPEnv.getCtx(request); + DefaultForm df = (DefaultForm) form; + InventoryLineBean bean = (InventoryLineBean) df.getBean(); + Trx trx = Trx.get(TrxPrefix.getPrefix(),true); + String description = Env.getContext(ctx, Constants.DESCRIPTION); + + String inventoryCart = Constants.INVENTORY_CART; + String inventoryCartItems = Constants.INVENTORY_CART_ITEMS; + + InventoryCartBean cartBean = (InventoryCartBean) request.getSession().getAttribute(inventoryCart); + + ArrayList items = (ArrayList) request.getSession().getAttribute(Constants.INVENTORY_CART_ITEMS); + ArrayList reportData = InventoryCartManager.getInventoryData(ctx, items, trx.getTrxName()); + + String title = description; + String subtitle = null; + byte printData[] = null; + + String sql = "Select Name from AD_Org where AD_org_ID=?"; + PreparedStatement pstmt = null; + ResultSet rs = null; + + pstmt = DB.prepareStatement(sql, null); + pstmt.setInt(1, Env.getAD_Org_ID(ctx)); + + try + { + rs = pstmt.executeQuery(); + + if (rs.next()) + { + subtitle = rs.getString(1); + } + + } + catch(SQLException e) + { + throw new OperationException(e); + } + finally + { + DBUtils.close(rs); + DBUtils.close(pstmt); + } + + //constructing the table + TabularReport tReport = new TabularReport(reportData); + tReport.setSortable(false); + tReport.setStyle("display"); + tReport.setTitle(title); + tReport.setSubtitle(subtitle); + tReport.createReport(); + + printData = tReport.getInventoryData(); + response.setContentType("application/pdf"); + + OutputStream os = response.getOutputStream(); + os.write(printData); + os.flush(); + os.close(); + + return null; + + } + + public static final String COMPLETE_INVENTORY_ADJUSTMENT="completeInventoryAdjustment"; + public ActionForward completeInventoryAdjustment(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException, IOException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx =TmkJSPEnv.getCtx(request); + Trx trx = Trx.get(TrxPrefix.getPrefix(),true); + + InventoryLineForm If = (InventoryLineForm)form; + InventoryLineBean bean = (InventoryLineBean) If.getBean(); + + ArrayList items = (ArrayList) request.getSession().getAttribute(Constants.INVENTORY_CART_ITEMS); + + try + { + + if(bean.getInventoryId() == null || bean.getInventoryId()==0) + { + MInventory inventory= InventoryCartManager.createInventory(ctx,bean.getDescription(),null); + bean.setInventoryId(inventory.get_ID()); + bean.setDocumentNo(inventory.getDocumentNo()); + bean.setDocStatus(inventory.getDocStatus()); + inventory.save(); + + trx.start(); + + for (ItemBean itemBean : items) + { + InventoryCartManager.addInventoryLine(ctx, bean.getInventoryId(), itemBean.getProductId() , itemBean.getQtyBook(), itemBean.getQtyCount(), itemBean.getQtyCsv(), true, trx.getTrxName()); + } + + trx.commit(); + + InventoryManager.completeStockAdjustment(ctx,bean.getInventoryId()); + } + else + { + InventoryCartManager.deleteInventoryLines(ctx, bean.getInventoryId()); + + trx.start(); + + for (ItemBean itemBean : items) + { + InventoryCartManager.addInventoryLine(ctx, bean.getInventoryId(), itemBean.getProductId() , itemBean.getQtyBook(), itemBean.getQtyCount(), itemBean.getQtyCsv(), true, trx.getTrxName()); + } + + trx.commit(); + + + + InventoryManager.completeStockAdjustment(ctx,bean.getInventoryId()); + } + + } + catch (OperationException e) + { + trx.rollback(); + trx.close(); + } + + request.setAttribute(Constants.DOC_NO, null); + request.setAttribute(Constants.DOC_STATUS, null); + + request.setAttribute("cartTotalCsv", null); + request.setAttribute("cartTotalBook", null); + request.setAttribute("cartTotalCount", null); + + ArrayList list = InventoryManager.getInventoryLines(ctx,bean.getInventoryId()); + request.setAttribute(Constants.COMPLETED_INVENTORY_LINE_LIST, list); + + request.setAttribute(Constants.INVENTORY_LINE_LIST, null); + request.setAttribute(Constants.INVENTORY_ID, null); + + InventoryCartManager.clearInventorycart(ctx, request); + + return mapping.findForward(COMPLETE_INVENTORY_ADJUSTMENT); + } + + public static final String ADD_STOCK_SHEETS = "addStockSheets"; + public ActionForward addStockSheets(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + DefaultForm df = (DefaultForm) form; + FormFile file = df.getFile(); + + if(file.getFileName().trim().equals("")) + { + postGlobalError("error.file.not.found", request); + return mapping.getInputForward(); + } + + Properties ctx =TmkJSPEnv.getCtx(request); + Trx trx = Trx.get(TrxPrefix.getPrefix(),true); + + InventoryLineForm If = (InventoryLineForm)form; + InventoryLineBean bean = (InventoryLineBean) If.getBean(); + request.getSession().removeAttribute(Constants.IMPORT_FAIL_CSV_FILE); + + String inventoryCart = Constants.INVENTORY_CART; + String inventoryCartItems = Constants.INVENTORY_CART_ITEMS; + + ArrayList items = (ArrayList) request.getSession().getAttribute(inventoryCartItems); + + InventoryCartBean cartBean = (InventoryCartBean) request.getSession().getAttribute(inventoryCart); + + try + { + cartBean = InventoryCartManager.addItemsFromCsv(ctx, file, bean, cartBean, trx.getTrxName()); + } + catch(Exception e) + { + + String message = e.getMessage(); + + + if(message != null) + { + int index = message.indexOf("csv"); + String filename = message.substring(0,index+3); + String error = message.substring(index+3); + postGlobalError("error.process", error, request); + String csvURI = ReportManager.getReportURI(filename,request); + request.getSession().setAttribute(Constants.IMPORT_FAIL_CSV_FILE, csvURI); + } + else + { + postGlobalError("error.process", e.toString() , request); + } + + return new ActionForward("/jsp/pos/inventoryImportErrors.jsp"); + } + finally + { + + } + + request.getSession().setAttribute(inventoryCart, cartBean); + request.getSession().setAttribute(inventoryCartItems, cartBean.getItems()); + + return new ActionForward("/initInventoryCart.do"); + + } + + public ActionForward newInventoryCart(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception + { + Properties ctx =TmkJSPEnv.getCtx(request); + InventoryCartManager.clearInventorycart(ctx, request); + return new ActionForward("/initInventoryCart.do"); + } + + +} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/POSAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/POSAction.java new file mode 100644 index 0000000000..4e704ac2bb --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/pos/POSAction.java @@ -0,0 +1,50 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 25-Jul-2005 by alok + * + */ + +package org.posterita.struts.pos; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; + +import org.posterita.exceptions.ApplicationException; +import org.posterita.struts.core.BaseAction; + +public class POSAction extends BaseAction +{ + public static final String POS_LOGIN = "posLogin"; + + public final ActionForward init(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException + { + ActionForward fwd = super.init(mapping,form,request,response); + + if(fwd!=null) + { + return mapping.findForward(POS_LOGIN); + } + + return fwd; + } +} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/POSAttributesAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/POSAttributesAction.java new file mode 100644 index 0000000000..a2e96fcf59 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/pos/POSAttributesAction.java @@ -0,0 +1,140 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +* Created on May 23, 2006 by ashley +* +*/ + +package org.posterita.struts.pos; + +import java.util.ArrayList; +import java.util.Properties; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.action.ActionErrors; +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.compiere.util.KeyNamePair; +import org.compiere.util.Trx; +import org.posterita.Constants; +import org.posterita.beans.AttributeValueDetailBean; +import org.posterita.beans.ProductKeywordsBean; +import org.posterita.businesslogic.AttributeValuesManager; +import org.posterita.businesslogic.administration.ProductManager; +import org.posterita.core.TmkJSPEnv; +import org.posterita.core.TrxPrefix; +import org.posterita.form.EditAttributeForm; +import org.posterita.struts.core.DefaultForm; + +public class POSAttributesAction extends POSDispatchAction +{ + public static final String INIT_VIEW_ATTRIBUTEVALUES = "initViewAttributeValues"; + public ActionForward initViewAttributeValues(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws Exception + { + ActionForward fwd = init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + ArrayList attributeList = AttributeValuesManager.getAttributes(ctx); + + request.getSession().setAttribute(Constants.ATTRIBUTE_LIST, attributeList); + + return mapping.findForward(INIT_VIEW_ATTRIBUTEVALUES); + } + + public static final String LIST_ATTRIBUTEVALUES = "listAttributeValues"; + public ActionForward listAttributeValues(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws Exception + { + ActionForward fwd = init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + DefaultForm df = (DefaultForm)form; + + AttributeValueDetailBean attrValBean = (AttributeValueDetailBean)df.getBean(); + + ArrayList attributeValuesList = AttributeValuesManager.getAttributeValues(ctx, attrValBean.getAttributeId().intValue()); + + request.setAttribute(Constants.ATTRIBUTE_VALUES_LIST, attributeValuesList); + + return mapping.findForward(LIST_ATTRIBUTEVALUES); + } + + public static final String INIT_EDIT_ATTRIBUTEVALUE = "initEditAttributeValue"; + public ActionForward initEditAttributeValue(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws Exception + { + ActionForward fwd = init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + return mapping.findForward(INIT_EDIT_ATTRIBUTEVALUE); + } + + public static final String EDIT_ATTRIBUTEVALUE = "editAttributeValue"; + /*public ActionForward editAttributeValue(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws Exception + { + ActionForward fwd = init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + EditAttributeForm df = (EditAttributeForm)form; + ActionErrors errors = df.validate(mapping,request); + + if(!errors.isEmpty()) + { + postGlobalError("error.required","New Name",request); + return mapping.getInputForward(); + } + + AttributeValueDetailBean attrBean = (AttributeValueDetailBean)df.getBean(); + + Trx trx = Trx.get(TrxPrefix.getPrefix(), true); + + + try + { + trx.start(); + int newAttrValueId = AttributeValuesManager.changeAttributeValue(ctx, attrBean.getAttributeValueId().intValue(), attrBean.getNewName(), trx.getTrxName()); + ProductManager.updateProductsAttribute(ctx, attrBean.getAttributeValueId().intValue(), newAttrValueId, attrBean.getAttributeId().intValue(), trx.getTrxName()); + trx.commit(); + } + catch(Exception ex) + { + trx.rollback(); + postGlobalError("error.updating.attribute", request); + return mapping.getInputForward(); + } + finally + { + trx.close(); + } + + + return mapping.findForward(EDIT_ATTRIBUTEVALUE); + } */ + +} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/POSDispatchAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/POSDispatchAction.java new file mode 100644 index 0000000000..9b740400e7 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/pos/POSDispatchAction.java @@ -0,0 +1,46 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 25-Jul-2005 by alok + * + */ + +package org.posterita.struts.pos; + + + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.posterita.core.TmkJSPEnv; +import org.posterita.exceptions.ApplicationException; +import org.posterita.struts.core.BaseDispatchAction; + +public class POSDispatchAction extends BaseDispatchAction +{ + + public ActionForward init(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException + { + TmkJSPEnv.getCtx(request); + return super.init(mapping, form, request, response); + + } +} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/POSGoodsAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/POSGoodsAction.java new file mode 100644 index 0000000000..3dad34919a --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/pos/POSGoodsAction.java @@ -0,0 +1,1457 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Created on 27-Apr-2006 + */ + + +package org.posterita.struts.pos; + +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Properties; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.compiere.model.MBPartner; +import org.compiere.model.MInOut; +import org.compiere.model.MOrder; +import org.compiere.model.MPayment; +import org.compiere.model.MProduct; +import org.compiere.process.DocAction; +import org.compiere.process.DocumentEngine; +import org.compiere.util.KeyNamePair; +import org.compiere.util.Trx; +import org.posterita.Constants; +import org.posterita.beans.ItemBean; +import org.posterita.beans.OrderBean; +import org.posterita.beans.OrderLineBean; +import org.posterita.beans.POSSupplierBean; +import org.posterita.beans.ProductBean; +import org.posterita.beans.ShoppingCartBean; +import org.posterita.beans.WebDocumentBean; +import org.posterita.businesslogic.OrderManager; +import org.posterita.businesslogic.OrderReferenceManager; +import org.posterita.businesslogic.POSGoodsManager; +import org.posterita.businesslogic.POSManager; +import org.posterita.businesslogic.POSProductManager; +import org.posterita.businesslogic.POSTerminalManager; +import org.posterita.businesslogic.administration.BPartnerManager; +import org.posterita.businesslogic.administration.RoleManager; +import org.posterita.businesslogic.stock.StockManager; +import org.posterita.core.SessionStorage; +import org.posterita.core.TmkJSPEnv; +import org.posterita.core.TrxPrefix; +import org.posterita.core.bean.ElementBean; +import org.posterita.core.businesslogic.ElementManager; +import org.posterita.exceptions.ApplicationException; +import org.posterita.exceptions.BPartnerNoLocationException; +import org.posterita.exceptions.BPartnerOverCreditLimitException; +import org.posterita.exceptions.InputQuantityLessThanZeroException; +import org.posterita.exceptions.InvalidOrderIDException; +import org.posterita.exceptions.NoOrderLineFoundException; +import org.posterita.exceptions.OperationException; +import org.posterita.exceptions.ProductNotFoundException; +import org.posterita.exceptions.ProductNotOnPriceListException; +import org.posterita.exceptions.QuantityNotAvailableException; +import org.posterita.exceptions.UOMValuePrecisionNotValidException; +import org.posterita.form.OrderLineForm; +import org.posterita.form.POSProductForm; +import org.posterita.lib.UdiConstants; +import org.posterita.order.UDIOrderTypes; +import org.posterita.struts.core.DefaultForm; + + +public class POSGoodsAction extends POSDispatchAction +{ + public static final String CREATE_POS_GOODS_RECEIVE_NOTE="createPOSGoodsReceiveNote"; + public ActionForward createPOSGoodsReceiveNote(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException, IOException + { + ActionForward fwd= init(mapping,form,request,response); + + if(fwd!=null) + return fwd; + + Properties ctx=TmkJSPEnv.getCtx(request); + DefaultForm df= (DefaultForm) form; + OrderLineBean bean=(OrderLineBean) df.getBean(); + + Integer bPartnerId = bean.getBpartnerId(); + String supplierRef = bean.getDescription(); + + MOrder previousOrder= null; + previousOrder=(MOrder)request.getSession().getAttribute(Constants.PRESENT_GRN_ORDER); + + if(previousOrder!=null) + { + bean.setOrderId(Integer.valueOf(previousOrder.get_ID())); + } + else + { + bean.setOrderId(null); + } + + if( bPartnerId == null ) + { + //see if we have previously saved bpartnerId + bPartnerId= (Integer) request.getSession().getAttribute(Constants.B_PARTNER_ID); + } + else + { + //set the new bpartnerId in session + request.getSession().setAttribute(Constants.B_PARTNER_ID, bPartnerId); + } + + if( supplierRef == null ) + { + //see if we have previously saved supplierRef + supplierRef=(String) request.getSession().getAttribute(Constants.DESCRIPTION); + } + else + { + //set new supplierRef in session + request.getSession().setAttribute(Constants.DESCRIPTION, supplierRef); + } + + if( bPartnerId == null ) + { + postGlobalError("error.required.supplierName", request); + return mapping.getInputForward(); + } + + + ShoppingCartBean cartBean = (ShoppingCartBean) request.getSession().getAttribute(Constants.GOODS_RECEIVE_NOTE_SHOPPING_CART); + + if(cartBean == null||cartBean.getItems() == null||cartBean.getItems().size() == 0) + { + postGlobalError("error.pos.shoppingcart.empty",request); + return mapping.getInputForward(); + } + + MOrder goodsReceiveNote = null; + + Trx trx = Trx.get(TrxPrefix.getPrefix(),true); + + try + { + trx.start(); + goodsReceiveNote = POSGoodsManager.createGoodsReceiveNote(ctx,bean,cartBean.getItems(),bPartnerId,supplierRef,trx.getTrxName()); + trx.commit(); + } + catch(BPartnerNoLocationException ex) + { + trx.rollback(); + postGlobalError("error.bpartner.nolocation", request); + return mapping.getInputForward(); + } + catch(OperationException e) + { + trx.rollback(); + throw (e); + } + finally + { + trx.close(); + } + + // Reset transaction as it has already been committed and closed + goodsReceiveNote.set_TrxName(null); + + bean.setOrderId(Integer.valueOf(goodsReceiveNote.get_ID())); + + df.populate(new OrderLineBean()); + WebDocumentBean webBean = OrderReferenceManager.getWebOrderBean(ctx,goodsReceiveNote); + ArrayList list = POSManager.populateOrderLines(ctx,goodsReceiveNote); + WebDocumentBean documentBean=POSManager.calculateOrderTotals(list); + + request.getSession().setAttribute(Constants.GOODS_RECEIVE_NOTE_ID,goodsReceiveNote.get_ID()); + request.setAttribute(Constants.GOODS_RECEIVE_NOTE_LINES,list); + SessionStorage.putCompleteOrderInfo(ctx,request,webBean,documentBean); +/* SessionStorage.putCompleteOrderInfo(ctx,request,webBean,documentBean);*/ + request.getSession().removeAttribute(Constants.PRESENT_GRN_ORDER); + request.getSession().removeAttribute(Constants.PRESENT_GRN_ORDER_ID); + + return mapping.findForward(CREATE_POS_GOODS_RECEIVE_NOTE); + } + + public static final String COMPLETE_GOODS_RECEIVE_NOTE="completeGoodsReceiveNote"; + public ActionForward completeGoodsReceiveNote(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx=TmkJSPEnv.getCtx(request); + DefaultForm df= (DefaultForm) form; + //OrderLineBean bean=(OrderLineBean) df.getBean(); + Integer goodsReceiveNoteId=(Integer) request.getSession().getAttribute(Constants.GOODS_RECEIVE_NOTE_ID); + + MOrder completedGRN=null; + + Trx trx =Trx.get(TrxPrefix.getPrefix(),true); + + if(goodsReceiveNoteId==null) + { + postGlobalError("error.no.order.exists",request); + return mapping.getInputForward(); + } + + try + { + trx.start(); + completedGRN=POSGoodsManager.createAndCompletePODocuments(ctx,goodsReceiveNoteId,null); + trx.commit(); + } + catch(NoOrderLineFoundException e) + { + trx.rollback(); + postGlobalError("error.pos.no.orderline",request); + request.getSession().removeAttribute(Constants.GOODS_RECEIVE_NOTE_SHOPPING_CART); + request.getSession().removeAttribute(Constants.GOODS_RECEIVE_NOTE_SHOPPING_CART_ITEMS); + return mapping.getInputForward(); + } + catch(OperationException e) + { + trx.rollback(); + throw new OperationException("Could not complete documents. Reason: " + e); + + } + finally + { + trx.close(); + } + + + + df.populate(new OrderLineBean()); + WebDocumentBean webBean = OrderReferenceManager.getWebOrderBean(ctx,completedGRN); + ArrayList list = POSManager.populateOrderLines(ctx,completedGRN); + WebDocumentBean documentBean=POSManager.calculateOrderTotals(list); + + //request.getSession().setAttribute(Constants.GOODS_RECEIVE_NOTE_ID,completedGRN.get_ID()); + request.setAttribute(Constants.GOODS_RECEIVE_NOTE_LINES,list); + /*request.removeAttribute(Constants.POS_ORDER_LINES);*/ + + + + SessionStorage.putCompleteOrderInfo(ctx,request,webBean,documentBean); + request.getSession().removeAttribute(Constants.ALL_CUSTOMERS); + request.getSession().removeAttribute(Constants.GOODS_RECEIVE_NOTE_SHOPPING_CART); + request.getSession().removeAttribute(Constants.GOODS_RECEIVE_NOTE_SHOPPING_CART_ITEMS); + request.getSession().removeAttribute(Constants.DESCRIPTION); + request.getSession().removeAttribute(Constants.B_PARTNER_ID); + request.getSession().removeAttribute(Constants.GOODS_RECEIVE_NOTE_ID); + request.getSession().removeAttribute(Constants.DESCRIPTION); + request.getSession().removeAttribute(Constants.PRESENT_GRN_ORDER); + request.getSession().removeAttribute(Constants.PRESENT_GRN_ORDER_ID); + + request.removeAttribute(Constants.DESCRIPTION); + + return mapping.findForward(COMPLETE_GOODS_RECEIVE_NOTE); + } + + + public static final String CREATE_POS_GOODS_RETURN_NOTE="createPOSGoodsReturnNote"; + public ActionForward createPOSGoodsReturnNote(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx=TmkJSPEnv.getCtx(request); + DefaultForm df= (DefaultForm) form; + OrderLineBean bean=(OrderLineBean) df.getBean(); + + + Integer bPartnerId = bean.getBpartnerId(); + String supplierRef = bean.getDescription(); + BigDecimal quantity = bean.getQuantity(); + + if( bPartnerId == null ) + { + //see if we have previously saved bpartnerId + bPartnerId= (Integer) request.getSession().getAttribute(Constants.B_PARTNER_ID); + } + else + { + //set the new bpartnerId in session + request.getSession().setAttribute(Constants.B_PARTNER_ID, bPartnerId); + } + + if ( quantity == null) + { + throw new OperationException("Quantity cannot be null"); + } + if( quantity.equals(0) == true) + { + throw new OperationException("Quantity cannot be zero"); + } + + if( supplierRef == null ) + { + //see if we have previously saved supplierRef + supplierRef=(String) request.getSession().getAttribute(Constants.DESCRIPTION); + } + else + { + //set new supplierRef in session + request.getSession().setAttribute(Constants.DESCRIPTION, supplierRef); + } + + if( bPartnerId == null ) + { + postGlobalError("error.required.supplierName", request); + return mapping.getInputForward(); + } + + ArrayList items = (ArrayList) request.getSession().getAttribute(Constants.SHOPPING_ORDER_CART_ITEMS); + //ShoppingCartBean cartBean = (ShoppingCartBean) request.getSession().getAttribute(Constants.CUSTOMER_RETURN_ORDER_SHOPPING_CART); + + if(items == null || items.size() == 0) + { + postGlobalError("error.pos.shoppingcart.empty",request); + return mapping.getInputForward(); + } + + MOrder previousOrder= null; + previousOrder=(MOrder)request.getSession().getAttribute(Constants.PRESENT_GOODS_RET_ORDER); + + if(previousOrder!=null) + { + bean.setOrderId(Integer.valueOf(previousOrder.get_ID())); + } + else + { + bean.setOrderId(null); + } + MOrder goodsReturnNote=null; + + Trx trx = Trx.get(TrxPrefix.getPrefix(),true); + + bean.getDescription(); + try + { + trx.start(); + goodsReturnNote= POSGoodsManager.createGoodsReturnNote(ctx,bean,items,bPartnerId,supplierRef,trx.getTrxName()); + trx.commit(); + + } + catch(BPartnerOverCreditLimitException e1) + { + trx.rollback(); + postGlobalError("error.bpartner.over.credit.limit",e1.getMessage(),request); + return mapping.getInputForward(); + } + + catch(BPartnerNoLocationException ex) + { + trx.rollback(); + postGlobalError("error.bpartner.nolocation", request); + return mapping.getInputForward(); + } + catch (OperationException e) + { + trx.rollback(); + throw new OperationException("Could not create goods return note: Reason :" + e); + } + finally + { + trx.close(); + } + bean.setOrderId(Integer.valueOf(goodsReturnNote.get_ID())); + + df.populate(new OrderLineBean()); + WebDocumentBean webBean = OrderReferenceManager.getWebOrderBean(ctx,goodsReturnNote); + ArrayList list = POSManager.populateOrderLines(ctx,goodsReturnNote); + WebDocumentBean documentBean=POSManager.calculateOrderTotals(list); + request.setAttribute(Constants.GOODS_RETURN_NOTE_LINES,list); + request.getSession().setAttribute(Constants.GOODS_RETURN_NOTE_ID,goodsReturnNote.get_ID()); + SessionStorage.putCompleteOrderInfo(ctx,request,webBean,documentBean); + + request.getSession().removeAttribute(Constants.PRESENT_GOODS_RET_ORDER); + request.getSession().removeAttribute(Constants.PRESENT_GOODS_RET_ORDER_ID); + + return mapping.findForward(CREATE_POS_GOODS_RETURN_NOTE); + } + + + public static final String COMPLETE_GOODS_RETURN_NOTE="completeGoodsReturnNote"; + public ActionForward completeGoodsReturnNote(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx=TmkJSPEnv.getCtx(request); + DefaultForm df= (DefaultForm) form; + //OrderLineBean bean=(OrderLineBean) df.getBean(); + Integer goodsReturnNoteId=(Integer) request.getSession().getAttribute(Constants.GOODS_RETURN_NOTE_ID); + + Trx trx = Trx.get(TrxPrefix.getPrefix(),true); + + MOrder completedGRetN=null; + + + if(goodsReturnNoteId==null) + { + postGlobalError("error.no.order.exists",request); + return mapping.getInputForward(); + } + + try + { + trx.start(); + completedGRetN=POSGoodsManager.createAndCompletePODocuments(ctx,goodsReturnNoteId,null);//same sort of order i.e. sales Order + trx.commit(); + } + catch(BPartnerOverCreditLimitException e1) + { + trx.rollback(); + postGlobalError("error.bpartner.over.credit.limit",e1.getMessage(),request); + return mapping.getInputForward(); + } + catch(NoOrderLineFoundException e) + { + trx.rollback(); + postGlobalError("error.pos.no.orderline",request); + request.getSession().removeAttribute(Constants.GOODS_RETURN_NOTE_SHOPPING_CART); + request.getSession().removeAttribute(Constants.GOODS_RETURN_NOTE_SHOPPING_CART_ITEMS); + return mapping.getInputForward(); + } + + catch(OperationException e) + { + trx.rollback(); + throw new OperationException("Could not complete documents. Reason : " + e); + } + finally + { + trx.close(); + } + + df.populate(new OrderLineBean()); + WebDocumentBean webBean = OrderReferenceManager.getWebOrderBean(ctx,completedGRetN); + ArrayList list = POSManager.populateOrderLines(ctx,completedGRetN); + WebDocumentBean documentBean=POSManager.calculateOrderTotals(list); + request.setAttribute(Constants.GOODS_RETURN_NOTE_LINES,list); + //request.getSession().setAttribute(Constants.GOODS_RETURN_NOTE_ID,completedGRetN.get_ID()); + SessionStorage.putCompleteOrderInfo(ctx,request,webBean,documentBean); + request.getSession().removeAttribute(Constants.ALL_CUSTOMERS); + request.getSession().removeAttribute(Constants.GOODS_RETURN_NOTE_SHOPPING_CART); + request.getSession().removeAttribute(Constants.GOODS_RETURN_NOTE_SHOPPING_CART_ITEMS); + request.getSession().removeAttribute(Constants.GOODS_RETURN_NOTE_ID); + request.getSession().removeAttribute(Constants.B_PARTNER_ID); + request.getSession().removeAttribute(Constants.DESCRIPTION); + request.getSession().removeAttribute(Constants.PRESENT_GOODS_RET_ORDER); + request.getSession().removeAttribute(Constants.PRESENT_GOODS_RET_ORDER_ID); + + + request.removeAttribute(Constants.DESCRIPTION); + + return mapping.findForward(COMPLETE_GOODS_RETURN_NOTE); + } + + //public static final String GET_ALL_VENDORS="getAllVendors"; + public ActionForward getAllVendors(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd=init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx=TmkJSPEnv.getCtx(request); + HttpSession session = request.getSession(); + + DefaultForm df = (DefaultForm) form; + OrderLineBean b = (OrderLineBean) df.getBean(); + + OrderLineForm f = (OrderLineForm) form; + OrderLineBean bean = new OrderLineBean(); + + Integer bPartnerId = (Integer) session.getAttribute(Constants.B_PARTNER_ID); + String description = (String) session.getAttribute(Constants.DESCRIPTION); + + bean.setBpartnerId(bPartnerId); + bean.setDescription(description); + + f.populate(bean); + + ArrayList list=POSGoodsManager.getAllSuppliers(ctx); + + session.setAttribute(Constants.BP_LIST,list); + return mapping.findForward(POSGoodsManager.getForward(ctx,b.getIsSales())); + } + + public static final String ADD_TO_SHOPPING_CART = "addToShoppingCart"; + public ActionForward addToShoppingCart(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception + { + Properties ctx = TmkJSPEnv.getCtx(request); + DefaultForm df = (DefaultForm) form; + OrderLineBean bean = (OrderLineBean) df.getBean(); + + String orderType = bean.getOrderType(); + String shoppingCart = null; + String shoppingCartItem = null; + + if(orderType.equals(Constants.GOODS_RECEIVE_NOTE)) + { + shoppingCart = Constants.GOODS_RECEIVE_NOTE_SHOPPING_CART; + shoppingCartItem = Constants.GOODS_RECEIVE_NOTE_SHOPPING_CART_ITEMS; + + } + else if(orderType.equals(Constants.GOODS_RETURN_NOTE)) + { + shoppingCart = Constants.GOODS_RETURN_NOTE_SHOPPING_CART; + shoppingCartItem = Constants.GOODS_RETURN_NOTE_SHOPPING_CART_ITEMS; + + + } + else if(orderType.equals(Constants.CUSTOMER_RETURN_ORDER)) + { + shoppingCart = Constants.CUSTOMER_RETURN_ORDER_SHOPPING_CART; + shoppingCartItem = Constants.CUSTOMER_RETURN_ORDER_SHOPPING_CART_ITEMS; + + + } + + String currSymboleSales = POSTerminalManager.getDefaultSalesCurrency(ctx).getCurSymbol(); + request.setAttribute(Constants.CURRENCY_SYMBOLE,currSymboleSales); + + + ShoppingCartBean cartBean = (ShoppingCartBean) request.getSession().getAttribute(shoppingCart); + + try + { + //POSManager.getQtyAndItem(bean); + if(bean.getProductId()==null && bean.getBarCode()==null) + { + postGlobalError("error.barcode.required", request); + return mapping.getInputForward(); + } + + if(bean.getQuantity().doubleValue() <= 0) + { + postGlobalError("error.invalid.inputQty", request); + return mapping.getInputForward(); + } + + cartBean = StockManager.addToPOSCart(ctx, bean, cartBean,Boolean.parseBoolean(bean.getIsSales()),Boolean.parseBoolean(bean.getIfAdd())); + } + catch (InputQuantityLessThanZeroException e1) + { + postGlobalError("error.invalid.inputQty", request); + return mapping.getInputForward(); + } + catch (ProductNotFoundException e2) + { + postGlobalError("error.product.not.found", e2.getMessage(), request); + return mapping.getInputForward(); + } + catch(QuantityNotAvailableException e3) + { + postGlobalError("error.quantity.notAvailable", e3.getMessage(), request); + return mapping.getInputForward(); + } + + catch(ProductNotOnPriceListException e4) + { + postGlobalError("error.product.price.not.found", e4.getMessage(), request); + return mapping.getInputForward(); + } + + catch (UOMValuePrecisionNotValidException e) + { + postGlobalError("error.precision", e.getMessage(), request); + return mapping.getInputForward(); + } + request.getSession().setAttribute(Constants.DESCRIPTION, bean.getDescription()); + bean.setDescription(bean.getDescription()); + request.getSession().setAttribute(shoppingCart, cartBean); + request.getSession().setAttribute(shoppingCartItem, cartBean.getItems()); + request.getSession().setAttribute(Constants.B_PARTNER_ID,bean.getBpartnerId()); + + df.setQtyAndItem(""); + + return mapping.findForward(ADD_TO_SHOPPING_CART); + } + + public static final String SET_SUPPLIER="setSupplier"; + public ActionForward setSupplier(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd=init(mapping,form,request,response); + if(fwd!=null) + return fwd; + //Properties ctx=TmkJSPEnv.getCtx(request); + DefaultForm df = (DefaultForm)form; + POSSupplierBean bean = (POSSupplierBean)df.getBean(); + request.getSession().setAttribute(Constants.B_PARTNER_ID,bean.getBpartnerId()); + return mapping.findForward(SET_SUPPLIER); + } + + //NOTE:this does not select the actualy product category of compiere,its gets all the revenue recognitions + //revenue reco is used to categorise the proucts + /*public static final String GET_PRODUCT_CATEGORY="getProductCategory"; + public ActionForward getProductCategory(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + + //warning if no productid is passed as a parameter the form + // will not return you the bean, it will be null. + + ActionForward fwd=init(mapping,form,request,response); + if(fwd!=null) + return fwd; + Properties ctx=TmkJSPEnv.getCtx(request); + POSProductForm pf = (POSProductForm)form; + pf.validate(mapping, request); + + ProductBean bean = (ProductBean) pf.getBean(); + + bean = POSProductManager.viewPOSProduct(ctx,bean.getProductId(), null); + bean.setProductType(MProduct.PRODUCTTYPE_Item); + pf.populate(bean); + + ArrayList list = POSGoodsManager.getAllRevenueRecos(ctx); + ArrayList supList=POSGoodsManager.getAllSuppliers(ctx); + ArrayList taxList=POSGoodsManager.getAllTaxCategory(ctx); + + ArrayList uomList = POSProductManager.getUoms(ctx, null); + + request.getSession().setAttribute(Constants.BP_LIST,supList); + request.getSession().setAttribute(Constants.PRODUCT_CATEGORY_ID,list); + request.getSession().setAttribute(Constants.TAX_CATEGORY_ID,taxList); + request.getSession().setAttribute(Constants.UOM_LIST, uomList); + + return mapping.findForward(GET_PRODUCT_CATEGORY); + }*/ + + + public static final String CREATE_CUSTOMER_RETURN_ORDER="createCustomerReturnOrder"; + public ActionForward createCustomerReturnOrder(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx=TmkJSPEnv.getCtx(request); + DefaultForm df= (DefaultForm) form; + OrderLineBean bean=(OrderLineBean) df.getBean(); + + HttpSession session = request.getSession(); + Integer bPartnerId = bean.getBpartnerId(); + + if( bPartnerId == null) + { + bPartnerId = (Integer) request.getSession().getAttribute(Constants.B_PARTNER_ID); + } + else + { + request.getSession().setAttribute(Constants.B_PARTNER_ID, bPartnerId); + } + + BigDecimal qty = bean.getQuantity(); + + if ( (qty == null) || (qty.doubleValue() <= 0) ) + { + postGlobalError("error.invalid.inputQty", request); + return mapping.getInputForward(); + } + + + String reason = bean.getDescription(); + + if( reason == null ) + { + reason = (String) session.getAttribute(Constants.DESCRIPTION); + + if( reason == null ) + { + postGlobalError("error.reason.required", request); + return mapping.getInputForward(); + } + } + else + { + session.setAttribute(Constants.DESCRIPTION, reason); + } + MOrder previousOrder= null; + previousOrder=(MOrder)request.getSession().getAttribute(Constants.PRESENT_CUSTOMER_RET_ORDER); + + if(previousOrder!=null) + { + bean.setOrderId(Integer.valueOf(previousOrder.get_ID())); + } + else + { + bean.setOrderId(null); + } + + String posOrderDocNumber = (String) request.getSession().getAttribute(Constants.POS_ORDER_DOC_NUMBER); + Integer paymentTermId =(Integer) request.getSession().getAttribute(Constants.CREDIT_PAYMENT_TERM_ID); + String orderType = (String) request.getSession().getAttribute(Constants.ORDER_TYPE); + + if(posOrderDocNumber!=null) + bean.setDocumentNo(posOrderDocNumber); + if(orderType!=null) + bean.setOrderType(orderType); + if(paymentTermId!=null) + bean.setPaymentTermId(paymentTermId); + if(bPartnerId==null) + bPartnerId=Integer.valueOf(POSTerminalManager.getCashBPartner(ctx).get_ID()); + + ArrayList items = (ArrayList) request.getSession().getAttribute(Constants.SHOPPING_ORDER_CART_ITEMS); + //ShoppingCartBean cartBean = (ShoppingCartBean) request.getSession().getAttribute(Constants.CUSTOMER_RETURN_ORDER_SHOPPING_CART); + + if(items == null || items.size() == 0) + { + postGlobalError("error.pos.shoppingcart.empty",request); + return mapping.getInputForward(); + } + + MOrder customerReturnOrder=null; + MInOut materitalReceipt = null; + + Trx trx = Trx.get(TrxPrefix.getPrefix(),true); + + try + { + trx.start(); + + /* + // Materital Receipt + String Description = "Test Material Receipt"; + int C_DocType_ID = 1000029; + int C_BPartner_ID = 1000000; + int M_Product_ID = 1000002; + BigDecimal Qty = BigDecimal.ONE; + int M_Warehouse_ID = 1000001; + boolean IsSOTrx = false; + String trxName = trx.getTrxName(); + + if(bPartnerId != 0) + { + C_BPartner_ID = bPartnerId; + } + + materitalReceipt = MinOutManager.createMateritalReceipt(ctx, C_DocType_ID, C_BPartner_ID, M_Warehouse_ID, IsSOTrx, trxName); + + ArrayList list = cartBean.getItems(); + + for (ItemBean itemBean : list) + { + MinOutManager.createMaterialReceiptLine(ctx, materitalReceipt.get_ID(), itemBean.getProductId(), new BigDecimal(itemBean.getQty()), trxName); + } + + // End Material Receipt + */ + + customerReturnOrder= POSGoodsManager.createCustomerReturn(ctx,bean,items,bPartnerId,reason,trx.getTrxName()); + trx.commit(); + } + catch(BPartnerNoLocationException ex) + { + trx.rollback(); + postGlobalError("error.bpartner.nolocation", request); + return mapping.getInputForward(); + } + catch(BPartnerOverCreditLimitException e1) + { + trx.rollback(); + postGlobalError("error.bpartner.over.credit.limit",e1.getMessage(),request); + return mapping.getInputForward(); + } + catch(OperationException e) + { + trx.rollback(); + throw new OperationException("Could not create customer return order!! Reason : " + e); + } + finally + { + trx.close(); + } + + bean.setOrderId(Integer.valueOf(customerReturnOrder.get_ID())); + + df.populate(new OrderLineBean()); + WebDocumentBean webBean = OrderReferenceManager.getWebOrderBean(ctx,customerReturnOrder); + ArrayList list = POSManager.populateOrderLines(ctx,customerReturnOrder); + WebDocumentBean documentBean=POSManager.calculateOrderTotals(list); + + if(customerReturnOrder.getPaymentRule().equalsIgnoreCase(MOrder.PAYMENTRULE_OnCredit)) + { + ElementBean title=ElementManager.getMsg(ctx,"credit.memo"); + request.getSession().setAttribute(Constants.ORDER_TITLE,title.getName()); + } + + else + { + ElementBean title=ElementManager.getMsg(ctx,"customer.returned.order"); + request.getSession().setAttribute(Constants.ORDER_TITLE,title.getName()); + } + + + request.getSession().setAttribute(Constants.CUSTOMER_RETURN_ORDER_ID,customerReturnOrder.get_ID()); + request.setAttribute(Constants.CUSTOMER_RETURN_ORDER_LINES,list); + SessionStorage.putCompleteOrderInfo(ctx,request,webBean,documentBean); + + return mapping.findForward(CREATE_CUSTOMER_RETURN_ORDER); + } + + public static final String COMPLETE_CUSTOMER_RETURN_ORDER="completeCustomerReturnOrder"; + public ActionForward completeCustomerReturnOrder(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx=TmkJSPEnv.getCtx(request); + + + Integer customerReturnOrderId=(Integer)request.getSession().getAttribute(Constants.CUSTOMER_RETURN_ORDER_ID); + MOrder completedCustomerReturn=null; + + Trx trx = Trx.get(TrxPrefix.getPrefix(),true); + + if(customerReturnOrderId==null) + { + postGlobalError("error.no.order.exists",request); + return mapping.getInputForward(); + } + + try + { + trx.start(); + completedCustomerReturn=POSGoodsManager.completeCustomerReturnOrder(ctx,customerReturnOrderId.intValue(),trx.getTrxName()); + trx.commit(); + } + catch(NoOrderLineFoundException e) + { + trx.rollback(); + postGlobalError("error.pos.no.orderline",request); + request.getSession().removeAttribute(Constants.CUSTOMER_RETURN_ORDER_SHOPPING_CART); + request.getSession().removeAttribute(Constants.CUSTOMER_RETURN_ORDER_SHOPPING_CART_ITEMS); + return mapping.getInputForward(); + } + catch(BPartnerOverCreditLimitException e1) + { + trx.rollback(); + postGlobalError("error.bpartner.over.credit.limit",e1.getMessage(),request); + return mapping.getInputForward(); + } + + catch(OperationException e) + { + trx.rollback(); + throw new OperationException("Could not complete customer return order!! Reason : " + e); + } + finally + { + trx.close(); + } + + + WebDocumentBean webBean = OrderReferenceManager.getWebOrderBean(ctx,completedCustomerReturn); + ArrayList list = POSManager.populateOrderLines(ctx,completedCustomerReturn); + WebDocumentBean documentBean=POSManager.calculateOrderTotals(list); + + //request.getSession().setAttribute(Constants.CUSTOMER_RETURN_ORDER_ID,completedCustomerReturn.get_ID()); + request.setAttribute(Constants.CUSTOMER_RETURN_ORDER_LINES,list); + /*request.removeAttribute(Constants.POS_ORDER_LINES);*/ + + + SessionStorage.putCompleteOrderInfo(ctx,request,webBean,documentBean); + + if(completedCustomerReturn.getPaymentRule().equalsIgnoreCase(MOrder.PAYMENTRULE_OnCredit)) + { + ElementBean title=ElementManager.getMsg(ctx,"credit.memo"); + request.getSession().setAttribute(Constants.ORDER_TITLE,title.getName()); + } + + else + { + ElementBean title=ElementManager.getMsg(ctx,"customer.returned.order"); + request.getSession().setAttribute(Constants.ORDER_TITLE,title.getName()); + } + + + request.getSession().removeAttribute(Constants.DESCRIPTION); + request.removeAttribute(Constants.DESCRIPTION); + request.getSession().removeAttribute(Constants.ALL_CUSTOMERS); + request.getSession().removeAttribute(Constants.CUSTOMER_RETURN_ORDER_SHOPPING_CART); + request.getSession().removeAttribute(Constants.CUSTOMER_RETURN_ORDER_SHOPPING_CART_ITEMS); + request.getSession().removeAttribute(Constants.DESCRIPTION); + request.getSession().removeAttribute(Constants.CUSTOMER_RETURN_ORDER_ID); + request.getSession().removeAttribute(Constants.B_PARTNER_ID); + + request.getSession().removeAttribute(Constants.ORDER_TYPE); + request.getSession().removeAttribute(Constants.POS_ORDER_DOC_NUMBER); + request.getSession().removeAttribute(Constants.CREDIT_PAYMENT_TERM_ID); + + return mapping.findForward(COMPLETE_CUSTOMER_RETURN_ORDER); + } + + public static final String COMPLETE_POS_ORDER="completePOSOrder"; + public static final String VIEW_POS_ORDERS="viewPOSOrders"; + public static final String COMPLETED_CREDIT_ORDER="completedCreditOrder"; + + + public ActionForward viewPOSOrders(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx=TmkJSPEnv.getCtx(request); + DefaultForm df= (DefaultForm) form; + OrderLineBean bean=(OrderLineBean) df.getBean(); + + MOrder order= new MOrder(ctx,bean.getOrderId(),null); + String status = order.getDocStatus(); + + WebDocumentBean webBean = OrderReferenceManager.getWebOrderBean(ctx,order); + + ArrayList list = POSManager.populateOrderLines(ctx,order); + WebDocumentBean documentBean=POSManager.calculateOrderTotals(list); + ActionForward forward=null; + + if(UDIOrderTypes.POS_GOODS_RECEIVE_NOTE.getOrderType().equals(order.getOrderType())) + { + if( status.equals(DocAction.STATUS_Drafted) ) + { + int c_BPartner_Id = order.getC_BPartner_ID(); + request.getSession().setAttribute(Constants.BPARTNER, Integer.valueOf(c_BPartner_Id)); + request.getSession().setAttribute( Constants.GOODS_RECEIVE_NOTE_LINES, list ); + request.getSession().setAttribute( Constants.GOODS_RECEIVE_NOTE_ID , Integer.valueOf(order.get_ID()) ); + forward = new ActionForward("/DraftedGoodsReceiveNote.do"); + } + else + { + request.getSession().setAttribute(Constants.GOODS_RECEIVE_NOTE,order); + request.setAttribute(Constants.GOODS_RECEIVE_NOTE_LINES,list); + forward= mapping.findForward(COMPLETE_GOODS_RECEIVE_NOTE); + } + } + else if(UDIOrderTypes.POS_GOODS_RETURN_NOTE.getOrderType().equals(order.getOrderType())) + { + if( status.equals(DocAction.STATUS_Drafted) ) + { + + int c_BPartner_Id = order.getC_BPartner_ID(); + request.getSession().setAttribute(Constants.BPARTNER, Integer.valueOf(c_BPartner_Id)); + request.getSession().setAttribute( Constants.GOODS_RETURN_NOTE_LINES, list ); + request.getSession().setAttribute( Constants.GOODS_RETURN_NOTE_ID, Integer.valueOf(order.get_ID()) ); + + forward = new ActionForward("/DraftedGoodsReturnNote.do"); + } + else + { + request.getSession().setAttribute(Constants.GOODS_RETURN_NOTE,order); + request.setAttribute(Constants.GOODS_RETURN_NOTE_LINES,list); + forward= mapping.findForward(COMPLETE_GOODS_RETURN_NOTE); + } + + } + else if(UDIOrderTypes.CUSTOMER_RETURN_ORDER.getOrderType().equals(order.getOrderType())|| UDIOrderTypes.CREDIT_MEMO.getOrderType().equals(order.getOrderType())) + { + if(order.getPaymentRule().equalsIgnoreCase(MOrder.PAYMENTRULE_OnCredit)) + { + ElementBean title=ElementManager.getMsg(ctx,"credit.memo"); + request.getSession().setAttribute(Constants.ORDER_TITLE,title.getName()); + } + + else + { + ElementBean title=ElementManager.getMsg(ctx,"customer.returned.order"); + request.getSession().setAttribute(Constants.ORDER_TITLE,title.getName()); + } + if( status.equals(DocAction.STATUS_Drafted) ) + { + + int c_BPartner_Id = order.getC_BPartner_ID(); + request.getSession().setAttribute(Constants.BPARTNER, Integer.valueOf(c_BPartner_Id)); + request.getSession().setAttribute( Constants.CUSTOMER_RETURN_ORDER_LINES, list ); + request.getSession().setAttribute( Constants.CUSTOMER_RETURN_ORDER_ID, Integer.valueOf(order.get_ID()) ); + + + forward = new ActionForward("/DraftedCustomerReturnOrder.do"); + } + else + { + + request.getSession().setAttribute(Constants.CUSTOMER_RETURN_ORDER,order); + request.setAttribute(Constants.CUSTOMER_RETURN_ORDER_LINES,list); + forward= mapping.findForward(COMPLETE_CUSTOMER_RETURN_ORDER); + } + } + else if(UDIOrderTypes.WEBSTORE_ORDER.getOrderType().equals(order.getOrderType())) + { + + request.getSession().setAttribute(Constants.CURRENT_POS_ORDER,order); + request.setAttribute(Constants.POS_ORDER_LINES,list); + request.setAttribute(Constants.ORDER_NAME,"Webstore Order"); + + forward= mapping.findForward(COMPLETE_POS_ORDER); + } + + else if(UDIOrderTypes.POS_ORDER.getOrderType().equals(order.getOrderType())) + { + if( status.equals(DocAction.STATUS_Drafted) ) + { + int c_BPartner_Id = order.getC_BPartner_ID(); + + request.getSession().setAttribute(Constants.BPARTNER, Integer.valueOf(c_BPartner_Id)); + request.getSession().setAttribute( Constants.POS_ORDER_LINES, list ); + request.getSession().setAttribute( Constants.CURRENT_POS_ORDER_ID , Integer.valueOf(order.get_ID()) ); + forward = new ActionForward("/DraftedPOSOrder.do"); + } + else if( status.equals(DocAction.STATUS_InProgress) ) + { + int c_BPartner_Id = order.getC_BPartner_ID(); + + request.getSession().setAttribute(Constants.BPARTNER, Integer.valueOf(c_BPartner_Id)); + request.getSession().setAttribute( Constants.POS_ORDER_LINES, list ); + request.setAttribute(Constants.ORDER_NAME,"POS Order"); + request.getSession().setAttribute( Constants.CURRENT_POS_ORDER_ID , Integer.valueOf(order.get_ID()) ); + forward= mapping.findForward(COMPLETE_POS_ORDER); + } + else + { + if( status.equals(DocAction.STATUS_Completed) ) + { //setting card & check tendered amount + BigDecimal cardTendered = POSManager.getPayment(ctx,order.get_ID(),MPayment.TENDERTYPE_CreditCard,null); + BigDecimal chequeTendered = POSManager.getPayment(ctx,order.get_ID(),MPayment.TENDERTYPE_Check,null); + + request.setAttribute(Constants.CARD_AMT_TENDERED, cardTendered); + request.setAttribute(Constants.CHEQUE_AMT_TENDERED, chequeTendered); + } + + request.getSession().setAttribute(Constants.CURRENT_POS_ORDER,order); + request.setAttribute(Constants.POS_ORDER_LINES,list); + request.setAttribute(Constants.ORDER_NAME,"POS Order"); + forward= mapping.findForward(COMPLETE_POS_ORDER); + } + } + else if(UDIOrderTypes.CREDIT_ORDER.getOrderType().equals(order.getOrderType())) + { + if( status.equals(DocAction.STATUS_Drafted) ) + { + int c_BPartner_Id = order.getC_BPartner_ID(); + request.getSession().setAttribute(Constants.BPARTNER, Integer.valueOf(c_BPartner_Id)); + request.getSession().setAttribute( Constants.POS_ORDER_LINES, list ); + request.getSession().setAttribute( Constants.CURRENT_POS_ORDER_ID , Integer.valueOf(order.get_ID()) ); + + forward = new ActionForward("/DraftedCreditOrder.do"); + } + else + { + request.getSession().setAttribute(Constants.CURRENT_POS_ORDER,order); + request.setAttribute(Constants.POS_ORDER_LINES,list); + forward= mapping.findForward(COMPLETED_CREDIT_ORDER); + } + } + else + { + String msg = "Unknown orderType : " + order.getOrderType(); + throw new OperationException(msg); + } + if(order.getPaymentRule().equals(UdiConstants.PAYMENTRULE_MIXED)) + { + POSManager.getAmountForMixedPayment(ctx,order,webBean); + } + SessionStorage.putCompleteOrderInfo(ctx,request,webBean,documentBean); + df.populate(new OrderLineBean()); + return forward; + + } + + public static final String VIEW_COMPLETED_POS_ORDER = "viewCompletedPOSOrder"; + public ActionForward viewCompletedPOSOrder(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx=TmkJSPEnv.getCtx(request); + DefaultForm df= (DefaultForm) form; + OrderLineBean bean=(OrderLineBean) df.getBean(); + + MOrder order= new MOrder(ctx,bean.getOrderId(),null); + WebDocumentBean webBean = OrderReferenceManager.getWebOrderBean(ctx,order); + + + + ArrayList list = POSManager.populateOrderLines(ctx,order); + WebDocumentBean documentBean=POSManager.calculateOrderTotals(list); + + request.getSession().setAttribute(Constants.CURRENT_POS_ORDER,order); + request.setAttribute(Constants.POS_ORDER_LINES,list); + SessionStorage.putCompleteOrderInfo(ctx,request,webBean,documentBean); + + return mapping.findForward(VIEW_COMPLETED_POS_ORDER); + } + + public static final String GET_TAX_CATEGORY="getTaxCategory"; + public ActionForward getTaxCategory(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd=init(mapping,form,request,response); + if(fwd!=null) + return fwd; + Properties ctx=TmkJSPEnv.getCtx(request); + //DefaultForm df = (DefaultForm)form; + ArrayList taxList=POSGoodsManager.getAllTaxCategory(ctx); + + request.getSession().setAttribute(Constants.TAX_CATEGORY_ID,taxList); + return mapping.findForward(GET_TAX_CATEGORY); + } + + public static final String INCREMENT_QTY = "incrementQty"; + public ActionForward incrementQty(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception + { + DefaultForm df = (DefaultForm) form; + OrderLineBean bean = (OrderLineBean) df.getBean(); + bean.setQuantity(new BigDecimal(1)); + + addToShoppingCart(mapping,form,request,response); + return getShoppingCart(mapping,form,request,response); + } + + public static final String DECREMENT_QTY = "decrementQty"; + public ActionForward decrementQty(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception + { + DefaultForm df = (DefaultForm) form; + OrderLineBean bean = (OrderLineBean) df.getBean(); + bean.setQuantity(new BigDecimal(1)); + + addToShoppingCart(mapping,form,request,response); + return getShoppingCart(mapping,form,request,response); + } + + public ActionForward getShoppingCart(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws OperationException + { + DefaultForm df = (DefaultForm) form; + String orderType = df.getOrderType(); + + if(orderType == null) + { + throw new OperationException("Cannot lookup for shopping cart! Cause orderType is null."); + } + + HashMap map = new HashMap(); + + map.put(Constants.GOODS_RECEIVE_NOTE, "/jsp/pos/goodsReceiveShoppingCart.jsp"); + map.put(Constants.GOODS_RETURN_NOTE, "/jsp/pos/goodsReturnShoppingCart.jsp"); + map.put(Constants.CUSTOMER_RETURN_ORDER,"/jsp/pos/customerReturnShoppingCart.jsp"); + + String url = map.get(orderType); + if(url == null) + { + throw new OperationException("Cannot lookup for shopping cart! Cause no shopping cart is define for orderType:" + orderType); + } + + return new ActionForward(url); + } + + + public static final String CREATE_CUSTOMER_RETURN_FROM_POSORDER="createCustomerReturnFromPOSOrder"; + public ActionForward createCustomerReturnFromPOSOrder(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd=init(mapping,form,request,response); + if(fwd!=null) + return fwd; + Properties ctx=TmkJSPEnv.getCtx(request); + + DefaultForm df= (DefaultForm) form; + OrderLineBean bean=(OrderLineBean) df.getBean(); + ShoppingCartBean cart =null; + OrderBean orderBean; + try + { + orderBean = POSManager.getPOSOrderDetail(ctx,bean.getDocumentNo()); + + if(orderBean==null) + { + postGlobalError("error.orderid.notpresent",request); + return mapping.getInputForward(); + } + + if(!orderBean.getOrderType().equalsIgnoreCase(UDIOrderTypes.POS_ORDER.getOrderType())) + { + postGlobalError("error.only.pos.order.supported",request); + return mapping.getInputForward(); + } + + if(orderBean.getDocStatus().equalsIgnoreCase(DocumentEngine.STATUS_Drafted)) + { + postGlobalError("error.pos.order.not.completed",request); + return mapping.getInputForward(); + } + + cart = POSManager.getShoppingCartForOrder(ctx,orderBean.getOrderId(),null); + } + catch(InvalidOrderIDException e) + { + postGlobalError("error.orderid.notpresent",request); + return mapping.getInputForward(); + } + + if(orderBean.getOrderType().equalsIgnoreCase(UDIOrderTypes.CREDIT_ORDER.getOrderType())) + { + ElementBean title=ElementManager.getMsg(ctx,"credit.memo"); + request.getSession().setAttribute(Constants.ORDER_TITLE,title.getName()); + } + + else + { + ElementBean title=ElementManager.getMsg(ctx,"customer.returned.order"); + request.getSession().setAttribute(Constants.ORDER_TITLE,title.getName()); + } + + int bpartnerId = orderBean.getBpartnerId().intValue(); + MBPartner partner = BPartnerManager.loadBPartner(ctx, bpartnerId,null); + String partnerName = partner.getName() + " " + partner.getName2(); + partnerName = partnerName.trim(); + + df.setPartnerName(partnerName); + df.setBpartnerId(orderBean.getBpartnerId().toString()); + + request.getSession().setAttribute(Constants.B_PARTNER_ID,orderBean.getBpartnerId()); + request.getSession().setAttribute(Constants.ORDER_TYPE,orderBean.getOrderType()); + request.getSession().setAttribute(Constants.POS_ORDER_DOC_NUMBER,bean.getDocumentNo()); + request.getSession().setAttribute(Constants.CREDIT_PAYMENT_TERM_ID,orderBean.getPaymentTermId()); + request.getSession().setAttribute(Constants.CUSTOMER_RETURN_ORDER_SHOPPING_CART,cart); + request.getSession().setAttribute(Constants.SHOPPING_ORDER_CART_ITEMS,cart.getItems()); + return mapping.findForward(CREATE_CUSTOMER_RETURN_FROM_POSORDER); + } + + + //--------------------------------------------------credit order------------------------------------------------------------ + public static final String LOAD_CREDIT_ORDER="loadCreditOrder"; + public ActionForward loadCreditOrder(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd=init(mapping,form,request,response); + if(fwd!=null) + return fwd; + Properties ctx=TmkJSPEnv.getCtx(request); + + DefaultForm df= (DefaultForm) form; + OrderLineBean bean=(OrderLineBean) df.getBean(); + ShoppingCartBean cart =null; + OrderBean orderBean; + + try + { + orderBean = POSManager.getPOSOrderDetail(ctx,bean.getDocumentNo()); + + if(orderBean==null) + { + postGlobalError("error.orderid.notpresent",request); + return mapping.getInputForward(); + } + + if(!orderBean.getOrderType().equalsIgnoreCase(UDIOrderTypes.CREDIT_ORDER.getOrderType()) && !orderBean.getOrderType().equalsIgnoreCase(UDIOrderTypes.CREDIT_ORDER.getOrderType())) + { + postGlobalError("error.only.credit.order.supported",request); + return mapping.getInputForward(); + } + + if(orderBean.getDocStatus().equalsIgnoreCase(DocumentEngine.STATUS_Drafted)) + { + postGlobalError("error.credit.order.not.completed",request); + return mapping.getInputForward(); + } + + cart = POSManager.getShoppingCartForOrder(ctx,orderBean.getOrderId(),null); + } + catch(InvalidOrderIDException e) + { + postGlobalError("error.orderid.notpresent",request); + return mapping.getInputForward(); + } + + int bpartnerId = orderBean.getBpartnerId().intValue(); + MBPartner partner = BPartnerManager.loadBPartner(ctx, bpartnerId,null); + String partnerName = partner.getName() + " " + partner.getName2(); + partnerName = partnerName.trim(); + + df.setPartnerName(partnerName); + df.setBpartnerId(orderBean.getBpartnerId().toString()); + + request.getSession().setAttribute(Constants.B_PARTNER_ID,orderBean.getBpartnerId()); + request.getSession().setAttribute(Constants.ORDER_TYPE,orderBean.getOrderType()); + request.getSession().setAttribute(Constants.POS_ORDER_DOC_NUMBER,bean.getDocumentNo()); + request.getSession().setAttribute(Constants.CREDIT_PAYMENT_TERM_ID,orderBean.getPaymentTermId()); + request.getSession().setAttribute(Constants.CUSTOMER_RETURN_ORDER_SHOPPING_CART,cart); + request.getSession().setAttribute(Constants.SHOPPING_ORDER_CART_ITEMS,cart.getItems()); + return mapping.findForward(LOAD_CREDIT_ORDER); + } + + //####################### Deletion of orders #######################// + //deleteGoodsReturnOrder + //deleteGoodsReceiveOrder + //deleteCustomerReturnOrder + + public static final String DELETE_GOODS_RETURN_ORDER = "deleteGoodsReturnOrder"; + public static final String DELETE_GOODS_RECEIVE_ORDER = "deleteGoodsReceiveOrder"; + public static final String DELETE_CUSTOMER_RETURN_ORDER = "deleteCustomerReturnOrder"; + + public ActionForward deleteGoodsReturnOrder(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx=TmkJSPEnv.getCtx(request); + + Integer orderId = (Integer) request.getSession().getAttribute( Constants.GOODS_RETURN_NOTE_ID ); + + if( orderId == null ) + { + throw new OperationException("Cannot delete order. Reason: order ID not found!"); + } + + Trx trx = Trx.get(TrxPrefix.getPrefix(),true); + + try + { + trx.start(); + OrderManager.deleteDraftedOrder(ctx, orderId.intValue(), null); + trx.commit(); + } + catch(OperationException ex) + { + trx.rollback(); + postGlobalError("error.order.delete", request); + return mapping.getInputForward(); + } + finally + { + trx.close(); + } + + //remove previously set values + request.getSession().removeAttribute(Constants.GOODS_RETURN_NOTE_SHOPPING_CART); + request.getSession().removeAttribute(Constants.GOODS_RETURN_NOTE_SHOPPING_CART_ITEMS); + request.getSession().removeAttribute(Constants.GOODS_RETURN_NOTE_ID); + request.getSession().removeAttribute(Constants.B_PARTNER_ID); + request.getSession().removeAttribute(Constants.DESCRIPTION); + + //return mapping.findForward(DELETE_GOODS_RETURN_ORDER); + return new ActionForward( "/GetAllPOSVendor.do?action=getAllVendors&isSales=false" ); + } + + public ActionForward deleteGoodsReceiveOrder(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx=TmkJSPEnv.getCtx(request); + + Integer orderId = (Integer) request.getSession().getAttribute( Constants.GOODS_RECEIVE_NOTE_ID ); + + if( orderId == null ) + { + throw new OperationException("Cannot delete order. Reason: order ID not found!"); + } + + Trx trx = Trx.get(TrxPrefix.getPrefix(),true); + + try + { + trx.start(); + OrderManager.deleteDraftedOrder(ctx, orderId.intValue(), null); + trx.commit(); + } + catch(OperationException ex) + { + trx.rollback(); + postGlobalError("error.order.delete", request); + return mapping.getInputForward(); + } + finally + { + trx.close(); + } + + //remove previously set values + request.getSession().removeAttribute(Constants.GOODS_RECEIVE_NOTE_SHOPPING_CART); + request.getSession().removeAttribute(Constants.GOODS_RECEIVE_NOTE_SHOPPING_CART_ITEMS); + request.getSession().removeAttribute(Constants.GOODS_RECEIVE_NOTE_ID); + request.getSession().removeAttribute(Constants.B_PARTNER_ID); + request.getSession().removeAttribute(Constants.DESCRIPTION); + + //GetAllPOSVendor.do?action=getAllVendors&isSales=false + //return mapping.findForward(DELETE_GOODS_RECEIVE_ORDER); + return new ActionForward( "/GetAllPOSVendor.do?action=getAllVendors&isSales=true" ); + } + + public ActionForward deleteCustomerReturnOrder(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx=TmkJSPEnv.getCtx(request); + + Integer orderId = (Integer) request.getSession().getAttribute( Constants.CUSTOMER_RETURN_ORDER_ID ); + + if( orderId == null ) + { + throw new OperationException("Cannot delete order. Reason: order ID not found!"); + } + + Trx trx = Trx.get(TrxPrefix.getPrefix(),true); + + try + { + trx.start(); + OrderManager.deleteDraftedOrder(ctx, orderId.intValue(), null); + trx.commit(); + } + catch(OperationException ex) + { + trx.rollback(); + postGlobalError("error.order.delete", request); + return mapping.getInputForward(); + } + finally + { + trx.close(); + } + + //remove previously set values + request.getSession().removeAttribute(Constants.CUSTOMER_RETURN_ORDER_SHOPPING_CART); + request.getSession().removeAttribute(Constants.CUSTOMER_RETURN_ORDER_SHOPPING_CART_ITEMS); + request.getSession().removeAttribute(Constants.CUSTOMER_RETURN_ORDER_ID); + request.getSession().removeAttribute(Constants.B_PARTNER_ID); + request.getSession().removeAttribute(Constants.DESCRIPTION); + + request.getSession().removeAttribute(Constants.ORDER_TYPE); + request.getSession().removeAttribute(Constants.POS_ORDER_DOC_NUMBER); + request.getSession().removeAttribute(Constants.CREDIT_PAYMENT_TERM_ID); + + return mapping.findForward(DELETE_CUSTOMER_RETURN_ORDER); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/POSInfoAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/POSInfoAction.java new file mode 100644 index 0000000000..5137a8d86e --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/pos/POSInfoAction.java @@ -0,0 +1,208 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 25-Jul-2005 by alok + * + */ + +package org.posterita.struts.pos; + +import java.io.FileNotFoundException; +import java.sql.Timestamp; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.Properties; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.apache.struts.action.ActionMessage; +import org.apache.struts.action.ActionMessages; +import org.posterita.Constants; +import org.posterita.beans.POSInfoBean; +import org.posterita.beans.ReportBean; +import org.posterita.businesslogic.POSManager; +import org.posterita.businesslogic.performanceanalysis.CSVReportManager; +import org.posterita.businesslogic.performanceanalysis.ReportDateManager; +import org.posterita.businesslogic.performanceanalysis.ReportManager; +import org.posterita.core.TabularReport; +import org.posterita.core.TimestampConvertor; +import org.posterita.core.TmkJSPEnv; +import org.posterita.exceptions.ApplicationException; +import org.posterita.exceptions.OperationException; +import org.posterita.struts.core.DefaultForm; + +import com.lowagie.text.DocumentException; + +public class POSInfoAction extends POSDispatchAction +{ + public static final String GET_CURRENT_DAY_REPORT = "getCurrentDayReport"; + public ActionForward getCurrentDayReport(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + Timestamp fromDate = TimestampConvertor.getCurrentDateTimestamp(); + Timestamp toDate = TimestampConvertor.getCurrentDateTimeTimestamp(); + + ArrayList list = POSManager.getPOSInfo(ctx, fromDate, toDate, null); + request.getSession().setAttribute(Constants.POS_INFO,list); + + return mapping.findForward(GET_CURRENT_DAY_REPORT); + } + + public static final String GET_CURRENT_MONTH_REPORT = "getCurrentMonthReport"; + public ActionForward getCurrentMonthReport(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + Calendar cal = Calendar.getInstance(); + SimpleDateFormat sdf = new SimpleDateFormat(TimestampConvertor.DEFAULT_DATE_PATTERN1); + + Timestamp toDate = new Timestamp(cal.getTimeInMillis()); + + cal.set(Calendar.DATE,1); + cal.set(Calendar.HOUR_OF_DAY,0); + cal.set(Calendar.MINUTE,0); + cal.set(Calendar.SECOND,0); + cal.set(Calendar.MILLISECOND,0); + + Timestamp fromDate =new Timestamp(cal.getTimeInMillis()); + + ArrayList list = POSManager.getPOSInfo(ctx, fromDate, toDate, null); + request.getSession().setAttribute(Constants.POS_INFO, list); + + return mapping.findForward(GET_CURRENT_MONTH_REPORT); + } + + public static final String GET_CUSTOM_REPORT = "getCustomReport"; + public ActionForward getCustomReport(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException, FileNotFoundException, DocumentException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + DefaultForm df= (DefaultForm) form; + ReportBean bean = (ReportBean) df.getBean(); + + String title = "POS Info"; + String subtitle = ""; + + String dateRange = bean.getDateRange(); + String timePeriod = bean.getTimePeriod(); + + Timestamp fromDate = null; + Timestamp toDate = null; + + //setting from and to dates + if(dateRange.endsWith(Constants.FIXED_DATE_RANGE)) + { + if(timePeriod==null) + { + throw new OperationException("Invalid Parameter for timePeriod. timePeriod is NULL"); + } + + Date startDate = ReportDateManager.getStartDateForPeriod(timePeriod); + Date endDate = ReportDateManager.getEndDateForPeriod(timePeriod); + + + fromDate = new Timestamp(startDate.getTime()); + toDate = new Timestamp(endDate.getTime()); + + subtitle = "For " + timePeriod; + } + else if(dateRange.endsWith(Constants.CUSTOM_DATE_RANGE)) + { + boolean error = false; + ActionMessages messages = new ActionMessages(); + ActionMessage message = null; + + + if((bean.getFromDate()==null)||(bean.getFromDate()=="")) + { + message = new ActionMessage("error.required.fromDate"); + messages.add(ActionMessages.GLOBAL_MESSAGE, message); + error = true; + } + + if((bean.getToDate()==null)||(bean.getToDate()=="")) + { + message = new ActionMessage("error.required.toDate"); + messages.add(ActionMessages.GLOBAL_MESSAGE, message); + error = true; + } + + if(error) + { + saveErrors(request, messages); + return mapping.getInputForward(); + } + else + { + fromDate = ReportDateManager.getFromDate(bean); + toDate = ReportDateManager.getToDate(bean); + + } + + + subtitle = "For period:"+fromDate+" to "+toDate; + } + else + { + throw new OperationException("Invalid Parameter for dateRange :" + dateRange); + } + + ArrayList reportData = POSManager.getPOSInfoReportData(ctx, fromDate, toDate, null); + + //constructing the table + TabularReport tReport = new TabularReport(reportData); + tReport.setSortable(false); + tReport.setStyle("display"); + tReport.setTitle(title); + tReport.setSubtitle(subtitle); + tReport.createReport(); + + String csvReport = CSVReportManager.generateCSVReport(ctx,reportData); + String csvURI = ReportManager.getReportURI(csvReport,request); + + String pdfReport = tReport.createPDFReport(); + String pdfURI = ReportManager.getReportURI(pdfReport,request); + + request.getSession().setAttribute(Constants.TABULAR_REPORT_DATA,tReport.toString()); + request.getSession().setAttribute(Constants.CSV_FILE,csvURI); + + request.getSession().setAttribute(Constants.PDF_FILE,pdfURI); + + return mapping.findForward(GET_CUSTOM_REPORT); + + + } +} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/POSOrderAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/POSOrderAction.java new file mode 100644 index 0000000000..fa2672247d --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/pos/POSOrderAction.java @@ -0,0 +1,2213 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Created on 14-Mar-2006 + */ +package org.posterita.struts.pos; + +import java.io.IOException; +import java.io.OutputStream; +import java.io.PrintWriter; +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.sql.SQLException; +import java.sql.Timestamp; +import java.text.ParseException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.Properties; +import java.util.logging.Level; + +import javax.management.relation.RoleNotFoundException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.apache.struts.action.ActionMessage; +import org.apache.struts.action.ActionMessages; +import org.apache.struts.util.MessageResources; +import org.compiere.model.MBPartner; +import org.compiere.model.MCurrency; +import org.compiere.model.MOrder; +import org.compiere.model.MPayment; +import org.compiere.model.MPriceList; +import org.compiere.model.MRole; +import org.compiere.print.ReportEngine; +import org.compiere.util.CLogger; +import org.compiere.util.Env; +import org.compiere.util.Trx; +import org.compiere.util.WebUser; +import org.posterita.Constants; +import org.posterita.beans.CheckoutBean; +import org.posterita.beans.CurrentTillAmountBean; +import org.posterita.beans.ItemBean; +import org.posterita.beans.LoginBean; +import org.posterita.beans.OrderBean; +import org.posterita.beans.OrderLineBean; +import org.posterita.beans.POSInfoBean; +import org.posterita.beans.RemoveSessionBean; +import org.posterita.beans.ReportBean; +import org.posterita.beans.ShoppingCartBean; +import org.posterita.beans.WebDocumentBean; +import org.posterita.businesslogic.LoginManager; +import org.posterita.businesslogic.OrderManager; +import org.posterita.businesslogic.OrderReferenceManager; +import org.posterita.businesslogic.POSGoodsManager; +import org.posterita.businesslogic.POSManager; +import org.posterita.businesslogic.POSTerminalManager; +import org.posterita.businesslogic.PrintManager; +import org.posterita.businesslogic.ShoppingcartManager; +import org.posterita.businesslogic.administration.BPartnerManager; +import org.posterita.businesslogic.administration.PriceListManager; +import org.posterita.businesslogic.administration.RoleManager; +import org.posterita.businesslogic.administration.UserManager; +import org.posterita.businesslogic.creditsales.CreditOrderManager; +import org.posterita.businesslogic.performanceanalysis.ReportDateManager; +import org.posterita.businesslogic.stock.StockManager; +import org.posterita.core.Configuration; +import org.posterita.core.SessionStorage; +import org.posterita.core.TmkJSPEnv; +import org.posterita.core.TrxPrefix; +import org.posterita.core.businesslogic.ElementManager; +import org.posterita.exceptions.ApplicationException; +import org.posterita.exceptions.BPartnerNoLocationException; +import org.posterita.exceptions.BPartnerOverCreditLimitException; +import org.posterita.exceptions.DiscountLimitException; +import org.posterita.exceptions.DuplicatePINException; +import org.posterita.exceptions.InputQuantityLessThanZeroException; +import org.posterita.exceptions.InsufficientQtyException; +import org.posterita.exceptions.InvalidAddressException; +import org.posterita.exceptions.InvalidPINException; +import org.posterita.exceptions.InvalidTenderedAmountException; +import org.posterita.exceptions.LimitPriceViolatedException; +import org.posterita.exceptions.NoOrderLineSelectedException; +import org.posterita.exceptions.NotLoggedInException; +import org.posterita.exceptions.OperationException; +import org.posterita.exceptions.ProductNotFoundException; +import org.posterita.exceptions.ProductNotOnPriceListException; +import org.posterita.exceptions.QuantityNotAvailableException; +import org.posterita.exceptions.UOMValuePrecisionNotValidException; +import org.posterita.exceptions.UserInactiveException; +import org.posterita.exceptions.UserNotFoundException; +import org.posterita.form.CheckoutForm; +import org.posterita.form.OrderLineForm; +import org.posterita.form.RemoveSessionForm; +import org.posterita.lib.UdiConstants; +import org.posterita.order.UDIOrderTypes; +import org.posterita.struts.core.DefaultForm; +import org.posterita.util.TmkPrinterConstants; + +public class POSOrderAction extends POSDispatchAction +{ + /** Logger */ + private static final CLogger logger = CLogger.getCLogger(POSOrderAction.class); + + public static final String CREATE_POS_ORDER="createPOSOrder"; + public ActionForward createPOSOrder(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx=TmkJSPEnv.getCtx(request); + DefaultForm df= (DefaultForm) form; + OrderLineBean bean=(OrderLineBean) df.getBean(); + + ShoppingCartBean cartBean = (ShoppingCartBean) request.getSession().getAttribute(Constants.SHOPPING_ORDER_CART); + + if(cartBean==null ||cartBean.getItems() == null||cartBean.getItems().size()==0) + { + postGlobalError("error.pos.shoppingcart.empty",request); + return mapping.getInputForward(); + } + + String[] discountPercentage = df.getDiscountPercent(); + String[] actualPrice = df.getActualPrice(); + + double d = 0.0d; + + if(( discountPercentage != null ) && ( discountPercentage.length != 0 )) + { + for(String s : discountPercentage) + { + if(s == null || s == "") + { + continue; + } + + try + { + d = Double.parseDouble(s); + + if(d < 0) + { + postGlobalError("error.discount.nagative",request); + return mapping.getInputForward(); + } + } + catch (NumberFormatException e) + { + postGlobalError("errors.double","Discount(s)",request); + return mapping.getInputForward(); + } + } + + for(String s : actualPrice) + { + if(s == null || s == "") + { + continue; + } + + try + { + Double.parseDouble(s); + } + catch (NumberFormatException e) + { + postGlobalError("errors.double","Price(s)",request); + return mapping.getInputForward(); + } + } + } + + + + Integer bPartnerId = bean.getBpartnerId(); + + if(bPartnerId==null) + bPartnerId = (Integer) request.getSession().getAttribute(Constants.BPARTNER); + + if(bPartnerId==null) + { + String orderType = df.getOrderType(); + if(orderType!=null && orderType.equalsIgnoreCase( Constants.POS_ORDER_CUSTOMER_COMPULSORY )) + { + postGlobalError("error.required" ,"customer" ,request); + return mapping.getInputForward(); + } + + bPartnerId=Integer.valueOf(POSTerminalManager.getCashBPartner(ctx).get_ID()); + } + else + { + boolean isBPartnerPresent = BPartnerManager.isBPartnerPresent(ctx,bPartnerId.intValue(),null); + + if( !isBPartnerPresent ) + { + postGlobalError("error.pos.invalid.customerID",request); + return mapping.getInputForward(); + } + } + + // VALIDATING DISCOUNT AUTHORISATION <========= + BigDecimal discountAllowed = (BigDecimal) request.getSession().getAttribute(Constants.DISCOUNT_ALLOWED); + + + bean.setUserDiscount(discountAllowed); + bean.setBpartnerId(bPartnerId); + + //check if the order is alredy created + MOrder previousOrder= null; + previousOrder=(MOrder)request.getSession().getAttribute(Constants.PRESENT_POS_ORDER); + + if(previousOrder!=null) + { + bean.setOrderId(Integer.valueOf(previousOrder.get_ID())); + } + else + { + bean.setOrderId(null); + } + + Trx trx = Trx.get(TrxPrefix.getPrefix(),true); + + MOrder posOrder=null; + try + { + trx.start(); + posOrder= POSManager.createPOSOrder(ctx,bean,cartBean.getItems(),trx.getTrxName()); + trx.commit(); + } + catch(BPartnerOverCreditLimitException e1) + { + trx.rollback(); + postGlobalError("error.bpartner.over.credit.limit",e1.getMessage(),request); + return mapping.getInputForward(); + } + catch(BPartnerNoLocationException ex) + { + trx.rollback(); + postGlobalError("error.bpartner.nolocation", request); + return mapping.getInputForward(); + } + catch(InvalidTenderedAmountException e) + { + trx.rollback(); + postGlobalError("error.pos.incorrect.tendered.amount",request); + return mapping.getInputForward(); + } + catch (DiscountLimitException e) + { + trx.rollback(); + postGlobalError("error.discountLimit.exceeded",request); + return mapping.getInputForward(); + } + catch(InsufficientQtyException e3) + { + trx.rollback(); + postGlobalError("error.insufficient.qty",e3.getMessage(),request); + return mapping.getInputForward(); + } + catch(LimitPriceViolatedException e3) + { + trx.rollback(); + postGlobalError("error.limit.price.violated",e3.getMessage(),request); + return mapping.getInputForward(); + } + + finally + { + trx.close(); + } + + // Reset transaction as it has already been committed and closed + posOrder.set_TrxName(null); + + bean.setOrderId(Integer.valueOf(posOrder.get_ID())); + + df.populate(new OrderLineBean()); + WebDocumentBean webBean =null; + try + { + webBean = OrderReferenceManager.getWebOrderBean(ctx, posOrder); + } + catch(InvalidAddressException e) + { + postGlobalError("error.invalid.address",request); + return mapping.getInputForward(); + } + + if(posOrder.getPaymentRule().equals(UdiConstants.PAYMENTRULE_MIXED)) + { + if(bean.getPaymentByCash()!=null) + webBean.setPaymentByCash(bean.getPaymentByCash()); + if(bean.getPaymentByCard()!=null) + webBean.setPaymentByCard(bean.getPaymentByCard()); + if(bean.getPaymentByChq()!=null) + webBean.setPaymentbyCheque(bean.getPaymentByChq()); + } + + + ArrayList list = POSManager.populateOrderLines(ctx,posOrder); + WebDocumentBean documentBean=POSManager.calculateOrderTotals(list); + request.getSession().setAttribute(Constants.CURRENT_POS_ORDER_ID,Integer.valueOf(posOrder.get_ID())); + request.getSession().setAttribute(Constants.PRESENT_POS_ORDER,posOrder); + request.getSession().setAttribute(Constants.ORDER_LINE_BEAN,bean); + request.getSession().setAttribute(Constants.BPARTNER,bPartnerId); + request.setAttribute(Constants.POS_ORDER_LINES,list); + request.getSession().removeAttribute(Constants.PRESENT_POS_ORDER); + request.getSession().removeAttribute(Constants.PRESENT_POS_ORDER_ID); + + + SessionStorage.putCompleteOrderInfo(ctx,request,webBean,documentBean); + + //remove any previously set discount + request.getSession().removeAttribute(Constants.DISCOUNT_ALLOWED); + + return mapping.findForward(CREATE_POS_ORDER); + } + + public static final String COMPLETE_POS_ORDER="completePOSOrder"; + public ActionForward completePOSOrder(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx=TmkJSPEnv.getCtx(request); + DefaultForm df= (DefaultForm) form; + OrderLineBean b = (OrderLineBean) df.getBean(); + + OrderLineBean bean=(OrderLineBean) request.getSession().getAttribute(Constants.ORDER_LINE_BEAN); + + + if(bean==null) + { + bean = new OrderLineBean(); + } + bean.setAmountGiven(b.getAmountGiven()); + bean.setAmountRefunded(b.getAmountRefunded()); + + Integer orderId = (Integer) request.getSession().getAttribute(Constants.CURRENT_POS_ORDER_ID); + MOrder completedPOSOrder=null; + + + if(orderId==null) + { + postGlobalError("error.no.order.exists",request); + return mapping.getInputForward(); + } + + + if(OrderManager.isOrderEmpty(ctx,orderId.intValue(),null)) + { + postGlobalError("error.pos.no.orderline",request); + request.getSession().removeAttribute(Constants.SHOPPING_ORDER_CART); + request.getSession().removeAttribute(Constants.SHOPPING_ORDER_CART_ITEMS); + + return mapping.getInputForward(); + } + + + + Trx trx = Trx.get(TrxPrefix.getPrefix(),true); + + try + { + trx.start(); + completedPOSOrder=POSManager.completePOSOrder(ctx,orderId.intValue(),bean,null); + trx.commit(); + } + catch(BPartnerOverCreditLimitException e1) + { + trx.rollback(); + MOrder posOrder = new MOrder(ctx,orderId.intValue(),null); + ArrayList list = POSManager.populateOrderLines(ctx,posOrder); + request.setAttribute(Constants.POS_ORDER_LINES,list); + postGlobalError("error.bpartner.over.credit.limit",e1.getMessage(),request); + return mapping.getInputForward(); + } + catch(InvalidTenderedAmountException e) + { + trx.rollback(); + MOrder posOrder = new MOrder(ctx,orderId.intValue(),null); + ArrayList list = POSManager.populateOrderLines(ctx,posOrder); + request.setAttribute(Constants.POS_ORDER_LINES,list); + postGlobalError("error.required.amount.given",request); + return mapping.getInputForward(); + } + catch(OperationException e) + { + trx.rollback(); + MOrder posOrder = new MOrder(ctx,orderId.intValue(),null); + ArrayList list = POSManager.populateOrderLines(ctx,posOrder); + request.setAttribute(Constants.POS_ORDER_LINES,list); + throw e; + } + finally + { + trx.close(); + } + + + df.populate(new OrderLineBean()); + WebDocumentBean webBean = OrderReferenceManager.getWebOrderBean(ctx, completedPOSOrder); + + if(completedPOSOrder.getPaymentRule().equals(UdiConstants.PAYMENTRULE_MIXED)) + { + POSManager.getAmountForMixedPayment(ctx,completedPOSOrder,webBean); + } + + ArrayList list = POSManager.populateOrderLines(ctx,completedPOSOrder); + WebDocumentBean documentBean=POSManager.calculateOrderTotals(list); + request.getSession().setAttribute(Constants.CURRENT_POS_ORDER_ID,completedPOSOrder.get_ID()); + request.setAttribute(Constants.POS_ORDER_LINES,list); + + SessionStorage.putCompleteOrderInfo(ctx,request,webBean,documentBean); + /*request.removeAttribute(Constants.POS_ORDER_LINES);*/ + request.getSession().removeAttribute(Constants.ALL_CUSTOMERS); + request.getSession().removeAttribute(Constants.BPARTNER); + request.getSession().removeAttribute(Constants.SHOPPING_ORDER_CART); + request.getSession().removeAttribute(Constants.SHOPPING_ORDER_CART_ITEMS); + request.getSession().removeAttribute(Constants.CURRENT_POS_ORDER_ID); + + + //fix for invoke partial pos order + request.getSession().removeAttribute(Constants.PARTIAL_ORDER_SHOPPING_CART); + request.getSession().removeAttribute(Constants.PARTIAL_ORDER_SHOPPING_CART_ITEMS); + request.getSession().removeAttribute(Constants.CURRENT_PARTIAL_POS_ORDER_ID); + request.getSession().removeAttribute(Constants.PRESENT_POS_ORDER); + request.getSession().removeAttribute( Constants.PRESENT_POS_ORDER_ID ); + + //setting card & check tendered amount + BigDecimal cardTendered = POSManager.getPayment(ctx,completedPOSOrder.get_ID(),MPayment.TENDERTYPE_CreditCard,trx.getTrxName()); + BigDecimal chequeTendered = POSManager.getPayment(ctx,completedPOSOrder.get_ID(),MPayment.TENDERTYPE_Check,trx.getTrxName()); + + request.setAttribute(Constants.CARD_AMT_TENDERED, cardTendered); + request.setAttribute(Constants.CHEQUE_AMT_TENDERED, chequeTendered); + + return mapping.findForward(COMPLETE_POS_ORDER); + } + + + public static final String COMPLETE_POS_ORDER_PRINT_INVOICE="completePOSOrderPrintInvoice"; + public ActionForward completePOSOrderPrintInvoice(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx=TmkJSPEnv.getCtx(request); + DefaultForm df= (DefaultForm) form; + OrderLineBean b = (OrderLineBean) df.getBean(); + + OrderLineBean bean=(OrderLineBean) request.getSession().getAttribute(Constants.ORDER_LINE_BEAN); + bean.setAmountGiven(b.getAmountGiven()); + bean.setAmountRefunded(b.getAmountRefunded()); + + Integer orderId = (Integer) request.getSession().getAttribute(Constants.CURRENT_POS_ORDER_ID); + MOrder completedPOSOrder=null; + + + if(OrderManager.isOrderEmpty(ctx,orderId.intValue(),null)) + { + postGlobalError("error.pos.no.orderline",request); + request.getSession().removeAttribute(Constants.SHOPPING_ORDER_CART); + request.getSession().removeAttribute(Constants.SHOPPING_ORDER_CART_ITEMS); + + return mapping.getInputForward(); + } + + Trx trx = Trx.get(TrxPrefix.getPrefix(),true); + + try + { + trx.start(); + completedPOSOrder = POSManager.completePOSOrder(ctx,orderId.intValue(),bean,null); + trx.commit(); + } + catch(BPartnerOverCreditLimitException e1) + { + trx.rollback(); + postGlobalError("error.bpartner.over.credit.limit",e1.getMessage(),request); + return mapping.getInputForward(); + } + catch(OperationException e) + { + trx.rollback(); + throw e; + } + finally + { + trx.close(); + } + + + df.populate(new OrderLineBean()); + WebDocumentBean webBean = OrderReferenceManager.getWebOrderBean(ctx, completedPOSOrder); + + if(completedPOSOrder.getPaymentRule().equals(UdiConstants.PAYMENTRULE_MIXED)) + { + POSManager.getAmountForMixedPayment(ctx,completedPOSOrder,webBean); + } + + ArrayList list = POSManager.populateOrderLines(ctx,completedPOSOrder); + WebDocumentBean documentBean=POSManager.calculateOrderTotals(list); + request.getSession().setAttribute(Constants.CURRENT_POS_ORDER_ID,completedPOSOrder.get_ID()); + request.setAttribute(Constants.POS_ORDER_LINES,list); + SessionStorage.putCompleteOrderInfo(ctx,request,webBean,documentBean); + + /*request.removeAttribute(Constants.POS_ORDER_LINES);*/ + request.getSession().removeAttribute(Constants.ALL_CUSTOMERS); + request.getSession().removeAttribute(Constants.SHOPPING_ORDER_CART); + request.getSession().removeAttribute(Constants.SHOPPING_ORDER_CART_ITEMS); + request.getSession().removeAttribute(Constants.CURRENT_POS_ORDER_ID); + + return mapping.findForward(COMPLETE_POS_ORDER_PRINT_INVOICE); + } + + + public static final String CREATE_AND_COMPLETE_POS_ORDER="createAndCompletePOSOrder"; + public ActionForward createAndCompletePOSOrder(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx=TmkJSPEnv.getCtx(request); + DefaultForm df= (DefaultForm) form; + OrderLineBean bean=(OrderLineBean) df.getBean(); + + bean.getPaymentByCash(); + bean.getPaymentByCard(); + bean.getPaymentByChq(); + + + ShoppingCartBean cartBean = (ShoppingCartBean) request.getSession().getAttribute(Constants.SHOPPING_ORDER_CART); + + if(cartBean==null ||cartBean.getItems() == null||cartBean.getItems().size()==0) + { + postGlobalError("error.pos.shoppingcart.empty",request); + return mapping.getInputForward(); + } + + //MOrder posOrder=(MOrder) request.getSession().getAttribute(Constants.CURRENT_POS_ORDER); + + Integer bPartnerId = bean.getBpartnerId(); + + if(bPartnerId==null) + bPartnerId = (Integer) request.getSession().getAttribute(Constants.BPARTNER); + + if(bPartnerId==null) + { + bPartnerId=Integer.valueOf(POSTerminalManager.getCashBPartner(ctx).get_ID()); + } + else + { + boolean isBPartnerPresent = BPartnerManager.isBPartnerPresent(ctx,bPartnerId.intValue(),null); + + if( !isBPartnerPresent ) + { + postGlobalError("error.pos.invalid.customerID",request); + return mapping.getInputForward(); + } + } + + bean.setBpartnerId(bPartnerId); + + MOrder completedPOSOrder = null; + + try + { + completedPOSOrder = POSManager.createAndCompletePOSOrder(ctx,bean,cartBean.getItems()); + } + catch(BPartnerOverCreditLimitException e1) + { + + postGlobalError("error.bpartner.over.credit.limit",e1.getMessage(),request); + return mapping.getInputForward(); + } + catch(BPartnerNoLocationException ex) + { + postGlobalError("error.bpartner.nolocation", request); + return mapping.getInputForward(); + } + catch (DiscountLimitException e) + { + postGlobalError("error.discountLimit.exceeded",request); + return mapping.getInputForward(); + } + + WebDocumentBean webBean = OrderReferenceManager.getWebOrderBean(ctx, completedPOSOrder); + + ArrayList list = POSManager.populateOrderLines(ctx,completedPOSOrder); + WebDocumentBean documentBean=POSManager.calculateOrderTotals(list); + request.getSession().setAttribute(Constants.CURRENT_POS_ORDER_ID,completedPOSOrder.get_ID()); + request.setAttribute(Constants.POS_ORDER_LINES,list); + + /*request.removeAttribute(Constants.POS_ORDER_LINES);*/ + request.getSession().removeAttribute(Constants.ALL_CUSTOMERS); + request.getSession().removeAttribute(Constants.SHOPPING_ORDER_CART); + request.getSession().removeAttribute(Constants.SHOPPING_ORDER_CART_ITEMS); + request.getSession().removeAttribute(Constants.CURRENT_POS_ORDER_ID); + + SessionStorage.putCompleteOrderInfo(ctx,request,webBean,documentBean); + + return mapping.findForward(CREATE_AND_COMPLETE_POS_ORDER); + } + + public static final String GET_POS_PAYMENT_DETAILS="getPOSPaymentDetails"; + public ActionForward getPOSPaymentDetails(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + MOrder order=null; + Properties ctx=TmkJSPEnv.getCtx(request); + DefaultForm df= (DefaultForm) form; + OrderLineBean bean=(OrderLineBean) df.getBean(); + df.populate(new OrderLineBean()); + if(bean.getBpartnerId()!=null) + request.getSession().setAttribute(Constants.BPARTNER, bean.getBpartnerId()); + + else if(bean.getOrderId()!=null) + { + order = new MOrder(ctx, bean.getOrderId(), null); + bean.setBpartnerId(order.getC_BPartner_ID()); + request.getSession().setAttribute(Constants.BPARTNER, bean.getBpartnerId()); + + } + ShoppingCartBean cartBean = (ShoppingCartBean) request.getSession().getAttribute(Constants.SHOPPING_ORDER_CART); + if(cartBean==null) + { + postGlobalError("error.pos.shoppingcart.empty",request); + return mapping.getInputForward(); + } + request.getSession().setAttribute(Constants.PRESENT_POS_ORDER,order); + request.getSession().setAttribute(Constants.SHOPPING_ORDER_CART, cartBean); + request.getSession().setAttribute(Constants.SHOPPING_ORDER_CART_ITEMS, cartBean.getItems()); + return mapping.findForward(GET_POS_PAYMENT_DETAILS); + } + + public static final String GET_POS_CUSTOMERS="getPOSCustomers"; + public ActionForward getPOSCustomers(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + //Properties ctx=TmkJSPEnv.getCtx(request); + DefaultForm df= (DefaultForm) form; + //OrderLineBean bean=(OrderLineBean) df.getBean(); + df.populate(new OrderLineBean()); + ShoppingCartBean cartBean = (ShoppingCartBean) request.getSession().getAttribute(Constants.SHOPPING_ORDER_CART); + + if(cartBean == null||cartBean.getItems() == null||cartBean.getItems().size() == 0) + { + postGlobalError("error.pos.shoppingcart.empty",request); + return mapping.getInputForward(); + } + request.getSession().setAttribute(Constants.SHOPPING_ORDER_CART, cartBean); + request.getSession().setAttribute(Constants.SHOPPING_ORDER_CART_ITEMS, cartBean.getItems()); + + + return mapping.findForward(GET_POS_CUSTOMERS); + } + + public ActionForward deletePOSOrderLine(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx=TmkJSPEnv.getCtx(request); + DefaultForm df= (DefaultForm) form; + OrderLineBean bean=(OrderLineBean) df.getBean(); + + String forward = null; + + Trx trx = Trx.get(TrxPrefix.getPrefix(),true); + + try + { + trx.start(); + forward = POSManager.deleteOrderLines(ctx,bean.getPosOrderLineIds(),trx.getTrxName()); + trx.commit(); + } + catch (NoOrderLineSelectedException e) + { + trx.rollback(); + SessionStorage.putPOSOrderInfo(ctx,bean,request,forward); + + postGlobalError("error.order.noOrderline.selected",request); + return mapping.getInputForward(); + } + catch(OperationException ex) + { + trx.rollback(); + throw new OperationException("Could not delete orderline. Reason : " + ex); + } + finally + { + trx.close(); + } + + Integer orderId = getCurrentOrderId(mapping, form, request, response); + //validating order + //if lines == 0 goto createpartialOrder + + //reload shopping cart + ShoppingCartBean cart = POSManager.getShoppingCartForOrder(ctx,orderId.intValue(),null); + String shoppingCart = null; + String shoppingCartItem = null; + String input = null; + + String orderType = bean.getOrderType(); + + if(orderType.equals(Constants.POS_ORDER)) + { + input = "/CreatePOSOrder.do"; + + shoppingCart = Constants.SHOPPING_ORDER_CART; + shoppingCartItem = Constants.SHOPPING_ORDER_CART_ITEMS; + } + else if(orderType.equals(Constants.GOODS_RECEIVE_NOTE)) + { + input = "/GetAllPOSVendor.do?action=getAllVendors&isSales=true"; + + shoppingCart = Constants.GOODS_RECEIVE_NOTE_SHOPPING_CART; + shoppingCartItem = Constants.GOODS_RECEIVE_NOTE_SHOPPING_CART_ITEMS; + } + else if(orderType.equals(Constants.GOODS_RETURN_NOTE)) + { + input = "/GetAllPOSVendor.do?action=getAllVendors&isSales=false"; + + shoppingCart = Constants.GOODS_RETURN_NOTE_SHOPPING_CART; + shoppingCartItem = Constants.GOODS_RETURN_NOTE_SHOPPING_CART_ITEMS; + } + else if(orderType.equals(Constants.CUSTOMER_RETURN_ORDER)) + { + input = "/CustomerReturnOrder.do"; + + shoppingCart = Constants.CUSTOMER_RETURN_ORDER_SHOPPING_CART; + shoppingCartItem = Constants.CUSTOMER_RETURN_ORDER_SHOPPING_CART_ITEMS; + } + else + { + + } + + request.getSession().setAttribute(shoppingCart,cart); + request.getSession().setAttribute(shoppingCartItem,cart.getItems()); + + + if(OrderManager.isOrderEmpty(ctx,orderId.intValue(),null)) + { + request.getSession().removeAttribute(Constants.ALL_CUSTOMERS); + request.getSession().removeAttribute(shoppingCart); + request.getSession().removeAttribute(shoppingCartItem); + return new ActionForward(input); + } + + SessionStorage.putPOSOrderInfo(ctx,bean,request,forward); + df.populate(new OrderLineBean()); + return mapping.findForward(forward); + } + + public static final String VIEW_POS_INFO="viewPOSInfo"; + public ActionForward viewPOSInfo(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx=TmkJSPEnv.getCtx(request); + DefaultForm df= (DefaultForm) form; + + ReportBean bean = (ReportBean) df.getBean(); + + Timestamp fromdate = ReportDateManager.getFromDate(bean); + Timestamp todate = ReportDateManager.getToDate(bean); + + ArrayList list = POSManager.getPOSInfo(ctx, fromdate, todate, null); + request.getSession().setAttribute(Constants.POS_INFO,list); + //df.populate(new OrderLineBean()); + + return mapping.findForward(VIEW_POS_INFO); + } + + + + public static final String INCREMENT_QTY = "incrementQty"; + public ActionForward incrementQty(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception + { + // Bug fix for null pointer + OrderLineForm of = (OrderLineForm) form; + if(of.getQuantity() == null) + { + of.setQuantity("1"); + } + + addToShoppingCart(mapping,form,request,response); + return getShoppingCart(mapping,form,request,response); + } + + public static final String DECREMENT_QTY = "decrementQty"; + public ActionForward decrementQty(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception + { + // Bug fix for null pointer + OrderLineForm of = (OrderLineForm) form; + if(of.getQuantity() == null) + { + of.setQuantity("1"); + } + + addToShoppingCart(mapping,form,request,response); + return getShoppingCart(mapping,form,request,response); + } + + public ActionForward addProduct(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException, IOException, ParseException + { + // Bug fix for null pointer + OrderLineForm of = (OrderLineForm) form; + if(of.getQuantity() == null) + { + of.setQuantity("1"); + } + + addToShoppingCart(mapping,form,request,response); + + return getShoppingCart(mapping,form,request,response); + } + + + public static final String ADD_TO_SHOPPING_CART = "addToShoppingCart"; + public ActionForward addToShoppingCart(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException + { + Properties ctx = TmkJSPEnv.getCtx(request); + DefaultForm df = (DefaultForm) form; + OrderLineBean bean = (OrderLineBean) df.getBean(); + // ShoppingCartBean cartBean = (ShoppingCartBean) request.getSession().getAttribute(Constants.SHOPPING_ORDER_CART); + String orderType = bean.getOrderType(); + + if (orderType==null) + { orderType=(String)request.getSession().getAttribute(Constants.ORDER_TYPE); + bean.setOrderType(orderType); + df.populate(bean); + } + + String shoppingCart = Constants.SHOPPING_ORDER_CART; + String shoppingCartItem = Constants.SHOPPING_ORDER_CART_ITEMS; + String path=null; + + if (orderType.equalsIgnoreCase(Constants.POS_ORDER)) + { + path="/jsp/pos/createPOSOrder.jsp"; + } + if (orderType.equalsIgnoreCase(Constants.POS_ORDER_WITHOUT_ADVANCED)) + { + path="/jsp/pos/createPOSOrderWithoutAdvance.jsp"; + } + if (orderType.equalsIgnoreCase(Constants.QUICK_POS_ORDER)) + { + path="/jsp/pos/createPOSOrder3.jsp"; + } + if (orderType.equalsIgnoreCase(Constants.POS_ORDER_CUSTOMER_COMPULSORY)) + { + path="/jsp/pos/createPOSOrder2.jsp"; + } + else if(orderType.equalsIgnoreCase(Constants.CREDIT_ORDER)) + { + path="/jsp/pos/createCreditOrder.jsp"; + } + + ShoppingCartBean cartBean = (ShoppingCartBean) request.getSession().getAttribute(shoppingCart); + + try + { + // POSManager.getQtyAndItem(bean); + if(bean.getProductId()==null && bean.getBarCode()==null) + { + postGlobalError("error.barcode.required", request); + return new ActionForward(path); + } + + BigDecimal qty = bean.getQuantity(); + if(qty != null && qty.doubleValue() < 0.0) + { + throw new InputQuantityLessThanZeroException(""); + } + + cartBean = StockManager.addToPOSCart(ctx, bean, cartBean,true,Boolean.parseBoolean(bean.getIfAdd())); + + try + { + // cartBean = ComputeTotalLinePriceForDiscount(request, cartBean); + } + catch (Exception e) + { + e.printStackTrace(); + } + + } + catch (InputQuantityLessThanZeroException e) + { + postGlobalError("error.invalid.inputQty", request); + return new ActionForward(path); + } + catch (ProductNotFoundException e) + { + postGlobalError("error.product.not.found", e.getMessage(), request); + return new ActionForward(path); + } + catch(QuantityNotAvailableException e) + { + postGlobalError("error.quantity.notAvailable", e.getMessage(), request); + return new ActionForward(path); + } + + catch(ProductNotOnPriceListException e) + { + postGlobalError("error.product.price.not.found", e.getMessage(), request); + return new ActionForward(path); + } + + catch (UOMValuePrecisionNotValidException e) + { + postGlobalError("error.precision", e.getMessage(), request); + return new ActionForward(path); + } + + BigDecimal cartTotal = StockManager.setGrandTotal(cartBean.getItems()); + + String currSymboleSales = POSTerminalManager.getDefaultSalesCurrency(ctx).getCurSymbol(); + request.setAttribute(Constants.CURRENCY_SYMBOLE,currSymboleSales); + request.getSession().setAttribute(Constants.ORDER_TYPE,orderType); + + + request.getSession().setAttribute(shoppingCart, cartBean); + request.getSession().setAttribute(shoppingCartItem, cartBean.getItems()); + request.getSession().setAttribute(Constants.SHOPPING_CART_TOTAL, cartTotal); + request.getSession().setAttribute(Constants.B_PARTNER_ID,bean.getBpartnerId()); + + df.setQtyAndItem(""); + + return new ActionForward(path); + //return mapping.findForward(ADD_TO_SHOPPING_CART); + } + + public static final String GET_CURRENT_TILL_AMOUNT="getCurrentTillAmount"; + + public ActionForward getCurrentTillAmount(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx=TmkJSPEnv.getCtx(request); + //DefaultForm df= (DefaultForm) form; + + CurrentTillAmountBean bean = POSManager.getCurrentTillAmount(ctx); + MCurrency currency = POSTerminalManager.getCurrencyOfTerminalCashBook(ctx); + request.setAttribute(Constants.CURRENCY_SYMBOLE,currency.getCurSymbol()); + request.getSession().setAttribute(Constants.CURRENT_TILL_AMOUNT,bean); + return mapping.findForward(GET_CURRENT_TILL_AMOUNT); + } + + public static final String OPEN_CASH_DRAWER="openCashDrawer"; + + public ActionForward openCashDrawer(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException, IOException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + String cmd = PrintManager.getOpenDrawerCmd(); + + response.setContentType("application/octet-stream"); + OutputStream os = response.getOutputStream(); + os.write(cmd.getBytes()); + os.flush(); + os.close(); + + return null; + //return mapping.findForward(OPEN_CASH_DRAWER); + } + + public static final String REPRINT_ORDER="reprintOrder"; + + public ActionForward reprintOrder(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx=TmkJSPEnv.getCtx(request); + + DefaultForm df= (DefaultForm) form; + + OrderLineBean bean=(OrderLineBean)df.getBean(); + + OrderManager.rePrintOrder(ctx,bean.getOrderId()); + + return mapping.findForward(REPRINT_ORDER); + } + + public static final String DELETE_ORDER="deleteOrder"; + public ActionForward deleteOrder(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx=TmkJSPEnv.getCtx(request); + + DefaultForm df= (DefaultForm) form; + + OrderBean orderBean = (OrderBean)df.getBean(); + + try + { + OrderManager.deleteDraftedOrder(ctx, orderBean.getOrderId(), null); + } + catch(OperationException ex) + { + MOrder posOrder = new MOrder(ctx,orderBean.getOrderId(),null); + ArrayList list = POSManager.populateOrderLines(ctx,posOrder); + request.setAttribute(Constants.POS_ORDER_LINES,list); + postGlobalError("error.order.delete", request); + return mapping.getInputForward(); + } + return mapping.findForward(DELETE_ORDER); + } + + public static Integer getCurrentOrderId(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) + { + DefaultForm f = (DefaultForm)form; + + String orderType = f.getOrderType(); + Integer orderId = null; + + if(orderType.equals(Constants.POS_ORDER)) + { + orderId = (Integer) request.getSession().getAttribute(Constants.CURRENT_POS_ORDER_ID); + } + + if(orderType.equals(Constants.GOODS_RECEIVE_NOTE)) + { + orderId = (Integer) request.getSession().getAttribute(Constants.GOODS_RECEIVE_NOTE_ID); + } + + if(orderType.equals(Constants.GOODS_RETURN_NOTE)) + { + orderId = (Integer) request.getSession().getAttribute(Constants.GOODS_RETURN_NOTE_ID); + } + + if(orderType.equals(Constants.CUSTOMER_RETURN_ORDER)) + { + orderId = (Integer) request.getSession().getAttribute(Constants.CUSTOMER_RETURN_ORDER_ID); + } + + return orderId; + } + + public static final String DELETE_POS_ORDER = "deletePOSOrder"; + public ActionForward deletePOSOrder(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx=TmkJSPEnv.getCtx(request); + + Integer orderId = (Integer) request.getSession().getAttribute( Constants.CURRENT_POS_ORDER_ID ); + + if( orderId == null ) + { + throw new OperationException("Cannot delete order. Reason: order ID not found!"); + } + + Trx trx = Trx.get(TrxPrefix.getPrefix(),true); + + try + { + trx.start(); + OrderManager.deleteDraftedOrder(ctx, orderId.intValue(), trx.getTrxName()); + trx.commit(); + } + catch(OperationException ex) + { + trx.rollback(); + MOrder posOrder = new MOrder(ctx,orderId.intValue(),null); + ArrayList list = POSManager.populateOrderLines(ctx,posOrder); + request.setAttribute(Constants.POS_ORDER_LINES,list); + postGlobalError("error.order.delete", request); + return mapping.getInputForward(); + } + finally + { + trx.close(); + } + + //remove previously set values + request.getSession().removeAttribute(Constants.ALL_CUSTOMERS); + request.getSession().removeAttribute(Constants.SHOPPING_ORDER_CART); + request.getSession().removeAttribute(Constants.SHOPPING_ORDER_CART_ITEMS); + request.getSession().removeAttribute(Constants.CURRENT_POS_ORDER_ID); + request.getSession().removeAttribute(Constants.CREDIT_ORDER_SHOPPING_CART); + request.getSession().removeAttribute(Constants.CREDIT_ORDER_SHOPPING_CART_ITEMS); + request.getSession().removeAttribute(Constants.CREDITORDER_BPARTNER); + + return mapping.findForward(DELETE_POS_ORDER); + } + + public ActionForward getShoppingCart(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws OperationException, IOException, ParseException + { + DefaultForm df = (DefaultForm) form; + String orderType = df.getOrderType(); + + String shoppingcartHTML = ShoppingcartManager.getShoppingcartAsHTML(request, orderType); + + PrintWriter writer = response.getWriter(); + writer.write(shoppingcartHTML); + + + ActionMessages errors = (ActionMessages) request.getAttribute("org.apache.struts.action.ERROR"); + if(errors != null && !errors.isEmpty()) + { + MessageResources messageResources = getResources(request); + + Iterator iter = errors.get(); + while(iter.hasNext()) + { + ActionMessage message = iter.next(); + String key = message.getKey(); + Object[] values = message.getValues(); + + String errMsg = messageResources.getMessage(key, values); + writer.write(""); + } + + } + + writer.close(); + + return null; + } + + public ActionForward getBarcodeCart(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws OperationException, IOException, ParseException + { + DefaultForm df = (DefaultForm) form; + String orderType = df.getOrderType(); + + String shoppingcartHTML = ShoppingcartManager.getBarcodecartAsHTML(request); + + PrintWriter writer = response.getWriter(); + writer.write(shoppingcartHTML); + + + ActionMessages errors = (ActionMessages) request.getAttribute("org.apache.struts.action.ERROR"); + if(errors != null && !errors.isEmpty()) + { + MessageResources messageResources = getResources(request); + + Iterator iter = errors.get(); + while(iter.hasNext()) + { + ActionMessage message = iter.next(); + String key = message.getKey(); + Object[] values = message.getValues(); + + String errMsg = messageResources.getMessage(key, values); + writer.write(""); + } + + } + + writer.close(); + + return null; + } + + public ActionForward validateAdvanceOrderPIN(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws IOException, OperationException + { + Properties ctx=TmkJSPEnv.getCtx(request); + + DefaultForm df = (DefaultForm) form; + String userPIN = df.getUserPIN(); + + LoginBean bean = null; + LoginManager loginManager = new LoginManager(); + String script = null; + String errorMsg = ElementManager.getMsg(ctx,"not.authorised.to.give.discount").getName(); + + ShoppingCartBean cartBean = (ShoppingCartBean) request.getSession().getAttribute(Constants.SHOPPING_ORDER_CART); + + if (cartBean == null || cartBean.getItems().size() == 0) + { + script = "PINError('No items in cart')"; + } + else + { + try + { + bean = loginManager.getUserNameFromPIN(ctx, userPIN); + WebUser wu = loginManager.checkLoginPassword(ctx, bean); + + int roleId = Env.getAD_Role_ID(ctx); + BigDecimal discountAllowed = RoleManager.getDiscountAllowed(ctx, roleId, null); + + if(discountAllowed != Env.ZERO) + { + script = "setAction(document.forms[0],'GetPOSPaymentDetailsAction.do','getPOSPaymentDetails');" + + "disableButtons();"; + + request.getSession().setAttribute(Constants.DISCOUNT_ALLOWED, discountAllowed); + } + else + { + script = "PINError('" + errorMsg + "');" ; + } + } + catch (DuplicatePINException e) + { + script = "PINError('" + errorMsg + "');" ; + } + catch (InvalidPINException e) + { + script = "PINError('" + errorMsg + "');" ; + } + catch (UserNotFoundException e) + { + script = "PINError('" + errorMsg + "');" ; + } + catch (UserInactiveException e) + { + script = "PINError('" + errorMsg + "');" ; + } + catch (NotLoggedInException e) + { + script = "PINError('" + errorMsg + "');" ; + } + catch (SQLException e) + { + throw new OperationException(e); + } + catch (OperationException e) + { + throw new OperationException(e); + } + } + PrintWriter writer = response.getWriter(); + writer.print( script ); + writer.flush(); + writer.close(); + + return null; + } + + public ActionForward skipValidation(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws IOException, OperationException + { + Properties ctx=TmkJSPEnv.getCtx(request); + + DefaultForm df = (DefaultForm) form; + + LoginBean bean = null; + LoginManager loginManager = new LoginManager(); + String script = null; + String errorMsg = ElementManager.getMsg(ctx,"not.authorised.to.give.discount").getName(); + + ShoppingCartBean cartBean = (ShoppingCartBean) request.getSession().getAttribute(Constants.SHOPPING_ORDER_CART); + + if (cartBean == null || cartBean.getItems().size() == 0) + { + script = "PINError('No items in cart')"; + } + else + { + try + { + int roleId = Env.getAD_Role_ID(ctx); + + BigDecimal discountAllowed = RoleManager.getDiscountAllowed(ctx, roleId, null); + + if(discountAllowed != Env.ZERO) + { + script = "setAction(document.forms[0],'GetPOSPaymentDetailsAction.do','getPOSPaymentDetails');" + + "disableButtons();"; + + request.getSession().setAttribute(Constants.DISCOUNT_ALLOWED, discountAllowed); + } + else + { + script = "PINError('" + errorMsg + "');" ; + } + } + catch (OperationException e) + { + throw new OperationException(e); + } + } + PrintWriter writer = response.getWriter(); + writer.print( script ); + writer.flush(); + writer.close(); + + return null; + } + + public ActionForward validateAdvanceOrderPIN2(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws IOException, OperationException + { + Properties ctx=TmkJSPEnv.getCtx(request); + + DefaultForm df = (DefaultForm) form; + String userPIN = df.getUserPIN(); + + LoginBean bean = null; + LoginManager loginManager = new LoginManager(); + String script = null; + + try + { + bean = loginManager.getUserNameFromPIN(ctx, userPIN); + WebUser wu = loginManager.checkLoginPassword(ctx, bean); + + int roleId = Env.getAD_Role_ID(ctx); + + BigDecimal discountAllowed = RoleManager.getDiscountAllowed(ctx, roleId, null); + + if(discountAllowed != Env.ZERO) + { + script = "setAction(document.forms[0],'GetPOSPaymentDetailsAction2.do','getPOSPaymentDetails');" + + "disableButtons();"; + + request.getSession().setAttribute(Constants.DISCOUNT_ALLOWED, discountAllowed); + } + else + { + script = "PINError('It seems that you are not authorised to give discounts.');" ; + } + } + catch (DuplicatePINException e) + { + script = "PINError('It seems that you are not authorised to give discounts.');" ; + } + catch (InvalidPINException e) + { + script = "PINError('It seems that you are not authorised to give discounts.');" ; + } + catch (UserNotFoundException e) + { + script = "PINError('It seems that you are not authorised to give discounts.');" ; + } + catch (UserInactiveException e) + { + script = "PINError('It seems that you are not authorised to give discounts.');" ; + } + catch (NotLoggedInException e) + { + script = "PINError('It seems that you are not authorised to give discounts.');" ; + } + catch (SQLException e) + { + throw new OperationException(e); + } + catch (OperationException e) + { + throw new OperationException(e); + } + + PrintWriter writer = response.getWriter(); + writer.print( script ); + writer.flush(); + writer.close(); + + return null; + } + + public ActionForward getPrintOrderData(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws IOException, OperationException, ApplicationException + { + Properties ctx = TmkJSPEnv.getCtx(request); + DefaultForm df = (DefaultForm) form; + OrderLineBean bean = (OrderLineBean) df.getBean(); + + Integer C_Order_ID = bean.getOrderId(); + + if(C_Order_ID == null) + return null; + + String printingType = POSManager.getPrintingTypeFromCookie(request); + boolean cashDrawerPresent = POSManager.getCashDrawerStatusFromCookie(request); + + if (printingType == null) + { + printingType = TmkPrinterConstants.SLIP_PRINTER_9PIN; + } + + byte printData[] = null; + byte [] openCashDrawer = {10,27,112,48,55,1}; + + String args = "showFooter=true;lineLength=40;priceWithVat=true;showDiscount=true;showLogo=false;showBarcode=false;"; + + if (TmkPrinterConstants.SLIP_PRINTER_9PIN.equalsIgnoreCase(printingType)) + { + String data = PrintManager.getPrintData(ctx, C_Order_ID, args, null); + response.setContentType("application/octet-stream"); + printData = data.getBytes(); + } + else if (TmkPrinterConstants.SLIP_PRINTER_THERMAL.equalsIgnoreCase(printingType)) + { + args = "showFooter=true;lineLength=64;priceWithVat=true;showDiscount=true;showLogo=false;showBarcode=false;"; + String data = PrintManager.getPrintData(ctx, C_Order_ID, args, null); + response.setContentType("application/octet-stream"); + printData = data.getBytes(); + } + else if (TmkPrinterConstants.NORMAL_PRINTER.equalsIgnoreCase(printingType)) + { + printData = PrintManager.getPDFData(ctx, ReportEngine.ORDER, C_Order_ID); + response.setContentType("application/pdf"); + } + else + { + logger.log(Level.SEVERE, "Printing Type not defined, PrintingType: " + printingType); + return null; + } + + OutputStream os = response.getOutputStream(); + + if(bean.getOpenDrawer() && cashDrawerPresent) + { + os.write(openCashDrawer); + } + + os.write(printData); + os.flush(); + os.close(); + + + return null; + } + + public static final String GET_ORDER_SHOPPING_CART="getOrderShoppingCart"; + public ActionForward getOrderShoppingCart(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws IOException, OperationException, ApplicationException + { + + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx=TmkJSPEnv.getCtx(request); + + DefaultForm df = (DefaultForm) form; + OrderLineBean bean = (OrderLineBean) df.getBean(); + ActionForward forward=null; + + Integer orderId = bean.getOrderId(); + MOrder order = new MOrder(ctx,orderId,null); + + ShoppingCartBean cart = (ShoppingCartBean)request.getSession().getAttribute(Constants.SHOPPING_ORDER_CART); + if(cart == null) + { + cart = POSManager.getShoppingCartForOrder(ctx, order.get_ID(), null); + } + + + int c_BPartner_Id = order.getC_BPartner_ID(); + request.getSession().setAttribute(Constants.BPARTNER, Integer.valueOf(c_BPartner_Id)); + + if((Constants.POS_ORDER_WITHOUT_ADVANCED).equalsIgnoreCase(df.getOrderType())) + { + cart = POSManager.getShoppingCartForOrder(ctx, order.get_ID(), null); + request.getSession().setAttribute(Constants.BPARTNER, Integer.valueOf(c_BPartner_Id)); + request.getSession().setAttribute( Constants.SHOPPING_ORDER_CART , cart ); + request.getSession().setAttribute( Constants.SHOPPING_ORDER_CART_ITEMS , cart.getItems() ); + request.getSession().setAttribute( Constants.PRESENT_POS_ORDER , order ); + request.getSession().setAttribute( Constants.PRESENT_POS_ORDER_ID , Integer.valueOf(order.get_ID()) ); + + forward = new ActionForward("/CreatePOSOrderWithoutAdvanced.do"); + + df.populate(new OrderLineBean()); + return forward; + } + + if((Constants.POS_ORDER_CUSTOMER_COMPULSORY).equalsIgnoreCase(df.getOrderType())) + { + cart = POSManager.getShoppingCartForOrder(ctx, order.get_ID(), null); + request.getSession().setAttribute(Constants.BPARTNER, Integer.valueOf(c_BPartner_Id)); + request.getSession().setAttribute( Constants.SHOPPING_ORDER_CART , cart ); + request.getSession().setAttribute( Constants.SHOPPING_ORDER_CART_ITEMS , POSManager.getItemBean(cart.getItems()) ); + request.getSession().setAttribute( Constants.PRESENT_POS_ORDER , order ); + request.getSession().setAttribute( Constants.PRESENT_POS_ORDER_ID , Integer.valueOf(order.get_ID()) ); + + forward = new ActionForward("/CreatePOSOrder2.do"); + + df.populate(new OrderLineBean()); + return forward; + } + + if(order.getOrderType().equals(UDIOrderTypes.POS_ORDER.getOrderType())) + { + cart = POSManager.getShoppingCartForOrder(ctx, order.get_ID(), null); + request.getSession().setAttribute(Constants.BPARTNER, Integer.valueOf(c_BPartner_Id)); + request.getSession().setAttribute( Constants.SHOPPING_ORDER_CART , cart ); + request.getSession().setAttribute( Constants.SHOPPING_ORDER_CART_ITEMS , POSManager.getItemBean(cart.getItems())); + request.getSession().setAttribute( Constants.PRESENT_POS_ORDER , order ); + request.getSession().setAttribute( Constants.PRESENT_POS_ORDER_ID , Integer.valueOf(order.get_ID()) ); + df.populate(new OrderLineBean()); + forward = new ActionForward("/CreatePOSOrder.do"); + } + else if(order.getOrderType().equals(UDIOrderTypes.POS_GOODS_RECEIVE_NOTE.getOrderType())) + { + cart = (ShoppingCartBean)request.getSession().getAttribute(Constants.GOODS_RECEIVE_NOTE_SHOPPING_CART); + request.getSession().setAttribute(Constants.BPARTNER, Integer.valueOf(c_BPartner_Id)); + request.getSession().setAttribute( Constants.GOODS_RECEIVE_NOTE_SHOPPING_CART , cart ); + + if (cart != null) + { + request.getSession().setAttribute( Constants.GOODS_RECEIVE_NOTE_SHOPPING_CART_ITEMS , cart.getItems() ); + request.getSession().setAttribute( Constants.PRESENT_GRN_ORDER , order ); + request.getSession().setAttribute( Constants.PRESENT_GRN_ORDER_ID , Integer.valueOf(order.get_ID()) ); + } + + forward = new ActionForward("/GetAllPOSVendor.do?action=getAllVendors&isSales=true"); + } + else if(order.getOrderType().equals(UDIOrderTypes.POS_GOODS_RETURN_NOTE.getOrderType())) + { + cart = (ShoppingCartBean)request.getSession().getAttribute(Constants.GOODS_RETURN_NOTE_SHOPPING_CART); + request.getSession().setAttribute(Constants.BPARTNER, Integer.valueOf(c_BPartner_Id)); + request.getSession().setAttribute( Constants.GOODS_RETURN_NOTE_SHOPPING_CART, cart ); + request.getSession().setAttribute( Constants.GOODS_RETURN_NOTE_SHOPPING_CART_ITEMS,cart.getItems() ); + request.getSession().setAttribute( Constants.PRESENT_GOODS_RET_ORDER , order ); + request.getSession().setAttribute( Constants.PRESENT_GOODS_RET_ORDER_ID , Integer.valueOf(order.get_ID()) ); + + forward = new ActionForward("/GetAllPOSVendor.do?action=getAllVendors&isSales=false"); + } + else if(order.getOrderType().equals(UDIOrderTypes.CUSTOMER_RETURN_ORDER.getOrderType())) + { + cart = (ShoppingCartBean)request.getSession().getAttribute(Constants.CUSTOMER_RETURN_ORDER_SHOPPING_CART); + request.getSession().setAttribute(Constants.BPARTNER, Integer.valueOf(c_BPartner_Id)); + request.getSession().setAttribute( Constants.CUSTOMER_RETURN_ORDER_SHOPPING_CART, cart ); + request.getSession().setAttribute( Constants.CUSTOMER_RETURN_ORDER_SHOPPING_CART_ITEMS, POSManager.getItemBean(cart.getItems()) ); + request.getSession().setAttribute( Constants.PRESENT_CUSTOMER_RET_ORDER , order ); + request.getSession().setAttribute( Constants.PRESENT_CUSTOMER_RET_ORDER_ID , Integer.valueOf(order.get_ID()) ); + + forward = new ActionForward("/CustomerReturnOrder.do"); + + } + else if(order.getOrderType().equals(UDIOrderTypes.CREDIT_ORDER.getOrderType())) + { + cart = (ShoppingCartBean)request.getSession().getAttribute(Constants.CREDIT_ORDER_SHOPPING_CART); + request.getSession().setAttribute(Constants.CREDITORDER_BPARTNER, Integer.valueOf(c_BPartner_Id)); + request.getSession().setAttribute( Constants.CREDIT_ORDER_SHOPPING_CART , cart ); + request.getSession().setAttribute( Constants.CREDIT_ORDER_SHOPPING_CART_ITEMS , POSManager.getItemBean(cart.getItems()) ); + request.getSession().setAttribute( Constants.PRESENT_CREDIT_ORDER , order ); + request.getSession().setAttribute( Constants.PRESENT_CREDIT_ORDER_ID , Integer.valueOf(order.get_ID()) ); + forward = new ActionForward("/InitCreateCreditOrderAction.do?action=initCreateCreditOrder"); + + } + + else if(order.getOrderType().equals(UDIOrderTypes.CREDIT_MEMO.getOrderType())) + { + cart = (ShoppingCartBean)request.getSession().getAttribute(Constants.CUSTOMER_RETURN_ORDER_SHOPPING_CART); + OrderBean orderBean = POSManager.getPOSOrderDetail(ctx,order.getDocumentNo()); + int bpartnerId = orderBean.getBpartnerId().intValue(); + MBPartner partner = BPartnerManager.loadBPartner(ctx, bpartnerId,null); + String partnerName = partner.getName() + " " + partner.getName2(); + partnerName = partnerName.trim(); + + df.setPartnerName(partnerName); + df.setBpartnerId(orderBean.getBpartnerId().toString()); + + request.getSession().setAttribute(Constants.B_PARTNER_ID,orderBean.getBpartnerId()); + request.getSession().setAttribute(Constants.ORDER_TYPE,orderBean.getOrderType()); + request.getSession().setAttribute(Constants.POS_ORDER_DOC_NUMBER,bean.getDocumentNo()); + request.getSession().setAttribute(Constants.CREDIT_PAYMENT_TERM_ID,orderBean.getPaymentTermId()); + if (cart != null) + { + request.getSession().setAttribute(Constants.CUSTOMER_RETURN_ORDER_SHOPPING_CART,cart); + request.getSession().setAttribute(Constants.CUSTOMER_RETURN_ORDER_SHOPPING_CART_ITEMS,cart.getItems()); + } + forward = new ActionForward("/CreditMemoAction.do"); + + } + else + { + String msg = "Unknown orderType : " + order.getOrderType(); + throw new OperationException(msg); + } + df.populate(new OrderLineBean()); + return forward; + } + + public static final String GET_CUSTOMER_RETURN_ORDER_SHOPPING_CART = "getCustomerReturnOrderShoppingCart"; + public ActionForward getCustomerReturnOrderShoppingCart(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws IOException, OperationException, ApplicationException + { + getOrderShoppingCart(mapping,form,request,response); + + Properties ctx=TmkJSPEnv.getCtx(request); + DefaultForm df = (DefaultForm) form; + Integer bpartnerId = (Integer) request.getSession().getAttribute(Constants.B_PARTNER_ID); + + MBPartner partner = BPartnerManager.loadBPartner(ctx, bpartnerId.intValue(),null); + String partnerName = partner.getName() + " " + partner.getName2(); + partnerName = partnerName.trim(); + + df.setPartnerName(partnerName); + df.setBpartnerId(bpartnerId.toString()); + + return mapping.findForward(GET_CUSTOMER_RETURN_ORDER_SHOPPING_CART); + } + + public static final String GET_CUSTOMER_RETURN_ORDER_SHOPPING_CART2 = "getCustomerReturnOrderShoppingCart2"; + public ActionForward getCustomerReturnOrderShoppingCart2(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws IOException, OperationException, ApplicationException + { + getOrderShoppingCart(mapping,form,request,response); + + /* + Properties ctx=TmkJSPEnv.getCtx(request); + DefaultForm df = (DefaultForm) form; + Integer bpartnerId = (Integer) request.getSession().getAttribute(Constants.B_PARTNER_ID); + + MBPartner partner = BPartnerManager.loadBPartner(ctx, bpartnerId.intValue(),null); + String partnerName = partner.getName() + " " + partner.getName2(); + partnerName = partnerName.trim(); + + df.setPartnerName(partnerName); + df.setBpartnerId(bpartnerId.toString()); + */ + + return mapping.findForward(GET_CUSTOMER_RETURN_ORDER_SHOPPING_CART2); + } + + public static final String GET_CREDIT_MEMO_SHOPPING_CART = "getCreditMemoShoppingCart"; + public ActionForward getCreditMemoShoppingCart(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws IOException, OperationException, ApplicationException + { + getCustomerReturnOrderShoppingCart(mapping,form,request,response); + return mapping.findForward(GET_CREDIT_MEMO_SHOPPING_CART); + } + + public static final String REMOVE_SESSION_FOR_NEW_OREDR="removeSessionForNewOrder"; + public ActionForward removeSessionForNewOrder(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws IOException, OperationException, ApplicationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + + Properties ctx=TmkJSPEnv.getCtx(request); + RemoveSessionForm df = (RemoveSessionForm) form; + RemoveSessionBean bean = (RemoveSessionBean) df.getBean(); + + SessionStorage.removeSession(ctx,request); + String forwd =POSManager.getForward(ctx,bean.getOrderType()); + + + return new ActionForward(forwd); + } + + //---------------------------------------------------------------------------------------------- + + public static final String UPDATE_QTY = "updateQty"; + public ActionForward updateQty(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception + { + Properties ctx=TmkJSPEnv.getCtx(request); + + // Bug fix for null pointer + OrderLineForm of = (OrderLineForm) form; + if(of.getQuantity() == null) + { + of.setQuantity("1"); + } + + OrderLineBean bean = (OrderLineBean) of.getBean(); + Integer product_id = bean.getProductId(); + BigDecimal quantity = bean.getQuantity(); + Integer priceListId = bean.getPriceListId(); + + ArrayList items = (ArrayList) request.getSession().getAttribute(Constants.SHOPPING_ORDER_CART_ITEMS); + StockManager.updateItemFromPOSList(ctx, priceListId, items, product_id, quantity); + ShoppingCartBean cartBean = (ShoppingCartBean) request.getSession().getAttribute(Constants.SHOPPING_ORDER_CART); + cartBean.setItems(items); + BigDecimal cartTotal = StockManager.setGrandTotal(items); + request.getSession().setAttribute(Constants.SHOPPING_CART_TOTAL, cartTotal); + request.getSession().setAttribute(Constants.SHOPPING_ORDER_CART_ITEMS, items); + + if(quantity.doubleValue() == 0.0d) + { + request.getSession().setAttribute(Constants.SHOPPING_CART_DISCOUNTED_TOTAL, Env.ZERO); + } + return getShoppingCart(mapping,form,request,response); + } + + public static final String RELOAD_CART = "reloadCart"; + public ActionForward reloadCart(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception + { + return getShoppingCart(mapping,form,request,response); + } + + public static final String UPDATE_PRICELIST = "updatePriceList"; + public ActionForward updatePriceList(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception + { + Properties ctx=TmkJSPEnv.getCtx(request); + + OrderLineForm of = (OrderLineForm) form; + OrderLineBean bean = (OrderLineBean) of.getBean(); + + Integer priceListId = bean.getPriceListId(); + int oldPriceListId = ShoppingcartManager.getPriceList(request); + + if(oldPriceListId != priceListId) + { + try + { + ArrayList items = (ArrayList) request.getSession().getAttribute(Constants.SHOPPING_ORDER_CART_ITEMS); + StockManager.setPOSItemPrices(ctx, priceListId, items, true); + request.getSession().setAttribute(Constants.SHOPPING_ORDER_CART_ITEMS, items); + request.getSession().setAttribute(Constants.ORDER_PRICE_LIST, priceListId); + } + catch(ProductNotOnPriceListException e) + { + postGlobalError("error.product.price.not.found", e.getMessage(), request); + } + catch(OperationException e) + { + postGlobalError("error.process", e.getMessage(), request); + } + } + + return getShoppingCart(mapping,form,request,response); + } + + public static final String RESET_USER = "resetUser"; + public ActionForward resetUser(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception + { + Properties ctx=TmkJSPEnv.getCtx(request); + OrderLineForm of = (OrderLineForm) form; + OrderLineBean bean = (OrderLineBean) of.getBean(); + + StringBuffer sb = new StringBuffer(); + + try + { + MRole role = new MRole(ctx, bean.getRoleId(), null); + float discountAllowed = role.getUserDiscount().floatValue(); + boolean overrideLimit = role.isOverwritePriceLimit(); + boolean discountUptoPriceLimit = role.isDiscountUptoLimitPrice(); + boolean discountOnTotal = role.isDiscountAllowedOnTotal(); + + CheckoutForm cf = (CheckoutForm) request.getSession().getAttribute("CheckoutForm"); + if(cf == null) + { + cf = new CheckoutForm(); + } + + cf.setDiscountLimit(discountAllowed + ""); + cf.setIsOverwritePriceLimit(overrideLimit + ""); + cf.setIsDiscountOnTotal(discountOnTotal + ""); + cf.setIsDiscountUptoLimitPrice(discountUptoPriceLimit + ""); + + request.getSession().setAttribute("CheckoutForm", cf); + + sb.append("{ roleId:").append(role.getAD_Role_ID()).append(","); + sb.append("discountLimit:").append(discountAllowed).append(","); + sb.append("overrideLimit:").append(overrideLimit).append(","); + sb.append("discountOnTotal:").append(discountOnTotal).append(","); + sb.append("discountUptoPriceLimit:").append(discountUptoPriceLimit).append("}"); + + } + catch (Exception e) + { + sb.append("{error:'" + e.getMessage() + "'}"); + } + + PrintWriter writer = response.getWriter(); + writer.write(sb.toString()); + writer.close(); + + return null; + } + + + public static final String VALIDATE_PIN = "validatePIN"; + public ActionForward validatePIN(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception + { + String pin = request.getParameter("pin"); + Properties ctx=TmkJSPEnv.getCtx(request); + + StringBuffer sb = new StringBuffer(); + + try + { + int ad_role_id = UserManager.getRoleId(ctx, pin, null); + float discountAllowed = UserManager.getDiscountAllowed(ctx, pin, null).floatValue(); + boolean overrideLimit = UserManager.isOverridePriceLimitAllowed(ctx, pin, null); + boolean discountUptoPriceLimit = UserManager.isDiscountUptoPriceLimit(ctx, pin, null); + boolean discountOnTotal = UserManager.isDiscountAllowedOnTotal(ctx, pin, null); + + CheckoutForm cf = (CheckoutForm) request.getSession().getAttribute("CheckoutForm"); + if(cf == null) + { + cf = new CheckoutForm(); + } + + cf.setDiscountLimit(discountAllowed + ""); + cf.setIsOverwritePriceLimit(overrideLimit + ""); + cf.setIsDiscountOnTotal(discountOnTotal + ""); + cf.setIsDiscountUptoLimitPrice(discountUptoPriceLimit + ""); + + request.getSession().setAttribute("CheckoutForm", cf); + + sb.append("{ roleId:").append(ad_role_id).append(","); + sb.append("discountLimit:").append(discountAllowed).append(","); + sb.append("overrideLimit:").append(overrideLimit).append(","); + sb.append("discountOnTotal:").append(discountOnTotal).append(","); + sb.append("discountUptoPriceLimit:").append(discountUptoPriceLimit).append("}"); + + } + catch (UserNotFoundException e) + { + sb.append("{error:'Invalid PIN!'}"); + } + catch (RoleNotFoundException e) + { + sb.append("{error:'Invalid PIN!'}"); + } + + PrintWriter writer = response.getWriter(); + writer.write(sb.toString()); + writer.close(); + + return null; + } + + /** + * This method is called from the order screens + * Parameters supplied are: + * 1. amountTendered + * 2. cardNo + * 3. chequeNo + * 4. cashAmt + * 5. chequeAmt + * 6. cardAmount + * 7. bpartnerId + * 8. tenderType + * 9. discounts + * 10. orderType + * 11. discountLimit + */ + public static final String CHECKOUT = "checkout"; + public ActionForward checkout(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx=TmkJSPEnv.getCtx(request); + CheckoutForm cf = (CheckoutForm) form; + CheckoutBean bean = (CheckoutBean) cf.getBean(); + String input = ""; + + Trx trx = Trx.get(TrxPrefix.getPrefix(), true); + int c_order_id = -1; + + try + { + trx.start(); + //Bug fix for credit sales + //set order type to credit order if tender type is credit + /* + if("Credit".equals(bean.getTenderType()) && + UDIOrderTypes.POS_ORDER.getOrderType().compareTo(bean.getOrderType()) == 0) + { + bean.setOrderType(UDIOrderTypes.CREDIT_ORDER.getOrderType()); + } + */ + + if(UDIOrderTypes.POS_GOODS_RECEIVE_NOTE.getOrderType().equalsIgnoreCase(bean.getOrderType())) + { + input = "/CreatePOSOrderScreen.do"; + c_order_id = POSManager.createGoodsReceiveNote(ctx, bean, request, trx.getTrxName()); + } + + if(UDIOrderTypes.POS_GOODS_RETURN_NOTE.getOrderType().equalsIgnoreCase(bean.getOrderType())) + { + input = "/CreatePOSOrderScreen.do"; + c_order_id = POSManager.createGoodsReturnNote(ctx, bean, request, trx.getTrxName()); + } + + if(UDIOrderTypes.POS_ORDER.getOrderType().equalsIgnoreCase(bean.getOrderType()) + || UDIOrderTypes.CREDIT_ORDER.getOrderType().equalsIgnoreCase(bean.getOrderType())) + { + input = "/CreatePOSOrderScreen.do"; + //get shopping cart items + ArrayList items = (ArrayList) request.getSession().getAttribute(Constants.SHOPPING_ORDER_CART_ITEMS); + c_order_id = POSManager.checkoutOrder(ctx, bean, items, trx.getTrxName()); + } + + /* + if(UDIOrderTypes.CREDIT_ORDER.getOrderType().equalsIgnoreCase(bean.getOrderType())) + { + input = "/CreatePOSOrderScreen.do"; + //get shopping cart items + ArrayList items = (ArrayList) request.getSession().getAttribute(Constants.SHOPPING_ORDER_CART_ITEMS); + c_order_id = POSManager.checkoutOrder(ctx, bean, items, trx.getTrxName()); + } + */ + + if(UDIOrderTypes.CUSTOMER_RETURN_ORDER.getOrderType().equalsIgnoreCase(bean.getOrderType())) + { + input = "/CreatePOSOrderScreen.do"; + //get shopping cart items + ArrayList items = (ArrayList) request.getSession().getAttribute(Constants.SHOPPING_ORDER_CART_ITEMS); + c_order_id = POSManager.createCustomerReturnOrder(ctx, bean, request, trx.getTrxName()); + } + + trx.commit(); + } + catch (Exception e) + { + trx.rollback(); + postGlobalError("error.process", e.getMessage(), request); + e.printStackTrace(); + + return new ActionForward(input); + } + finally + { + trx.close(); + } + + ShoppingcartManager.clearShoppingcart(request); + request.getSession().removeAttribute(Constants.BPARTNER_ID); + request.getSession().removeAttribute(Constants.BPARTNER_NAME); + request.getSession().removeAttribute(Constants.BPARTNER_CREDIT); + request.getSession().removeAttribute(Constants.ORDER_PRICE_LIST); + //return mapping.findForward(CHECKOUT); + return new ActionForward("/ViewPOSOrder.do?orderType=" + bean.getOrderType() + "&orderId=" + c_order_id); + } + + public ActionForward clearCart(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception + { + ShoppingcartManager.clearShoppingcart(request); + + return getShoppingCart(mapping, form, request, response); + } + + public static String SET_DISCOUNT = "setDiscount"; + public ActionForward setDiscount(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx=TmkJSPEnv.getCtx(request); + CheckoutForm cf = (CheckoutForm) form; + CheckoutBean bean = (CheckoutBean) cf.getBean(); + + Trx trx = Trx.get(TrxPrefix.getPrefix(),true); + try + { + trx.start(); + POSManager.setDiscount(ctx, bean, request, trx.getTrxName()); + trx.commit(); + } + catch (DiscountLimitException e) + { + postGlobalError("error.process", e.getMessage(), request); + trx.rollback(); + } + catch(OperationException e) + { + postGlobalError("error.process", e.getMessage(), request); + trx.rollback(); + } + finally + { + trx.close(); + } + return new ActionForward("/CreatePOSOrderScreen.do"); + } + + public ActionForward setQuickDiscount(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx=TmkJSPEnv.getCtx(request); + CheckoutForm cf = (CheckoutForm) form; + CheckoutBean bean = (CheckoutBean) cf.getBean(); + StringBuffer sb = new StringBuffer(); + + Trx trx = Trx.get(TrxPrefix.getPrefix(),true); + try + { + trx.start(); + POSManager.setQuickDiscount(ctx, bean, request, trx.getTrxName()); + sb.append("{status: 'OK'}"); + trx.commit(); + } + catch (DiscountLimitException e) + { + trx.rollback(); + sb.append("{error:'" + e.getMessage() + "'}"); + + } + catch(OperationException e) + { + trx.rollback(); + sb.append("{error:'" + e.getMessage() + "'}"); + } + finally + { + trx.close(); + } + + PrintWriter writer = response.getWriter(); + writer.write(sb.toString()); + writer.close(); + + return null; + + } + + + public static final String LOAD_ORDER_SCREEN = "loadOrderScreen"; + public ActionForward loadOrderScreen(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx=TmkJSPEnv.getCtx(request); + Object isSales = request.getParameter(Constants.IS_SOTRX); + if (isSales == null) + { + return mapping.getInputForward(); + } + String isSO = String.valueOf(isSales); + Boolean isSOTrx = Boolean.valueOf(isSO); + Configuration config = Configuration.getConfiguration(request); + + DefaultForm df = (DefaultForm) form; + String orderType = df.getOrderType(); + + if(orderType == null) + { + if (isSOTrx) + { + orderType = UDIOrderTypes.POS_ORDER.getOrderType(); + } + else + { + orderType = UDIOrderTypes.POS_GOODS_RECEIVE_NOTE.getOrderType(); + } + } + else + { + if(UDIOrderTypes.POS_GOODS_RETURN_NOTE.getOrderType().equals(orderType)) + { + isSOTrx = false; + config.setPaymentRule(Constants.PAYMENT_RULE_CREDIT); + } + + if(UDIOrderTypes.CUSTOMER_RETURN_ORDER.getOrderType().equals(orderType)) + { + isSOTrx = true; + config.setPaymentRule(Constants.PAYMENT_RULE_CREDIT); + } + } + + config.setOrderType(orderType); + config.setIsSOTrx(isSOTrx); + + return new ActionForward("/CreatePOSOrderScreen.do"); + } + + + public static final String LOAD_ADVANCED_ORDER_SCREEN = "loadAdvancedOrderScreen"; + public ActionForward loadAdvancedOrderScreen(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx=TmkJSPEnv.getCtx(request); + Object isSO = request.getParameter(Constants.IS_SOTRX); + Boolean isSOTrx = Boolean.valueOf(String.valueOf(isSO)); + Object pListId = request.getSession().getAttribute(Constants.ORDER_PRICE_LIST); + Integer priceListId = PriceListManager.getDefaultPriceListId(ctx, isSOTrx); + try + { + if (pListId != null) + { + String prListId = String.valueOf(pListId); + priceListId = Integer.valueOf(prListId); + } + } + catch (NumberFormatException e) + { + } + + int roleId = Env.getAD_Role_ID(ctx); + float discountAllowed = RoleManager.getDiscountAllowed(ctx, roleId, null).floatValue(); + boolean isAllowedOverridePriceLimit = RoleManager.isOverridePriceLimitAllowed(ctx, roleId, null); + + String orderType = String.valueOf(request.getSession().getAttribute(Constants.ORDER_TYPE)); + + return new ActionForward("/CreateAdvancedPOSOrderScreen.do?discountAllowed="+discountAllowed+ + "&isAllowedOverridePriceLimit="+isAllowedOverridePriceLimit+"&orderType="+orderType+"&priceListId="+ priceListId); + } + + public ActionForward saveBPartnerInfo(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception + { + ActionForward fwd= init(mapping,form,request,response); + if (fwd!=null) + { + return fwd; + } + + Properties ctx=TmkJSPEnv.getCtx(request); + String bp = String.valueOf(request.getParameter("bPartnerId")); + String plId = String.valueOf(request.getParameter("priceListId")); + try + { + Integer bPartnerId = Integer.valueOf(bp); + String name = String.valueOf(request.getParameter("name")); + String creditLimit = String.valueOf(request.getParameter("creditLimit")); + Integer priceListId = Integer.valueOf(plId); + + request.getSession().setAttribute(Constants.ORDER_PRICE_LIST, priceListId); + request.getSession().setAttribute(Constants.BPARTNER_ID, bPartnerId); + request.getSession().setAttribute(Constants.BPARTNER_NAME, name); + request.getSession().setAttribute(Constants.BPARTNER_CREDIT, creditLimit); + } + catch (NumberFormatException e) + { + } + + return null; + } + + public static ShoppingCartBean ComputeTotalLinePriceForDiscount(HttpServletRequest request, ShoppingCartBean cartBean) throws Exception + { + CheckoutBean checkoutBean = (CheckoutBean) request.getSession().getAttribute(Constants.CHECKOUT_BEAN); + + if(checkoutBean == null) + { + return cartBean; + } + + BigDecimal[] totalLinePrices = checkoutBean.getDiscountedPrice(); + BigDecimal[] qtyPerLine = checkoutBean.getQtyPerLine(); + + ArrayList itemList = cartBean.getItems(); + Iterator itr = itemList.iterator(); + + for(int i=0; i< totalLinePrices.length; i++) + { + ItemBean itemBean = cartBean.getItems().get(i); + BigDecimal totalLinePrice = itemBean.getPrice(); + + + //When increasing or decreasing quantity after giving discount on percentage, give the same percentage + //discount on this new totalLine + if (itemBean.getIsDiscountOnPercentage()) + { + if (itemBean.getDiscountPercent().doubleValue() > 0) + { + totalLinePrice = totalLinePrice.multiply(((Env.ONEHUNDRED.subtract(itemBean.getDiscountPercent()))).divide(Env.ONEHUNDRED)); + totalLinePrice = totalLinePrice.setScale(2, RoundingMode.HALF_UP); + + } + } + + //When increasing or decreasing quantity, if discount was given on total line, retain the same + //total value if quantity of this item is not changed + else if (itemBean.getIsDiscountOnTotal() && (qtyPerLine[i].compareTo(itemBean.getQty()) == 0)) + { + totalLinePrice = totalLinePrices[i]; + } + else if (!itemBean.getIsDiscountOnInclUnitPrice()) + { + itemBean.setDiscountPercent(Env.ZERO); + } + + itemBean.setPrice(totalLinePrice); + + } + + cartBean.setItems(itemList); + return cartBean; + } + +} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/POSPriceListAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/POSPriceListAction.java new file mode 100644 index 0000000000..88d511584f --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/pos/POSPriceListAction.java @@ -0,0 +1,152 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Aug 19, 2005 by praveen + * + */ +package org.posterita.struts.pos; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Properties; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.compiere.util.Env; +import org.compiere.util.Trx; + +import org.posterita.Constants; +import org.posterita.beans.EditPriceBean; +import org.posterita.beans.PriceListBean; +import org.posterita.beans.ProductPriceBean; +import org.posterita.businesslogic.ProductCart; +import org.posterita.businesslogic.administration.PriceListManager; +import org.posterita.core.TmkJSPEnv; +import org.posterita.core.TrxPrefix; +import org.posterita.exceptions.ApplicationException; +import org.posterita.exceptions.OperationException; +import org.posterita.exceptions.SystemException; +import org.posterita.form.PriceListForm; +import org.posterita.lib.UdiConstants; +import org.posterita.struts.core.BaseDispatchAction; +import org.posterita.struts.core.DefaultForm; + +public class POSPriceListAction extends BaseDispatchAction +{ + public static final String INIT_PRICE_LIST = "initPriceList"; + public ActionForward initPriceList(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws Exception + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + DefaultForm df = (DefaultForm) form; + + String searchText = df.getSearchText(); + + int priceListId = Env.getContextAsInt(ctx, UdiConstants.PRICELIST_CTX_PARAM); + int priceListVersionId = PriceListManager.getPriceListVersionID(ctx, priceListId, null); + + ArrayList productPriceList = PriceListManager.getProductPriceList(ctx, priceListVersionId, searchText, null, null); + + request.getSession().setAttribute(Constants.POS_SALES_PRICE_LIST, productPriceList); + request.getSession().setAttribute(Constants.PRICE_LIST, productPriceList); + return mapping.findForward(INIT_PRICE_LIST); + } + + public static final String INIT_EDIT_PRICE_LIST = "initEditPriceList"; + public ActionForward initEditPriceList(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws OperationException, ApplicationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + PriceListForm df = (PriceListForm) form; + + df.validate(mapping,request); + + PriceListBean bean = (PriceListBean) df.getBean(); + + if(bean.getProductIds() == null || bean.getProductIds().length == 0) + { + postGlobalError("error.product.not.selected", request); + return mapping.getInputForward(); + } + + request.getSession().setAttribute(Constants.PRODUCT_IDS, bean.getProductIds()); + + + return mapping.findForward(INIT_EDIT_PRICE_LIST); + } + + public static final String EDIT_PRICELIST = "editPriceList"; + public ActionForward editPriceList(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws OperationException, ApplicationException, SystemException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + DefaultForm df = (DefaultForm) form; + + EditPriceBean bean = (EditPriceBean) df.getBean(); + + BigDecimal priceEntered = bean.getPrice(); + + ProductCart cart = (ProductCart) request.getSession().getAttribute(Constants.PRODUCT_CART); + Integer productIds[] = cart.getProductIDs(); + + + int priceListId = Env.getContextAsInt(ctx, UdiConstants.PRICELIST_CTX_PARAM); + int priceListVersionId = PriceListManager.getPriceListVersionID(ctx, priceListId, null); + + Trx trx = Trx.get(TrxPrefix.getPrefix(), true); + + + try + { + trx.start(); + PriceListManager.editProductPrices(ctx,productIds, priceListVersionId, priceEntered, trx.getTrxName()); + trx.commit(); + } + catch (OperationException e) + { + trx.rollback(); + throw e; + } + catch (SystemException e) + { + trx.rollback(); + throw e; + } + finally + { + trx.close(); + } + + return mapping.findForward(EDIT_PRICELIST); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/POSProductAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/POSProductAction.java new file mode 100644 index 0000000000..67c7cd09df --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/pos/POSProductAction.java @@ -0,0 +1,1035 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on May 22, 2006 + */ + + +package org.posterita.struts.pos; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.PrintWriter; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.Properties; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.compiere.model.MLocator; +import org.compiere.model.MProduct; +import org.compiere.model.MProductPrice; +import org.compiere.model.MStorage; +import org.compiere.util.Env; +import org.compiere.util.KeyNamePair; +import org.compiere.util.Trx; +import org.posterita.Constants; +import org.posterita.beans.ProductBean; +import org.posterita.beans.ProductDetailsBean; +import org.posterita.beans.ProductSalesInfoBean; +import org.posterita.beans.ProductSalesSummaryBean; +import org.posterita.businesslogic.POSGoodsManager; +import org.posterita.businesslogic.POSProductManager; +import org.posterita.businesslogic.ProductCart; +import org.posterita.businesslogic.administration.PriceListManager; +import org.posterita.businesslogic.administration.ProductManager; +import org.posterita.businesslogic.administration.WarehouseManager; +import org.posterita.businesslogic.performanceanalysis.CSVReportManager; +import org.posterita.businesslogic.performanceanalysis.ReportManager; +import org.posterita.core.RandomStringGenerator; +import org.posterita.core.TmkJSPEnv; +import org.posterita.core.TrxPrefix; +import org.posterita.exceptions.ApplicationException; +import org.posterita.exceptions.BarcodeAlreadyExistsException; +import org.posterita.exceptions.CannotInactivateProductException; +import org.posterita.exceptions.InvalidBarcodeException; +import org.posterita.exceptions.OperationException; +import org.posterita.exceptions.ProductAlreadyExistException; +import org.posterita.exceptions.ProductNotFoundException; +import org.posterita.form.POSProductForm; +import org.posterita.lib.UdiConstants; +import org.posterita.struts.core.DefaultForm; + + + +public class POSProductAction extends POSDispatchAction +{ + public static final String CREATE_OR_UPDATE_PRODUCT = "createOrUpdateProduct"; + public ActionForward createOrUpdateProduct(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd=init(mapping,form,request,response); + if (fwd!=null) + { + return fwd; + } + + Properties ctx=TmkJSPEnv.getCtx(request); + POSProductForm pf = (POSProductForm)form; + ProductBean bean = (ProductBean)pf.getBean(); + ProductBean productBean = new ProductBean(); + + Trx trx = Trx.get(TrxPrefix.getPrefix(),true); + + try + { + trx.start(); + POSProductManager.createOrUpdateProduct(ctx,bean,trx.getTrxName()); + productBean = POSProductManager.viewPOSProduct(ctx, bean.getProductId(), trx.getTrxName()); + + postGlobalMessage("message.product.saved", request); + trx.commit(); + } + catch(ProductAlreadyExistException e1) + { + postGlobalError("error.product.already.exists",request); + trx.rollback(); + return mapping.getInputForward(); + } + catch(BarcodeAlreadyExistsException e2) + { + postGlobalError("error.barcode.already.exists",request); + trx.rollback(); + return mapping.getInputForward(); + } + catch(NumberFormatException e3) + { + postGlobalError("error.numberformatexception.price",request); + trx.rollback(); + trx.close(); + return mapping.getInputForward(); + } + catch(OperationException e) + { + postGlobalError("error.process", e.getMessage(), request); + trx.rollback(); + trx.close(); + return mapping.getInputForward(); + } + finally + { + trx.close(); + } + ArrayList list = (ArrayList) request.getSession().getAttribute(Constants.VIEW_POS_PRODUCTS); + if (list == null) + { + list = new ArrayList(); + } + list.add(productBean); + ArrayList productPriceLists = PriceListManager.getProductPriceLists(ctx, bean.getProductId(), bean.getOrgId(), null); + request.getSession().setAttribute(Constants.PRODUCT_PRICE_LISTS, productPriceLists); + + pf.populate(productBean); + return mapping.findForward(CREATE_OR_UPDATE_PRODUCT); + } + + public static final String VIEW_PRODUCT = "viewProduct"; + public ActionForward viewProduct(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd=init(mapping,form,request,response); + if (fwd!=null) + { + return fwd; + } + Properties ctx=TmkJSPEnv.getCtx(request); + POSProductForm pf = (POSProductForm)form; + Integer productId = Integer.valueOf(request.getParameter("productId")); + String next =request.getParameter("isNext"); + + Boolean isNext= null; + if ("true".equals(next)) + { + isNext = true; + } + else if ("false".equals(next)) + { + isNext = false; + } + + ArrayList list = (ArrayList) request.getSession().getAttribute(Constants.VIEW_POS_PRODUCTS); + ProductBean bean = null; + + bean = POSProductManager.getProductBean(ctx, list, productId, isNext); + pf.populate(bean); + + ArrayList productPriceLists = PriceListManager.getProductPriceLists(ctx, productId, bean.getOrgId(), null); + ArrayList uomList = POSProductManager.getUoms(ctx, null); + ArrayList taxList = POSGoodsManager.getAllTaxCategory(ctx); + + request.getSession().setAttribute(Constants.UOM_LIST, uomList); + request.getSession().setAttribute(Constants.EXISTING_BAR_CODE,bean.getBarCode()); + request.getSession().setAttribute(Constants.TAX_CATEGORY_ID,taxList); + request.getSession().setAttribute(Constants.PRODUCT_PRICE_LISTS, productPriceLists); + + return mapping.findForward(VIEW_PRODUCT); + } + + + /*public static final String UPDATE_PRODUCT_DETAILS="updateProductDetails"; + public ActionForward updateProductDetails(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd=init(mapping,form,request,response); + if(fwd!=null) + return fwd; + Properties ctx=TmkJSPEnv.getCtx(request); + DefaultForm df = (DefaultForm)form; + ProductBean bean = (ProductBean)df.getBean(); + bean.setFile(df.getFile()); + String existingBarCode = (String)request.getSession().getAttribute(Constants.EXISTING_BAR_CODE); + + Trx trx = Trx.get(TrxPrefix.getPrefix(),true); + + try + { + trx.start(); + POSProductManager.editProduct(ctx,bean,existingBarCode,trx.getTrxName()); + trx.commit(); + } + catch(BarcodeAlreadyExistsException e1) + { + + trx.rollback(); + postGlobalError("error.barcode.already.exists",request); + return mapping.getInputForward(); + } + catch(CannotInactivateProductException e2) + { + trx.rollback(); + postGlobalError("error.product.cannot.inactivate", e2.getMessage(), request); + return mapping.getInputForward(); + + } + catch(InvalidContentTypeException e3) + { + trx.rollback(); + postGlobalError("error.invalid.content", e3.getMessage(), request); + return mapping.getInputForward(); + } + finally + { + trx.close(); + } + ProductBean productBean= POSProductManager.viewPOSProduct(ctx,bean.getProductId().intValue(), null); + + ArrayList list = new ArrayList(); + list.add(productBean); + + refreshProductList(request, list); + + request.getSession().setAttribute(Constants.PRODUCT_DETAILS,productBean); + return mapping.findForward(UPDATE_PRODUCT_DETAILS); + }*/ + + public static final String VIEW_ALL_POS_PRODUCTS="viewAllPOSProducts"; + public static final String LIST_PRICE_LISTS = "listPriceLists"; + public ActionForward viewAllPOSProducts(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd=init(mapping,form,request,response); + if(fwd!=null) + return fwd; + Properties ctx=TmkJSPEnv.getCtx(request); + DefaultForm df = (DefaultForm)form; + ProductBean bean = (ProductBean) df.getBean(); + ArrayList list=null; + + String fromDeletePriceOnPriceList = request.getParameter("isFromDeletePriceOnPriceList"); + Integer priceListId; + Integer priceListVersionId; + + //Check if user just clicked on the delete price on priceList submenu + if(fromDeletePriceOnPriceList != null && fromDeletePriceOnPriceList.equals("true")) + { + priceListId = Integer.valueOf(request.getParameter("priceListId")); + priceListVersionId = PriceListManager.getPriceListVersionID(ctx, priceListId, null); + + list = new ArrayList(); + + list = POSProductManager.getProductBeans(ctx, priceListVersionId, null); + + if(list.isEmpty()) + { + postGlobalError("error.no.product.found.on.pricelist", request); + request.setAttribute(Constants.IS_FROM_DELETE_PRODUCT_PRICE, "true"); + return mapping.findForward(LIST_PRICE_LISTS); + } + else + { + request.getSession().setAttribute(Constants.PRICE_LIST_VERSION_ID, priceListVersionId); + request.setAttribute(Constants.IS_FROM_DELETE_PRODUCT_PRICE, "true"); + } + } + else + { + try + { + list=new ArrayList(); + list=POSProductManager.viewAllProducts(ctx,bean.getProductName(),bean.getBarCode(), bean.getDescription()); + + } + catch(ProductNotFoundException e1) + { + postGlobalError("error.product.not.defined.client",request); + return mapping.getInputForward(); + + } + } + + //for export + ArrayList exportProductData = null; + try + { + exportProductData = POSProductManager.getExportData(ctx, list); + } + catch (IOException e) + { + postGlobalError("error.process",request); + return mapping.getInputForward(); + } + String csvReport = CSVReportManager.generateCSVReport(ctx,exportProductData); + String csvURI = ReportManager.getReportURI(csvReport,request); + + request.getSession().setAttribute(Constants.CSV_FILE,csvURI); + request.getSession().setAttribute(Constants.VIEW_POS_PRODUCTS,list); + return mapping.findForward(VIEW_ALL_POS_PRODUCTS); + } + + + public static final String VIEW_POS_PRODUCT_DETAIL="viewPOSProductDetails"; + public static final String ERROR_VIEW_PRODUCT_DETAIL = "errorViewProductDetails"; + + public ActionForward viewPOSProductDetailInfo(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd=init(mapping,form,request,response); + if(fwd!=null) + return fwd; + Properties ctx=TmkJSPEnv.getCtx(request); + DefaultForm df = (DefaultForm)form; + ProductDetailsBean bean = (ProductDetailsBean) df.getBean(); + + try + { + int productId = bean.getProductId().intValue(); + ProductDetailsBean prodDetailsBean = ProductManager.getProductDetailInfo(ctx, productId, null); + + request.setAttribute(Constants.PRODUCT_DETAIL_INFO, prodDetailsBean); + + return mapping.findForward(VIEW_POS_PRODUCT_DETAIL); + } + catch(Exception ex) + { + return mapping.findForward(ERROR_VIEW_PRODUCT_DETAIL); + } + } + + public ActionForward validateProductName(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException, IOException + { + DefaultForm df = (DefaultForm) form; + String productName = df.getProductName(); + Properties ctx=TmkJSPEnv.getCtx(request); + + boolean isNameInvalid = (ProductManager.getSimilarProduct(ctx, productName, null) != 0); + + response.setContentType("text/plain"); + PrintWriter out = response.getWriter(); + out.print(isNameInvalid); + out.flush(); + out.close(); + + return null; + } + + public ActionForward validateProductBarcode(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException, IOException + { + DefaultForm df = (DefaultForm) form; + String barcode = df.getBarCode(); + Properties ctx=TmkJSPEnv.getCtx(request); + + boolean isBarcodeValid = ProductManager.isBarCodePresent(ctx, barcode, null); + + response.setContentType("text/plain"); + PrintWriter out = response.getWriter(); + out.print(isBarcodeValid); + out.flush(); + out.close(); + + return null; + } + + public static final String SEARCH_POS_PRODUCTS = "searchPOSProducts" ; + + public ActionForward searchPOSProducts (ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException, IOException + { + viewAllPOSProducts(mapping, form, request, response); + + return mapping.findForward(SEARCH_POS_PRODUCTS); + } + + + public ActionForward addAllProducts (ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException, IOException + { + Properties ctx=TmkJSPEnv.getCtx(request); + HttpSession session = request.getSession(); + + ProductCart cart = (ProductCart) session.getAttribute(Constants.PRODUCT_CART); + ArrayList productList = (ArrayList) session.getAttribute(Constants.VIEW_POS_PRODUCTS); + + if(productList == null) + { + return mapping.findForward(VIEW_ALL_POS_PRODUCTS); + } + + if(cart == null) + { + cart = new ProductCart(ctx); + } + + for(ProductBean bean:productList) + { + Integer productId = bean.getProductId(); + + if(productId == null) continue; + if(cart.hasProduct(productId.intValue())) continue; + + cart.addProduct(productId.intValue()); + } + + session.setAttribute(Constants.PRODUCT_CART,cart); + + return mapping.findForward(VIEW_ALL_POS_PRODUCTS); + + } + + public ActionForward addToCart (ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException, IOException + { + Properties ctx=TmkJSPEnv.getCtx(request); + DefaultForm df = (DefaultForm)form; + ProductBean bean = (ProductBean) df.getBean(); + + Integer productId = bean.getProductId(); + HttpSession session = request.getSession(); + + ProductCart cart = (ProductCart) session.getAttribute(Constants.PRODUCT_CART); + + if( cart == null ) + { + cart = new ProductCart( ctx ); + } + + cart.addProduct( productId.intValue() ); + session.setAttribute(Constants.PRODUCT_CART, cart); + + String script = "productAdded("+ productId +");setCartCounter("+ cart.getNoOfProducts() +")"; + + PrintWriter writer = response.getWriter(); + writer.print( script ); + writer.flush(); + writer.close(); + + return null; + } + + public ActionForward removeFromCart (ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException, IOException + { + Properties ctx=TmkJSPEnv.getCtx(request); + DefaultForm df = (DefaultForm)form; + ProductBean bean = (ProductBean) df.getBean(); + + Integer productId = bean.getProductId(); + HttpSession session = request.getSession(); + + ProductCart cart = (ProductCart) session.getAttribute(Constants.PRODUCT_CART); + + if( cart == null ) + { + cart = new ProductCart( ctx ); + } + + cart.removeProduct( productId.intValue() ); + session.setAttribute(Constants.PRODUCT_CART, cart); + + String script = "productRemoved("+ productId +");setCartCounter("+ cart.getNoOfProducts() +")"; + + PrintWriter writer = response.getWriter(); + writer.print( script ); + writer.flush(); + writer.close(); + + return null; + } + + public ActionForward clearCart (ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException, IOException + { + HttpSession session = request.getSession(); + session.removeAttribute(Constants.PRODUCT_CART); + request.getSession().removeAttribute(Constants.VIEW_POS_PRODUCTS); + + String script = "clearAll();"; + PrintWriter writer = response.getWriter(); + writer.print( script ); + writer.flush(); + writer.close(); + + return null; + } + + public static final String VIEW_CART = "viewCart"; + public ActionForward viewCart(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd=init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + HttpSession session = request.getSession(); + ProductCart cart = (ProductCart) session.getAttribute(Constants.PRODUCT_CART); + + ArrayList productList = null; + + if(cart != null) + { + productList = cart.getProducts(); + session.setAttribute(Constants.PRODUCT_DETAILS, productList); + } + + return mapping.findForward(VIEW_CART); + } + + public static final String REMOVE = "remove"; + public ActionForward remove(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd=init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + HttpSession session = request.getSession(); + ProductCart cart = (ProductCart) session.getAttribute(Constants.PRODUCT_CART); + + DefaultForm df = (DefaultForm) form; + ProductBean bean = (ProductBean) df.getBean(); + Integer productId = bean.getProductId(); + + if(cart != null) + { + cart.removeProduct( productId.intValue() ); + session.setAttribute(Constants.PRODUCT_CART, cart); + } + + return mapping.findForward(REMOVE); + } + + //---------------------------------------------------------------------------------------------------------------------------------------------------- + + public static final String EXPORT_CSV = "exportCSV"; + public ActionForward exportCSV(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException, IOException + { + ActionForward fwd=init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx=TmkJSPEnv.getCtx(request); + HttpSession session = request.getSession(); + ProductCart cart = (ProductCart) session.getAttribute(Constants.PRODUCT_CART); + + if(cart == null) + { + String msg = "Cannot print barcode. Reason: cart is empty!"; + throw new OperationException( msg ); + } + + String reportName = POSProductManager.getProductCartAsCSV( ctx, cart ); + String reportURI = ReportManager.getReportURI( reportName, request ); + response.sendRedirect(reportURI); + + //return mapping.findForward(EXPORT_CSV); + return null; + } + + + public static final String PRINT_BARCODE = "printBarcode"; + public ActionForward printBarcode(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException, IOException + { + ActionForward fwd=init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + HttpSession session = request.getSession(); + ProductCart cart = (ProductCart) session.getAttribute(Constants.PRODUCT_CART); + + if(cart == null) + { + String msg = "Cannot print barcode. Reason: cart is empty!"; + throw new OperationException( msg ); + } + + String printData = POSProductManager.getPrintBarcodeData( ctx, cart, null ); + //send it to client + + String filename = RandomStringGenerator.randomstring() + ".txt"; + String filepath = ReportManager.getReportPath( filename ); + + FileOutputStream fos = new FileOutputStream( new File( filepath ) ); + fos.write( printData.getBytes() ); + fos.flush(); + fos.close(); + + String fileURL = ReportManager.getReportURI( filename, request ); + response.sendRedirect( fileURL ); + + return null; + } + +// public static final String GENERATE_PROD_PDF ="generateproductpdf"; +// public ActionForward generateproductpdf(ActionMapping mapping, ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException +// { +// ActionForward fwd = init(mapping,form,request,response); +// if (fwd!=null) +// return fwd; +// +// Properties ctx = TmkJSPEnv.getCtx(request); +// +// String reportName=POSProductManager.productcatalogue(ctx); +// +// ReportManager.writeReport(reportName, response); +// +// +// return null; +// } +// + + public static final String VIEW_PRODUCT_SALES_DETAILS = "viewProductSalesDetails"; + public ActionForward viewProductSalesDetails(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException, IOException + { + ActionForward fwd=init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + HttpSession session = request.getSession(); + + DefaultForm df = (DefaultForm) form; + ProductBean bean = (ProductBean) df.getBean(); + Integer productId = bean.getProductId(); + + ProductSalesSummaryBean summaryBean = POSProductManager.getProductSalesInfoSummary( ctx, productId.intValue(), null ); + ArrayList salesDetails = POSProductManager.getProductSalesInfoDetails( ctx, productId.intValue(), null ); + + ProductSalesSummaryBean[] bucket = POSProductManager.getSalesBucket(ctx, productId.intValue(), null); + + + session.setAttribute( Constants.PRODUCT_SALES_SUMMARY, summaryBean ); + session.setAttribute( Constants.PRODUCT_SALES_DETAILS, salesDetails ); + session.setAttribute( Constants.PRODUCT_SALES_BUCKET, bucket ); + + return mapping.findForward( VIEW_PRODUCT_SALES_DETAILS ); + } + + + public static final String UPDATE_BULK_PRODUCT_DETAILS="updateBulkProductDetails"; + public ActionForward updateBulkProductDetails(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd=init(mapping,form,request,response); + if(fwd!=null) + return fwd; + Properties ctx=TmkJSPEnv.getCtx(request); + DefaultForm df = (DefaultForm)form; + df.validate(mapping,request); + + ProductBean bean = (ProductBean)df.getBean(); + bean.setFile(df.getFile()); + + ProductCart cart = (ProductCart) request.getSession().getAttribute(Constants.PRODUCT_CART); + + Trx trx = Trx.get(TrxPrefix.getPrefix(),true); + Integer[] productIds = cart.getProductIDs(); + + try + { + trx.start(); + POSProductManager.editBulkProduct(ctx,productIds,bean,trx.getTrxName()); + trx.commit(); + } + catch(BarcodeAlreadyExistsException e1) + { + + trx.rollback(); + postGlobalError("error.barcode.already.exists",request); + return mapping.getInputForward(); + } + catch(CannotInactivateProductException e2) + { + trx.rollback(); + postGlobalError("error.product.cannot.inactivate", e2.getMessage(), request); + return mapping.getInputForward(); + + } + finally + { + trx.close(); + } + + + ArrayList list = new ArrayList(); + + for(int product_id : productIds) + { + ProductBean productBean = POSProductManager.viewPOSProduct(ctx, product_id, null); + list.add(productBean); + } + refreshProductList(request, list); + + return mapping.findForward(UPDATE_BULK_PRODUCT_DETAILS); + } + + + public static final String INIT_UPDATE_BULK_PRODUCT_DETAILS = "initUpdateBulkProductDetails"; + public ActionForward initUpdateBulkProductDetails(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws OperationException + { + Properties ctx=TmkJSPEnv.getCtx(request); + ArrayList taxList = POSGoodsManager.getAllTaxCategory(ctx); + + request.setAttribute(Constants.TAX_CATEGORY_ID,taxList); + return mapping.findForward(INIT_UPDATE_BULK_PRODUCT_DETAILS); + } + + /*public static final String VIEW_PRODUCT = "viewProduct"; + public ActionForward viewProduct(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws OperationException, ApplicationException + { + viewProductForUpdate(mapping,form,request,response); + + return mapping.findForward(VIEW_PRODUCT); + }*/ + + public static final String ACTIVATE_PRODUCT = "activateProduct"; + public ActionForward activateProduct(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws OperationException, ApplicationException + { + ActionForward fwd=init(mapping,form,request,response); + if(fwd!=null) + return fwd; + Properties ctx=TmkJSPEnv.getCtx(request); + DefaultForm df = (DefaultForm)form; + df.validate(mapping,request); + + ProductBean bean = (ProductBean)df.getBean(); + Integer productId = bean.getProductId(); + + ProductManager.activateProducts(ctx, new Integer[]{productId},null); + + ProductBean productBean= POSProductManager.viewPOSProduct(ctx,bean.getProductId().intValue(), null); + ArrayList list = new ArrayList(); + list.add(productBean); + + // Refresh product list + refreshProductList(request, list); + + return mapping.findForward(ACTIVATE_PRODUCT); + } + + public static final String DEACTIVATE_PRODUCT = "deactivateProduct"; + public ActionForward deactivateProduct(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws OperationException, ApplicationException + { + ActionForward fwd=init(mapping,form,request,response); + if(fwd!=null) + return fwd; + Properties ctx=TmkJSPEnv.getCtx(request); + DefaultForm df = (DefaultForm)form; + df.validate(mapping,request); + + ProductBean bean = (ProductBean)df.getBean(); + Integer productId = bean.getProductId(); + + try + { + ProductManager.inactivateProducts(ctx, new Integer[]{productId},null); + } + catch(CannotInactivateProductException e2) + { + postGlobalError("error.product.cannot.inactivate", e2.getMessage(), request); + return mapping.getInputForward(); + } + + ProductBean productBean= POSProductManager.viewPOSProduct(ctx,bean.getProductId().intValue(), null); + ArrayList list = new ArrayList(); + list.add(productBean); + + // Refresh product list + refreshProductList(request, list); + + return mapping.findForward(DEACTIVATE_PRODUCT); + } + + public static final String PRICE_CHECK = "priceCheck"; + public ActionForward priceCheck(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws OperationException, ApplicationException + { + ActionForward fwd=init(mapping,form,request,response); + + if(fwd!=null) + { + return fwd; + } + + Properties ctx=TmkJSPEnv.getCtx(request); + DefaultForm df = (DefaultForm)form; + String barcode = df.getBarCode(); + + ProductBean productBean = null; + try + { + productBean = POSProductManager.getProduct(ctx, barcode, null); + request.setAttribute(Constants.PRODUCT_DETAILS, productBean); + } + catch (InvalidBarcodeException e) + { + postGlobalError("error.invalid.barcode", "barcode", request); + return mapping.getInputForward(); + } + catch (ProductNotFoundException e) + { + postGlobalError("error.notfound", "Product", request); + return mapping.getInputForward(); + } + + return mapping.findForward(PRICE_CHECK); + } + + + /** + * This method is called to update product list present in session + * @param request + * @param list + */ + private void refreshProductList(HttpServletRequest request, ArrayList productList) + { + ArrayList list = (ArrayList) request.getSession().getAttribute(Constants.VIEW_POS_PRODUCTS); + if(list == null) + { + return; + } + + if(!list.isEmpty()) + { + for(ProductBean bean : productList) + { + int index = list.indexOf(bean); + if(index != -1) + { + list.set(index, bean); + } + } + + request.getSession().setAttribute(Constants.VIEW_POS_PRODUCTS, list); + } + + } + + + public static final String GET_PRODUCT_DETAILS = "getProductDetails"; + public ActionForward getProductDetails(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws OperationException, ApplicationException, IOException + { + ActionForward fwd=init(mapping,form,request,response); + + if(fwd!=null) + { + return fwd; + } + + Properties ctx=TmkJSPEnv.getCtx(request); + + String productIdAsStr = request.getParameter("productId"); + String priceListIdAsStr = request.getParameter("priceListId"); + int productId = Integer.parseInt(productIdAsStr); + int priceListId = Integer.parseInt(priceListIdAsStr); + + Env.setContext(ctx, UdiConstants.PRICELIST_CTX_PARAM, priceListId); + String currSymbol = PriceListManager.getCurrency(ctx, priceListId); + + ProductBean details = POSProductManager.viewPOSProduct(ctx, productId, priceListId, null); + + StringBuffer sb = new StringBuffer(); + sb.append("{"); + sb.append("name: \"" + details.getProductName() + "\""); + sb.append(", id: \"" + details.getProductId() + "\""); + sb.append(", description: \"" + details.getDescription() + "\""); + sb.append(", barcode: '" + details.getBarCode() + "'"); + sb.append(", taxCategory: '" + details.getTaxCategoryName() + "'"); + sb.append(", productCategory: '" + details.getProductCategoryName() + "'"); + sb.append(", priceStd: '" + details.getPriceStandard() + "'"); + sb.append(", priceList: '" + details.getPriceList() + "'"); + sb.append(", priceLimit: '" + details.getPriceLimit() + "'"); + sb.append(", priceListID: '" + details.getPriceListId() + "'"); + sb.append(", taxRate: '" + details.getTaxRate() + "'"); + sb.append(", isTaxIncluded: '" + details.getIsTaxIncluded() + "'"); + sb.append(", currSymbol: '" + currSymbol + "'"); + sb.append(", stockQty: '" + details.getQtyOnHand() + "'"); + sb.append(", unitsPerPack: '" + details.getUnitsPerPack() + "'"); + sb.append("}"); + + PrintWriter writer = response.getWriter(); + writer.print( sb.toString() ); + writer.flush(); + writer.close(); + + return null; + } + + public static final String GET_PRODUCT_DETAILS_FOR_INVENTORY = "getProductDetailsForInventory"; + public ActionForward getProductDetailsForInventory(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws OperationException, ApplicationException, IOException + { + ActionForward fwd=init(mapping,form,request,response); + + if(fwd!=null) + { + return fwd; + } + + Properties ctx=TmkJSPEnv.getCtx(request); + + String productIdAsStr = request.getParameter("productId"); + String priceListIdAsStr = request.getParameter("priceListId"); + int productId = Integer.parseInt(productIdAsStr); + int priceListId = Integer.parseInt(priceListIdAsStr); + + Env.setContext(ctx, UdiConstants.PRICELIST_CTX_PARAM, priceListId); + String currSymbol = PriceListManager.getCurrency(ctx, priceListId); + + ProductBean details = POSProductManager.viewPOSProductForInventory(ctx, productId, priceListId, null); + + StringBuffer sb = new StringBuffer(); + sb.append("{"); + sb.append("name: '" + details.getProductName() + "'"); + sb.append(", id: '" + details.getProductId() + "'"); + sb.append(", description: '" + details.getDescription() + "'"); + sb.append(", barcode: '" + details.getBarCode() + "'"); + sb.append(", taxCategory: '" + details.getTaxCategoryName() + "'"); + sb.append(", productCategory: '" + details.getProductCategoryName() + "'"); + sb.append(", priceStd: '" + details.getPriceStandard() + "'"); + sb.append(", priceList: '" + details.getPriceList() + "'"); + sb.append(", priceLimit: '" + details.getPriceLimit() + "'"); + sb.append(", priceListID: '" + details.getPriceListId() + "'"); + sb.append(", taxRate: '" + details.getTaxRate() + "'"); + sb.append(", currSymbol: '" + currSymbol + "'"); + sb.append(", stockQty: '" + details.getQtyOnHand() + "'"); + sb.append("}"); + + PrintWriter writer = response.getWriter(); + writer.print( sb.toString() ); + writer.flush(); + writer.close(); + + return null; + } + + public static final String POS_SUB_MENU_ITEMS = "POSSubMenuItems"; + public ActionForward deleteProductPricesOnPriceList(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws OperationException, ApplicationException + { + ActionForward fwd=init(mapping,form,request,response); + + if(fwd!=null) + { + return fwd; + } + + ArrayList list = new ArrayList(); + list = (ArrayList)request.getSession().getAttribute(Constants.VIEW_POS_PRODUCTS); + + Iterator itr = list.iterator(); + Integer productId; + Integer priceListVersionId = (Integer)request.getSession().getAttribute(Constants.PRICE_LIST_VERSION_ID); + Properties ctx = TmkJSPEnv.getCtx(request); + + while(itr.hasNext()) + { + ProductBean productBean = itr.next(); + if (productBean != null) + { + productId = productBean.getProductId(); + + if(productId != null && productId != 0 && priceListVersionId != null) + { + MProductPrice productPrice = MProductPrice.get(ctx, priceListVersionId, productId, null); + productPrice.delete(true); + } + } + } + + return mapping.findForward(POS_SUB_MENU_ITEMS); + } + + public static String GET_CREATE_PRODUCT_FORM = "getCreateProductForm"; + public ActionForward getCreateProductForm(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException + { + viewProduct(mapping, form, request, response); + + return mapping.findForward(GET_CREATE_PRODUCT_FORM); + } + + public static final String VIEW_PRODUCT_SALES_SUMMARY = "viewProductSalesSummary"; + public ActionForward viewProductSalesSummary(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException, IOException + { + ActionForward fwd=init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + HttpSession session = request.getSession(); + + String productIdStr = request.getParameter("productId"); + + if(productIdStr != null && !productIdStr.equals("")) + { + int productIdInt = Integer.parseInt(productIdStr); + StringBuffer sb = new StringBuffer(); + + ProductSalesSummaryBean[] summaryBeans = POSProductManager.getSalesBucket( ctx, productIdInt, null ); + + int warehouseId = WarehouseManager.getDefaultWarehouse(ctx).getM_Warehouse_ID(); + MLocator locator = MLocator.get(ctx, warehouseId, "", "0", "0", "0"); + BigDecimal qtyAvailable = MStorage.getQtyAvailable(warehouseId, locator.get_ID(), productIdInt, 0, null); + + MProduct product = new MProduct(ctx, productIdInt, null); + + sb.append("{"); + sb.append("name:'" + product.getName() + "'"); + sb.append(", id:'" + product.getM_Product_ID() + "'"); + sb.append(", qtyOnHand:'" + qtyAvailable + "'"); + + for(int i = 0; i < summaryBeans.length; i++) + { + if(i != 2 || i != 3) // skip sales figures for 2 and 3 months + { + sb.append(", qtySold" + i +":'" + summaryBeans[i].getQtySold() + "'"); + sb.append(", totalAmt" + i + ":'" + summaryBeans[i].getTotalAmount() + "'"); + } + } + + sb.append("}"); + + PrintWriter writer = response.getWriter(); + writer.print( sb.toString() ); + writer.flush(); + writer.close(); + + } + return null; + } +} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/POSReportAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/POSReportAction.java new file mode 100644 index 0000000000..0f1b1b465e --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/pos/POSReportAction.java @@ -0,0 +1,1602 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Created on May 9, 2006 + */ + + +package org.posterita.struts.pos; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileReader; +import java.io.IOException; +import java.io.PrintWriter; +import java.math.BigDecimal; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Timestamp; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Map; +import java.util.Properties; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import net.sf.jasperreports.engine.JasperExportManager; +import net.sf.jasperreports.engine.JasperPrint; + +import org.apache.ecs.XhtmlDocument; +import org.apache.ecs.xhtml.tr; +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.apache.struts.action.ActionMessage; +import org.apache.struts.action.ActionMessages; +import org.compiere.model.MProcess; +import org.compiere.model.MProcessPara; +import org.compiere.model.MProduct; +import org.compiere.print.MPrintFormat; +import org.compiere.print.PrintData; +import org.compiere.print.ReportEngine; +import org.compiere.process.ProcessInfo; +import org.compiere.report.ReportStarter; +import org.compiere.util.DB; +import org.compiere.util.Env; +import org.compiere.util.MimeType; +import org.compiere.utils.DBUtils; +import org.posterita.Constants; +import org.posterita.beans.POSHistoryBean; +import org.posterita.beans.ReportBean; +import org.posterita.beans.StockMovementBean; +import org.posterita.businesslogic.POSProductManager; +import org.posterita.businesslogic.POSStockManager; +import org.posterita.businesslogic.ProcessManager; +import org.posterita.businesslogic.administration.ProductManager; +import org.posterita.businesslogic.performanceanalysis.CSVReportManager; +import org.posterita.businesslogic.performanceanalysis.POSReportManager; +import org.posterita.businesslogic.performanceanalysis.POSSalesReportManager; +import org.posterita.businesslogic.performanceanalysis.ReportDateManager; +import org.posterita.businesslogic.performanceanalysis.ReportManager; +import org.posterita.businesslogic.stock.InventoryManager; +import org.posterita.businesslogic.stock.MMovementManager; +import org.posterita.core.TabularReport; +import org.posterita.core.TabularReport2; +import org.posterita.core.TabularReportMerge; +import org.posterita.core.TimestampConvertor; +import org.posterita.core.TmkJSPEnv; +import org.posterita.exceptions.ApplicationException; +import org.posterita.exceptions.OperationException; +import org.posterita.factory.WebComponentFactory; +import org.posterita.form.POSHistoryForm; +import org.posterita.form.ReportForm; +import org.posterita.form.SellingItemForm; +import org.posterita.form.StockEnquiryForm; +import org.posterita.lib.UdiConstants; +import org.posterita.order.UDIOrderTypes; +import org.posterita.struts.core.BaseDispatchAction; +import org.posterita.struts.core.DefaultForm; +import org.posterita.util.PathInfo; + +import com.lowagie.text.DocumentException; + + +public class POSReportAction extends BaseDispatchAction +{ + + public static final String GET_MIN_SOLD_ITEMS="getMinSoldItems"; + public static HashMap monthMap = new HashMap(); + + public ActionForward getMinSoldItems(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + DefaultForm df= (DefaultForm) form; + + ReportBean bean = (ReportBean) df.getBean(); + + Timestamp fromdate = ReportDateManager.getFromDate(bean); + Timestamp todate = ReportDateManager.getToDate(bean); + + ArrayList list=POSReportManager.getMaxMinSoldProducts(ctx,"asc",fromdate,todate); + request.getSession().setAttribute(Constants.MIN_SOLD_ITEMS,list); + + return mapping.findForward(GET_MIN_SOLD_ITEMS); + } + + + public static final String GET_MAX_SOLD_ITEMS="getMaxSoldItems"; + public ActionForward getMaxSoldItems(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + DefaultForm df= (DefaultForm) form; + + ReportBean bean = (ReportBean) df.getBean(); + + Timestamp fromdate = ReportDateManager.getFromDate(bean); + Timestamp todate = ReportDateManager.getToDate(bean); + + ArrayList list=POSReportManager.getMaxMinSoldProducts(ctx,"desc",fromdate,todate); + request.getSession().setAttribute(Constants.MAX_SOLD_ITEMS,list); + + return mapping.findForward(GET_MAX_SOLD_ITEMS); + } + + public static final String GET_STOCK_MOVEMENT="getStockMovement"; + public ActionForward getStockMovement(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + DefaultForm df= (DefaultForm) form; + + ReportBean bean = (ReportBean) df.getBean(); + + Timestamp fromdate = ReportDateManager.getFromDate(bean); + Timestamp todate = ReportDateManager.getToDate(bean); + + ArrayList list=POSReportManager.getStockMovementReport(ctx,fromdate,todate); + request.getSession().setAttribute(Constants.STOCK_MOVEMENT,list); + + return mapping.findForward(GET_STOCK_MOVEMENT); + } + + + public static final String INIT_POS_HISTORY="initPOSHistory"; + public ActionForward initPOSHistory(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + Properties ctx = TmkJSPEnv.getCtx(request); + ArrayList orderTypeList=POSReportManager.getAllOrderTypes(ctx); + ArrayList paymentRuleList=POSReportManager.getAllPaymentRule(ctx); + request.getSession().setAttribute(Constants.ORDER_TYPES,orderTypeList); + request.getSession().setAttribute(Constants.PAYMENT_RULES,paymentRuleList); + request.setAttribute(Constants.ALL_ORDER_HISTORY,"allOrderHistory"); + getPOSHistory(mapping,new POSHistoryForm(),request,response); + + return mapping.findForward(INIT_POS_HISTORY); + } + + + public static final String GET_POS_HISTORY="getPOSHistory"; + + public ActionForward getPOSHistory(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + Properties ctx = TmkJSPEnv.getCtx(request); + DefaultForm df= (DefaultForm) form; + POSHistoryBean bean = (POSHistoryBean) df.getBean(); + + if(bean.getHistoryType()==null) + { + String historyType = (String)request.getAttribute(Constants.ALL_ORDER_HISTORY); + bean.setHistoryType(historyType); + } + + if(bean.getHistoryType()==null || !bean.getHistoryType().equalsIgnoreCase(Constants.ALL_ORDER_HISTORY)) + { + if(bean.getOrderType()==null) + { + String orderType=(String)request.getSession().getAttribute(Constants.POS_HISTORY_ORDER_TYPE); + bean.setOrderType(orderType); + } + } + ArrayList list=POSReportManager.getOrderHistory(ctx,bean.getOrderType(),bean.getDocStatus(),bean.getMonth(),bean.getYear(),bean.getPaymentRule(),null); + request.setAttribute(Constants.POS_HISTORY,list); + if(bean.getOrderType()!=null) + { + request.getSession().setAttribute(Constants.POS_HISTORY_ORDER_TYPE,bean.getOrderType()); + } + else + { + String orderType=(String)request.getSession().getAttribute(Constants.POS_HISTORY_ORDER_TYPE); + request.getSession().setAttribute(Constants.POS_HISTORY_ORDER_TYPE,orderType); + } + + + return mapping.findForward(GET_POS_HISTORY); + } + + //----------------------------------------------------------------------------------------------------- + + public static final String GET_CUSTOM_REPORT = "getCustomReport"; + public static final String GET_CUSTOM_MOVING_ITEMS = "getCustomMovingItems"; + public ActionForward getCustomFastSlowMovingItems(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + DefaultForm df= (DefaultForm) form; + + ReportBean bean = (ReportBean) df.getBean(); + + String title = " Moving Items Report"; + String subtitle = "subtitle"; + + String reportType = bean.getReportType(); + if(reportType.equalsIgnoreCase("asc")) + { + title = "Slow" + title; + } + else if(reportType.equalsIgnoreCase("desc")) + { + title = "Fast" + title; + } + else + { + throw new OperationException("invalid report type: " + reportType); + } + + String dateRange = bean.getDateRange(); + String timePeriod = bean.getTimePeriod(); + + Timestamp fromDate = null; + Timestamp toDate = null; + + //setting from and to dates + if(dateRange.endsWith(Constants.FIXED_DATE_RANGE)) + { + if(timePeriod==null) + { + throw new OperationException("Invalid Parameter for timePeriod. timePeriod is null"); + } + + Date startDate = ReportDateManager.getStartDateForPeriod(timePeriod); + Date endDate = ReportDateManager.getEndDateForPeriod(timePeriod); + + fromDate = new Timestamp(startDate.getTime()); + toDate = new Timestamp(endDate.getTime()); + + subtitle = "For " + timePeriod; + } + else if(dateRange.endsWith(Constants.CUSTOM_DATE_RANGE)) + { + boolean error = false; + ActionMessages messages = new ActionMessages(); + ActionMessage message = null; + + + if((bean.getFromDate()==null)||(bean.getFromDate()=="")) + { + message = new ActionMessage("error.required.fromDate"); + messages.add(ActionMessages.GLOBAL_MESSAGE, message); + error = true; + } + + if((bean.getToDate()==null)||(bean.getToDate()=="")) + { + message = new ActionMessage("error.required.toDate"); + messages.add(ActionMessages.GLOBAL_MESSAGE, message); + error = true; + } + + if(error) + { + saveErrors(request, messages); + return mapping.getInputForward(); + } + else + { + fromDate = ReportDateManager.getFromDate(bean); + toDate = ReportDateManager.getToDate(bean); + + } + + + subtitle = "For period:"+fromDate+" to "+toDate; + } + else + { + throw new OperationException("Invalid Parameter for dateRange :" + dateRange); + } + + + ArrayList reportData = POSReportManager.getMaxMinSoldProductReportData(ctx,reportType,fromDate,toDate); + + //constructing the table + TabularReport tReport = new TabularReport(reportData); + tReport.setSortable(false); + tReport.setStyle("display"); + tReport.setTitle(title); + tReport.setSubtitle(subtitle); + tReport.createReport(); + + String csvReport = CSVReportManager.generateCSVReport(ctx,reportData); + String csvURI = ReportManager.getReportURI(csvReport,request); + + request.getSession().setAttribute(Constants.TABULAR_REPORT_DATA,tReport.toString()); + request.getSession().setAttribute(Constants.CSV_FILE,csvURI); + + return mapping.findForward(GET_CUSTOM_REPORT); + } + + //Partial POS History action + public static final String INIT_PARTIAL_POS_HISTORY="initPartialPOSHistory"; + public ActionForward initPartialPOSHistory(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + Properties ctx = TmkJSPEnv.getCtx(request); + ArrayList list=POSReportManager.getAllOrderTypes(ctx); + request.getSession().setAttribute(Constants.ORDER_TYPES,list); + + getPartialPOSHistory(mapping,new POSHistoryForm(),request,response); + + return mapping.findForward(INIT_PARTIAL_POS_HISTORY); + } + + + public static final String GET_PARTIAL_POS_HISTORY="getPartialPOSHistory"; + public ActionForward getPartialPOSHistory(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + DefaultForm df= (DefaultForm) form; + POSHistoryBean bean = (POSHistoryBean) df.getBean(); + + String orderType = UDIOrderTypes.POS_ORDER.getOrderType(); + + ArrayList list=POSReportManager.getPartialOrderHistory(ctx,orderType,bean.getMonth(),bean.getYear()); + request.getSession().setAttribute(Constants.POS_HISTORY,list); + + return mapping.findForward(GET_PARTIAL_POS_HISTORY); + } + + public static final String GET_SALES_REPORT = "getSalesReport"; + public ActionForward getSalesOrPurchaseReport(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws Exception + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + DefaultForm df= (DefaultForm) form; + + df.validate(mapping, request); + + ReportBean bean = (ReportBean) df.getBean(); + + String isSalesRPT = bean.getIsSalesReport(); + + boolean isSalesReport = Boolean.parseBoolean(isSalesRPT); + + String title = "Sales Report"; + + if(!(isSalesReport)) + { + title = "Purchase Report"; + } + + String subtitle = "subtitle"; + + + String dateRange = bean.getDateRange(); + String timePeriod = bean.getTimePeriod(); + + Timestamp fromDate = null; + Timestamp toDate = null; + + Date startDate = null; + Date endDate = null; + + //setting from and to dates + if(dateRange.endsWith(Constants.FIXED_DATE_RANGE)) + { + if(timePeriod==null) + { + throw new OperationException("Invalid Parameter for timePeriod. timePeriod is null"); + } + + startDate = ReportDateManager.getStartDateForPeriod(timePeriod); + endDate = ReportDateManager.getEndDateForPeriod(timePeriod); + + fromDate = new Timestamp(startDate.getTime()); + toDate = new Timestamp(endDate.getTime()); + + subtitle = "For " + timePeriod + ": " + startDate; + } + else if(dateRange.endsWith(Constants.CUSTOM_DATE_RANGE)) + { + boolean error = false; + ActionMessages messages = new ActionMessages(); + ActionMessage message = null; + + + if((bean.getFromDate()==null)||(bean.getFromDate()=="")) + { + message = new ActionMessage("error.required.fromDate"); + messages.add(ActionMessages.GLOBAL_MESSAGE, message); + error = true; + } + + if((bean.getToDate()==null)||(bean.getToDate()=="")) + { + message = new ActionMessage("error.required.toDate"); + messages.add(ActionMessages.GLOBAL_MESSAGE, message); + error = true; + } + + if(error) + { + saveErrors(request, messages); + return mapping.getInputForward(); + } + else + { + fromDate = ReportDateManager.getFromDate(bean); + toDate = ReportDateManager.getToDate(bean); + + } + + + subtitle = "For period:"+fromDate+" to "+toDate; + } + else + { + throw new OperationException("Invalid Parameter for dateRange :" + dateRange); + } + boolean isFullDetails = false; + + if (Constants.FULL_DETAILS.equals(bean.getFullDetails())) + { + isFullDetails = true; + } + + ArrayList reportData = POSSalesReportManager.getSalesOrPurchaseReportData(ctx, bean, null); + + //constructing the table + TabularReport2 tReport = new TabularReport2(reportData); + tReport.setSortable(false); + tReport.setStyle("display"); + tReport.setTitle(title); + tReport.setSubtitle(subtitle); + tReport.setFromDate(fromDate); + tReport.setSalesReport(isSalesReport); + tReport.setFullDetails(isFullDetails); + tReport.setToDate(toDate); + tReport.createReport(); + + String csvReport = CSVReportManager.generateCSVReport(ctx,reportData); + String csvURI = ReportManager.getReportURI(csvReport,request); + + String pdfReport = tReport.createPDFReport(); + String pdfURI = ReportManager.getReportURI(pdfReport,request); + + request.getSession().setAttribute(Constants.TABULAR_REPORT_DATA,tReport.toString()); + request.getSession().setAttribute(Constants.CSV_FILE,csvURI); + request.getSession().setAttribute(Constants.PDF_FILE,pdfURI); + + return mapping.findForward(GET_SALES_REPORT); + } + + public static final String GET_DETAILED_SALES_REPORT = "getDetailedSalesReport"; + public ActionForward getDetailedSalesReport(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException, ParseException, FileNotFoundException, DocumentException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + String salesType = request.getParameter("salesType"); + String date1 = request.getParameter("date1"); + String date2 = request.getParameter("date2"); + boolean isSalesReport = Boolean.parseBoolean(request.getParameter("isSalesReport")); + + Timestamp fromDate = TimestampConvertor.getTimestamp(date1, TimestampConvertor.XML_DATE_PATTERN); + Timestamp toDate = TimestampConvertor.getTimestamp(date2, TimestampConvertor.XML_DATE_PATTERN); + // sales types + // 1 -> Sales Excluding VAT + // 2 -> Credit Note Excluding VAT + // 3 -> Exempt Sales + // 4 -> Exempt Credit Note + + ArrayList list = null; + try + { + list =POSSalesReportManager.getDetailedSalesReport(ctx, salesType, isSalesReport, fromDate, toDate, null); + } + catch (OperationException e) + { + postGlobalError("error.process",e.getMessage(),request); + return mapping.getInputForward(); + } + request.getSession().setAttribute(Constants.DETAILED_SALES_REPORT,list); + + return mapping.findForward(GET_DETAILED_SALES_REPORT); + } + + public static String GET_MONTHLY_SALES_REPORT = "getMonthlySalesReport"; + public ActionForward getMonthlySalesReport(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException, ParseException, FileNotFoundException, DocumentException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + String productName = request.getParameter("productName"); + + String orgIds = getOrgIds(ctx, request); + + String date1 = request.getParameter("date1"); + String date2 = request.getParameter("date2"); + + Timestamp d1 = TimestampConvertor.getTimestamp(date1, TimestampConvertor.XML_DATE_PATTERN); + Timestamp d2 = TimestampConvertor.getTimestamp(date2, TimestampConvertor.XML_DATE_PATTERN); + + Calendar fd = Calendar.getInstance(); + fd.setTimeInMillis(d1.getTime()); + fd.set(Calendar.DATE, 1); + + Calendar td = Calendar.getInstance(); + td.setTimeInMillis(d2.getTime()); + td.set(Calendar.DATE, td.getMaximum(Calendar.DAY_OF_MONTH)); + + Timestamp fromDate = new Timestamp(fd.getTimeInMillis()); + Timestamp toDate = new Timestamp(td.getTimeInMillis()); + + // Timestamp fromDate = TimestampConvertor.getTimestamp(date1, TimestampConvertor.XML_DATE_PATTERN); + //Timestamp toDate = TimestampConvertor.getTimestamp(date2, TimestampConvertor.XML_DATE_PATTERN); + + int[] productIds = ProductManager.getProducts(ctx, productName, Env.getContext(ctx,UdiConstants.ROLE_EDITABLE_ORGS_CTX_PARAM), null, null, null); + + if (productIds == null || productIds.length == 0) + { + throw new OperationException ("no products found with product name " + productName); + } + ArrayList reportData = null; + try + { + reportData = new ArrayList(); + Object[] header = {"Month", "Qty Sold"}; + reportData.add(header); + int precision = ProductManager.getUOMPrecision(ctx, productIds[0]); + + HashMap monthQtyMap = POSProductManager.getOrderQtyInfoPerProduct(ctx, true, productIds[0], + orgIds, fromDate, toDate, null); + + reportData = POSReportManager.formatStockSalesReportData(reportData, monthQtyMap, + fromDate, toDate, precision); + } + catch (OperationException e) + { + postGlobalError("error.process",e.getMessage(),request); + return mapping.getInputForward(); + } + + TabularReport tReport = new TabularReport(reportData); + tReport.setSortable(false); + tReport.setStyle("display"); + tReport.setTitle("Monthly Sales Report from " + date1 + " to "+date2 ); + tReport.setSubtitle("Product: "+productName); + tReport.setFromDate(fromDate); + tReport.setToDate(toDate); + tReport.createReport("SalesReportAction.do?action=getSalesDetailsPerProduct", productIds[0]); + + request.getSession().setAttribute(Constants.MONTHLY_SALES_REPORT_DATA,tReport.toString()); + + + return mapping.findForward(GET_MONTHLY_SALES_REPORT); + } + + public static String GET_SALES_DETAILS_PER_PRODUCT = "getSODetailsPerProduct"; + public ActionForward getSalesDetailsPerProduct(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + String productId = request.getParameter("productId"); + + String orgIds = getOrgIds(ctx, request); + + String date1 = request.getParameter("date1"); + String date2 = request.getParameter("date2"); + + Timestamp fromDate = TimestampConvertor.getTimestamp(date1, TimestampConvertor.BIRTH_DATE); + Timestamp toDate = TimestampConvertor.getTimestamp(date2, TimestampConvertor.BIRTH_DATE); + + ArrayList list = null; + try + { + list = POSSalesReportManager.getOrderDetailsPerProduct(ctx, true, productId, orgIds, fromDate, toDate); + } + catch (OperationException e) + { + postGlobalError("error.process",e.getMessage(),request); + return mapping.getInputForward(); + } +/* request.getSession().setAttribute(Constants.DETAILED_SALES_REPORT_PER_PRODUCT,list);*/ + request.getSession().setAttribute(Constants.POS_HISTORY,list); + request.getSession().setAttribute(Constants.POS_HISTORY_ORDER_TYPE,UDIOrderTypes.POS_ORDER.getOrderType()); + + return mapping.findForward(GET_SALES_DETAILS_PER_PRODUCT); + } + + public static String GET_GRN_DETAILS_PER_PRODUCT = "getPODetailsPerProduct"; + public ActionForward getGRNDetailsPerProduct(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + String productId = request.getParameter("productId"); + + String orgIds = getOrgIds(ctx, request); + + String date1 = request.getParameter("date1"); + String date2 = request.getParameter("date2"); + + Timestamp fromDate = TimestampConvertor.getTimestamp(date1, TimestampConvertor.BIRTH_DATE); + Timestamp toDate = TimestampConvertor.getTimestamp(date2, TimestampConvertor.BIRTH_DATE); + + ArrayList list = null; + try + { + list = POSSalesReportManager.getOrderDetailsPerProduct(ctx, false, productId, orgIds, fromDate, toDate); + } + catch (OperationException e) + { + postGlobalError("error.process",e.getMessage(),request); + return mapping.getInputForward(); + } + request.getSession().setAttribute(Constants.POS_HISTORY,list); + request.getSession().setAttribute(Constants.POS_HISTORY_ORDER_TYPE,UDIOrderTypes.POS_GOODS_RECEIVE_NOTE.getOrderType()); + + return mapping.findForward(GET_GRN_DETAILS_PER_PRODUCT); + } + + /*********************************************************************************/ + + public static final String INIT_BEST_SELLING_REPORT = "initBestSellingReport"; + + /** + * Initialise Best Selling Items Report + * @param mapping + * @param form + * @param request + * @param response + * @return + * @throws ApplicationException + * @throws OperationException + */ + public ActionForward initBestSellingReport(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + SellingItemForm reportForm = (SellingItemForm) form; + + //setting defaults + String timePeriod = ReportDateManager.TODAY; + String dateRange = Constants.FIXED_DATE_RANGE; + + reportForm.setTimePeriod(timePeriod); + reportForm.setDateRange(dateRange); + reportForm.setFromDate(""); + reportForm.setToDate(""); + + reportForm.validate(mapping,request); + + return mapping.findForward(INIT_BEST_SELLING_REPORT); + } + + + public static final String GET_BEST_SELLING_ITEMS = "getBestSellingItems"; + + /** + * Generate Best Selling Items + * @param mapping + * @param form + * @param request + * @param response + * @return + * @throws ApplicationException + * @throws OperationException + * @throws DocumentException + * @throws IOException + * @throws SQLException + * @throws ParseException + */ + public ActionForward getBestSellingItems(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException, DocumentException, IOException, SQLException, ParseException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + SellingItemForm sf = (SellingItemForm)form; + ReportBean bean = (ReportBean) sf.getBean(); + + String dateRange = bean.getDateRange(); + String timePeriod = bean.getTimePeriod(); + Timestamp fromDate = null; + Timestamp toDate = null; + + //setting from and to dates + if(dateRange.endsWith(Constants.FIXED_DATE_RANGE)) + { + if(timePeriod == null) + { + throw new OperationException("Invalid Parameter for timePeriod. TimePeriod is null"); + } + + fromDate = ReportDateManager.getStartDateForPeriod(timePeriod); + toDate = ReportDateManager.getEndDateForPeriod(timePeriod); + + } + else if(dateRange.endsWith(Constants.CUSTOM_DATE_RANGE)) + { + fromDate = ReportDateManager.getFromDate(bean); + toDate = ReportDateManager.getToDate(bean); + + } + else + { + throw new OperationException("Invalid Parameter for dateRange :" + dateRange); + } + + + ArrayList reportData = POSReportManager.getBestSellingItemsData(ctx, fromDate, toDate, null); + + String title = "BEST 100 SELLING ITEMS"; + String subtitle = null; + + String sql = "Select Upper(Name) from AD_Org where AD_org_ID=?"; + PreparedStatement pstmt = null; + ResultSet rs = null; + + pstmt = DB.prepareStatement(sql.toString(), null); + pstmt.setInt(1, Env.getAD_Org_ID(ctx)); + + try + { + rs = pstmt.executeQuery(); + + if (rs.next()) + { + subtitle = rs.getString(1); + } + + } + catch(SQLException e) + { + throw new OperationException(e); + } + finally + { + DBUtils.close(rs); + DBUtils.close(pstmt); + } + + SimpleDateFormat dateFormat2 = new SimpleDateFormat("dd-MMM-yyyy"); + + //constructing the table + TabularReport tReport = new TabularReport(reportData); + tReport.setSortable(false); + tReport.setStyle("display"); + tReport.setTitle(title); + tReport.setFromDate(fromDate); + tReport.setToDate(toDate); + tReport.setSubtitle(subtitle); + tReport.createReport(); + + response.setContentType("x-application/pdf"); + response.setHeader("Content-Disposition","inline;filename=BestSellingItemsReport("+System.currentTimeMillis()+").pdf"); + response.getOutputStream().write(tReport.getSellingItemsData()); + + + return mapping.findForward(GET_BEST_SELLING_ITEMS); + } + + public static final String INIT_STOCK_ENQUIRY_REPORT = "initStockEnquiryReport"; + + public ActionForward initStockEnquiryReport(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + StockEnquiryForm reportForm = (StockEnquiryForm) form; + + //setting defaults + String timePeriod = ReportDateManager.TODAY; + String dateRange = Constants.FIXED_DATE_RANGE; + + reportForm.setTimePeriod(timePeriod); + reportForm.setDateRange(dateRange); + reportForm.setFromDate(""); + reportForm.setToDate(""); + + reportForm.validate(mapping,request); + + return mapping.findForward(INIT_STOCK_ENQUIRY_REPORT); + } + + public static final String GET_STOCK_ENQUIRY_REPORT = "getStockEnquiryReport"; + + + /** + * Get Stock Enquiry Report + * @param mapping + * @param form + * @param request + * @param response + * @return + * @throws ApplicationException + * @throws OperationException + * @throws DocumentException + * @throws IOException + * @throws SQLException + * @throws ParseException + */ + public ActionForward getStockEnquiryReport(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException, DocumentException, IOException, SQLException, ParseException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + StockEnquiryForm sf = (StockEnquiryForm)form; + ReportBean bean = (ReportBean) sf.getBean(); + + String dateRange = bean.getDateRange(); + String timePeriod = bean.getTimePeriod(); + Timestamp fromDate = null; + Timestamp toDate = null; + + //setting from and to dates + if(dateRange.endsWith(Constants.FIXED_DATE_RANGE)) + { + if(timePeriod == null) + { + throw new OperationException("Invalid Parameter for timePeriod. TimePeriod is null"); + } + + fromDate = ReportDateManager.getStartDateForPeriod(timePeriod); + toDate = ReportDateManager.getEndDateForPeriod(timePeriod); + + } + else if(dateRange.endsWith(Constants.CUSTOM_DATE_RANGE)) + { + fromDate = ReportDateManager.getFromDate(bean); + toDate = ReportDateManager.getToDate(bean); + + } + else + { + throw new OperationException("Invalid Parameter for dateRange :" + dateRange); + } + + ArrayList reportData = POSReportManager.getStockEnquiryData(ctx, fromDate, toDate, null); + + String title = "STOCK ENQUIRY REPORT"; + String subtitle = null; + + String sql = "Select Upper(Name) from AD_Org where AD_org_ID=?"; + PreparedStatement pstmt = null; + ResultSet rs = null; + + pstmt = DB.prepareStatement(sql.toString(), null); + pstmt.setInt(1, Env.getAD_Org_ID(ctx)); + + try + { + rs = pstmt.executeQuery(); + + if (rs.next()) + { + subtitle = rs.getString(1); + } + + } + catch(SQLException e) + { + throw new OperationException(e); + } + finally + { + DBUtils.close(rs); + DBUtils.close(pstmt); + } + + SimpleDateFormat dateFormat2 = new SimpleDateFormat("dd-MMM-yyyy"); + + //constructing the table + TabularReport tReport = new TabularReport(reportData); + tReport.setSortable(false); + tReport.setStyle("display"); + tReport.setTitle(title); + tReport.setFromDate(fromDate); + tReport.setToDate(toDate); + tReport.setSubtitle(subtitle); + tReport.createReport(); + + response.setContentType("x-application/pdf"); + response.setHeader("Content-Disposition","inline;filename=StockEnquiryReport("+System.currentTimeMillis()+").pdf"); + response.getOutputStream().write(tReport.getStockEnquiryData()); + + + return mapping.findForward(GET_STOCK_ENQUIRY_REPORT); + } + + public static final String GET_STOCK_SALES_REPORT = "getStockSalesReport"; + public ActionForward getStockSalesReport(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, SQLException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + + if (fwd!=null) + { + return fwd; + } + + Properties ctx = TmkJSPEnv.getCtx(request); + + ReportForm sf = (ReportForm)form; + ReportBean bean = (ReportBean) sf.getBean(); + + Integer productId = bean.getProductId(); + String description = bean.getDescription(); + String barCode = bean.getBarCode(); + Integer orgId = bean.getOrgId(); + + String fromDate = bean.getFromDate(); + String toDate = bean.getToDate(); + + Timestamp thisDate = TimestampConvertor.getCurrentDateTimeTimestamp(); + Timestamp startDate = thisDate; + Timestamp endDate = thisDate; + + String productName = bean.getProductName(); + + HashSet orgIds = (HashSet)request.getSession().getAttribute(Constants.STOCK_SALES_REPORT_ORGS); + if (orgIds == null) + { + orgIds = new HashSet(); + } + orgIds.add(orgId); + + if (fromDate != null) + { + startDate = TimestampConvertor.getTimestamp(fromDate, TimestampConvertor.BIRTH_DATE); + } + if (toDate != null) + { + endDate = TimestampConvertor.getTimestamp(toDate, TimestampConvertor.BIRTH_DATE); + } + Timestamp oldFromDate = (Timestamp)request.getSession().getAttribute(Constants.FROM_DATE); + Timestamp oldToDate = (Timestamp)request.getSession().getAttribute(Constants.TO_DATE); + + if (!startDate.equals(oldFromDate) || !endDate.equals(oldToDate)) + { + clear(request, true); + clear(request, false); + } + + description = description == null? "":description; + barCode = barCode == null?"": barCode; + + ArrayList reportSalesData = getReportData(request, true, orgId); + ArrayList reportStockData = getReportData(request, false, orgId); + + HashSet productSalesCompleteSet = (HashSet) request.getSession().getAttribute(Constants.PRODUCT_SALES_COMPLETE_SET); + HashSet productStockCompleteSet = (HashSet) request.getSession().getAttribute(Constants.PRODUCT_STOCK_COMPLETE_SET); + + + HashMap> prodOrgStockMap = (HashMap>)request.getSession().getAttribute(Constants.PRODUCT_ORG_STOCK_MAP); + HashMap> prodOrgSalesMap = (HashMap>)request.getSession().getAttribute(Constants.PRODUCT_ORG_SALES_MAP); + + + productSalesCompleteSet = productSalesCompleteSet == null? new HashSet() : productSalesCompleteSet; + productStockCompleteSet = productStockCompleteSet == null? new HashSet() : productStockCompleteSet; + prodOrgStockMap = prodOrgStockMap == null? new HashMap>() : prodOrgStockMap; + prodOrgSalesMap = prodOrgSalesMap == null? new HashMap>() : prodOrgSalesMap; + + + ArrayList salesBackup = POSReportManager.doBackup(reportSalesData); + ArrayList stockBackup = POSReportManager.doBackup(reportStockData); + + + if (orgId != null) + { + boolean isComplete = false; + if (orgId == 0) + { + isComplete = true; + } + try + { + + int[] productIds = null ; + + if (productName == null) + { + productIds = ProductManager.getProducts(ctx, "", description, barCode, null); + if (productIds.length == 0) + { + throw new OperationException("no products found matching that description and/or barcode"); + } + } + else + { + productIds = new int[]{productId}; + } + + clear(request, !isComplete); + + if (orgId == 0) + { + + for (int prodId: productIds) + { + reportSalesData = POSReportManager.getStockSalesReportComplete(ctx, productSalesCompleteSet, true, reportSalesData, prodId, orgId, startDate, endDate); + reportStockData = POSReportManager.getStockSalesReportComplete(ctx, productStockCompleteSet,false, reportStockData, prodId, orgId, startDate, endDate); + } + } + else + { + + for (int prodId: productIds) + { + reportSalesData = POSReportManager.getStockSalesReport(ctx, prodOrgSalesMap, reportSalesData, true, prodId, orgId, startDate, endDate); + reportStockData = POSReportManager.getStockSalesReport(ctx, prodOrgStockMap,reportStockData, false, prodId, orgId, startDate, endDate); + } + } + } + catch (OperationException e) + { + reportStockData = stockBackup; + reportSalesData = salesBackup; + + if (orgId != 0) + { + request.getSession().setAttribute(Constants.SALES_REPORT_LIST, reportSalesData); + request.getSession().setAttribute(Constants.STOCK_REPORT_LIST, reportStockData); + } + else + { + request.getSession().setAttribute(Constants.SALES_REPORT_LIST_COMPLETE, reportSalesData); + request.getSession().setAttribute(Constants.STOCK_REPORT_LIST_COMPLETE, reportStockData); + + } + postGlobalError("error.process",e.getMessage(),request); + return mapping.getInputForward(); + } + + //constructing the table + TabularReportMerge tReport = new TabularReportMerge("Stock Sales Report", 2); + tReport.setFromDate(startDate); + tReport.setToDate(endDate); + tReport.setSortable(false); + tReport.setStyle("display"); + try + { + if (orgId == 0) + { + tReport.createReport(reportSalesData, Constants.SALES_TYPE, "Sales (Qty Sold)"); + tReport.createReport(reportStockData, Constants.STOCK_TYPE, "Stock (Qty On Hand)"); + } + else + { + tReport.createReport(reportSalesData, Constants.SALES_TYPE, "Sales (Qty Sold)"); + tReport.createReport(reportStockData, Constants.STOCK_TYPE, "Stock (Qty On Hand)"); + } + } + catch (OperationException e) + { + postGlobalError("error.process",e.getMessage(),request); + return mapping.getInputForward(); + } + request.getSession().setAttribute(Constants.STOCK_SALES_REPORT_DATA,tReport.toString()); + request.getSession().setAttribute(Constants.STOCK_SALES_REPORT_ORGS, orgIds); + + if (orgId != 0) + { + request.getSession().setAttribute(Constants.SALES_REPORT_LIST, reportSalesData); + request.getSession().setAttribute(Constants.STOCK_REPORT_LIST, reportStockData); + request.getSession().setAttribute(Constants.PRODUCT_ORG_STOCK_MAP, prodOrgStockMap); + request.getSession().setAttribute(Constants.PRODUCT_ORG_SALES_MAP, prodOrgSalesMap); + + } + else + { + request.getSession().setAttribute(Constants.SALES_REPORT_LIST_COMPLETE, reportSalesData); + request.getSession().setAttribute(Constants.STOCK_REPORT_LIST_COMPLETE, reportStockData); + request.getSession().setAttribute(Constants.PRODUCT_SALES_COMPLETE_SET, productSalesCompleteSet); + request.getSession().setAttribute(Constants.PRODUCT_STOCK_COMPLETE_SET, productStockCompleteSet); + } + } + + request.getSession().setAttribute(Constants.FROM_DATE, startDate); + request.getSession().setAttribute(Constants.TO_DATE, endDate); + + return mapping.findForward(GET_STOCK_SALES_REPORT); + + } + + public static final String CLEAR_STOCK_SALES_REPORT = "clearStockSalesReport"; + public ActionForward clearStockSalesReport(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException, DocumentException, IOException, SQLException, ParseException + { + ActionForward fwd= init(mapping,form,request,response); + + if (fwd!=null) + { + return fwd; + } + + clear(request, true); + clear(request, false); + request.getSession().removeAttribute(Constants.STOCK_SALES_REPORT_ORGS); + request.getSession().removeAttribute(Constants.STOCK_SALES_REPORT_DATA); + + return mapping.findForward(GET_STOCK_SALES_REPORT); + } + + private void clear(HttpServletRequest request, boolean isComplete) + { + if (!isComplete) + { + request.getSession().removeAttribute(Constants.PRODUCT_ORG_STOCK_MAP); + request.getSession().removeAttribute(Constants.PRODUCT_ORG_SALES_MAP); + request.getSession().removeAttribute(Constants.SALES_REPORT_LIST); + request.getSession().removeAttribute(Constants.STOCK_REPORT_LIST); + } + else + { + request.getSession().removeAttribute(Constants.PRODUCT_SALES_COMPLETE_SET); + request.getSession().removeAttribute(Constants.PRODUCT_STOCK_COMPLETE_SET); + request.getSession().removeAttribute(Constants.SALES_REPORT_LIST_COMPLETE); + request.getSession().removeAttribute(Constants.STOCK_REPORT_LIST_COMPLETE); + } + } + + private ArrayList getReportData(HttpServletRequest request, boolean isSales, int orgId) + { + + if (isSales) + { + if (orgId == 0) + { + return (ArrayList) request.getSession().getAttribute(Constants.SALES_REPORT_LIST_COMPLETE); + } + else + { + return (ArrayList)request.getSession().getAttribute(Constants.SALES_REPORT_LIST); + } + } + else + { + if (orgId == 0) + { + return (ArrayList) request.getSession().getAttribute(Constants.STOCK_REPORT_LIST_COMPLETE); + } + else + { + return (ArrayList)request.getSession().getAttribute(Constants.STOCK_REPORT_LIST); + } + } + } + + public ActionForward getMonthlyStockReport(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException, ParseException, FileNotFoundException, DocumentException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + String productName = request.getParameter("productName"); + String orgIds = getOrgIds(ctx, request); + String date1 = request.getParameter("date1"); + String date2 = request.getParameter("date2"); + + Timestamp d1 = TimestampConvertor.getTimestamp(date1, TimestampConvertor.XML_DATE_PATTERN); + Timestamp d2 = TimestampConvertor.getTimestamp(date2, TimestampConvertor.XML_DATE_PATTERN); + + Calendar fd = Calendar.getInstance(); + fd.setTimeInMillis(d1.getTime()); + fd.set(Calendar.DATE, 1); + + Calendar td = Calendar.getInstance(); + td.setTimeInMillis(d2.getTime()); + td.set(Calendar.DATE, td.getMaximum(Calendar.DAY_OF_MONTH)); + + Timestamp fromDate = new Timestamp(fd.getTimeInMillis()); + Timestamp toDate = new Timestamp(td.getTimeInMillis()); + + int[] productIds = ProductManager.getProducts(ctx, productName, Env.getContext(ctx,UdiConstants.ROLE_EDITABLE_ORGS_CTX_PARAM), null, null, null); + + if (productIds == null || productIds.length == 0) + { + throw new OperationException ("no products found with product name " + productName); + } + ArrayList reportData = null; + try + { + reportData = new ArrayList(); + Object[] header = new Object[]{"Month", "Qty Sold", "GRN", "Stock Adjustments"}; + reportData.add(header); + + HashMap monthQtySales = POSProductManager.getOrderQtyInfoPerProduct(ctx, true, productIds[0], + orgIds, fromDate, toDate, null); + + reportData = POSReportManager.formatStockSalesReportData(reportData, monthQtySales, fromDate, toDate, 2); + + HashMap monthQtyGRN = POSProductManager.getOrderQtyInfoPerProduct(ctx, false, productIds[0], + orgIds, fromDate, toDate, null); + + reportData = POSReportManager.formatStockSalesReportData(reportData, monthQtyGRN,fromDate, toDate, 2); + + HashMap monthStockAdjust = POSStockManager.getMonthlyStockAdjustments(ctx, + productIds[0], orgIds, fromDate, toDate, null); + reportData = POSReportManager.formatStockSalesReportData(reportData, monthStockAdjust,fromDate, toDate, 2); + + } + catch (OperationException e) + { + postGlobalError("error.process",e.getMessage(),request); + return mapping.getInputForward(); + } + + TabularReport tReport = new TabularReport(reportData); + tReport.setSortable(false); + tReport.setStyle("display"); + tReport.setTitle("Monthly Stock and Sales Report from " + date1 + " to "+date2 ); + tReport.setSubtitle("Product: "+productName); + tReport.setFromDate(fromDate); + tReport.setToDate(toDate); + tReport.createReport("SalesReportAction.do?action=getGRNDetailsPerProduct", productIds[0]); // need to find another way to generate reports with links on data + + request.getSession().setAttribute(Constants.MONTHLY_SALES_REPORT_DATA,tReport.toString()); + + + return mapping.findForward(GET_MONTHLY_SALES_REPORT); + } + + public static String GET_STOCK_ADJUSTMENTS_PER_PRODUCT = "getStockAdjustmentsPerProduct"; + public ActionForward getStockAdjustmentsPerProduct(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + String prodId = request.getParameter("productId"); + String orgIds = getOrgIds(ctx, request); + int productId = Integer.parseInt(prodId); + String date1 = request.getParameter("date1"); + String date2 = request.getParameter("date2"); + Timestamp fromDate = TimestampConvertor.getTimestamp(date1, TimestampConvertor.BIRTH_DATE); + Timestamp toDate = TimestampConvertor.getTimestamp(date2, TimestampConvertor.BIRTH_DATE); + MProduct product = MProduct.get(ctx, productId); + + ArrayList reportData = new ArrayList(); + + + reportData = POSStockManager.getStockAdjustments(ctx, reportData, productId, orgIds, fromDate, toDate, null); + + TabularReport tReport = new TabularReport(reportData); + tReport.setSortable(false); + tReport.setStyle("display"); + tReport.setTitle("Stock Adjustments Report from " + date1 + " to "+date2 ); + tReport.setSubtitle("Product: "+product.getName()); + tReport.setFromDate(fromDate); + tReport.setToDate(toDate); + tReport.createReport(ctx, productId); + + request.getSession().setAttribute(Constants.STOCK_ADJUSTMENTS_REPORT_DATA,tReport.toString()); + + + return mapping.findForward(GET_STOCK_ADJUSTMENTS_PER_PRODUCT); + } + + public static final String VIEW_INVENTORY_HISTORY="viewInventoryHistory"; + public ActionForward viewInventoryHistory(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + + Properties ctx = TmkJSPEnv.getCtx(request); + String prodId = request.getParameter("productId"); + String org_Id = request.getParameter("orgId"); + int orgId = Integer.parseInt(org_Id); + int productId = Integer.parseInt(prodId); + + String date1 = request.getParameter("date1"); + String date2 = request.getParameter("date2"); + + Timestamp fromDate = TimestampConvertor.getTimestamp(date1, TimestampConvertor.XML_DATE_PATTERN); + Timestamp toDate = TimestampConvertor.getTimestamp(date2, TimestampConvertor.XML_DATE_PATTERN); + + ArrayList list = InventoryManager.viewInventoryHistory(ctx,orgId, productId, fromDate, toDate, null); + request.setAttribute(Constants.INVENTORY_HISTORY_LIST,list); + return mapping.findForward(VIEW_INVENTORY_HISTORY); + } + + public static final String VIEW_INVENTORY_MOVE_HISTORY = "viewInventoryMoveHistory"; + public ActionForward viewInventoryMoveHistory(ActionMapping mapping, ActionForm form, + HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd = init(mapping, form, request, response); + + if (fwd != null) + { + return fwd; + } + Properties ctx = TmkJSPEnv.getCtx(request); + String prodId = request.getParameter("productId"); + String orgId = request.getParameter("orgId"); + String type = request.getParameter("type"); + int productId = Integer.parseInt(prodId); + String date1 = request.getParameter("date1"); + String date2 = request.getParameter("date2"); + + Timestamp fromDate = TimestampConvertor.getTimestamp(date1, TimestampConvertor.XML_DATE_PATTERN); + Timestamp toDate = TimestampConvertor.getTimestamp(date2, TimestampConvertor.XML_DATE_PATTERN); + + ArrayList list = MMovementManager.getMMovement(ctx, orgId, type, productId, fromDate, toDate); + + request.setAttribute(Constants.INVENTORY_MOVE_HISTORY, list); + return mapping.findForward(VIEW_INVENTORY_MOVE_HISTORY); + } + + private String getOrgIds(Properties ctx, HttpServletRequest request) + { + HashSet orgIdSet = (HashSet)request.getSession().getAttribute(Constants.STOCK_SALES_REPORT_ORGS); + StringBuffer orgIds = new StringBuffer(); + Iterator iter = orgIdSet.iterator(); + while (iter.hasNext()) + { + Integer orgId = iter.next(); + + if (orgId ==0) + { + return Env.getContext(ctx,UdiConstants.ROLE_EDITABLE_ORGS_CTX_PARAM); + } + else + { + orgIds = orgIds.append(orgId); + if (iter.hasNext()) + { + orgIds = orgIds.append(","); + } + } + } + + return orgIds.toString(); + } + + + public static final String GENERATE_REPORT_INPUT = "generateReportInput"; + public ActionForward generateReportInput(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + + if (fwd!=null) + { + return fwd; + } + + Properties ctx = TmkJSPEnv.getCtx(request); + StringBuffer componentList = new StringBuffer(); + String processDescription = null; + String processComment = null; + + int processId = 0; + try + { + processId = Integer.valueOf(request.getParameter("processId")); + MProcess process = MProcess.get(ctx, processId); + MProcessPara[] processPara = process.getParameters(); + processDescription = process.getDescription(); + processComment = process.getHelp(); + + for (MProcessPara parameter:processPara) + { + tr component = new tr(); + try + { + component = (tr)WebComponentFactory.getWebComponent(ctx, parameter); + } + catch (Exception e) + { + postGlobalError("error.process", e.getMessage(), request); + return mapping.getInputForward(); + + } + componentList.append(component.toString()); + } + } + catch (NumberFormatException e) + { + return mapping.getInputForward(); + } + request.getSession().setAttribute(Constants.PROCESS_ID, processId); + request.getSession().setAttribute(Constants.REPORT_DESCRIPTION, processDescription); + request.getSession().setAttribute(Constants.REPORT_COMMENT, processComment); + request.getSession().setAttribute(Constants.WEB_COMPONENTS, componentList.toString()); + return mapping.findForward(GENERATE_REPORT_INPUT); + } + + + public static final String GENERATE_REPORT_OUTPUT = "generateReportOutput"; + public ActionForward generateReportOutput(ActionMapping mapping, ActionForm form, + HttpServletRequest request, HttpServletResponse response) throws Exception + { + ActionForward fwd = init(mapping, form, request, response); + + if (fwd != null) + { + return fwd; + } + Properties ctx = TmkJSPEnv.getCtx(request); + DefaultForm df = (DefaultForm)form; + + String reportType = df.getReportType(); + // Load process + int processId = Integer.valueOf(request.getSession().getAttribute(Constants.PROCESS_ID).toString()); + MProcess process = MProcess.get(ctx, processId); + + Map map = request.getParameterMap(); + ProcessInfo pi = null; + // Create a new process instance and populate its parameters with the web user's input + try + { + pi = POSReportManager.createProcessInstance(ctx, processId, map, null); + } + catch (OperationException e) + { + postGlobalError("error.process",e.getMessage(), request); + return mapping.getInputForward(); + } + try + { + ProcessManager.startProcess(ctx, process.getClassname(), pi, null); + } + catch (InstantiationException e) + { + return mapping.getInputForward(); + } + catch (IllegalAccessException e) + { + return mapping.getInputForward(); + } + catch (ClassNotFoundException e) + { + return mapping.getInputForward(); + } + + if (POSReportManager.isJasperReport(process.getClassname())) + { + JasperPrint jasperPrint = ReportStarter.getJasperPrint(); + if (Constants.HTML.equals(reportType)) + { + XhtmlDocument doc = new XhtmlDocument(); + File file = File.createTempFile ("Jasper", ".html", new File(PathInfo.PROJECT_HOME)); + JasperExportManager.exportReportToHtmlFile(jasperPrint, file.getAbsolutePath()); + + StringBuffer contents = new StringBuffer(); + try + { + BufferedReader input = new BufferedReader(new FileReader(file)); + try + { + String line = null; + while (( line = input.readLine()) != null){ + contents.append(line); + contents.append(System.getProperty("line.separator")); + } + } + finally + { + input.close(); + } + } + catch (IOException ex) + { + ex.printStackTrace(); + } + PrintWriter writer = response.getWriter(); + writer.write(contents.toString()); + doc.output(writer); + writer.flush(); + writer.close(); + } + if (Constants.PDF.equals(reportType)) + { + response.setContentType(MimeType.getMimeType(".pdf")); + response.setHeader("Content-Disposition:", "attachment;filename=\""+process.getName()+".pdf\""); + byte[] pdfData = JasperExportManager.exportReportToPdf(jasperPrint); + response.getOutputStream().write(pdfData); + } + } + else + { + MPrintFormat printFormat = POSReportManager.loadPrintFormat(ctx, process, null); + PrintData printData = POSReportManager.getPrintData(ctx, printFormat, pi); + + ReportEngine reportEngine = POSReportManager.getReportEngine(ctx, printFormat, pi); + + if (Constants.PDF.equals(reportType)) + { + response.setContentType(MimeType.getMimeType(".pdf")); + response.setHeader("Content-Disposition:", "attachment;filename=\""+process.getName()+".pdf\""); + + byte[] pdfData = reportEngine.createPDFData(); + response.getOutputStream().write(pdfData); + } + if (Constants.CSV.equals(reportType)) + { + response.setContentType(MimeType.getMimeType(".csv")); + response.setHeader("Content-Disposition:", "attachment;filename=\""+process.getName()+".csv\""); + PrintWriter writer = new PrintWriter(response.getOutputStream()); + reportEngine.createCSV(writer, ',', printFormat.getLanguage()); + } + if (Constants.HTML.equals(reportType)) + { + PrintWriter printWriter = new PrintWriter(response.getOutputStream()); + HashMap paramMap = POSReportManager.getReportParameters(ctx, pi.getAD_PInstance_ID(), null); + POSReportManager.createHTML(printWriter, process.getName(), paramMap, printData, printFormat); + } + } + response.getOutputStream().flush(); + response.getOutputStream().close(); + return null; + } + +} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/POSRoleAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/POSRoleAction.java new file mode 100644 index 0000000000..4d8a4de4a8 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/pos/POSRoleAction.java @@ -0,0 +1,361 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 25-Jul-2005 by alok + * + */ + +package org.posterita.struts.pos; + +import java.util.ArrayList; +import java.util.Properties; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.compiere.model.MOrg; +import org.compiere.model.MRole; +import org.compiere.model.MRoleOrgAccess; +import org.compiere.util.Env; +import org.compiere.util.Trx; +import org.posterita.Constants; +import org.posterita.beans.RoleBean; +import org.posterita.businesslogic.MenuManager; +import org.posterita.businesslogic.administration.RoleManager; +import org.posterita.core.MenuItem; +import org.posterita.core.TmkJSPEnv; +import org.posterita.core.TrxPrefix; +import org.posterita.exceptions.ApplicationException; +import org.posterita.exceptions.NoAccessToEditObjectException; +import org.posterita.exceptions.NoCheckBoxSelectedException; +import org.posterita.exceptions.OperationException; +import org.posterita.exceptions.RoleAlreadyExistsException; +import org.posterita.exceptions.SystemException; +import org.posterita.form.RoleForm; +import org.posterita.lib.UdiConstants; +import org.posterita.struts.core.DefaultForm; + +public class POSRoleAction extends POSDispatchAction +{ + public static final String CREATE_ROLE = "createRole"; + public static final String INIT_ROLE = "initRole"; + public static final String LIST_ROLES = "listRoles"; + public static final String VIEW_ROLE = "viewRole"; + public static final String DELETE_ROLE = "deleteRole"; + + public ActionForward createRole(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws Exception + { + ActionForward fwd = init(mapping,form,request,response); + + if (fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + DefaultForm df = (DefaultForm) form; + + RoleBean bean = (RoleBean) df.getBean(); + + + //Create Role and assign menus + MRole role; + + Trx trx = Trx.get(TrxPrefix.getPrefix(), true); + + try + { + trx.start(); + role = RoleManager.createRole(ctx, bean.getOrgId(), bean.getName(),bean.getIsAccessAllOrgs(), bean.getCheckBox(), bean.getUserDiscount(), bean.getIsOverwritePriceLimit(), bean.getIsDiscountAllowedOnTotal(), bean.getIsDiscountUptoLimitPrice(), bean.getCanCreateOrder(), bean.getCanAlterOrder(), bean.getCanViewOrder(), trx.getTrxName()); + trx.commit(); + ArrayList menus = MenuManager.getMenus(ctx, role.get_ID()); + MenuItem rootItem = MenuManager.buildMenuTree(ctx, menus); + + request.getSession().setAttribute(Constants.ROLE,bean); + request.getSession().setAttribute(Constants.ROLE_MENUS, rootItem.getSubMenus()); + } + catch (RoleAlreadyExistsException e) + { + trx.rollback(); + postGlobalError("error.role.already.exists",request); + return mapping.getInputForward(); + } + finally + { + trx.close(); + } + + return mapping.findForward(CREATE_ROLE); + + } + + public ActionForward initRole(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws Exception + { + ActionForward fwd = init(mapping,form,request,response); + + if (fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + //ArrayList menuList = MenuKeyNamePair.getKeyNamePairs(ctx); + + //String menu = MenuItem.getMenu(ctx, null); + + //request.getSession().setAttribute(Constants.MENUS,menu); + + ArrayList menus = MenuManager.getMenusForOrganisationType(ctx); + MenuItem rootItem = MenuManager.buildMenuTree(ctx, menus); + + //request.getSession().setAttribute(Constants.ROLE,bean); + request.getSession().setAttribute(Constants.ROLE_MENUS, rootItem.getSubMenus()); + + return mapping.findForward(CREATE_ROLE); + + } + + public ActionForward listRoles(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, SystemException, OperationException + { + ActionForward fwd = init(mapping,form,request,response); + + if (fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + DefaultForm df = (DefaultForm) form; + + ArrayList roles = new ArrayList(); + + if (df.getFirst() != null && df.getFirst().equals("1")) + { + request.getSession().setAttribute(Constants.ALL_ROLES,roles); + return mapping.findForward(LIST_ROLES); + } + else + roles = RoleManager.getRoles(ctx, df.getName()); + + request.getSession().setAttribute(Constants.ALL_ROLES,roles); + + return mapping.findForward(LIST_ROLES); + + } + + public ActionForward deleteRole(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, SystemException, OperationException + { + ActionForward fwd = init(mapping,form,request,response); + + if (fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + DefaultForm df = (DefaultForm) form; + + Integer roleId = Integer.valueOf(df.getRoleId()); + + RoleManager.deleteRole(ctx,roleId.intValue()); + + return mapping.findForward(DELETE_ROLE); + } + + + public ActionForward viewRole(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, SystemException, OperationException + { + ActionForward fwd = init(mapping,form,request,response); + + if (fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + DefaultForm df = (DefaultForm) form; + + Integer roleId = Integer.valueOf(df.getRoleId()); + + RoleBean bean = RoleManager.getRole(ctx,roleId.intValue()); + + //ArrayList menus = MenuItem.getMenu(ctx,roleId.intValue()); + + //request.getSession().setAttribute(Constants.MENUS,menus); + + ArrayList menus = MenuManager.getMenus(ctx, roleId.intValue()); + MenuItem rootItem = MenuManager.buildMenuTree(ctx, menus); + + request.getSession().setAttribute(Constants.ROLE_MENUS, rootItem.getSubMenus()); + request.getSession().setAttribute(Constants.ROLE,bean); + + return mapping.findForward(VIEW_ROLE); + + } + + private static final String INIT_EDIT_ROLE = "initEditRole"; + public ActionForward initEditRole(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, SystemException, OperationException + { + ActionForward fwd = init(mapping,form,request,response); + + if (fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + DefaultForm df = (DefaultForm)form; + + Integer roleId = Integer.valueOf(df.getRoleId()); + + RoleBean bean = RoleManager.getRole(ctx,roleId.intValue()); + MenuItem menuItem = RoleManager.getAvailableMenus(ctx, roleId); + + request.getSession().setAttribute(Constants.ROLE_MENUS, menuItem.getSubMenus()); + request.getSession().setAttribute(Constants.ROLE,bean); + + return mapping.findForward(INIT_EDIT_ROLE); + } + + + private static final String INIT_ROLE_ORG_ACCESS = "initRoleOrgAccess"; + public ActionForward initEditRoleOrgAccess(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, SystemException, OperationException + { + ActionForward fwd = init(mapping,form,request,response); + + if (fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + RoleForm rf = (RoleForm) form; + + RoleBean bean = (RoleBean) rf.getBean(); + + ArrayList list = RoleManager.getRoleOrgAccess(ctx, bean.getRoleId()); + RoleBean myRoleBean = RoleManager.getRole(ctx, bean.getRoleId()); + + request.getSession().setAttribute(Constants.ROLE_ORG_ACCESS_LIST, list); + request.getSession().setAttribute(Constants.ROLE, myRoleBean); + + + return mapping.findForward(INIT_ROLE_ORG_ACCESS); + } + + private static final String EDIT_ROLE_ORG_ACCESS = "editRoleOrgAccess"; + public ActionForward editRoleOrgAccess(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, SystemException, OperationException + { + ActionForward fwd = init(mapping,form,request,response); + + if (fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + DefaultForm df = (DefaultForm) form; + + //RoleBean bean = (RoleBean) rf.getBean(); + + ArrayList roleBeanList = df.getRoleOrgAccessList(); + + Trx trx = Trx.get(TrxPrefix.getPrefix(), true); + trx.start(); + + + try + { + RoleManager.editRoleOrgAccess(ctx, roleBeanList, trx.getTrxName()); + trx.commit(); + } + catch(OperationException ex) + { + trx.rollback(); + postGlobalError("error.role.org.access.edit", request); + return mapping.getInputForward(); + } + finally + { + trx.close(); + } + + return mapping.findForward(EDIT_ROLE_ORG_ACCESS); + } + + + public static final String EDIT_ROLE = "editRole"; + public ActionForward editRole(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, SystemException, OperationException + { + ActionForward fwd = init(mapping,form,request,response); + + if (fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + DefaultForm df = (DefaultForm)form; + + RoleBean roleBean = (RoleBean)df.getBean(); + + Trx trx = Trx.get(TrxPrefix.getPrefix(), true); + trx.start(); + try + { + RoleManager.editRole(ctx, roleBean.getRoleId(), roleBean.getName(), roleBean.getIsAccessAllOrgs(), roleBean.getCheckBox(), roleBean.getUserDiscount(), roleBean.getIsOverwritePriceLimit(), roleBean.getIsDiscountUptoLimitPrice(), roleBean.getIsDiscountAllowedOnTotal() ,trx.getTrxName()); + trx.commit(); + } + catch(RoleAlreadyExistsException ex) + { + trx.rollback(); + postGlobalError("error.role.already.exists",request); + return mapping.getInputForward(); + } + catch (NoAccessToEditObjectException e) + { + trx.rollback(); + postGlobalError("error.no.edit.access", request); + return mapping.getInputForward(); + } + catch(NoCheckBoxSelectedException e) + { + trx.rollback(); + postGlobalError("error.no.checkbox.selected",request); + return mapping.getInputForward(); + } + catch(OperationException ex) + { + trx.rollback(); + postGlobalError("error.role.edit", request); + return mapping.getInputForward(); + } + finally + { + trx.close(); + } + + RoleBean bean = RoleManager.getRole(ctx, roleBean.getRoleId()); + ArrayList menus = MenuManager.getMenus(ctx, roleBean.getRoleId()); + MenuItem rootItem = MenuManager.buildMenuTree(ctx, menus); + + request.getSession().setAttribute(Constants.ROLE_MENUS, rootItem.getSubMenus()); + request.getSession().setAttribute(Constants.ROLE, bean); + + ArrayList roles = RoleManager.getRoles(ctx, null); + + request.getSession().setAttribute(Constants.ALL_ROLES,roles); + + return mapping.findForward(EDIT_ROLE); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/POSSalesReportAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/POSSalesReportAction.java new file mode 100644 index 0000000000..078edc6ef6 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/pos/POSSalesReportAction.java @@ -0,0 +1,290 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * 17-Jul-2006 14:12:03 by praveen + * + */ + +package org.posterita.struts.pos; + +import java.awt.Color; +import java.sql.Timestamp; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; +import java.util.Properties; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.compiere.model.MAttribute; +import org.compiere.model.MAttributeSet; +import org.jfree.chart.axis.DateAxis; +import org.jfree.chart.plot.XYPlot; +import org.posterita.Constants; +import org.posterita.beans.ReportBean; +import org.posterita.businesslogic.performanceanalysis.ReportDateManager; +import org.posterita.businesslogic.performanceanalysis.ReportManager; +import org.posterita.businesslogic.performanceanalysis.SalesAnalysisReportManager; +import org.posterita.core.PieChart; +import org.posterita.core.RandomStringGenerator; +import org.posterita.core.SessionStorage; +import org.posterita.core.TimeSeriesChart; +import org.posterita.core.TimestampConvertor; +import org.posterita.core.TmkJSPEnv; +import org.posterita.exceptions.ApplicationException; +import org.posterita.exceptions.OperationException; +import org.posterita.form.SalesReportForm; +import org.posterita.struts.core.DefaultForm; + +public class POSSalesReportAction extends POSDispatchAction +{ + public static final String GET_CUSTOM_REPORT = "getCustomReport"; + public ActionForward getCustomReport(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws OperationException, ApplicationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + + Properties ctx = TmkJSPEnv.getCtx(request); + DefaultForm df= (DefaultForm) form; + + ReportBean bean = (ReportBean) df.getBean(); + Timestamp fromDate = ReportDateManager.getFromDate(bean); + Timestamp toDate = ReportDateManager.getToDate(bean); + String timeperiod = bean.getTimePeriod(); + String chartType = bean.getChartType(); + String salesGroup = bean.getSalesGroup(); + + String reportDir = ReportManager.getReportDirectoryFromServletContext(this.servlet); + String filename = RandomStringGenerator.randomstring(); + + String subtitle = null; + String title = null; + + if(timeperiod!=null) + { + subtitle = "For " + timeperiod; + } + else + { + subtitle = "For period:"+fromDate+" to "+toDate; + } + + + if(salesGroup.equalsIgnoreCase(Constants.REVENUE_RECOGNITION)||salesGroup.equalsIgnoreCase(Constants.ATTRIBUTESET)) + { + title = "Sales By " + salesGroup; + } + else + { + String[] s = salesGroup.split("_"); + + if(s.length!=2) + { + throw new OperationException("Cannot generate sql. Unknown salesGroup parameter:"+salesGroup); + } + + int attributeSetId = Integer.parseInt(s[0]); + int attributeId = Integer.parseInt(s[1]); + + String attributeSetName = null; + String attributeName = null; + + attributeSetName = MAttributeSet.get(ctx,attributeSetId).getName(); + attributeName = new MAttribute(ctx,attributeId,null).getName(); + + title = "Sales By " + attributeName + " For " + attributeSetName; + } + + + if(chartType.equals(PieChart.CHART_TYPE)) + { + //draw pie chart + String pieChartSQL = SalesAnalysisReportManager.getPieChartDataSetSQL(ctx,Integer.valueOf(1),fromDate,toDate,salesGroup); + PieChart pieChart = new PieChart(); + + pieChart.setTitle(title); + pieChart.setSubtitle(subtitle); + pieChart.getDataSetFromSQL(pieChartSQL); + pieChart.getChart().setBackgroundPaint(Color.white); + pieChart.saveChartAsJPEG(reportDir+filename+".jpg",700,600); + } + else if(chartType.equals(TimeSeriesChart.CHART_TYPE)) + { + //draw timeseries + String timeSeriesChartSQL = SalesAnalysisReportManager.getTimeSeriesDataSetSQL(ctx,Integer.valueOf(1),fromDate,toDate,salesGroup); + TimeSeriesChart timeSeriesChart = new TimeSeriesChart(); + + timeSeriesChart.setTitle(title); + timeSeriesChart.setSubtitle(subtitle); + timeSeriesChart.setShowShapes(true); + timeSeriesChart.getDataSetFromSQL(timeSeriesChartSQL); + + + XYPlot plot = (XYPlot) timeSeriesChart.getChart().getPlot(); + DateAxis axis = (DateAxis) plot.getDomainAxis(); + + axis.setRange(fromDate, toDate); + //axis.setTickUnit(new DateTickUnit(DateTickUnit.MONTH,1,new SimpleDateFormat("MMM-yyyy"))); + + timeSeriesChart.getChart().setBackgroundPaint(Color.white); + timeSeriesChart.saveChartAsJPEG(reportDir+filename+".jpg",700,600); + } + else + { + throw new OperationException("Invalid Chart type:" + chartType); + } + + String imgURL = request.getContextPath() + "/config/reports/"+filename+".jpg"; + request.getSession().setAttribute(Constants.REPORT_URL,imgURL); + + return mapping.findForward(GET_CUSTOM_REPORT); + //return getGroupedSalesReport(mapping,form,request,response); + } + + public static final String INIT_CUSTOM_REPORT = "initCustomReport"; + public ActionForward initCustomReport(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws OperationException, ApplicationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + SalesReportForm salesReportForm = (SalesReportForm) form; + ReportBean reportBean = (ReportBean) salesReportForm.getBean(); + + salesReportForm.setChartType(PieChart.CHART_TYPE); + reportBean.setChartType(PieChart.CHART_TYPE); + + boolean error = false; + + if((salesReportForm.getFromDate()==null)||(salesReportForm.getFromDate()=="")) + { + postGlobalError("error.required.startDate",request); + error = true; + } + + if((salesReportForm.getToDate()==null)||(salesReportForm.getToDate()=="")) + { + postGlobalError("error.required.endDate",request); + error = true; + } + + if(error) + { + return mapping.getInputForward(); + } + + SessionStorage.putSalesGroupFilter(ctx,request,reportBean); + + return mapping.findForward(INIT_CUSTOM_REPORT); + } + + public static final String INIT_CUSTOM_SALES_REPORT = "initCustomSalesReport"; + public ActionForward initCustomSalesReport(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws OperationException, ApplicationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + SalesReportForm reportForm = (SalesReportForm) form; + ReportBean reportBean = (ReportBean) reportForm.getBean(); + + if(reportBean.getFromDate()==null) + { + String timeperiod = reportBean.getTimePeriod(); + if(timeperiod==null) + { + throw new OperationException("No period parameter found!"); + } + + Date startDate = ReportDateManager.getStartDateForPeriod(timeperiod); + Date endDate = ReportDateManager.getEndDateForPeriod(timeperiod); + + SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); + String fromDate = sdf.format(startDate); + String toDate = sdf.format(endDate); + + reportForm.setFromDate(fromDate); + reportForm.setToDate(toDate); + reportForm.setStartHour("0"); + reportForm.setStartMinute("0"); + reportForm.setChartType(PieChart.CHART_TYPE); + + reportBean.setFromDate(fromDate); + reportBean.setToDate(toDate); + reportBean.setStartHour("0"); + reportBean.setStartMinute("0"); + reportBean.setChartType(PieChart.CHART_TYPE); + + Calendar cal = Calendar.getInstance(); + + reportForm.setToDate(toDate); + reportForm.setEndHour(cal.get(Calendar.HOUR_OF_DAY)+""); + reportForm.setEndMinute(cal.get(Calendar.MINUTE)+""); + + reportBean.setToDate(toDate); + reportBean.setEndHour(cal.get(Calendar.HOUR_OF_DAY)+""); + reportBean.setEndMinute(cal.get(Calendar.MINUTE)+""); + + SessionStorage.putSalesGroupFilter(ctx,request,reportBean); + + } + + return mapping.findForward(INIT_CUSTOM_SALES_REPORT); + } + + public static final String SALES_BY_ATTRIBUTESET = "salesByAttributeSet"; + public static final String SALES_BY_REVENUE_RECOGNITION = "salesByRevenueRecognition"; + + public static final String GET_GROUPED_SALES_REPORT = "getGroupedSalesReport"; + public ActionForward getGroupedSalesReport(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws OperationException, ApplicationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + SalesReportForm reportForm = (SalesReportForm) form; + ReportBean reportBean = (ReportBean) reportForm.getBean(); + + String salesGroup = reportBean.getSalesGroup(); + + if(salesGroup.equalsIgnoreCase(Constants.REVENUE_RECOGNITION)) + { + return mapping.findForward(SALES_BY_REVENUE_RECOGNITION); + } + else if(salesGroup.equalsIgnoreCase(Constants.ATTRIBUTESET)) + { + return mapping.findForward(SALES_BY_ATTRIBUTESET); + } + else + { + throw new OperationException("Invalid Sales Grouping: "+ salesGroup); + } + + } + + +} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/POSStockAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/POSStockAction.java new file mode 100644 index 0000000000..dd609b9343 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/pos/POSStockAction.java @@ -0,0 +1,155 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Created on May 8, 2006 + */ + + +package org.posterita.struts.pos; + +import java.util.ArrayList; +import java.util.Properties; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; + +import org.posterita.Constants; +import org.posterita.beans.AttributeBean; +import org.posterita.businesslogic.POSStockManager; +import org.posterita.core.TmkJSPEnv; +import org.posterita.exceptions.ApplicationException; +import org.posterita.exceptions.OperationException; +import org.posterita.struts.core.BaseDispatchAction; +import org.posterita.struts.core.DefaultForm; + + +public class POSStockAction extends BaseDispatchAction +{ + public static final String initPOSStock="initPOSStock"; + public ActionForward initPOSStock(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx =TmkJSPEnv.getCtx(request); + + request.getSession().removeAttribute(Constants.PRODUCTS); + ArrayList list=POSStockManager.getAllAttributeSet(ctx); + request.getSession().setAttribute(Constants.PRODUCT_ATTRIBUTE_SET,list); + + return mapping.findForward(GET_POS_STOCK); + + } + + public static final String GET_POS_STOCK="getPOSStock"; + public ActionForward getPOSStock(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx =TmkJSPEnv.getCtx(request); + + request.removeAttribute(Constants.PRODUCTS); + ArrayList list=POSStockManager.getAllAttributeSet(ctx); + request.getSession().setAttribute(Constants.PRODUCT_ATTRIBUTE_SET,list); + + ArrayList list2=POSStockManager.getStockFromSearch(ctx, null, null, null); + request.getSession().setAttribute(Constants.PRODUCTS,list2); + + return mapping.findForward(GET_POS_STOCK); + + + } + + public static final String GET_STOCK="getStock"; + public ActionForward getStock(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx =TmkJSPEnv.getCtx(request); + DefaultForm df = (DefaultForm)form; + AttributeBean bean = (AttributeBean) df.getBean(); + ArrayList list=POSStockManager.getAllAttributeFromAttributeSet(ctx,bean); + request.getSession().setAttribute(Constants.ATTRIBUTE_SET_ID,bean.getAttributeSetId()); + request.getSession().setAttribute(Constants.PRODUCT_ATTRIBUTE_LIST,list); + request.removeAttribute(Constants.PRODUCTS); + ArrayList productList=POSStockManager.getAllProducts(ctx, bean.getAttributeSetId()); + request.getSession().setAttribute(Constants.PRODUCTS,productList); + + return mapping.findForward(GET_STOCK); + } + + + public static final String GET_PRODUCTS="getProducts"; + public ActionForward getProducts(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Integer attributeSetId=(Integer)request.getSession().getAttribute(Constants.ATTRIBUTE_SET_ID); + Properties ctx =TmkJSPEnv.getCtx(request); + DefaultForm df = (DefaultForm)form; + AttributeBean bean = (AttributeBean) df.getBean(); + ArrayList list=POSStockManager.getProducts(ctx,bean); + request.setAttribute(Constants.PRODUCTS,list); + + bean.setAttributeSetId(attributeSetId); + + ArrayList attriList=POSStockManager.getAllAttributeFromAttributeSet(ctx,bean); + request.getSession().setAttribute(Constants.PRODUCT_ATTRIBUTE_LIST,attriList); + + return mapping.findForward(GET_PRODUCTS); + } + + + public static final String GET_STOCK_FROM_SEARCH="getStockFromSearch"; + public ActionForward getStockFromSearch(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + if (isDisplayTagAction(request)) + { + return mapping.findForward(GET_STOCK_FROM_SEARCH); + } + + Properties ctx =TmkJSPEnv.getCtx(request); + DefaultForm df = (DefaultForm)form; + + String filter=null; + if(df.getQtyFilter()!=null && df.getQtyFilter().length()!=0) + filter=df.getQtyFilter(); + + ArrayList list = POSStockManager.getStockFromSearch(ctx,df.getProductName(),df.getBarCode(),filter); + request.getSession().setAttribute(Constants.PRODUCTS,list); + + return mapping.findForward(GET_STOCK_FROM_SEARCH); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/POSUserAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/POSUserAction.java new file mode 100644 index 0000000000..2e6441cf8b --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/pos/POSUserAction.java @@ -0,0 +1,293 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Aug 29, 2005 by praveen + * + */ +package org.posterita.struts.pos; + +import java.util.ArrayList; +import java.util.Properties; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.compiere.model.MCountry; +import org.compiere.util.Trx; + +import org.posterita.Constants; +import org.posterita.beans.UserBean; +import org.posterita.businesslogic.administration.RoleManager; +import org.posterita.businesslogic.administration.UserManager; +import org.posterita.core.TmkJSPEnv; +import org.posterita.core.TrxPrefix; +import org.posterita.exceptions.ApplicationException; +import org.posterita.exceptions.DuplicateUserPinException; +import org.posterita.exceptions.NoAccessToEditObjectException; +import org.posterita.exceptions.OperationException; +import org.posterita.exceptions.UserAlreadyExistsException; +import org.posterita.form.UserForm; +import org.posterita.keyname.RegionKeyNamePair; +import org.posterita.struts.core.DefaultForm; + +public class POSUserAction extends POSDispatchAction +{ + + public static final String CREATE_USER = "createUser"; + public ActionForward createUser(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd = init(mapping,form,request,response); + + if (fwd!=null) + return fwd; + + DefaultForm df = (DefaultForm) form; + + UserBean bean = (UserBean) df.getBean(); + + Properties ctx = TmkJSPEnv.getCtx(request); + + Trx trx = Trx.get(TrxPrefix.getPrefix(), true); + + try + { + trx.start(); + MCountry country = MCountry.getDefault(ctx); + UserManager.createUser(ctx, bean.getOrgId(), bean.getUsername(),bean.getUsername(), bean.getIsSalesRep().booleanValue(),bean.getAddress1(),bean.getPostalAddress(),bean.getCity(),bean.getPassword(),bean.getEmail(),bean.getIsActive().booleanValue(),bean.getPhone(),0, bean.getRoleId().intValue(), country.get_ID(),bean.getUserPIN(),bean.getUserDiscount(),bean.getDocBasisType(),bean.getAmtMultiplier(),bean.getFrequencyType(),bean.getSubtractAmt(),bean.getIsFullAccess(),trx.getTrxName()); + trx.commit(); + } + catch(DuplicateUserPinException e) + { + trx.rollback(); + postGlobalError("error.duplicate.userpin", request); + return mapping.getInputForward(); + } + catch(UserAlreadyExistsException e) + { + trx.rollback(); + postGlobalError("error.usernameAlreadyUsed", request); + return mapping.getInputForward(); + } + finally + { + trx.close(); + } + + return mapping.findForward(CREATE_USER); + } + + public static final String EDIT_USER = "editUser"; + public ActionForward editUser(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException + { + ActionForward fwd = init(mapping,form,request,response); + + if (fwd!=null) + return fwd; + + DefaultForm df = (DefaultForm) form; + + UserBean bean = (UserBean) df.getBean(); + + Properties ctx = TmkJSPEnv.getCtx(request); + + Trx trx = Trx.get(TrxPrefix.getPrefix(), true); + + try + { + trx.start(); + UserManager.editUser(ctx, bean.getOrgId(), bean.getUserId().intValue(),bean.getRoleId().intValue(),bean.getPassword(),bean.getEmail(),bean.getPhone(),bean.getAddress1(),bean.getPostalAddress(),bean.getCity(),bean.getIsSalesRep().booleanValue(),bean.getIsActive().booleanValue(),bean.getUserPIN(),bean.getUserDiscount(),bean.getDocBasisType(),bean.getAmtMultiplier(),bean.getFrequencyType(),bean.getSubtractAmt(),bean.getIsFullAccess(),trx.getTrxName()); + trx.commit(); + } + catch(DuplicateUserPinException e) + { + trx.rollback(); + postGlobalError("error.duplicate.userpin", request); + return mapping.getInputForward(); + } + catch(NoAccessToEditObjectException e) + { + trx.rollback(); + postGlobalError("error.no.edit.access", request); + return mapping.getInputForward(); + } + catch (OperationException e) + { + trx.rollback(); + postGlobalError("error.editing.user", request); + mapping.getInputForward(); + } + finally + { + trx.close(); + } + + return mapping.findForward(EDIT_USER); + } + + public static final String DELETE_USER = "deleteUser"; + @SuppressWarnings("unchecked") + public ActionForward deleteUser(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd = init(mapping,form,request,response); + + if (fwd!=null) + return fwd; + + UserForm uf = (UserForm) form; + + Properties ctx = TmkJSPEnv.getCtx(request); + + int userId = Integer.valueOf(uf.getUserId()).intValue(); + + UserManager.deleteUser(ctx,userId); + + ArrayList list = (ArrayList) request.getSession().getAttribute(Constants.ALL_USERS); + + ArrayList newList = UserManager.updateUserListStatus(list, userId, false); + + request.getSession().setAttribute(Constants.ALL_USERS,newList); + + return mapping.findForward(DELETE_USER); + } + + public static final String ACTIVATE_USER = "activateUser"; + @SuppressWarnings("unchecked") + public ActionForward activateUser(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd = init(mapping,form,request,response); + + if (fwd!=null) + return fwd; + + UserForm uf = (UserForm) form; + + Properties ctx = TmkJSPEnv.getCtx(request); + + int userId = Integer.valueOf(uf.getUserId()).intValue(); + + UserManager.activateUser(ctx,userId); + + ArrayList list = (ArrayList) request.getSession().getAttribute(Constants.ALL_USERS); + + ArrayList newList = UserManager.updateUserListStatus(list, userId, true); + + request.getSession().setAttribute(Constants.ALL_USERS,newList); + + return mapping.findForward(ACTIVATE_USER); + } + + public static final String INIT_CREATE_USER = "initCreateUser"; + public ActionForward initCreateUser(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd = init(mapping,form,request,response); + + if (fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + ArrayList roles = RoleManager.getAllRoles(ctx); + + ArrayList regions = RegionKeyNamePair.getKeyNamePairs(ctx); + + request.getSession().setAttribute(Constants.ROLES,roles); + + request.getSession().setAttribute(Constants.REGIONS,regions); + + return mapping.findForward(INIT_CREATE_USER); + } + + public static final String INIT_EDIT_USER = "initEditUser"; + public ActionForward initEditUser(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd = init(mapping,form,request,response); + + if (fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + UserForm uf = (UserForm) form; + + int userId = Integer.valueOf(uf.getUserId()).intValue(); + + UserBean bean = UserManager.getUser(ctx,userId); + + uf.populate(bean); + + ArrayList roles = RoleManager.getAllRoles(ctx); + + request.getSession().setAttribute(Constants.ROLES,roles); + + request.getSession().setAttribute(Constants.USER_DETAILS,bean); + + return mapping.findForward(INIT_EDIT_USER); + } + + public static final String LIST_USERS = "listUsers"; + public ActionForward listUsers(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd = init(mapping,form,request,response); + + if (fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + DefaultForm df = (DefaultForm) form; + + ArrayList users = new ArrayList(); + + if (df.getFirst() != null && df.getFirst().equals("1")) + { + request.getSession().setAttribute(Constants.ALL_USERS,users); + return mapping.findForward(LIST_USERS); + } + else + users = UserManager.getUsers(ctx, df.getName()); + + request.getSession().setAttribute(Constants.ALL_USERS,users); + + return mapping.findForward(LIST_USERS); + } + + public static final String VIEW_USER = "viewUser"; + public ActionForward viewUser(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd = init(mapping,form,request,response); + + if (fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + UserForm uf = (UserForm) form; + + int userId = Integer.valueOf(uf.getUserId()).intValue(); + + UserBean userBean = UserManager.getUser(ctx,userId); + + request.getSession().setAttribute(Constants.USER_DETAILS,userBean); + + return mapping.findForward(VIEW_USER); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/PartialPOSOrderAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/PartialPOSOrderAction.java new file mode 100644 index 0000000000..57bf7e06ef --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/pos/PartialPOSOrderAction.java @@ -0,0 +1,763 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * */ + + +package org.posterita.struts.pos; + +import java.util.ArrayList; +import java.util.Properties; +import java.math.BigDecimal; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.compiere.model.MOrder; +import org.compiere.util.Env; +import org.compiere.util.Trx; + +import org.posterita.Constants; +import org.posterita.beans.ItemBean; +import org.posterita.beans.OrderLineBean; +import org.posterita.beans.ShoppingCartBean; +import org.posterita.beans.WebDocumentBean; +import org.posterita.businesslogic.OrderReferenceManager; +import org.posterita.businesslogic.OrderManager; +import org.posterita.businesslogic.POSTerminalManager; +import org.posterita.businesslogic.PartialPOSManager; +import org.posterita.businesslogic.administration.BPartnerManager; +import org.posterita.businesslogic.administration.RoleManager; +import org.posterita.businesslogic.administration.UserManager; +import org.posterita.businesslogic.stock.StockManager; +import org.posterita.core.SessionStorage; +import org.posterita.core.TmkJSPEnv; +import org.posterita.core.TrxPrefix; +import org.posterita.exceptions.ApplicationException; +import org.posterita.exceptions.BPartnerNoLocationException; +import org.posterita.exceptions.BPartnerOverCreditLimitException; +import org.posterita.exceptions.DiscountLimitException; +import org.posterita.exceptions.InputQuantityLessThanZeroException; +import org.posterita.exceptions.InsufficientQtyException; +import org.posterita.exceptions.InvalidInvokeOrderStatusException; +import org.posterita.exceptions.InvalidOrderIDException; +import org.posterita.exceptions.InvalidOrderTypeException; +import org.posterita.exceptions.InvalidTenderedAmountException; +import org.posterita.exceptions.NoOrderLineFoundException; +import org.posterita.exceptions.NoOrderLineSelectedException; +import org.posterita.exceptions.OperationException; +import org.posterita.exceptions.ProductNotFoundException; +import org.posterita.exceptions.ProductNotOnPriceListException; +import org.posterita.exceptions.QuantityNotAvailableException; +import org.posterita.exceptions.UOMValuePrecisionNotValidException; +import org.posterita.form.InvokeOrderForm; +import org.posterita.lib.UdiConstants; +import org.posterita.struts.core.DefaultForm; + + +public class PartialPOSOrderAction extends POSDispatchAction +{ + public static final String CREATE_POS_ORDER="createPOSOrder"; + public ActionForward createPOSOrder(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException, DiscountLimitException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx=TmkJSPEnv.getCtx(request); + DefaultForm df= (DefaultForm) form; + OrderLineBean bean=(OrderLineBean) df.getBean(); + + //validate payment type + + + ShoppingCartBean cartBean = (ShoppingCartBean) request.getSession().getAttribute(Constants.PARTIAL_ORDER_SHOPPING_CART); + + if(cartBean==null ||cartBean.getItems() == null||cartBean.getItems().size()==0) + { + postGlobalError("error.pos.shoppingcart.empty",request); + return mapping.getInputForward(); + } + + MOrder posOrder = null; + + Integer bPartnerId = bean.getBpartnerId(); + + if(bPartnerId==null) + bPartnerId = (Integer) request.getSession().getAttribute(Constants.BPARTNER); + + if(bPartnerId==null) + { + bPartnerId=Integer.valueOf(POSTerminalManager.getCashBPartner(ctx).get_ID()); + } + else + { + boolean isBPartnerPresent = BPartnerManager.isBPartnerPresent(ctx,bPartnerId.intValue(),null); + + if( !isBPartnerPresent ) + { + postGlobalError("error.pos.invalid.customerID",request); + return mapping.getInputForward(); + } + } + + request.getSession().setAttribute(Constants.BPARTNER, bPartnerId); + + bean.setBpartnerId(bPartnerId); + + Trx trx = Trx.get(TrxPrefix.getPrefix(),true); + + try + { + trx.start(); + posOrder= PartialPOSManager.createPOSOrder(ctx,bean,cartBean.getItems(),null/*trx.getTrxName()*/); + trx.commit(); + } + catch(BPartnerOverCreditLimitException e1) + { + trx.rollback(); + postGlobalError("error.bpartner.over.credit.limit",e1.getMessage(),request); + return mapping.getInputForward(); + } + catch(BPartnerNoLocationException ex) + { + trx.rollback(); + postGlobalError("error.bpartner.nolocation", request); + return mapping.getInputForward(); + } + catch(InvalidTenderedAmountException e) + { + trx.rollback(); + postGlobalError("error.pos.incorrect.tendered.amount",request); + return mapping.getInputForward(); + } + catch(InsufficientQtyException e3) + { + trx.rollback(); + postGlobalError("error.insufficient.qty",e3.getMessage(),request); + return mapping.getInputForward(); + } + finally + { + trx.close(); + } + + bean.setOrderId(Integer.valueOf(posOrder.get_ID())); + + df.populate(new OrderLineBean()); + WebDocumentBean webBean = OrderReferenceManager.getWebOrderBean(ctx, posOrder); + if(posOrder.getPaymentRule().equals(UdiConstants.PAYMENTRULE_MIXED)) + { + if(bean.getPaymentByCash()!=null) + webBean.setPaymentByCash(bean.getPaymentByCash()); + if(bean.getPaymentByCard()!=null) + webBean.setPaymentByCard(bean.getPaymentByCard()); + if(bean.getPaymentByChq()!=null) + webBean.setPaymentbyCheque(bean.getPaymentByChq()); + } + + + ArrayList list = PartialPOSManager.populateOrderLines(ctx,posOrder); + WebDocumentBean documentBean=PartialPOSManager.calculateOrderTotals(list); + request.getSession().setAttribute(Constants.CURRENT_PARTIAL_POS_ORDER_ID,posOrder.get_ID()); + request.getSession().setAttribute(Constants.ORDER_LINE_BEAN,bean); + request.setAttribute(Constants.PARTIAL_POS_ORDER_LINES,list); + /*request.removeAttribute(Constants.POS_ORDER_LINES);*/ + + SessionStorage.putCompleteOrderInfo(ctx,request,webBean,documentBean); + + return mapping.findForward(CREATE_POS_ORDER); + + + + } + + public static final String COMPLETE_POS_ORDER="completePOSOrder"; + public ActionForward completePOSOrder(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx=TmkJSPEnv.getCtx(request); + DefaultForm df= (DefaultForm) form; + + OrderLineBean bean=(OrderLineBean) request.getSession().getAttribute(Constants.ORDER_LINE_BEAN); + Integer orderId = (Integer)request.getSession().getAttribute(Constants.CURRENT_PARTIAL_POS_ORDER_ID); + MOrder completedPOSOrder=null; + + Trx trx = Trx.get(TrxPrefix.getPrefix(),true); + + try + { + trx.start(); + completedPOSOrder=PartialPOSManager.completePOSOrder(ctx,orderId.intValue(),bean,trx.getTrxName()); + trx.commit(); + } + catch(NoOrderLineFoundException e) + { + trx.rollback(); + postGlobalError("error.pos.no.orderline",request); + request.getSession().removeAttribute(Constants.PARTIAL_ORDER_SHOPPING_CART); + request.getSession().removeAttribute(Constants.PARTIAL_ORDER_SHOPPING_CART_ITEMS); + + return mapping.getInputForward(); + } + catch(OperationException e) + { + trx.rollback(); + throw e; + } + finally + { + trx.close(); + } + + + df.populate(new OrderLineBean()); + WebDocumentBean webBean = OrderReferenceManager.getWebOrderBean(ctx, completedPOSOrder); + + if(completedPOSOrder.getPaymentRule().equals(UdiConstants.PAYMENTRULE_MIXED)) + { + PartialPOSManager.getAmountForMixedPayment(ctx,completedPOSOrder,webBean); + } + + ArrayList list = PartialPOSManager.populateOrderLines(ctx,completedPOSOrder); + WebDocumentBean documentBean=PartialPOSManager.calculateOrderTotals(list); + request.setAttribute(Constants.POS_ORDER_LINES,list); + + /*request.removeAttribute(Constants.POS_ORDER_LINES);*/ + request.getSession().removeAttribute(Constants.BPARTNER); + request.getSession().removeAttribute(Constants.ALL_CUSTOMERS); + request.getSession().removeAttribute(Constants.PARTIAL_ORDER_SHOPPING_CART); + request.getSession().removeAttribute(Constants.PARTIAL_ORDER_SHOPPING_CART_ITEMS); + request.getSession().removeAttribute(Constants.CURRENT_PARTIAL_POS_ORDER_ID); + request.setAttribute(Constants.ORDER_NAME,"POS ORDER"); + SessionStorage.putCompleteOrderInfo(ctx,request,webBean,documentBean); + + return mapping.findForward(COMPLETE_POS_ORDER); + } + + + public static final String GET_POS_PAYMENT_DETAILS="getPOSPaymentDetails"; + public ActionForward getPOSPaymentDetails(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + // Properties ctx=TmkJSPEnv.getCtx(request); + DefaultForm df= (DefaultForm) form; + OrderLineBean bean=(OrderLineBean) df.getBean(); + df.populate(new OrderLineBean()); + request.getSession().setAttribute(Constants.BPARTNER, bean.getBpartnerId()); + ShoppingCartBean cartBean = (ShoppingCartBean) request.getSession().getAttribute(Constants.PARTIAL_ORDER_SHOPPING_CART); + + if(cartBean==null ||cartBean.getItems() == null||cartBean.getItems().size()==0) + { + postGlobalError("error.pos.shoppingcart.empty",request); + return mapping.getInputForward(); + } + + request.getSession().setAttribute(Constants.PARTIAL_ORDER_SHOPPING_CART, cartBean); + request.getSession().setAttribute(Constants.PARTIAL_ORDER_SHOPPING_CART_ITEMS, cartBean.getItems()); + return mapping.findForward(GET_POS_PAYMENT_DETAILS); + + + } + + public static final String DELETE_POS_ORDERLINE = "deletePOSOrderLine"; + public ActionForward deletePOSOrderLine(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx=TmkJSPEnv.getCtx(request); + DefaultForm df= (DefaultForm) form; + OrderLineBean bean=(OrderLineBean) df.getBean(); + + String forward = DELETE_POS_ORDERLINE; + + Trx trx = Trx.get(TrxPrefix.getPrefix(),true); + + try + { + trx.start(); + forward = PartialPOSManager.deleteOrderLines(ctx,bean.getPosOrderLineIds(),trx.getTrxName()); + trx.commit(); + } + catch (NoOrderLineSelectedException e) + { + trx.rollback(); + SessionStorage.putPOSOrderInfo(ctx,bean,request,forward); + + postGlobalError("error.order.noOrderline.selected",request); + return mapping.getInputForward(); + } + catch (OperationException e) + { + trx.rollback(); + throw e; + } + finally + { + trx.close(); + } + + Integer orderId = (Integer)request.getSession().getAttribute(Constants.CURRENT_PARTIAL_POS_ORDER_ID); + //validating order + //if lines == 0 goto createpartialOrder + + if(OrderManager.isOrderEmpty(ctx,orderId.intValue(),null)) + { + request.getSession().removeAttribute(Constants.ALL_CUSTOMERS); + request.getSession().removeAttribute(Constants.PARTIAL_ORDER_SHOPPING_CART); + request.getSession().removeAttribute(Constants.PARTIAL_ORDER_SHOPPING_CART_ITEMS); + return new ActionForward("/CreatePartialPOSOrder.do"); + } + + //reload shopping cart + ShoppingCartBean cart = PartialPOSManager.getShoppingCartForOrder(ctx,orderId.intValue(),null); + request.getSession().setAttribute(Constants.PARTIAL_ORDER_SHOPPING_CART,cart); + request.getSession().setAttribute(Constants.PARTIAL_ORDER_SHOPPING_CART_ITEMS,cart.getItems()); + + + + SessionStorage.putPOSOrderInfo(ctx,bean,request,forward); + df.populate(new OrderLineBean()); + + return mapping.findForward(DELETE_POS_ORDERLINE); + } + + + public static final String ADD_TO_SHOPPING_CART = "addToShoppingCart"; + public ActionForward addToShoppingCart(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException + { + Properties ctx = TmkJSPEnv.getCtx(request); + DefaultForm df = (DefaultForm) form; + OrderLineBean bean = (OrderLineBean) df.getBean(); + ShoppingCartBean cartBean = (ShoppingCartBean) request.getSession().getAttribute(Constants.PARTIAL_ORDER_SHOPPING_CART); + + + try + { + // PartialPOSManager.getQtyAndItem(bean); + if(bean.getProductId()==null && bean.getBarCode()==null) + { + postGlobalError("error.barcode.required", request); + return mapping.getInputForward(); + } + + cartBean = StockManager.addToPOSCart(ctx, bean, cartBean,true,Boolean.parseBoolean(bean.getIfAdd())); + } + catch (InputQuantityLessThanZeroException e1) + { + postGlobalError("error.invalid.inputQty", request); + return mapping.getInputForward(); + } + catch (ProductNotFoundException e2) + { + postGlobalError("error.product.not.found", e2.getMessage(), request); + return mapping.getInputForward(); + } + catch(QuantityNotAvailableException e3) + { + postGlobalError("error.quantity.notAvailable", e3.getMessage(), request); + return mapping.getInputForward(); + } + + catch(ProductNotOnPriceListException e4) + { + postGlobalError("error.product.price.not.found", e4.getMessage(), request); + return mapping.getInputForward(); + } + + catch (UOMValuePrecisionNotValidException e) + { + postGlobalError("error.precision", e.getMessage(), request); + return mapping.getInputForward(); + } + + request.getSession().setAttribute(Constants.PARTIAL_ORDER_SHOPPING_CART, cartBean); + request.getSession().setAttribute(Constants.PARTIAL_ORDER_SHOPPING_CART_ITEMS, cartBean.getItems()); + + df.setQtyAndItem(""); + + return mapping.findForward(ADD_TO_SHOPPING_CART); + } + + + + public static final String COMPLETE_PARTIAL_POS_ORDER="completePartialPOSOrder"; + public ActionForward completePartialPOSOrder(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx=TmkJSPEnv.getCtx(request); + DefaultForm df= (DefaultForm) form; + + Integer orderId = (Integer)request.getSession().getAttribute(Constants.CURRENT_PARTIAL_POS_ORDER_ID); + + //MOrder posOrder=(MOrder) request.getSession().getAttribute(Constants.CURRENT_POS_ORDER); + //MOrder completedPOSOrder=null; + //boolean error = false; + + if (orderId == null) + { + return mapping.getInputForward(); + } + if(OrderManager.isOrderEmpty(ctx,orderId.intValue(),null)) + { + postGlobalError("error.pos.no.orderline",request); + request.getSession().removeAttribute(Constants.PARTIAL_ORDER_SHOPPING_CART); + request.getSession().removeAttribute(Constants.PARTIAL_ORDER_SHOPPING_CART_ITEMS); + return mapping.getInputForward(); + } + + //completedPOSOrder=PartialPOSManager.completePOSOrder(ctx,posOrder,bean); + MOrder completedPOSOrder = OrderManager.prepareOrder(ctx,orderId.intValue(),null); + + df.populate(new OrderLineBean()); + WebDocumentBean webBean = OrderReferenceManager.getWebOrderBean(ctx, completedPOSOrder); + + if(completedPOSOrder.getPaymentRule().equals(UdiConstants.PAYMENTRULE_MIXED)) + { + PartialPOSManager.getAmountForMixedPayment(ctx,completedPOSOrder,webBean); + } + + ArrayList list = PartialPOSManager.populateOrderLines(ctx,completedPOSOrder); + WebDocumentBean documentBean=PartialPOSManager.calculateOrderTotals(list); + request.getSession().setAttribute(Constants.CURRENT_PARTIAL_POS_ORDER_ID,orderId); + request.setAttribute(Constants.POS_ORDER_LINES,list); + + /*request.removeAttribute(Constants.POS_ORDER_LINES);*/ + request.getSession().removeAttribute(Constants.BPARTNER); + request.getSession().removeAttribute(Constants.ALL_CUSTOMERS); + request.getSession().removeAttribute(Constants.PARTIAL_ORDER_SHOPPING_CART); + request.getSession().removeAttribute(Constants.PARTIAL_ORDER_SHOPPING_CART_ITEMS); + request.getSession().removeAttribute(Constants.CURRENT_PARTIAL_POS_ORDER_ID); + SessionStorage.putCompleteOrderInfo(ctx,request,webBean,documentBean); + request.setAttribute(Constants.ORDER_NAME,"POS ORDER"); + + return mapping.findForward(COMPLETE_PARTIAL_POS_ORDER); + } + + + public static final String INVOKE_PARTIAL_ORDER = "invokePartialOrder"; + public ActionForward invokePartialOrder(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx=TmkJSPEnv.getCtx(request); + InvokeOrderForm f = (InvokeOrderForm) form; + OrderLineBean bean = (OrderLineBean) f.getBean(); + + String documentNo = bean.getDocumentNo(); + + MOrder order = null; + + Trx trx = Trx.get(TrxPrefix.getPrefix(),true); + + try + { + trx.start(); + order = PartialPOSManager.invokePartialOrder(ctx,documentNo,trx.getTrxName()); + trx.commit(); + } + catch (InvalidOrderIDException e) + { + trx.rollback(); + postGlobalError("error.invalid.orderId",request); + return mapping.getInputForward(); + } + catch (InvalidOrderTypeException e) + { + trx.rollback(); + postGlobalError("error.invalid.orderType",request); + return mapping.getInputForward(); + } + catch (NoOrderLineFoundException e) + { + trx.rollback(); + postGlobalError("error.pos.invoke.no.orderline",request); + return mapping.getInputForward(); + } + catch (InvalidInvokeOrderStatusException e) + { + trx.rollback(); + postGlobalError("error.invoke.status",e.getStatus(),request); + return mapping.getInputForward(); + } + finally + { + trx.close(); + } + + int bPartnerId = order.getC_BPartner_ID(); + ShoppingCartBean cart = PartialPOSManager.getShoppingCartForOrder(ctx,order.get_ID(),null); + ArrayList cartItems = cart.getItems(); + + BigDecimal discountAllowed = RoleManager.getDiscountAllowed(ctx, Env.getAD_Role_ID(ctx),null); + + //putting cart & other info in session + request.getSession().setAttribute(Constants.BPARTNER, Integer.valueOf(bPartnerId)); + request.getSession().setAttribute(Constants.PARTIAL_ORDER_SHOPPING_CART, cart); + request.getSession().setAttribute(Constants.PARTIAL_ORDER_SHOPPING_CART_ITEMS, cartItems); + request.getSession().setAttribute(Constants.CURRENT_PARTIAL_POS_ORDER_ID,Integer.valueOf(order.get_ID())); + request.getSession().setAttribute(Constants.DISCOUNT_ALLOWED, discountAllowed); + + return mapping.findForward(INVOKE_PARTIAL_ORDER); + + } + + public static final String SET_POS_PAYMENT_DETAILS = "setPOSPaymentDetails"; + public ActionForward setPOSPaymentDetails(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + //mapping.setInput("/GetPartialPOSPaymentDetails.do"); + + Properties ctx=TmkJSPEnv.getCtx(request); + DefaultForm df= (DefaultForm) form; + OrderLineBean bean=(OrderLineBean) df.getBean(); + + ShoppingCartBean cartBean = (ShoppingCartBean) request.getSession().getAttribute(Constants.PARTIAL_ORDER_SHOPPING_CART); + + if(cartBean==null) + { + postGlobalError("error.pos.shoppingcart.empty",request); + return mapping.getInputForward(); + } + + //validate discount entered + String[] discountPercentage = df.getDiscountPercent(); + String[] actualPrice = df.getActualPrice(); + + for(String s : discountPercentage) + { + if(s == null || s == "") + { + continue; + } + + try + { + Double.parseDouble(s); + } + catch (NumberFormatException e) + { + postGlobalError("errors.double","Discount(s)",request); + return mapping.getInputForward(); + } + } + + for(String s : actualPrice) + { + if(s == null || s == "") + { + continue; + } + + try + { + Double.parseDouble(s); + } + catch (NumberFormatException e) + { + postGlobalError("errors.double","Price(s)",request); + return mapping.getInputForward(); + } + } + + Integer orderId = (Integer) request.getSession().getAttribute(Constants.CURRENT_PARTIAL_POS_ORDER_ID); + Integer bPartnerId = bean.getBpartnerId(); + + if(bPartnerId==null) + bPartnerId = (Integer) request.getSession().getAttribute(Constants.BPARTNER); + if(bPartnerId==null) + bPartnerId=Integer.valueOf(POSTerminalManager.getCashBPartner(ctx).get_ID()); + + bean.setBpartnerId(bPartnerId); + MOrder posOrder = null; + + Trx trx = Trx.get(TrxPrefix.getPrefix(), true); + + try + { + trx.start(); + posOrder= PartialPOSManager.setOrderPaymentDetails(ctx,orderId,bean,cartBean.getItems(), trx.getTrxName()); + trx.commit(); + } + catch(InvalidTenderedAmountException e) + { + trx.rollback(); + postGlobalError("error.pos.incorrect.tendered.amount",request); + return mapping.getInputForward(); + } + catch (OperationException e) + { + trx.rollback(); + throw e; + } + finally + { + trx.close(); + } + + bean.setOrderId(Integer.valueOf(posOrder.get_ID())); + + df.populate(new OrderLineBean()); + WebDocumentBean webBean = OrderReferenceManager.getWebOrderBean(ctx, posOrder); + if(posOrder.getPaymentRule().equals(UdiConstants.PAYMENTRULE_MIXED)) + { + if(bean.getPaymentByCash()!=null) + webBean.setPaymentByCash(bean.getPaymentByCash()); + if(bean.getPaymentByCard()!=null) + webBean.setPaymentByCard(bean.getPaymentByCard()); + if(bean.getPaymentByChq()!=null) + webBean.setPaymentbyCheque(bean.getPaymentByChq()); + } + + + ArrayList list = PartialPOSManager.populateOrderLines(ctx,posOrder); + WebDocumentBean documentBean=PartialPOSManager.calculateOrderTotals(list); + //TODO put id only + request.getSession().setAttribute(Constants.CURRENT_POS_ORDER_ID,Integer.valueOf(orderId)); + request.getSession().setAttribute(Constants.ORDER_LINE_BEAN,bean); + request.setAttribute(Constants.POS_ORDER_LINES,list); + request.setAttribute(Constants.PARTIAL_POS_OREDR,"partialPOSOrder"); + + SessionStorage.putCompleteOrderInfo(ctx,request,webBean,documentBean); + + + return mapping.findForward(SET_POS_PAYMENT_DETAILS); + } + + public static final String DELETE_PARTIAL_ORDER = "deletePartialOrder"; + public ActionForward deletePartialOrder(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx=TmkJSPEnv.getCtx(request); + InvokeOrderForm f = (InvokeOrderForm) form; + OrderLineBean bean = (OrderLineBean) f.getBean(); + + int orderId = bean.getOrderId().intValue(); + + Trx trx = Trx.get(TrxPrefix.getPrefix(),true); + + try + { + trx.start(); + OrderManager.deleteDraftedOrder(ctx,orderId,trx.getTrxName()); + trx.commit(); + } + catch (OperationException e) + { + trx.rollback(); + throw e; + } + finally + { + trx.close(); + } + + return mapping.findForward(DELETE_PARTIAL_ORDER); + } + + //methods called using AJAX + public static final String INCREMENT_QTY = "incrementQty"; + public ActionForward incrementQty(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException + { + addToShoppingCart(mapping,form,request,response); + return new ActionForward("/jsp/pos/partialPOSOrderShoppingCart.jsp"); + } + + public static final String DECREMENT_QTY = "decrementQty"; + public ActionForward decrementQty(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException + { + addToShoppingCart(mapping,form,request,response); + return new ActionForward("/jsp/pos/partialPOSOrderShoppingCart.jsp"); + } + + public static final String DELETE_FROM_POS_CART = "deleteFromPOSCart"; + public ActionForward deleteFromPOSCart(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException + { + Properties ctx = TmkJSPEnv.getCtx(request); + DefaultForm df = (DefaultForm) form; + OrderLineBean bean = (OrderLineBean) df.getBean(); + ArrayList items = (ArrayList) request.getSession().getAttribute(Constants.PARTIAL_ORDER_SHOPPING_CART_ITEMS); + ArrayList itemsInCart = StockManager.deleteItemFromPOSList(ctx,items, bean.getProductId(),true); + request.getSession().setAttribute(Constants.PARTIAL_ORDER_SHOPPING_CART_ITEMS, itemsInCart); + + return new ActionForward("/jsp/pos/partialPOSOrderShoppingCart.jsp"); + } + + public static final String DELETE_ORDER = "deleteOrder"; + public ActionForward deleteOrder(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException + { + Properties ctx = TmkJSPEnv.getCtx(request); + DefaultForm df = (DefaultForm) form; + OrderLineBean bean = (OrderLineBean) df.getBean(); + + int orderId = bean.getOrderId().intValue(); + + Trx trx = Trx.get(TrxPrefix.getPrefix(),true); + + try + { + trx.start(); + OrderManager.deleteDraftedOrder(ctx,orderId,trx.getTrxName()); + trx.commit(); + } + catch (OperationException e) + { + trx.rollback(); + throw e; + } + finally + { + trx.close(); + } + + //removing cart & other info in session + HttpSession session = request.getSession(); + + session.removeAttribute(Constants.BPARTNER); + session.removeAttribute(Constants.PARTIAL_ORDER_SHOPPING_CART); + session.removeAttribute(Constants.PARTIAL_ORDER_SHOPPING_CART_ITEMS); + session.removeAttribute(Constants.CURRENT_PARTIAL_POS_ORDER_ID); + + return mapping.getInputForward(); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/PaymentAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/PaymentAction.java new file mode 100644 index 0000000000..a5387dcc95 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/pos/PaymentAction.java @@ -0,0 +1,132 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * 08-Dec-2006 14:01:58 by praveen + * + */ + +package org.posterita.struts.pos; + +import java.util.Properties; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.compiere.model.MPayment; +import org.compiere.util.Trx; +import org.posterita.beans.PaymentBean; +import org.posterita.businesslogic.PaymentAllocationManager; +import org.posterita.businesslogic.PaymentManager; +import org.posterita.core.TmkJSPEnv; +import org.posterita.core.TrxPrefix; +import org.posterita.exceptions.AllocatedAmtMoreThanOpenAmtException; +import org.posterita.exceptions.ApplicationException; +import org.posterita.exceptions.BPartnerNotFoundException; +import org.posterita.exceptions.OperationException; +import org.posterita.exceptions.PayAmtNotEqualToAllocateAmtException; +import org.posterita.form.GeneralPaymentForm; +import org.posterita.form.PaymentForm; + +public class PaymentAction extends POSDispatchAction +{ + public static String CREATE_PAYMENT = "createPayment"; + public ActionForward createPayment(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd = init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + GeneralPaymentForm pf = (GeneralPaymentForm) form; + PaymentBean bean = (PaymentBean) pf.getBean(); + Trx trx = Trx.get(TrxPrefix.getPrefix(),true); + MPayment payment; + try + { + trx.start(); + payment= PaymentManager.createPayment(ctx,bean,trx.getTrxName()); + trx.commit(); + } + catch(BPartnerNotFoundException e) + { + trx.rollback(); + postGlobalError("error.required.bpartnerId",request); + return mapping.getInputForward(); + } + catch(OperationException e) + { + trx.rollback(); + return mapping.getInputForward(); + } + finally + { + trx.close(); + } + + return new ActionForward("/ViewWebstorePaymentAction.do?action=viewOrder&documentId="+payment.get_ID()); + } + + + + public static String CREATE_PAYMENT_FOR_MULTIPLE_INVOICE = "createPaymentForMultipleInvoice"; + public ActionForward createPaymentForMultipleInvoice(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd = init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + PaymentForm pf = (PaymentForm) form; + PaymentBean bean = (PaymentBean) pf.getBean(); + Trx trx = Trx.get(TrxPrefix.getPrefix(),true); + MPayment payment=null; + try + { + trx.start(); + payment= PaymentManager.createPayment(ctx,bean,trx.getTrxName()); + PaymentAllocationManager.allocatepaymentWithInvoices(ctx,bean.getInvoiceIds(),bean.getAllocateAmount(),payment.get_ID(),trx.getTrxName()); + trx.commit(); + } + catch(AllocatedAmtMoreThanOpenAmtException e1) + { + trx.rollback(); + postGlobalError("error.allocate.amt.exceeds",e1.getMessage(),request); + return mapping.getInputForward(); + } + catch(PayAmtNotEqualToAllocateAmtException e2) + { + trx.rollback(); + postGlobalError("error.allocate.amt.payamt.notequal",e2.getMessage(),request); + return mapping.getInputForward(); + } + catch(OperationException e) + { + trx.rollback(); + return mapping.getInputForward(); + } + finally + { + trx.close(); + } + + return new ActionForward("/ViewWebstorePaymentAction.do?action=viewOrder&documentId="+payment.get_ID()); + } +} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/PaymentTermAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/PaymentTermAction.java new file mode 100644 index 0000000000..aa75b82edc --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/pos/PaymentTermAction.java @@ -0,0 +1,237 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Oct 31, 2006 + */ + + +package org.posterita.struts.pos; + +import java.util.ArrayList; +import java.util.Properties; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.compiere.util.Trx; +import org.posterita.Constants; +import org.posterita.beans.PaymentTermBean; +import org.posterita.businesslogic.PaymentTermManager; +import org.posterita.core.TmkJSPEnv; +import org.posterita.core.TrxPrefix; +import org.posterita.exceptions.ApplicationException; +import org.posterita.exceptions.CannotDeactivatePaymentTermException; +import org.posterita.exceptions.InvalidNetDaysException; +import org.posterita.exceptions.MandatoryNameException; +import org.posterita.exceptions.OperationException; +import org.posterita.exceptions.PaymentTermAlreadyExistsException; +import org.posterita.form.PaymentTermForm; +import org.posterita.form.PaymentTermForm2; +import org.posterita.struts.core.BaseDispatchAction; +import org.posterita.struts.core.DefaultForm; + + +public class PaymentTermAction extends BaseDispatchAction +{ + public static final String VIEW_ALL_PAYMENT_TERMS = "viewAllPaymentTerms"; + public ActionForward viewAllPaymentTerms(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx=TmkJSPEnv.getCtx(request); + + ArrayList paymentTermList = PaymentTermManager.getAllPaymentTerm(ctx,false); + request.setAttribute(Constants.ALL_PAYMENT_TERMS,paymentTermList); + return mapping.findForward(VIEW_ALL_PAYMENT_TERMS); + } + + public static final String CREATE_PAYMENT_TERM = "createPaymentTerm"; + public ActionForward createPaymentTerm(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + DefaultForm df= (DefaultForm) form; + PaymentTermBean bean=(PaymentTermBean) df.getBean(); + Properties ctx=TmkJSPEnv.getCtx(request); + + Trx trx = Trx.get(TrxPrefix.getPrefix(),true); + + try + { + trx.start(); + PaymentTermManager.createEditPaymentTerm(ctx,bean,trx.getTrxName()); + trx.commit(); + } + catch(MandatoryNameException e) + { + trx.rollback(); + postGlobalError("error.name.mandatory",request); + return mapping.getInputForward(); + } + catch(InvalidNetDaysException e1) + { + trx.rollback(); + postGlobalError("error.net.days.cannot.be.negative",request); + return mapping.getInputForward(); + } + catch(PaymentTermAlreadyExistsException e2) + { + trx.rollback(); + postGlobalError("error.paymentTermName.duplicate",request); + return mapping.getInputForward(); + } + catch(CannotDeactivatePaymentTermException e3) + { + trx.rollback(); + postGlobalError("error.cannot.deactivate.paymentTermName",request); + return mapping.getInputForward(); + } + finally + { + trx.close(); + } + ArrayList paymentTermList = PaymentTermManager.getAllPaymentTerm(ctx,false); + request.setAttribute(Constants.ALL_PAYMENT_TERMS,paymentTermList); + return mapping.findForward(CREATE_PAYMENT_TERM); + } + + public static final String DEACTIVATE_PAYMENT_TERM = "deActivatePaymentTerm"; + public ActionForward deActivatePaymentTerm(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + PaymentTermForm2 df= (PaymentTermForm2) form; + PaymentTermBean bean=(PaymentTermBean) df.getBean(); + Properties ctx=TmkJSPEnv.getCtx(request); + ArrayList paymentTermList = PaymentTermManager.getAllPaymentTerm(ctx,false); + request.setAttribute(Constants.ALL_PAYMENT_TERMS,paymentTermList); + try + { + PaymentTermManager.activatePaymentTerm(ctx,bean.getPaymentTermId(),false); + } + catch(CannotDeactivatePaymentTermException e3) + { + + postGlobalError("error.cannot.deactivate.paymentTermName",request); + return mapping.getInputForward(); + } + + + return mapping.findForward(DEACTIVATE_PAYMENT_TERM); + } + + + public static final String ACTIVATE_PAYMENT_TERM = "activatePaymentTerm"; + public ActionForward activatePaymentTerm(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + PaymentTermForm2 df= (PaymentTermForm2) form; + PaymentTermBean bean=(PaymentTermBean) df.getBean(); + Properties ctx=TmkJSPEnv.getCtx(request); + + PaymentTermManager.activatePaymentTerm(ctx,bean.getPaymentTermId(),true); + ArrayList paymentTermList = PaymentTermManager.getAllPaymentTerm(ctx,false); + request.setAttribute(Constants.ALL_PAYMENT_TERMS,paymentTermList); + return mapping.findForward(ACTIVATE_PAYMENT_TERM); + } + + public static final String INIT_EDIT_PAYMENT_TERM = "initEditPaymentTerm"; + public ActionForward initEditPaymentTerm(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + PaymentTermForm ptf = (PaymentTermForm) form; + int paymentTermId = new Integer (ptf.getPaymentTermId()).intValue(); + Properties ctx=TmkJSPEnv.getCtx(request); + PaymentTermBean bean= PaymentTermManager.getPaymentTerm(ctx,paymentTermId); + ptf.populate(bean); + request.setAttribute(Constants.EDIT_PAYMENT_TERM,bean); + return mapping.findForward(INIT_EDIT_PAYMENT_TERM); + } + + public static final String EDIT_PAYMENT_TERM = "editPaymentTerm"; + public ActionForward editPaymentTerm(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + DefaultForm df= (DefaultForm) form; + PaymentTermBean bean=(PaymentTermBean) df.getBean(); + Properties ctx=TmkJSPEnv.getCtx(request); + + Trx trx = Trx.get(TrxPrefix.getPrefix(),true); + + try + { + trx.start(); + PaymentTermManager.createEditPaymentTerm(ctx,bean,trx.getTrxName()); + trx.commit(); + } + catch(MandatoryNameException e) + { + trx.rollback(); + postGlobalError("error.name.mandatory",request); + return mapping.getInputForward(); + } + catch(InvalidNetDaysException e1) + { + trx.rollback(); + postGlobalError("error.net.days.cannot.be.negative",request); + return mapping.getInputForward(); + } + + catch(PaymentTermAlreadyExistsException e) + { + trx.rollback(); + postGlobalError("error.paymentTermName.duplicate",request); + return mapping.getInputForward(); + } + catch(CannotDeactivatePaymentTermException e3) + { + trx.rollback(); + postGlobalError("error.cannot.deactivate.paymentTermName",request); + return mapping.getInputForward(); + } + catch(OperationException e) + { + trx.rollback(); + throw e; + } + finally + { + trx.close(); + } + ArrayList paymentTermList = PaymentTermManager.getAllPaymentTerm(ctx,false); + request.setAttribute(Constants.ALL_PAYMENT_TERMS,paymentTermList); + return mapping.findForward(EDIT_PAYMENT_TERM); + } +} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/PostingAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/PostingAction.java new file mode 100644 index 0000000000..1148f59b3b --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/pos/PostingAction.java @@ -0,0 +1,59 @@ +/** + * + * Copyright (c) 2007 Posterita. All Rights Reserved. + * + * This software is the confidential and proprietary information of + * Posterita. ("Confidential Information"). You shall not + * disclose such Confidential Information and shall use it only in + * accordance with the terms of the license agreement you entered into + * with Posterita. + * + * POSTERITA MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE + * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT + * NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR + * A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. TAMAK ICT SHALL NOT + * BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, + * MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. + * + * 21 Dec 2007 17:36:26 by shameem + * + */ + +package org.posterita.struts.pos; + +import java.util.Properties; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.posterita.businesslogic.PostingManager; +import org.posterita.core.TmkJSPEnv; +import org.posterita.exceptions.ApplicationException; +import org.posterita.exceptions.OperationException; +import org.posterita.struts.core.BaseDispatchAction; + +public class PostingAction extends BaseDispatchAction +{ + + public static final String RESUBMIT_POSTING="resubmitPosting"; + + public ActionForward resubmitPosting(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx =TmkJSPEnv.getCtx(request); + + PostingManager.resubmitPostingForInvoice(ctx); + + return mapping.findForward(RESUBMIT_POSTING); + + + } + + +} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/PriceListAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/PriceListAction.java new file mode 100644 index 0000000000..9755d38f25 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/pos/PriceListAction.java @@ -0,0 +1,216 @@ +package org.posterita.struts.pos; + +import java.io.IOException; +import java.io.PrintWriter; +import java.util.ArrayList; +import java.util.Properties; +import java.util.logging.Level; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.compiere.model.MPriceList; +import org.compiere.util.CLogger; +import org.compiere.util.Env; +import org.compiere.util.Trx; +import org.posterita.Constants; +import org.posterita.beans.PriceListBean; +import org.posterita.businesslogic.administration.PriceListManager; +import org.posterita.core.SessionStorage; +import org.posterita.core.TmkJSPEnv; +import org.posterita.core.TrxPrefix; +import org.posterita.exceptions.ApplicationException; +import org.posterita.exceptions.OperationException; +import org.posterita.form.PriceListForm; +import org.posterita.struts.core.BaseDispatchAction; + +public class PriceListAction extends BaseDispatchAction +{ + + private static CLogger logger = CLogger.getCLogger(PriceListAction.class); + + public static final String CREATE_OR_UPDATE_PRICE_LIST = "createOrUpdatePriceList"; + public ActionForward createOrUpdatePriceList(ActionMapping mapping, ActionForm form, + HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException, IOException, InstantiationException, IllegalAccessException + { + ActionForward fwd = init(mapping, form, request, response); + + if (fwd != null) + { + return fwd; + } + + Properties ctx = TmkJSPEnv.getCtx(request); + PriceListForm priceListForm = (PriceListForm)form; + PriceListBean priceListBean = (PriceListBean)priceListForm.getBean(); + + Trx trx = Trx.get(TrxPrefix.getPrefix(),true); + try + { + trx.start(); + PriceListManager.createOrUpdatePriceList(ctx, priceListBean, trx.getTrxName()); + trx.commit(); + } + catch (OperationException e) + { + trx.rollback(); + logger.log(Level.SEVERE, e.getMessage()); + postGlobalError("error.process", e.getMessage(), request); + } + finally + { + trx.close(); + } + + request.getSession().setAttribute(Constants.PRICE_LIST, priceListBean); + SessionStorage.putPriceLists(ctx, request); + priceListForm.populate(priceListBean); + return mapping.findForward(CREATE_OR_UPDATE_PRICE_LIST); + } + + + public static final String LIST_PRICE_LISTS = "listPriceLists"; + public ActionForward listPriceLists(ActionMapping mapping, ActionForm form, + HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException, IOException + { + ActionForward fwd = init(mapping, form, request, response); + + if (fwd != null) + { + return fwd; + } + + Properties ctx = TmkJSPEnv.getCtx(request); + PriceListForm priceListForm = (PriceListForm)form; + PriceListBean priceListBean = (PriceListBean)priceListForm.getBean(); + + String name = priceListBean.getName(); + ArrayList list = PriceListManager.getPriceLists(ctx, 0, name, null, null, null, null, null); + + request.getSession().setAttribute(Constants.LIST_PRICE_LISTS, list); + + String fromDeletePriceOnPriceList = request.getParameter("isFromDeletePriceOnPriceList"); + + if(fromDeletePriceOnPriceList != null && fromDeletePriceOnPriceList.equals("true")) + { + request.setAttribute(Constants.IS_FROM_DELETE_PRODUCT_PRICE, "true"); + } + + return mapping.findForward(LIST_PRICE_LISTS); + + } + + public static final String VIEW_PRICE_LIST = "viewPriceList"; + public ActionForward viewPriceList(ActionMapping mapping, ActionForm form, + HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException, IOException + { + ActionForward fwd = init(mapping, form, request, response); + + if (fwd != null) + { + return fwd; + } + + Properties ctx = TmkJSPEnv.getCtx(request); + Integer priceListId = Integer.valueOf(request.getParameter("priceListId")); + String next =request.getParameter("isNext"); + Boolean isNext= null; + if ("true".equals(next)) + { + isNext = true; + } + else if ("false".equals(next)) + { + isNext = false; + } + + PriceListForm priceListform = (PriceListForm)form; + + ArrayList list = (ArrayList) request.getSession().getAttribute(Constants.LIST_PRICE_LISTS); + PriceListBean priceListBean = null; + + priceListBean = PriceListManager.getPriceListBean(ctx, list, priceListId, isNext); + priceListform.populate(priceListBean); + + request.getSession().setAttribute(Constants.PRICE_LIST, priceListBean); + + return mapping.findForward(VIEW_PRICE_LIST); + } + + + public static final String SET_DEFAULT_PRICE_LIST = "setDefaultPriceList"; + public ActionForward setDefaultPriceList(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd = init(mapping, form, request, response); + + if (fwd != null) + { + return fwd; + } + + Properties ctx = TmkJSPEnv.getCtx(request); + int priceListId = 0; + try + { + priceListId = Integer.parseInt(String.valueOf(request.getParameter("priceListId"))); + MPriceList priceList = MPriceList.get(ctx, priceListId, null); + PriceListManager.setDefaultPriceList(ctx, priceList, true, null); + } + catch (NumberFormatException e) + { + return mapping.getInputForward(); + } + ArrayList list = (ArrayList)request.getSession().getAttribute(Constants.LIST_PRICE_LISTS); + ArrayList n_list = new ArrayList(); + for (PriceListBean pBean : list) + { + pBean = PriceListManager.getPriceList(ctx, pBean.getPriceListId(), null); + n_list.add(pBean); + } + request.getSession().setAttribute(Constants.LIST_PRICE_LISTS, n_list); + return mapping.findForward(LIST_PRICE_LISTS); + + } + + public static final String LOAD_PRICE_LISTS = "loadPriceLists"; + + public ActionForward loadPriceLists(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException, IOException + { + ActionForward fwd = init(mapping, form, request, response); + + if (fwd != null) + { + return fwd; + } + + Properties ctx = TmkJSPEnv.getCtx(request); + PriceListForm priceListForm = (PriceListForm)form; + PriceListBean priceListBean = (PriceListBean)priceListForm.getBean(); + + int ad_org_id = Env.getAD_Org_ID(ctx); + + Trx trx = Trx.get(TrxPrefix.getPrefix(),true); + + String name = priceListBean.getName(); + ArrayList list = PriceListManager.getPriceLists(ctx, ad_org_id , name, true, null, true, true, trx.getTrxName()); + String priceListHTML = PriceListManager.loadPriceListAsHTMLSelect(ctx, list); + + PrintWriter writer = response.getWriter(); + writer.print(priceListHTML); + writer.flush(); + writer.close(); + + return null; + + } + + public ActionForward fromDeletePriceOnPriceList(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException + { + request.setAttribute(Constants.IS_FROM_DELETE_PRODUCT_PRICE, "true"); + return mapping.findForward(LIST_PRICE_LISTS); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/SalesAnalysisReportAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/SalesAnalysisReportAction.java new file mode 100644 index 0000000000..6c36d000ab --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/pos/SalesAnalysisReportAction.java @@ -0,0 +1,150 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 25-Jul-2005 by alok + * + */ + + +package org.posterita.struts.pos; + + +public class SalesAnalysisReportAction extends POSDispatchAction +{ + /*public static final String GET_CURRENT_DAY_REPORT = "getCurrentDayReport"; + public ActionForward getCurrentDayReport(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + Calendar cal = Calendar.getInstance(); + + Timestamp toDate = new Timestamp(cal.getTimeInMillis()); + + cal.set(Calendar.HOUR_OF_DAY,0); + cal.set(Calendar.MINUTE,0); + cal.set(Calendar.SECOND,0); + cal.set(Calendar.MILLISECOND,0); + + Timestamp fromDate = new Timestamp(cal.getTimeInMillis()); + + ArrayList list=POSReportManager.getSalesAnalysisReport(ctx,fromDate,toDate); + request.getSession().setAttribute(org.posterita.Constants.SALES_ANALYSIS,list); + + return mapping.findForward(GET_CURRENT_DAY_REPORT); + }*/ + + /*public static final String GET_CURRENT_MONTH_REPORT = "getCurrentMonthReport"; + public ActionForward getCurrentMonthReport(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + Calendar cal = Calendar.getInstance(); + SimpleDateFormat sdf = new SimpleDateFormat(TimestampConvertor.DEFAULT_DATE_PATTERN1); + + String toDate = sdf.format(new Date(cal.getTimeInMillis())); + + cal.set(Calendar.DATE,1); + cal.set(Calendar.HOUR_OF_DAY,0); + cal.set(Calendar.MINUTE,0); + cal.set(Calendar.SECOND,0); + cal.set(Calendar.MILLISECOND,0); + + String fromDate = sdf.format(new Date(cal.getTimeInMillis())); + + //String report = SalesAnalysisReportManager.getPDFReport(ctx,fromDate,toDate); + + ArrayList list=POSReportManager.getSalesAnalysisReport(ctx,fromDate,toDate); + request.getSession().setAttribute(org.posterita.Constants.SALES_ANALYSIS,list); + + return mapping.findForward(GET_CURRENT_MONTH_REPORT); + } + */ + /*public static final String GET_CUSTOM_REPORT = "getCustomReport"; + public ActionForward getCustomReport(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws OperationException, ApplicationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + + Properties ctx = TmkJSPEnv.getCtx(request); + DefaultForm df= (DefaultForm) form; + + ReportBean bean = (ReportBean) df.getBean(); + Timestamp fromDate = ReportDateManager.getFromDate(bean); + Timestamp toDate = ReportDateManager.getToDate(bean); + + ArrayList list=POSReportManager.getSalesAnalysisReport(ctx,fromDate,toDate); + request.getSession().setAttribute(org.posterita.Constants.SALES_ANALYSIS,list); + + return mapping.findForward(GET_CUSTOM_REPORT); + }*/ + + /*public static final String GET_JPEG_REPORT = "getJpegReport"; + public ActionForward getJpegReport(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws OperationException, ApplicationException + { + try + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + + String reportDir = ReportManager.getReportDirectoryFromServletContext(this.servlet); + + String filename = RandomStringGenerator.randomstring(); + + PieChart pieChart = new PieChart(); + pieChart.getDataSetFromSQL("" + + " select t.ATTR_MODEL \"Model\"," + + " sum(AMTACCTCR) \"Sum\"" + + " from FACT_ACCT f,M_PRODUCT p,U_TSHIRT_V t" + + " where f.AD_CLIENT_ID = 1016840" + + " and f.M_PRODUCT_ID = p.M_PRODUCT_ID" + + " and f.AMTACCTCR > 0" + + " and t.M_PRODUCT_ID = p.M_PRODUCT_ID" + + " having sum(AMTACCTCR) < 1000" + + " group by t.ATTR_MODEL"); + + pieChart.saveChartAsJPEG(reportDir+filename+".jpg",700,600); + + String imgSrc = request.getContextPath() + "/config/reports/"+filename+".jpg"; + String imagemaptag = pieChart.getImageMap(filename); + String imagetag = ""; + + request.getSession().setAttribute("CHART",imagemaptag+imagetag); + + } + catch (Exception e) + { + e.printStackTrace(); + } + + return mapping.findForward(GET_JPEG_REPORT); + }*/ + + +} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/SearchCustomerAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/SearchCustomerAction.java new file mode 100644 index 0000000000..7c6c14eaa4 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/pos/SearchCustomerAction.java @@ -0,0 +1,164 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * 12-Dec-2006 10:00:02 by praveen + * + */ + +package org.posterita.struts.pos; + +import java.io.PrintWriter; +import java.io.StringWriter; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Properties; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.action.Action; +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.compiere.model.MPriceList; +import org.posterita.beans.CustomerBean; +import org.posterita.businesslogic.POSTerminalManager; +import org.posterita.businesslogic.administration.CustomerManager; +import org.posterita.businesslogic.administration.VendorManager; +import org.posterita.core.TmkJSPEnv; +import org.posterita.core.bean.ElementBean; +import org.posterita.core.businesslogic.ElementManager; +import org.posterita.order.UDIOrderTypes; + +/** + * This action is called using AJAX form the vendor panel + */ +public class SearchCustomerAction extends Action +{ + public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception + { + Properties ctx = TmkJSPEnv.getCtx(request); + String customerName = request.getParameter("customerQuery"); + String orderType = request.getParameter("orderType"); + int priceListId = -1; + + ArrayList customerList = null; + + if(UDIOrderTypes.POS_GOODS_RECEIVE_NOTE.getOrderType().equals(orderType) || + UDIOrderTypes.POS_GOODS_RETURN_NOTE.getOrderType().equals(orderType)) + { + customerList = VendorManager.searchVendors(ctx,customerName,true); + priceListId = POSTerminalManager.getPOPriceListId(ctx); + } + else + { + customerList = CustomerManager.searchCustomers(ctx,customerName,false); + priceListId = POSTerminalManager.getSOPriceListId(ctx); + } + + CustomerBean bean = null; + + ElementBean elementBean = null; + elementBean = ElementManager.getMsg(ctx, "not.found"); + + StringWriter sw = new StringWriter(); + PrintWriter out = new PrintWriter(sw); + + if (customerList == null || customerList.size() == 0) + { + out.print("
      "); + out.print("
    • "); + out.print("
    "); + out.print("
    "); + } + else + { + String priceListName = MPriceList.get(ctx, priceListId, null).getName(); + + + int size = customerList.size(); + size = (size > customerList.size())? customerList.size() : size; + + out.print("
      "); + + for(int i=0;i"); + out.print(vendorName); + out.print(""); + } + + out.print("
    "); + + elementBean = ElementManager.getMsg(ctx, "search.result.displaying"); + String msg = elementBean.getName(); + + out.print("
    "); + } + + response.getOutputStream().print(sw.toString()); + response.getOutputStream().flush(); + response.getOutputStream().close(); + + return null; + } +} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/SearchPOSProductAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/SearchPOSProductAction.java new file mode 100644 index 0000000000..6efae86cba --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/pos/SearchPOSProductAction.java @@ -0,0 +1,57 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 25-Jul-2005 by alok + * + */ + +package org.posterita.struts.pos; + +import java.util.ArrayList; +import java.util.Properties; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; + +import org.posterita.Constants; +import org.posterita.businesslogic.administration.ProductManager; +import org.posterita.core.TmkJSPEnv; + +public class SearchPOSProductAction extends POSDispatchAction +{ + public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + String productName = request.getParameter("productName"); + + Properties ctx = TmkJSPEnv.getCtx(request); + + ArrayList productList = ProductManager.getProductList(ctx,productName,true,true); + + request.getSession().setAttribute(Constants.PRODUCT_LIST,productList); + + return mapping.findForward("displayProducts"); + } +} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/SearchProductAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/SearchProductAction.java new file mode 100644 index 0000000000..e450481f65 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/pos/SearchProductAction.java @@ -0,0 +1,152 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * 12-Dec-2006 10:00:02 by praveen + * + */ + +package org.posterita.struts.pos; + +import java.io.PrintWriter; +import java.io.StringWriter; +import java.util.ArrayList; +import java.util.Properties; +import java.util.logging.Level; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.action.Action; +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.compiere.util.CLogger; +import org.posterita.TangoColors; +import org.posterita.beans.ProductStatusBean; +import org.posterita.businesslogic.administration.ProductManager; +import org.posterita.businesslogic.POSTerminalManager; +import org.posterita.core.TmkJSPEnv; + +/** + * This action is called using AJAX form the product panel + */ +public class SearchProductAction extends Action +{ + private static final CLogger logger = CLogger.getCLogger(SearchProductAction.class); + + public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception + { + Properties ctx = TmkJSPEnv.getCtx(request); + String description = request.getParameter("description"); + String productName = request.getParameter("productName"); + String strPriceListId = request.getParameter("priceListId"); + + int priceListId = 0; + if (strPriceListId != null && strPriceListId.trim().length() != 0) + { + try + { + priceListId = Integer.parseInt(strPriceListId); + } + catch (Exception ex) + { + logger.log(Level.SEVERE, "Could not parse Price List Id, priceListId: " + strPriceListId, ex); + } + } + else + { + priceListId = POSTerminalManager.getSOPriceListId(ctx); + } + + int adOrgId = POSTerminalManager.getOrgId(ctx); + int warehouseId = POSTerminalManager.getWarehouseId(ctx); + ArrayList productList = null; + + if(productName != null) + { + productName = productName.replaceAll("#", "&#"); + productList = ProductManager.searchProducts(ctx, adOrgId, productName, "", priceListId, warehouseId, null); + } + else if(description != null) + { + description = description.replaceAll("#", "&#"); + productList = ProductManager.searchProducts(ctx, adOrgId, "", description, priceListId, warehouseId, null); + } + else + { + productList = ProductManager.searchProducts(ctx, adOrgId, "", "", priceListId, warehouseId, null); + } + + ProductStatusBean bean = null; + StringWriter sw = new StringWriter(); + PrintWriter out = new PrintWriter(sw); + + if(productList == null || productList.size() == 0) + { + out.print("
    "); + } + else + { + int size = productList.size(); + + size = (size > productList.size())? productList.size() : size; + + int i = 0; + + if(size > 0) + { + out.print("
      "); + + for(i=0;i< size;i++) + { + bean = (ProductStatusBean)productList.get(i); + + if(i % 2 == 0) + { + out.print("
    • "); + + out.print(bean.getProductName() + "-" + bean.getDescription()+">qty:"+bean.getQtyOnHand()+ ">price:"+bean.getPriceStandard()); + + out.print("
    • "); + } + else + { + out.print("
    • "); + + out.print(bean.getProductName() + "-" + bean.getDescription()+">qty:"+bean.getQtyOnHand()+ ">price:"+bean.getPriceStandard()); + + out.print("
    • "); + + } + + + } + + out.print("
    "); + } + + out.print("
    "); + } + + response.getOutputStream().print(sw.toString()); + response.getOutputStream().flush(); + response.getOutputStream().close(); + + return null; + } +} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/SearchProductsInStockAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/SearchProductsInStockAction.java new file mode 100644 index 0000000000..662e341587 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/pos/SearchProductsInStockAction.java @@ -0,0 +1,80 @@ +package org.posterita.struts.pos; + +import java.io.PrintWriter; +import java.io.StringWriter; +import java.util.ArrayList; +import java.util.Properties; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.action.Action; +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.compiere.util.Env; +import org.posterita.Constants; +import org.posterita.beans.ProductStatusBean; +import org.posterita.businesslogic.administration.ProductManager; +import org.posterita.core.TmkJSPEnv; +import org.posterita.lib.UdiConstants; + +public class SearchProductsInStockAction extends Action +{ + public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception + { + String productName = request.getParameter("productName"); + Integer orgId = (Integer)request.getSession().getAttribute(Constants.ORG_FROM_ID); + Properties ctx = TmkJSPEnv.getCtx(request); + + if (orgId == null) + { + orgId = Env.getContextAsInt(ctx, UdiConstants.ORG_ID_CTX_PARAM); + } + + productName = productName.replaceAll("#", "&#"); + + ArrayList productList =ProductManager.searchProductsFromStock(ctx, orgId, productName, null); + + ProductStatusBean bean = null; + StringWriter sw = new StringWriter(); + PrintWriter out = new PrintWriter(sw); + + if(productList == null || productList.size() == 0) + { + out.print("
    "); + } + else + { + int size = productList.size(); + + size = (size > productList.size())? productList.size() : size; + + if(size > 0) + { + out.print("
      "); + + for(int i=0;i< size;i++) + { + bean = (ProductStatusBean)productList.get(i); + + out.print("
    • "); + out.print(bean.getProductName()); + out.print("
    • "); + } + + out.print("
    "); + } + + out.print("
    "); + + } + response.getOutputStream().print(sw.toString()); + response.getOutputStream().flush(); + response.getOutputStream().close(); + + return null; + + } + +} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/SearchVendorAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/SearchVendorAction.java new file mode 100644 index 0000000000..036b17c1c5 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/pos/SearchVendorAction.java @@ -0,0 +1,123 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * 12-Dec-2006 10:00:02 by praveen + * + */ + +package org.posterita.struts.pos; + +import java.io.PrintWriter; +import java.io.StringWriter; +import java.util.ArrayList; +import java.util.Properties; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.action.Action; +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; + +import org.posterita.beans.CustomerBean; +import org.posterita.businesslogic.administration.VendorManager; +import org.posterita.core.TmkJSPEnv; +import org.posterita.core.bean.ElementBean; +import org.posterita.core.businesslogic.ElementManager; + +/** + * This action is called using AJAX form the vendor panel + */ +public class SearchVendorAction extends Action +{ + public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception + { + Properties ctx = TmkJSPEnv.getCtx(request); + String customerName = request.getParameter("customerQuery"); + + ArrayList customerList = VendorManager.searchVendors(TmkJSPEnv.getCtx(request),customerName,true); + CustomerBean bean = null; + + ElementBean elementBean = null; + elementBean = ElementManager.getMsg(ctx, "not.found"); + + StringWriter sw = new StringWriter(); + PrintWriter out = new PrintWriter(sw); + + if (customerList == null || customerList.size() == 0) + { + out.print("
      "); + out.print("
    • "); + out.print("
    "); + out.print("
    "); + } + else + { + int size = 15; + size = (size > customerList.size())? customerList.size() : size; + + out.print("
      "); + + for(int i=0;i"); + out.print(vendorName); + out.print(""); + } + + out.print("
    "); + + elementBean = ElementManager.getMsg(ctx, "search.result.displaying"); + String msg = elementBean.getName(); + + out.print("
    "); + } + + response.getOutputStream().print(sw.toString()); + response.getOutputStream().flush(); + response.getOutputStream().close(); + + return null; + } +} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/SlowMovingItemReportAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/SlowMovingItemReportAction.java new file mode 100644 index 0000000000..2f0d52bba0 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/pos/SlowMovingItemReportAction.java @@ -0,0 +1,121 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 25-Jul-2005 by alok + * + */ + +package org.posterita.struts.pos; + +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Properties; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.posterita.Constants; +import org.posterita.beans.ReportBean; +import org.posterita.businesslogic.performanceanalysis.POSReportManager; +import org.posterita.businesslogic.performanceanalysis.ReportDateManager; +import org.posterita.core.TmkJSPEnv; +import org.posterita.exceptions.ApplicationException; +import org.posterita.exceptions.OperationException; +import org.posterita.struts.core.DefaultForm; + +public class SlowMovingItemReportAction extends POSDispatchAction +{ + public static final String GET_CURRENT_DAY_REPORT = "getCurrentDayReport"; + public ActionForward getCurrentDayReport(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + Calendar cal = Calendar.getInstance(); + + Timestamp toDate = new Timestamp(cal.getTimeInMillis()); + + cal.set(Calendar.HOUR_OF_DAY,0); + cal.set(Calendar.MINUTE,0); + cal.set(Calendar.SECOND,0); + cal.set(Calendar.MILLISECOND,0); + + Timestamp fromDate = new Timestamp(cal.getTimeInMillis()); + + ArrayList list=POSReportManager.getMaxMinSoldProducts(ctx,"asc",fromDate,toDate); + request.getSession().setAttribute(Constants.MIN_SOLD_ITEMS,list); + + return mapping.findForward(GET_CURRENT_DAY_REPORT); + } + + public static final String GET_CURRENT_MONTH_REPORT = "getCurrentMonthReport"; + public ActionForward getCurrentMonthReport(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + Calendar cal = Calendar.getInstance(); + Timestamp toDate = new Timestamp(cal.getTimeInMillis()); + + cal.set(Calendar.DATE,1); + cal.set(Calendar.HOUR_OF_DAY,0); + cal.set(Calendar.MINUTE,0); + cal.set(Calendar.SECOND,0); + cal.set(Calendar.MILLISECOND,0); + + Timestamp fromDate = new Timestamp(cal.getTimeInMillis()); + + ArrayList list=POSReportManager.getMaxMinSoldProducts(ctx,"asc",fromDate,toDate); + request.getSession().setAttribute(Constants.MIN_SOLD_ITEMS,list); + + return mapping.findForward(GET_CURRENT_MONTH_REPORT); + } + + public static final String GET_CUSTOM_REPORT = "getCustomReport"; + public ActionForward getCustomReport(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws OperationException, ApplicationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + + Properties ctx = TmkJSPEnv.getCtx(request); + DefaultForm df= (DefaultForm) form; + + ReportBean bean = (ReportBean) df.getBean(); + Timestamp fromDate = ReportDateManager.getFromDate(bean); + Timestamp toDate = ReportDateManager.getToDate(bean); + + ArrayList list=POSReportManager.getMaxMinSoldProducts(ctx,"asc",fromDate,toDate); + request.getSession().setAttribute(Constants.MIN_SOLD_ITEMS,list); + + return mapping.findForward(GET_CUSTOM_REPORT); + } + + +} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/StockMovementReportAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/StockMovementReportAction.java new file mode 100644 index 0000000000..548344ddc7 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/pos/StockMovementReportAction.java @@ -0,0 +1,200 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 25-Jul-2005 by alok + * + */ + +package org.posterita.struts.pos; + +import java.sql.Timestamp; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.Properties; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.apache.struts.action.ActionMessage; +import org.apache.struts.action.ActionMessages; + +import org.posterita.Constants; +import org.posterita.beans.ReportBean; +import org.posterita.businesslogic.performanceanalysis.CSVReportManager; +import org.posterita.businesslogic.performanceanalysis.POSReportManager; +import org.posterita.businesslogic.performanceanalysis.ReportDateManager; +import org.posterita.businesslogic.performanceanalysis.ReportManager; +import org.posterita.core.TabularReport; +import org.posterita.core.TimestampConvertor; +import org.posterita.core.TmkJSPEnv; +import org.posterita.exceptions.ApplicationException; +import org.posterita.exceptions.OperationException; +import org.posterita.struts.core.DefaultForm; + +public class StockMovementReportAction extends POSDispatchAction +{ + public static final String GET_CURRENT_DAY_REPORT = "getCurrentDayReport"; + public ActionForward getCurrentDayReport(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + Calendar cal = Calendar.getInstance(); + + Timestamp toDate = new Timestamp(cal.getTimeInMillis()); + + cal.set(Calendar.HOUR_OF_DAY,0); + cal.set(Calendar.MINUTE,0); + cal.set(Calendar.SECOND,0); + cal.set(Calendar.MILLISECOND,0); + + Timestamp fromDate = new Timestamp(cal.getTimeInMillis()); + + ArrayList list=POSReportManager.getStockMovementReport(ctx,fromDate,toDate); + request.getSession().setAttribute(Constants.STOCK_MOVEMENT,list); + + return mapping.findForward(GET_CURRENT_DAY_REPORT); + } + + public static final String GET_CURRENT_MONTH_REPORT = "getCurrentMonthReport"; + public ActionForward getCurrentMonthReport(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + Calendar cal = Calendar.getInstance(); + Timestamp toDate = new Timestamp(cal.getTimeInMillis()); + + cal.set(Calendar.DATE,1); + cal.set(Calendar.HOUR_OF_DAY,0); + cal.set(Calendar.MINUTE,0); + cal.set(Calendar.SECOND,0); + cal.set(Calendar.MILLISECOND,0); + + Timestamp fromDate = new Timestamp(cal.getTimeInMillis()); + + ArrayList list=POSReportManager.getStockMovementReport(ctx,fromDate,toDate); + request.getSession().setAttribute(Constants.STOCK_MOVEMENT,list); + + return mapping.findForward(GET_CURRENT_MONTH_REPORT); + } + + public static final String GET_CUSTOM_REPORT = "getCustomReport"; + public ActionForward getCustomReport(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + DefaultForm df= (DefaultForm) form; + ReportBean bean = (ReportBean) df.getBean(); + + String title = "Stock Movement Report"; + String subtitle = ""; + + String dateRange = bean.getDateRange(); + String timePeriod = bean.getTimePeriod(); + + Timestamp fromDate = null; + Timestamp toDate = null; + + //setting from and to dates + if(dateRange.endsWith(Constants.FIXED_DATE_RANGE)) + { + if(timePeriod==null) + { + throw new OperationException("Invalid Parameter for timePeriod : Time period is null "); + } + + fromDate = ReportDateManager.getStartDateForPeriod(timePeriod); + toDate = ReportDateManager.getEndDateForPeriod(timePeriod); + + subtitle = "For " + timePeriod; + } + else if(dateRange.endsWith(Constants.CUSTOM_DATE_RANGE)) + { + boolean error = false; + ActionMessages messages = new ActionMessages(); + ActionMessage message = null; + + if((bean.getFromDate()==null)||(bean.getFromDate()=="")) + { + message = new ActionMessage("error.required.fromDate"); + messages.add(ActionMessages.GLOBAL_MESSAGE, message); + error = true; + } + + if((bean.getToDate()==null)||(bean.getToDate()=="")) + { + message = new ActionMessage("error.required.toDate"); + messages.add(ActionMessages.GLOBAL_MESSAGE, message); + error = true; + } + + if(error) + { + saveErrors(request, messages); + return mapping.getInputForward(); + } + else + { + fromDate = ReportDateManager.getFromDate(bean); + toDate = ReportDateManager.getToDate(bean); + + } + + + subtitle = "For period:"+fromDate+" to "+toDate; + } + else + { + throw new OperationException("Invalid Parameter for dateRange :" + dateRange); + } + + ArrayList reportData = POSReportManager.getStockMovementReportData(ctx,fromDate,toDate); + + //constructing the table + TabularReport tReport = new TabularReport(reportData); + tReport.setSortable(false); + tReport.setStyle("display"); + tReport.setTitle(title); + tReport.setSubtitle(subtitle); + tReport.createReport(); + + String csvReport = CSVReportManager.generateCSVReport(ctx,reportData); + String csvURI = ReportManager.getReportURI(csvReport,request); + + request.getSession().setAttribute(Constants.TABULAR_REPORT_DATA,tReport.toString()); + request.getSession().setAttribute(Constants.CSV_FILE,csvURI); + + return mapping.findForward(GET_CUSTOM_REPORT); + + } +} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/TaxAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/TaxAction.java new file mode 100644 index 0000000000..5e4a7ca925 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/pos/TaxAction.java @@ -0,0 +1,287 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Nov 28, 2006 + */ + + +package org.posterita.struts.pos; + +import java.io.IOException; +import java.io.PrintWriter; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Properties; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.compiere.model.MTax; +import org.compiere.util.Env; +import org.compiere.util.Trx; +import org.posterita.Constants; +import org.posterita.beans.TaxBean; +import org.posterita.businesslogic.administration.TaxManager; +import org.posterita.core.TmkJSPEnv; +import org.posterita.core.TrxPrefix; +import org.posterita.exceptions.ApplicationException; +import org.posterita.exceptions.CannotInactivateTaxException; +import org.posterita.exceptions.InvalidNetDaysException; +import org.posterita.exceptions.MandatoryException; +import org.posterita.exceptions.MandatoryNameException; +import org.posterita.exceptions.NoAccessToEditObjectException; +import org.posterita.exceptions.OperationException; +import org.posterita.exceptions.TaxNameAlreadyExistsException; +import org.posterita.exceptions.TaxRateAlreadyExistsException; +import org.posterita.form.TaxForm; +import org.posterita.struts.core.BaseDispatchAction; +import org.posterita.struts.core.DefaultForm; + + +public class TaxAction extends BaseDispatchAction +{ + public static final String VIEW_ALL_TAX = "viewAllTax"; + + public ActionForward viewAllTax(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx=TmkJSPEnv.getCtx(request); + + ArrayList taxList = TaxManager.getAllTaxRates(ctx,false); + request.setAttribute(Constants.ALL_TAX_RATE,taxList); + return mapping.findForward(VIEW_ALL_TAX); + } + + public static final String CREATE_TAX = "createTax"; + public ActionForward createTax(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + DefaultForm df= (DefaultForm) form; + TaxBean bean=(TaxBean) df.getBean(); + Properties ctx=TmkJSPEnv.getCtx(request); + + Trx trx = Trx.get(TrxPrefix.getPrefix(),true); + + try + { + trx.start(); + TaxManager.createEditTaxCategoryAndTax(ctx,bean,trx.getTrxName()); + trx.commit(); + } + catch(MandatoryNameException e) + { + trx.rollback(); + postGlobalError("error.name.mandatory",request); + return mapping.getInputForward(); + } + catch(MandatoryException e1) + { + trx.rollback(); + postGlobalError("error.required.field",e1.getMessage(),request); + return mapping.getInputForward(); + } + catch(TaxNameAlreadyExistsException e3) + { + trx.rollback(); + postGlobalError("error.taxname.duplicate",request); + return mapping.getInputForward(); + } + catch(TaxRateAlreadyExistsException e4) + { + trx.rollback(); + postGlobalError("error.taxrate.duplicate",request); + return mapping.getInputForward(); + } + catch(InvalidNetDaysException e5) + { + trx.rollback(); + postGlobalError("error.tax.rate.nagative",request); + return mapping.getInputForward(); + } + finally + { + trx.close(); + } + ArrayList taxList = TaxManager.getAllTaxRates(ctx,false); + request.setAttribute(Constants.ALL_TAX_RATE,taxList); + return mapping.findForward(CREATE_TAX); + } + + public static final String DEACTIVATE_TAX = "deActivateTax"; + public ActionForward deActivateTax(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + DefaultForm df= (DefaultForm) form; + TaxBean bean=(TaxBean) df.getBean(); + Properties ctx=TmkJSPEnv.getCtx(request); + + try + { + TaxManager.activateTax(ctx,bean.getTaxId(),false); + } + + catch(CannotInactivateTaxException e) + { + ArrayList taxList = TaxManager.getAllTaxRates(ctx,false); + request.setAttribute(Constants.ALL_TAX_RATE,taxList); + postGlobalError("cannot.inactivate.tax",request); + return mapping.getInputForward(); + } + ArrayList taxList = TaxManager.getAllTaxRates(ctx,false); + request.setAttribute(Constants.ALL_TAX_RATE,taxList); + + return mapping.findForward(DEACTIVATE_TAX); + } + + + public static final String ACTIVATE_TAX = "activateTax"; + public ActionForward activateTax(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + DefaultForm df= (DefaultForm) form; + TaxBean bean=(TaxBean) df.getBean(); + Properties ctx=TmkJSPEnv.getCtx(request); + + TaxManager.activateTax(ctx,bean.getTaxId(),true); + ArrayList taxList = TaxManager.getAllTaxRates(ctx,false); + request.setAttribute(Constants.ALL_TAX_RATE,taxList); + return mapping.findForward(ACTIVATE_TAX); + } + + public static final String INIT_EDIT_TAX = "initEditTax"; + public ActionForward initEditTax(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + TaxForm tf = (TaxForm) form; + int taxId = new Integer (tf.getTaxId()).intValue(); + Properties ctx=TmkJSPEnv.getCtx(request); + TaxBean bean= TaxManager.getTaxRate(ctx,taxId); + tf.populate(bean); + request.setAttribute(Constants.EDIT_TAX,bean); + return mapping.findForward(INIT_EDIT_TAX); + } + + public static final String EDIT_TAX = "editTax"; + public ActionForward editTax(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + DefaultForm df= (DefaultForm) form; + TaxBean bean=(TaxBean) df.getBean(); + Properties ctx=TmkJSPEnv.getCtx(request); + + Trx trx = Trx.get(TrxPrefix.getPrefix(),true); + + try + { + trx.start(); + TaxManager.createEditTaxCategoryAndTax(ctx,bean,trx.getTrxName()); + trx.commit(); + } + catch(MandatoryException e1) + { + trx.rollback(); + postGlobalError("error.required.field",e1.getMessage(),request); + return mapping.getInputForward(); + } + catch (NoAccessToEditObjectException e) + { + trx.rollback(); + postGlobalError("error.no.edit.access", request); + return mapping.getInputForward(); + } + catch(MandatoryNameException e2) + { + trx.rollback(); + postGlobalError("error.name.required",request); + return mapping.getInputForward(); + } + catch(InvalidNetDaysException e3) + { + trx.rollback(); + postGlobalError("error.tax.rate.nagative",request); + return mapping.getInputForward(); + } + catch(TaxNameAlreadyExistsException e) + { + trx.rollback(); + postGlobalError("error.taxname.duplicate",request); + return mapping.getInputForward(); + } + catch(TaxRateAlreadyExistsException e) + { + trx.rollback(); + postGlobalError("error.taxrate.duplicate",request); + return mapping.getInputForward(); + } + finally + { + trx.close(); + } + ArrayList taxList = TaxManager.getAllTaxRates(ctx,false); + request.setAttribute(Constants.ALL_TAX_RATE,taxList); + return mapping.findForward(EDIT_TAX); + } + + public static final String GET_TAX_RATE = "getTaxRate"; + public ActionForward getTaxRate(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException, IOException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + Properties ctx=TmkJSPEnv.getCtx(request); + Object taxCatId = request.getParameter("taxCategoryId"); + Integer taxCategoryId = 0; + BigDecimal taxRate = Env.ZERO; + if (taxCatId != null) + { + taxCategoryId = Integer.parseInt(taxCatId.toString()); + + MTax tax = TaxManager.getTaxFromCategory(ctx, taxCategoryId, null); + + taxRate = tax.getRate(); + } + + String res = taxRate.toString(); + PrintWriter writer = response.getWriter(); + writer.print(res); + writer.flush(); + writer.close(); + + return null; + } +} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/TerminalAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/TerminalAction.java new file mode 100644 index 0000000000..ddff7df5f4 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/pos/TerminalAction.java @@ -0,0 +1,477 @@ +/****************************************************************************** + * Product: Posterita Web-Based POS and Adempiere Plugin * + * Copyright (C) 2008 Posterita Ltd * + * This file is part of POSterita * + * * + * POSterita is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * + *****************************************************************************/ +package org.posterita.struts.pos; + +import java.util.ArrayList; +import java.util.Properties; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.compiere.model.MPOSTerminal; +import org.compiere.util.Env; +import org.compiere.util.KeyNamePair; +import org.compiere.util.Trx; +import org.posterita.Constants; +import org.posterita.beans.BankAccountBean; +import org.posterita.beans.CashBookBean; +import org.posterita.beans.PriceListBean; +import org.posterita.beans.TerminalBean; +import org.posterita.beans.UDIBean; +import org.posterita.beans.WarehouseBean; +import org.posterita.businesslogic.BankManager; +import org.posterita.businesslogic.CashManager; +import org.posterita.businesslogic.OrganisationManager; +import org.posterita.businesslogic.POSTerminalManager; +import org.posterita.businesslogic.administration.PriceListManager; +import org.posterita.businesslogic.administration.WarehouseManager; +import org.posterita.core.TmkJSPEnv; +import org.posterita.exceptions.ApplicationException; +import org.posterita.exceptions.InvalidTerminalCashBookException; +import org.posterita.exceptions.OperationException; +import org.posterita.exceptions.TerminalInactivateException; +import org.posterita.form.TerminalForm; +import org.posterita.struts.core.BaseDispatchAction; +import org.posterita.struts.core.DefaultForm; + +/** + * @author Ashley G Ramdass + * Apr 14, 2008 + */ +public class TerminalAction extends BaseDispatchAction +{ + private void populateData(HttpServletRequest request, TerminalBean terminalBean, int adOrgId, String trxName) + throws OperationException + { + Properties ctx = TmkJSPEnv.getCtx(request); + + ArrayList accessibleOrgs = OrganisationManager.getUserOrgPairs(ctx, false); + request.getSession().setAttribute(Constants.ACCESSIBLE_ORGS, accessibleOrgs); + + ArrayList purchasePriceLists = PriceListManager.getPriceLists(ctx, 0, false, trxName); + request.getSession().setAttribute(Constants.PURCHASE_PRICELISTS, purchasePriceLists); + + ArrayList salesPriceLists = PriceListManager.getPriceLists(ctx, 0, true, trxName); + request.getSession().setAttribute(Constants.SALES_PRICELISTS, salesPriceLists); + + ArrayList warehouseList = WarehouseManager.getAllWarehouses(ctx, adOrgId); + request.getSession().setAttribute(Constants.WAREHOUSES, warehouseList); + + ArrayList cashBookList = CashManager.getCashBooksForTerminal(ctx, adOrgId, terminalBean.getTerminalId(), trxName); + request.getSession().setAttribute(Constants.CASH_BOOK, cashBookList); + + ArrayList accessibleCashBookList = CashManager.getCashBooks(ctx, trxName); + request.getSession().setAttribute(Constants.ACCESSIBLE_CASHBOOKS, accessibleCashBookList); + + ArrayList bankAccountList = BankManager.getBankAccounts(ctx, adOrgId, trxName); + request.getSession().setAttribute(Constants.BANK_ACCOUNTS, bankAccountList); + + ArrayList accessibleBankAccountList = BankManager.getBankAccounts(ctx, trxName); + request.getSession().setAttribute(Constants.ACCESSIBLE_BANKACCOUNTS, accessibleBankAccountList); + } + + public static final String INIT_SEARCH_TERMINAL = "initSearchTerminal"; + public ActionForward initSearchTerminal(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd = init(mapping,form,request,response); + if(fwd != null) + return fwd; + + request.getSession().setAttribute(Constants.TERMINALS, null); + + return mapping.findForward(INIT_SEARCH_TERMINAL); + } + + public static final String SEARCH_TERMINAL = "searchTerminal"; + public ActionForward searchTerminal(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd = init(mapping,form,request,response); + if(fwd != null) + return fwd; + + Properties ctx=TmkJSPEnv.getCtx(request); + DefaultForm df = (DefaultForm)form; + UDIBean bean = (UDIBean)df.getBean(); + + String searchText = bean.getSearchText(); + + ArrayList terminalList = POSTerminalManager.getTerminals(ctx, searchText, null); + + request.setAttribute(Constants.TERMINALS, terminalList); + + return mapping.findForward(SEARCH_TERMINAL); + } + + public static final String INIT_CREATE_TERMINAL = "initCreateTerminal"; + public ActionForward initCreateTerminal(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd = init(mapping,form,request,response); + if(fwd != null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + DefaultForm df = (DefaultForm)form; + TerminalBean terminalBean = new TerminalBean(); + terminalBean.setIsActive(true); + + int orgId = Env.getAD_Org_ID(ctx); + + populateData(request, terminalBean, orgId, null); + int warehouseId = WarehouseManager.getOrganisationWarehouse(ctx, orgId, null); + terminalBean.setOrgId(orgId); + terminalBean.setWarehouseId(warehouseId); + df.populate(terminalBean); + df.setAction(CREATE_TERMINAL); + df.setReadOnly(false); + + return mapping.findForward(INIT_CREATE_TERMINAL); + } + + + public static final String CREATE_TERMINAL = "createTerminal"; + public ActionForward createTerminal(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd = init(mapping,form,request,response); + if(fwd != null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + TerminalForm terminalForm = (TerminalForm)form; + TerminalBean terminalBean = (TerminalBean)terminalForm.getBean(); + + Trx trx = Trx.get(Trx.createTrxName(), true); + trx.start(); + + try + { + MPOSTerminal terminal = POSTerminalManager.createUpdatePOSTerminal(ctx, terminalBean, trx.getTrxName()); + terminalBean.setTerminalId(terminal.get_ID()); + trx.commit(); + } + catch (InvalidTerminalCashBookException invalidTerminalCashBookException) + { + postGlobalError("error.terminal.cashbook", request); + return mapping.getInputForward(); + } + catch (TerminalInactivateException terminalInactivateException) + { + postGlobalError("error.deactivate.terminal", request); + return mapping.getInputForward(); + } + catch (Exception ex) + { + postGlobalError("error.operation", request); + return mapping.getInputForward(); + } + finally + { + trx.rollback(); + trx.close(); + } + + terminalForm.populate(terminalBean); + viewTerminal(mapping, form, request, response); + + return mapping.findForward(CREATE_TERMINAL); + } + + public static final String EDIT_TERMINAL = "editTerminal"; + public ActionForward editTerminal(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd = init(mapping,form,request,response); + if(fwd != null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + TerminalForm terminalForm = (TerminalForm)form; + TerminalBean terminalBean = (TerminalBean)terminalForm.getBean(); + + terminalBean = POSTerminalManager.getTerminalBean(ctx, terminalBean.getTerminalId(), null); + populateData(request, terminalBean, terminalBean.getOrgId(), null); + terminalForm.populate(terminalBean); + terminalForm.setAction(SAVE_TERMINAL); + terminalForm.setReadOnly(false); + return mapping.findForward(EDIT_TERMINAL); + } + + public static final String SAVE_TERMINAL = "saveTerminal"; + public ActionForward saveTerminal(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException + { + return createTerminal(mapping, form, request, response); + } + + public static final String VIEW_TERMINAL = "viewTerminal"; + public ActionForward viewTerminal(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd = init(mapping,form,request,response); + if(fwd != null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + TerminalForm terminalForm = (TerminalForm)form; + TerminalBean terminalBean = (TerminalBean)terminalForm.getBean(); + + terminalBean = POSTerminalManager.getTerminalBean(ctx, terminalBean.getTerminalId(), null); + + populateData(request, terminalBean, terminalBean.getOrgId(), null); + + terminalForm.populate(terminalBean); + terminalForm.setAction(VIEW_TERMINAL); + terminalForm.setReadOnly(true); + + return mapping.findForward(VIEW_TERMINAL); + } + + public static final String COPY_TERMINAL = "copyTerminal"; + public ActionForward copyTerminal(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd = init(mapping,form,request,response); + if(fwd != null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + TerminalForm terminalForm = (TerminalForm)form; + TerminalBean terminalBean = (TerminalBean)terminalForm.getBean(); + + terminalBean = POSTerminalManager.getTerminalBean(ctx, terminalBean.getTerminalId(), null); + terminalBean.setTerminalId(0); + + populateData(request, terminalBean, Env.getAD_Org_ID(ctx), null); + + terminalForm.populate(terminalBean); + terminalForm.setAction(SAVE_TERMINAL); + terminalForm.setReadOnly(false); + + return mapping.findForward(COPY_TERMINAL); + } + + public static final String DEACTIVATE_TERMINAL = "deactivateTerminal"; + public ActionForward deactivateTerminal(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd = init(mapping,form,request,response); + if(fwd != null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + TerminalForm terminalForm = (TerminalForm)form; + TerminalBean terminalBean = (TerminalBean)terminalForm.getBean(); + + Trx trx = Trx.get(Trx.createTrxName(), true); + trx.start(); + + try + { + terminalBean = POSTerminalManager.updateTerminalStatus(ctx, terminalBean.getTerminalId(), false, trx.getTrxName()); + trx.commit(); + } + catch (TerminalInactivateException terminalInactivateException) + { + postGlobalError("error.deactivate.terminal", request); + } + catch (Exception ex) + { + postGlobalError("error.operation", request); + } + finally + { + trx.rollback(); + trx.close(); + } + + searchTerminal(mapping, form, request, response); + + return mapping.findForward(SEARCH_TERMINAL); + } + + public static final String ACTIVATE_TERMINAL = "activateTerminal"; + public ActionForward activateTerminal(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd = init(mapping,form,request,response); + if(fwd != null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + TerminalForm terminalForm = (TerminalForm)form; + TerminalBean terminalBean = (TerminalBean)terminalForm.getBean(); + + Trx trx = Trx.get(Trx.createTrxName(), true); + trx.start(); + + try + { + terminalBean = POSTerminalManager.updateTerminalStatus(ctx, terminalBean.getTerminalId(), true, trx.getTrxName()); + trx.commit(); + } + catch (InvalidTerminalCashBookException invalidTerminalCashBookException) + { + postGlobalError("error.terminal.cashbook", request); + } + catch (Exception ex) + { + postGlobalError("error.operation", request); + } + finally + { + trx.rollback(); + trx.close(); + } + + searchTerminal(mapping, form, request, response); + + return mapping.findForward(SEARCH_TERMINAL); + } + + public static final String RESET_CURRENT_TERMINAL = "resetCurrentTerminal"; + public ActionForward resetCurrentTerminal(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd = init(mapping,form,request,response); + if(fwd != null) + return fwd; + + POSTerminalManager.resetTerminalInCookie(response); + searchTerminal(mapping, form, request, response); + postGlobalMessage("current.terminal.reset", request); + return mapping.findForward(SEARCH_TERMINAL); + } + + public static final String UPDATE_CURRENT_TERMINAL = "updateCurrentTerminal"; + public ActionForward updateCurrentTerminal(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd = init(mapping,form,request,response); + if(fwd != null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + TerminalForm terminalForm = (TerminalForm)form; + TerminalBean terminalBean = (TerminalBean)terminalForm.getBean(); + + POSTerminalManager.setTerminalInCookie(response, terminalBean.getTerminalId()); + + searchTerminal(mapping, form, request, response); + postGlobalMessage("current.terminal.updated", request); + return mapping.findForward(SEARCH_TERMINAL); + } + + public static final String CHANGE_ORGANISATION = "changeOrganisation"; + public ActionForward changeOrganisation(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd = init(mapping,form,request,response); + if(fwd != null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + TerminalForm terminalForm = (TerminalForm)form; + TerminalBean terminalBean = (TerminalBean)terminalForm.getBean(); + + terminalBean.setBpartnerId(0); + terminalBean.setCashBookId(0); + terminalBean.setCashbookTransferBankAccountId(0); + terminalBean.setCashbookTransferCashbookId(0); + terminalBean.setCashbookTransferType(null); + terminalBean.setCheckBankAccountId(0); + terminalBean.setCheckTransferBankAccountId(0); + terminalBean.setCheckTransferCashbookId(0); + terminalBean.setCheckTransferType(null); + terminalBean.setCardBankAccountId(0); + terminalBean.setCardTransferBankAccountId(0); + terminalBean.setCardTransferCashbookId(0); + terminalBean.setCardTransferType(null); + terminalBean.setLastLockTime(null); + terminalBean.setPurchasePriceListId(0); + terminalBean.setSalesPriceListId(0); + terminalBean.setTemplateBPartnerId(0); + terminalBean.setWarehouseId(0); + + populateData(request, terminalBean, terminalBean.getOrgId(), null); + + terminalForm.populate(terminalBean); + terminalForm.setAction(CREATE_TERMINAL); + terminalForm.setReadOnly(false); + + return mapping.getInputForward(); + } + + public static final String LOCK_TERMINAL = "lockTerminal"; + public ActionForward lockTerminal(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd = init(mapping,form,request,response); + if(fwd != null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + TerminalForm terminalForm = (TerminalForm)form; + TerminalBean terminalBean = (TerminalBean)terminalForm.getBean(); + + Trx trx = Trx.get(Trx.createTrxName(), true); + trx.start(); + + try + { + POSTerminalManager.setTerminalLockStatus(ctx, terminalBean.getTerminalId(), true, trx.getTrxName()); + trx.commit(); + } + catch (Exception ex) + { + postGlobalError("error.operation", request); + } + finally + { + trx.rollback(); + trx.close(); + } + + return viewTerminal(mapping, form, request, response); + } + + public static final String UNLOCK_TERMINAL = "unlockTerminal"; + public ActionForward unlockTerminal(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd = init(mapping,form,request,response); + if(fwd != null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + TerminalForm terminalForm = (TerminalForm)form; + TerminalBean terminalBean = (TerminalBean)terminalForm.getBean(); + + Trx trx = Trx.get(Trx.createTrxName(), true); + trx.start(); + + try + { + POSTerminalManager.setTerminalLockStatus(ctx, terminalBean.getTerminalId(), false, trx.getTrxName()); + trx.commit(); + } + catch (Exception ex) + { + postGlobalError("error.operation", request); + } + finally + { + trx.rollback(); + trx.close(); + } + + return viewTerminal(mapping, form, request, response); + } +} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/UOMAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/UOMAction.java new file mode 100644 index 0000000000..b1641a19a6 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/pos/UOMAction.java @@ -0,0 +1,44 @@ +package org.posterita.struts.pos; + +import java.util.Properties; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.posterita.core.TmkJSPEnv; +import org.posterita.exceptions.ApplicationException; +import org.posterita.exceptions.OperationException; + +public class UOMAction extends POSDispatchAction +{ + + public static final String CREATE_OR_UPDATE_UOM = "createOrUpdateUOM"; + public ActionForward createOrUpdateUOM(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + return null; + } + + public static final String VIEW_UOM = "viewUOM"; + public ActionForward viewUOM(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + return null; + } + + public static final String LIST_UOMS = "listUOMs"; + public ActionForward listUOMs(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd=init(mapping,form,request,response); + + if (fwd!=null) + { + return fwd; + } + Properties ctx=TmkJSPEnv.getCtx(request); + + return null; + } + +} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/VendorAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/VendorAction.java new file mode 100644 index 0000000000..f3e7051acb --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/pos/VendorAction.java @@ -0,0 +1,288 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on 25-Jul-2005 by alok + * + */ + +package org.posterita.struts.pos; + +import java.util.ArrayList; +import java.util.Properties; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.compiere.util.KeyNamePair; +import org.compiere.util.Trx; +import org.posterita.Constants; +import org.posterita.beans.PriceListBean; +import org.posterita.beans.VendorBean; +import org.posterita.businesslogic.administration.PriceListManager; +import org.posterita.businesslogic.administration.VendorManager; +import org.posterita.core.TmkJSPEnv; +import org.posterita.core.TrxPrefix; +import org.posterita.exceptions.ApplicationException; +import org.posterita.exceptions.NoAccessToEditObjectException; +import org.posterita.exceptions.OperationException; +import org.posterita.form.VendorForm; +import org.posterita.struts.core.DefaultForm; + +public class VendorAction extends POSDispatchAction +{ + public static final String SAVE_VENDOR = "saveVendor"; + public ActionForward saveVendor(ActionMapping mapping, ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + + ActionForward fwd=init(mapping,form,request,response); + if (fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + DefaultForm df = (DefaultForm) form; + VendorBean bean = (VendorBean) df.getBean(); + + Trx trx = Trx.get(TrxPrefix.getPrefix(), true); + + Integer partnerId = 0; + + if (bean.getBpartnerId() != null) + partnerId = bean.getBpartnerId(); + + try + { + trx.start(); + VendorManager.saveVendor(ctx, partnerId, bean, trx.getTrxName()); + trx.commit(); + } + catch(NoAccessToEditObjectException e) + { + trx.rollback(); + postGlobalError("error.no.edit.access", request); + return mapping.getInputForward(); + } + catch(OperationException ex) + { + trx.rollback(); + throw ex; + } + finally + { + trx.close(); + } + request.setAttribute(Constants.VENDOR_DETAILS,bean); + + return mapping.findForward(SAVE_VENDOR); + } + + public static final String VIEW_VENDOR = "viewVendorDetails"; + public ActionForward viewVendorDetails1(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd = init(mapping,form,request,response); + + if (fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + VendorForm uf = (VendorForm) form; + + int vendorId = Integer.valueOf(uf.getBpartnerId()).intValue(); + + VendorBean vendorBean = VendorManager.getVendor(ctx,vendorId); + + request.getSession().setAttribute(Constants.VENDOR_DETAILS,vendorBean); + + return mapping.findForward(VIEW_VENDOR); + } + + + public static final String INIT_SEARCH_VENDOR = "initSearchVendors"; + public ActionForward initSearchVendors(ActionMapping mapping, ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd=init(mapping,form,request,response); + + if (fwd!=null) + return fwd; + + request.getSession().removeAttribute(Constants.VENDOR_LIST); + + return mapping.findForward(INIT_SEARCH_VENDOR); + } + + + public static final String SEARCH_VENDOR = "searchVendors"; + public ActionForward searchVendors(ActionMapping mapping, ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd=init(mapping,form,request,response); + + if (fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + DefaultForm df = (DefaultForm) form; + + ArrayList vendorList = VendorManager.searchVendors(ctx, df.getName()); + + request.getSession().setAttribute(Constants.VENDOR_LIST,vendorList); + + return mapping.findForward(SEARCH_VENDOR); + } + + + public static final String INIT_EDIT_VENDOR = "initEditVendor"; + public ActionForward initEditVendor(ActionMapping mapping, ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + + ActionForward fwd=init(mapping,form,request,response); + if (fwd!=null) + return fwd; + Properties ctx = TmkJSPEnv.getCtx(request); + + VendorForm f = (VendorForm) form; + f.validate(mapping,request); + + VendorBean bean = (VendorBean) f.getBean(); + + Integer bpartnerId = bean.getBpartnerId(); + if(bpartnerId==null) + { + throw new OperationException("Cannot edit vendor. Cause vendor id cannot be null!"); + } + + bean = VendorManager.getVendor(ctx,bpartnerId.intValue()); + f.populate(bean); + + ArrayList activePriceLists = PriceListManager.getPriceLists(ctx,0,"",true,null,null,false,null); + ArrayList priceListsKNP = PriceListManager.getKeyNamePair(ctx, activePriceLists); + request.getSession().setAttribute(Constants.USER_PRICE_LISTS, priceListsKNP); + + return mapping.findForward(INIT_EDIT_VENDOR); + } + + + public static final String ACTIVATE_VENDOR = "activateVendor"; + @SuppressWarnings("unchecked") + public ActionForward activateVendor(ActionMapping mapping, ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + + ActionForward fwd=init(mapping,form,request,response); + if (fwd!=null) + return fwd; + Properties ctx = TmkJSPEnv.getCtx(request); + + VendorForm f = (VendorForm) form; + f.validate(mapping,request); //copying the value from the form to the bean + + VendorBean bean = (VendorBean) f.getBean(); + + Integer bpartnerId = bean.getBpartnerId(); + + if(bpartnerId==null) + { + throw new OperationException("Cannot edit vendor. Cause: Vendor id cannot be null!"); + } + + Trx trx = Trx.get(TrxPrefix.getPrefix(), true); + + + try + { + trx.start(); + VendorManager.activateVendor(ctx,bpartnerId.intValue(), trx.getTrxName()); + trx.commit(); + } + catch (OperationException e) + { + trx.rollback(); + postGlobalError("error.activate.vendor", request); + mapping.getInputForward(); + } + finally + { + trx.close(); + } + + ArrayList list = (ArrayList) request.getSession().getAttribute(Constants.VENDOR_LIST); + ArrayList vendorBeanList = list; + + ArrayList newList = VendorManager.updateVendorListStatus(vendorBeanList, bpartnerId, true); + + request.getSession().setAttribute(Constants.VENDOR_LIST, newList); + + + return mapping.findForward(SEARCH_VENDOR); + } + + public static final String DEACTIVATE_VENDOR = "deactivateVendor"; + @SuppressWarnings("unchecked") + public ActionForward deactivateVendor(ActionMapping mapping, ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + + ActionForward fwd=init(mapping,form,request,response); + if (fwd!=null) + return fwd; + Properties ctx = TmkJSPEnv.getCtx(request); + + VendorForm f = (VendorForm) form; + f.validate(mapping,request); //copying the value from the form to the bean + + VendorBean bean = (VendorBean) f.getBean(); + + Integer bpartnerId = bean.getBpartnerId(); + if(bpartnerId==null) + { + throw new OperationException("Cannot edit vendor. Cause vendor id cannot be null!"); + } + + Trx trx = Trx.get(TrxPrefix.getPrefix(), true); + + try + { + trx.start(); + VendorManager.deactivateVendor(ctx,bpartnerId.intValue(), trx.getTrxName()); + trx.commit(); + } + catch (OperationException e) + { + trx.rollback(); + postGlobalError("error.deactivate.vendor", request); + mapping.getInputForward(); + } + finally + { + trx.close(); + } + + ArrayList list = (ArrayList) request.getSession().getAttribute(Constants.VENDOR_LIST); + ArrayList vendorBeanList = list; + + ArrayList newList = VendorManager.updateVendorListStatus(vendorBeanList, bpartnerId, false); + + request.getSession().setAttribute(Constants.VENDOR_LIST, newList); + + return mapping.findForward(SEARCH_VENDOR); + } + + + +} diff --git a/posterita/posterita/src/main/org/posterita/struts/stock/StockAction.java b/posterita/posterita/src/main/org/posterita/struts/stock/StockAction.java new file mode 100644 index 0000000000..02903b9ad5 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/stock/StockAction.java @@ -0,0 +1,237 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +package org.posterita.struts.stock; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Properties; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.posterita.Constants; +import org.posterita.beans.ItemBean; +import org.posterita.beans.ShoppingCartBean; +import org.posterita.businesslogic.stock.StockManager; +import org.posterita.core.TmkJSPEnv; +import org.posterita.exceptions.ApplicationException; +import org.posterita.exceptions.OperationException; +import org.posterita.exceptions.ProductNotOnPriceListException; +import org.posterita.struts.core.BaseDispatchAction; +import org.posterita.struts.core.DefaultForm; +import org.posterita.struts.pos.POSGoodsAction; + + +public class StockAction extends BaseDispatchAction +{ + + + + public static final String DELETE_FROM_CART = "deleteFromCart"; + public ActionForward deleteFromCart(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd = init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + DefaultForm df = (DefaultForm) form; + + ItemBean bean = (ItemBean) df.getBean(); + + ArrayList cartItems = (ArrayList) request.getSession().getAttribute(Constants.SHOPPING_CART_ITEMS); + ShoppingCartBean cartBeans = (ShoppingCartBean) request.getSession().getAttribute(Constants.SHOPPING_CART); + + if (cartItems == null || cartItems.size() == 0) + return mapping.findForward(DELETE_FROM_CART); + + cartItems = StockManager.deleteItemFromList(cartItems, bean.getProductId()); + BigDecimal grandTotal = StockManager.setGrandTotal(cartItems); + cartBeans.setTotalPrice(grandTotal); + + request.getSession().setAttribute(Constants.SHOPPING_CART_ITEMS, cartItems); + request.getSession().setAttribute(Constants.SHOPPING_CART, cartBeans); + + return mapping.findForward(DELETE_FROM_CART); + } + + public static final String DELETE_FROM_POS_CART = "deleteFromPOSCart"; + public ActionForward deleteFromPOSCart(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException + { + + ActionForward fwd = init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + DefaultForm df = (DefaultForm) form; + + String orderType = df.getOrderType(); + ItemBean bean = (ItemBean) df.getBean(); + + if(orderType==null) + { + orderType=(String)request.getSession().getAttribute(Constants.ORDER_TYPE); + } + + String shoppingCartItem = null; + String path=null; + if(orderType.equalsIgnoreCase(Constants.CREDIT_ORDER)) + { + shoppingCartItem = Constants.CREDIT_ORDER_SHOPPING_CART_ITEMS; + path="/jsp/pos/creditOrderShoppingCart.jsp"; + } + else + { + shoppingCartItem = Constants.SHOPPING_ORDER_CART_ITEMS; + path="/jsp/pos/posShoppingCartFirstPage.jsp"; + + } + ArrayList items = (ArrayList) request.getSession().getAttribute(shoppingCartItem); + ArrayList itemsInCart = StockManager.deleteItemFromPOSList(ctx,items, bean.getProductId(),true); + request.getSession().setAttribute(shoppingCartItem, itemsInCart); + return new ActionForward(path); + } + + + + public static final String DELETE_FROM_CREDIT_ORDER_CART = "deleteFromCreditOrderCart"; + public ActionForward deleteFromCreditOrderCart(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException + { + + ActionForward fwd = init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + DefaultForm df = (DefaultForm) form; + + //String orderType = df.getOrderType(); + ItemBean bean = (ItemBean) df.getBean(); + + + ArrayList items = (ArrayList) request.getSession().getAttribute(Constants.CREDIT_ORDER_SHOPPING_CART_ITEMS); + + ArrayList itemsInCart = StockManager.deleteItemFromPOSList(ctx,items, bean.getProductId(),true); + + + request.getSession().setAttribute(Constants.CREDIT_ORDER_SHOPPING_CART_ITEMS, itemsInCart); + + return new ActionForward("/jsp/pos/creditOrderShoppingCart.jsp"); + } + + public static final String DELETE_FROM_POS_GRN_CART = "deleteFromPOSGRNCart"; + public ActionForward deleteFromPOSGRNCart(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd = init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + DefaultForm df = (DefaultForm) form; + ItemBean bean = (ItemBean) df.getBean(); + + String orderType = df.getOrderType(); + //String shoppingCart = null; + String shoppingCartItem = null; + + if(orderType.equals(Constants.GOODS_RECEIVE_NOTE)) + { + //shoppingCart = Constants.GOODS_RECEIVE_NOTE_SHOPPING_CART; + shoppingCartItem = Constants.GOODS_RECEIVE_NOTE_SHOPPING_CART_ITEMS; + } + else if(orderType.equals(Constants.GOODS_RETURN_NOTE)) + { + //shoppingCart = Constants.GOODS_RETURN_NOTE_SHOPPING_CART; + shoppingCartItem = Constants.GOODS_RETURN_NOTE_SHOPPING_CART_ITEMS; + } + else if(orderType.equals(Constants.CUSTOMER_RETURN_ORDER)) + { + //shoppingCart = Constants.CUSTOMER_RETURN_ORDER_SHOPPING_CART; + shoppingCartItem = Constants.CUSTOMER_RETURN_ORDER_SHOPPING_CART_ITEMS; + } + + + ArrayList items = (ArrayList) request.getSession().getAttribute(shoppingCartItem); + + ArrayList itemsInCart = StockManager.deleteItemFromPOSList(ctx,items, bean.getProductId(),false); + + request.getSession().setAttribute(shoppingCartItem, itemsInCart); + + POSGoodsAction action = new POSGoodsAction(); + ActionForward forward = action.getShoppingCart(mapping,form,request,response); + + return forward; + } + + public static final String DELETE_FROM_POS_RET_CART = "deleteFromPOSRetCart"; + public ActionForward deleteFromPOSRetCart(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, ProductNotOnPriceListException, OperationException + { + + ActionForward fwd = init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + DefaultForm df = (DefaultForm) form; + + ItemBean bean = (ItemBean) df.getBean(); + + ArrayList items = (ArrayList) request.getSession().getAttribute(Constants.SHOPPING_GRN_CART_ITEMS); + + ArrayList itemsInCart = StockManager.deleteItemFromPOSList(ctx,items, bean.getProductId(),false); + + request.getSession().setAttribute(Constants.SHOPPING_GRN_CART_ITEMS, itemsInCart); + + return mapping.findForward(DELETE_FROM_POS_RET_CART); + } + + + public static final String DELETE_FROM_CUST_RET_CART = "deleteFromCustRetCart"; + public ActionForward deleteFromCustRetCart(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, ProductNotOnPriceListException, OperationException + { + ActionForward fwd = init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + DefaultForm df = (DefaultForm) form; + + ItemBean bean = (ItemBean) df.getBean(); + + ArrayList items = (ArrayList) request.getSession().getAttribute(Constants.SHOPPING_GRN_CART_ITEMS); + + ArrayList itemsInCart = StockManager.deleteItemFromPOSList(ctx,items, bean.getProductId(),true); + + request.getSession().setAttribute(Constants.SHOPPING_GRN_CART_ITEMS, itemsInCart); + + return mapping.findForward(DELETE_FROM_CUST_RET_CART); + } + + + + +} diff --git a/posterita/posterita/src/main/org/posterita/struts/stock/StockMovementAction.java b/posterita/posterita/src/main/org/posterita/struts/stock/StockMovementAction.java new file mode 100644 index 0000000000..d5a1f65822 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/struts/stock/StockMovementAction.java @@ -0,0 +1,912 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on May 22, 2006 by alok + */ +package org.posterita.struts.stock; + +import java.io.IOException; +import java.io.PrintWriter; +import java.math.BigDecimal; +import java.sql.Timestamp; +import java.text.ParseException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Properties; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.apache.struts.action.ActionMessage; +import org.apache.struts.action.ActionMessages; +import org.apache.struts.util.MessageResources; +import org.compiere.model.MMovement; +import org.compiere.model.MProduct; +import org.compiere.util.Env; +import org.compiere.util.Trx; +import org.posterita.Constants; +import org.posterita.beans.ItemBean; +import org.posterita.beans.MMovementCartBean; +import org.posterita.beans.StockMovementBean; +import org.posterita.businesslogic.administration.PriceListManager; +import org.posterita.businesslogic.stock.MMovementManager; +import org.posterita.businesslogic.stock.StockManager; +import org.posterita.core.TimestampConvertor; +import org.posterita.core.TmkJSPEnv; +import org.posterita.core.TrxPrefix; +import org.posterita.exceptions.ApplicationException; +import org.posterita.exceptions.InputQuantityLessThanZeroException; +import org.posterita.exceptions.OperationException; +import org.posterita.exceptions.ProductNotFoundException; +import org.posterita.exceptions.ProductNotOnPriceListException; +import org.posterita.exceptions.QuantityNotAvailableException; +import org.posterita.form.StockMovementForm; +import org.posterita.lib.UdiConstants; +import org.posterita.struts.core.BaseDispatchAction; +import org.posterita.struts.core.DefaultForm; + +public class StockMovementAction extends BaseDispatchAction +{ + public static final String VIEW_STOCK = "viewStock"; + public ActionForward viewStock(ActionMapping mapping, ActionForm form, + HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException, IOException + { + ActionForward fwd = init(mapping, form, request, response); + + if (fwd != null) + { + return fwd; + } + + Properties ctx = TmkJSPEnv.getCtx(request); + StockMovementForm stockForm = (StockMovementForm)form; + StockMovementBean bean = (StockMovementBean)stockForm.getBean(); + + + Integer orgFromId = bean.getOrgFromId(); + int orgToId = bean.getOrgToId(); + String productName = bean.getProductName() == null? "" : bean.getProductName(); + String description = bean.getDescription() == null? "" : bean.getDescription(); + String barcode = bean.getBarCode() == null? "" : bean.getBarCode(); + + Integer preOrgFromId = (Integer)request.getSession().getAttribute(Constants.PRE_ORG_FROM_ID); + preOrgFromId = preOrgFromId == null?0:preOrgFromId; + HashMap stockProductList = (HashMap) request.getSession().getAttribute(Constants.STOCK_PRODUCT_LIST); + ArrayList stockList = (ArrayList) request.getSession().getAttribute(Constants.MATERIAL_MOVEMENT_ITEMS); + + stockProductList = stockProductList == null? new HashMap(): stockProductList; + stockList = stockList == null? new ArrayList():stockList; + + try + { + ArrayList productList = MMovementManager.getAvailableProducts(ctx, orgFromId, productName, + description, barcode, null); + + stockList = MMovementManager.convertToBeanList(ctx,stockList, stockProductList, productList, preOrgFromId, orgFromId, orgToId, null); + } + catch (ProductNotFoundException e) + { + postGlobalError("error.product.not.found", e.getMessage(),request); + } + + request.getSession().setAttribute(Constants.MATERIAL_MOVEMENT_ITEMS, stockList); + request.getSession().setAttribute(Constants.STOCK_PRODUCT_LIST, stockProductList); + request.getSession().setAttribute(Constants.PRE_ORG_FROM_ID, orgFromId); + return mapping.findForward(VIEW_STOCK); + + } + + public static final String VIEW_OR_EDIT_MMOVEMENT = "viewOrEditMMovement"; + public ActionForward viewOrEditMMovement (ActionMapping mapping, ActionForm form, + HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd = init(mapping, form, request, response); + + if (fwd != null) + { + return fwd; + } + + Properties ctx = TmkJSPEnv.getCtx(request); + StockMovementForm stockForm = (StockMovementForm)form; + StockMovementBean bean = (StockMovementBean)stockForm.getBean(); + + return null; + } + + public static final String VIEW_MATERIAL_MOVEMENT_HISTORY="viewMMovementHistory"; + public ActionForward viewMMovementHistory(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd= init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + DefaultForm sf = (DefaultForm)form; + StockMovementBean bean = (StockMovementBean) sf.getBean(); + + Properties ctx =TmkJSPEnv.getCtx(request); + ArrayList list = MMovementManager.viewMMovementHistory(ctx, bean.getDocStatus(), bean.getMonth(), bean.getYear()); + request.setAttribute(Constants.MATERIAL_MOVEMENT_LIST, list); + return mapping.findForward(VIEW_MATERIAL_MOVEMENT_HISTORY); + } + + public static final String VIEW_MATERIAL_MOVEMENT = "viewMMovement"; + public ActionForward viewMMovement(ActionMapping mapping, ActionForm form, + HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd = init(mapping, form, request, response); + + if (fwd != null) + { + return fwd; + } + + Properties ctx = TmkJSPEnv.getCtx(request); + StockMovementForm stockForm = (StockMovementForm)form; + StockMovementBean bean = (StockMovementBean)stockForm.getBean(); + + int orgId = Env.getAD_Org_ID(ctx); + String docStatus = bean.getDocStatus(); + String f_Date = bean.getFromDate(); + String t_Date = bean.getToDate(); + String docNo = bean.getDocumentNo(); + Timestamp fromDate = TimestampConvertor.getCurrentDateTimeTimestamp(); + Timestamp toDate = TimestampConvertor.getCurrentDateTimestamp(); + + if (f_Date != null) + { + fromDate = TimestampConvertor.getTimestamp(f_Date, TimestampConvertor.BIRTH_DATE); + } + if (t_Date!=null) + { + toDate = TimestampConvertor.getTimestamp(t_Date, TimestampConvertor.BIRTH_DATE); + } + + ArrayList m_list = MMovementManager.getMovementByOrgFrom(ctx,orgId, docStatus, docNo, fromDate, toDate); + + request.getSession().setAttribute(Constants.MATERIAL_MOVEMENT, m_list); + return mapping.findForward(VIEW_MATERIAL_MOVEMENT); + + } + + public static final String VIEW_MOVE_CONFIRM = "viewMoveConfirm"; + public ActionForward viewMoveConfirm(ActionMapping mapping, ActionForm form, + HttpServletRequest request, HttpServletResponse response) throws ApplicationException + { + ActionForward fwd = init(mapping, form, request, response); + + if (fwd != null) + { + return fwd; + } + + Properties ctx = TmkJSPEnv.getCtx(request); + + int orgToId = Env.getAD_Org_ID(ctx); + + ArrayList m_list = MMovementManager.getMoveConfirmByOrgTo(ctx, orgToId, null); + + request.getSession().setAttribute(Constants.MOVE_CONFIRM, m_list); + + return mapping.findForward(VIEW_MOVE_CONFIRM); + + } + + public static final String VIEW_MATERIAL_MOVEMENT_LINES = "viewMMovementLines"; + public ActionForward viewMMovementLines(ActionMapping mapping, ActionForm form, + HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd = init(mapping, form, request, response); + + if (fwd != null) + { + return fwd; + } + + Properties ctx = TmkJSPEnv.getCtx(request); + StockMovementForm stockForm = (StockMovementForm)form; + StockMovementBean bean = (StockMovementBean)stockForm.getBean(); + int movementId = bean.getMovementId(); + + StockMovementBean movementBean = MMovementManager.getBean(ctx, movementId); + ArrayList m_list = MMovementManager.getMovementLines(ctx,movementId); + + request.getSession().setAttribute(Constants.MMOVEMENT, movementBean); + request.getSession().setAttribute(Constants.MATERIAL_MOVEMENT_LINES, m_list); + return mapping.findForward(VIEW_MATERIAL_MOVEMENT_LINES); + } + + public static final String VIEW_MATERIAL_MOVEMENT_LINES_HISTORY = "viewMoveLinesHistory"; + public ActionForward viewMoveLinesHistory(ActionMapping mapping, ActionForm form, + HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd = init(mapping, form, request, response); + + if (fwd != null) + { + return fwd; + } + + Properties ctx = TmkJSPEnv.getCtx(request); + StockMovementForm stockForm = (StockMovementForm)form; + StockMovementBean bean = (StockMovementBean)stockForm.getBean(); + int movementId = bean.getMovementId(); + + StockMovementBean movementBean = MMovementManager.getBean(ctx, movementId); + ArrayList m_list = MMovementManager.getMovementLines(ctx,movementId); + + request.getSession().setAttribute(Constants.MMOVEMENT, movementBean); + request.getSession().setAttribute(Constants.MATERIAL_MOVEMENT_LINES, m_list); + return mapping.findForward(VIEW_MATERIAL_MOVEMENT_LINES_HISTORY); + } + + public static final String VIEW_MOVE_CONFIRM_LINES = "viewMoveConfirmLines"; + public ActionForward viewMoveConfirmLines(ActionMapping mapping, ActionForm form, + HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd = init(mapping, form, request, response); + + if (fwd != null) + { + return fwd; + } + + Properties ctx = TmkJSPEnv.getCtx(request); + StockMovementForm stockForm = (StockMovementForm)form; + StockMovementBean bean = (StockMovementBean)stockForm.getBean(); + int movementId = bean.getMovementId(); + int moveConfirmId = bean.getMoveConfirmId(); + StockMovementBean movementBean = MMovementManager.getBean(ctx, movementId); + movementBean.setMoveConfirmId(moveConfirmId); + ArrayList m_list = MMovementManager.getMovementLines(ctx,movementId); + request.getSession().setAttribute(Constants.MMOVEMENT, movementBean); + request.getSession().setAttribute(Constants.MOVE_CONFIRM_LINES, m_list); + return mapping.findForward(VIEW_MOVE_CONFIRM_LINES); + } + + public static final String CREATE_MATERIAL_MOVEMENT = "createMMovement"; + public ActionForward createMMovement(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException, IOException + { + ActionForward fwd = init(mapping, form, request, response); + + if (fwd != null) + { + return fwd; + } + Properties ctx = TmkJSPEnv.getCtx(request); + StockMovementForm stockForm = (StockMovementForm)form; + StockMovementBean stockMovementBean = (StockMovementBean)stockForm.getBean(); + + String movementCart = Constants.MMOVEMENT_CART; + String movementCartItems = Constants.MMOVEMENT_CART_ITEMS; + + String description = request.getParameter("description"); + String priceListIdAsStr = request.getParameter("priceListId"); + String movementIdAsStr = request.getParameter("movementId"); + String orgFromIdAsStr = request.getParameter("orgFromId"); + String orgToIdAsStr = request.getParameter("orgToId"); + int priceListId = Integer.parseInt(priceListIdAsStr); + int movementId = Integer.parseInt(movementIdAsStr); + Integer orgFromId = Integer.parseInt(orgFromIdAsStr); + Integer orgToId = Integer.parseInt(orgToIdAsStr); + + stockMovementBean.setMovementId(movementId); + stockMovementBean.setDescription(description); + stockMovementBean.setPriceListId(priceListId); + stockMovementBean.setOrgFromId(orgFromId); + stockMovementBean.setOrgToId(orgToId); + stockForm.populate(stockMovementBean); + + Trx trx = Trx.get(TrxPrefix.getPrefix(), true); + String docNo = null; + String docStatus = null; + String docInfo = null; + + ArrayList itemList = (ArrayList) request.getSession().getAttribute(Constants.MMOVEMENT_CART_ITEMS); + + if(stockMovementBean.getMovementId() == null || stockMovementBean.getMovementId() == 0) + { + MMovement mmovement = MMovementManager.createInventoryMove(ctx, stockMovementBean.getDescription(), null); + docNo = mmovement.getDocumentNo(); + docInfo = mmovement.getDocumentInfo(); + docStatus = mmovement.getDocStatus(); + stockMovementBean.setDocumentNo(docNo); + stockMovementBean.setMovementId(mmovement.getM_Movement_ID()); + + } + else + { + MMovement mmovement2 = new MMovement(ctx, stockMovementBean.getMovementId(), null); + mmovement2.setDescription(stockMovementBean.getDescription()); + docNo = mmovement2.getDocumentNo(); + docInfo = mmovement2.getDocumentInfo(); + docStatus = mmovement2.getDocStatus(); + stockMovementBean.setDocumentNo(docNo); + stockMovementBean.setMovementId(mmovement2.getM_Movement_ID()); + mmovement2.save(); + + MMovementManager.deleteMovementLines(ctx, mmovement2.getM_Movement_ID()); + + } + + try + { + trx.start(); + + for (ItemBean itemBean : itemList) + { + MMovementManager.createOrUpdateMaterialMovementLine(ctx, stockMovementBean.getMovementId(), itemBean.getProductId(), itemBean.getQtyToMove(), stockMovementBean.getOrgFromId(), stockMovementBean.getOrgToId(), trx.getTrxName()); + } + + trx.commit(); + } + catch (OperationException e) + { + trx.rollback(); + postGlobalError("error.process", e.getMessage(), request); + } + finally + { + trx.close(); + } + + stockForm.populate(stockMovementBean); + + request.getSession().setAttribute(Constants.DOC_NO, docNo); + request.getSession().setAttribute(Constants.DOC_STATUS, docStatus); + request.getSession().setAttribute(Constants.MMOVEMENT_ID, stockMovementBean.getMovementId()); + request.getSession().setAttribute(Constants.DESCRIPTION, description); + + Env.setContext(ctx, Constants.MMOVEMENT_ID, stockMovementBean.getMovementId()); + + + if((MMovement.DOCSTATUS_Drafted).equals(docStatus)) + { + docStatus = "DRAFTED"; + } + + if((MMovement.DOCSTATUS_Completed).equals(docStatus)) + { + docStatus = "COMPLETED"; + } + + if((MMovement.DOCSTATUS_Closed).equals(docStatus)) + { + docStatus = "CLOSED"; + } + + if((MMovement.DOCSTATUS_InProgress).equals(docStatus)) + { + docStatus = "IN PROGRESS"; + } + + if((MMovement.DOCSTATUS_Approved).equals(docStatus)) + { + docStatus = "APPROVED"; + } + + + StringBuffer sb = new StringBuffer(); + sb.append("{"); + sb.append("movementId: \"" + stockMovementBean.getMovementId() + "\""); + sb.append(", docNo: \"" + docNo + "\""); + sb.append(", docStatus: \"" + docStatus + "\""); + sb.append(", docInfo: \"" + docInfo + "\""); + sb.append(", description: \"" + stockMovementBean.getDescription() + "\""); + sb.append("}"); + + PrintWriter writer = response.getWriter(); + writer.print( sb.toString() ); + writer.flush(); + writer.close(); + + return null; + } + + public static final String COMPLETE_MATERIAL_MOVEMENT = "completeMMovement"; + public ActionForward completeMMovement(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception + { + ActionForward fwd = init(mapping, form, request, response); + + if (fwd != null) + { + return fwd; + } + Properties ctx = TmkJSPEnv.getCtx(request); + + StockMovementForm stockForm = (StockMovementForm)form; + StockMovementBean stockMovementBean = (StockMovementBean)stockForm.getBean(); + + ArrayList itemList = (ArrayList) request.getSession().getAttribute(Constants.MMOVEMENT_CART_ITEMS); + + Trx trx = Trx.get(TrxPrefix.getPrefix(), true); + + try + { + if(stockMovementBean.getMovementId() == null || stockMovementBean.getMovementId() == 0) + { + MMovement mmovement = MMovementManager.createInventoryMove(ctx, stockMovementBean.getReference(), null); + stockMovementBean.setMovementId(mmovement.get_ID()); + stockMovementBean.setDocumentNo(mmovement.getDocumentNo()); + stockMovementBean.setDocStatus(mmovement.getDocStatus()); + mmovement.save(); + + trx.start(); + + for (ItemBean itemBean : itemList) + { + MMovementManager.createOrUpdateMaterialMovementLine(ctx, stockMovementBean.getMovementId(), itemBean.getProductId(), itemBean.getQtyToMove(), stockMovementBean.getOrgFromId(), stockMovementBean.getOrgToId(), trx.getTrxName()); + } + + trx.commit(); + + MMovementManager.completeMaterialMovement(ctx, stockMovementBean.getMovementId(), trx.getTrxName()); + } + else + { + MMovementManager.deleteMovementLines(ctx, stockMovementBean.getMovementId()); + + trx.start(); + + for (ItemBean itemBean : itemList) + { + MMovementManager.createOrUpdateMaterialMovementLine(ctx, stockMovementBean.getMovementId(), itemBean.getProductId(), itemBean.getQtyToMove(), stockMovementBean.getOrgFromId(), stockMovementBean.getOrgToId(), trx.getTrxName()); + } + + trx.commit(); + + MMovementManager.completeMaterialMovement(ctx, stockMovementBean.getMovementId(), trx.getTrxName()); + + } + } + catch (OperationException e) + { + trx.rollback(); + trx.close(); + } + + ArrayList list = MMovementManager.getMovementLines(ctx, stockMovementBean.getMovementId()); + request.getSession().setAttribute(Constants.MATERIAL_MOVEMENT, list); + + MMovementManager.clearCart(ctx, request); + return mapping.findForward(VIEW_MATERIAL_MOVEMENT); + + } + + public static final String COMPLETE_MOVE_CONFIRM = "completeMoveConfirm"; + public ActionForward completeMoveConfirm(ActionMapping mapping, ActionForm form, + HttpServletRequest request, HttpServletResponse response) throws ApplicationException + { + ActionForward fwd = init(mapping, form, request, response); + + if (fwd != null) + { + return fwd; + } + Properties ctx = TmkJSPEnv.getCtx(request); + + StockMovementForm stockForm = (StockMovementForm)form; + StockMovementBean stockMovementBean = (StockMovementBean)stockForm.getBean(); + + int moveConfirmId = stockMovementBean.getMoveConfirmId(); + + + Trx trx = Trx.get(TrxPrefix.getPrefix(), true); + ArrayList bean = null; + try + { + trx.start(); + MMovementManager.completeMoveConfirm(ctx, moveConfirmId, trx.getTrxName()); + + trx.commit(); + } + catch (OperationException e) + { + trx.rollback(); + trx.close(); + } + ArrayList list = (ArrayList)request.getSession().getAttribute(Constants.MOVE_CONFIRM); + bean = MMovementManager.getConfirmList(ctx, list, moveConfirmId); + + request.getSession().setAttribute(Constants.MOVE_CONFIRM, bean); + return mapping.findForward(VIEW_MOVE_CONFIRM); + + } + + public ActionForward setOrgFrom(ActionMapping mapping, ActionForm form, + HttpServletRequest request, HttpServletResponse response) throws ApplicationException + { + ActionForward fwd = init(mapping, form, request, response); + + if (fwd != null) + { + return fwd; + } + Properties ctx = TmkJSPEnv.getCtx(request); + + StockMovementForm stockForm = (StockMovementForm)form; + StockMovementBean stockMovementBean = (StockMovementBean)stockForm.getBean(); + Integer orgFromId = stockMovementBean.getOrgFromId(); + + if (orgFromId != null) + { + request.getSession().setAttribute(Constants.ORG_FROM_ID, orgFromId); + } + + return null; + } + + + public ActionForward setQtyToMove(ActionMapping mapping, ActionForm form, + HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd = init(mapping, form, request, response); + + if (fwd != null) + { + return fwd; + } + Properties ctx = TmkJSPEnv.getCtx(request); + String qtyToMove = request.getParameter("qtyToMove"); + String index = request.getParameter("index"); + String salesPriceListId = request.getParameter("salesPriceListId"); + + Double qty = Double.valueOf(qtyToMove); + BigDecimal qtyToMov = BigDecimal.valueOf(qty); + Integer ind = Integer.valueOf(index); + Integer salesPrId = 0; + if (salesPriceListId != null) + { + salesPrId = Integer.valueOf(salesPriceListId); + } + ArrayList stockList = (ArrayList)request.getSession().getAttribute(Constants.MATERIAL_MOVEMENT_ITEMS); + BigDecimal stockValue = MMovementManager.setQtyToMove(ctx, qtyToMov, ind, salesPrId, stockList); + + return null; + } + + + //--------------------------------------------------------------------------------------------------------------// + + public static final String ADD_TO_MMOVEMENT_CART = "addToMMovementCart"; + public ActionForward addToMMovementCart(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException + { + ActionForward fwd = init(mapping, form, request, response); + + if (fwd != null) + { + return fwd; + } + Properties ctx = TmkJSPEnv.getCtx(request); + + StockMovementForm stockForm = (StockMovementForm)form; + StockMovementBean stockMovementBean = (StockMovementBean)stockForm.getBean(); + + String movementCart = Constants.MMOVEMENT_CART; + String movementCartItems = Constants.MMOVEMENT_CART_ITEMS; + Trx trx = Trx.get(TrxPrefix.getPrefix(),true); + + MMovementCartBean mmovementBean = (MMovementCartBean) request.getSession().getAttribute(movementCart); + + try + { + if(stockMovementBean.getProductId()==null && stockMovementBean.getBarCode()==null) + { + postGlobalError("error.barcode.required", request); + return mapping.getInputForward(); + } + + BigDecimal qty = stockMovementBean.getQtyToMove(); + if(qty != null && qty.doubleValue() < 0.0) + { + throw new InputQuantityLessThanZeroException(""); + } + + + trx.start(); + mmovementBean = StockManager.addToMovementCart(ctx, stockMovementBean, mmovementBean, false, Boolean.parseBoolean(stockMovementBean.getIfAdd())); + trx.commit(); + } + catch (InputQuantityLessThanZeroException e) + { + postGlobalError("error.invalid.inputQty", request); + trx.rollback(); + return mapping.getInputForward(); + } + catch (ProductNotFoundException e) + { + postGlobalError("error.product.not.found", e.getMessage(), request); + trx.rollback(); + return mapping.getInputForward(); + } + catch(QuantityNotAvailableException e) + { + postGlobalError("error.quantity.notAvailable", e.getMessage(), request); + trx.rollback(); + return mapping.getInputForward(); + } + + catch(ProductNotOnPriceListException e) + { + postGlobalError("error.product.price.not.found", e.getMessage(), request); + trx.rollback(); + return mapping.getInputForward(); + } + catch(OperationException e) + { + postGlobalError("error.inventory.not.available", e.getMessage(), request); + trx.rollback(); + return mapping.getInputForward(); + } + finally + { + trx.close(); + } + + int priceListId = Env.getContextAsInt(ctx, UdiConstants.PRICELIST_CTX_PARAM); + String currSymboleSales = PriceListManager.getCurrency(ctx, priceListId); + request.setAttribute(Constants.CURRENCY_SYMBOLE,currSymboleSales); + + request.getSession().setAttribute(movementCart, mmovementBean); + request.getSession().setAttribute(movementCartItems, mmovementBean.getItems()); + + return mapping.findForward(ADD_TO_MMOVEMENT_CART); + } + + public ActionForward addProduct(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException, IOException, ParseException + { + // Bug fix for null pointer + StockMovementForm stockForm = (StockMovementForm)form; + if(stockForm.getQtyToMove() == null) + { + stockForm.setQtyToMove("1"); + } + + addToMMovementCart(mapping,form,request,response); + + return getMMovementCart(mapping,form,request,response); + } + + + public static final String INCREMENT_QTY = "incrementQty"; + public ActionForward incrementQty(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception + { + StockMovementForm stockForm = (StockMovementForm)form; + StockMovementBean stockMovementBean = (StockMovementBean)stockForm.getBean(); + stockMovementBean.setQtyToMove(new BigDecimal(1)); + + addToMMovementCart(mapping,form,request,response); + return getMMovementCart(mapping,form,request,response); + } + + public static final String DECREMENT_QTY = "decrementQty"; + public ActionForward decrementQty(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception + { + StockMovementForm stockForm = (StockMovementForm)form; + StockMovementBean stockMovementBean = (StockMovementBean)stockForm.getBean(); + stockMovementBean.setQtyToMove(new BigDecimal(1)); + + addToMMovementCart(mapping,form,request,response); + return getMMovementCart(mapping,form,request,response); + } + + public ActionForward getMMovementCart(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws OperationException, IOException, ParseException + { + DefaultForm df = (DefaultForm) form; + String orderType = df.getOrderType(); + + String mmovementCart = MMovementManager.getMMovementCartAsHTML(request); + + PrintWriter writer = response.getWriter(); + writer.write(mmovementCart); + + + ActionMessages errors = (ActionMessages) request.getAttribute("org.apache.struts.action.ERROR"); + if(errors != null && !errors.isEmpty()) + { + MessageResources messageResources = getResources(request); + + Iterator iter = errors.get(); + while(iter.hasNext()) + { + ActionMessage message = iter.next(); + String key = message.getKey(); + Object[] values = message.getValues(); + + String errMsg = messageResources.getMessage(key, values); + writer.write(""); + } + + } + + writer.close(); + + return null; + } + + public static final String UPDATE_QTY = "updateQty"; + public ActionForward updateQty(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception + { + Properties ctx=TmkJSPEnv.getCtx(request); + + // Bug fix for null pointer + StockMovementForm stockForm = (StockMovementForm)form; + Trx trx = Trx.get(TrxPrefix.getPrefix(),true); + + if(stockForm.getQtyToMove() == null) + { + stockForm.setQtyToMove("1"); + } + + StockMovementBean stockMovementBean = (StockMovementBean)stockForm.getBean(); + Integer product_id = stockMovementBean.getProductId(); + Integer quantity = stockMovementBean.getQtyToMove().intValue(); + Integer priceListId = stockMovementBean.getPriceListId(); + + ArrayList items = (ArrayList) request.getSession().getAttribute(Constants.MMOVEMENT_CART_ITEMS); + + try + { + trx.start(); + StockManager.updateItemFromMMovementList(ctx, priceListId, items, product_id, quantity); + trx.commit(); + } + catch(OperationException e) + { + postGlobalError("error.inventory.not.available", e.getMessage(), request); + trx.rollback(); + return mapping.getInputForward(); + } + finally + { + trx.close(); + } + + return getMMovementCart(mapping,form,request,response); + } + + public static final String UPDATE_NO_OF_PACK = "updateNoOfPack"; + public ActionForward updateNoOfPack(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception + { + Properties ctx=TmkJSPEnv.getCtx(request); + + // Bug fix for null pointer + StockMovementForm stockForm = (StockMovementForm)form; + + if(stockForm.getNoOfPack() == null) + { + stockForm.setNoOfPack("1"); + } + + StockMovementBean stockMovementBean = (StockMovementBean)stockForm.getBean(); + Integer product_id = stockMovementBean.getProductId(); + Integer noOfPack = stockMovementBean.getNoOfPack(); + Integer priceListId = stockMovementBean.getPriceListId(); + + ArrayList items = (ArrayList) request.getSession().getAttribute(Constants.MMOVEMENT_CART_ITEMS); + StockManager.updateNoOfPack(ctx, priceListId, items, product_id, noOfPack); + + return getMMovementCart(mapping,form,request,response); + } + + public static final String RELOAD_BARCODE_CART = "reloadBarcodeCart"; + public ActionForward reloadBarcodeCart(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws OperationException, IOException, ParseException, ApplicationException + { + ActionForward fwd=init(mapping,form,request,response); + if(fwd!=null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + StockMovementForm stockForm = (StockMovementForm)form; + StockMovementBean stockMovementBean = (StockMovementBean)stockForm.getBean(); + + String movementCart = Constants.MMOVEMENT_CART; + String movementCartItems = Constants.MMOVEMENT_CART_ITEMS; + + MMovementCartBean cartBean = (MMovementCartBean) request.getSession().getAttribute(movementCart); + ArrayList itemBeans= cartBean.getItems(); + + String priceListIdAsStr = request.getParameter("priceListId"); + String productIdAsStr = request.getParameter("productId"); + int productId = Integer.parseInt(productIdAsStr); + int priceListId = Integer.parseInt(priceListIdAsStr); + + BigDecimal qty = BigDecimal.ZERO; + + for(int i=0; i webDocStatusMap; + static LinkedHashMap docStatusMap; + + static + { + webDocStatusMap = new LinkedHashMap(); + webDocStatusMap.putAll(UDIMap.docStatusMap); + } + + static + { + docStatusMap = new LinkedHashMap(); + docStatusMap.putAll(webDocStatusMap); + docStatusMap.put(DocumentEngine.STATUS_Approved,"Approved"); + docStatusMap.put(DocumentEngine.STATUS_NotApproved,"Not Approved"); + docStatusMap.put(DocumentEngine.STATUS_Reversed,"Reversed"); + docStatusMap.put(DocumentEngine.STATUS_Unknown,"??"); + docStatusMap.put(DocumentEngine.STATUS_WaitingPayment,"Waiting Payment"); + docStatusMap.put(DocumentEngine.STATUS_WaitingConfirmation,"Waiting Confirmation"); + docStatusMap.put(DocumentEngine.STATUS_Invalid,"Invalid"); + } + + + + public static LinkedHashMap getWebDocStatusMap() + { + return webDocStatusMap; + } + + public static void setWebDocStatusMap(LinkedHashMap webDocStatusMap) + { + OrderStatus.webDocStatusMap = webDocStatusMap; + } + + public String formatValue(Object valueToFormat) throws JspException + { + if (valueToFormat instanceof String == false) + throw new JspException("Expected java.lang.String, obtained" + valueToFormat.getClass().getName()); + + String strValueToFormat = (String) valueToFormat; + + return format(strValueToFormat); + } + + + + + + private String format(String strValueToFormat) + { + if (docStatusMap.containsKey(strValueToFormat)) + return (String) docStatusMap.get(strValueToFormat); + + + return (String) docStatusMap.get(DocumentEngine.STATUS_Unknown); + } + + + @SuppressWarnings("deprecation") + public int doStartTag() throws JspException + { + + HttpServletRequest request = (HttpServletRequest) pageContext.getRequest(); + + request.getSession().getAttribute(WebUserInfo.NAME); + + if (ignore) + { + if (RequestUtils.lookup(pageContext, name, scope) == null) + return (SKIP_BODY); + } + + Object value = RequestUtils.lookup(pageContext, name, property, scope); + if (value == null) + return (SKIP_BODY); + + String output = formatValue(value); + + org.apache.struts.util.ResponseUtils.write(pageContext, output); + + return (SKIP_BODY); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/taglib/ProductName.java b/posterita/posterita/src/main/org/posterita/taglib/ProductName.java new file mode 100644 index 0000000000..7a7fc036bb --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/taglib/ProductName.java @@ -0,0 +1,94 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Aug 11, 2005 by Alok + */ + +package org.posterita.taglib; + +import java.util.Properties; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.jsp.JspException; + +import org.apache.struts.taglib.bean.WriteTag; +import org.apache.struts.util.RequestUtils; +import org.compiere.model.MAttributeValue; + +import org.posterita.core.TmkJSPEnv; + +public class ProductName extends WriteTag +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + + + + public String formatValue(Object valueToFormat) throws JspException + { + if (valueToFormat instanceof Integer == false) + throw new JspException("Expected java.lang.Integer, obtained" + valueToFormat.getClass().getName()); + + Integer id = (Integer) valueToFormat; + + return format(id); + } + + private String format(Integer integerValueToFormat) + { + + if (integerValueToFormat == null) + return ""; + + HttpServletRequest request = (HttpServletRequest) pageContext.getRequest(); + + Properties ctx = TmkJSPEnv.getCtx(request); + + MAttributeValue attributeValue = new MAttributeValue(ctx, integerValueToFormat.intValue(),null); + + + return attributeValue.getName(); + } + + + + + @SuppressWarnings("deprecation") + public int doStartTag() throws JspException + { + + if (ignore) + { + if (RequestUtils.lookup(pageContext, name, scope) == null) + return (SKIP_BODY); + } + + Object value = RequestUtils.lookup(pageContext, name, property, scope); + if (value == null) + return (SKIP_BODY); + + String output = formatValue(value); + + org.apache.struts.util.ResponseUtils.write(pageContext, output); + + return (SKIP_BODY); + } +} diff --git a/posterita/posterita/src/main/org/posterita/user/WebUserInfo.java b/posterita/posterita/src/main/org/posterita/user/WebUserInfo.java new file mode 100644 index 0000000000..c354a15664 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/user/WebUserInfo.java @@ -0,0 +1,303 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Aug 11, 2005 by Alok + */ + +package org.posterita.user; + +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.Properties; + +import org.compiere.model.MLocation; +import org.compiere.model.MOrg; +import org.compiere.model.MRole; +import org.compiere.model.MUser; +import org.compiere.util.DB; +import org.compiere.util.Env; +import org.compiere.util.KeyNamePair; +import org.compiere.util.Secure; +import org.compiere.util.WebInfo; +import org.compiere.util.WebUser; + +import org.posterita.exceptions.DataException; +import org.posterita.exceptions.OperationException; + + +/** + * @author fred + * + *This Info is breaking convention because it is using Info that calls some business logic when + *invoking it in the jsp. But should be fine for now. + * + */ +public class WebUserInfo +{ + + public static final String NAME = "webUserInfo"; + protected WebUser user; + protected WebInfo info; + protected Properties ctx; + protected String orgName; + protected String roleName; + protected Integer roleId; + protected Integer orgId; + protected ArrayList menuItem; + protected Integer unreadMessageCount; + protected Boolean canAlterOrder; + protected Boolean canCreateOrder; + protected Boolean canViewOrder; + + + + public Boolean getCanAlterOrder() { + return canAlterOrder; + } + public void setCanAlterOrder(Boolean canAlterOrder) { + this.canAlterOrder = canAlterOrder; + } + public Boolean getCanCreateOrder() { + return canCreateOrder; + } + public void setCanCreateOrder(Boolean canCreateOrder) { + this.canCreateOrder = canCreateOrder; + } + public Boolean getCanViewOrder() { + return canViewOrder; + } + public void setCanViewOrder(Boolean canViewOrder) { + this.canViewOrder = canViewOrder; + } + + public Integer getUnreadMessageCount() + { + return unreadMessageCount; + } + + public void setUnreadMessageCount(Integer unreadMessageCount) + { + this.unreadMessageCount = unreadMessageCount; + } + + public ArrayList getMenuItem() + { + return menuItem; + } + + public void setMenuItem(ArrayList menuItem) + { + this.menuItem = menuItem; + } + + public Integer getOrgId() + { + return orgId; + } + + public void setOrgId(Integer orgId) + { + this.orgId = orgId; + } + + + public Integer getRoleId() + { + return roleId; + } + + public void setRoleId(Integer roleId) + { + this.roleId = roleId; + Env.setContext(ctx,"#AD_Role_ID",roleId.intValue()); + } + public WebUserInfo(Properties ctx, WebUser user, WebInfo info) throws DataException, OperationException + { + this.user = user; + this.ctx =ctx; + this.info = info; + + MUser muser = new MUser(ctx, user.getAD_User_ID(), null); + + // TODO think about this Little hack +// Env.setContext(ctx, "#AD_Org_ID", muser.getAD_Org_ID()); + +// setOriginalUserID(ctx, muser); + + orgId = Integer.valueOf(muser.getAD_Org_ID()); + + KeyNamePair[] roles = getRoles(muser.getName(),muser.getPassword()); + + + if (roles == null || roles.length == 0) + throw new DataException("No role has been set for your user, Please check with your administrator to assign one for you."); + + /* + if (roles.length > 1 ) + throw new DataException("You have been assigned many roles. You are permitted to have one role only. Please check with your administrator"); + */ + + setRoleId( Integer.valueOf(roles[0].getKey())); + setRoleName(); + + } + + /*public void setOriginalUserID(Properties ctx, MUser originalUser) + { + int originalUserID = Env.getContextAsInt(ctx, "#AD_OriginalUser_ID"); + + if (originalUserID == 0) + Env.setContext(ctx, "#AD_OriginalUser_ID", originalUser.getAD_User_ID()); + }*/ + + private KeyNamePair[] getRoles (String app_user, String app_pwd) throws OperationException + { + + if (app_user == null) + return null; + + KeyNamePair[] retValue = null; + ArrayList list = new ArrayList(); + // + String sql = "SELECT AD_User.AD_User_ID, AD_User.Description," + + " AD_Role.AD_Role_ID, AD_Role.Name " + + "FROM AD_User, AD_User_Roles, AD_Role " + + "WHERE AD_User.AD_User_ID=AD_User_Roles.AD_User_ID" + + " AND AD_User_Roles.AD_Role_ID=AD_Role.AD_Role_ID" + + " AND AD_User.Name=? AND AD_User.AD_CLIENT_ID=" + Env.getAD_Client_ID(ctx) // #1 + + " AND AD_User.IsActive='Y' AND AD_Role.IsActive='Y' AND AD_User_Roles.IsActive='Y'"; + if (app_pwd != null) + sql += " AND (AD_User.Password=? OR AD_User.Password=?)"; // #2/3 + sql += " ORDER BY AD_Role.Name"; + + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement(sql, null); + pstmt.setString(1, app_user); + if (app_pwd != null) + { + pstmt.setString(2, app_pwd); + pstmt.setString(3, new Secure().getDigest(app_pwd)); + } + // execute a query + ResultSet rs = pstmt.executeQuery(); + + while (rs.next()) + { + + int AD_Role_ID = rs.getInt("AD_Role_ID"); + String Name = rs.getString("Name"); + KeyNamePair p = new KeyNamePair(AD_Role_ID, Name); + list.add(p); + } + + rs.close(); + pstmt.close(); + pstmt = null; + // + retValue = new KeyNamePair[list.size()]; + list.toArray(retValue); + } + catch (SQLException ex) + { + ex.printStackTrace(); + retValue = null; + } + // + try + { + if (pstmt != null) + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + return retValue; + } // getRoles + + + /** + * @return Returns the info. + */ + public WebInfo getInfo() + { + return info; + } + /** + * @param info The info to set. + */ + public void setInfo(WebInfo info) + { + this.info = info; + } + /** + * @return Returns the user. + */ + public WebUser getUser() + { + return user; + } + /** + * @param user The user to set. + */ + public void setUser(WebUser user) + { + this.user = user; + } + + public String getOrgName() + { + if (orgName ==null) + { + MUser muser = new MUser(ctx,user.getAD_User_ID(),null); + MOrg org = new MOrg (ctx,muser.getAD_Org_ID(),null); + orgName = org.getName(); + } + + return orgName; + + } + + public String getRoleName() + { + MRole role = new MRole(ctx, getRoleId().intValue(),null); + return role.getName(); + } + + public MLocation getLocation() + { + + MUser muser = new MUser(ctx, user.getAD_User_ID(),null); + MOrg org = new MOrg(ctx,muser.getAD_Org_ID(),null); + + int locationId = org.getInfo().getC_Location_ID(); + MLocation mlocation = MLocation.get(ctx, locationId, null); + + return mlocation; + } + + public void setRoleName() + { + this.roleName = getRoleName(); + } +} diff --git a/posterita/posterita/src/main/org/posterita/util/AbstractPrintFormatter.java b/posterita/posterita/src/main/org/posterita/util/AbstractPrintFormatter.java new file mode 100644 index 0000000000..39d06cb302 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/util/AbstractPrintFormatter.java @@ -0,0 +1,176 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + */ +package org.posterita.util; + +import java.lang.reflect.Constructor; +import java.lang.reflect.Field; +import java.util.HashMap; +import java.util.Map; +import java.util.StringTokenizer; + +import org.posterita.exceptions.OperationException; + + +/** + * @author alok + */ + +public abstract class AbstractPrintFormatter implements IPrintFormatter +{ + private Map arguments; + + protected int _lineWidth = 40; + protected int _halfLineWidth = 20; + protected String _lineTop= ""; + protected String _lineBottom = ""; + protected boolean _showLogo = false; + protected boolean _showBarcode = false; + protected boolean _showDiscount = false; + protected boolean _showFooter = false; + protected boolean _priceWithVat = false; + protected String _footerMessage = ""; + + protected String trxName = null; + + public AbstractPrintFormatter(String args) + { + parseArguments(args); + initFormatter(); + } + + private void parseArguments(String args) + { + arguments = new HashMap(); + + if( args == null || args.length() == 0) + { + return; + } + + StringTokenizer params = new StringTokenizer(args,";"); + StringTokenizer s = null; + + while(params.hasMoreTokens()) + { + s = new StringTokenizer(params.nextToken(), "="); + + if(s.hasMoreTokens()) + { + String key = s.nextToken(); + + if(s.hasMoreTokens()) + { + String value = s.nextToken(); + + arguments.put(key, value); + } + } + }//while + + } + + public String getArgumentValue(String argumentName) + { + if(arguments != null) + { + return arguments.get(argumentName); + } + + return null; + } + + protected void setArgumentValue(String argumentName, String value) throws OperationException + { + try + { + Field field = getClass().getField(argumentName); + Class c = field.getType().getClass(); + + Constructor con = c.getConstructor(new Class[]{String.class}); + Object obj = con.newInstance(new Object[]{value}); + + field.set(this,obj); + } + catch (Exception e) + { + throw new OperationException(e); + } + } + + public void initFormatter() + { + String value; + + value = getArgumentValue("showBarcode"); + if(value != null) + { + _showBarcode = Boolean.parseBoolean(value); + } + + value = getArgumentValue("showLogo"); + if(value != null) + { + _showLogo = Boolean.parseBoolean(value); + } + + value = getArgumentValue("lineLength"); + if(value != null) + { + _lineWidth = Integer.parseInt(value); + } + + value = getArgumentValue("footer"); + if(value != null) + { + _footerMessage = value; + } + + value = getArgumentValue("showDiscount"); + if(value != null) + { + _showDiscount = Boolean.parseBoolean(value); + } + + value = getArgumentValue("showFooter"); + if(value != null) + { + _showFooter = Boolean.parseBoolean(value); + } + + value = getArgumentValue("priceWithVat"); + if(value != null) + { + _priceWithVat = Boolean.parseBoolean(value); + } + + String lineSeparator = ""; + + for(int i = 0; i < _lineWidth; i++) + { + lineSeparator = lineSeparator + "-"; + } + + _lineTop = lineSeparator; + _lineBottom = lineSeparator; + + _halfLineWidth = _lineWidth/2; + } +} diff --git a/posterita/posterita/src/main/org/posterita/util/BarcodeFormatter.java b/posterita/posterita/src/main/org/posterita/util/BarcodeFormatter.java new file mode 100644 index 0000000000..d0ad551976 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/util/BarcodeFormatter.java @@ -0,0 +1,154 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * 04-Oct-2006 09:52:44 by praveen + * + */ + +package org.posterita.util; + +import java.io.PrintWriter; +import java.io.StringWriter; + +import org.posterita.beans.PrintBarcodeBean; +import org.posterita.exceptions.FormattingException; +import org.posterita.formatter.Formatter; + +public class BarcodeFormatter extends Formatter +{ + boolean showPrice = true; + boolean showTitle = true; + boolean showSubtitle = true; + + public Object format(Object target) throws FormattingException + { + + PrintBarcodeBean bean = null; + bean = (PrintBarcodeBean) target; + + int qty = 0; + String title = null; + String barcode = null; + String price = null; + String subtitle = null; + + title = bean.getTitle(); + barcode = bean.getBarcode(); + price = bean.getPrice(); + subtitle = bean.getSubtitle(); + qty = bean.getQty(); + + //setting defaults if params are null + title = ( title == null ) ? "" : title; + barcode = ( barcode == null ) ? "" : barcode; + price = ( price == null ) ? "" : price; + subtitle = ( subtitle == null ) ? "" : subtitle; + qty = ( qty == 0 ) ? 1 : qty; + + StringWriter sw = new StringWriter(); + PrintWriter w = new PrintWriter(sw); + + w.println("^Q24,3"); + w.println("^W75"); + w.println("^H10"); + w.println("^P1"); + w.println("^S4"); + w.println("^AD"); + w.println("^C$qty"); //<-- qty + w.println("^R2"); + w.println("~Q+3"); + w.println("^O0"); + w.println("^D0"); + w.println("^E10"); + w.println("~R200"); + w.println("^L"); + w.println("Dy2-me-dd"); + w.println("Th:m:s"); + + if( showTitle ) + { + w.println("AA,22,12,1,1,0,0,$title"); //<--title1 + w.println("AA,22,12,1,1,0,0,$title"); //<--title1 + } + + w.println("BE,42,62,2,5,100,0,1,$barcode"); //<--barcode + w.println("BE,42,62,2,5,100,0,1,$barcode"); //<--barcode + + if( showPrice ) + { + w.println("AC,222,27,1,1,0,0,$price"); //<-- price + w.println("AC,222,27,1,1,0,0,$price"); //<-- price + } + + if( showSubtitle ) + { + w.println("AA,22,32,1,1,0,0,$subtitle"); //<-- title2 + w.println("AA,22,32,1,1,0,0,$subtitle"); //<-- title2 + } + + w.println("E"); + w.flush(); + + String printData = sw.getBuffer().toString(); + + printData = printData.replace("$qty", qty+""); + printData = printData.replace("$title", title); + printData = printData.replace("$subtitle", subtitle); + printData = printData.replace("$barcode", barcode); + printData = printData.replace("$price", price); + + return printData; + } + + + public Object unformat(Object target) throws FormattingException + { + throw new FormattingException("Operartion not supported"); + } + + + public boolean isShowPrice() { + return showPrice; + } + + + public void setShowPrice(boolean showPrice) { + this.showPrice = showPrice; + } + + + public boolean isShowSubtitle() { + return showSubtitle; + } + + + public void setShowSubtitle(boolean showSubtitle) { + this.showSubtitle = showSubtitle; + } + + + public boolean isShowTitle() { + return showTitle; + } + + + public void setShowTitle(boolean showTitle) { + this.showTitle = showTitle; + } + +} diff --git a/posterita/posterita/src/main/org/posterita/util/EmailUtil.java b/posterita/posterita/src/main/org/posterita/util/EmailUtil.java new file mode 100644 index 0000000000..b8c545fec2 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/util/EmailUtil.java @@ -0,0 +1,102 @@ +/* + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Servansingh + * */ + +package org.posterita.util; + +import java.util.Properties; + +import javax.mail.internet.InternetAddress; + +import org.compiere.model.MCountry; +import org.compiere.util.EMail; +import org.posterita.beans.UserBean; +import org.posterita.exceptions.InvalidEmailException; + +public class EmailUtil +{ + public static final String DEFAULT_SMTP_SERVER = "mail.tamakict.com"; + public static final String SUPPORT_EMAIL_ADDRESS = "support@posterita.org"; + public static final String DEFAULT_USER_AUTH_NAME = "admin@tamakict.com"; + public static final String DEFAULT_USER_AUTH_PWD = "kaizen"; + + public static boolean send(Properties ctx, String smtpHost, String from, String to, + String subject, String message, String username, String password) + { + EMail email = new EMail(ctx, smtpHost, from, to, subject, message); + + email.createAuthenticator(username, password); + String retMsg = email.send(); + + return EMail.SENT_OK.equals(retMsg); + } + + /** + * Validates an email address. Throws InvalidEmailException if mail address + * is not valid + * @param emailAddress + * @throws InvalidEmailException + */ + public static void checkEMail(String emailAddress) throws InvalidEmailException + { + if (emailAddress == null) + { + throw new InvalidEmailException("No email provided"); + } + + try + { + InternetAddress iNetAddress = new InternetAddress(emailAddress); + iNetAddress.validate(); + } + catch (Exception ex) + { + throw new InvalidEmailException(ex.getMessage(), ex); + } + } + + public static boolean sendRegistrationEmail(Properties ctx, UserBean userBean) + { + if (userBean == null) + { + throw new IllegalArgumentException("User cannot be null"); + } + + MCountry country = MCountry.get(ctx, userBean.getCountryId()); + StringBuffer msg = new StringBuffer(); + msg.append("Full Name: " + userBean.getName() + " " + userBean.getUserSurname()); + msg.append("\n\nAddress: " + userBean.getAddress1()); + msg.append("\n\nCity: " + userBean.getCity()); + msg.append("\n\nCountry: " + country.getName()); + msg.append("\n\nCompany: " + userBean.getCompany()); + msg.append("\n\nIndustry: " + userBean.getIndustry()); + msg.append("\n\nEmail: " + userBean.getEmail()); + msg.append("\n\nRemarks: " + userBean.getComments()); + + String subject = "Posterita POS User Registration"; + String from = userBean.getEmail(); + + return send(ctx, DEFAULT_SMTP_SERVER, from, + SUPPORT_EMAIL_ADDRESS, subject, msg.toString(), + DEFAULT_USER_AUTH_NAME, DEFAULT_USER_AUTH_PWD); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/util/HtmlOrderPrintFormatter.java b/posterita/posterita/src/main/org/posterita/util/HtmlOrderPrintFormatter.java new file mode 100644 index 0000000000..9e78ae4710 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/util/HtmlOrderPrintFormatter.java @@ -0,0 +1,735 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Aug 23, 2006 + */ + + +package org.posterita.util; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.Properties; + +import org.compiere.model.MBPartner; +import org.compiere.model.MCashLine; +import org.compiere.model.MCurrency; +import org.compiere.model.MInvoice; +import org.compiere.model.MLocation; +import org.compiere.model.MOrder; +import org.compiere.model.MOrg; +import org.compiere.model.MPayment; +import org.compiere.model.MUser; +import org.compiere.util.Env; +import org.posterita.Constants; +import org.posterita.beans.BPartnerBean; +import org.posterita.beans.ItemBean; +import org.posterita.beans.OrderLineBean; +import org.posterita.beans.ShoppingCartBean; +import org.posterita.beans.WebOrderLineBean; +import org.posterita.businesslogic.OrganisationManager; +import org.posterita.businesslogic.POSManager; +import org.posterita.businesslogic.administration.BPartnerManager; +import org.posterita.businesslogic.administration.PriceListManager; +import org.posterita.exceptions.FormattingException; +import org.posterita.exceptions.OperationException; +import org.posterita.lib.UdiConstants; +import org.posterita.order.UDIOrderTypes; + + + +public class HtmlOrderPrintFormatter extends AbstractPrintFormatter +{ + public HtmlOrderPrintFormatter(String args) + { + super(args); + } + + public HtmlOrderPrintFormatter(String args, String trxName) + { + super(args); + this.trxName = trxName; + } + + public String format(Properties ctx, int recordId, Object... args) throws Exception + { + //require UDIBean + OrderLineBean orderLineBean = null; + if( args != null && args.length > 0) + { + orderLineBean = (OrderLineBean) args[0]; + } + + //----------------------------------------------------------------------------------------------------------------------------- + + //set some default values + String vatRegNumber = ""; + String companyName1 = ""; + String companyName2 = ""; + String companyPhone = ""; + String companyAddress = ""; + String footerMsg = ""; + + //setting receipt header + try + { + MOrg myorg = OrganisationManager.getMyOrg(ctx); + int bpartnerId = myorg.getLinkedC_BPartner_ID(trxName); + + + MBPartner bpartner = BPartnerManager.loadBPartner(ctx,bpartnerId,trxName); + BPartnerBean bean = BPartnerManager.getBpartner(ctx, bpartnerId, trxName); + + vatRegNumber = bpartner.getTaxID(); + companyName1 = bean.getPartnerName(); + companyName2 = bean.getName2(); + companyPhone = bean.getPhone(); + + String add = bean.getAddress1(); + add = (add==null) ? "" : add; + + companyAddress = add; + + add = bean.getAddress2(); + + if(add!=null){ + companyAddress = companyAddress + " " + add; + } + + add = bean.getCity(); + add = (add==null) ? "" : add; + + companyAddress = companyAddress + ", " + add; + + + } catch (OperationException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + + String title = null; + String customerName = null; + String salesRep = null; + String docStatus = null; + String payment = null; + String customerAddress = null; + String refNo = null; + + //load the order + MOrder order = new MOrder(ctx, recordId, trxName); + + String paymentRule = null; + int priceListId = order.getM_PriceList_ID(); + String currency = PriceListManager.getCurrency(ctx, priceListId); + + //setting payment + paymentRule = order.getPaymentRule(); + + if(paymentRule.equalsIgnoreCase(MOrder.PAYMENTRULE_Cash)) + { + payment = Constants.PAYMENT_RULE_CASH; + } + + if(paymentRule.equalsIgnoreCase(MOrder.PAYMENTRULE_CreditCard)) + { + payment = Constants.PAYMENT_RULE_CARD; + } + + if(paymentRule.equalsIgnoreCase(MOrder.PAYMENTRULE_Check)) + { + payment = Constants.PAYMENT_RULE_CHEQUE; + } + + if(paymentRule.equalsIgnoreCase(UdiConstants.PAYMENTRULE_MIXED)) + { + payment = Constants.PAYMENT_RULE_MIXED; + } + + if(paymentRule.equalsIgnoreCase(MOrder.PAYMENTRULE_OnCredit)) + { + payment = "On Credit"; + } + + //setting ref no + refNo = order.getDocumentNo(); + + //getting orgInfo + MOrg org = new MOrg(ctx,order.getAD_Org_ID(),trxName); + footerMsg = org.getInfo().getReceiptFooterMsg(); + int location_id = org.getInfo().getC_Location_ID(); + MLocation location = new MLocation(ctx,location_id,trxName); + + // orgName = org.getName(); + + String address1 = (location.getAddress1() == null)? " " : location.getAddress1(); + String address2 = (location.getAddress2() == null)? " " : location.getAddress2(); + // orgAddress = (address1 + " " + address2).trim(); + + + //getting orderInfo + docStatus = order.getDocStatusName(); + + //getting salesrep + int saleRep_id = order.getSalesRep_ID(); + MUser user = new MUser(ctx,saleRep_id,null); + salesRep = user.getName(); + + //getting customer info + int bpartner_id = order.getBill_BPartner_ID(); + BPartnerBean bean; + try + { + bean = BPartnerManager.getBpartner(ctx,bpartner_id,trxName); + } + catch(Exception e) + { + throw new FormattingException("Formatting Error", e); + } + + + String name1 = (bean.getPartnerName() == null)? " " : bean.getPartnerName(); + String name2 = (bean.getName2() == null)? " " : bean.getName2(); + customerName = (name1 + " " + name2).trim(); + + address1 = (bean.getAddress1() == null)? " " : bean.getAddress1(); + address2 = (bean.getAddress2() == null)? " " : bean.getAddress2(); + customerAddress = (address1 + " " + address2).trim(); + + + ///////////////////////////////drawing the order//////////////////////////////// + StringBuffer reportData = new StringBuffer();//TmkPrinterConstants.LOGO1); + + if(_showLogo) + { + reportData.append(""); + } + + //adding header + reportData.append(_lineTop).append("
    "); + + if(companyName1!=null) + reportData.append("

    ").append(companyName1).append("

    "); + + + if(companyName2!=null) + if(companyName2.trim().length() > 0) + reportData.append("

    ").append("(" + companyName2 + ")").append("

    "); + + if(companyAddress!=null) + reportData.append(companyAddress).append("
    "); + + if(companyPhone!=null) + reportData.append("Tel:" + companyPhone).append("
    "); + + if(vatRegNumber!=null) + reportData.append("VAT Reg No:" + vatRegNumber).append("
    "); + + reportData.append(_lineTop).append("
    "); + + //adding title + + if ( UDIOrderTypes.POS_ORDER.getOrderType().equals(order.getOrderType())) + { + title = "Sales Receipt"; + } + else if ( UDIOrderTypes.POS_GOODS_RECEIVE_NOTE.getOrderType().equals(order.getOrderType())) + { + title = "Goods Received Note"; + } + else if ( UDIOrderTypes.POS_GOODS_RETURN_NOTE.getOrderType().equals(order.getOrderType())) + { + title = "Goods Returned Note"; + } + else if ( UDIOrderTypes.CUSTOMER_RETURN_ORDER.getOrderType().equals(order.getOrderType())) + { + title = "Customer Returned Order"; + } + else if ( UDIOrderTypes.CREDIT_ORDER.getOrderType().equals(order.getOrderType())) + { + title = "Credit Order"; + } + else + { + throw new OperationException("Unknown order type!"); + } + + reportData.append("

    ") + .append(title) + .append("

    "); + + //adding customer name + customerName = String.format("%1$-" + _halfLineWidth + "s", customerName); + reportData.append(customerName); + + //adding sales rep + salesRep = "Sales Rep:" + salesRep; + salesRep = String.format("%1$"+ _halfLineWidth + "s", salesRep); + reportData.append(salesRep) + .append("
    "); + + //adding customer address + customerAddress = String.format("%1$-" + _lineWidth + "s",customerAddress); + reportData.append(customerAddress) + .append("
    "); + + //adding status + docStatus = "Status:" + docStatus; + docStatus = String.format("%1$-" + _lineWidth + "s",docStatus); + reportData.append(docStatus) + .append("
    "); + + //adding payment + String paymentDetails = String.format("%1$-" + _lineWidth + "s","Payment:" + payment); + reportData.append(paymentDetails) + .append("
    "); + + //adding reference no + refNo = "Ref No:" + refNo; + refNo = String.format("%1$-" + _lineWidth + "s",refNo); + reportData.append(refNo) + .append("
    "); + + //adding date + Calendar c = Calendar.getInstance(); + c.setTime(new Date(order.getCreated().getTime())); + String date = String.format("%1$te %1$tb,%1$tY %1$tH:%1$tM:%1$tS",c); + date = String.format("%1$-" + _lineWidth + "s",date); + reportData.append(date) + .append("
    "); + + //adding orderlines + //1.header + reportData.append(_lineTop).append("
    ");; + + String headerFormat; + if(_showDiscount) + { + headerFormat = "%1$-" + (_lineWidth - ( 7 + 5 + 8 + 10 )) + "s" + + "%2$7s" + + "%3$5s" + + "%4$8s" + + "%5$10s"; + } + else + { + headerFormat = "%1$-" + (_lineWidth - ( 7 + 5 + 13 )) + "s" + + "%2$7s" + + "%3$5s" + + //"%4$8s" + + "%5$13s"; + } + + String header = String.format(headerFormat,"Name","Unit","Qty","Dis","Total"); + reportData.append(header).append("
    "); + + reportData.append(_lineBottom) + .append("
    "); + + //2.body + ShoppingCartBean cart = null; + + try + { + cart = POSManager.getShoppingCartForOrder(ctx, recordId, trxName); + } + catch(Exception e) + { + throw new FormattingException("Formatting Error", e); + } + + String name = null; + int qty; + BigDecimal discount = null; + BigDecimal taxAmt = null; + BigDecimal total; + BigDecimal unitPrice; + + int totalQty = 0; + double grandTotal = 0.0d; + double totalTax = 0.0d; + String orderline = ""; + String orderlineFormat = null; + + int nameWidth = 0; + + + if(_showDiscount) + { + orderlineFormat = "" + + "%1$-" + (_lineWidth - ( 7 + 5 + 8 + 10 )) + "s" + //1.product name OR description + "%2$7.2f" + //2.unit price + "%3$5d" + //3.quantity + "%4$8.2f" + //4.discount amount + "%5$10.2f"; //5.total price + + nameWidth = _lineWidth - ( 7 + 5 + 8 + 10 ); + } + else + { + orderlineFormat = "" + + "%1$-" + (_lineWidth - ( 7 + 5 + 13 )) + "s" + //1.product name OR description + "%2$7.2f" + //2.unit price + "%3$5d" + //3.quantity + //"%4$8.2f" + //4.discount amount + "%5$13.2f"; //5.total price + + nameWidth = _lineWidth - ( 7 + 5 + 13 ); + } + + + + for(ItemBean item : cart.getItems()) + { + taxAmt = item.getTaxAmt(); + name = item.getDescription(); + qty = item.getQty().intValue(); + discount = item.getDiscountPercent(); + total = item.getPrice(); + unitPrice = item.getUnitPrice(); + + if( _priceWithVat ) + { + unitPrice = total.divide(item.getQty(), 2, RoundingMode.HALF_EVEN); + } + + + if(name.length() > nameWidth) + { + // print on multiple lines + int beginIndex = 0; + int endIndex = 0; + endIndex = nameWidth; + + while(endIndex < name.length()) + { + String s = name.substring(beginIndex, endIndex); + beginIndex = endIndex; + endIndex = endIndex + nameWidth; + + orderline = String.format("%1$-" + _lineWidth + "s", s); + reportData.append(orderline) + .append("
    "); + } + + name = name.substring(beginIndex); + } + + discount = (discount==null)? new BigDecimal(0.0) : discount; + taxAmt = (taxAmt==null)? new BigDecimal(0.0) : taxAmt; + + double discountAmt = 0.0; + discountAmt = (total.doubleValue() * 100.0)/(100.0 - discount.doubleValue()) - total.doubleValue(); + + totalQty += qty; + grandTotal += total.doubleValue(); + totalTax += taxAmt.doubleValue(); + + if(taxAmt.intValue() == 0) + { + name = name + "*"; + } + + orderline = String.format(orderlineFormat,name,unitPrice,qty,discountAmt,total); + reportData.append(orderline) + .append("
    "); + } + + //3.footer + reportData.append(_lineBottom) + .append("
    "); + + String footerFormat = null; + if(_showDiscount) + { + footerFormat = "" + + "%1$-" + (_lineWidth - ( 5 + 8 + 10 )) + "s" + + "%2$5d" + + "%3$8.2s" + + "%4$10.2f"; + } + else + { + footerFormat = "" + + "%1$-" + (_lineWidth - ( 5 + 3 + 10 )) + "s" + + "%2$5d" + + "%3$3s" + + "%4$10.2f"; + } + + //4.amount tendered & refunded + BigDecimal cashAmountTendered = order.getAmountTendered(); + if(cashAmountTendered == null) + { + cashAmountTendered = new BigDecimal(0.0); + } + BigDecimal cashAmountRefunded = Env.ZERO; + if (MOrder.PAYMENTRULE_Cash.equals(order.getPaymentRule())) + { + cashAmountRefunded = order.getAmountRefunded(); + } + if(cashAmountRefunded == null) + { + cashAmountRefunded = new BigDecimal(0.0); + } + + BigDecimal cardAmountTendered = new BigDecimal(0.0d); + BigDecimal chequeAmountTendered = new BigDecimal(0.0d); + + + if(orderLineBean != null) + { + Double cardAmt = orderLineBean.getPaymentByCard(); + Double chequeAmt = orderLineBean.getPaymentByChq(); + + if(cardAmt == null) + { + cardAmountTendered = new BigDecimal(0.0d); + } + else + { + cardAmountTendered = new BigDecimal(cardAmt.doubleValue()); + } + + if(chequeAmt == null) + { + chequeAmountTendered = new BigDecimal(0.0d); + } + else + { + chequeAmountTendered = new BigDecimal(chequeAmt.doubleValue()); + } + } + else + { + + if(MOrder.STATUS_Completed.equalsIgnoreCase(order.getDocStatus())) + if(order.getOrderType().equalsIgnoreCase(UDIOrderTypes.POS_ORDER.getOrderType())) + { + try + { + cardAmountTendered = POSManager.getPayment(ctx, order.get_ID(), MPayment.TENDERTYPE_CreditCard, trxName); + chequeAmountTendered = POSManager.getPayment(ctx, order.get_ID(), MPayment.TENDERTYPE_Check, trxName); + } + catch (OperationException e) + { + throw new FormattingException("Cannot get payment",e); + } + } + else + { + cardAmountTendered = new BigDecimal(0.0d); + chequeAmountTendered = new BigDecimal(0.0d); + } + + } + + BigDecimal discountAmt = Env.ZERO; + BigDecimal writeOffAmt = Env.ZERO; + BigDecimal paymentAmt = Env.ZERO; + String writeOff = ""; + String actualPayment = ""; + String seperator = ""; + + MInvoice invoice = new MInvoice(ctx, order.getC_Invoice_ID(), trxName); + + if(invoice == null) + { + throw new OperationException("Could not load Invoice."); + } + + MCashLine cashLine = new MCashLine(ctx, invoice.getC_CashLine_ID(), trxName); + + if(cashLine == null) + { + throw new OperationException("Could not load CashLine"); + } + else + { + writeOffAmt = cashLine.getWriteOffAmt(); + paymentAmt = cashLine.getAmount(); + discountAmt = cashLine.getDiscountAmt(); + + if(writeOffAmt.doubleValue() == 0.0) + { + writeOffAmt = new BigDecimal(0.0d); + } + + if(discountAmt.doubleValue() == 0.0) + { + discountAmt = new BigDecimal(0.0d); + } + } + + String orderFooter = ""; + + if(discountAmt.doubleValue() > 0.0d) + { + orderFooter = String.format(footerFormat,"Sub Total",totalQty,currency,grandTotal); + } + else + { + orderFooter = String.format(footerFormat,"Grand Total",totalQty,currency,grandTotal); + } + reportData.append(orderFooter) + .append("
    "); + + reportData.append(_lineTop) + .append("
    "); + + if(!order.getOrderType().equalsIgnoreCase(UDIOrderTypes.CREDIT_ORDER.getOrderType())) + { + if(order.getOrderType().equalsIgnoreCase("POS Order")) + { + BigDecimal totalAfterDiscount = order.getGrandTotal().subtract(discountAmt); + + if(discountAmt.doubleValue() > 0.0d) + { + String str = String.format("%1$25s%2$4s:%3$10.2f","Less Discount", currency, discountAmt); + reportData.append(str).append("
    "); + + String totalAfterDiscountStr = String.format("%1$25s%2$4s:%3$10.2f","Grand Total", currency, totalAfterDiscount); + reportData.append(totalAfterDiscountStr).append("
    "); + + seperator = String.format("%1$25s%2$15s","","------------"); + reportData.append(seperator).append("
    "); + } + + if(payment.equalsIgnoreCase(Constants.PAYMENT_RULE_CASH)) + { + writeOff = String.format("%1$25s%2$4s:%3$10.2f","Write Off Amt", currency, writeOffAmt); + reportData.append(writeOff).append("
    "); + + actualPayment = String.format("%1$25s%2$4s:%3$10.2f","Payment Amt", currency, paymentAmt); + reportData.append(actualPayment).append("
    "); + } + + } + + String amountTendered = String.format("%1$25s%2$4s:%3$10.2f","Cash Tendered",currency,cashAmountTendered); + String amountRefunded = String.format("%1$25s%2$4s:%3$10.2f","Cash Refunded",currency,cashAmountRefunded); + + String cardTendered = String.format("%1$25s%2$4s:%3$10.2f","Card Tendered",currency,cardAmountTendered); + String chequeTendered = String.format("%1$25s%2$4s:%3$10.2f","Cheque Tendered",currency,chequeAmountTendered); + + if(cashAmountTendered.doubleValue() > 0.0d) + { + reportData.append(amountTendered).append("
    "); + } + + if(cardAmountTendered.doubleValue() > 0.0d) + { + reportData.append(cardTendered).append("
    "); + } + + if(chequeAmountTendered.doubleValue() > 0.0d) + { + reportData.append(chequeTendered).append("
    "); + } + + if(cashAmountTendered.doubleValue() > 0.0d && MOrder.PAYMENTRULE_Cash.equals(order.getPaymentRule())) + { + reportData.append(amountRefunded).append("
    "); + } + } + + + String totalVAT = String.format("%1$.2f",totalTax); + String vat = String.format("%1$-" + _lineWidth + "s","Total VAT:" + currency + totalVAT); + reportData.append("
    ") + .append(vat) + .append("
    "); + + String noVAT = String.format("%1$-" + _lineWidth + "s","* NO VAT"); + + + + reportData.append(noVAT) + .append("
    ") + .append("
    "); + + if(_showBarcode) + { + String barcode = order.getDocumentNo(); + reportData.append(barcode) + .append("
    "); + } + + + //reportData.append("*** Thank you ***") + reportData.append("
    "); + + + if(_showFooter) + if( _footerMessage.length() > 0 ) + { + reportData.append("
    ") + .append(_footerMessage) + .append("
    "); + } + + + if( order.getOrderType().equalsIgnoreCase(UDIOrderTypes.POS_ORDER.getOrderType()) ) + { + /* + reportData.append("
    ") + .append("*Goods once sold cannot be returned."); + */ + reportData.append("
    "); + reportData.append("
    "); + + if(footerMsg != null && footerMsg.length() != 0) + { + if(footerMsg.length() > 43) + { + String temp = ""; + String formattedFooterMsg = ""; + + while(footerMsg.length() > 43) + { + temp = footerMsg.substring(0, 42); + + if(!(temp.endsWith(" "))) + { + temp = temp.substring(0, temp.lastIndexOf(" ")); + formattedFooterMsg = formattedFooterMsg + temp.concat("
    "); + } + else + { + formattedFooterMsg = formattedFooterMsg + temp.concat("
    "); + } + + footerMsg = footerMsg.substring(temp.lastIndexOf(" ") +1); + } + + formattedFooterMsg = formattedFooterMsg.concat(footerMsg); + reportData.append(formattedFooterMsg); + } + else + { + reportData.append(footerMsg); + } + } + } + + return reportData.toString(); + + } +} diff --git a/posterita/posterita/src/main/org/posterita/util/IPrintFormatter.java b/posterita/posterita/src/main/org/posterita/util/IPrintFormatter.java new file mode 100644 index 0000000000..cc328ab18c --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/util/IPrintFormatter.java @@ -0,0 +1,33 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + */ +package org.posterita.util; + +import java.util.Properties; + +/** + * @author alok + */ + +public interface IPrintFormatter +{ + public String format(Properties ctx,int recordId, Object ...args) throws Exception; +} + diff --git a/posterita/posterita/src/main/org/posterita/util/InvoiceFormatter.java b/posterita/posterita/src/main/org/posterita/util/InvoiceFormatter.java new file mode 100644 index 0000000000..d3d869098e --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/util/InvoiceFormatter.java @@ -0,0 +1,308 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Sep 26, 2006 + */ + + +package org.posterita.util; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.Properties; + +import org.compiere.model.MDocType; +import org.compiere.model.MInvoice; +import org.compiere.model.MLocation; +import org.compiere.model.MOrder; +import org.compiere.model.MOrg; +import org.compiere.model.MUser; + +import org.posterita.Constants; +import org.posterita.beans.BPartnerBean; +import org.posterita.beans.WebOrderLineBean; +import org.posterita.businesslogic.InvoiceManager; +import org.posterita.businesslogic.administration.BPartnerManager; +import org.posterita.core.ContextId; +import org.posterita.exceptions.FormattingException; +import org.posterita.formatter.Formatter; +import org.posterita.lib.UdiConstants; + + +public class InvoiceFormatter extends Formatter +{ + + @Override + public Object format(Object target) throws FormattingException + { + + ContextId ctxId = (ContextId) target; + + Properties ctx = ctxId.getCtx(); + int recordId = ctxId.getId(); + + String title = null; + String customerName = null; + String salesRep = null; + String docStatus = null; + String payment = null; + String customerAddress = null; + String orderType=null; + //String dateOrdered = null; + String refNo = null; + + //load the order + MInvoice invoice = new MInvoice(ctx, recordId, null); + + String paymentRule = null; + + //setting payment + paymentRule = invoice.getPaymentRule(); + + if(paymentRule.equalsIgnoreCase(MOrder.PAYMENTRULE_Cash)) + { + payment = Constants.PAYMENT_RULE_CASH; + } + + if(paymentRule.equalsIgnoreCase(MOrder.PAYMENTRULE_CreditCard)) + { + payment = Constants.PAYMENT_RULE_CARD; + } + + if(paymentRule.equalsIgnoreCase(MOrder.PAYMENTRULE_Check)) + { + payment = Constants.PAYMENT_RULE_CHEQUE; + } + + if(paymentRule.equalsIgnoreCase(UdiConstants.PAYMENTRULE_MIXED)) + { + payment = Constants.PAYMENT_RULE_MIXED; + } + //setting ref no + refNo = invoice.getDocumentNo(); + + //getting orgInfo + MOrg org = new MOrg(ctx,invoice.getAD_Org_ID(),null); + int location_id = org.getInfo().getC_Location_ID(); + MLocation location = new MLocation(ctx,location_id,null); + + + String address1 = (location.getAddress1() == null)? " " : location.getAddress1(); + String address2 = (location.getAddress2() == null)? " " : location.getAddress2(); + + //getting order type + int docTypeId = invoice.getC_DocType_ID(); + MDocType docType = new MDocType(ctx, docTypeId, null); + + orderType = docType.getName(); + + //getting orderInfo + docStatus = invoice.getDocStatusName(); + + + //getting salesrep + int saleRep_id = invoice.getSalesRep_ID(); + MUser user = new MUser(ctx,saleRep_id,null); + salesRep = user.getName(); + + //getting customer info + int bpartner_id = invoice.getC_BPartner_ID(); + BPartnerBean bean; + try + { + bean = BPartnerManager.getBpartner(ctx,bpartner_id,null); + } + catch(Exception e) + { + throw new FormattingException("Formatting",e); + } + + + String name1 = (bean.getPartnerName() == null)? " " : bean.getPartnerName(); + String name2 = (bean.getName2() == null)? " " : bean.getName2(); + customerName = (name1 + " " + name2).trim(); + + address1 = (bean.getAddress1() == null)? " " : bean.getAddress1(); + address2 = (bean.getAddress2() == null)? " " : bean.getAddress2(); + customerAddress = (address1 + " " + address2).trim(); + + + ///////////////////////////////drawing the order//////////////////////////////// + StringBuffer reportData = new StringBuffer(TmkPrinterConstants.LOGO1); + //adding title + title = orderType; + reportData.append(TmkPrinterConstants.BIG_FONT) + .append(TmkPrinterConstants.CENTER_ALIGN) + .append(title) + .append(TmkPrinterConstants.LINE_FEED); + + //setting small font + reportData.append(TmkPrinterConstants.SMALL_FONT); + reportData.append(TmkPrinterConstants.LEFT_ALIGN); + + //adding customer name + customerName = String.format("%1$-30s",customerName); + reportData.append(customerName); + + //adding sales rep + salesRep = "Sales Rep:" + salesRep; + salesRep = String.format("%1$30s",salesRep); + reportData.append(salesRep) + .append(TmkPrinterConstants.LINE_FEED); + + //adding customer address + customerAddress = String.format("%1$-60s",customerAddress); + reportData.append(customerAddress) + .append(TmkPrinterConstants.LINE_FEED); + + //adding status + docStatus = "Status:" + docStatus; + docStatus = String.format("%1$-60s",docStatus); + reportData.append(docStatus) + .append(TmkPrinterConstants.LINE_FEED); + + //adding payment + payment = "Payment:" + payment; + payment = String.format("%1$-60s",payment); + reportData.append(payment) + .append(TmkPrinterConstants.LINE_FEED); + + //adding reference no + refNo = "Ref No:" + refNo; + refNo = String.format("%1$-60s",refNo); + reportData.append(refNo) + .append(TmkPrinterConstants.LINE_FEED); + + //adding date + Calendar c = Calendar.getInstance(); + c.setTime(new Date(invoice.getCreated().getTime())); + String date = String.format("%1$te %1$tb,%1$tY %1$tH:%1$tM:%1$tS",c); + date = String.format("%1$-60s",date); + reportData.append(date) + .append(TmkPrinterConstants.LINE_FEED); + + //adding orderlines + //1.header + reportData.append(TmkPrinterConstants.H_FULL_LINE_TOP).append("\n"); + + String headerFormat = "" + + "%1$-40s" + + "%2$5s" + + "%3$5s" + + "%4$10s"; + + String header = String.format(headerFormat,"Name","Qty","","Total"); + reportData.append(header).append("\n"); + + reportData.append(TmkPrinterConstants.H_FULL_LINE_BOTTOM) + .append(TmkPrinterConstants.LINE_FEED); + + ArrayList invoiceLineList; + + //2.body + try + { + invoiceLineList = InvoiceManager.populateInvoiceLines(ctx,invoice,false); + } + catch(Exception e) + { + throw new FormattingException("Formatting Error", e); + } + + + String name = null; + int qty; + + BigDecimal taxAmt = null; + BigDecimal total; + + int totalQty = 0; + double grandTotal = 0.0d; + double totalTax = 0.0d; + String orderline = ""; + + String orderlineFormat = "" + + "%1$-40s" + + "%2$5d" + + "%3$5s" + + "%4$10.2f"; + + for(WebOrderLineBean wbean : invoiceLineList) + { + taxAmt = wbean.getTaxAmt(); + name = wbean.getDescription(); + qty = wbean.getQtyOrdered().intValue(); + total = wbean.getLineTotalAmt(); + + taxAmt = (taxAmt==null)? new BigDecimal(0.0) : taxAmt; + + totalQty += qty; + grandTotal += total.doubleValue(); + totalTax += taxAmt.doubleValue(); + + if(taxAmt.intValue() == 0) + { + name = name + "*"; + } + + orderline = String.format(orderlineFormat,name,qty,"",total); + reportData.append(orderline) + .append(TmkPrinterConstants.LINE_FEED); + } + + //3.footer + reportData.append(TmkPrinterConstants.H_FULL_LINE_BOTTOM) + .append(TmkPrinterConstants.LINE_FEED); + + String footerFormat = "" + + "%1$-40s" + + "%2$5d" + + "%3$5s" + + "%4$10.2f"; + + String footer = String.format(footerFormat,"Grand Total",totalQty,"Rs",grandTotal); + reportData.append(footer) + .append(TmkPrinterConstants.LINE_FEED); + + reportData.append(TmkPrinterConstants.H_FULL_LINE_TOP) + .append(TmkPrinterConstants.LINE_FEED); + + + String totalVAT = String.format("%1$.2f",totalTax); + String vat = String.format("%1$-60s","Total VAT:Rs"+totalVAT); + reportData.append(vat) + .append(TmkPrinterConstants.LINE_FEED); + + String noVAT = String.format("%1$-60s","* NO VAT"); + reportData.append(noVAT) + .append(TmkPrinterConstants.LINE_FEED) + .append(TmkPrinterConstants.PAPER_CUT); + + + return reportData.toString(); + } + + @Override + public Object unformat(Object target) + { + return null; + } + +} diff --git a/posterita/posterita/src/main/org/posterita/util/ListUtil.java b/posterita/posterita/src/main/org/posterita/util/ListUtil.java new file mode 100644 index 0000000000..2f36dce1a1 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/util/ListUtil.java @@ -0,0 +1,44 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +* +* Created on Oct 3, 2006 by ashley +* +*/ + +/** + @author ashley + */ + +package org.posterita.util; + +import java.util.ArrayList; + +public class ListUtil +{ + public static ArrayList getListFromArray(T[] a) + { + ArrayList retList = new ArrayList(); + if(a != null) + { + for(T t : a) + retList.add(t); + } + return retList; + } +} diff --git a/posterita/posterita/src/main/org/posterita/util/MinOutFormatter.java b/posterita/posterita/src/main/org/posterita/util/MinOutFormatter.java new file mode 100644 index 0000000000..cedd4e2b68 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/util/MinOutFormatter.java @@ -0,0 +1,44 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Sep 26, 2006 + */ + + +package org.posterita.util; + +import org.posterita.formatter.Formatter; + + +public class MinOutFormatter extends Formatter +{ + + @Override + public Object format(Object target) + { + return null; + } + + @Override + public Object unformat(Object target) + { + return null; + } + + +} diff --git a/posterita/posterita/src/main/org/posterita/util/OSBroOrderPrintFormatter1.java b/posterita/posterita/src/main/org/posterita/util/OSBroOrderPrintFormatter1.java new file mode 100644 index 0000000000..fa1a3bdec7 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/util/OSBroOrderPrintFormatter1.java @@ -0,0 +1,655 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Aug 23, 2006 + */ + + +package org.posterita.util; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.Properties; +import java.util.StringTokenizer; +import java.util.logging.Level; + +import org.compiere.model.MBPartner; +import org.compiere.model.MCashLine; +import org.compiere.model.MInvoice; +import org.compiere.model.MLocation; +import org.compiere.model.MOrder; +import org.compiere.model.MOrg; +import org.compiere.model.MPOS; +import org.compiere.model.MPayment; +import org.compiere.model.MUser; +import org.compiere.util.CLogger; +import org.compiere.util.Env; +import org.posterita.Constants; +import org.posterita.beans.BPartnerBean; +import org.posterita.beans.OrderLineBean; +import org.posterita.beans.WebOrderLineBean; +import org.posterita.businesslogic.OrganisationManager; +import org.posterita.businesslogic.POSManager; +import org.posterita.businesslogic.administration.BPartnerManager; +import org.posterita.exceptions.FormattingException; +import org.posterita.exceptions.OperationException; +import org.posterita.lib.UdiConstants; +import org.posterita.order.UDIOrderTypes; + + + +public class OSBroOrderPrintFormatter1 extends AbstractPrintFormatter +{ + private static final CLogger log = CLogger.getCLogger(OSBroOrderPrintFormatter1.class); + + public OSBroOrderPrintFormatter1(String args) + { + super(args); + } + + public OSBroOrderPrintFormatter1(String args, String trxName) + { + super(args); + this.trxName = trxName; + } + + public String format(Properties ctx, int recordId, Object... args) throws Exception + { + + //require UDIBean + OrderLineBean orderLineBean = null; + if( args != null && args.length > 0) + { + orderLineBean = (OrderLineBean) args[0]; + } + + //----------------------------------------------------------------------------------------------------------------------------- + + //set some default values + String vatRegNumber = ""; + String companyName1 = ""; + String companyName2 = ""; + String companyPhone = ""; + String companyFax = ""; + String companyAddress = ""; + String footerMsg = ""; + String terminal = ""; + + //setting receipt header + try + { + MOrg myorg = OrganisationManager.getMyOrg(ctx); + int bpartnerId = myorg.getLinkedC_BPartner_ID(trxName); + + //get footer message + footerMsg = myorg.getInfo().getReceiptFooterMsg(); + + + MBPartner linkedBPartner = BPartnerManager.loadBPartner(ctx,bpartnerId,trxName); + BPartnerBean linkedBPartnerBean = BPartnerManager.getBpartner(ctx, bpartnerId, trxName); + + vatRegNumber = linkedBPartner.getTaxID(); + companyName1 = linkedBPartnerBean.getPartnerName(); + companyName2 = linkedBPartnerBean.getName2(); + companyPhone = linkedBPartnerBean.getPhone(); + companyFax = linkedBPartnerBean.getFax(); + + String address1 = linkedBPartnerBean.getAddress1(); + String address2 = linkedBPartnerBean.getAddress2(); + String city = linkedBPartnerBean.getCity(); + String postalAddress = linkedBPartnerBean.getPostalAddress(); + String postalCode = linkedBPartnerBean.getPostalCode(); + + String newLine = System.getProperty("line.separator"); + companyAddress = (address1==null) ? companyAddress : getFormattedText(address1, TmkPrinterConstants.FONT_SMALL, TmkPrinterConstants.LEFT_ALIGN); + companyAddress = (address2==null) ? companyAddress : companyAddress + getFormattedText(address2, TmkPrinterConstants.FONT_SMALL, TmkPrinterConstants.LEFT_ALIGN); + companyAddress = (postalAddress==null) ? companyAddress : companyAddress + getFormattedText(postalAddress, TmkPrinterConstants.FONT_SMALL, TmkPrinterConstants.LEFT_ALIGN); + companyAddress = (city==null) ? companyAddress : companyAddress + getFormattedText(city, TmkPrinterConstants.FONT_SMALL, TmkPrinterConstants.LEFT_ALIGN); + companyAddress = (postalCode==null) ? companyAddress : companyAddress + getFormattedText(postalCode, TmkPrinterConstants.FONT_SMALL, TmkPrinterConstants.LEFT_ALIGN); + } + catch (OperationException e1) + { + log.log(Level.SEVERE, "Could not get details for linked business partner", e1); + } + + String title = null; + String customerName = null; + String salesRep = null; + String docStatus = null; + String payment = null; + String customerAddress = null; + String refNo = null; + + //load the order + MOrder order = new MOrder(ctx, recordId, trxName); + + // Load terminal info + MPOS posTerminal = new MPOS(ctx, order.getC_POS_ID(), trxName); + terminal = posTerminal.getName(); + + //getting customer info + int bpartner_id = order.getBill_BPartner_ID(); + BPartnerBean bean; + try + { + bean = BPartnerManager.getBpartner(ctx,bpartner_id,trxName); + } + catch(Exception e) + { + throw new FormattingException("Formatting Error", e); + } + + String name1 = (bean.getPartnerName() == null)? " " : bean.getPartnerName(); + String name2 = (bean.getName2() == null)? " " : bean.getName2(); + customerName = (name1 + " " + name2).trim(); + + String address1 = (bean.getAddress1() == null)? " " : bean.getAddress1(); + String address2 = (bean.getAddress2() == null)? " " : bean.getAddress2(); + customerAddress = (address1 + " " + address2).trim(); + + MBPartner customer = BPartnerManager.loadBPartner(ctx,bean.getBpartnerId(),trxName); + String customerVAT = customer.getTaxID()==null?"":customer.getTaxID(); + + if ( UDIOrderTypes.POS_ORDER.getOrderType().equals(order.getOrderType()) + || order.getOrderType().equals(null) + || UDIOrderTypes.CREDIT_ORDER.getOrderType().equals(order.getOrderType())) + { + title = "Tax Invoice"; + } + if ( UDIOrderTypes.POS_GOODS_RECEIVE_NOTE.getOrderType().equals(order.getOrderType())) + { + title = "Goods Receive Note"; + } + if ( UDIOrderTypes.POS_GOODS_RETURN_NOTE.getOrderType().equals(order.getOrderType())) + { + title = "Goods Return Note"; + } + if ( UDIOrderTypes.CUSTOMER_RETURN_ORDER.getOrderType().equals(order.getOrderType())) + { + title = "Customer Return Order"; + } + + + ///////////////////////////////drawing the order//////////////////////////////// + StringBuffer reportData = new StringBuffer(); + + // add title + reportData.append(getFormattedText("***" + title + "***", TmkPrinterConstants.FONT_SMALL, TmkPrinterConstants.LEFT_ALIGN)); + + // add company name + if(companyName1 != null) + { + // TODO Refactor code push code in getFormattedText(String text, String font, String alignment, boolean addLineFeed) method + int lineWidth = getLineWidth(TmkPrinterConstants.FONT_DOUBLE); + //split name1 + StringTokenizer st = new StringTokenizer(companyName1); + String line = ""; + + while(st.hasMoreTokens()) + { + String s = st.nextToken(); + + if((line + " " + s).length() > lineWidth) + { + reportData.append(getFormattedText(line, TmkPrinterConstants.FONT_DOUBLE, TmkPrinterConstants.LEFT_ALIGN)); + line = ""; + } + + line += s + " "; + + } + + reportData.append(getFormattedText(line, TmkPrinterConstants.FONT_DOUBLE, TmkPrinterConstants.LEFT_ALIGN)); + + } + + // add company branch + if(companyName2 != null) + { + if(companyName2.trim().length() > 0) + { + reportData.append(getFormattedText(companyName2, TmkPrinterConstants.FONT_SMALL, TmkPrinterConstants.LEFT_ALIGN)); + } + } + + reportData.append(TmkPrinterConstants.LINE_FEED); + + // add vat# + if(vatRegNumber != null) + { + reportData.append(getFormattedText("VAT NO: " + vatRegNumber, TmkPrinterConstants.FONT_SMALL, TmkPrinterConstants.LEFT_ALIGN)); + } + + // add phone# + if(companyPhone != null) + { + reportData.append(getFormattedText("TEL: " + companyPhone, TmkPrinterConstants.FONT_SMALL, TmkPrinterConstants.LEFT_ALIGN)); + } + + // add fax# + if(companyFax != null) + { + reportData.append(getFormattedText("FAX: " + companyFax, TmkPrinterConstants.FONT_SMALL, TmkPrinterConstants.LEFT_ALIGN)); + } + + reportData.append(TmkPrinterConstants.LINE_FEED); + + // add date & time + Calendar c = Calendar.getInstance(); + c.setTime(new Date(order.getCreated().getTime())); + String date = String.format("%1$te/%1$tm/%1$tY",c); + String time = String.format("%1$tH:%1$tM",c); + String dateTime = "DATE: " + date + " TIME: " + time; + + reportData.append(getFormattedText(dateTime, TmkPrinterConstants.FONT_SMALL, TmkPrinterConstants.LEFT_ALIGN)); + + // add till# + if(terminal != null) + { + reportData.append(getFormattedText("TILL : " + terminal, TmkPrinterConstants.FONT_SMALL, TmkPrinterConstants.LEFT_ALIGN)); + } + + if (companyAddress != null) + { + reportData.append(companyAddress); + } + + // add Invoice # + MInvoice[] invoices = order.getInvoices(); + if(invoices.length > 0) + { + MInvoice invoice = invoices[0]; + reportData.append(getFormattedText("INVOICE NO : " + invoice.getDocumentNo(), TmkPrinterConstants.FONT_SMALL, TmkPrinterConstants.LEFT_ALIGN)); + } + + + // add BP account# followed by address and VAT# + // reportData.append(getFormattedText(customerActNumber, TmkPrinterConstants.FONT_SMALL, TmkPrinterConstants.LEFT_ALIGN)); + reportData.append(getFormattedText(customerName, TmkPrinterConstants.FONT_SMALL, TmkPrinterConstants.LEFT_ALIGN)); + reportData.append(getFormattedText(address1, TmkPrinterConstants.FONT_SMALL, TmkPrinterConstants.LEFT_ALIGN)); + reportData.append(getFormattedText(address2, TmkPrinterConstants.FONT_SMALL, TmkPrinterConstants.LEFT_ALIGN)); + reportData.append(getFormattedText("Client VAT No: " + customerVAT, TmkPrinterConstants.FONT_SMALL, TmkPrinterConstants.LEFT_ALIGN)); + + reportData.append(getFormattedText(_lineTop, TmkPrinterConstants.FONT_SMALL, TmkPrinterConstants.CENTER_ALIGN)); + + // 1.body + ArrayList orderLineList; + + try + { + orderLineList = POSManager.populateOrderLines(ctx,order); + } + catch(Exception e) + { + throw new FormattingException("Formatting Error", e); + } + + BigDecimal lineQty = Env.ZERO; + BigDecimal lineDiscount = Env.ZERO; + BigDecimal lineTaxAmt = Env.ZERO; + BigDecimal lineTotal = Env.ZERO; + BigDecimal lineListPrice = Env.ZERO; + BigDecimal lineInclUnitPrice = Env.ZERO; + BigDecimal linePriceActual = Env.ZERO; + BigDecimal lineTaxRate = Env.ZERO; + BigDecimal orderTotalQty = Env.ZERO; + BigDecimal orderGrandTotal = Env.ZERO; + BigDecimal orderTotalTax = Env.ZERO; + Boolean isTaxIncluded = order.isTaxIncluded(); + + String orderline = ""; + String orderlineFormat = ""; + + orderlineFormat = "%1$-9.2f X %2$-10.2f %3$" + (_lineWidth - (9 + 10 + 4) + ".2f"); + + BigDecimal orderTotalDiscount = Env.ZERO; + for(WebOrderLineBean wbean : orderLineList) + { + String productName = wbean.getProductName(); + String productDesc = wbean.getDescription(); + int nameLength = productName.length(); + int space = 2; + int descLength = productDesc.length(); + + if ((nameLength + descLength + space) > _lineWidth) + { + int trunc = nameLength + descLength + space - _lineWidth; + productDesc = productDesc.substring(0, descLength-trunc-1); + } + + orderline = String.format("%1$-"+ (nameLength + space) +"s %2$-" + (_lineWidth - (nameLength + space + 1))+ "s", productName, productDesc); + reportData.append(TmkPrinterConstants.FONT_SMALL) + .append(orderline); + + lineTaxAmt = wbean.getTaxAmt()==null?Env.ZERO :wbean.getTaxAmt(); + lineTaxRate = wbean.getTaxRate() == null? Env.ZERO : wbean.getTaxRate(); + lineQty = wbean.getQtyOrdered(); + lineDiscount = wbean.getDiscountPercentage()==null?Env.ZERO :wbean.getDiscountPercentage(); + lineListPrice = wbean.getUnitPrice(); + linePriceActual = wbean.getPriceActual(); + + lineTotal = linePriceActual.multiply(lineQty); + + BigDecimal taxRateMulFactor = (lineTaxRate.divide(Env.ONEHUNDRED)).add(Env.ONE).setScale(2, RoundingMode.HALF_DOWN); + BigDecimal discountMulFactor = (lineDiscount.divide(Env.ONEHUNDRED)).add(Env.ONE).setScale(2, RoundingMode.HALF_DOWN); + BigDecimal discountAmt = lineListPrice.multiply(lineDiscount).multiply(taxRateMulFactor).setScale(2, RoundingMode.HALF_DOWN); + + if (isTaxIncluded) + { + lineInclUnitPrice = linePriceActual; + orderGrandTotal = orderGrandTotal.add(lineTotal); + } + else + { + lineInclUnitPrice = linePriceActual.multiply(taxRateMulFactor).setScale(2, RoundingMode.HALF_DOWN); + orderGrandTotal = orderGrandTotal.add(lineTotal).add(lineTaxAmt); + } + + orderTotalDiscount = orderTotalDiscount.add(discountAmt); + orderTotalQty = orderTotalQty.add(lineQty); + orderTotalTax = orderTotalTax.add(lineTaxAmt); + + orderline = String.format(orderlineFormat, lineQty, lineInclUnitPrice, lineInclUnitPrice.multiply(lineQty)); + reportData.append(TmkPrinterConstants.FONT_SMALL) + .append(orderline) + .append(TmkPrinterConstants.LINE_FEED); + + reportData.append(getFormattedText(_lineBottom, TmkPrinterConstants.FONT_SMALL, TmkPrinterConstants.CENTER_ALIGN)); + } + + // 2.footer + String footerFormat = "%1$6s %2$" + (_lineWidth - (6 + 1)) + ".2f"; + String orderFooter = String.format(footerFormat,"TOTAL",orderGrandTotal); + reportData.append(TmkPrinterConstants.FONT_SMALL) + .append(orderFooter) + .append(TmkPrinterConstants.LINE_FEED) + .append(TmkPrinterConstants.LINE_FEED); + + footerFormat = "%1$6s %2$-" + (_lineWidth - (10)) + ".2f"; + orderFooter = String.format(footerFormat,"Total VAT",orderTotalTax); + reportData.append(TmkPrinterConstants.FONT_SMALL) + .append(orderFooter) + .append(TmkPrinterConstants.LINE_FEED) + .append(TmkPrinterConstants.LINE_FEED); + + // add messages + // align contents to left + reportData.append(TmkPrinterConstants.LEFT_ALIGN); + + reportData.append(TmkPrinterConstants.LINE_FEED).append(TmkPrinterConstants.LINE_FEED); + + reportData.append(getFormattedText("Total Items..... "+ String.format("%1$-9.2f",orderTotalQty), TmkPrinterConstants.FONT_SMALL, TmkPrinterConstants.LEFT_ALIGN)); + + reportData.append(TmkPrinterConstants.LINE_FEED).append(TmkPrinterConstants.LINE_FEED); + + /*-----------------------------------------------------------------------------------*/ + + // 4.amount tendered & refunded + + if (UDIOrderTypes.CREDIT_ORDER.getOrderType().equals(order.getOrderType())) + { + MInvoice invoice = order.getInvoices()[0]; + reportData.append(getFormattedText("DEBTORS ACCOUNT SALES " + invoice.getDocumentNo() , TmkPrinterConstants.FONT_SMALL, TmkPrinterConstants.LEFT_ALIGN)); + + BigDecimal openBalance = customer.getTotalOpenBalance(); + reportData.append(getFormattedText("Balance: " + String.format("%1$10.2f", openBalance) , TmkPrinterConstants.FONT_SMALL, TmkPrinterConstants.LEFT_ALIGN)); + } + else + { + BigDecimal cashAmountTendered = order.getAmountTendered()==null? Env.ZERO : order.getAmountTendered(); + + BigDecimal cashAmountRefunded = Env.ZERO; + if (MOrder.PAYMENTRULE_Cash.equals(order.getPaymentRule())) + { + cashAmountRefunded = order.getAmountRefunded() == null? cashAmountRefunded : order.getAmountRefunded(); + } + + BigDecimal cardAmountTendered = Env.ZERO; + BigDecimal chequeAmountTendered = Env.ZERO; + BigDecimal writeOffAmt = Env.ZERO; + BigDecimal orderDiscount = Env.ZERO; + BigDecimal paymentAmt = Env.ZERO; + + if (MOrder.STATUS_Completed.equalsIgnoreCase(order.getDocStatus())) + { + if(order.getOrderType().equalsIgnoreCase(UDIOrderTypes.POS_ORDER.getOrderType())) + { + try + { + orderDiscount = POSManager.getFromInvoice(ctx, order.getC_Invoice_ID(), Constants.ORDER_DICOUNT, trxName); + writeOffAmt = POSManager.getFromInvoice(ctx, order.getC_Invoice_ID(), Constants.ORDER_WRITE_OFF, trxName); + cardAmountTendered = POSManager.getFromInvoice(ctx, order.getC_Invoice_ID(), Constants.ORDER_CARD_AMOUNT, trxName); + chequeAmountTendered = POSManager.getFromInvoice(ctx, order.getC_Invoice_ID(), Constants.ORDER_CHECK_AMOUNT, trxName); + paymentAmt = POSManager.getFromInvoice(ctx, order.getC_Invoice_ID(), Constants.ORDER_PAYMENT, trxName); + + } + catch (OperationException e) + { + throw new FormattingException("Cannot get payment",e); + } + } + } + + boolean discountOnOrderLine = false; + + if (orderTotalDiscount.compareTo(Env.ZERO) == 1) + { + discountOnOrderLine = true; + } + orderTotalDiscount = orderTotalDiscount.add(orderDiscount); + + if (orderTotalDiscount.compareTo(Env.ZERO)==1 && !discountOnOrderLine) + { + String discountAmtStr = String.format("Discount Amt :%1$10.2f", orderTotalDiscount); + reportData.append(getFormattedText(discountAmtStr, TmkPrinterConstants.FONT_NORMAL, TmkPrinterConstants.LEFT_ALIGN)).append(TmkPrinterConstants.LINE_FEED); + } + if (writeOffAmt.compareTo(Env.ZERO)==1 && MOrder.PAYMENTRULE_Cash.equals(order.getPaymentRule())) + { + String writeOff = String.format("Write Off Amt :%1$10.2f", writeOffAmt); + reportData.append(getFormattedText(writeOff, TmkPrinterConstants.FONT_NORMAL, TmkPrinterConstants.LEFT_ALIGN)); + } + if (paymentAmt.compareTo(Env.ZERO)==1) + { + String actualPayment = String.format("Payment Amt :%1$10.2f", paymentAmt); + reportData.append(getFormattedText(actualPayment, TmkPrinterConstants.FONT_NORMAL, TmkPrinterConstants.LEFT_ALIGN)); + } + + String amountTendered = String.format("Cash Tendered :%1$10.2f", cashAmountTendered); + String amountRefunded = String.format("Cash refunded :%1$10.2f", cashAmountRefunded); + String cardTendered = String.format("Card Tendered :%1$10.2f", cardAmountTendered); + String chequeTendered = String.format("Cheque Tendered:%1$10.2f", chequeAmountTendered); + + if (MOrder.PAYMENTRULE_Cash.equals(order.getPaymentRule()) || MOrder.PAYMENTRULE_Mixed.equals(order.getPaymentRule())) + { + if(cashAmountTendered.doubleValue() > 0.0d) + { + reportData.append(getFormattedText(amountTendered, TmkPrinterConstants.FONT_NORMAL, TmkPrinterConstants.LEFT_ALIGN)); + } + if (cashAmountRefunded.compareTo(Env.ZERO) == 1) + { + reportData.append(getFormattedText(amountRefunded, TmkPrinterConstants.FONT_NORMAL, TmkPrinterConstants.LEFT_ALIGN)); + } + } + if (MOrder.PAYMENTRULE_CreditCard.equals(order.getPaymentRule()) || MOrder.PAYMENTRULE_Mixed.equals(order.getPaymentRule())) + { + if(cardAmountTendered.doubleValue() > 0.0d) + { + reportData.append(getFormattedText(cardTendered, TmkPrinterConstants.FONT_NORMAL, TmkPrinterConstants.LEFT_ALIGN)); + } + } + if (MOrder.PAYMENTRULE_Check.equals(order.getPaymentRule()) || MOrder.PAYMENTRULE_Mixed.equals(order.getPaymentRule())) + { + if(chequeAmountTendered.doubleValue() > 0.0d) + { + reportData.append(getFormattedText(chequeTendered, TmkPrinterConstants.FONT_NORMAL, TmkPrinterConstants.LEFT_ALIGN)); + } + } + } + + // show if credit sales + + if ( UDIOrderTypes.CREDIT_ORDER.getOrderType().equals(order.getOrderType())) + { + reportData.append(TmkPrinterConstants.LINE_FEED).append(TmkPrinterConstants.LINE_FEED) + .append(getFormattedText("------------------------------" , TmkPrinterConstants.FONT_SMALL, TmkPrinterConstants.CENTER_ALIGN)); + + reportData.append(getFormattedText("SIGNATURE OF BUYER" , TmkPrinterConstants.FONT_SMALL, TmkPrinterConstants.CENTER_ALIGN)); + + } + + reportData.append(TmkPrinterConstants.LINE_FEED); + + if( order.getOrderType().equalsIgnoreCase(UDIOrderTypes.POS_ORDER.getOrderType()) ) + { + /*reportData.append(getFormattedText("*** Thank you ***", TmkPrinterConstants.FONT_SMALL, TmkPrinterConstants.LEFT_ALIGN)); + reportData.append(TmkPrinterConstants.LINE_FEED) + .append(getFormattedText("*Goods once sold cannot be returned.", TmkPrinterConstants.FONT_SMALL, TmkPrinterConstants.LEFT_ALIGN)); + reportData.append(TmkPrinterConstants.LINE_FEED);*/ + reportData.append(TmkPrinterConstants.LINE_FEED); + + if(footerMsg != null && footerMsg.length() != 0) + { + if(footerMsg.length() > 40) // 40 is the max no of chars that can fit in a single line + { + String temp = ""; + String splittedFooterMsg = ""; + + while(footerMsg.length() > 40) + { + temp = footerMsg.substring(0, 39); + + if(!(temp.endsWith(" "))) + { + splittedFooterMsg = temp.substring(0, temp.lastIndexOf(" ")); + + } + else + { + splittedFooterMsg = temp; + } + + footerMsg = footerMsg.substring(temp.lastIndexOf(" ") +1); + reportData.append(getFormattedText(splittedFooterMsg, TmkPrinterConstants.FONT_SMALL, TmkPrinterConstants.LEFT_ALIGN)); + } + + reportData.append(getFormattedText(footerMsg, TmkPrinterConstants.FONT_SMALL, TmkPrinterConstants.LEFT_ALIGN)); + } + else //footerMsg length < 40 + { + reportData.append(getFormattedText(footerMsg, TmkPrinterConstants.FONT_SMALL, TmkPrinterConstants.LEFT_ALIGN)); + } + } + } + + reportData.append(TmkPrinterConstants.PAPER_CUT).append(TmkPrinterConstants.LINE_FEED); + + return reportData.toString(); + + } + + public String format1(Properties ctx, int recordId, Object... args) throws Exception + { + StringBuffer reportData = new StringBuffer(); + + String text1 = getFormattedText("L", TmkPrinterConstants.FONT_NORMAL, TmkPrinterConstants.LEFT_ALIGN); + String text2 = getFormattedText("R", TmkPrinterConstants.FONT_NORMAL, TmkPrinterConstants.RIGHT_ALIGN); + + reportData.append(text1); + reportData.append(text2); + + reportData.append(text1); + reportData.append("\r"); + reportData.append(text2); + reportData.append("\n"); + + return reportData.toString(); + } + + private int getLineWidth(String font) + { + if(TmkPrinterConstants.FONT_DOUBLE.equals(font)) + { + return 16; + } + + if(TmkPrinterConstants.FONT_NORMAL.equals(font)) + { + return 33; + } + + if(TmkPrinterConstants.FONT_SMALL.equals(font)) + { + return 40; + } + + return _lineWidth; + } + + public String getFormattedText(String text, String font, String alignment) + { + return getFormattedText(text, font, alignment, true); + } + + public String getFormattedText(String text, String font, String alignment, boolean addLineFeed) + { + int charPerLine = getLineWidth(font); + String formattedText = ""; + + if (TmkPrinterConstants.CENTER_ALIGN.equals(alignment)) + { + formattedText = font + TmkPrinterConstants.CENTER_ALIGN + text; + + if(addLineFeed) + { + formattedText = formattedText + TmkPrinterConstants.LINE_FEED; + } + return formattedText; + } + + if (TmkPrinterConstants.LEFT_ALIGN.equals(alignment)) + { + formattedText = font + String.format("%1$-" + charPerLine + "s", text); + + if(addLineFeed) + { + formattedText = formattedText + TmkPrinterConstants.LINE_FEED; + } + return formattedText; + } + + if (TmkPrinterConstants.RIGHT_ALIGN.equals(alignment)) + { + formattedText = font + String.format("%1$" + charPerLine + "s", text); + + if(addLineFeed) + { + formattedText = formattedText + TmkPrinterConstants.LINE_FEED; + } + return formattedText; + } + + return text; + } + + + + +} diff --git a/posterita/posterita/src/main/org/posterita/util/OrderFormatter.java b/posterita/posterita/src/main/org/posterita/util/OrderFormatter.java new file mode 100644 index 0000000000..81d0f90e5a --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/util/OrderFormatter.java @@ -0,0 +1,524 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Sep 26, 2006 + */ + + +package org.posterita.util; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.Properties; +import java.util.ResourceBundle; + +import org.compiere.model.MBPartner; +import org.compiere.model.MLocation; +import org.compiere.model.MOrder; +import org.compiere.model.MOrg; +import org.compiere.model.MPayment; +import org.compiere.model.MUser; + +import org.posterita.Constants; +import org.posterita.beans.BPartnerBean; +import org.posterita.beans.OrderLineBean; +import org.posterita.beans.WebOrderLineBean; +import org.posterita.businesslogic.OrganisationManager; +import org.posterita.businesslogic.POSManager; +import org.posterita.businesslogic.administration.BPartnerManager; +import org.posterita.core.ContextId; +import org.posterita.exceptions.FormattingException; +import org.posterita.exceptions.OperationException; +import org.posterita.formatter.Formatter; +import org.posterita.lib.UdiConstants; +import org.posterita.order.UDIOrderTypes; + +import org.posterita.util.TmkPrinterConstants; + + +public class OrderFormatter extends Formatter +{ + private boolean isVatIncluded = true; + + @Override + public Object format(Object target) throws FormattingException + { + ResourceBundle messageResource = ResourceBundle.getBundle("MessageResources"); + + String vatRegNumber = "VAT Reg No:" + messageResource.getString("receipt.VATRegNo"); + String companyName1 = messageResource.getString("receipt.company.name1"); + String companyName2 = messageResource.getString("receipt.company.name2"); + String companyPhone = messageResource.getString("receipt.company.phone"); + String companyAddress = messageResource.getString("receipt.company.address"); + + ContextId ctxId = (ContextId) target; + + Properties ctx = ctxId.getCtx(); + int id = ctxId.getId(); + + //setting receipt header + try + { + MOrg myorg = OrganisationManager.getMyOrg(ctx); + int bpartnerId = myorg.getLinkedC_BPartner_ID(null); + + + MBPartner bpartner = BPartnerManager.loadBPartner(ctx,bpartnerId,null); + BPartnerBean bean = BPartnerManager.getBpartner(ctx, bpartnerId, null); + + vatRegNumber = bpartner.getTaxID(); + companyName1 = bean.getPartnerName(); + companyName2 = bean.getName2(); + companyPhone = bean.getPhone(); + + String add = bean.getAddress1(); + add = (add==null) ? "" : add; + + companyAddress = add; + + add = bean.getAddress2(); + + if(add!=null){ + companyAddress = companyAddress + " " + add; + } + + add = bean.getCity(); + add = (add==null) ? "" : add; + + companyAddress = companyAddress + ", " + add; + + + } catch (OperationException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + + String title = null; + String customerName = null; + String salesRep = null; + String docStatus = null; + String payment = null; + String customerAddress = null; + String orderType=null; + //String dateOrdered = null; + String refNo = null; + + //load the order + MOrder order = new MOrder(ctx, id, null); + + String paymentRule = null; + + //setting payment + paymentRule = order.getPaymentRule(); + + if(paymentRule.equalsIgnoreCase(MOrder.PAYMENTRULE_Cash)) + { + payment = Constants.PAYMENT_RULE_CASH; + } + + if(paymentRule.equalsIgnoreCase(MOrder.PAYMENTRULE_CreditCard)) + { + payment = Constants.PAYMENT_RULE_CARD; + } + + if(paymentRule.equalsIgnoreCase(MOrder.PAYMENTRULE_Check)) + { + payment = Constants.PAYMENT_RULE_CHEQUE; + } + + if(paymentRule.equalsIgnoreCase(UdiConstants.PAYMENTRULE_MIXED)) + { + payment = Constants.PAYMENT_RULE_MIXED; + } + //setting ref no + refNo = order.getDocumentNo(); + + //getting orgInfo + MOrg org = new MOrg(ctx,order.getAD_Org_ID(),null); + int location_id = org.getInfo().getC_Location_ID(); + MLocation location = new MLocation(ctx,location_id,null); + + // orgName = org.getName(); + + String address1 = (location.getAddress1() == null)? " " : location.getAddress1(); + String address2 = (location.getAddress2() == null)? " " : location.getAddress2(); + // orgAddress = (address1 + " " + address2).trim(); + + //getting order type + orderType = order.getOrderType(); + + //getting orderInfo + docStatus = order.getDocStatusName(); + + + //getting salesrep + int saleRep_id = order.getSalesRep_ID(); + MUser user = new MUser(ctx,saleRep_id,null); + salesRep = user.getName(); + + //getting customer info + int bpartner_id = order.getBill_BPartner_ID(); + BPartnerBean bean; + try + { + bean = BPartnerManager.getBpartner(ctx,bpartner_id,null); + } + catch(Exception e) + { + throw new FormattingException("Formatting Error", e); + } + + + String name1 = (bean.getPartnerName() == null)? " " : bean.getPartnerName(); + String name2 = (bean.getName2() == null)? " " : bean.getName2(); + customerName = (name1 + " " + name2).trim(); + + address1 = (bean.getAddress1() == null)? " " : bean.getAddress1(); + address2 = (bean.getAddress2() == null)? " " : bean.getAddress2(); + customerAddress = (address1 + " " + address2).trim(); + + + ///////////////////////////////drawing the order//////////////////////////////// + StringBuffer reportData = new StringBuffer(TmkPrinterConstants.LOGO1); + //adding header + reportData.append(TmkPrinterConstants.SMALL_FONT) + .append(TmkPrinterConstants.H_FULL_LINE_TOP) + .append(TmkPrinterConstants.CENTER_ALIGN) + .append(TmkPrinterConstants.LINE_FEED); + + if(companyName1!=null) + reportData.append(TmkPrinterConstants.FONT_DOUBLE) + .append(companyName1) + .append(TmkPrinterConstants.LINE_FEED); + + if(companyName2!=null) + reportData.append(TmkPrinterConstants.CENTER_ALIGN) + .append(TmkPrinterConstants.BIG_FONT) + .append("(" + companyName2 + ")") + .append(TmkPrinterConstants.LINE_FEED); + + if(companyAddress!=null) + reportData.append(TmkPrinterConstants.FONT_NORMAL) + .append(companyAddress) + .append(TmkPrinterConstants.LINE_FEED); + + if(companyPhone!=null) + reportData.append(TmkPrinterConstants.FONT_NORMAL) + .append("Tel:" + companyPhone) + .append(TmkPrinterConstants.LINE_FEED); + + if(vatRegNumber!=null) + reportData.append(TmkPrinterConstants.FONT_NORMAL) + .append("VAT Reg No:" + vatRegNumber) + .append(TmkPrinterConstants.LINE_FEED); + + reportData.append(TmkPrinterConstants.SMALL_FONT) + .append(TmkPrinterConstants.H_FULL_LINE_TOP) + .append(TmkPrinterConstants.LINE_FEED); + + //adding title + title = orderType; + reportData.append(TmkPrinterConstants.BIG_FONT) + .append(TmkPrinterConstants.CENTER_ALIGN) + .append(title) + .append(TmkPrinterConstants.LINE_FEED); + + //setting small font + reportData.append(TmkPrinterConstants.SMALL_FONT); + reportData.append(TmkPrinterConstants.LEFT_ALIGN); + + //adding customer name + customerName = String.format("%1$-30s",customerName); + reportData.append(customerName); + + //adding sales rep + salesRep = "Sales Rep:" + salesRep; + salesRep = String.format("%1$30s",salesRep); + reportData.append(salesRep) + .append(TmkPrinterConstants.LINE_FEED); + + //adding customer address + customerAddress = String.format("%1$-60s",customerAddress); + reportData.append(customerAddress) + .append(TmkPrinterConstants.LINE_FEED); + + //adding status + docStatus = "Status:" + docStatus; + docStatus = String.format("%1$-60s",docStatus); + reportData.append(docStatus) + .append(TmkPrinterConstants.LINE_FEED); + + //adding payment + payment = "Payment:" + payment; + payment = String.format("%1$-60s",payment); + reportData.append(payment) + .append(TmkPrinterConstants.LINE_FEED); + + //adding reference no + refNo = "Ref No:" + refNo; + refNo = String.format("%1$-60s",refNo); + reportData.append(refNo) + .append(TmkPrinterConstants.LINE_FEED); + + //adding date + Calendar c = Calendar.getInstance(); + c.setTime(new Date(order.getCreated().getTime())); + String date = String.format("%1$te %1$tb,%1$tY %1$tH:%1$tM:%1$tS",c); + date = String.format("%1$-60s",date); + reportData.append(date) + .append(TmkPrinterConstants.LINE_FEED); + + //adding orderlines + //1.header + reportData.append(TmkPrinterConstants.H_FULL_LINE_TOP).append("\n"); + + String headerFormat = "" + + "%1$-30s" + + "%2$7s" + + "%3$5s" + + "%4$8s" + + "%5$10s"; + + String header = String.format(headerFormat,"Name","Unit","Qty","Dis","Total"); + reportData.append(header).append("\n"); + + reportData.append(TmkPrinterConstants.H_FULL_LINE_BOTTOM) + .append(TmkPrinterConstants.LINE_FEED); + + //2.body + ArrayList orderLineList; + try + { + orderLineList = POSManager.populateOrderLines(ctx,order); + } + catch(Exception e) + { + throw new FormattingException("Formatting Error", e); + } + + String name = null; + int qty; + BigDecimal discount = null; + BigDecimal taxAmt = null; + BigDecimal total; + BigDecimal unitPrice; + + int totalQty = 0; + double grandTotal = 0.0d; + double totalTax = 0.0d; + String orderline = ""; + + String orderlineFormat = "" + + "%1$-30s" + //1.product name OR description + "%2$7.2f" + //2.unit price + "%3$5d" + //3.quantity + "%4$8.2f" + //4.discount amount + "%5$10.2f"; //5.total price + + for(WebOrderLineBean wbean : orderLineList) + { + taxAmt = wbean.getTaxAmt(); + name = wbean.getDescription(); + qty = wbean.getQtyOrdered().intValue(); + discount = wbean.getDiscountPercentage(); + total = wbean.getLineTotalAmt(); + unitPrice = wbean.getUnitPrice(); + + if(isVatIncluded) + { + unitPrice = total.divide(new BigDecimal(qty)); + } + + + discount = (discount==null)? new BigDecimal(0.0) : discount; + taxAmt = (taxAmt==null)? new BigDecimal(0.0) : taxAmt; + + double discountAmt = 0.0; + discountAmt = (total.doubleValue() * 100.0)/(100.0 - discount.doubleValue()) - total.doubleValue(); + + totalQty += qty; + grandTotal += total.doubleValue(); + totalTax += taxAmt.doubleValue(); + + if(taxAmt.intValue() == 0) + { + name = name + "*"; + } + + orderline = String.format(orderlineFormat,name,unitPrice,qty,discountAmt,total); + reportData.append(orderline) + .append(TmkPrinterConstants.LINE_FEED); + } + + //3.footer + reportData.append(TmkPrinterConstants.H_FULL_LINE_BOTTOM) + .append(TmkPrinterConstants.LINE_FEED); + + String footerFormat = "" + + "%1$-37s" + + "%2$5d" + + "%3$8s" + + "%4$10.2f"; + + String footer = String.format(footerFormat,"Grand Total",totalQty,"Rs",grandTotal); + reportData.append(footer) + .append(TmkPrinterConstants.LINE_FEED); + + reportData.append(TmkPrinterConstants.H_FULL_LINE_TOP) + .append(TmkPrinterConstants.LINE_FEED); + + + //4.amount tendered & refunded + BigDecimal cashAmountTendered = order.getAmountTendered(); + if(cashAmountTendered == null) + { + cashAmountTendered = new BigDecimal(0.0); + } + + BigDecimal cashAmountRefunded = order.getAmountRefunded(); + if(cashAmountRefunded == null) + { + cashAmountRefunded = new BigDecimal(0.0); + } + + BigDecimal cardAmountTendered = null; + BigDecimal chequeAmountTendered = null; + + OrderLineBean orderLineBean = null; + if(ctxId.getBean() != null) + { + orderLineBean = (OrderLineBean) ctxId.getBean(); + Double cardAmt = orderLineBean.getPaymentByCard(); + Double chequeAmt = orderLineBean.getPaymentByChq(); + + if(cardAmt == null) + { + cardAmountTendered = new BigDecimal(0.0d); + } + else + { + cardAmountTendered = new BigDecimal(cardAmt.doubleValue()); + } + + if(chequeAmt == null) + { + chequeAmountTendered = new BigDecimal(0.0d); + } + else + { + chequeAmountTendered = new BigDecimal(chequeAmt.doubleValue()); + } + } + else + { + + if(order.getOrderType().equalsIgnoreCase(UDIOrderTypes.POS_ORDER.getOrderType())) + { + try + { + cardAmountTendered = POSManager.getPayment(ctx, order.get_ID(),MPayment.TENDERTYPE_CreditCard,null); + chequeAmountTendered = POSManager.getPayment(ctx, order.get_ID(),MPayment.TENDERTYPE_Check,null); + } + catch (OperationException e) + { + throw new FormattingException("Cannot get payment",e); + } + } + else + { + cardAmountTendered = new BigDecimal(0.0d); + chequeAmountTendered = new BigDecimal(0.0d); + } + + } + + String amountTendered = String.format("%1$45s%2$4s:%3$10.2f","Cash Tendered","Rs",cashAmountTendered); + String amountRefunded = String.format("%1$45s%2$4s:%3$10.2f","Cash Refunded","Rs",cashAmountRefunded); + + String seperator = String.format("%1$45s%2$15s","","------------"); + + String cardTendered = String.format("%1$45s%2$4s:%3$10.2f","Card Tendered","Rs",cardAmountTendered); + String chequeTendered = String.format("%1$45s%2$4s:%3$10.2f","Cheque Tendered","Rs",chequeAmountTendered); + + if(cashAmountTendered.doubleValue() > 0.0d) + { + reportData.append(amountTendered).append(TmkPrinterConstants.LINE_FEED); + } + + if(cardAmountTendered.doubleValue() > 0.0d) + { + reportData.append(cardTendered).append(TmkPrinterConstants.LINE_FEED); + } + + if(chequeAmountTendered.doubleValue() > 0.0d) + { + reportData.append(chequeTendered).append(TmkPrinterConstants.LINE_FEED); + } + + if(cashAmountTendered.doubleValue() > 0.0d) + { + reportData.append(seperator).append(TmkPrinterConstants.LINE_FEED); + reportData.append(amountRefunded).append(TmkPrinterConstants.LINE_FEED); + } + + + String totalVAT = String.format("%1$.2f",totalTax); + String vat = String.format("%1$-60s","Total VAT:Rs"+totalVAT); + reportData.append(vat) + .append(TmkPrinterConstants.LINE_FEED); + + String noVAT = String.format("%1$-60s","* NO VAT"); + + //barcode + String barcode = ((char)0x1d ) + "H" + (char)2 + ((char)0x1d ) + "k" + (char)4 + order.getDocumentNo() + (char)0; + String barcodeDim = ((char)0x1d) + "h" + (char)50 + ((char)0x1d) + "w" + (char)3; + + reportData.append(noVAT) + .append(TmkPrinterConstants.LINE_FEED) + .append(TmkPrinterConstants.LINE_FEED) + .append(TmkPrinterConstants.CENTER_ALIGN) + .append(barcodeDim) + .append(barcode) + .append(TmkPrinterConstants.LINE_FEED) + .append(TmkPrinterConstants.FONT_NORMAL) + .append(TmkPrinterConstants.CENTER_ALIGN) + .append("*** Thank you ***") + .append(TmkPrinterConstants.LINE_FEED); + + if( order.getOrderType().equalsIgnoreCase(UDIOrderTypes.POS_ORDER.getOrderType()) ) + { + reportData.append(TmkPrinterConstants.LINE_FEED) + .append(TmkPrinterConstants.CENTER_ALIGN) + .append(TmkPrinterConstants.FONT_SMALL) + .append("*Goods once sold cannot be returned."); + } + + reportData.append(TmkPrinterConstants.PAPER_CUT) + .append(TmkPrinterConstants.LINE_FEED); + + + return reportData.toString(); + } + + @Override + public Object unformat(Object target) { + throw new RuntimeException("Method not implemented"); + } +} diff --git a/posterita/posterita/src/main/org/posterita/util/PathInfo.java b/posterita/posterita/src/main/org/posterita/util/PathInfo.java new file mode 100644 index 0000000000..8905bd31a4 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/util/PathInfo.java @@ -0,0 +1,50 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +* Created on Mar 15, 2006 by ashley +* +*/ + +package org.posterita.util; + +import javax.servlet.Servlet; +import javax.servlet.ServletContext; + +public class PathInfo +{ + + public static String PROJECT_HOME = ""; + public static final String FILE_SEPARATOR = System.getProperty("file.separator"); + static + { + PROJECT_HOME = System.getProperty("user.dir"); + } + + public static void setPathInfo(Servlet servlet) + { + ServletContext serCtx = servlet.getServletConfig().getServletContext(); + + try + { + PROJECT_HOME = serCtx.getRealPath("") + FILE_SEPARATOR; + } + catch(Exception ex) + {} + + } +} diff --git a/posterita/posterita/src/main/org/posterita/util/PaymentFormatter.java b/posterita/posterita/src/main/org/posterita/util/PaymentFormatter.java new file mode 100644 index 0000000000..ab3cebf0bb --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/util/PaymentFormatter.java @@ -0,0 +1,43 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Sep 26, 2006 + */ + + +package org.posterita.util; + +import org.posterita.formatter.Formatter; + + +public class PaymentFormatter extends Formatter +{ + + @Override + public Object format(Object target) + { + return null; + } + + @Override + public Object unformat(Object target) + { + return null; + } + +} diff --git a/posterita/posterita/src/main/org/posterita/util/PoManager.java b/posterita/posterita/src/main/org/posterita/util/PoManager.java new file mode 100644 index 0000000000..fba4c3ab1a --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/util/PoManager.java @@ -0,0 +1,118 @@ +/** + * + * Copyright (c) 2007 Posterita. All Rights Reserved. + * + * This software is the confidential and proprietary information of + * Posterita. ("Confidential Information"). You shall not + * disclose such Confidential Information and shall use it only in + * accordance with the terms of the license agreement you entered into + * with Posterita. + * + * POSTERITA MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE + * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT + * NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR + * A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. Posterita SHALL NOT + * BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, + * MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. + * + * May 22, 2007 11:46:27 AM by praveen + * + */ + +package org.posterita.util; + +import org.compiere.model.PO; +import org.compiere.model.X_C_Order; +import org.compiere.process.DocAction; +import org.compiere.util.CLogger; +import org.compiere.util.ValueNamePair; +import org.posterita.businesslogic.POSTerminalManager; +import org.posterita.exceptions.OperationException; +import org.posterita.exceptions.TerminalLockedException; + +public class PoManager +{ + public static void save(PO po) throws OperationException + { + boolean saved = po.save(); + if(! saved ) + { + handleError(po); + } + } + + private static void validatePO(PO po) throws OperationException + { + if (po instanceof X_C_Order) + { + X_C_Order order = (X_C_Order)po; + int terminalId = order.getC_POS_ID(); + if (terminalId > 0 && POSTerminalManager.isTerminalLocked(po.getCtx(), terminalId)) + { + throw new TerminalLockedException("Terminal is locked"); + } + } + } + + public static void save(PO po, String trxName) throws OperationException + { + validatePO(po); + boolean saved = po.save(trxName); + if(!saved) + { + handleError(po); + } + } + + private static void handleError(PO po) throws OperationException + { + Exception ex = CLogger.retrieveException(); + ValueNamePair error = CLogger.retrieveError(); + String msg = null; + if(error != null) + { + msg = error.getName(); + } + + if(ex != null) + { + throw new OperationException("Cannot save PO object. " + po.getClass().getName() + " Cause: " + ex.getMessage()); + } + + if(msg != null) + { + throw new OperationException("Cannot save PO object. " + po.getClass().getName() + " Cause: " + msg); + } + + throw new OperationException("Cannot save PO object. " + po.getClass().getName()); + } + + public static void processIt(PO po, String processAction) throws OperationException + { + validatePO(po); + boolean processed = false; + try + { + if(po instanceof DocAction) + { + DocAction docPo = (DocAction)po; + processed = docPo.processIt(processAction); + save(po); + + if (!processed) + { + throw new OperationException("Cannot process " + po.getClass().getName() + " to: " + processAction + " "+ docPo.getProcessMsg()); + } + } + } + catch (OperationException ex) // Should not wrap Operation exception instance + { + throw ex; + } + catch (Exception ex) + { + throw new OperationException(ex.getMessage(), ex); + } + } + +} diff --git a/posterita/posterita/src/main/org/posterita/util/RegenerateModels.java b/posterita/posterita/src/main/org/posterita/util/RegenerateModels.java new file mode 100644 index 0000000000..b0e4413797 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/util/RegenerateModels.java @@ -0,0 +1,119 @@ +/* +* +* Copyright (c) 2007 Posterita Ltd. All Rights Reserved. +* +* This software is the confidential and proprietary information of +* Tamak ICT Ltd. ("Confidential Information"). You shall not +* disclose such Confidential Information and shall use it only in +* accordance with the terms of the license agreement you entered into +* with Tamak ICT. +* +* Tamak ICT MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE +* SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT +* NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR +* A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. Tamak ICT SHALL NOT +* BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, +* MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. +* +* Created on Feb 6, 2007 by ashley +* +*/ + +/** + @author ashley + */ + +package org.posterita.util; + +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.logging.Level; + +import org.adempiere.util.ModelClassGenerator; +import org.adempiere.util.ModelInterfaceGenerator; +import org.compiere.Adempiere; +import org.compiere.util.CLogMgt; +import org.compiere.util.DB; + +public class RegenerateModels +{ + + private static final ArrayList tables = new ArrayList(); + private static final String PACKAGE_NAME = "org.compiere.model"; + private static final String DIRECTORY = PathInfo.PROJECT_HOME + "/posterita/src/main/org/compiere/model/"; + + static + { + tables.add("M_PriceList"); + /*tables.add("U_RoleMenu"); + tables.add("U_WEB_PROPERTIES"); + tables.add("U_BlackListCheque"); + tables.add("C_ORDER"); + tables.add("AD_USER"); + tables.add("AD_ROLE"); + tables.add("M_PRODUCT"); + tables.add("AD_PRINTFORMAT");*/ + } + + public static void main(String args[]) throws Exception + { + Adempiere.startupEnvironment(true); + CLogMgt.setLevel(Level.FINE); + + StringBuffer sqlStmt = new StringBuffer(); + + StringBuffer tableNames = new StringBuffer(); + + for (String tblName : tables) + { + tableNames.append(", '").append(tblName).append("'"); + } + + if (tableNames.length() > 0 && tables.size() > 0) + { + String tableInStmt = tableNames.substring(1); + tableInStmt = tableInStmt.toUpperCase(); + + String entityType = "'U','A','D','EXT'"; + sqlStmt.append("SELECT AD_Table_ID from AD_Table where "); + sqlStmt.append(" (TableName IN ('RV_WarehousePrice','RV_BPartner')"); + sqlStmt.append(" OR IsView='N')"); + sqlStmt.append(" AND Upper(TableName) in (").append(tableInStmt).append(") and"); + sqlStmt.append(" EntityType in (").append(entityType).append(")"); + sqlStmt.append(" ORDER BY TableName"); + + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement(sqlStmt.toString(), null); + ResultSet rs = pstmt.executeQuery(); + while (rs.next()) + { + int tableId = rs.getInt(1); + new ModelInterfaceGenerator(tableId, DIRECTORY, PACKAGE_NAME); + new ModelClassGenerator(tableId, DIRECTORY, PACKAGE_NAME); + } + rs.close(); + } + catch (SQLException ex) + { + throw ex; + } + finally + { + if (pstmt != null) + { + try + { + pstmt.close(); + } + catch (Exception ex){} + } + } + + } + + } +} diff --git a/posterita/posterita/src/main/org/posterita/util/TMKInvoicePrintFormatter.java b/posterita/posterita/src/main/org/posterita/util/TMKInvoicePrintFormatter.java new file mode 100644 index 0000000000..a86c667010 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/util/TMKInvoicePrintFormatter.java @@ -0,0 +1,439 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Aug 23, 2006 + */ + + +package org.posterita.util; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.Properties; + +import org.compiere.model.MBPartner; +import org.compiere.model.MDocType; +import org.compiere.model.MInvoice; +import org.compiere.model.MLocation; +import org.compiere.model.MOrder; +import org.compiere.model.MOrg; +import org.compiere.model.MUser; + +import org.posterita.Constants; +import org.posterita.beans.BPartnerBean; +import org.posterita.beans.WebOrderLineBean; +import org.posterita.businesslogic.InvoiceManager; +import org.posterita.businesslogic.OrganisationManager; +import org.posterita.businesslogic.administration.BPartnerManager; +import org.posterita.exceptions.FormattingException; +import org.posterita.exceptions.OperationException; +import org.posterita.lib.UdiConstants; + + + +public class TMKInvoicePrintFormatter extends AbstractPrintFormatter +{ + public TMKInvoicePrintFormatter(String args) + { + super(args); + } + + public String format(Properties ctx, int recordId, Object... args) throws Exception + { + //----------------------------------------------------------------------------------------------------------------------------- + + //set some default values + String vatRegNumber = ""; + String companyName1 = ""; + String companyName2 = ""; + String companyPhone = ""; + String companyAddress = ""; + + //setting receipt header + try + { + MOrg myorg = OrganisationManager.getMyOrg(ctx); + int bpartnerId = myorg.getLinkedC_BPartner_ID(null); + + + MBPartner bpartner = BPartnerManager.loadBPartner(ctx,bpartnerId,null); + BPartnerBean bean = BPartnerManager.getBpartner(ctx, bpartnerId, null); + + vatRegNumber = bpartner.getTaxID(); + companyName1 = bean.getPartnerName(); + companyName2 = bean.getName2(); + companyPhone = bean.getPhone(); + + String add = bean.getAddress1(); + add = (add==null) ? "" : add; + + companyAddress = add; + + add = bean.getAddress2(); + + if(add!=null){ + companyAddress = companyAddress + " " + add; + } + + add = bean.getCity(); + add = (add==null) ? "" : add; + + companyAddress = companyAddress + ", " + add; + + + } catch (OperationException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + + String title = null; + String customerName = null; + String salesRep = null; + String docStatus = null; + String payment = null; + String customerAddress = null; + String orderType=null; + //String dateOrdered = null; + String refNo = null; + + //load the order + MInvoice invoice = new MInvoice(ctx, recordId, null); + + String paymentRule = null; + + //setting payment + paymentRule = invoice.getPaymentRule(); + + if(paymentRule.equalsIgnoreCase(MOrder.PAYMENTRULE_Cash)) + { + payment = Constants.PAYMENT_RULE_CASH; + } + + if(paymentRule.equalsIgnoreCase(MOrder.PAYMENTRULE_CreditCard)) + { + payment = Constants.PAYMENT_RULE_CARD; + } + + if(paymentRule.equalsIgnoreCase(MOrder.PAYMENTRULE_Check)) + { + payment = Constants.PAYMENT_RULE_CHEQUE; + } + + if(paymentRule.equalsIgnoreCase(UdiConstants.PAYMENTRULE_MIXED)) + { + payment = Constants.PAYMENT_RULE_MIXED; + } + //setting ref no + refNo = invoice.getDocumentNo(); + + //getting orgInfo + MOrg org = new MOrg(ctx,invoice.getAD_Org_ID(),null); + int location_id = org.getInfo().getC_Location_ID(); + MLocation location = new MLocation(ctx,location_id,null); + + + String address1 = (location.getAddress1() == null)? " " : location.getAddress1(); + String address2 = (location.getAddress2() == null)? " " : location.getAddress2(); + + //getting order type + int docTypeId = invoice.getC_DocType_ID(); + MDocType docType = new MDocType(ctx, docTypeId, null); + + orderType = docType.getName(); + + //getting orderInfo + docStatus = invoice.getDocStatusName(); + + + //getting salesrep + int saleRep_id = invoice.getSalesRep_ID(); + MUser user = new MUser(ctx,saleRep_id,null); + salesRep = user.getName(); + + //getting customer info + int bpartner_id = invoice.getC_BPartner_ID(); + BPartnerBean bean; + try + { + bean = BPartnerManager.getBpartner(ctx,bpartner_id,null); + } + catch(Exception e) + { + throw new FormattingException("Formatting",e); + } + + + String name1 = (bean.getPartnerName() == null)? " " : bean.getPartnerName(); + String name2 = (bean.getName2() == null)? " " : bean.getName2(); + customerName = (name1 + " " + name2).trim(); + + address1 = (bean.getAddress1() == null)? " " : bean.getAddress1(); + address2 = (bean.getAddress2() == null)? " " : bean.getAddress2(); + customerAddress = (address1 + " " + address2).trim(); + + + ///////////////////////////////drawing the order//////////////////////////////// + StringBuffer reportData = new StringBuffer();//TmkPrinterConstants.LOGO1); + + if(_showLogo) + { + reportData.append(TmkPrinterConstants.LOGO1); + } + + //adding header + reportData.append(TmkPrinterConstants.FONT_SMALL) + .append(_lineTop) + .append(TmkPrinterConstants.CENTER_ALIGN) + .append(TmkPrinterConstants.LINE_FEED); + + if(companyName1!=null) + reportData.append(TmkPrinterConstants.FONT_DOUBLE) + .append(companyName1) + .append(TmkPrinterConstants.LINE_FEED); + + if(companyName2.trim().length() > 0) + if(companyName2!=null) + reportData.append(TmkPrinterConstants.CENTER_ALIGN) + .append(TmkPrinterConstants.BIG_FONT) + .append("(" + companyName2 + ")") + .append(TmkPrinterConstants.LINE_FEED); + + if(companyAddress!=null) + reportData.append(TmkPrinterConstants.FONT_NORMAL) + .append(companyAddress) + .append(TmkPrinterConstants.LINE_FEED); + + if(companyPhone!=null) + reportData.append(TmkPrinterConstants.FONT_NORMAL) + .append("Tel:" + companyPhone) + .append(TmkPrinterConstants.LINE_FEED); + + if(vatRegNumber!=null) + reportData.append(TmkPrinterConstants.FONT_NORMAL) + .append("VAT Reg No:" + vatRegNumber) + .append(TmkPrinterConstants.LINE_FEED); + + reportData.append(TmkPrinterConstants.FONT_SMALL) + .append(_lineTop) + .append(TmkPrinterConstants.LINE_FEED); + + //adding title + title = "Invoice"; + reportData.append(TmkPrinterConstants.BIG_FONT) + .append(TmkPrinterConstants.CENTER_ALIGN) + .append(title) + .append(TmkPrinterConstants.LINE_FEED); + + //setting small font + reportData.append(TmkPrinterConstants.FONT_SMALL); + reportData.append(TmkPrinterConstants.LEFT_ALIGN); + + //adding customer name + customerName = String.format("%1$-" + _halfLineWidth + "s", customerName); + reportData.append(customerName); + + //adding sales rep + salesRep = "Sales Rep:" + salesRep; + salesRep = String.format("%1$"+ _halfLineWidth + "s", salesRep); + reportData.append(salesRep) + .append(TmkPrinterConstants.LINE_FEED); + + //adding customer address + customerAddress = String.format("%1$-" + _lineWidth + "s",customerAddress); + reportData.append(customerAddress) + .append(TmkPrinterConstants.LINE_FEED); + + //adding status + docStatus = "Status:" + docStatus; + docStatus = String.format("%1$-" + _lineWidth + "s",docStatus); + reportData.append(docStatus) + .append(TmkPrinterConstants.LINE_FEED); + + //adding payment + payment = "Payment:" + payment; + payment = String.format("%1$-" + _lineWidth + "s",payment); + reportData.append(payment) + .append(TmkPrinterConstants.LINE_FEED); + + //adding reference no + refNo = "Ref No:" + refNo; + refNo = String.format("%1$-" + _lineWidth + "s",refNo); + reportData.append(refNo) + .append(TmkPrinterConstants.LINE_FEED); + + //adding date + Calendar c = Calendar.getInstance(); + c.setTime(new Date(invoice.getCreated().getTime())); + String date = String.format("%1$te %1$tb,%1$tY %1$tH:%1$tM:%1$tS",c); + date = String.format("%1$-" + _lineWidth + "s",date); + reportData.append(date) + .append(TmkPrinterConstants.LINE_FEED); + + //adding orderlines + //1.header + reportData.append(_lineTop).append("\n"); + + String headerFormat = "%1$-" + (_lineWidth - ( 7 + 5 + 13 )) + "s" + + "%2$7s" + + "%3$5s" + + "%4$13s"; + + String header = String.format(headerFormat,"Name","Unit","Qty","Total"); + reportData.append(header).append("\n"); + + reportData.append(_lineBottom) + .append(TmkPrinterConstants.LINE_FEED); + + //2.body + ArrayList invoiceLineList; + try + { + invoiceLineList = InvoiceManager.populateInvoiceLines(ctx,invoice,false); + } + catch(Exception e) + { + throw new FormattingException("Formatting Error", e); + } + + String name = null; + int qty; + + BigDecimal taxAmt = null; + BigDecimal total; + BigDecimal unitPrice; + + int totalQty = 0; + double grandTotal = 0.0d; + double totalTax = 0.0d; + String orderline = ""; + + String orderlineFormat = "" + + "%1$-" + (_lineWidth - ( 7 + 5 + 13 )) + "s" + //1.product name OR description + "%2$7.2f" + //2.unit price + "%3$5d" + //3.quantity + "%4$13.2f"; //5.total price + + for(WebOrderLineBean wbean : invoiceLineList) + { + taxAmt = wbean.getTaxAmt(); + name = wbean.getDescription(); + qty = wbean.getQtyOrdered().intValue(); + total = wbean.getLineTotalAmt(); + unitPrice = wbean.getUnitPrice(); + + if( _priceWithVat ) + { + unitPrice = total.divide(wbean.getQtyOrdered()); + } + + if(name.length() > 10) + { + if(name.length() > 40) + name = name.substring(0,39); + + orderline = String.format("%1$-" + _lineWidth + "s", name); + reportData.append(orderline) + .append(TmkPrinterConstants.LINE_FEED); + + name = ""; + + } + + taxAmt = (taxAmt==null)? new BigDecimal(0.0) : taxAmt; + + totalQty += qty; + grandTotal += total.doubleValue(); + totalTax += taxAmt.doubleValue(); + + if(taxAmt.intValue() == 0) + { + name = name + "*"; + } + + orderline = String.format(orderlineFormat,name,unitPrice,qty,total); + reportData.append(orderline) + .append(TmkPrinterConstants.LINE_FEED); + } + + //3.footer + reportData.append(_lineBottom) + .append(TmkPrinterConstants.LINE_FEED); + + String footerFormat = "" + + "%1$-" + (_lineWidth - ( 5 + 3 + 10 )) + "s" + + "%2$5d" + + "%3$3s" + + "%4$10.2f"; + + String footer = String.format(footerFormat,"Grand Total",totalQty,"Rs",grandTotal); + reportData.append(footer) + .append(TmkPrinterConstants.LINE_FEED); + + reportData.append(_lineTop) + .append(TmkPrinterConstants.LINE_FEED); + + + String totalVAT = String.format("%1$.2f",totalTax); + String vat = String.format("%1$-" + _lineWidth + "s","Total VAT:Rs"+totalVAT); + reportData.append(vat) + .append(TmkPrinterConstants.LINE_FEED); + + String noVAT = String.format("%1$-" + _lineWidth + "s","* NO VAT"); + reportData.append(noVAT) + .append(TmkPrinterConstants.LINE_FEED) + .append(TmkPrinterConstants.LINE_FEED); + + if(_showBarcode) + { + String barcode = ((char)0x1d ) + "H" + (char)2 + ((char)0x1d ) + "k" + (char)4 + invoice.getDocumentNo() + (char)0; + String barcodeDim = ((char)0x1d) + "h" + (char)50 + ((char)0x1d) + "w" + (char)3; + reportData.append(TmkPrinterConstants.CENTER_ALIGN) + .append(barcodeDim) + .append(barcode) + .append(TmkPrinterConstants.LINE_FEED); + } + + + reportData.append(TmkPrinterConstants.FONT_NORMAL) + .append(TmkPrinterConstants.CENTER_ALIGN) + .append("*** Thank you ***") + .append(TmkPrinterConstants.LINE_FEED); + + + if(_showFooter) + if( _footerMessage.length() > 0 ) + { + reportData.append(TmkPrinterConstants.FONT_NORMAL) + .append(TmkPrinterConstants.LINE_FEED) + .append(TmkPrinterConstants.CENTER_ALIGN) + .append(_footerMessage) + .append(TmkPrinterConstants.LINE_FEED); + } + + reportData.append(TmkPrinterConstants.PAPER_CUT) + .append(TmkPrinterConstants.LINE_FEED); + + + return reportData.toString(); + + } + + +} diff --git a/posterita/posterita/src/main/org/posterita/util/TMKOrderPrintFormatter.java b/posterita/posterita/src/main/org/posterita/util/TMKOrderPrintFormatter.java new file mode 100644 index 0000000000..1f45043f43 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/util/TMKOrderPrintFormatter.java @@ -0,0 +1,637 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Aug 23, 2006 + */ + + +package org.posterita.util; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.Properties; + +import org.compiere.model.MBPartner; +import org.compiere.model.MLocation; +import org.compiere.model.MOrder; +import org.compiere.model.MOrg; +import org.compiere.model.MPayment; +import org.compiere.model.MUser; +import org.posterita.Constants; +import org.posterita.beans.BPartnerBean; +import org.posterita.beans.OrderLineBean; +import org.posterita.beans.WebOrderLineBean; +import org.posterita.businesslogic.OrganisationManager; +import org.posterita.businesslogic.POSManager; +import org.posterita.businesslogic.administration.BPartnerManager; +import org.posterita.businesslogic.administration.PriceListManager; +import org.posterita.exceptions.FormattingException; +import org.posterita.exceptions.OperationException; +import org.posterita.lib.UdiConstants; +import org.posterita.order.UDIOrderTypes; + + + +public class TMKOrderPrintFormatter extends AbstractPrintFormatter +{ + public TMKOrderPrintFormatter(String args) + { + super(args); + } + + public TMKOrderPrintFormatter(String args, String trxName) + { + super(args); + this.trxName = trxName; + } + + public String format(Properties ctx, int recordId, Object... args) throws Exception + { + //require UDIBean + OrderLineBean orderLineBean = null; + if( args != null && args.length > 0) + { + orderLineBean = (OrderLineBean) args[0]; + } + + //----------------------------------------------------------------------------------------------------------------------------- + + //set some default values + String vatRegNumber = ""; + String companyName1 = ""; + String companyName2 = ""; + String companyPhone = ""; + String companyAddress = ""; + + //setting receipt header + try + { + MOrg myorg = OrganisationManager.getMyOrg(ctx); + int bpartnerId = myorg.getLinkedC_BPartner_ID(trxName); + + + MBPartner bpartner = BPartnerManager.loadBPartner(ctx,bpartnerId,trxName); + BPartnerBean bean = BPartnerManager.getBpartner(ctx, bpartnerId, trxName); + + vatRegNumber = bpartner.getTaxID(); + companyName1 = bean.getPartnerName(); + companyName2 = bean.getName2(); + companyPhone = bean.getPhone(); + + String add = bean.getAddress1(); + add = (add==null) ? "" : add; + + companyAddress = add; + + add = bean.getAddress2(); + + if(add!=null){ + companyAddress = companyAddress + " " + add; + } + + add = bean.getCity(); + add = (add==null) ? "" : add; + + companyAddress = companyAddress + ", " + add; + + + } catch (OperationException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + + String title = null; + String customerName = null; + String salesRep = null; + String docStatus = null; + String payment = null; + String customerAddress = null; + String refNo = null; + + //load the order + MOrder order = new MOrder(ctx, recordId, trxName); + + String paymentRule = null; + int priceListId = order.getM_PriceList_ID(); + String currency = PriceListManager.getCurrency(ctx, priceListId); + + //setting payment + paymentRule = order.getPaymentRule(); + + if(paymentRule.equalsIgnoreCase(MOrder.PAYMENTRULE_Cash)) + { + payment = Constants.PAYMENT_RULE_CASH; + } + + if(paymentRule.equalsIgnoreCase(MOrder.PAYMENTRULE_CreditCard)) + { + payment = Constants.PAYMENT_RULE_CARD; + } + + if(paymentRule.equalsIgnoreCase(MOrder.PAYMENTRULE_Check)) + { + payment = Constants.PAYMENT_RULE_CHEQUE; + } + + if(paymentRule.equalsIgnoreCase(UdiConstants.PAYMENTRULE_MIXED)) + { + payment = Constants.PAYMENT_RULE_MIXED; + } + //setting ref no + refNo = order.getDocumentNo(); + + //getting orgInfo + MOrg org = new MOrg(ctx,order.getAD_Org_ID(),trxName); + int location_id = org.getInfo().getC_Location_ID(); + MLocation location = new MLocation(ctx,location_id,trxName); + + // orgName = org.getName(); + + String address1 = (location.getAddress1() == null)? " " : location.getAddress1(); + String address2 = (location.getAddress2() == null)? " " : location.getAddress2(); + // orgAddress = (address1 + " " + address2).trim(); + + + //getting orderInfo + docStatus = order.getDocStatusName(); + + //getting salesrep + int saleRep_id = order.getSalesRep_ID(); + MUser user = new MUser(ctx,saleRep_id,null); + salesRep = user.getName(); + + //getting customer info + int bpartner_id = order.getBill_BPartner_ID(); + BPartnerBean bean; + try + { + bean = BPartnerManager.getBpartner(ctx,bpartner_id,trxName); + } + catch(Exception e) + { + throw new FormattingException("Formatting Error", e); + } + + + String name1 = (bean.getPartnerName() == null)? " " : bean.getPartnerName(); + String name2 = (bean.getName2() == null)? " " : bean.getName2(); + customerName = (name1 + " " + name2).trim(); + + address1 = (bean.getAddress1() == null)? " " : bean.getAddress1(); + address2 = (bean.getAddress2() == null)? " " : bean.getAddress2(); + customerAddress = (address1 + " " + address2).trim(); + + + ///////////////////////////////drawing the order//////////////////////////////// + StringBuffer reportData = new StringBuffer();//TmkPrinterConstants.LOGO1); + + if(_showLogo) + { + reportData.append(TmkPrinterConstants.LOGO1); + } + + //adding header + reportData.append(TmkPrinterConstants.FONT_SMALL) + .append(_lineTop) + .append(TmkPrinterConstants.CENTER_ALIGN) + .append(TmkPrinterConstants.LINE_FEED); + + if(companyName1!=null) + reportData.append(TmkPrinterConstants.FONT_DOUBLE) + .append(companyName1) + .append(TmkPrinterConstants.LINE_FEED); + + + if(companyName2!=null) + if(companyName2.trim().length() > 0) + reportData.append(TmkPrinterConstants.CENTER_ALIGN) + .append(TmkPrinterConstants.BIG_FONT) + .append("(" + companyName2 + ")") + .append(TmkPrinterConstants.LINE_FEED); + + if(companyAddress!=null) + reportData.append(TmkPrinterConstants.FONT_NORMAL) + .append(companyAddress) + .append(TmkPrinterConstants.LINE_FEED); + + if(companyPhone!=null) + reportData.append(TmkPrinterConstants.FONT_NORMAL) + .append("Tel:" + companyPhone) + .append(TmkPrinterConstants.LINE_FEED); + + if(vatRegNumber!=null) + reportData.append(TmkPrinterConstants.FONT_NORMAL) + .append("VAT Reg No:" + vatRegNumber) + .append(TmkPrinterConstants.LINE_FEED); + + reportData.append(TmkPrinterConstants.FONT_SMALL) + .append(_lineTop) + .append(TmkPrinterConstants.LINE_FEED); + + //adding title + + if ( UDIOrderTypes.POS_ORDER.getOrderType().equals(order.getOrderType()) || order.getOrderType().equals(null)) + { + title = "Sales Receipt"; + } + if ( UDIOrderTypes.POS_GOODS_RECEIVE_NOTE.getOrderType().equals(order.getOrderType())) + { + title = "Goods Received Note"; + } + if ( UDIOrderTypes.POS_GOODS_RETURN_NOTE.getOrderType().equals(order.getOrderType())) + { + title = "Goods Returned Note"; + } + if ( UDIOrderTypes.CUSTOMER_RETURN_ORDER.getOrderType().equals(order.getOrderType())) + { + title = "Customer Returned Order"; + } + if ( UDIOrderTypes.CREDIT_ORDER.getOrderType().equals(order.getOrderType())) + { + title = "Credit Order"; + } + + reportData.append(TmkPrinterConstants.BIG_FONT) + .append(TmkPrinterConstants.CENTER_ALIGN) + .append(title) + .append(TmkPrinterConstants.LINE_FEED); + + //setting small font + reportData.append(TmkPrinterConstants.FONT_SMALL); + reportData.append(TmkPrinterConstants.LEFT_ALIGN); + + //adding customer name + customerName = String.format("%1$-" + _halfLineWidth + "s", customerName); + reportData.append(customerName); + + //adding sales rep + salesRep = "Sales Rep:" + salesRep; + salesRep = String.format("%1$"+ _halfLineWidth + "s", salesRep); + reportData.append(salesRep) + .append(TmkPrinterConstants.LINE_FEED); + + //adding customer address + customerAddress = String.format("%1$-" + _lineWidth + "s",customerAddress); + reportData.append(customerAddress) + .append(TmkPrinterConstants.LINE_FEED); + + //adding status + docStatus = "Status:" + docStatus; + docStatus = String.format("%1$-" + _lineWidth + "s",docStatus); + reportData.append(docStatus) + .append(TmkPrinterConstants.LINE_FEED); + + //adding payment + payment = "Payment:" + payment; + payment = String.format("%1$-" + _lineWidth + "s",payment); + reportData.append(payment) + .append(TmkPrinterConstants.LINE_FEED); + + //adding reference no + refNo = "Ref No:" + refNo; + refNo = String.format("%1$-" + _lineWidth + "s",refNo); + reportData.append(refNo) + .append(TmkPrinterConstants.LINE_FEED); + + //adding date + Calendar c = Calendar.getInstance(); + c.setTime(new Date(order.getCreated().getTime())); + String date = String.format("%1$te %1$tb,%1$tY %1$tH:%1$tM:%1$tS",c); + date = String.format("%1$-" + _lineWidth + "s",date); + reportData.append(date) + .append(TmkPrinterConstants.LINE_FEED); + + //adding orderlines + //1.header + reportData.append(_lineTop).append("\n"); + + String headerFormat; + if(_showDiscount) + { + headerFormat = "%1$-" + (_lineWidth - ( 7 + 5 + 8 + 10 )) + "s" + + "%2$7s" + + "%3$5s" + + "%4$8s" + + "%5$10s"; + } + else + { + headerFormat = "%1$-" + (_lineWidth - ( 7 + 5 + 13 )) + "s" + + "%2$7s" + + "%3$5s" + + //"%4$8s" + + "%5$13s"; + } + + String header = String.format(headerFormat,"Name","Unit","Qty","Dis","Total"); + reportData.append(header).append("\n"); + + reportData.append(_lineBottom) + .append(TmkPrinterConstants.LINE_FEED); + + //2.body + ArrayList orderLineList; + try + { + orderLineList = POSManager.populateOrderLines(ctx,order); + } + catch(Exception e) + { + throw new FormattingException("Formatting Error", e); + } + + String name = null; + int qty; + BigDecimal discount = null; + BigDecimal taxAmt = null; + BigDecimal total; + BigDecimal unitPrice; + + int totalQty = 0; + double grandTotal = 0.0d; + double totalTax = 0.0d; + String orderline = ""; + String orderlineFormat = null; + + int nameWidth = 0; + + + if(_showDiscount) + { + orderlineFormat = "" + + "%1$-" + (_lineWidth - ( 7 + 5 + 8 + 10 )) + "s" + //1.product name OR description + "%2$7.2f" + //2.unit price + "%3$5d" + //3.quantity + "%4$8.2f" + //4.discount amount + "%5$10.2f"; //5.total price + + nameWidth = _lineWidth - ( 7 + 5 + 8 + 10 ); + } + else + { + orderlineFormat = "" + + "%1$-" + (_lineWidth - ( 7 + 5 + 13 )) + "s" + //1.product name OR description + "%2$7.2f" + //2.unit price + "%3$5d" + //3.quantity + //"%4$8.2f" + //4.discount amount + "%5$13.2f"; //5.total price + + nameWidth = _lineWidth - ( 7 + 5 + 13 ); + } + + + + for(WebOrderLineBean wbean : orderLineList) + { + taxAmt = wbean.getTaxAmt(); + name = wbean.getDescription(); + qty = wbean.getQtyOrdered().intValue(); + discount = wbean.getDiscountPercentage(); + total = wbean.getLineTotalAmt(); + unitPrice = wbean.getUnitPrice(); + + if( _priceWithVat ) + { + unitPrice = total.divide(wbean.getQtyOrdered(),BigDecimal.ROUND_UP); + } + + + if(name.length() > nameWidth) + { + // print on multiple lines + int beginIndex = 0; + int endIndex = 0; + endIndex = nameWidth; + + while(endIndex < name.length()) + { + String s = name.substring(beginIndex, endIndex); + beginIndex = endIndex; + endIndex = endIndex + nameWidth; + + orderline = String.format("%1$-" + _lineWidth + "s", s); + reportData.append(orderline) + .append(TmkPrinterConstants.LINE_FEED); + } + + name = name.substring(beginIndex); + } + + discount = (discount==null)? new BigDecimal(0.0) : discount; + taxAmt = (taxAmt==null)? new BigDecimal(0.0) : taxAmt; + + double discountAmt = 0.0; + discountAmt = (total.doubleValue() * 100.0)/(100.0 - discount.doubleValue()) - total.doubleValue(); + + totalQty += qty; + grandTotal += total.doubleValue(); + totalTax += taxAmt.doubleValue(); + + if(taxAmt.intValue() == 0) + { + name = name + "*"; + } + + unitPrice = unitPrice.add(BigDecimal.valueOf(discountAmt)); + + orderline = String.format(orderlineFormat,name,unitPrice,qty,discountAmt,total); + reportData.append(orderline) + .append(TmkPrinterConstants.LINE_FEED); + } + + //3.footer + reportData.append(_lineBottom) + .append(TmkPrinterConstants.LINE_FEED); + + String footerFormat = null; + if(_showDiscount) + { + footerFormat = "" + + "%1$-" + (_lineWidth - ( 5 + 8 + 10 )) + "s" + + "%2$5d" + + "%3$8.2s" + + "%4$10.2f"; + } + else + { + footerFormat = "" + + "%1$-" + (_lineWidth - ( 5 + 3 + 10 )) + "s" + + "%2$5d" + + "%3$3s" + + "%4$10.2f"; + } + + String orderFooter = String.format(footerFormat,"Grand Total",totalQty,currency,grandTotal); + reportData.append(orderFooter) + .append(TmkPrinterConstants.LINE_FEED); + + reportData.append(_lineTop) + .append(TmkPrinterConstants.LINE_FEED); + + + //4.amount tendered & refunded + BigDecimal cashAmountTendered = order.getAmountTendered(); + if(cashAmountTendered == null) + { + cashAmountTendered = new BigDecimal(0.0); + } + + BigDecimal cashAmountRefunded = order.getAmountRefunded(); + if(cashAmountRefunded == null) + { + cashAmountRefunded = new BigDecimal(0.0); + } + + BigDecimal cardAmountTendered = null; + BigDecimal chequeAmountTendered = null; + + + if(orderLineBean != null) + { + Double cardAmt = orderLineBean.getPaymentByCard(); + Double chequeAmt = orderLineBean.getPaymentByChq(); + + if(cardAmt == null) + { + cardAmountTendered = new BigDecimal(0.0d); + } + else + { + cardAmountTendered = new BigDecimal(cardAmt.doubleValue()); + } + + if(chequeAmt == null) + { + chequeAmountTendered = new BigDecimal(0.0d); + } + else + { + chequeAmountTendered = new BigDecimal(chequeAmt.doubleValue()); + } + } + else + { + + if(MOrder.STATUS_Completed.equalsIgnoreCase(order.getDocStatus())) + if(order.getOrderType().equalsIgnoreCase(UDIOrderTypes.POS_ORDER.getOrderType())) + { + try + { + cardAmountTendered = POSManager.getPayment(ctx, order.get_ID(), MPayment.TENDERTYPE_CreditCard, trxName); + chequeAmountTendered = POSManager.getPayment(ctx, order.get_ID(), MPayment.TENDERTYPE_Check, trxName); + } + catch (OperationException e) + { + throw new FormattingException("Cannot get payment",e); + } + } + else + { + cardAmountTendered = new BigDecimal(0.0d); + chequeAmountTendered = new BigDecimal(0.0d); + } + + } + + String amountTendered = String.format("%1$25s%2$4s:%3$10.2f","Cash Tendered",currency ,cashAmountTendered); + String amountRefunded = String.format("%1$25s%2$4s:%3$10.2f","Cash Refunded",currency ,cashAmountRefunded); + + String seperator = String.format("%1$25s%2$15s","","------------"); + + String cardTendered = String.format("%1$25s%2$4s:%3$10.2f","Card Tendered",currency ,cardAmountTendered); + String chequeTendered = String.format("%1$25s%2$4s:%3$10.2f","Cheque Tendered",currency ,chequeAmountTendered); + + if(cashAmountTendered.doubleValue() > 0.0d) + { + reportData.append(amountTendered).append(TmkPrinterConstants.LINE_FEED); + } + + if(cardAmountTendered.doubleValue() > 0.0d) + { + reportData.append(cardTendered).append(TmkPrinterConstants.LINE_FEED); + } + + if(chequeAmountTendered.doubleValue() > 0.0d) + { + reportData.append(chequeTendered).append(TmkPrinterConstants.LINE_FEED); + } + + if(cashAmountTendered.doubleValue() > 0.0d) + { + reportData.append(seperator).append(TmkPrinterConstants.LINE_FEED); + reportData.append(amountRefunded).append(TmkPrinterConstants.LINE_FEED); + } + + + String totalVAT = String.format("%1$.2f",totalTax); + String vat = String.format("%1$-" + _lineWidth + "s","Total VAT:" + currency + totalVAT); + reportData.append(vat) + .append(TmkPrinterConstants.LINE_FEED); + + String noVAT = String.format("%1$-" + _lineWidth + "s","* NO VAT"); + + + + reportData.append(noVAT) + .append(TmkPrinterConstants.LINE_FEED) + .append(TmkPrinterConstants.LINE_FEED); + + if(_showBarcode) + { + String barcode = ((char)0x1d ) + "H" + (char)2 + ((char)0x1d ) + "k" + (char)4 + order.getDocumentNo() + (char)0; + String barcodeDim = ((char)0x1d) + "h" + (char)50 + ((char)0x1d) + "w" + (char)3; + reportData.append(TmkPrinterConstants.CENTER_ALIGN) + .append(barcodeDim) + .append(barcode) + .append(TmkPrinterConstants.LINE_FEED); + } + + + reportData.append(TmkPrinterConstants.FONT_NORMAL) + .append(TmkPrinterConstants.CENTER_ALIGN) + .append("*** Thank you ***") + .append(TmkPrinterConstants.LINE_FEED); + + + if(_showFooter) + if( _footerMessage.length() > 0 ) + { + reportData.append(TmkPrinterConstants.FONT_NORMAL) + .append(TmkPrinterConstants.LINE_FEED) + .append(TmkPrinterConstants.CENTER_ALIGN) + .append(_footerMessage) + .append(TmkPrinterConstants.LINE_FEED); + } + + if( order.getOrderType().equalsIgnoreCase(UDIOrderTypes.POS_ORDER.getOrderType()) ) + { + reportData.append(TmkPrinterConstants.LINE_FEED) + .append(TmkPrinterConstants.CENTER_ALIGN) + .append(TmkPrinterConstants.FONT_SMALL) + .append("*Goods once sold cannot be returned."); + } + + reportData.append(TmkPrinterConstants.PAPER_CUT) + .append(TmkPrinterConstants.LINE_FEED); + + return reportData.toString(); + + } +} diff --git a/posterita/posterita/src/main/org/posterita/util/TmkPrintUtil.java b/posterita/posterita/src/main/org/posterita/util/TmkPrintUtil.java new file mode 100644 index 0000000000..90cb9a64ca --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/util/TmkPrintUtil.java @@ -0,0 +1,71 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Aug 23, 2006 + */ + + +package org.posterita.util; + + +public class TmkPrintUtil +{ + + private static final int TOTAL_PAGE_LENGTH=40; + private static final int MAX_ALLOWED_FOR_FIELD=15; + public static String alignRight(String data) + { + int dataLength=data.length(); + String padding=" "; + for( int i=0;i14) + { + finaldata=finaldata+"\n"+initData.substring(0,MAX_ALLOWED_FOR_FIELD); + initData=initData.substring(MAX_ALLOWED_FOR_FIELD,initData.length()-1); + } + + } + + finaldata=finaldata+"\n"+initData; + + return finaldata.trim(); + + + } + + + public static String alignInCorners(String data1,String data2) + { + + + return null; + } +} diff --git a/posterita/posterita/src/main/org/posterita/util/TmkPrinterConstants.java b/posterita/posterita/src/main/org/posterita/util/TmkPrinterConstants.java new file mode 100644 index 0000000000..fad7179d72 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/util/TmkPrinterConstants.java @@ -0,0 +1,87 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Aug 24, 2006 + */ + + +package org.posterita.util; + + +public class TmkPrinterConstants +{ + public static final String SLIP_PRINTER_THERMAL = "Slip - Thermal"; + public static final String SLIP_PRINTER_9PIN = "Slip - 9 Pin"; + public static final String NORMAL_PRINTER = "Normal"; + + public static final int PRINTER_9PIN_WIDTH = 40; + public static final int PRINTER_SLIP_WIDTH = 64; + public static final int PRINTER_DEFAULT_WIDTH = PRINTER_9PIN_WIDTH; + + public static final String PAPER_CUT = new String(new byte[]{10,29,86,66}); + // public static final String PAPER_CUT= new String (new byte[]{10,29,56,66}); + public static final String PAGE_MODE = new String (new byte[]{27,76}); + public static final String LOGO1= new String(new byte[]{28,112,1,48}); + public static final String STANDARD_MODE = new String (new byte[]{27,83}); + public static final String LINE_FEED= new String (new byte []{10}); + public static final String H_TAB = new String (new byte[]{9}); + public static final String SOUND_BUZZER=new String (new byte[]{27,30}); + public static final String ABS_POSITION=new String (new byte[]{}); + public static final String LEFT_ALIGN=new String (new byte[]{27,97,2}); + public static final String CENTER_ALIGN=new String (new byte[]{27,97,1}); + public static final String RIGHT_ALIGN=new String (new byte[]{27,97,2,80}); + public static final String MULTIPLE_LINE_FEED= new String (new byte []{27,100,2});//5 lines + public static final String SETTING_LEFT_MARGIN=new String (new byte[]{29,76,5,0}); + public static final String BIG_FONT=new String (new byte[]{27,33,8}); + public static final String SMALL_FONT=new String (new byte[]{27,33,1}); + public static final String ABS_POS_LOC1=new String (new byte[]{27,36,0,0}); + public static final String ABS_POS_LOC2=new String (new byte[]{27,36,100,1}); + public static final String ABS_POS_LOC3=new String (new byte[]{27,36,(byte)145,1}); + public static final String ABS_POS_LOC4=new String (new byte[]{27,36,(byte)200,1}); + public static final String ABS_POS_LOC5=new String (new byte[]{27,36,1,1}); + public static final String CHARACTER_SPACING=new String (new byte[]{27,32,0}); + public static final String H_FULL_LINE_TOP; + + public static final String FONT_NORMAL = ((char)0x1b) + "!" + ((char)0x00); + public static final String FONT_SMALL = ((char)0x1b) + "!" + ((char)0x01); + public static final String FONT_NORMAL_BOLD = ((char)0x1b) + "!" + ((char)0x08); + public static final String FONT_DOUBLE_HEIGHT = ((char)0x1b) + "!" + ((char)0x10); + public static final String FONT_DOUBLE_WIDTH = ((char)0x1b) + "!" + ((char)0x20); + public static final String FONT_DOUBLE = ((char)0x1b) + "!" + ((char)0x30); + + public static final String H_FULL_LINE_BOTTOM; + + static + { + int length = 60; + byte hFullLineTop[] = new byte[length]; + + for(int i = 0; i < length; i++) + hFullLineTop[i] = (byte)223; + + H_FULL_LINE_TOP = new String(hFullLineTop); + + byte hFullLineBottom[] = new byte[length]; + + for(int i = 0; i < length; i++) + hFullLineBottom[i] = (byte)220; + + H_FULL_LINE_BOTTOM = new String(hFullLineBottom); + } + +} diff --git a/posterita/posterita/src/main/org/posterita/webstore/action/DocumentHistoryAction.java b/posterita/posterita/src/main/org/posterita/webstore/action/DocumentHistoryAction.java new file mode 100644 index 0000000000..5fee77ae01 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/webstore/action/DocumentHistoryAction.java @@ -0,0 +1,136 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + **/ +package org.posterita.webstore.action; + +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Properties; +import java.util.TreeSet; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.compiere.model.MBPartner; +import org.compiere.process.DocAction; +import org.compiere.util.Env; +import org.posterita.Constants; +import org.posterita.beans.DocumentHistortFilterBean; +import org.posterita.beans.DocumentHistoryBean; +import org.posterita.beans.FilterBean; +import org.posterita.businesslogic.performanceanalysis.POSReportManager; +import org.posterita.core.TmkJSPEnv; +import org.posterita.exceptions.ApplicationException; +import org.posterita.exceptions.OperationException; +import org.posterita.form.DocumentHistoryForm; +import org.posterita.order.UDIOrderTypes; +import org.posterita.struts.core.BaseDispatchAction; +import org.posterita.user.WebUserInfo; +import org.posterita.webstore.businesslogic.DocumentHistoryManager; + +public class DocumentHistoryAction extends BaseDispatchAction +{ + + public static final String INIT_HISTORY = "initHistory"; + public ActionForward initHistory(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws OperationException, ApplicationException + { + ActionForward fwd = init(mapping, form, request, response); + + if (fwd != null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + DocumentHistoryForm dhf = (DocumentHistoryForm) form; + DocumentHistoryBean bean = (DocumentHistoryBean) dhf.getBean(); + + Calendar calendar = Calendar.getInstance(); + int month = calendar.get(Calendar.MONTH) + 1 ; + int year = calendar.get(Calendar.YEAR); + + bean.setMonth( Integer.valueOf(month) ); + bean.setYear( Integer.valueOf(year) ); + bean.setOrderType( UDIOrderTypes.POS_ORDER .getOrderType()); + bean.setDocStatus( DocAction.STATUS_Completed ); + + dhf.populate( bean ); + + //TODO OrderType should be taken from the bean + ArrayList list = DocumentHistoryManager.getHistory(ctx, bean.getBpartnerId(), bean.getDocStatus(), bean.getMonth(), bean.getYear(), bean.getOrderType()); + + getWebstoreFilterBean(ctx, request, list); + + request.getSession().setAttribute(Constants.DOCUMENT_HISTORY, list); + + return mapping.findForward(GET_HISTORY); + } + + public static final String GET_HISTORY = "getHistory"; + public ActionForward getHistory(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws OperationException, ApplicationException + { + ActionForward fwd = init(mapping, form, request, response); + + if (fwd != null) + return fwd; + + Properties ctx = TmkJSPEnv.getCtx(request); + + DocumentHistoryForm dhf = (DocumentHistoryForm) form; + DocumentHistoryBean bean = (DocumentHistoryBean) dhf.getBean(); + + //TODO OrderType should be taken from the bean + ArrayList list = DocumentHistoryManager.getHistory(ctx, bean.getBpartnerId(), bean.getDocStatus(), bean.getMonth(), bean.getYear(), bean.getOrderType()); + + getWebstoreFilterBean(ctx, request, list); + + request.getSession().setAttribute(Constants.DOCUMENT_HISTORY, list); + + return mapping.findForward(GET_HISTORY); + + } + + public static void getWebstoreFilterBean(Properties ctx, HttpServletRequest request, ArrayList orderHistory) throws OperationException + { + + DocumentHistortFilterBean filterBean = new DocumentHistortFilterBean(orderHistory); + + TreeSet docStatus = filterBean.getDocStatusList(); + request.getSession().setAttribute(Constants.DOC_STATUS, docStatus); + ArrayList orderTypeList=POSReportManager.getAllOrderTypes(ctx); + + request.getSession().setAttribute(Constants.ORDER_TYPES,orderTypeList); + + WebUserInfo wuInfo = (WebUserInfo) request.getSession().getAttribute(WebUserInfo.NAME); + int partnerId = wuInfo.getInfo().getC_BPartner_ID(); + MBPartner partner = new MBPartner(ctx, partnerId, null); + + + if (partner.getAD_Org_ID() != Env.getAD_Org_ID(ctx)) + { + TreeSet bPartners = (TreeSet)filterBean.getBPartnerList(); + request.getSession().setAttribute(Constants.BPARTNERS, bPartners); + + } + } + +} diff --git a/posterita/posterita/src/main/org/posterita/webstore/action/ViewCashPaymentAction.java b/posterita/posterita/src/main/org/posterita/webstore/action/ViewCashPaymentAction.java new file mode 100644 index 0000000000..cde8b771c3 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/webstore/action/ViewCashPaymentAction.java @@ -0,0 +1,101 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Created on Oct 25, 2006 + */ + + +package org.posterita.webstore.action; + +import java.util.Properties; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.Globals; +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.apache.struts.config.ActionConfig; +import org.apache.struts.config.ForwardConfig; +import org.apache.struts.util.MessageResources; + +import org.posterita.Constants; +import org.posterita.beans.DocumentBean; +import org.posterita.beans.WebDocumentBean; +import org.posterita.businesslogic.CashManager; +import org.posterita.core.TmkJSPEnv; +import org.posterita.exceptions.ApplicationException; +import org.posterita.exceptions.OperationException; +import org.posterita.struts.core.DefaultForm; +import org.posterita.struts.pos.POSDispatchAction; + + +public class ViewCashPaymentAction extends POSDispatchAction +{ + public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws OperationException, ApplicationException + { + ActionForward fwd = init(mapping, form, request, response); + + if (fwd != null) + return fwd; + + MessageResources resources = (MessageResources) request.getAttribute(Globals.MESSAGES_KEY); + + String operationException = resources.getMessage("error.operationException"); + + Properties ctx = TmkJSPEnv.getCtx(request); + + DefaultForm df = (DefaultForm) form; + DocumentBean bean = (DocumentBean) df.getBean(); + Integer paymentId = bean.getDocumentId(); + + // retrieve from cache + WebDocumentBean webBean = null; + webBean = CashManager.getWebCashPaymentBean(ctx, paymentId); + + request.getSession().setAttribute(Constants.WEB_PAYMENT_BEAN, webBean); + if (webBean == null) + webBean = (WebDocumentBean) request.getSession().getAttribute(Constants.WEB_PAYMENT_BEAN); + + if (webBean == null) + throw new OperationException(operationException); + + request.getSession().setAttribute(Constants.ME_LOCATION, webBean.getMeLocation()); + request.getSession().setAttribute(Constants.YOU_LOCATION, webBean.getYouLocation()); + request.getSession().setAttribute(Constants.YOU_BP_LOCATION, webBean.getYoubpLocation()); + request.getSession().setAttribute(Constants.ME, webBean.getMe()); + request.getSession().setAttribute(Constants.YOU,webBean.getYou()); + request.getSession().setAttribute(Constants.MCASHLINE, webBean.getCashLine()); + request.getSession().setAttribute(Constants.WEB_DOCUMENT_HEADER_BEAN, webBean.getHeaderBean()); + request.setAttribute(Constants.CURRENCY_SYMBOLE,webBean.getCurrencySymbole()); + request.getSession().setAttribute(Constants.CASH_PAYMENT_MADE,bean); + ForwardConfig forwardConfig = getForward(ctx,webBean,mapping,form); + + ActionForward forward = new ActionForward(forwardConfig.getPath()); + + return forward; + } + + private ForwardConfig getForward(Properties ctx, WebDocumentBean webBean, ActionMapping mapping, ActionForm form) throws OperationException + { + ActionConfig config = mapping.getModuleConfig().findActionConfig("/ViewWebstoreCashPaymentAction"); + + return config.findForwardConfig(Constants.VIEW_PAYMENT); + } +} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/webstore/action/ViewPaymentAction.java b/posterita/posterita/src/main/org/posterita/webstore/action/ViewPaymentAction.java new file mode 100644 index 0000000000..f03ec967a4 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/webstore/action/ViewPaymentAction.java @@ -0,0 +1,109 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ +package org.posterita.webstore.action; + +import java.util.Properties; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.Globals; +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.apache.struts.config.ActionConfig; +import org.apache.struts.config.ForwardConfig; +import org.apache.struts.util.MessageResources; +import org.compiere.model.MPayment; + +import org.posterita.Constants; +import org.posterita.beans.DocumentBean; +import org.posterita.beans.WebDocumentBean; +import org.posterita.businesslogic.PaymentManager; +import org.posterita.core.TmkJSPEnv; +import org.posterita.exceptions.ApplicationException; +import org.posterita.exceptions.OperationException; +import org.posterita.struts.core.DefaultForm; +import org.posterita.struts.pos.POSDispatchAction; + + +public class ViewPaymentAction extends POSDispatchAction +{ + public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws OperationException, ApplicationException + { + ActionForward fwd = init(mapping, form, request, response); + + if (fwd != null) + return fwd; + + MessageResources resources = (MessageResources) request.getAttribute(Globals.MESSAGES_KEY); + + String operationException = resources.getMessage("error.operationException"); + + Properties ctx = TmkJSPEnv.getCtx(request); + + DefaultForm df = (DefaultForm) form; + DocumentBean bean = (DocumentBean) df.getBean(); + Integer paymentId = bean.getDocumentId(); + + // retrieve from cache + WebDocumentBean webBean = null; + + MPayment payment = null; + if (paymentId!= null) + { + payment = new MPayment(ctx, paymentId.intValue(), null); + webBean = PaymentManager.getWebPaymentBean(ctx, payment); + request.getSession().setAttribute(Constants.WEB_PAYMENT_BEAN, webBean); + } + + if (webBean == null) + webBean = (WebDocumentBean) request.getSession().getAttribute(Constants.WEB_PAYMENT_BEAN); + + if (webBean == null) + throw new OperationException(operationException); + + request.getSession().setAttribute(Constants.ME_LOCATION, webBean.getMeLocation()); + request.getSession().setAttribute(Constants.YOU_LOCATION, webBean.getYouLocation()); + request.getSession().setAttribute(Constants.YOU_BP_LOCATION, webBean.getYoubpLocation()); + request.getSession().setAttribute(Constants.ME, webBean.getMe()); + request.getSession().setAttribute(Constants.MORDER, webBean.getOrder()); + request.getSession().setAttribute(Constants.YOU,webBean.getYou()); + request.getSession().setAttribute(Constants.MPAYMENT, webBean.getPayment()); + request.getSession().setAttribute(Constants.PAYMENT_TYPE, webBean.getTenderType()); + request.getSession().setAttribute(Constants.MINVOICE, webBean.getInvoice()); + request.getSession().setAttribute(Constants.SIMPLE_COMMAND,webBean.getSimpleCommand()); + request.getSession().setAttribute(Constants.COMPLEX_COMMAND,webBean.getComplexCommand()); + request.getSession().setAttribute(Constants.WEB_DOCUMENT_HEADER_BEAN, webBean.getHeaderBean()); + request.setAttribute(Constants.CURRENCY_SYMBOLE,webBean.getCurrencySymbole()); + ForwardConfig forwardConfig = getForward(ctx,webBean,mapping,form); + + ActionForward forward = new ActionForward(forwardConfig.getPath()); + + return forward; + } + + private ForwardConfig getForward(Properties ctx, WebDocumentBean webBean, ActionMapping mapping, ActionForm form) throws OperationException + { + ActionConfig config = mapping.getModuleConfig().findActionConfig("/ViewWebstorePaymentAction"); + + return config.findForwardConfig(Constants.VIEW_PAYMENT); + } +} diff --git a/posterita/posterita/src/main/org/posterita/webstore/businesslogic/DocumentHistoryManager.java b/posterita/posterita/src/main/org/posterita/webstore/businesslogic/DocumentHistoryManager.java new file mode 100644 index 0000000000..b4c33429e2 --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/webstore/businesslogic/DocumentHistoryManager.java @@ -0,0 +1,186 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + **/ +package org.posterita.webstore.businesslogic; + +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.Properties; + +import org.compiere.util.DB; +import org.compiere.util.Env; +import org.posterita.beans.DocumentHistoryBean; +import org.posterita.core.UDIMap; +import org.posterita.exceptions.OperationException; + +public class DocumentHistoryManager +{ + + private static Integer getIntegerValue(int value) + { + if (value == 0) + return null; + else + return Integer.valueOf(value); + } + + + public static ArrayList getHistory(Properties ctx, Integer bpartnerId, String docStatus, Integer month, Integer year, String orderType) throws OperationException + { + StringBuffer sql = new StringBuffer(); + sql.append(" select"); + sql.append(" ord.c_order_id, "); //1.orderID + sql.append(" pay.c_payment_id, "); //2.paymentID + sql.append(" inv.c_invoice_id, "); //3.invoiceID + sql.append(" ship.m_inout_id, "); //4.shipmentID + sql.append(" partner.c_bpartner_id, "); //5.partnerID + sql.append(" partner.name, "); //6.partnerName + sql.append(" partner.name2, "); //7.partnerName2 + sql.append(" ord.created, "); //8.dateCreated + sql.append(" ship.docstatus,"); //9/docStatus + //sql.append(" DECODE(pay.docstatus, 'CO', 'Paid', 'Awaiting Payment') paymentStatus,"); + sql.append(" CASE WHEN pay.docstatus = 'CO' THEN 'Paid' ELSE 'Awaiting Payment' END AS paymentStatus,"); + //sql.append(" DECODE (ship.docstatus, 'CO', 'Shipped', 'Not Shipped') shipmentStatus,"); + sql.append(" CASE WHEN ship.docstatus= 'CO' THEN 'Shipped' ELSE 'Not Shipped' END AS shipmentStatus,"); + sql.append(" ord.documentNo,"); + sql.append(" inv.documentNo,"); + sql.append(" pay.documentNo,"); + sql.append(" ship.documentNo,"); + sql.append(" partner.isCustomer,"); + sql.append(" partner.isVendor from "); + sql.append("(((c_order ord left outer join c_invoice inv on ord.C_Order_ID=inv.C_Order_ID) left outer join M_InOut ship on ord.C_Order_ID=ship.C_Order_ID) left outer join c_payment pay on inv.c_invoice_id = pay.c_invoice_id)"); + sql.append(", c_bpartner partner"); + sql.append(" where ord.ad_client_id=" + Env.getAD_Client_ID(ctx)); + sql.append(" and ord.ad_org_id=" + Env.getAD_Org_ID(ctx)); + sql.append(" and partner.c_bpartner_id=ord.c_bpartner_id"); + sql.append(" and ord.isactive='Y'"); + + + if(orderType!=null) + { + sql.append(" and ord.ordertype='" + orderType + "'"); + } + + if (month != null) + { + String mm = String.valueOf(month); + if (mm.length() == 1) + { + mm = "0" + mm; + } + sql.append(" and to_char(ord.dateOrdered, 'mm') ='" + mm + "'"); + } + + if (year != null) + { + sql.append(" and to_char(ord.dateOrdered, 'yyyy') ='" + year+"'"); + } + + if (bpartnerId != null) + { + sql.append(" and ord.c_bpartner_id=" + bpartnerId); + } + + sql.append(" order by ord.c_order_id desc"); + + + + PreparedStatement pstmt = DB.prepareStatement(sql.toString(), null); + + ResultSet rs = null; + DocumentHistoryBean bean; + ArrayList list = new ArrayList(); + + try + { + rs = pstmt.executeQuery(); + + while(rs.next()) + { + bean = new DocumentHistoryBean(); + bean.setOrderId(getIntegerValue(rs.getInt(1))); + bean.setPaymentId(getIntegerValue(rs.getInt(2))); + bean.setInvoiceId(getIntegerValue(rs.getInt(3))); + bean.setMinOutId(getIntegerValue(rs.getInt(4))); + bean.setBpartnerId(getIntegerValue(rs.getInt(5))); + bean.setPartnerName(rs.getString(6) + " " + rs.getString(7)); + bean.setDateOrdered(rs.getTimestamp(8)); + + if (rs.getString(9) != null) + { + bean.setDocStatus(UDIMap.docStatusMap.get(rs.getString(9))); + bean.setDocStatusCode(rs.getString(9)); + } + + bean.setPaymentStatus(rs.getString(10)); + bean.setShipmentStatus(rs.getString(11)); + bean.setDocumentNo(rs.getString(12)); + bean.setInvoiceNo(rs.getString(13)); + bean.setPaymentNo(rs.getString(14)); + bean.setShipmentNo(rs.getString(15)); + + if(rs.getString(16).equals("Y")) + { + bean.setIsCustomer(Boolean.valueOf(true)); + } + else + { + bean.setIsCustomer(Boolean.valueOf(false)); + } + + if(rs.getString(17).equals("Y")) + { + bean.setIsVendor(Boolean.valueOf(true)); + } + else + { + bean.setIsVendor(Boolean.valueOf(false)); + } + + + list.add(bean); + } + + } + catch (SQLException e) + { + throw new OperationException(e.getMessage()); + } + finally + { + try + { + rs.close(); + pstmt.close(); + } + catch (Exception ex) + { + } + rs = null; + pstmt = null; + } + + return list; + } + + +} diff --git a/posterita/posterita/src/main/org/posterita/webstore/businesslogic/PaymentManager.java b/posterita/posterita/src/main/org/posterita/webstore/businesslogic/PaymentManager.java new file mode 100644 index 0000000000..45abaae90c --- /dev/null +++ b/posterita/posterita/src/main/org/posterita/webstore/businesslogic/PaymentManager.java @@ -0,0 +1,256 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + **/ +package org.posterita.webstore.businesslogic; + +import java.util.Properties; + +import org.compiere.model.MBankAccount; +import org.compiere.model.MDocType; +import org.compiere.model.MInOut; +import org.compiere.model.MOrder; +import org.compiere.model.MPayment; +import org.compiere.model.MPaymentValidate; +import org.compiere.process.DocumentEngine; +import org.compiere.util.Env; +import org.posterita.Constants; +import org.posterita.beans.CreditCardBean; +import org.posterita.exceptions.CreditCardExpiryInvalidException; +import org.posterita.exceptions.CreditCardNumberException; +import org.posterita.exceptions.CreditCardTypeNotSupportedException; +import org.posterita.exceptions.CreditCardVVInvalidException; +import org.posterita.exceptions.OperationException; +import org.posterita.order.UDIOrderTypes; +import org.posterita.util.PoManager; + +public class PaymentManager +{ + + public static MPayment createARReceipt(Properties ctx, int salesOrderId, String deliveryViaRule, String trxName) throws OperationException + { + return createPayment(ctx, salesOrderId, deliveryViaRule, MDocType.DOCBASETYPE_ARReceipt, null, null, null, null, null, trxName); + } + + + public static MPayment createARReceipt(Properties ctx, int salesOrderId, String deliveryViaRule, String creditCardType, String creditCardNumber, String cvv2, Integer expMonth, Integer expYear, String trxName) throws OperationException + { + return createPayment(ctx, salesOrderId, deliveryViaRule, MDocType.DOCBASETYPE_ARReceipt, creditCardType, creditCardNumber, cvv2, expMonth, expYear, trxName); + } + + + public static MPayment createPayment(Properties ctx, int orderId, String deliveryViaRule, String docBaseType, String creditCardType, String creditCardNumber, String cvv2, Integer expMonth, Integer expYear, String trxName) throws OperationException + { + MPayment payment; + MOrder order = new MOrder(ctx, orderId, trxName); + + try + { + int orgID = Env.getAD_Org_ID(ctx); + //get org's default bank Account + int bankAccIds[] = MBankAccount.getAllIDs(MBankAccount.Table_Name, " ad_org_id=" + orgID + " and ad_client_id=" + Env.getAD_Client_ID(ctx) + " and isDefault='Y'", trxName); + + if (bankAccIds.length == 0) + throw new OperationException("No default bank account found for org"); + + MBankAccount orgBankAc = new MBankAccount(ctx, bankAccIds[0], trxName); + + payment = new MPayment(ctx,0, trxName); + payment.setC_BankAccount_ID(bankAccIds[0]); + payment.setC_BPartner_ID(order.getC_BPartner_ID()); + payment.setC_Currency_ID(order.getC_Currency_ID()); + payment.setC_Order_ID(orderId); + + if (deliveryViaRule != null && deliveryViaRule.equals(MInOut.DELIVERYVIARULE_Shipper)) + { + payment.setTenderType(MPayment.TENDERTYPE_CreditCard); + + boolean creditcardDetailsValid = payment.setCreditCard(MPayment.TRXTYPE_Sales, creditCardType, creditCardNumber, cvv2,expMonth.intValue(), expYear.intValue()); + + if (!creditcardDetailsValid) + throw new OperationException("Credit Card Details Missing!!!"); + } + else + payment.setTenderType(MPayment.TENDERTYPE_Check); + + MDocType[] docTypes = MDocType.getOfDocBaseType(ctx, docBaseType); + + if (docTypes.length == 0) + throw new OperationException("not document type found for payment"); + + payment.setC_DocType_ID(docTypes[0].get_ID()); + + payment.setAccountNo(orgBankAc.getAccountNo()); + + payment.setPayAmt(order.getGrandTotal()); + + + if (docBaseType.equals(MDocType.DOCBASETYPE_APPayment)) + { + payment.setIsReceipt(false); + payment.setDescription("(AP Payment) Payment Made"); + } + + else + { + payment.setIsReceipt(true); + payment.setDescription("(AR Receipt) Payment Received"); + } + + PoManager.save(payment); + + } + catch(OperationException e) + { + throw e; + } + + return payment; + } + + + public static MPayment completePayment(Properties ctx, int paymentId, String trxName) throws OperationException + { + MPayment payment; + + try + { + payment = new MPayment(ctx, paymentId, trxName); + + + if (payment.getDocStatus().equals(DocumentEngine.STATUS_Completed)) + throw new OperationException("Cannot complete a payment which is already completed"); + + if (payment.getDocStatus().equals(DocumentEngine.STATUS_Voided)) + throw new OperationException("Cannot complete a payment which has been voided"); + + PoManager.processIt(payment, DocumentEngine.ACTION_Complete); + } + catch(OperationException e) + { + throw e; + } + + return payment; + } + + public static MPayment loadPayment(Properties ctx, MOrder order, String trxName) throws OperationException + { + if (!order.getOrderType().equals(UDIOrderTypes.WEBSTORE_ORDER.getOrderType())) + throw new OperationException("This method only loads payment for a webstore order!!"); + + int[] paymentIds = MPayment.getAllIDs(MPayment.Table_Name, "c_order_id=" + order.get_ID(), null); + + if (paymentIds.length > 1) + throw new OperationException("Error loading payment. Webstore does not support multiple payment for one order.Order Id is " + order.get_ID()); + + if (paymentIds.length < 0) + throw new OperationException("Error loading payment. No payment found for this order: " + order.get_ID()); + + //Assuming that there will be only one payment for this order + MPayment payment = new MPayment(ctx, paymentIds[0], trxName); + + return payment; + } + + + public static String isPaid(Properties ctx, int orderId, String trxName) + { + int[] paymentIds = MPayment.getAllIDs(MPayment.Table_Name, "c_order_id=" + orderId, trxName); + + if (paymentIds.length == 0) + return Constants.NO_CHAR; + + MPayment payment = new MPayment(ctx, paymentIds[0], trxName); + + if (payment.getDocStatus().equals(MPayment.DOCSTATUS_Completed)) + return Constants.YES_CHAR; + else + return Constants.NO_CHAR; + } + + + public static void validateCreditCardDetails(CreditCardBean cardBean) throws CreditCardTypeNotSupportedException, CreditCardNumberException, CreditCardExpiryInvalidException, CreditCardVVInvalidException + { + if(cardBean == null) + throw new IllegalArgumentException("CardBean cannot be null"); + + String creditCardNum = cardBean.getCreditCardNumber(); + String creditCardType = cardBean.getCreditCardType(); + + if(!(creditCardType != null + && (creditCardType.equals(MPayment.CREDITCARDTYPE_Amex) + || creditCardType.equals(MPayment.CREDITCARDTYPE_Discover) + || creditCardType.equals(MPayment.CREDITCARDTYPE_MasterCard) + || creditCardType.equals(MPayment.CREDITCARDTYPE_Visa)))) + { + throw new CreditCardTypeNotSupportedException("Credit Card type: " + creditCardType + " is not supported"); + } + + String numValResult = MPaymentValidate.validateCreditCardNumber(creditCardNum, creditCardType); + if(numValResult != "") + throw new CreditCardNumberException("Credit Card number is not valid, Reason: " + numValResult); + + Integer expMonth = cardBean.getCreditCardExpMonth(); + Integer expYear = cardBean.getCreditCardExpYear(); + + if(expMonth == null) + throw new CreditCardExpiryInvalidException("Expiry month cannot be null"); + if(expYear == null) + throw new CreditCardExpiryInvalidException("Expiry year cannot be null"); + + String expiryValResult = MPaymentValidate.validateCreditCardExp(expMonth.intValue(), expYear.intValue()); + + if(expiryValResult != "") + throw new CreditCardExpiryInvalidException("Credit Card Expiry date invalid"); + + String cvv = cardBean.getCvv(); + if(cvv == null) + throw new CreditCardVVInvalidException("Credit Card VV cannot be null"); + + String cvvValResult = MPaymentValidate.validateCreditCardVV(cvv, creditCardType); + if(cvvValResult != "") + throw new CreditCardVVInvalidException("Credit Card VV is not valid"); + } + + + public static String loadCreditCardTypeName(String creditCardType) throws OperationException + { + if(creditCardType == null) + throw new OperationException("Credit Card Type not present!!"); + + String creditCardTypeName = ""; + + if (creditCardType.equals(MPayment.CREDITCARDTYPE_Amex)) + creditCardTypeName = Constants.CREDITCARDTYPE_AMEX; + else + if (creditCardType.equals(MPayment.CREDITCARDTYPE_Discover)) + creditCardTypeName = Constants.CREDITCARDTYPE_DISCOVER; + else + if (creditCardType.equals(MPayment.CREDITCARDTYPE_MasterCard)) + creditCardTypeName = Constants.CREDITCARDTYPE_MASTERCARD; + else + if (creditCardType.equals(MPayment.CREDITCARDTYPE_Visa)) + creditCardTypeName = Constants.CREDITCARDTYPE_VISA; + + return creditCardTypeName; + + } + +} diff --git a/posterita/posterita/src/main/posterita.properties b/posterita/posterita/src/main/posterita.properties new file mode 100644 index 0000000000..7ca992f448 --- /dev/null +++ b/posterita/posterita/src/main/posterita.properties @@ -0,0 +1,13 @@ +## webstore Image Folder +webstore.automated.import=OFF +webstore.automated.time=1800000 +webstore.collection.folder=/home/posterita/images/Collections +webstore.inactive.folder=/home/posterita/images/Inactive +webstore.folder.errors=/home/posterita/images/Errors + + +webstore.shipping.promotion.status=ON +webstore.shipping.promotion.price=50 + +webstore.url=http://www.posterita.com +webstore.price.default=120 diff --git a/posterita/posterita/src/utils/ImportMessages.sh b/posterita/posterita/src/utils/ImportMessages.sh new file mode 100644 index 0000000000..c5fbac3538 --- /dev/null +++ b/posterita/posterita/src/utils/ImportMessages.sh @@ -0,0 +1 @@ +java -DPropertyFile=../Adempiere.properties -cp ./trlImporter.jar:../lib/Adempiere.jar:../lib/CSTools.jar:../lib/CCTools.jar:../lib/oracle.jar:../lib/postgresql.jar:../lib/j2ee.jar:../lib/sqlj.jar com.tamak.core.utils.MsgImporter messages.csv diff --git a/posterita/posterita/src/utils/messages.csv b/posterita/posterita/src/utils/messages.csv new file mode 100644 index 0000000000..2ec869dc47 --- /dev/null +++ b/posterita/posterita/src/utils/messages.csv @@ -0,0 +1,444 @@ +"SEARCHKEY";"ENGTEXT";"ENGTIP";"FRENCHTXT";"FRENCHTIP" +"1000_rupees";"1000 Rupees";" ";"1000 Rupees";" " +"100_dollars";"100 dollars";" ";"100 dollars";" " +"100_rupees";"100 Rupees";" ";"100 Rupees";" " +"10_dollars";"10 dollars";" ";"10 dollars";" " +"10_rupees";"10 Rupees";" ";"10 Rupees";" " +"1_cent";"1 cent";"1 cent";"1 sous/centime";" " +"1_dollar";"1 dollar";" ";"1 dollar";" " +"1_rupee";"1 Rupee";" ";"1 Rupee";" " +"2000_rupees";"2000 Rupees";" ";"2000 Rupees";" " +"200_rupees";"200 Rupees";" ";"200 Rupees";" " +"20_cents";"20 cents";"20 cents";"20 sous/centimes";" " +"20_dollars";"20 dollars";" ";"20 dollars";" " +"25_rupees";"25 Rupees";" ";"25 Rupees";" " +"500_rupees";"500 Rupees";" ";"500 Rupees";" " +"50_cents";"50 cents";"50 cents";"50 sous/centimes";" " +"50_dollars";"50 dollars";" ";"50 dollars";" " +"50_rupees";"50 Rupees";" ";"50 Rupees";" " +"5_cents";"5 cents";"5 cents";"5 sous/centimes";" " +"5_dollars";"5 dollars";" ";"5 dollars";" " +"5_rupees";"5 Rupees";" ";"5 Rupees";" " +"Due0";"Due 0";" ";"D 0";" " +"Due0_30";"Due 0-30";" ";"D 0-30";" " +"account.type";"Account Type";" ";"Type de compte";" " +"accounts.receivable";"Accounts Receivable-Trade";" ";"Comptes clients";" " +"activate";"Activate";" ";"Activer";" " +"activate.vendor";"Activate Vendor";" ";"Activer fournisseur";" " +"actual.price";"Actual Price";" ";"Prix actuel";" " +"add";"Add";" ";"Ajouter";" " +"add.black.listed.cheque";"Add Black Listed Cheque";" ";"Ajouter aux ch�ues non valable";" " +"add.customer.fidelity.card";"Add Customer for fidelity card";" ";"Ajouter client �la liste des cartes de fid�it�;" " +"add.customer.for.fidelity.card";"Add Customer for fidelity card";" ";"Ajouter client �la liste des cartes de fid�it�;" " +"add.record";"Add Record";" ";"Ajouter";" " +"add.to.cart";"Add To Cart";" ";"Ajouter au Caddie";" " +"address";"Address";" ";"Adresse";" " +"adjust.cash.book";"Adjust Cash Book";" ";"Ajuster le livre de caisse";" " +"advanced";"Advanced";" ";"Avanc�";" " +"aging";"Aging";" ";"Balance �� du d�iteur";" " +"ajax.error";"Some error occured while communicating with the server. Please try again.";" ";"Une erreur s'est produite lors de la communication avec le serveur. Pri�e de r�ssayer";" " +"all";"All";" ";"Tout";" " +"all.products";"All products";" ";"Tous les produits";" " +"amount.difference";"Difference";" ";"Diff�ence";" " +"amount.expense";"Expense";" ";"D�enses";" " +"amount.receipt";"Receipt";" ";"Montant re�";" " +"amount.refunded";"Amount refunded";" ";"Montant rendu";" " +"amount.tendered";"Amount Tendered";" ";"Montant re�";" " +"amount.transfer";"Transfer";" ";"Montant transf��;" " +"application.name";"Application Name";" ";"Nom de l`application";" " +"application.version";"Application Version";" ";"Version de l`application";" " +"asset";"Assets";" ";"Actif";" " +"at.least.one";"At least one";" ";"Au moins un";" " +"attach.image";"Attach Image";" ";"Attacher une image";" " +"attribute";"Attribute";"Attribute";"Attribue";" " +"attribute.set";"Attribute Set";"Attribute Set";"Groupe de l`attribue";" " +"available.menu";"Available Menus";" ";"Menus disponibles";" " +"back";"Back";" ";"Retour";" " +"barcode";"Barcode";"Barcode";"Code barre";" " +"barcode.already.exists";"Barcode already exists!";" ";"Code barre d��existant";" " +"black.listed.cheques";"Black Listed Cheques";" ";"Ch�ue sur liste noire";" " +"bpartner.info";"Business Partner Info";" ";"Info sur tiers";" " +"bpartner.trx.details";"Business Partner Trx Details";" ";"D�ails des transactions des tiers";" " +"brand";"Brand";" ";"Marque";" " +"cal.period.curr";"Calculation Period And Curr.";" ";"P�iode de calcul et devise";" " +"card";"Card";" ";"Carte bleue";" " +"card.amount";"Card Amount";" ";"Montant carte bleue";" " +"card.amt.entered";"Card Amount Entered";" ";"Montant carte bleue �d�iter";" " +"card.amt.tendered";"Card amount tendered";" ";"Montant re� par carte bleue";" " +"card.amt.total";"Card Amount Total";" ";"Montant total sur carte bleue";" " +"card.is.empty";"The Cart is Empty !";" ";"Le caddie est vide!";" " +"card.no";"Card No";" ";"Num�o de carte bleue";" " +"card.total";"Card Total";" ";"Montant total sur carte bleue";" " +"cart.addmore";"Add More";" ";"Rajouter";" " +"cart.empty";"Cart is empty!";" ";"Le caddie est vide!";" " +"cart.has";"Cart has";" ";"Le caddie contient:";" " +"cart.items";" items";" ";"items";" " +"cart.remove";"Remove";" ";"Retirer";" " +"cash";"Cash";" ";"Esp�e";" " +"cash.amount";"Cash Amount";" ";"Montant en esp�e";" " +"cash.book";"Cash Book";" ";"Livre de caisse";" " +"cash.book.adjust";"The Cash Book has been adjusted.";" ";"Le livre de caisse a ��ajust�;" " +"cash.book.adjusted";"The Cash Book has been adjusted";" ";"Le livre de caisse a ��ajust�;" " +"cash.book.history";"Cash Book History";" ";"Historique du livre de caisse";" " +"cash.line.detail";"Cash Line Details";" ";"D�ail des lignes d'esp�e";" " +"cash.payment";"Cash Payment";" ";"Paiement en esp�e";" " +"cash.receipt";"Cash Receipt";" ";"Montant re� en esp�e";" " +"cash.refunded";"Cash refunded";" ";"Montant rembours�en esp�e";" " +"cash.tendered";"Cash tendered";" ";"Argent donn�;" " +"cash.to.transfer";"Cash to transfer";" ";"Argent �transf�er";" " +"cash.total";"Cash Total";" ";"Total Esp�e";" " +"cellphone";"Cellphone";" ";"T��hone portable/GSM";" " +"checkout";"Checkout";" ";"Sortir";" " +"cheque";"Cheque";" ";"Ch�ue";" " +"cheque.amount";"Cheque Amount";" ";"Montant ch�ue";" " +"cheque.amt.entered";"Cheque Amount Entered";" ";"Montant donn�en ch�ue";" " +"cheque.amt.tendered";"Cheque amount tendered";" ";"Montant re� par ch�ue";" " +"cheque.amt.total";"Cheque Amount Total";" ";"Montant total en ch�ue";" " +"cheque.no";"Cheque No";" ";"No de ch�ue";" " +"cheque.total";"Cheque Total";" ";"Montant total ch�ue";" " +"choose.attribute";"Choose Attribute";" ";"Choisir les attributs";" " +"choose.your.till";"Please choose your till number";" ";"Choisir le num�o de poste";" " +"clear";"Clear";" ";"Supprimer";" " +"close";"Close";" ";"Fermer";" " +"close.till";"Close Till";" ";"Fermer la caisse";" " +"closed";"Closed";" ";"Ferm�;" " +"closing.balance";"Closing Balance";" ";"Balance de cl�ure";" " +"cogs";"CoGS";" ";"Cots des marchandises vendues";" " +"colour";"Colour";" ";"Couleur";" " +"commission.details";"Commission Details";" ";"D�ails des commissions";" " +"completed";"Completed";" ";"Compl��;" " +"continue";"Continue";" ";"Continuer a v�ifier";" " +"create.bpartner";"Create Business Partner";" ";"Cr�r tiers";" " +"create.garment";"Create Garment";" ";"Cr�r";" " +"create.payment";"Create Payment";" ";"Cr�r un paiement";" " +"credit.check";"Credit Check";" ";"V�ification cr�it";" " +"credit.details";"Credit Details";" ";"D�ails cr�nces";" " +"credit.hold";"Credit Hold";" ";"Cr�it �v�ifier";" " +"credit.memo";"Credit Memo";" ";"Cr�it M�o";" " +"credit.ok";"Credit OK";" ";"Cr�it OK";" " +"credit.order";"Credit Order";" ";"Vente �cr�it";" " +"credit.order.discount";"Credit Order Discount";" ";"Remise sur vente �cr�it";" " +"credit.stop";"Credit Stop";" ";"Cr�it suspendu";" " +"credit.watch";"Credit Watch";" ";"Cr�it sous surveillance";" " +"current.month";"Current Month";" ";"Mois actuel";" " +"current.till.amount";"Current Till Amount";" ";"Montant en caisse";" " +"current.week";"Current Week";" ";"Semaine actuelle";" " +"current.year";"Current Year";" ";"Ann� actuelle";" " +"custom";"Custom";" ";"Personnalis�;" " +"custom.sales.reports";"Custom Sales Report";" ";"Tableaux de bords personnalis�";" " +"customer";"Customer";" ";"Client";" " +"customer.id";"Customer ID";" ";"Identification client";" " +"customer.info";"Customer Info";" ";"Information client";" " +"customer.returned.order";"Customer Returned Order";" ";"Retour client";" " +"customervendor";"Customer/Vendor";" ";"Client/Fournisseur";" " +"date.created";"Date Created";" ";"Date de cr�tion";" " +"date.from";"From";" ";"De";" " +"date.ordered";"Date Ordered";"Date Ordered";"Date de commande";" " +"date.range";"Date Range";" ";"P�iode";" " +"date.to";"to";" ";"�;" " +"deactivate";"De-activate";" ";"D�activer";" " +"deactivate.vendor";"Deactivate Vendor";" ";"D�activer fournisseur";" " +"dealer.name";"Dealer Name";" ";"Nom client";" " +"default";"Default";" ";"Par d�aut";" " +"delete";"Delete";" ";"Supprimer";" " +"delete.selected";"Delete Selected";" ";"Supprimer la s�ection";" " +"design";"Design";" ";"Dessin";" " +"discount.amt";"Discount";" ";"Escompte";" " +"discounted.price";"Discounted Price";" ";"Prix sold�;" " +"display";"Display";" ";"Display";" " +"display.all.records";"Do you want to display all records?";" ";"Voulez vous voir toute les entr�s?";" " +"doc.basis.type";"Doc Basis Type";" ";"Type de document";" " +"download.csv";"Download CSV";" ";"T��harger en CSV";" " +"drafted";"Drafted";" ";"Brouillon";" " +"dunning.letters.printed.successfully";"Dunning letters have been printed successfully";" ";"Les lettres ont ��imprim�s";" " +"edit";"Edit";" ";"Modifier";" " +"edit.attribute";"Edit Attribute";" ";"Modifier les attributs";" " +"edit.black.listed.cheque";"Edit Black Listed Cheque";" ";"Modifier la liste des ch�ues non recevables";" " +"edit.customer";"Edit Customer";" ";"Modifier client";" " +"edit.price";"Edit Price";" ";"Modifier prix";" " +"edit.price.list";"Edit Price List";" ";"Modifier la liste de prix";" " +"edit.product";"Edit Product";" ";"�iter le produit";" " +"edit.related.products";"Edit related products details";" ";"Modifier les d�ails des produits";" " +"edit.role";"Edit Role";" ";"Modifier le r�e";" " +"edit.user";"Edit User";" ";"Modifier utilisateur";" " +"edit.vendor";"Edit Vendor";" ";"�iter le fournisseur";" " +"enable.printing";"Enable printing";" ";"Permettre l`impression";" " +"enter";"ENTER";" ";"Entrer";" " +"excl.vat";"(excl. VAT)";" ";"TVA exclu";" " +"fast.moving.item";"Fast Moving Items Report";" ";"Tableau des produits les PLUS vendus";" " +"fast.moving.item.current.month";"Fast Moving Items Report (Current Month)";" ";"Tableau des produits les PLUS vendus (MOIS courant)";" " +"fast.moving.item.today";"Fast Moving Items Report (Today)";" ";"Tableau des produits les PLUS vendus (aujourd'hui)";" " +"filter.by";"Filter By";" ";"Filtrer par";" " +"filter.type";"Choose the type of filter";" ";"Choisir le type de filtre";" " +"first";"First";" ";"Premier";" " +"fixed";"Fixed";" ";"Fixe";" " +"float.amt.change";"This is the float amount for today. Please Enter float amount for the next day if needs to be changed.";" ";"Ceci est le fond de caisse pour aujourd'hui. Pri�e d'entrer le fond de caisse pour le jour suivant si besoin est.";" " +"footer.copyright";"All Contents ©2006 Tamak ICT";" ";" ";"Tout contenues et copies r�erv�" +"found.none";"Found None";" ";"Aucune information correspond �la recherche";" " +"from";"From";" ";"De";" " +"garment.template";"Garment Template";" ";"Mod�e pour v�ement";" " +"generate.commission";"Generate Commission";" ";"G��er les commissions";" " +"goods.received.note";"Goods Received Note";" ";"Achat produit";" " +"goods.returned.note";"Goods Returned Note";" ";"Retour produit";" " +"hide.details";"Hide Details";" ";"Cacher d�ails";" " +"import.black.listed";"Import Black Listed Cheques";" ";"Importer la liste de ch�ues non recevables";" " +"import.blacklisted.message1";"This utility is to import the a list of Black Listed Cheques from a csv file into the system,
    The csv file should look like the one shown below including the header:";" ";"Cet outil aide �importer une liste de ch�ue non recevables dans l'application a partir d'un fichier CSV.
    le ficher CSV doit �re importe sous le m�e format que celui de l'exemple ci-dessous en incluant l'en-t�e";" " +"import.list";"Import List";" ";"Importer la liste";" " +"import.product.message";"This utility is to import the products & Stock in Hand from a csv file into the system,
    For importing the garment products, the CSV file name should containg the word 'Garment'
    The csv file should look like the one shown below including the header";" ";"Cet outil aide �importer une liste de produit accompagner du stock dans l'application a partir d'un fichier CSV.
    le ficher CSV doit �re importe sous le m�e format que celui de l'exemple ci-dessous en incluant l'en-t�e";" " +"incl.vat";"(incl. VAT)";" ";"( TVA inclue)";" " +"inprogress";"InProgress";" ";"En cours";" " +"invalid";"Invalid";" ";"Non valable";" " +"invoice.no";"Invoice No";" ";"No de facture";" " +"invoke";"Invoke";" ";"Chercher";" " +"invoke.customer.returned.order";"Invoke";" ";"Chercher r��ence pour retour client";" " +"invoke.partial";"Invoke Partial POS Order";" ";"Chercher Ordre de vente partiel";" " +"items";"Items";" ";"Items";" " +"last";"Last";" ";"Suivant";" " +"last.2.months";"Last 2 Months";" ";"Deux derniers mois";" " +"last.2.weeks";"Last 2 Weeks";" ";"Deux derni�es semaines";" " +"last.3.months";"Last 3 Months";" ";"Les 3 derniers mois";" " +"last.3.weeks";"Last 3 Weeks";" ";"Les 3 derni�es semaines";" " +"last.6.month";"Last 6 Months";" ";"Les 6 derniers mois";" " +"license.name";"License Name";"License Name";"Nom de la Licence";" " +"license.valid";"License Valid";"License Valid";"Licence valide";" " +"licensed.distribution";"Licensed Distribution";" ";"Distribution de la licence";" " +"licensed.module";"Licensed Modules";" ";"Module de la Licence";" " +"licensing.info";"Licensing Information";" ";"Information de la licence";" " +"list";"List";" ";"Liste";" " +"login.home.all.contents";"All content";" ";"Tout le contenu";" " +"login.home.loginForgot";"Forgot password?";" ";"Vous avez oubli�votre mot de passe?";" " +"login.home.message1";"Please enter your username and password";" ";"Veuillez entrer votre identifiant et votre mot de passe";" " +"login.home.message2";"Please enter PIN";" ";"Entrer votre code secret";" " +"login.home.password";"Password";" ";"Mot de passe";" " +"login.home.username";"Username";" ";"Nom utilisateur";" " +"login.password.backToLogin";"  Click Here to go back to the Login Screen";" ";" ";" " +"login.password.passwordSent";"Your password has been sent you should receive it in a few minutes";" ";"Votre mot de passe vous a ��envoy� vous devriez le recevoir d'ici quelques minutes";" " +"marked.price";"Marked Price";" ";"Prix affich�;" " +"max.active.users";"Max Active Users";" ";"Max d`utilisateur valide";" " +"max.sold.item";"Max sold Item";" ";"Items";" " +"menus";"Menus";" ";"Menus";" " +"min.item.sold";"Min Item Sold";" ";"Min d'article vendus";" " +"mixed";"Mixed";" ";"mixe";" " +"mobile";"Moblie No";" ";"GSM";" " +"model";"Model";" ";"Mod�e";" " +"month";"Month";" ";"Mois";" " +"net.amt";"Net Amount";" ";"Montant Net";" " +"net.cash.trx";"Net Cash Trx";" ";"Montant Net en esp�e";" " +"net.transaction";"Net Transaction";" ";"Transaction net";" " +"new.attribute.value";"New Attribute Value";" ";"Nouvel valeur pour l'attribue";" " +"new.credit.order";"New Credit Order";" ";"Nouvel vente �cr�it";" " +"new.customer";"New Customer";" ";"Nouveau client";" " +"new.customer.return.order";"New Customer Return Order";" ";"Nouveau retour client";" " +"new.goods.received.note";"New Goods Receive Note";" ";"Nouvel achat produit";" " +"new.goods.returned.note";"New Goods Returned Note";" ";"Nouveau retour produit";" " +"new.order";"New Order";" ";"Nouvel vente";" " +"new.price";"New Price";" ";"Nouveau prix";" " +"no";"No";" ";"No";" " +"no.customer.was.found.for";"No customer was found for";" ";"Aucun client n'a ��trouv�pour votre recherche:";" " +"no.shipment";"No Shipment";" ";"No d`exp�ition";" " +"no.vendor.was.found.for";"No vendor was found for";" ";"Aucun fournisseur n'a ��trouv�pour votre recherche:";" " +"normal.template";"Normal Template";" ";"Mod�e normal";" " +"not.authorised.to.give.discount";"It seems that you are not authorised to give discounts";" ";"Vous n'avez pas le droit de donner des remises";" " +"not.found";"Not Found";" ";"Ne peux pas �re trouv�;" " +"notes";"Notes";"Notes";"Coin";" " +"num.active.users";"No of Active Users";" ";"Nombre d`utilisateur actif";" " +"num.operations";"Number of Operations";" ";"Nombre d`op�ation";" " +"old.attribute.value";"Old Attribute Value";" ";"Ancienne valeur de l'attribue";" " +"open.invoices";"Open Invoices";" ";"Ouvrir factures";" " +"opening.balance";"Opening Balance";" ";"Balance d'ouverture";" " +"order.no";"Order No";" ";"num�o de facture";" " +"order.type";"Order Type";" ";"Type de facture";" " +"organisation.name";"Organisations";" ";"Organisation";" " +"partial.pos.order";"Partial POS Order";" ";"Vente partielle";" " +"partial.pos.order.history";"Partial POS Order History";" ";"Historique des ventes partielles";" " +"payment.allocation";"Payment Allocation";" ";"Allocation de payement";" " +"payment.by";"Payment By";" ";"Paiement par";" " +"payment.details";"Payment Details";" ";"D�ails des paiements";" " +"payment.num";"Payment No";"Payment No";"Num�o du paiement";" " +"payment.status";"Payment Status";"Payment Status";"Statue du paiement";" " +"payment.terms";"Payment Terms";" ";"Terme de paiement";" " +"payment.type";"Payment Type";" ";"Type de paiement";" " +"periodic.cash.details";"Periodic Cash Book Details";" ";"D�ails du livre de caisse par p�iode";" " +"please.enter.pin";"Please enter PIN";" ";"Entrer votre code secret";" " +"pmenu.administration";"Administration";" ";"Administration";" " +"pmenu.cash.sales";"Cash Sales";" ";"Ventes";" " +"pmenu.credit.sales";"Credit Sales";" ";"Ventes �Cr�it";" " +"pmenu.performance.analysis";"Performance Analysis";" ";"Tableaux de bords";" " +"pmenu.purchases";"Purchases";" ";"Achat";" " +"pmenu.stock";"Stock";" ";"Stock";" " +"pos.info";"POS Info";" ";"Information du point de vente";" " +"pos.info.current.month";"POS Info (Current Month)";" ";"Information du point de vente(du mois)";" " +"pos.info.custom";"POS Info (Custom)";" ";"Information du point de vente(Personnalis�";" " +"pos.info.today";"POS Info (Today)";" ";"Information du point de vente(aujourd'hui)";" " +"pos.name";"POS Name";" ";"Nom de point de vente";" " +"pos.order";"POS Order";" ";"Facture";" " +"pos.order.history";"POS Order History";" ";"Historique des factures";" " +"posPassowrd.welcome";"Welcome to Tamak POS";" ";"Bienvenue";" " +"postalAddr";"Postal Address";" ";"Adresse postale";" " +"preference.themes";"Themes";" ";"Th�es";" " +"preferences";"Preferences";" ";"Preferences";" " +"prepared.order";"Prepared Order";" ";"Ventes partielles";" " +"prev";"Prev";" ";"Pr��ent";" " +"print.barcode";"Print Barcode";" ";"Imprimer code barre";" " +"print.dunning.letters";"Print Dunning Letters";" ";"Imprimer lettres de rappels";" " +"print.fidelity.card";"Print Fidelity Card";" ";"Imprimer carte de fid�it�;" " +"print.order";"Print Order";" ";"Imprimer facture";" " +"print.pdf";"Print PDF";" ";"Imprimer PDF";" " +"printer.enabled";"Printer enabled";" ";"Imprimante active";" " +"printer.name";"Printer name";" ";"Nom de l`imprimante";" " +"product.already.exists";"Product name already exists!";" ";"Nom du produit est d��existant";" " +"product.id";"Product ID";" ";"ID Produit";" " +"product.info";"Product Info";" ";"Information Produit";" " +"product.type.item";"Item";" ";"Items";" " +"product.type.services";"Services";" ";"Services";" " +"product.updated";"The Products have been updated";" ";"Les produits ont ��mis �jour";" " +"profit.margin";"Profit Margin";" ";"Marge brute";" " +"purchase.price";"Purchase Price";" ";"Prix d'achat";" " +"qty.received";"Qty Received";" ";"Quantit� re�es";" " +"qty.returned.by.customer";"Qty Returned By Customer";" ";"Quantit�retourn�par le client";" " +"qty.returned.to.supplier";"Qty Returned to Supplier";" ";"Quantit�retourn�au fournisseur";" " +"qty.sold";"Qty Sold";" ";"Quantit�vendues";" " +"reason.message";"Reason";" ";"Raison";" " +"record.found";"Records found";" ";"Donn� trouv�s";" " +"records.per.page";"records per page";" ";"Donn� par page";" " +"remote.printing";"Remote printing";" ";"Imprim��distance";" " +"remove.customer.fidelity.card";"Remove Customer for fidelity card";" ";"Enlever client";" " +"report.filter.settings";"Report Filter Settings";" ";"R�lage du filtre des tableaux";" " +"reprint";"Reprint";" ";"R�mprimer";" " +"returned.order";"Returned Order";" ";"Retour";" " +"revenue";"Revenue";" ";"Chiffre d'affaires";" " +"sales.details";"Sales Details";" ";"D�ail de ventes";" " +"sales.order";"Sales Order";" ";"Ventes";" " +"sales.price";"Sales Price";" ";"Prix de vente";" " +"sales.reports";"Sales Reports";" ";"Tableau de vente";" " +"save";"Save";" ";"Save";" " +"save.as.csv";"Save as CSV";" ";"Sauvegarder en CSV";" " +"search";"Search";" ";"Rechercher";" " +"search.customer";"Search Customer";" ";"Rechercher un client";" " +"search.customer.notfound";"No customers were found for";" ";"Pas de clients trouv�pour";" " +"search.product";"Search Product";" ";"Rechercher un produit";" " +"search.product.notfound";"No products were found for:";" ";"Aucun produit n'a ��trouv�pour votre recherche:";" " +"search.result.displaying";"Displaying";" ";"Affichage";" " +"search.result.of";"of";" ";"De";" " +"search.result.to";"to";" ";"Jusqu'�;" " +"search.results";"Search Results";" ";"Rechercher r�ultats";" " +"select";"Select";" ";"S�ectionner";" " +"select.all";"Select All";" ";"Tout S�ectionner";" " +"select.bpartner.type";"Select partner type";" ";"Choisir type de tiers";" " +"select.range";"Select Range";" ";"S�ectionner une p�iode";" " +"selected.customers";"Selected Customers";" ";"S�ectionner les clients";" " +"settle.payment";"Settle Payment";" ";"Paiement d'une facture";" " +"settle.payment.message";"NOTE:-The Cash Payments would have effect only when the cash book is closed";" ";"NOTE:-The Cash Payments would have effect only when the cash book is closed";" " +"shipment.no";"Shipment No";" ";"Num�o d`exp�ition";" " +"shipment.required";"Shipment Required";" ";"Exp�ition requise";" " +"shipment.status";"Shipment Status";"Shipment Status";"Statue de l`exp�ition";" " +"show.details";"Show Details";" ";"Montrer d�ails";" " +"size";"Size";" ";"Taille";" " +"slow.moving.item";"Slow Moving Items";" ";"Produits lents";" " +"smenu.adjust.cashbook";"Adjust Cash Book";" ";"Ajuster le livre de caisse";" " +"smenu.adjust.inventory.id";"Adjust Inventory";" ";"Ajuster l'inventaire";" " +"smenu.adjust.stock.id";"Stock Adjustment";" ";"Ajuster le stock";" " +"smenu.bpartner.sales.details";"Business Partner Sales Details";" ";"Info sur tiers";" " +"smenu.bpartners";"Business Partners";" ";"Tiers";" " +"smenu.cash.sales";"Cash Sales";" ";"Ventes";" " +"smenu.cash.sales.customer.complusory";"Cash Sales (Customer Compulsory)";" ";"Ventes (Client obligatoire)";" " +"smenu.cash.sales.history";"Cash Sales History";" ";"Historique des ventes";" " +"smenu.cash.sales.multiple.payments";"Cash Sales (Discount/Multiple Payments)";" ";"Ventes (Remises/Paiements multiples)";" " +"smenu.cashbook.history";"Cash Book History";" ";"Historique du livre de caisse";" " +"smenu.cashbook.report";"Cash Book Report";" ";"Tableaux de bords du livre de caisse";" " +"smenu.check.repair.database.integrity";"Check/Repair Database Integrity";" ";"V�ifier/R�arer l'int�rit�de la base de donn�s";" " +"smenu.close.till";"Close Till";" ";"Fermer la caisse";" " +"smenu.complete.prepared.order";"Complete Prepared Order";" ";"Compl��une vente partielle";" " +"smenu.create.unallocated.payment.id";"Create General Payments";" ";"Cr�r un paiement g��al";" " +"smenu.credit.memo.history.id";"Credit Memo History";" ";"Credit Memo History";" " +"smenu.credit.sales";"Credit Sales";" ";"Ventes �cr�it";" " +"smenu.credit.sales.history";"Credit Sales History";" ";"Historique des ventes �cr�it";" " +"smenu.creditmemo.from.creditorder.id";"Invoke Credit Memo";" ";"Chercher r��ence pour vente �cr�it";" " +"smenu.current.money.in.terminal";"Current Money in Terminal";" ";"Montant du terminal";" " +"smenu.customer.return.history.id";"Customer Return History";" ";"Customer Return History";" " +"smenu.customer.returned.order";"Customer Returned Order";" ";"Retour client";" " +"smenu.customers";"Customers";" ";"Clients";" " +"smenu.document.history";"Document History";" ";"Historique des documents";" " +"smenu.dunning.letters";"Dunning Letters";" ";"Lettres de rappelles";" " +"smenu.edit.product.attribute.value";"Edit Product Attribute Value";" ";"�iter valeur de l'attribut du produit";" " +"smenu.fast.moving.items";"Fast Moving Items";" ";"Tableaux des produits les plus vendus";" " +"smenu.generate.commission";"Generate Commission";" ";"G��er les commissions";" " +"smenu.goods.received.note";"Goods Received Note";" ";"Achat produit";" " +"smenu.goods.received.note.history";"Goods Received Note History";" ";"Historique des achats produit";" " +"smenu.goods.returned.note";"Goods Returned Note";" ";"Retour produit";" " +"smenu.goods.returned.note.history";"Goods Returned Note History";" ";"Historique des retours produit";" " +"smenu.inventory.history.id";"Inventory History";" ";"Historique des inventaires";" " +"smenu.invoke.customer.returned.order";"Invoke Customer Returned Order";" ";"Rechercher retour client";" " +"smenu.logout";"Logout";" ";"Quitter";" " +"smenu.open.cashdrawer";"Open Cash Drawer";" ";"Ouvrir la caisse";" " +"smenu.order.history";"Order History";" ";"Historique des ventes";" " +"smenu.payment.allocation.history";"Payment Allocations History";" ";"Historique des allocations de paiement";" " +"smenu.payment.term";"Payment Term";" ";"Allocation de payement";" " +"smenu.performance.analysis.report";"Performance Analysis Report";" ";"Tableaux de bords";" " +"smenu.preferences";"Preferences";" ";"Pr��ences";" " +"smenu.prepare.order";"Prepare Order";" ";"Ventes partielles";" " +"smenu.prepared.order.history";"Prepared Order History";" ";"Historique des ventes partielles";" " +"smenu.products";"Products";" ";"Produits";" " +"smenu.quick.cash.sales";"Quick Cash Sales";" ";"Ventes rapide";" " +"smenu.role";"Role";" ";"R�e";" " +"smenu.sales.report.per.terminal";"Sales Report per Terminal";" ";"Tableaux de bords par terminal";" " +"smenu.settle.payment.credit.sales";"Settle Payment on a Credit Sales";" ";"Paiement pour ventes �cr�it";" " +"smenu.slow.moving.items";"Slow Moving Items";" ";"Tableaux des produits les moins vendus";" " +"smenu.stock";"Stock";" ";"Stock";" " +"smenu.stock.movement";"Stock Movement";" ";"Mouvement du stock";" " +"smenu.tax";"Tax";" ";"Taxe";" " +"smenu.users";"Users";" ";"Utilisateur";" " +"smenu.vendors";"Vendors";" ";"Fournisseurs";" " +"smenu.view.last.generated.commission";"Last Generated Commission";" ";"Visualiser les derni�es commissions g���s";" " +"smenu.view.licensing";"Licensing";" ";"Visualiser licence";" " +"status";"Status";"Status";"Statues";" " +"stock.in.hand";"Stock in Hand";" ";"Stock disponible";" " +"stock.inquiry";"Stock Inquiry";" ";"Interrogation du stock";" " +"stock.movement";"Stock Movement";" ";"Mouvement du stock";" " +"stock.movement.report";"Stock Movement Report";" ";"�ats sur les mouvements de stock";" " +"submit";"Submit";" ";"Soumettre";" " +"summary.by.periods";"Summary By Period";" ";"R�um�par p�iode";" " +"switch.to.paging";"Switch to Paging";" ";"Changer la pagination";" " +"tamak.pos";"TAMAK ICT WARMS";" ";"Tamak ICT ARMS";" " +"tax.credit";"Tax Credit";" ";"Cr�it de TVA";" " +"tax.due";"Tax Due";" ";"TVA d";" " +"texttile.products.only";"Textile Products Only";" ";"Produits textiles uniquement";" " +"the.cart.has";"The Cart has";" ";"Le caddie contient:";" " +"till.balance.entered";"Till Balance Entered";" ";"Balance de la caisse entr�par vendeur";" " +"till.management";"Till Mgt";" ";"G�er la caisse";" " +"till.no";"Till No";" ";"No de caisse";" " +"time.hour";"h";" ";"H";" " +"time.minute";"m";" ";"Min";" " +"to";"To";" ";"Jusqu'�;" " +"today";"Today";" ";"Aujourd'hui";" " +"total";"Total";" ";"Total";" " +"total.price";"Total Price";" ";"Prix total";" " +"trade.revenue";"Trade Revenue";" ";"Chiffre d'affaires";" " +"unallocated.payments";"Unallocated Payments";" ";"Paiements non assign�;" " +"update.details";"Update Details";" ";"Mise �jour";" " +"user";"User";" ";"Utilisateur";" " +"user.details";"User's Details";" ";"D�ails utilisateur";" " +"user.info";"Information";" ";"Information";" " +"vat";"VAT";" ";"TVA";" " +"vendor.details";"Vendor Details";" ";"D�ails fournisseurs";" " +"vendor.ref";"Vendor Ref";" ";"R��ence fournisseur";" " +"vendors";"Vendors";" ";"Fournisseurs";" " +"view";"View";" ";"Visualiser";" " +"view.attributes";"View Attributes";"View Attributes";"Visualiser attribues";" " +"view.by";"View By";" ";"Visualiser par";" " +"view.info";"View Info";" ";"Visualiser Info";" " +"view.product.cart";"View Product Cart";" ";"Visualiser caddie";" " +"view.report";"View Report";" ";"Visualiser tableaux de bords";" " +"view.role";"View Role";" ";"Visualiser R�e";" " +"view.vendor";"View Vendor";" ";"Visualiser fournisseur";" " +"year";"Year";" ";"Ann�";" " +"yes";"Yes";" ";"Oui";" " +"price.x";"Price(excl. VAT)";"Prix(excl. TVA)";" " +"price.i";"Price(incl. VAT)";"Prix(incl. TVA)";" " +"LogOut";"Log Out";"Sortir";" " +"smenu.price.check";"Price Check";"Verifier Prix";" " +"next";"Next";"Suivant";" " +"grouped.by";"Group by";"Grouper par";" " +"view.product";"View Product";"Produit de vue";" " +"activate.product";"Activate Ptoduct";"Activez le produit";" " +"deactivate.product";"Deactivate Produit";"Desactiver le produit";" " diff --git a/posterita/posterita/web/WEB-INF/c.tld b/posterita/posterita/web/WEB-INF/c.tld new file mode 100644 index 0000000000..ce80e8dd55 --- /dev/null +++ b/posterita/posterita/web/WEB-INF/c.tld @@ -0,0 +1,416 @@ + + + + 1.0 + 1.2 + c + http://java.sun.com/jstl/core + JSTL core + JSTL 1.0 core library + + + + org.apache.taglibs.standard.tlv.JstlCoreTLV + + + expressionAttributes + + out:value + out:default + out:escapeXml + if:test + import:url + import:context + import:charEncoding + forEach:items + forEach:begin + forEach:end + forEach:step + forTokens:items + forTokens:begin + forTokens:end + forTokens:step + param:encode + param:name + param:value + redirect:context + redirect:url + set:property + set:target + set:value + url:context + url:value + when:test + + + Whitespace-separated list of colon-separated token pairs + describing tag:attribute combinations that accept expressions. + The validator uses this information to determine which + attributes need their syntax validated. + + + + + + catch + org.apache.taglibs.standard.tag.common.core.CatchTag + JSP + + Catches any Throwable that occurs in its body and optionally + exposes it. + + + var + false + false + + + + + choose + org.apache.taglibs.standard.tag.common.core.ChooseTag + JSP + + Simple conditional tag that establishes a context for + mutually exclusive conditional operations, marked by + <when> and <otherwise> + + + + + out + org.apache.taglibs.standard.tag.el.core.OutTag + JSP + + Like <%= ... >, but for expressions. + + + value + true + false + + + default + false + false + + + escapeXml + false + false + + + + + if + org.apache.taglibs.standard.tag.el.core.IfTag + JSP + + Simple conditional tag, which evalutes its body if the + supplied condition is true and optionally exposes a Boolean + scripting variable representing the evaluation of this condition + + + test + true + false + + + var + false + false + + + scope + false + false + + + + + import + org.apache.taglibs.standard.tag.el.core.ImportTag + org.apache.taglibs.standard.tei.ImportTEI + JSP + + Retrieves an absolute or relative URL and exposes its contents + to either the page, a String in 'var', or a Reader in 'varReader'. + + + url + true + false + + + var + false + false + + + scope + false + false + + + varReader + false + false + + + context + false + false + + + charEncoding + false + false + + + + + forEach + org.apache.taglibs.standard.tag.el.core.ForEachTag + org.apache.taglibs.standard.tei.ForEachTEI + JSP + + The basic iteration tag, accepting many different + collection types and supporting subsetting and other + functionality + + + items + false + false + + + begin + false + false + + + end + false + false + + + step + false + false + + + var + false + false + + + varStatus + false + false + + + + + forTokens + org.apache.taglibs.standard.tag.el.core.ForTokensTag + JSP + + Iterates over tokens, separated by the supplied delimeters + + + items + true + false + + + delims + true + false + + + begin + false + false + + + end + false + false + + + step + false + false + + + var + false + false + + + varStatus + false + false + + + + + otherwise + org.apache.taglibs.standard.tag.common.core.OtherwiseTag + JSP + + Subtag of <choose> that follows <when> tags + and runs only if all of the prior conditions evaluated to + 'false' + + + + + param + org.apache.taglibs.standard.tag.el.core.ParamTag + JSP + + Adds a parameter to a containing 'import' tag's URL. + + + name + true + false + + + value + false + false + + + + + redirect + org.apache.taglibs.standard.tag.el.core.RedirectTag + JSP + + Redirects to a new URL. + + + var + false + false + + + scope + false + false + + + url + true + false + + + context + false + false + + + + + remove + org.apache.taglibs.standard.tag.common.core.RemoveTag + empty + + Removes a scoped variable (from a particular scope, if specified). + + + var + true + false + + + scope + false + false + + + + + set + org.apache.taglibs.standard.tag.el.core.SetTag + JSP + + Sets the result of an expression evaluation in a 'scope' + + + var + false + false + + + value + false + false + + + target + false + false + + + property + false + false + + + scope + false + false + + + + + url + org.apache.taglibs.standard.tag.el.core.UrlTag + JSP + + Prints or exposes a URL with optional query parameters + (via the c:param tag). + + + var + false + false + + + scope + false + false + + + value + true + false + + + context + false + false + + + + + when + org.apache.taglibs.standard.tag.el.core.WhenTag + JSP + + Subtag of <choose> that includes its body if its + condition evalutes to 'true' + + + test + true + false + + + + diff --git a/posterita/posterita/web/WEB-INF/dcs.tld b/posterita/posterita/web/WEB-INF/dcs.tld new file mode 100644 index 0000000000..f24e99d210 --- /dev/null +++ b/posterita/posterita/web/WEB-INF/dcs.tld @@ -0,0 +1,201 @@ + + + +1.0 +1.1 +dcs + + + + +orderStatus +org.posterita.taglib.OrderStatus +JSP + +name +true +true + + +property +true +true + + +scope +false +true + + + + +attributeValues +com.posterita.taglib.AttributeValues +JSP + +name +true +true + + +property +true +true + + +scope +false +true + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/posterita/posterita/web/WEB-INF/fmt.tld b/posterita/posterita/web/WEB-INF/fmt.tld new file mode 100644 index 0000000000..20523ee619 --- /dev/null +++ b/posterita/posterita/web/WEB-INF/fmt.tld @@ -0,0 +1,442 @@ + + + + 1.0 + 1.2 + fmt + http://java.sun.com/jstl/fmt + JSTL fmt + JSTL 1.0 i18n-capable formatting library + + + + org.apache.taglibs.standard.tlv.JstlFmtTLV + + + expressionAttributes + + requestEncoding:value + setLocale:value + setLocale:variant + timeZone:value + setTimeZone:value + bundle:basename + bundle:prefix + setBundle:basename + message:key + message:bundle + param:value + formatNumber:value + formatNumber:pattern + formatNumber:currencyCode + formatNumber:currencySymbol + formatNumber:groupingUsed + formatNumber:maxIntegerDigits + formatNumber:minIntegerDigits + formatNumber:maxFractionDigits + formatNumber:minFractionDigits + parseNumber:value + parseNumber:pattern + parseNumber:parseLocale + parseNumber:integerOnly + formatDate:value + formatDate:pattern + formatDate:timeZone + parseDate:value + parseDate:pattern + parseDate:timeZone + parseDate:parseLocale + + + Whitespace-separated list of colon-separated token pairs + describing tag:attribute combinations that accept expressions. + The validator uses this information to determine which + attributes need their syntax validated. + + + + + + requestEncoding + org.apache.taglibs.standard.tag.el.fmt.RequestEncodingTag + empty + + Sets the request character encoding + + + value + false + false + + + + + setLocale + org.apache.taglibs.standard.tag.el.fmt.SetLocaleTag + empty + + Stores the given locale in the locale configuration variable + + + value + true + false + + + variant + false + false + + + scope + false + false + + + + + timeZone + org.apache.taglibs.standard.tag.el.fmt.TimeZoneTag + JSP + + Specifies the time zone for any time formatting or parsing actions + nested in its body + + + value + true + false + + + + + setTimeZone + org.apache.taglibs.standard.tag.el.fmt.SetTimeZoneTag + empty + + Stores the given time zone in the time zone configuration variable + + + value + true + false + + + var + false + false + + + scope + false + false + + + + + bundle + org.apache.taglibs.standard.tag.el.fmt.BundleTag + JSP + + Loads a resource bundle to be used by its tag body + + + basename + true + false + + + prefix + false + false + + + + + setBundle + org.apache.taglibs.standard.tag.el.fmt.SetBundleTag + empty + + Loads a resource bundle and stores it in the named scoped variable or + the bundle configuration variable + + + basename + true + false + + + var + false + false + + + scope + false + false + + + + + message + org.apache.taglibs.standard.tag.el.fmt.MessageTag + JSP + + Maps key to localized message and performs parametric replacement + + + key + false + false + + + bundle + false + false + + + var + false + false + + + scope + false + false + + + + + param + org.apache.taglibs.standard.tag.el.fmt.ParamTag + JSP + + Supplies an argument for parametric replacement to a containing + <message> tag + + + value + false + false + + + + + formatNumber + org.apache.taglibs.standard.tag.el.fmt.FormatNumberTag + JSP + + Formats a numeric value as a number, currency, or percentage + + + value + false + false + + + type + false + false + + + pattern + false + false + + + currencyCode + false + false + + + currencySymbol + false + false + + + groupingUsed + false + false + + + maxIntegerDigits + false + false + + + minIntegerDigits + false + false + + + maxFractionDigits + false + false + + + minFractionDigits + false + false + + + var + false + false + + + scope + false + false + + + + + parseNumber + org.apache.taglibs.standard.tag.el.fmt.ParseNumberTag + JSP + + Parses the string representation of a number, currency, or percentage + + + value + false + false + + + type + false + false + + + pattern + false + false + + + parseLocale + false + false + + + integerOnly + false + false + + + var + false + false + + + scope + false + false + + + + + formatDate + org.apache.taglibs.standard.tag.el.fmt.FormatDateTag + empty + + Formats a date and/or time using the supplied styles and pattern + + + value + true + false + + + type + false + false + + + dateStyle + false + false + + + timeStyle + false + false + + + pattern + false + false + + + timeZone + false + false + + + var + false + false + + + scope + false + false + + + + + parseDate + org.apache.taglibs.standard.tag.el.fmt.ParseDateTag + JSP + + Parses the string representation of a date and/or time + + + value + false + false + + + type + false + false + + + dateStyle + false + false + + + timeStyle + false + false + + + pattern + false + false + + + timeZone + false + false + + + parseLocale + false + false + + + var + false + false + + + scope + false + false + + + + diff --git a/posterita/posterita/web/WEB-INF/pos.tld b/posterita/posterita/web/WEB-INF/pos.tld new file mode 100644 index 0000000000..b194ced21f --- /dev/null +++ b/posterita/posterita/web/WEB-INF/pos.tld @@ -0,0 +1,76 @@ + + + + 1.0 + 1.2 + pos + pos.tld + POSterita + $Id: pos.tld,v 1.2 2006/11/29 05:23:55 alok Exp $ + + + + message + org.posterita.pos.taglib.MessageTag + JSP + Display element + + key + true + true + + + printing + false + false + + + textOnly + false + false + + + + bpartner + org.posterita.pos.taglib.BPartnerSearchTag + JSP + Ajax search for BPartner + + name + true + true + + + property + true + true + + + disabled + false + true + + + isCustomer + false + false + + + isVendor + false + false + + + isEmployee + false + false + + + size + false + false + + + \ No newline at end of file diff --git a/posterita/posterita/web/WEB-INF/posterita.tld b/posterita/posterita/web/WEB-INF/posterita.tld new file mode 100644 index 0000000000..11315c500f --- /dev/null +++ b/posterita/posterita/web/WEB-INF/posterita.tld @@ -0,0 +1,146 @@ + + + +1.0 +1.1 +dms + + + + +regionName +com.dms.taglib.Region +JSP + +name +true +true + + +property +false +true + + +scope +true +true + + + + +warehouseName +com.dms.taglib.Warehouse +JSP + +name +true +true + + +property +false +true + + +scope +true +true + + + + + +productName +com.dms.taglib.ProductName +JSP + +name +true +true + + +property +false +true + + +scope +true +true + + + + + bankName + com.dms.taglib.BankName + JSP + + name + true + true + + + property + false + true + + + scope + true + true + + + + + +menuClose +com.dms.taglib.MenuClose +JSP + +name +true +true + + +property +false +true + + +scope +true +true + + + + + +sco +com.dms.taglib.SCONaming +JSP + +name +false +true + + +property +false +true + + +abbreviated +false +true + + +scope +false +true + + + + + + \ No newline at end of file diff --git a/posterita/posterita/web/WEB-INF/struts-bean.tld b/posterita/posterita/web/WEB-INF/struts-bean.tld new file mode 100644 index 0000000000..5fe94bd359 --- /dev/null +++ b/posterita/posterita/web/WEB-INF/struts-bean.tld @@ -0,0 +1,382 @@ + + + + + + + + + + +1.2 +1.1 +bean +http://struts.apache.org/tags-bean + +cookie +org.apache.struts.taglib.bean.CookieTag +org.apache.struts.taglib.bean.CookieTei +empty + +id +true +false + + +multiple +false +true + + +name +true +true + + +value +false +true + + + +define +org.apache.struts.taglib.bean.DefineTag +org.apache.struts.taglib.bean.DefineTei +JSP + +id +true +false + + +name +false +true + + +property +false +true + + +scope +false +true + + +toScope +false +true + + +type +false +true + + +value +false +true + + + +header +org.apache.struts.taglib.bean.HeaderTag +org.apache.struts.taglib.bean.HeaderTei +empty + +id +true +false + + +multiple +false +true + + +name +true +true + + +value +false +true + + + +include +org.apache.struts.taglib.bean.IncludeTag +org.apache.struts.taglib.bean.IncludeTei +empty + +anchor +false +true + + +forward +false +true + + +href +false +true + + +id +true +false + + +name +false +true + + +page +false +true + + +transaction +false +true + + + +message +org.apache.struts.taglib.bean.MessageTag +empty + +arg0 +false +true + + +arg1 +false +true + + +arg2 +false +true + + +arg3 +false +true + + +arg4 +false +true + + +bundle +false +true + + +key +false +true + + +locale +false +true + + +name +false +true + + +property +false +true + + +scope +false +true + + + +page +org.apache.struts.taglib.bean.PageTag +org.apache.struts.taglib.bean.PageTei +empty + +id +true +false + + +property +true +true + + + +parameter +org.apache.struts.taglib.bean.ParameterTag +org.apache.struts.taglib.bean.ParameterTei +empty + +id +true +false + + +multiple +false +true + + +name +true +true + + +value +false +true + + + +resource +org.apache.struts.taglib.bean.ResourceTag +org.apache.struts.taglib.bean.ResourceTei +empty + +id +true +false + + +input +false +true + + +name +true +true + + + +size +org.apache.struts.taglib.bean.SizeTag +org.apache.struts.taglib.bean.SizeTei +empty + +collection +false +true + + +id +true +false + + +name +false +true + + +property +false +true + + +scope +false +true + + + +struts +org.apache.struts.taglib.bean.StrutsTag +org.apache.struts.taglib.bean.StrutsTei +empty + +id +true +false + + +formBean +false +true + + +forward +false +true + + +mapping +false +true + + + +write +org.apache.struts.taglib.bean.WriteTag +empty + +bundle +false +true + + +filter +false +true + + +format +false +true + + +formatKey +false +true + + +ignore +false +true + + +locale +false +true + + +name +true +true + + +property +false +true + + +scope +false +true + + + + + + diff --git a/posterita/posterita/web/WEB-INF/struts-config.xml b/posterita/posterita/web/WEB-INF/struts-config.xml new file mode 100644 index 0000000000..e33082530b --- /dev/null +++ b/posterita/posterita/web/WEB-INF/struts-config.xml @@ -0,0 +1,6673 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/posterita/posterita/web/WEB-INF/struts-config_1_2.dtd b/posterita/posterita/web/WEB-INF/struts-config_1_2.dtd new file mode 100644 index 0000000000..fa479f76b5 --- /dev/null +++ b/posterita/posterita/web/WEB-INF/struts-config_1_2.dtd @@ -0,0 +1,686 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/posterita/posterita/web/WEB-INF/struts-html.tld b/posterita/posterita/web/WEB-INF/struts-html.tld new file mode 100644 index 0000000000..a53db16f66 --- /dev/null +++ b/posterita/posterita/web/WEB-INF/struts-html.tld @@ -0,0 +1,3032 @@ + + + + + + + + + + +1.2 +1.1 +html +http://struts.apache.org/tags-html + +base +org.apache.struts.taglib.html.BaseTag +empty + +target +false +true + + +server +false +true + + + +button +org.apache.struts.taglib.html.ButtonTag + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +disabled +false +true + + +indexed +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +true +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +cancel +org.apache.struts.taglib.html.CancelTag + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +disabled +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +checkbox +org.apache.struts.taglib.html.CheckboxTag + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +disabled +false +true + + +indexed +false +true + + +name +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +true +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +errors +org.apache.struts.taglib.html.ErrorsTag +empty + +bundle +false +true + + +locale +false +true + + +name +false +true + + +property +false +true + + + +file +org.apache.struts.taglib.html.FileTag + +accesskey +false +true + + +accept +false +true + + +alt +false +true + + +altKey +false +true + + +disabled +false +true + + +indexed +false +true + + +maxlength +false +true + + +name +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +true +true + + +size +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +form +org.apache.struts.taglib.html.FormTag +JSP + +action +true +true + + +acceptCharset +false +true + + +enctype +false +true + + +focus +false +true + + +focusIndex +false +true + + +method +false +true + + +onreset +false +true + + +onsubmit +false +true + + +scriptLanguage +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +target +false +true + + + +frame +org.apache.struts.taglib.html.FrameTag + +action +false +true + + +module +false +true + + +anchor +false +true + + +forward +false +true + + +frameborder +false +true + + +frameName +false +true + + +href +false +true + + +longdesc +false +true + + +marginheight +false +true + + +marginwidth +false +true + + +name +false +true + + +noresize +false +true + + +page +false +true + + +paramId +false +true + + +paramName +false +true + + +paramProperty +false +true + + +paramScope +false +true + + +property +false +true + + +scope +false +true + + +scrolling +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +title +false +true + + +titleKey +false +true + + +transaction +false +true + + + +hidden +org.apache.struts.taglib.html.HiddenTag +empty + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +disabled +false +true + + +indexed +false +true + + +name +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +true +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + +write +false +true + + + +html +org.apache.struts.taglib.html.HtmlTag +JSP + +lang +false +true + + +locale +false +true + + +xhtml +false +true + + + +image +org.apache.struts.taglib.html.ImageTag + +accesskey +false +true + + +align +false +true + + +alt +false +true + + +altKey +false +true + + +border +false +true + + +bundle +false +true + + +disabled +false +true + + +indexed +false +true + + +locale +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +page +false +true + + +pageKey +false +true + + +property +false +true + + +src +false +true + + +srcKey +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +img +org.apache.struts.taglib.html.ImgTag +empty + +align +false +true + + +alt +false +true + + +altKey +false +true + + +border +false +true + + +bundle +false +true + + +contextRelative +false +true + + +height +false +true + + +hspace +false +true + + +imageName +false +true + + +ismap +false +true + + +locale +false +true + + +lowsrc +false +true + + +name +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +paramId +false +true + + +page +false +true + + +pageKey +false +true + + +action +false +true + + +module +false +true + + +paramName +false +true + + +paramProperty +false +true + + +paramScope +false +true + + +property +false +true + + +scope +false +true + + +src +false +true + + +srcKey +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +title +false +true + + +titleKey +false +true + + +useLocalEncoding +false +true + + +usemap +false +true + + +vspace +false +true + + +width +false +true + + + +javascript +org.apache.struts.taglib.html.JavascriptValidatorTag +empty + +cdata +false +true + + +dynamicJavascript +false +false + + +formName +false +true + + +method +false +true + + +page +false +true + + +scriptLanguage +false +true + + +src +false +true + + +staticJavascript +false +false + + +htmlComment +false +true + + + +link +org.apache.struts.taglib.html.LinkTag + +accesskey +false +true + + +action +false +true + + +module +false +true + + +anchor +false +true + + +forward +false +true + + +href +false +true + + +indexed +false +true + + +indexId +false +true + + +linkName +false +true + + +name +false +true + + +onblur +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +page +false +true + + +paramId +false +true + + +paramName +false +true + + +paramProperty +false +true + + +paramScope +false +true + + +property +false +true + + +scope +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +target +false +true + + +title +false +true + + +titleKey +false +true + + +transaction +false +true + + +useLocalEncoding +false +true + + + +messages +org.apache.struts.taglib.html.MessagesTag +org.apache.struts.taglib.html.MessagesTei +JSP + +id +true +false + + +bundle +false +true + + +locale +false +true + + +name +false +true + + +property +false +true + + +header +false +true + + +footer +false +true + + +message +false +true + + + +multibox +org.apache.struts.taglib.html.MultiboxTag + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +disabled +false +true + + +name +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +true +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +option +org.apache.struts.taglib.html.OptionTag + +bundle +false +true + + +disabled +false +true + + +key +false +true + + +locale +false +true + + +style +false +true + + +styleId +false +true + + +styleClass +false +true + + +value +true +true + + + +options +org.apache.struts.taglib.html.OptionsTag +empty + +collection +false +true + + +filter +false +true + + +labelName +false +true + + +labelProperty +false +true + + +name +false +true + + +property +false +true + + +style +false +true + + +styleClass +false +true + + + +optionsCollection +org.apache.struts.taglib.html.OptionsCollectionTag +empty + +filter +false +true + + +label +false +true + + +name +false +true + + +property +false +true + + +style +false +true + + +styleClass +false +true + + +value +false +true + + + +password +org.apache.struts.taglib.html.PasswordTag + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +disabled +false +true + + +indexed +false +true + + +maxlength +false +true + + +name +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +true +true + + +readonly +false +true + + +redisplay +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +size +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +radio +org.apache.struts.taglib.html.RadioTag + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +disabled +false +true + + +indexed +false +true + + +name +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +property +true +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +true +true + + +idName +false +true + + + +reset +org.apache.struts.taglib.html.ResetTag + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +disabled +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +rewrite +org.apache.struts.taglib.html.RewriteTag +empty + +action +false +true + + +module +false +true + + +anchor +false +true + + +forward +false +true + + +href +false +true + + +name +false +true + + +page +false +true + + +paramId +false +true + + +paramName +false +true + + +paramProperty +false +true + + +paramScope +false +true + + +property +false +true + + +scope +false +true + + +transaction +false +true + + +useLocalEncoding +false +true + + + +select +org.apache.struts.taglib.html.SelectTag +JSP + +alt +false +true + + +altKey +false +true + + +disabled +false +true + + +indexed +false +true + + +multiple +false +true + + +name +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +true +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +size +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +submit +org.apache.struts.taglib.html.SubmitTag + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +disabled +false +true + + +indexed +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +text +org.apache.struts.taglib.html.TextTag + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +disabled +false +true + + +indexed +false +true + + +maxlength +false +true + + +name +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +true +true + + +readonly +false +true + + +size +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +textarea +org.apache.struts.taglib.html.TextareaTag + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +cols +false +true + + +disabled +false +true + + +indexed +false +true + + +name +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +true +true + + +readonly +false +true + + +rows +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +xhtml +org.apache.struts.taglib.html.XhtmlTag +empty + + + diff --git a/posterita/posterita/web/WEB-INF/struts-logic.tld b/posterita/posterita/web/WEB-INF/struts-logic.tld new file mode 100644 index 0000000000..f920868073 --- /dev/null +++ b/posterita/posterita/web/WEB-INF/struts-logic.tld @@ -0,0 +1,652 @@ + + + + + + + + + +1.2 +1.1 +logic +http://struts.apache.org/tags-logic + +empty +org.apache.struts.taglib.logic.EmptyTag +JSP + +name +false +true + + +property +false +true + + +scope +false +true + + + +equal +org.apache.struts.taglib.logic.EqualTag +JSP + +cookie +false +true + + +header +false +true + + +name +false +true + + +parameter +false +true + + +property +false +true + + +scope +false +true + + +value +true +true + + + +forward +org.apache.struts.taglib.logic.ForwardTag +empty + +name +true +true + + + +greaterEqual +org.apache.struts.taglib.logic.GreaterEqualTag +JSP + +cookie +false +true + + +header +false +true + + +name +false +true + + +parameter +false +true + + +property +false +true + + +scope +false +true + + +value +true +true + + + +greaterThan +org.apache.struts.taglib.logic.GreaterThanTag +JSP + +cookie +false +true + + +header +false +true + + +name +false +true + + +parameter +false +true + + +property +false +true + + +scope +false +true + + +value +true +true + + + +iterate +org.apache.struts.taglib.logic.IterateTag +org.apache.struts.taglib.logic.IterateTei +JSP + +collection +false +true + + +id +true +false + + +indexId +false +false + + +length +false +true + + +name +false +true + + +offset +false +true + + +property +false +true + + +scope +false +true + + +type +false +true + + + +lessEqual +org.apache.struts.taglib.logic.LessEqualTag +JSP + +cookie +false +true + + +header +false +true + + +name +false +true + + +parameter +false +true + + +property +false +true + + +scope +false +true + + +value +true +true + + + +lessThan +org.apache.struts.taglib.logic.LessThanTag +JSP + +cookie +false +true + + +header +false +true + + +name +false +true + + +parameter +false +true + + +property +false +true + + +scope +false +true + + +value +true +true + + + +match +org.apache.struts.taglib.logic.MatchTag +JSP + +cookie +false +true + + +header +false +true + + +location +false +true + + +name +false +true + + +parameter +false +true + + +property +false +true + + +scope +false +true + + +value +true +true + + + +messagesNotPresent +org.apache.struts.taglib.logic.MessagesNotPresentTag +JSP + +name +false +true + + +property +false +true + + +message +false +true + + + +messagesPresent +org.apache.struts.taglib.logic.MessagesPresentTag +JSP + +name +false +true + + +property +false +true + + +message +false +true + + + +notEmpty +org.apache.struts.taglib.logic.NotEmptyTag +JSP + +name +false +true + + +property +false +true + + +scope +false +true + + + +notEqual +org.apache.struts.taglib.logic.NotEqualTag +JSP + +cookie +false +true + + +header +false +true + + +name +false +true + + +parameter +false +true + + +property +false +true + + +scope +false +true + + +value +true +true + + + +notMatch +org.apache.struts.taglib.logic.NotMatchTag +JSP + +cookie +false +true + + +header +false +true + + +location +false +true + + +name +false +true + + +parameter +false +true + + +property +false +true + + +scope +false +true + + +value +true +true + + + +notPresent +org.apache.struts.taglib.logic.NotPresentTag +JSP + +cookie +false +true + + +header +false +true + + +name +false +true + + +parameter +false +true + + +property +false +true + + +role +false +true + + +scope +false +true + + +user +false +true + + + +present +org.apache.struts.taglib.logic.PresentTag +JSP + +cookie +false +true + + +header +false +true + + +name +false +true + + +parameter +false +true + + +property +false +true + + +role +false +true + + +scope +false +true + + +user +false +true + + + +redirect +org.apache.struts.taglib.logic.RedirectTag + +action +false +true + + +anchor +false +true + + +forward +false +true + + +href +false +true + + +name +false +true + + +page +false +true + + +paramId +false +true + + +paramName +false +true + + +paramProperty +false +true + + +paramScope +false +true + + +property +false +true + + +scope +false +true + + +transaction +false +true + + +useLocalEncoding +false +true + + + + + + diff --git a/posterita/posterita/web/WEB-INF/struts-nested.tld b/posterita/posterita/web/WEB-INF/struts-nested.tld new file mode 100644 index 0000000000..f4a10d0f52 --- /dev/null +++ b/posterita/posterita/web/WEB-INF/struts-nested.tld @@ -0,0 +1,2886 @@ + + + + + + + + + +1.2 +1.1 +nested +http://struts.apache.org/tags-nested + +nest +org.apache.struts.taglib.nested.NestedPropertyTag +JSP + +property +false +true + + + +writeNesting +org.apache.struts.taglib.nested.NestedWriteNestingTag +org.apache.struts.taglib.nested.NestedWriteNestingTei +JSP + +property +false +true + + +id +false +true + + +filter +false +true + + + +root +org.apache.struts.taglib.nested.NestedRootTag +JSP + +name +false +true + + + +define +org.apache.struts.taglib.nested.bean.NestedDefineTag +org.apache.struts.taglib.nested.bean.NestedDefineTei +empty + +id +true +true + + +name +false +true + + +property +false +true + + +scope +false +true + + +toScope +false +true + + +type +false +true + + +value +false +true + + + +message +org.apache.struts.taglib.nested.bean.NestedMessageTag +empty + +arg0 +false +true + + +arg1 +false +true + + +arg2 +false +true + + +arg3 +false +true + + +arg4 +false +true + + +bundle +false +true + + +key +false +true + + +locale +false +true + + +name +false +true + + +property +false +true + + +scope +false +true + + + +size +org.apache.struts.taglib.nested.bean.NestedSizeTag +org.apache.struts.taglib.bean.SizeTei +empty + +collection +false +true + + +id +true +true + + +name +false +true + + +property +false +true + + +scope +false +true + + + +write +org.apache.struts.taglib.nested.bean.NestedWriteTag +empty + +bundle +false +true + + +filter +false +true + + +format +false +true + + +formatKey +false +true + + +ignore +false +true + + +locale +false +true + + +name +false +true + + +property +false +true + + +scope +false +true + + + +checkbox +org.apache.struts.taglib.nested.html.NestedCheckboxTag + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +disabled +false +true + + +indexed +false +true + + +name +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +true +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +errors +org.apache.struts.taglib.nested.html.NestedErrorsTag +empty + +bundle +false +true + + +locale +false +true + + +name +false +true + + +property +false +true + + + +file +org.apache.struts.taglib.nested.html.NestedFileTag + +accesskey +false +true + + +accept +false +true + + +alt +false +true + + +altKey +false +true + + +disabled +false +true + + +indexed +false +true + + +maxlength +false +true + + +name +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +true +true + + +size +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +form +org.apache.struts.taglib.nested.html.NestedFormTag +JSP + +action +true +true + + +enctype +false +true + + +focus +false +true + + +method +false +true + + +onreset +false +true + + +onsubmit +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +target +false +true + + + +hidden +org.apache.struts.taglib.nested.html.NestedHiddenTag + +alt +false +true + + +altKey +false +true + + +indexed +false +true + + +name +false +true + + +property +true +true + + +title +false +true + + +titleKey +false +true + + +styleClass +false +true + + +styleId +false +true + + +value +false +true + + +write +false +true + + + +image +org.apache.struts.taglib.nested.html.NestedImageTag + +accesskey +false +true + + +align +false +true + + +alt +false +true + + +altKey +false +true + + +border +false +true + + +bundle +false +true + + +disabled +false +true + + +indexed +false +true + + +locale +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +page +false +true + + +pageKey +false +true + + +property +false +true + + +src +false +true + + +srcKey +false +true + + +style +false +true + + +styleClass +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +img +org.apache.struts.taglib.nested.html.NestedImgTag +empty + +accesskey +false +true + + +align +false +true + + +alt +false +true + + +altKey +false +true + + +border +false +true + + +bundle +false +true + + +height +false +true + + +hspace +false +true + + +imageName +false +true + + +ismap +false +true + + +locale +false +true + + +lowsrc +false +true + + +name +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +paramId +false +true + + +page +false +true + + +pageKey +false +true + + +paramName +false +true + + +paramProperty +false +true + + +paramScope +false +true + + +property +false +true + + +scope +false +true + + +src +false +true + + +srcKey +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +title +false +true + + +titleKey +false +true + + +usemap +false +true + + +vspace +false +true + + +width +false +true + + + +link +org.apache.struts.taglib.nested.html.NestedLinkTag + +accesskey +false +true + + +action +false +true + + +anchor +false +true + + +forward +false +true + + +href +false +true + + +indexed +false +true + + +indexId +false +true + + +linkName +false +true + + +name +false +true + + +onblur +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +page +false +true + + +paramId +false +true + + +paramName +false +true + + +paramProperty +false +true + + +paramScope +false +true + + +property +false +true + + +scope +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +target +false +true + + +title +false +true + + +titleKey +false +true + + +transaction +false +true + + + +messages +org.apache.struts.taglib.nested.html.NestedMessagesTag +org.apache.struts.taglib.html.MessagesTei +JSP + +id +true +true + + +bundle +false +true + + +locale +false +true + + +name +false +true + + +property +false +true + + +header +false +true + + +footer +false +true + + +message +false +true + + + +multibox +org.apache.struts.taglib.nested.html.NestedMultiboxTag + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +disabled +false +true + + +name +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +true +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +options +org.apache.struts.taglib.nested.html.NestedOptionsTag +empty + +collection +false +true + + +filter +false +true + + +labelName +false +true + + +labelProperty +false +true + + +name +false +true + + +property +false +true + + +style +false +true + + +styleClass +false +true + + + +optionsCollection +org.apache.struts.taglib.nested.html.NestedOptionsCollectionTag +empty + +filter +false +true + + +label +false +true + + +name +false +true + + +property +true +true + + +style +false +true + + +styleClass +false +true + + +value +false +true + + + +password +org.apache.struts.taglib.nested.html.NestedPasswordTag + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +disabled +false +true + + +indexed +false +true + + +maxlength +false +true + + +name +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +true +true + + +readonly +false +true + + +redisplay +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +size +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +radio +org.apache.struts.taglib.nested.html.NestedRadioTag + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +disabled +false +true + + +indexed +false +true + + +name +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +property +true +true + + +onmousedown +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +true +true + + + +select +org.apache.struts.taglib.nested.html.NestedSelectTag +JSP + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +disabled +false +true + + +indexed +false +true + + +multiple +false +true + + +name +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +true +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +size +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +submit +org.apache.struts.taglib.nested.html.NestedSubmitTag + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +disabled +false +true + + +indexed +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +text +org.apache.struts.taglib.nested.html.NestedTextTag + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +disabled +false +true + + +indexed +false +true + + +maxlength +false +true + + +name +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +true +true + + +readonly +false +true + + +size +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +textarea +org.apache.struts.taglib.nested.html.NestedTextareaTag + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +cols +false +true + + +disabled +false +true + + +indexed +false +true + + +name +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +true +true + + +readonly +false +true + + +rows +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +empty +org.apache.struts.taglib.nested.logic.NestedEmptyTag +JSP + +name +false +true + + +property +false +true + + +scope +false +true + + + +equal +org.apache.struts.taglib.nested.logic.NestedEqualTag +JSP + +cookie +false +true + + +header +false +true + + +name +false +true + + +parameter +false +true + + +property +false +true + + +scope +false +true + + +value +true +true + + + +greaterEqual +org.apache.struts.taglib.nested.logic.NestedGreaterEqualTag +JSP + +cookie +false +true + + +header +false +true + + +name +false +true + + +parameter +false +true + + +property +false +true + + +scope +false +true + + +value +true +true + + + +greaterThan +org.apache.struts.taglib.nested.logic.NestedGreaterThanTag +JSP + +cookie +false +true + + +header +false +true + + +name +false +true + + +parameter +false +true + + +property +false +true + + +scope +false +true + + +value +true +true + + + +iterate +org.apache.struts.taglib.nested.logic.NestedIterateTag +org.apache.struts.taglib.nested.logic.NestedIterateTei +JSP + +collection +false +true + + +id +false +true + + +indexId +false +true + + +length +false +true + + +name +false +true + + +offset +false +true + + +property +false +true + + +scope +false +true + + +type +false +true + + + +lessEqual +org.apache.struts.taglib.nested.logic.NestedLessEqualTag +JSP + +cookie +false +true + + +header +false +true + + +name +false +true + + +parameter +false +true + + +property +false +true + + +scope +false +true + + +value +true +true + + + +lessThan +org.apache.struts.taglib.nested.logic.NestedLessThanTag +JSP + +cookie +false +true + + +header +false +true + + +name +false +true + + +parameter +false +true + + +property +false +true + + +scope +false +true + + +value +true +true + + + +match +org.apache.struts.taglib.nested.logic.NestedMatchTag +JSP + +cookie +false +true + + +header +false +true + + +location +false +true + + +name +false +true + + +parameter +false +true + + +property +false +true + + +scope +false +true + + +value +true +true + + + +messagesNotPresent +org.apache.struts.taglib.nested.logic.NestedMessagesNotPresentTag +JSP + +name +false +true + + +property +false +true + + +message +false +true + + + +messagesPresent +org.apache.struts.taglib.nested.logic.NestedMessagesPresentTag +JSP + +name +false +true + + +property +false +true + + +message +false +true + + + +notEmpty +org.apache.struts.taglib.nested.logic.NestedNotEmptyTag +JSP + +name +false +true + + +property +false +true + + +scope +false +true + + + +notEqual +org.apache.struts.taglib.nested.logic.NestedNotEqualTag +JSP + +cookie +false +true + + +header +false +true + + +name +false +true + + +parameter +false +true + + +property +false +true + + +scope +false +true + + +value +true +true + + + +notMatch +org.apache.struts.taglib.nested.logic.NestedNotMatchTag +JSP + +cookie +false +true + + +header +false +true + + +location +false +true + + +name +false +true + + +parameter +false +true + + +property +false +true + + +scope +false +true + + +value +true +true + + + +notPresent +org.apache.struts.taglib.nested.logic.NestedNotPresentTag +JSP + +cookie +false +true + + +header +false +true + + +name +false +true + + +parameter +false +true + + +property +false +true + + +role +false +true + + +scope +false +true + + +user +false +true + + + +present +org.apache.struts.taglib.nested.logic.NestedPresentTag +JSP + +cookie +false +true + + +header +false +true + + +name +false +true + + +parameter +false +true + + +property +false +true + + +role +false +true + + +scope +false +true + + +user +false +true + + + + + + diff --git a/posterita/posterita/web/WEB-INF/struts-tiles.tld b/posterita/posterita/web/WEB-INF/struts-tiles.tld new file mode 100644 index 0000000000..657334ea94 --- /dev/null +++ b/posterita/posterita/web/WEB-INF/struts-tiles.tld @@ -0,0 +1,344 @@ + + + + + + + + + + +1.2 +1.1 +tiles +http://struts.apache.org/tags-tiles + +insert +org.apache.struts.taglib.tiles.InsertTag +JSP + +template +false +true + + +component +false +true + + +page +false +true + + +definition +false +true + + +attribute +false +false + + +name +false +true + + +beanName +false +true + + +beanProperty +false +true + + +beanScope +false +false + + +flush +false +false + + +ignore +false +true + + +role +false +true + + +controllerUrl +false +true + + +controllerClass +false +true + + + +definition +org.apache.struts.taglib.tiles.DefinitionTag +JSP + +id +true +false + + +scope +false +false + + +template +false +true + + +page +false +true + + +role +false +true + + +extends +false +true + + + +put +org.apache.struts.taglib.tiles.PutTag +JSP + +name +false +false + + +value +false +true + + +content +false +true + + +direct +false +false + + +type +false +false + + +beanName +false +true + + +beanProperty +false +true + + +beanScope +false +false + + +role +false +true + + + +putList +org.apache.struts.taglib.tiles.PutListTag +JSP + +name +true +false + + + +add +org.apache.struts.taglib.tiles.AddTag +JSP + +value +false +false + + +content +false +true + + +direct +false +false + + +type +false +false + + +beanName +false +true + + +beanProperty +false +true + + +beanScope +false +false + + +role +false +true + + + +get +org.apache.struts.taglib.tiles.GetTag +empty + +name +true +true + + +ignore +false +true + + +flush +false +false + + +role +false +true + + + +getAsString +org.apache.struts.taglib.tiles.GetAttributeTag +empty + +name +true +true + + +ignore +false +true + + +role +false +true + + + +useAttribute +org.apache.struts.taglib.tiles.UseAttributeTag +org.apache.struts.taglib.tiles.UseAttributeTei +empty + +id +false +false + + +classname +false +false + + +scope +false +false + + +name +true +true + + +ignore +false +true + + + +importAttribute +org.apache.struts.taglib.tiles.ImportAttributeTag +empty + +name +false +true + + +scope +false +false + + +ignore +false +true + + + +initComponentDefinitions +org.apache.struts.taglib.tiles.InitDefinitionsTag +empty + +file +true +false + + +classname +false +false + + + + + + diff --git a/posterita/posterita/web/WEB-INF/tiles-config_1_1.dtd b/posterita/posterita/web/WEB-INF/tiles-config_1_1.dtd new file mode 100644 index 0000000000..7568b78082 --- /dev/null +++ b/posterita/posterita/web/WEB-INF/tiles-config_1_1.dtd @@ -0,0 +1,281 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/posterita/posterita/web/WEB-INF/tiles-defs.xml b/posterita/posterita/web/WEB-INF/tiles-defs.xml new file mode 100644 index 0000000000..8b8f66691a --- /dev/null +++ b/posterita/posterita/web/WEB-INF/tiles-defs.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + diff --git a/posterita/posterita/web/WEB-INF/validator-rules.xml b/posterita/posterita/web/WEB-INF/validator-rules.xml new file mode 100644 index 0000000000..6c502f73dd --- /dev/null +++ b/posterita/posterita/web/WEB-INF/validator-rules.xml @@ -0,0 +1,287 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/posterita/posterita/web/WEB-INF/web-app_2_2.dtd b/posterita/posterita/web/WEB-INF/web-app_2_2.dtd new file mode 100644 index 0000000000..172dafa712 --- /dev/null +++ b/posterita/posterita/web/WEB-INF/web-app_2_2.dtd @@ -0,0 +1,565 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/posterita/posterita/web/WEB-INF/web-app_2_3.dtd b/posterita/posterita/web/WEB-INF/web-app_2_3.dtd new file mode 100644 index 0000000000..56bfb11dc2 --- /dev/null +++ b/posterita/posterita/web/WEB-INF/web-app_2_3.dtd @@ -0,0 +1,1059 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/posterita/posterita/web/WEB-INF/web.xml b/posterita/posterita/web/WEB-INF/web.xml new file mode 100644 index 0000000000..60154ea3f4 --- /dev/null +++ b/posterita/posterita/web/WEB-INF/web.xml @@ -0,0 +1,190 @@ + + + + + + + /C32.gif + + + Posterita Ltd Enterprise Software Platform + + + + + #AD_Client_ID + 11 + + + #AD_Language + en_US + + + #AD_Org_ID + 11 + + + #AD_User_ID + 100 + + + #C_BankAccount_ID + 100 + + + #SalesRep_ID + 100 + + + #AD_Role_ID + 103 + + + #W_Store_ID + 11 + + + #POS_ID + 100 + + + REPORT_DIRECTORY + /config/reports/ + + + + + + action + org.apache.struts.action.ActionServlet + + config + /WEB-INF/struts-config.xml + + + debug + 2 + + + detail + 2 + + 2 + + + + DisplayChart + org.jfree.chart.servlet.DisplayChart + + + + DisplayReportServlet + org.posterita.core.utils.DisplayReportServlet + + + + action + *.do + + + + + + DisplayChart + /servlet/DisplayChart + + + + DisplayReportServlet + /servlet/DisplayReportServlet/* + + + + + + + 60 + + + + + + + + + index.jsp + + + + + + + + /tags/struts-bean + /WEB-INF/struts-bean.tld + + + + /tags/struts-html + /WEB-INF/struts-html.tld + + + + /tags/struts-logic + /WEB-INF/struts-logic.tld + + + + /tags/struts-nested + /WEB-INF/struts-nested.tld + + + + /tags/struts-tiles + /WEB-INF/struts-tiles.tld + + + + + + + + ResponseOverrideFilter + org.displaytag.filter.ResponseOverrideFilter + + + + ResponseOverrideFilter + *.do + + + ResponseOverrideFilter + *.jsp + + + diff --git a/posterita/posterita/web/WEB-INF/webStore.tld b/posterita/posterita/web/WEB-INF/webStore.tld new file mode 100644 index 0000000000..6ba28aa42e --- /dev/null +++ b/posterita/posterita/web/WEB-INF/webStore.tld @@ -0,0 +1,213 @@ + + + + 1.0 + 1.2 + cws + webStore.tld + Compiere WebStore + $Id: webStore.tld,v 1.1 2005/06/23 08:33:30 vishee Exp $ + + + + requestType + org.compiere.wstore.RequestTypeTag + empty + Request Type Selection + + + + loginLink + org.compiere.wstore.LoginLinkTag + empty + Login Links + + + + checkOutLink + org.compiere.wstore.CheckOutLinkTag + empty + CheckOut Links + + oneLine + false + false + + + + + infoLink + org.compiere.wstore.InfoLinkTag + empty + Info Links + + oneLine + false + false + + + + + priceList + org.compiere.wstore.PriceListTag + empty + Initializes + loads Price List + + priceList_ID + false + false + + + + + productCategoryList + org.compiere.wstore.ProductCategoryListTag + empty + Login Links + + + + workflow + org.compiere.wstore.WorkflowTag + empty + Workflow Choices + + activityID + true + false + + + + + location + org.compiere.wstore.LocationTag + empty + Location table rows + + countryID + true + false + + + regionID + false + false + + + regionName + false + false + + + postal + false + false + + + city + true + false + + + + + message + org.compiere.wstore.MessageTag + empty + Translate Messages + + txt + true + false + + + + + tableBorder + com.tamak.webstore.util.TableBorder + JSP + + scope + false + true + + + lcTopImg + false + true + + + bgTopImg + false + true + + + rcTopImg + false + true + + + topBorderHeight + false + true + + + bgLeftImg + false + true + + + sideBorderHeight + false + true + + + borderBgColor + false + true + + + contentBgColor + false + true + + + classStyleSheet + false + true + + + bgRightImg + false + true + + + lcBtmImg + false + true + + + bgBtmImg + false + true + + + rcBtmImg + false + true + + + btmBorderHeight + false + true + + + borderWidth + false + true + + + + diff --git a/posterita/posterita/web/css/alternative.css b/posterita/posterita/web/css/alternative.css new file mode 100644 index 0000000000..c44429bdec --- /dev/null +++ b/posterita/posterita/web/css/alternative.css @@ -0,0 +1,85 @@ +/* alternative styles */ +table.its thead tr { + background-color: #69c; +} + +table.its tr.even { + background-color: #def; +} + +table.mars thead tr { + background-color: #9c9; +} + +table.mars tr.even { + background-color: #ccb; +} + +table.mars tr.odd { + background-color: #eec; +} + +table.simple thead tr th { + background-color: #eee; +} + +table.simple tr.even { + background-color: #fff; +} + +table.simple { + border: 1px solid #ccc; + border-collapse: collapse; +} + +table.simple td,table.simple th { + border: 1px solid #ccc; +} + +table.nocol tbody td,table.nocol tbody th { + border-left: none; + border-right: none; +} + +table.report td,table.report th { + font: menu; +} + +table.report th { + background: buttonface; + border-width: 1px; + border-style: solid; + border-color: threedhighlight threedshadow threedshadow threedhighlight; + cursor: hand; +} + +table.report idcol { + background: buttonface; +} + +table.report tr.even { + background-color: #399; +} + +table.report tbody { + height: 100px; + overflow: auto; +} + +table.report { + height: 120px; + overflow: auto; +} + +table.report tbody tr { + height: 10px; +} + +table.mark td.tableCellError { + background-color: #d00; + color: #fff; +} + +table.simple td.textRed { + color: #b11; +} \ No newline at end of file diff --git a/posterita/posterita/web/css/common.jsp b/posterita/posterita/web/css/common.jsp new file mode 100644 index 0000000000..6c120a1586 --- /dev/null +++ b/posterita/posterita/web/css/common.jsp @@ -0,0 +1,1688 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +/** + @author tamak + */ + + +<% +response.setContentType("text/css"); +String path = request.getContextPath() + "/"; +%> + +div.main +{ + width:100%; + text-align: center; + overflow: inherit; +} + + +#header { + background: #fff; + position:relative; + vertical-align:top; + height:30px; + width: 100%; + overflow:hidden; + text-overflow:ellipsis + + +} + +#headerTitle +{ + float:left; + margin-left:200px; + font-weight: bold; +} + +#logo{ +height:30px; +float:left; +} + +#context{ +float:right; +margin-right:50px; +height:30px; +white-space:nowrap; +overflow:hidden; +text-align:right; +text-overflow:ellipsis + +} + +#timer{ +position:relative; +vertical-align:top; +float:right; +border: 0px #E83530 solid; +background-color: #ffffff; +color: #666666; +font-size: 13px; +font-weight: bold; +} + +#actionlink +{ +position:relative; +vertical-align:top; +float:right; + +} + +#menu +{ + position:relative; + background-color: #D8D8D8; +} + +#menulink +{ + background-color: #D8D8D8; + position:relative; + width:100%; + float:right; + text-align: right; + height:20px; + overflow:hidden; + text-overflow: ellipsis; +} + + + +#content { + text-align:left; + background-color: #F4F4F4; + width: 100%; + min-height: 500px; + padding:0px; +} + +#cart td{ + text-align: left; +} + +div.container +{ + +} + +div.leftContainer +{ + width:50%; + float:left; + text-align:left; +} + +div.rightContainer +{ + width:50%; + float:right; + text-align:right; +} + + +/*#footer { + background: #D8D8D8; + clear: both; + width: 100%; +} +*/ + +/*body +{ + font-family: arial,sans-serif; + font-size: 10pt; + letter-spacing: 1px; + color: #000000; +}*/ + +#content div, #main div +{ + font-family: arial,sans-serif; + font-size: 10pt; + letter-spacing: 1px; + color: #000000; +} + +mandatory +{ + font-weight: bold; + text-align:right; + font-size:12px; + color: blue; +} + +p.loginHeader +{ + color: #666666; + font-size: 36px; + font-weight: bold; + font-family: arial,sans-serif; +} + + + +div.copyright +{ + background-color: #666666; + text-align: center; + color: #FFFFFF; + font-family: arial,sans-serif; + font-weight: bold; + font-size: 10pt; + letter-spacing: 1px; + padding: 2; +} + +/*label +{ + font-family: arial,sans-serif; + font-size: 10pt; + /*font-weight: bold;*/ + letter-spacing: 1px; + color: #000000; + padding-right: 4px; +}*/ + +label.red +{ + font-family: arial,sans-serif; + font-size: 10pt; + /*font-weight: bold;*/ + letter-spacing: 1px; + color: #E83530; +} + + + + +label.green +{ + font-family: arial,sans-serif; + font-size: 10pt; + /*font-weight: bold;*/ + letter-spacing: 1px; + color: #0A9409; +} + +td.green +{ + font-family: arial,sans-serif; + font-size: 10pt; + /*font-weight: bold;*/ + letter-spacing: 1px; + background-color: #80FFC9; +} + +td.green input +{ + visibility:hidden; +} + +td.red +{ + font-family: arial,sans-serif; + font-size: 10pt; + /*font-weight: bold;*/ + letter-spacing: 1px; + background-color: #FF9980; +} +td.blue +{ + font-family: arial,sans-serif; + font-size: 10pt; + /*font-weight: bold;*/ + letter-spacing: 1px; + background-color: #80C9FF; +} +td.yellow +{ + font-family: arial,sans-serif; + font-size: 10pt; + /*font-weight: bold;*/ + letter-spacing: 1px; + background-color: #FFE680; +} + +#messagebox div, .errormsg +{ + background-image: url("<%= path + "images/newUI/icon-err.gif" %>"); + background-repeat: no-repeat; + background-position: left center; + font-family: arial,sans-serif; + font-weight: bold; + font-size: 10pt; + letter-spacing: 1px; + padding-left: 30px; + color: #E83530; +} + +.successmsg +{ + background-image: url("<%= path + "images/pos/success.gif" %>"); + background-repeat: no-repeat; + background-position: left top; + font-family: arial,sans-serif; + font-weight: bold; + font-size: 12pt; + letter-spacing: 1px; + padding-left: 30px; + color: #008000; +} + +legend +{ + font-family: arial,sans-serif; + font-size: 10pt; + font-weight: bold; + letter-spacing: 1px; + color:#0A9409; +} + + +input.text +{ + border: solid 1px #666666; + /*font-family: arial,sans-serif;*/ + font-size: 10pt; +} + +textarea.text +{ + border: solid 1px #666666; + /*font-family: arial,sans-serif;*/ + font-size: 10pt; +} + +select.text +{ + border: solid 1px #666666; + /*font-family: arial,sans-serif;*/ + font-size: 10pt; + color: #51585F; +} + + +input.medium +{ + width:100px; +} + +input:focus +{ + background-color: #CDD4E9; + border: solid 1px #333333; +} + + +.greencolor +{ + color:#0A9409; +} + +.completecolor +{ + color:#E83530; +} + +font.pagetitle +{ + font-size: 14pt; + color: #990000; +} + +font.reporttitle +{ + font-size: 14pt; +} + +font.reportsubtitle +{ + font-size: 12pt; +} + +font +{ + font-family: arial,sans-serif; + font-size: 10pt; + font-weight: bold; + letter-spacing: 1px; + color: #555555; +} + +li.submenu +{ + list-style-image: url("<%= path + "images/pos/buttons/bullet_red.gif" %>"); + font-family: arial,sans-serif; + font-size: 10pt; + /*font-weight: bold;*/ + letter-spacing: 1px; + color: #000000; +} + +img.topmenu +{ + border-style: none; + +} + +img.button +{ + cursor:pointer; +} + +/* anchor sytles */ +/*a:hover +{ + color:#0A9409; +} +*/ +a.topmenu +{ + text-decoration: none; + border-width: 0px; + border-style: none; +} + +a.submenu +{ + text-decoration: none; + color:#666666; + font-family: arial,sans-serif; + font-size: 10pt; + letter-spacing: 1px; + font-weight: bold; +} + +a +{ + text-decoration: none; + font-family:tahoma,san-serif; + font-size: 10pt; + letter-spacing: 0px; +} + +a.forgotpassword +{ + color:#0A9409; + font-family: arial,sans-serif; + font-size: 12pt; + letter-spacing: 1px; + font-weight: bold; +} + +/* end of anchor styles */ + +/* Auto complete style */ +div.autocomplete { + position:absolute; + width:250px; + height:300px; + background-color:white; + border:1px solid #888; + margin:0px; + padding:0px; + overflow: scroll; +} + +div.autocomplete ul { + list-style-type:none; + margin:0px; + padding:0px; +} +div.autocomplete ul li.selected { background-color: #ffb;} +div.autocomplete ul li { + list-style-type:none; + display:block; + margin:0; + padding:2px; + cursor:pointer; + letter-spacing: 1px; + font-size: 10pt; + font-family:arial,sans-serif; +} +div.notfound { + background-color: #ffb; +} + +div.autocomplete2 { + position:absolute; + width:250px; + background-color:white; + border:1px solid #888; + margin:0px; + padding:0px; + overflow: auto; +} + +div.autocomplete2 ul { + list-style-type:none; + margin:0px; + padding:0px; +} +div.autocomplete2 ul li.selected { background-color: #9ACF30;} +div.autocomplete2 ul li { + list-style-type:none; + display:block; + margin:0; + padding:2px; + cursor:pointer; + letter-spacing: 1px; + font-size: 10pt; + font-family:arial,sans-serif; + text-align:left; +} + +/* tables styles */ +table.view +{ + border-collapse: collapse; + /*border: solid 1px black;*/ +} + +table.view td +{ + font-family: arial,sans-serif; + font-size: 10pt; + letter-spacing: 1px; + color: #000000; + padding: 5px 0px 5px 0px; +} + +table.layout +{ + padding-left: 10; + padding-right: 10; + padding-top: 0; + padding-bottom: 5; + + /* border:solid 1px #000000; */ +} + +table.main +{ + width: 100%; + /*border: solid 1px black;*/ + border-collapse: collapse; +} + +table.main td +{ + padding: 5px 0px 5px 0px; +} + +table.topmenu +{ + padding-left: 0; + padding-right: 0; + + /* border:solid 1px #000000; */ +} + +td.buttoncell +{ + padding-right: 0px; +} + +table.login +{ + width: 800px; + /*height: 600px;*/ + border: solid black 1px; + border-spacing: 0; +} + +table.content +{ + width: 100%; + /* border: solid 1px black; */ + border-collapse: collapse; +} + +table.content th +{ + font-family: arial,sans-serif; + font-size: 10pt; + font-weight: bold; + letter-spacing: 1px; + color: #FFFFFF; + background-color: #909090; +} + +table.content td.total +{ + font-family: arial,sans-serif; + font-size: 10pt; + font-weight: bold; + letter-spacing: 1px; + color: #FFFFFF; + background-color: #BBBBBB; +} + +table.content td +{ + font-family: arial,sans-serif; + font-size: 10pt; + letter-spacing: 1px; + font-weight: bold; + color: #000000; + padding: 5px 0px 5px 0px; + +} + +table.cart +{ + width: 100%; + /*border: solid 1px black;*/ + border-collapse: collapse; + border-spacing: 0px; + border: 0px; +} + +table.cart td +{ + font-family: arial,sans-serif; + font-size: 10pt; + letter-spacing: 1px; + font-weight: bold; + color: #000000; + padding: 5px 5px 5px 5px; +} + +table.cart th +{ + font-family: arial,sans-serif; + font-size: 10pt; + font-weight: bold; + letter-spacing: 1px; + color: #FFFFFF; + background-color: #909090; + padding: 5px 5px 5px 5px; +} + +table.cart td.total +{ + color: #FFFFFF; + background-color: #909090; +} + +table.cart td.label +{ + color: #000000; + background-color: #D8D8D8; +} + +table.cart td.contentname +{ + color: #000000; + background-color: #C9C9C9; +} + +table.content td.label +{ + font-family: arial,sans-serif; + font-size: 10pt; + letter-spacing: 1px; + font-weight: bold; + color: #000000; + background-color: #D8D8D8; +} + +table.content td.contentname +{ + font-family: arial,sans-serif; + font-size: 10pt; + letter-spacing: 1px; + font-weight: bold; + color: #ffffff; + background-color: #C9C9C9; +} + +table.orderheader td +{ + font-family: arial,sans-serif; + font-size: 10pt; + letter-spacing: 1px; + padding: 5px 0px 5px 0px; + color: #000000; +} + +/* +td.copyright +{ + height: 60px; + vertical-align: top; + padding: 0; +} +*/ + +table.display td a +{ + text-decoration: none; + color:blue; + font-family: arial,sans-serif; + font-size: 10pt; + letter-spacing: 1px; +} + +table.display +{ + width: 100%; + border-color: #000000; + border-collapse: collapse; +} + +table.display td.label +{ + /* + font-family: arial,sans-serif; + letter-spacing: 1px; + color: #000000; + */ + font-size: 8pt; + background-color: #D8D8D8; +} + +table.display td.contentname +{ + /* + font-family: arial,sans-serif; + letter-spacing: 1px; + color: #000000; + */ + font-size: 8pt; + background-color: #C9C9C9; +} + +table.display td +{ + font-family: arial,sans-serif; + font-size: 9pt; + letter-spacing: 1px; + color: #000000; + padding: 5px 5px 5px 5px; + border-color: #000000; + border-collapse: collapse; +} + +table.display th +{ + font-family: arial,sans-serif; + font-size: 9pt; + font-weight: bold; + letter-spacing: 1px; + color: #FFFFFF; + background-color: #909090; + padding: 5px 5px 5px 5px; + border-color: #000000; + border-collapse: collapse; +} + +table.displaytag +{ + border-width: 1px; + width: 100%; + border-color: #000000; + border-collapse: collapse; + border-style: solid; +} + +table.displaytag th +{ + font-family: arial,sans-serif; + font-size: 9pt; + font-weight: bold; + letter-spacing: 1px; + color: #FFFFFF; + background-color: #909090; + border-color: #000000; + padding: 5px 5px 5px 5px; + border-width: 1px; + border-style: solid; +} + +table.displaytag th a +{ + color: #FFFFFF; +} + +table.displaytag td +{ + font-family: arial,sans-serif; + font-size: 9pt; + letter-spacing: 1px; + color: #000000; + padding: 5px 5px 5px 5px; + border-color: #000000; + border-collapse: collapse; + border-width: 1px; + border-style: solid; +} + +table.displaytag td.amount +{ + font-family: arial,sans-serif; + font-size: 9pt; + letter-spacing: 1px; + color: #000000; + padding: 5px 5px 5px 5px; + border-color: #000000; + border-collapse: collapse; + border-width: 1px; + border-style: solid; + text-align: right; +} + +table.displaytag td.numeric +{ + font-family: arial,sans-serif; + font-size: 9pt; + letter-spacing: 1px; + color: #000000; + padding: 5px 5px 5px 5px; + border-color: #000000; + border-collapse: collapse; + border-width: 1px; + border-style: solid; + text-align: right; + font-weight: bold; +} + +table.displaytag td.negativenumeric +{ + font-family: arial,sans-serif; + font-size: 9pt; + letter-spacing: 1px; + padding: 5px 5px 5px 5px; + border-color: #000000; + border-collapse: collapse; + border-width: 1px; + border-style: solid; + text-align: right; + color: #FF0000; + font-weight: bold; +} + + +table.displaytag td a +{ + text-decoration: none; + color:blue; + font-family: arial,sans-serif; + font-size: 10pt; + letter-spacing: 1px; +} + +table.displaytag tr.odd +{ + border-width: 1px; + border-style: solid; + text-align: left; + background-color: #D8D8D8; +} + +table.displaytag tr.even +{ + border-width: 1px; + border-style: solid; + background-color: #C9C9C9; + text-align: left; +} + +div.exportlinks +{ + text-align: right; +} + +caption +{ + font-family: arial,sans-serif; + font-size: 12pt; + font-weight: bold; + letter-spacing: 1px; + padding: 5px 5px 5px 5px; +} +/* end of table styles */ + +/* buttons styles */ +.advanced +{ + background-image: url("<%= path + "images/pos/buttons/button_advanced.gif" %>"); +} + +.continue +{ + background-image: url("<%= path + "images/pos/buttons/button_continue.gif" %>"); +} + +.create +{ + background-image: url("<%= path + "images/pos/buttons/button_create.gif" %>"); +} + +.complete +{ + background-image: url("<%= path + "images/pos/buttons/button_complete.gif" %>"); +} + +.addtocart +{ + background-image: url("<%= path + "images/pos/buttons/button_addtocart.gif" %>"); +} + +.newcustomer +{ + background-image: url("<%= path + "images/pos/buttons/button_newcustomer.gif" %>"); +} + +.checkout +{ + background-image: url("<%= path + "images/pos/buttons/button_checkout.gif" %>"); +} + +.delete +{ + background-image: url("<%= path + "images/pos/buttons/button_delete.gif" %>"); +} + +.neworder +{ + background-image: url("<%= path + "images/pos/buttons/button_neworder.gif" %>"); +} +.newnote +{ + background-image: url("<%= path + "images/pos/buttons/button_newnote.gif" %>"); +} + +.cash +{ + background-image: url("<%= path + "images/pos/buttons/button_cash.gif" %>"); +} + +.card +{ + background-image: url("<%= path + "images/pos/buttons/button_card.gif" %>"); +} + +.cheque +{ + background-image: url("<%= path + "images/pos/buttons/button_cheque.gif" %>"); +} + +.mixed +{ + background-image: url("<%= path + "images/pos/buttons/button_mixed.gif" %>"); +} + +.save +{ + background-image: url("<%= path + "images/pos/buttons/button_save.gif" %>"); +} + +.search +{ + background-image: url("<%= path + "images/pos/buttons/button_search.gif" %>"); +} + +.edit +{ + background-image: url("<%= path + "images/pos/buttons/button_edit.gif" %>"); +} + +.tangoSearch +{ + background-image: url("<%= path + "images/tango/system-search.png" %>"); + margin-top: -3px; +} + +.selectall +{ + background-image: url("<%= path + "images/pos/buttons/button_selectall.gif" %>"); +} + +.submit +{ + background-image: url("<%= path + "images/pos/buttons/button_submit.gif" %>"); +} + +.refresh +{ + background-image: url("<%= path + "images/pos/buttons/button_refresh.gif" %>"); +} + +.piechart +{ + background-image: url("<%= path + "images/pos/buttons/button_piechart.gif" %>"); +} + +.barchart +{ + background-image: url("<%= path + "images/pos/buttons/button_barchart.gif" %>"); +} + +.timeseries +{ + background-image: url("<%= path + "images/pos/buttons/button_timeseries.gif" %>"); +} + +.tabular +{ + background-image: url("<%= path + "images/pos/buttons/button_tabular.gif" %>"); +} + +.saveascsv +{ + background-image: url("<%= path + "images/pos/buttons/button_saveascsv.gif" %>"); +} + +.saveaspdf +{ + background-image: url("<%= path + "images/pos/buttons/button_saveaspdf.gif" %>"); +} + +.blank +{ + background-image: url("<%= path + "images/pos/buttons/button_blank.gif" %>"); +} + +.bigbutton +{ + background-repeat: no-repeat; + cursor: pointer; + border: 0px; + width: 127px; + height: 42px; + font-family: arial,sans-serif; + font-size: 12pt; + letter-spacing: 1px; + font-weight: bolder; + color: #666666; + padding: 0px; +} + +.smallbutton +{ + background-repeat: no-repeat; + cursor: pointer; + border: 0px; + width: 87px; + height: 42px; + font-family: arial,sans-serif; + font-size: 12pt; + letter-spacing: 1px; + font-weight: bolder; + color: #666666; + padding: 0px; +} + +.tangoButton +{ + background-repeat: no-repeat; + cursor: pointer; + border: 0px; + width: 32px; + height: 32px; + font-family: arial,sans-serif; + letter-spacing: 1px; + font-weight: bolder; + v-align:middle; + background-color:transparent; +} + +/* end of buttons styles */ + +div.space +{ + height:10px; + /* + border: solid 1px black; + background-color: #0000FF; + */ +} + +span.link +{ + cursor:pointer; + font-family: arial,sans-serif; + font-size: 10pt; + letter-spacing: 1px; + color: #0A9409; +} + +span.shortcutkey +{ + padding:0px 4px; + /*float:left;*/ +} + +span.shortcutkey label +{ + font-size: 10pt; + padding-right: 0px; +} + +span.shortcutkey label.red +{ + padding-left: 0px; +} + +/* Shopping Cart */ +div#shoppingCart +{ +/* + height:200; + overflow:auto; + border: solid 1px #555555; +*/ +} + +table.scroll +{ + border-color: #000000; + border-collapse: collapse; +} + +table.scroll td.label +{ + background-color: #D8D8D8; +} + +table.scroll td.contentname +{ + background-color: #C9C9C9; +} + +table.scroll td +{ + font-family: arial,sans-serif; + font-size: 9pt; + letter-spacing: 1px; + color: #000000; + padding: 5px 5px 5px 5px; + border-color: #000000; + border-collapse: collapse; +} + +table.scroll th +{ + font-family: arial,sans-serif; + font-size: 9pt; + font-weight: bold; + letter-spacing: 1px; + color: #FFFFFF; + background-color: #909090; + padding: 5px 5px 5px 5px; + border-color: #000000; + border-collapse: collapse; +} + +table.scroll a +{ + font-family: arial,sans-serif; + font-size: 9pt; +} + +table.popup +{ + background-color: #FFFFFF; + border: solid 1px #000000; +} + +table.popup td +{ + font-family: arial,sans-serif; + font-size: 9pt; + letter-spacing: 1px; + color: #000000; + padding: 5px 5px 5px 5px; + border-color: #000000; + border-collapse: collapse; +} + +div.popup +{ + font-family: arial,sans-serif; + font-size: 9pt; + letter-spacing: 1px; + position:absolute; + display:none; + background-color:#FFFFFF; +} + + +table.cart td.label div.popupDiv:hover +{ + background-color:#CDD4E9;; +} + +table.cart td.contentname div.popupDiv:hover +{ + background-color:#CDD4E9; +} + +/* +table.cart tr.popup:hover td.label,td.contentname +{ + background-color:#CDD4E9; +} +*/ + +table.report +{ + border-color: #000000; + border-collapse: collapse; + font-family: arial,sans-serif; + font-size: 9pt; + letter-spacing: 1px; +} + +table.cart tbody +{ +/* + style="height:200px; + overflow:auto"; +*/ +} + +.border +{ + border:solid 1px #000000; +} + +.error +{ + background-color:#E83530; + border:solid 1px #000000; +} + +div.scrollpane +{ + overflow:auto; + /*height:500px;*/ +} + + +table.numericpad td +{ + text-align:center; + v-align:middle; +} + +div.key +{ + width:50px; + height:50px; + border:solid 1px #000000; + cursor:pointer; + text-align:center; + vertical-align: middle; + font-family: arial,sans-serif; + font-size: 14pt; + font-weight:bold; +} + +a.button +{ + text-decoration: none; + cursor: pointer; + border: 0px; + font-family: arial,sans-serif; + font-size: 10pt; + letter-spacing: 1px; + font-weight: bolder; + color: #606760; + padding: 2px 4px 2px 4px; + border:solid 1px #000000; + text-align:center; + background-color: #F2F2F2; +} + +a.button:hover +{ + background-color: #D8D8D8; +} + +div#PINPanel +{ + border:solid 2px #000000; + z-index:1000; + height:120px; + width:200px; + background-color: #F2F2F2; + padding: 4px; + display:none; +} + +div#divBack +{ + background-image: url("<%= path + "images/pos/maskBG.png" %>"); + filter: alpha(opacity=40); +} + +span.draftedcolor +{ + color:red; +} + +div.draftedcolor +{ + color:red; +} + +div.completecolor +{ + color:green; +} + +div.inprogresscolor +{ + color:yellow; +} + +div.closed +{ + color:blue; +} + +div.negativecolor +{ + color:red; +} +div.nomalcolor +{ + color:black; +} + +div#keyboard{ + position:absolute; + background-color: #FFFFFF; + border:solid 1px #000000; + z-index:3000; + display:none; +} + +div#uppercase{ + display:none; +} + +div#lowercase{ + display:block; +} + +div.keyboardHandler{ + background-color:#777777; + height:20px; + cursor:move; +} + +table.keyboard{ + background-color: #FFFFFF; +} + +table.keyboard td{ + vertical-align:middle; + text-align:center; + width:50px; + height:50px; + border:solid 1px #444444; + background-color: #FFFFFF; + cursor:pointer; + background-color:#F4F4F4; + font-family: arial,sans-serif; + font-size: 13pt; + letter-spacing: 1px; + font-weight: bolder; + color: #000000; +} + +table.keyboard td:hover{ + background-color:#FFFFFF; +} + +img#keyboardicon{ + display:none; + cursor: pointer; +} + +div.tooltip{ + width:200px; + z-index:1000; + background-color:#FDFDDB; + position:absolute; + border: solid 1px #000000; + padding:4px; + font-color:#333333; + font-size:10pt; +} + +div.pager{ + //border: dashed 1px #000000; + padding:4px; + font-color:#333333; + font-size:10pt; + text-align:center; +} + +.pager label{ + color: #51585F; + font-weight: normal; + font-family: Verdana,Arial,Helvetica,san-serif; +} + +div.button { + float:left; + border:solid 1px #333333; + margin-right: 4px; + margin-top: 4px; + margin-bottom: 4px; + padding:6px; + font-size:14px; + font-weight: bold; + font-family: Verdana, Arial, Helvetica, sans-serif; + color:#FFFFFF; + background-color:#333333; + cursor:pointer; +} + +div.pager a{ + font-color:#333333; + font-size:10pt; + text-decoration:none; +} + +span.menu{ + text-decoration: none; + color:#000000; + padding:1px; + font-family: arial,sans-serif; + font-size: 10pt; + letter-spacing: 1px; + font-weight: bold; +} + +a.nodecoration:active,a.nodecoration:visited{ + text-decoration:none; +} + +fieldset.submenu{ + height:165px; +} + +.newbutton{ + background-repeat: repeat-x; + cursor: pointer; + font-family: verdana,arial,sans-serif; + font-size: 11pt; + font-weight:bold; + letter-spacing: 1px; + font-weight: bolder; + color: #666666; + height: 42px; + /*min-width:87px;*/ + background-image: url("<%= path + "images/pos/buttons/button_middle.gif" %>"); + border-left: solid 1px #9b9b9b; + border-right: solid 1px #9b9b9b; + border-top-width: 0px; + border-bottom-width: 0px; + padding-left:4px; + padding-right:4px; +} + +fieldset#createcustomer{ + height:150px; +} + +/* +.searchBox{ + background-image:url("<%= path + "images/pos/magnifying-glass.gif" %>"); + background-repeat:no-repeat; + padding-left:20px; +} +*/ + +span.drafted +{ + color:red; +} + +span.completed +{ + color:green; +} + +span.inprogress +{ + color:yellow; +} + +span.closed +{ + color:blue; +} + +div#errorbox +{ + background-color:CC1515; + border: solid 1px #D41616; + padding: 4px; +} + +div#msgbox +{ + background-color:#E6F3D8; + border: solid 1px #75D416; + padding: 4px; +} + +/***************************************************************************/ +div.popupwindow{ + display:inline; + position:absolute; + z-index:1000; + border: solid 1px #636363; + padding:0px; + visibility:hidden; +} + +div.popupwindow div{ + padding:4px; +} + +div.popupwindow div.title{ + color:#FFFFFF; + background:#ACACAC; + font-weight:bold; + /*font-size:13pt;*/ +} + +div.popupwindow div.footer{ + background:#EDEDED; + text-align:right; + background:#ACACAC; +} + +div.popupwindow div.messagebody{ + background:#EDEDED; +} + +div.popupwindow div.footer a{ + font-size:10pt; +} + +div#tenderPanel{ + /*height:170px;*/ + width:300px; +} + +div#customerInfoPanel{ + width:400px; +} + +div.disableMask +{ + background-image: url("<%= path + "images/pos/maskBG.png" %>"); + filter: alpha(opacity=40); +} + +div.ajaxindicator +{ + width:150px; + padding:10px; + border:solid 1px #000000; + background-color:#FFFFFF; + /*background-image: url("<%= path + "images/ajax-indicators/indicator.gif" %>");*/ + background-repeat:no-repeat; + background-position:left center; + padding-left:20px; + +} + +.redcolor +{ + color:#E83530; +} + +td.loginHeader +{ + height: 210px; + width: 800px; + background-image: url("<%= path + "images/pos/logo.jpg" %>"); + background-position:center center; + background-repeat:no-repeat; +} + +td.headerLogo +{ + background-image: url("<%= path + "images/pos/logo.gif" %>"); + background-position:top left; + background-repeat:no-repeat; + height: 40px; + width: 320px; +} + +td.headerDetails +{ + vertical-align: top; + background-color:#EEEEEE; +} + +a.sortheader +{ + color:#000; +} + +input.calendar-icon +{ + width: 28px; + height: 22px; + background-image: url("<%= path + "images/pos/calendar.gif" %>"); +} + +.floatleft +{ + float: left; + display: block; + padding: 0px 2px; +} + +#footerContainer{ + position: relative; +} + +.footer{ +background: #9A9A9A url("../images/newUI/footerbg.gif") repeat-x; +padding: 8px; +margin: 0; +height: 41px; +color: #FFFFFF; +font-family: tahoma, san-serif; +font-size: 11px; +font-weight: bold; +border-top: #FFFFFF solid 1px; +position: relative; +} + +.roleButton{ + background: url("../images/newUI/pricedetbg.gif") repeat; + border: 1px solid #FFF; + line-height: 15px; + float: left; + height: 15px; + width: 90px; + font-family: tahoma, san-serif; + font-weight: normal; + color: #FFF; + padding-top: 0px; + padding-bottom: 0px; + vertical-align: middle; + text-align: center; + cursor: pointer; + margin-left: 15px; + margin-top: 1px; +} + +.buttonLabel{ + font-family: tahoma, san-serif; + font-weight: normal; + color: #FFF; +} + +.button span{ + color: #FFFFFF; +} + +#remainingDetailsBtn, #remainingDetailsBtn1, #switchBack, #switchBack1{ + + float: right; +} + +#previousFirst div { + float:left; +} + +#previousFirst span{ + float: right; +} + +#nextLast div{ + float: right; +} + +#nextLast span{ + float:left; +} + +#nextLast{ + margin-top: -17px; +} + +.pagerContainer{ + border-top: solid 1px #FFFFFF; + font-family:tahoma,san-serif; + background: #9A9A9A +} + +.pagerContainer a{ + color: #669ACF; +} diff --git a/posterita/posterita/web/css/displaytag.css b/posterita/posterita/web/css/displaytag.css new file mode 100644 index 0000000000..a77fc712df --- /dev/null +++ b/posterita/posterita/web/css/displaytag.css @@ -0,0 +1,147 @@ + +table { + border: 0px solid #666; + width: 100%; + margin: 20px 0 20px 0 !important; +} + + +th,td { + padding: 2px 4px 2px 4px !important; + text-align: left; + vertical-align: top; +} + +thead tr { + background-color: #fc0; +} + +th.sorted { + background-color: orange; +} + +th a,th a:visited { + color: black; +} + +th a:hover { + text-decoration: underline; + color: black; +} + +th.sorted a,th.sortable a { + background-position: right; + display: block; + width: 100%; +} + +th.sortable a { + background: transparent url(../images/pos/arrow_off.png) no-repeat right; + +} + +th.order1 a { + background: transparent url(../images/pos/arrow_down.png) no-repeat right; + +} + +th.order2 a { + background: transparent url(../images/pos/arrow_up.png) no-repeat right; + +} + +tr.odd { + background-color: #fff +} + +tr.tableRowEven,tr.even { + background-color: #fea +} + +div.exportlinks { + background-color: #eee; + border: 1px dotted #999; + padding: 2px 4px 2px 4px; + margin: 2px 0 10px 0; + width: 100%; +} + +span.export { + padding: 0 4px 1px 20px; + display: inline; + display: inline-block; + cursor: pointer; +} + +span.excel { + background: transparent url(../images/pos/ico_file_excel.png) no-repeat; +} + +span.csv { + background: transparent url(../images/pos/ico_file_csv.png) no-repeat; +} + +span.xml { + background: transparent url(../images/pos/ico_file_xml.png) no-repeat; +} + +span.pdf { + background: transparent url(../images/pos/ico_file_pdf.png) no-repeat; +} + +span.rtf { + background: transparent url(../images/pos/ico_file_rtf.png) no-repeat; +} + +span.pagebanner { + background-color: #eee; + border: 1px dotted #999; + padding: 2px 4px 2px 4px; + width: 100%; + margin-top: 10px; + display: block; + border-bottom: none; +} + +span.pagelinks { + background-color: #eee; + border: 1px dotted #999; + padding: 2px 4px 2px 4px; + width: 100%; + display: block; + border-top: none; + margin-bottom: -5px; +} + + +.group-1 { + font-weight:bold; + padding-bottom:10px; + border-top:1px solid black; +} +.group-2 { + font-style:italic; + border-top: 1px solid black; + +} +.subtotal-sum, .grandtotal-sum { + font-weight:bold; + text-align:right; +} +.subtotal-header { + padding-bottom: 0px; + border-top: 1px solid white; +} +.subtotal-label, .grandtotal-label { + border-top: 1px solid white; + font-weight: bold; +} +.grouped-table tr.even { + background-color: #fff; +} +.grouped-table tr.odd { + background-color: #fff; +} +.grandtotal-row { + border-top: 2px solid black; +} diff --git a/posterita/posterita/web/css/frame.css b/posterita/posterita/web/css/frame.css new file mode 100644 index 0000000000..6af85573d8 --- /dev/null +++ b/posterita/posterita/web/css/frame.css @@ -0,0 +1,30 @@ +/* Send link +============================== */ + +MB_content fieldset input { + float: left; + margin: 0.5em 0; + font: 100%/1.2 Arial, Helvetica, Geneva, sans-serif; +} +#MB_content fieldset textarea { + width: 98%; + margin: 0 0 0.5em; + color: #666; + font: 100%/1.2 Arial, Helvetica, Geneva, sans-serif; +} +#MB_content fieldset label { + float: left; + padding-bottom: .25em; + margin: 0.5em 0; + width: 100px; +} +#MB_content fieldset label.long { width: 100%; } +#MB_content br { clear: both } + +#MB_content .error-msg { + padding: .5em; + color: #FFF; + font-weight: bold; + background-color: #C30; + border: 1px solid #930; +} \ No newline at end of file diff --git a/posterita/posterita/web/css/global.css b/posterita/posterita/web/css/global.css new file mode 100644 index 0000000000..9f66e3253a --- /dev/null +++ b/posterita/posterita/web/css/global.css @@ -0,0 +1,390 @@ +body { + padding:0; + margin:0; + font:12px Arial, Helvetica, sans-serif; + line-height:130%; + color:#333; + text-align:center; + background:#FFF; + font-size:x-small; + voice-family: "\"}\""; + voice-family: inherit; + font-size:small; +} + + +/* General definitions */ +a { color:#06C; } +a:visited { color:#A9D; } +a:hover { color:#C63 } +a img { border:0px solid } + +h2 { + margin:1.5em 0 .5em; + font-size:135%; + font-weight:normal; + color:#000; +} +h3 { + font-size:115%; + color:#666; +} + +p { + margin:.75em 0; + line-height:1.5; +} + +ol li, ul li { margin:.5em 0; } +ul li { list-style:square; } + +code { + padding: .15em; + font: 100% "Monaco", "Courier New", Courier, monospace; + border-bottom: 1px dotted #FFCC66; + background-color: #FFFFCC; +} + +pre { + margin: .5em 0; + padding: .5em; + font: 100% "Monaco", "Courier New", Courier, monospace; + border: 1px solid #D3DAE4; + background-color: #F4F6F8; + width: 97%; + overflow: auto; +} + +/* General Layout */ +#page { + position:relative; + margin:0 auto; + text-align:left; + width:700px; +} + +#container { + position:relative; + background:#FFF; + z-index:1; +} +#container:after { + content: "."; + display: block; + height: 0; + clear: both; + visibility: hidden; +} +/* Hides from IE-mac \*/ +* html #container { height: 1%; } +/* End hide from IE-mac */ + + +.xtop, .xbottom {display:block; background:transparent; font-size:1px; } +.xb1, .xb2, .xb3, .xb4 {display:block; overflow:hidden;} +.xb1, .xb2, .xb3 {height:1px;} +.xb2, .xb3, .xb4 {background:#F4F6F8; border-left:1px solid #D3DAE4; border-right:1px solid #D3DAE4;} +.xbottom .xb2, .xbottom .xb3, .xbottom .xb4 {background:#FFF;} +.xb1 {margin:0 5px; background:#D3DAE4;} +.xb2 {margin:0 3px; border-width:0 2px;} +.xb3 {margin:0 2px;} +.xb4 {height:2px; margin:0 1px; } + +.xboxcontent { + background:#FFF; + border:1px solid #D3DAE4; + border-top:0 solid; + border-bottom:1px solid #FFF; +} +.block-content { + border:0px solid; + background:none; +} + +/* Badge */ +#badge { + position: absolute; + top: 0; + right: 0; + width: 111px; + height: 114px; + background: url(../images/newversion-badge.gif) 0 0 no-repeat; +} + #badge * { display: none; } + +/* Header section */ +#header { + position:relative; + margin:30px 10px; + text-align:center; + overflow: hidden; + //height: 1%; +} + +/* Wildbit Logotype */ +#wildbit { + float: left; + margin:0 18px 0 0; + padding:0 18px 0 18px; + width:96px; + height:57px; + border-right: 1px solid #CCC; + overflow:hidden; +} + #wildbit a { + position:relative; + display:block; + width:96px; + height:57px; + } + #wildbit a span { + position:absolute; + left:0; top:0; + display:block; + width:96px; + height:57px; + background:url(../images/wildbit-logo.gif) left top no-repeat; + } + + +/* Columns wrappers */ +.twocolwrapper { clear:both; margin:0; width:100%; overflow:hidden; } +html>body .twocolwrapper { width:auto; border-top:1px solid #FFF; } + +.twocolwrapper .firstcol { + float:left; + width:59%; +} +.twocolwrapper .secondcol { + margin:0 0 0 60%; + padding:0; + width:100%; + voice-family: "\"}\""; + voice-family: inherit; + width:39%; +} +html>body .twocolwrapper .secondcol { width:40%; overflow:visible; } + + +/* Content Area */ +#content { + margin: 0 28px; + padding-bottom: 2em; +} + +.new { + padding:.15em .35em; + font-size:85%; + font-style:italic; + background-color:#CBE564; +} +.note { + font-style:italic; +} + +/* Demo buttons */ +.demo-hint { + padding-left: .5em; + line-height: 2.5em; + color: #999; +} + +a.demo-btn { + display: block; + float: left; + font-weight: bold; + text-decoration: none; + text-shadow: #FFF 2px 2px 0; + color: #000!important; + background: url('../images/btn-demo-l.gif') 0 0 no-repeat; +} +a.demo-btn:hover { text-decoration: underline; } + a.demo-btn span { + display: block; + padding: 8px 15px 12px 34px; + background: url('../images/btn-demo-r.gif') 100% 0 no-repeat; + } + +ul#features { + padding:0; + margin:1em 0; +} + #features li { + margin:1em 0; + padding-left:18px; + font-size: 90%; + list-style:none; + background:url(../images/bul-feature.gif) 0 0 no-repeat; + } + +/* Download block */ +.download { + position: relative; + padding: 1em 1em 1em 28px; + background: #F4F6F8; + //height: 1%; +} + .download .download-lnk { + margin-right: 270px; + + } + .download .download-lnk h2 { + position: relative; + margin: 0; + padding: 1em 0 .75em; + font-weight: bold; + } + .download .download-lnk h2 a { + display: block; + position: absolute; + left: -52px; top: 0; + margin: 0; + padding: 1em 0 .75em 52px; + background: url(../images/download.gif) 0 0 no-repeat; + } + + /* Donate form section */ + .form-donate { + margin: 0; + padding: 0; + margin-left: -14px; + } + .form-donate .xtop, .form-donate .xbottom {display:block; background:transparent; font-size:1px; } + .form-donate .xb1, .form-donate .xb2, .form-donate .xb3, .form-donate .xb4 {display:block; overflow:hidden;} + .form-donate .xb1, .form-donate .xb2, .form-donate .xb3 {height:1px;} + .form-donate .xb2, .form-donate .xb3, .form-donate .xb4 {background:#FCFCFF; border-left:1px solid #FCFCFF; border-right:1px solid #FCFCFF;} + .form-donate .xbottom .xb2, .form-donate .xbottom .xb3, .form-donate .xbottom .xb4 {background:#FCFCFF;} + .form-donate .xb1 {margin:0 5px; background:#FCFCFF;} + .form-donate .xb2 {margin:0 3px; border-width:0 2px;} + .form-donate .xb3 {margin:0 2px;} + .form-donate .xb4 {height:2px; margin:0 1px; } + + .form-donate .xboxcontent { + padding: .25em 1em; + margin: 0; + color: #000; + border: 1px solid #FCFCFF; + border-width: 0px 1px 0 1px; + background-color: #FCFCFF; + } + .form-donate p { + margin: 0; + padding: 0; + } + .form-donate .secondcol input { margin-left: 6px; } + /* Huge demo button */ + .download .demo-btn { + position: absolute; + float: none; + left: 416px; top: 20px; + width: 182px; + height: 67px; + background: url(../images/button-demo.gif) 0 0 no-repeat; + } + .download .demo-btn span { + display: block; + text-indent: -2000px; + background-image: none; + } + +/* Demos */ +.warning { + padding: .5em .5em 1em 28px; + font-weight: bold; + background: url('../images/warn.gif') 0 15px no-repeat; +} + +/* Google Code Block */ +#gcode { + padding-left: 110px; + background: url('../images/google-logo.png') 0 0 no-repeat; + +} + +/* Annouce balloon block */ +.balloon { + position: relative; + margin: -20px 0 20px; +} + + .balloon .xtop, .balloon .xbottom {display:block; background:transparent; font-size:1px; } + .balloon .xb1, .balloon .xb2, .balloon .xb3, .balloon .xb4 {display:block; overflow:hidden;} + .balloon .xb1, .balloon .xb2, .balloon .xb3 {height:1px;} + .balloon .xb2, .balloon .xb3, .balloon .xb4 {background:#FFFFEC; border-left:1px solid #EEC; border-right:1px solid #EEC;} + .balloon .xbottom .xb2, .balloon .xbottom .xb3, .balloon .xbottom .xb4 {background:#FFFFEC;} + .balloon .xb1 {margin:0 5px; background:#EEC;} + .balloon .xb2 {margin:0 3px; border-width:0 2px;} + .balloon .xb3 {margin:0 2px;} + .balloon .xb4 {height:2px; margin:0 1px; } + + .balloon .xarrow { + position: relative; + top: 1px; left: 70px; + width: 15px; + height: 16px; + } + .balloon .xarrow b { + display: block; + background:#FFFFEC; + border-left:1px solid #EEC; + border-right:1px solid #EEC; + font-size:1px; + height: 2px; + } + .balloon .xarrow .a1 { margin: 0 7px; background-color: #EEC; border: 0 solid; width: 1px; } + .balloon .xarrow .a2 { width: 1px; margin: 0 6px;} + .balloon .xarrow .a3 { width: 3px; margin: 0 5px;} + .balloon .xarrow .a4 { width: 5px; margin: 0 4px;} + .balloon .xarrow .a5 { width: 7px; margin: 0 3px;} + .balloon .xarrow .a6 { width: 9px; margin: 0 2px;} + .balloon .xarrow .a7 { width: 11px; margin: 0 1px;} + .balloon .xarrow .a8 { width: 13px; margin: 0;} + + .balloon .xboxcontent { + padding: .25em 27px; + margin: 0; + color: #000; + font-size: 135%; + border: 1px solid #EEC; + border-width: 0px 1px 0 1px; + background-color: #FFFFEC; + } + .balloon .xboxcontent a:link, + .balloon .xboxcontent a:visited { + display: block; + padding: .5em 0; + color: #000; + text-decoration: none; + } + .balloon .xboxcontent a:hover { + color: #C63; + text-decoration: underline; + } + + + +/* Footer Section */ +#footer { + margin-top:10px; + font-size:85%; + color:#99C; + text-align:center; +} + +/* Clear */ +.clear { + clear: both; + margin: 0; + padding: 0; + font-size: 1px; +} + +/* Hire us badge */ +.label-hire { + position: absolute; + margin: 0; + padding: 0; + top: 0; + left: 0; + z-index: 1010; +} \ No newline at end of file diff --git a/posterita/posterita/web/css/inventory.css b/posterita/posterita/web/css/inventory.css new file mode 100644 index 0000000000..2853b2e4eb --- /dev/null +++ b/posterita/posterita/web/css/inventory.css @@ -0,0 +1,118 @@ +div#status{ + font-size: 12px; + font-weight: bold; +} +div#uploadCsv{ + height: 150px; + font-size: 14px; + font-weight: bold; + border-top: solid 1px #000; + border-bottom: solid 1px #000; +} + +div#priceLists{ + font-size: 10px; + font-weight: bold; + border-top: solid 1px #000; + border-left: solid 1px #000; + border-right: solid 1px #000; + border-bottom: solid 1px #000; + background-color: #dddddd; +} + +select#priceList{ + font-size: 10px; + font-weight: bold; + border-top: solid 1px #000; + border-left: solid 1px #000; + border-right: solid 1px #000; + border-bottom: solid 1px #000; + background-color: #ffffff +} + + + +.descButton { + float:left; + border:solid 1px #333333; + margin-right: 4px; + margin-top: 4px; + margin-bottom: 4px; + padding:6px; + font-size:8px; + font-weight: bold; + font-family: Verdana, Arial, Helvetica, sans-serif; + color:#FFFFFF; + background-color:#333333; + cursor:pointer; +} + +.upbutton { + float:left; + border:solid 1px #333333; + margin-right: 4px; + margin-top: 4px; + margin-bottom: 4px; + padding:6px; + font-size:10px; + font-weight: bold; + font-family: Verdana, Arial, Helvetica, sans-serif; + color:#FFFFFF; + background-color:#333333; + cursor:pointer; +} + +div#detailsInfo label{ + width : 190px; + display:block; + /*border: solid 1px #000;*/ + float:left; +} + +div#invDescription label{ + width : 100px; + display:block; + font-size: 12px; + float:left; +} + +/* Sortable tables */ +table.sortable thead { + background-color:#eee; + color:#666666; + font-weight: bold; + cursor: default; +} + +.highlighted { background: yellow; } + +.box .filter { display: none; } + + +div.popup { + max-width: 600px; + border: 1px solid red; + padding: 5px; + background-color: white; + /* The following properties should not be changed */ + position: absolute; +} +.popup_overlay { + background-color: #000000; + /* The following properties should not be changed */ + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 500px; + z-index:9999; +} + +span.popup_link, a.popup_link { + cursor: pointer; + border-bottom: 1px dotted; +} + +.popup_draghandle { + cursor: move; +} diff --git a/posterita/posterita/web/css/js-calendar/calendar-win2k-1.css b/posterita/posterita/web/css/js-calendar/calendar-win2k-1.css new file mode 100644 index 0000000000..e7c888c6aa --- /dev/null +++ b/posterita/posterita/web/css/js-calendar/calendar-win2k-1.css @@ -0,0 +1,296 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +/** + @author tamak + */ + + +/* The main calendar widget. DIV containing a table. */ + +.calendar { + position: relative; + display: none; + border-top: 2px solid #fff; + border-right: 2px solid #000; + border-bottom: 2px solid #000; + border-left: 2px solid #fff; + font-size: 11px; + color: #000; + cursor: default; + background: #d4d0c8; + font-family: tahoma,verdana,sans-serif; +} + +.calendar table { + border-top: 1px solid #000; + border-right: 1px solid #fff; + border-bottom: 1px solid #fff; + border-left: 1px solid #000; + font-size: 11px; + color: #000; + cursor: default; + background: #d4d0c8; + font-family: tahoma,verdana,sans-serif; +} + +/* Header part -- contains navigation buttons and day names. */ + +.calendar .button { /* "<<", "<", ">", ">>" buttons have this class */ + text-align: center; + padding: 1px; + border-top: 1px solid #fff; + border-right: 1px solid #000; + border-bottom: 1px solid #000; + border-left: 1px solid #fff; +} + +.calendar .nav { + background: transparent url(menuarrow.gif) no-repeat 100% 100%; +} + +.calendar thead .title { /* This holds the current "month, year" */ + font-weight: bold; + padding: 1px; + border: 1px solid #000; + background: #848078; + color: #fff; + text-align: center; +} + +.calendar thead .headrow { /* Row containing navigation buttons */ +} + +.calendar thead .daynames { /* Row containing the day names */ +} + +.calendar thead .name { /* Cells containing the day names */ + border-bottom: 1px solid #000; + padding: 2px; + text-align: center; + background: #f4f0e8; +} + +.calendar thead .weekend { /* How a weekend day name shows in header */ + color: #f00; +} + +.calendar thead .hilite { /* How do the buttons in header appear when hover */ + border-top: 2px solid #fff; + border-right: 2px solid #000; + border-bottom: 2px solid #000; + border-left: 2px solid #fff; + padding: 0px; + background-color: #e4e0d8; +} + +.calendar thead .active { /* Active (pressed) buttons in header */ + padding: 2px 0px 0px 2px; + border-top: 1px solid #000; + border-right: 1px solid #fff; + border-bottom: 1px solid #fff; + border-left: 1px solid #000; + background-color: #c4c0b8; +} + +/* The body part -- contains all the days in month. */ + +.calendar tbody .day { /* Cells containing month days dates */ + width: 2em; + text-align: right; + padding: 2px 4px 2px 2px; +} +.calendar tbody .day.othermonth { + font-size: 80%; + color: #aaa; +} +.calendar tbody .day.othermonth.oweekend { + color: #faa; +} + +.calendar table .wn { + padding: 2px 3px 2px 2px; + border-right: 1px solid #000; + background: #f4f0e8; +} + +.calendar tbody .rowhilite td { + background: #e4e0d8; +} + +.calendar tbody .rowhilite td.wn { + background: #d4d0c8; +} + +.calendar tbody td.hilite { /* Hovered cells */ + padding: 1px 3px 1px 1px; + border-top: 1px solid #fff; + border-right: 1px solid #000; + border-bottom: 1px solid #000; + border-left: 1px solid #fff; +} + +.calendar tbody td.active { /* Active (pressed) cells */ + padding: 2px 2px 0px 2px; + border-top: 1px solid #000; + border-right: 1px solid #fff; + border-bottom: 1px solid #fff; + border-left: 1px solid #000; +} + +.calendar tbody td.selected { /* Cell showing selected date */ + font-weight: bold; + border-top: 1px solid #000; + border-right: 1px solid #fff; + border-bottom: 1px solid #fff; + border-left: 1px solid #000; + padding: 2px 2px 0px 2px; + background: #e4e0d8; +} + +.calendar tbody td.weekend { /* Cells showing weekend days */ + color: #f00; +} + +.calendar tbody td.today { /* Cell showing today date */ + font-weight: bold; + color: #00f; +} + +.calendar tbody .disabled { color: #999; } + +.calendar tbody .emptycell { /* Empty cells (the best is to hide them) */ + visibility: hidden; +} + +.calendar tbody .emptyrow { /* Empty row (some months need less than 6 rows) */ + display: none; +} + +/* The footer part -- status bar and "Close" button */ + +.calendar tfoot .footrow { /* The in footer (only one right now) */ +} + +.calendar tfoot .ttip { /* Tooltip (status bar) cell */ + background: #f4f0e8; + padding: 1px; + border: 1px solid #000; + background: #848078; + color: #fff; + text-align: center; +} + +.calendar tfoot .hilite { /* Hover style for buttons in footer */ + border-top: 1px solid #fff; + border-right: 1px solid #000; + border-bottom: 1px solid #000; + border-left: 1px solid #fff; + padding: 1px; + background: #e4e0d8; +} + +.calendar tfoot .active { /* Active (pressed) style for buttons in footer */ + padding: 2px 0px 0px 2px; + border-top: 1px solid #000; + border-right: 1px solid #fff; + border-bottom: 1px solid #fff; + border-left: 1px solid #000; +} + +/* Combo boxes (menus that display months/years for direct selection) */ + +.calendar .combo { + position: absolute; + display: none; + width: 4em; + top: 0px; + left: 0px; + cursor: default; + border-top: 1px solid #fff; + border-right: 1px solid #000; + border-bottom: 1px solid #000; + border-left: 1px solid #fff; + background: #e4e0d8; + font-size: 90%; + padding: 1px; + z-index: 100; +} + +.calendar .combo .label, +.calendar .combo .label-IEfix { + text-align: center; + padding: 1px; +} + +.calendar .combo .label-IEfix { + width: 4em; +} + +.calendar .combo .active { + background: #c4c0b8; + padding: 0px; + border-top: 1px solid #000; + border-right: 1px solid #fff; + border-bottom: 1px solid #fff; + border-left: 1px solid #000; +} + +.calendar .combo .hilite { + background: #048; + color: #fea; +} + +.calendar td.time { + border-top: 1px solid #000; + padding: 1px 0px; + text-align: center; + background-color: #f4f0e8; +} + +.calendar td.time .hour, +.calendar td.time .minute, +.calendar td.time .ampm { + padding: 0px 3px 0px 4px; + border: 1px solid #889; + font-weight: bold; + background-color: #fff; +} + +.calendar td.time .ampm { + text-align: center; +} + +.calendar td.time .colon { + padding: 0px 2px 0px 3px; + font-weight: bold; +} + +.calendar td.time span.hilite { + border-color: #000; + background-color: #766; + color: #fff; +} + +.calendar td.time span.active { + border-color: #f00; + background-color: #000; + color: #0f0; +} diff --git a/posterita/posterita/web/css/logo.css b/posterita/posterita/web/css/logo.css new file mode 100644 index 0000000000..d13a1e6359 --- /dev/null +++ b/posterita/posterita/web/css/logo.css @@ -0,0 +1,23 @@ +/* Logotype */ +#logo { + float: left; + margin:0; + padding:0; + width:265px; + height:57px; + overflow:hidden; +} + #logo a { + position:relative; + display:block; + width:265px; + height:57px; + } + #logo a span { + position:absolute; + left:0; top:0; + display:block; + width:265px; + height:57px; + background:url(../images/logo.gif) left top no-repeat; + } \ No newline at end of file diff --git a/posterita/posterita/web/css/mainMenu.css b/posterita/posterita/web/css/mainMenu.css new file mode 100644 index 0000000000..6cb65890b0 --- /dev/null +++ b/posterita/posterita/web/css/mainMenu.css @@ -0,0 +1,841 @@ +/*MAIN POS MENU CSS*/ + +#posHeader{ +background: #9A9A9A url("../images/newUI/topmenubg.gif") repeat-x; +position: relative; +float: left; +width: 100%;} + + +#backButn{ +position: relative; +float: left; +width: 28px; +cursor: pointer; +} + +#logo{ +position: relative; +width: 133px; +float: left; +} + +#mainTitle{ +position: relative; +color: #FFFFFF; +font-family: tahoma, san-serif; +font-size: 13px; +font-weight: bold; +text-transform: uppercase; +margin: 10px 0 0 10px; +float: left; + +} +#acDetailsContainer{ +margin: 5px 10px 0 10px;} + +#acDetailsL{ +position: relative; +margin: 0; +float: right; +color: #fff; +font-family: tahoma, san-serif; +font-size: 11px; +font-weight: normal; +padding-right: 10px; + +} + +#acDetailsR{ +position: relative; +margin: 0; +float: right; +color: #fff; +font-family: tahoma, san-serif; +font-size: 11px; +font-weight: normal; +} + +#systemMenuContainer{ +background: #9A9A9A url("../images/newUI/pricedetbg.gif") no-repeat; +height: 41px; +} + +#systemMenuBg{ +background: url("../images/newUI/pricedetbgtile.gif") repeat-x; +height: 41px; +position: relative; +margin: 0 0 0 5px; +} + +#choosePOS{ + color: #FFFFFF; + text-align: center; + font-size: 11pt; +} + +#systemMenu{ +padding-top: 3px; +padding-left: 13px;} + + +img.center{ +padding-right: 10px; +float: left; +} + +.posSubNavContainer, .category h1{ +font-size: 11px; +font-family: tahoma; +color: #fff; +text-transform: uppercase; +padding: 6px 0 10px 0; +margin-top: -40px; +margin-left: 0px; +text-indent: 30px; + +} + +#categoryImg +{ + height: 19px; + width: 18px; + margin-right: 13px; + margin-top: 5px; + margin-left: -30px; +} + +#posNavContainer { + margin: 0; + padding: 0; + } + +#posNavContainer ul{ + margin: 0; + padding: 0; + list-style-type: none; + line-height: 30px; +} + +#posNavContainer li { + margin: 0; + padding: 0; + } + +#posNavContainer a{ + display: table-row; + color: #777; + padding: 2px 0px 2px 20px; + text-decoration: none; + font-size: 11px; + font-weight: bold; + text-transform: normal; + font-family: tahoma, verdana, san-serif; + width: 1em; + margin: 0px; + text-indent: 20px; + } + +#posNavContainer a:hover{ + color: #333; + } + +#posSubNavContainer .posNews h1{ + font-size: 11px; + font-family: tahoma; + color: #fff; + text-transform: uppercase; + padding: 6px 0 10px 0; + margin-top: -30px; + margin-left: 0px; + text-indent: 30px; + background: url(../images/newUI/hicon-news.gif) 0 0 no-repeat; +} + +#posSubNavContainer .posHelp h1{ + font-size: 11px; + font-family: tahoma; + color: #fff; + text-transform: uppercase; + padding: 6px 0 10px 0; + margin-top: -30px; + margin-left: 0px; + text-indent: 30px; + background: url(../images/newUI/hicon-help.gif) 0 0 no-repeat; +} + + +#posSubNavContainer .posDonate h1{ + font-size: 11px; + font-family: tahoma; + color: #fff; + text-transform: uppercase; + padding: 6px 0 10px 0; + margin-top: -30px; + margin-left: 0px; + text-indent: 30px; + background: url(../images/newUI/hicon-donate.gif) 0 0 no-repeat; +} + +.currentpage { + background: url(../images/newUI/navbg.gif) left; + background-repeat: no-repeat; + width: 100%; + margin-left: 1px; +} + +.currentpage span{ + color: #3B6DAA; +} + +/*END*/ + + +/*POS SUB CONTENT MENU CSS*/ + +#posSubNavContainer { + margin-right: 0px; + margin-left: 0px; + + } + +#posSubNavContainer ul{ + margin: 0px 0 0 0 ; + padding: 0; + list-style-type: none; + line-height: 12px; + } + +#posSubNavContainer li { + margin: 0 0 0 0px; + } + +#posSubNavContainer a{ + width: 98%; + text-align: left; + color: #777; + display: block; + padding: 5px 0 5px 0px; + text-decoration: none; + font-size: 11px; + font-weight: bold; + text-transform: normal; + font-family: tahoma, verdana, san-serif; + text-indent: 0px; + + border-top: 1px solid #ddd} + +#posSubNavContainer a:hover{ + color: #3B6DAA; + } + + +/*END*/ + + +#rightContainer{ +margin: 0; +padding: 0; +min-height: 525px; +} + +.rightContainer{ +background:#EBEFF7 url(../images/newUI/palebluebg.gif) repeat-y 0 0; +} + + +#mainHeaderTitleContainer{ +text-align: left; +margin-top: 0px; +padding-left: 20px; +border-bottom: 1px solid #fff; +height: 30px;} + + +#mainHeaderTitleContainer h1{ +font-size: 14px; +font-family: tahoma; +color: #669ACF; +text-transform: uppercase; +padding: 5px 0 0 0; +margin: 0; + +} + +.liquid-round { +padding-right: 5px; +float: left; +width:32%; +/* set to 49% for 2 column layout. can also set exact px width if you dont want to auto resize width */ +margin-top: 5px; +margin-right: auto; +margin-bottom: 5px; +margin-left: auto; +background:#fff url(../images/newUI/leftside.gif) repeat-y left top; +position: relative; + +} + +.top { +width:100%; +height:40px; +background:url(../images/newUI/top.gif) no-repeat left top; +} + +.top span { +display:block; +position:relative; +height:40px; +background:url(../images/newUI/top-right.gif) no-repeat right top; +} + +.center-content { +position:relative; +background:url(../images/newUI/rightside.gif) repeat-y right top; +padding:1px 20px 1px 25px; +margin:-1px 0 -50px 0; +} + +.bottom{ +width:100%; +height:60px; +background:url(../images/newUI/bottom.gif) no-repeat left bottom; +} + +.bottom span { +display:block; +/*remove because of ie position:relative;*/ +height:60px; +background:url(../images/newUI/bottom-right.gif) no-repeat right top; +} + + .mainContainer{ +background: #fff; +padding: 5px; +} + +#mainFields{ +padding: 0px; +margin: 0; +background: #FFF; +} + +#mainFields td, #mainFields table, #mainFields tr{ +background: #DFDFDF; +color: #51585F; +font-family: tahoma, san-serif; +font-size: 12px; +font-weight: bold; +text-transform: uppercase; +padding: 0px 0 0 0; +margin: 0; +} + +.footer{ +background: #9A9A9A url("../images/newUI/footerbg.gif") repeat-x; +padding: 8px; +margin: 0; +height: 41px; +color: #FFFFFF; +font-family: tahoma, san-serif; +font-size: 11px; +font-weight: bold; +border-top: #FFFFFF solid 1px; +position: relative; +} + +.floatRight{ + float: right; +} + +.floatLeft{ + float: left; +} + +#newHeader, #footer, #body, .form{ + padding: 0px; + margin: 0px; +} + +#content{ + padding: 0px; + min-height: 525px; + margin: 0px; +} + +#search{ + display:none; + border:solid 1px #FFF; + background-color: #EBEFF7; + padding: 10px; + width : 280px; + height: 100px; + position: absolute; + z-index: 8000; + color: #333; + font-family: tahoma, san-serif; + font-size: 12px; + text-align: center; + left: 40%; + top: 40%; +} + +#bulletList { + margin-right: 0px; + margin-left: 0px; +} + +#bulletList ul{ + margin: 0px 0 0 0 ; + padding: 0; + list-style-type: none; + line-height: 12px; +} + +#bulletList li { + margin: 0 0 0 0px; +} + +#bulletList a{ + width: 98%; + text-align: left; + color: #777; + display: block; + padding: 8px 0 3px 0px; + text-decoration: none; + font-size: 11px; + font-weight: bold; + text-transform: normal; + font-family: tahoma, verdana, san-serif; + text-indent: 18px; + background: url(../images/newUI/icon-newwindow.gif) no-repeat 0 8px; + border-top: none +} + +#bulletList a:hover{ + color: #3B6DAA; +} + +#bulletList2 { + margin-right: 0px; + margin-left: 20px; +} + +#bulletList2 ul{ + margin: 0px 0 0 0 ; + padding: 0; + list-style-type: none; + line-height: 12px; +} + +#bulletList2 li { + margin: 0 0 0 0px; +} + +#bulletList2 a{ + width: 98%; + text-align: left; + color: #777; + display: block; + padding: 8px 0 3px 0px; + text-decoration: none; + font-size: 11px; + font-weight: bold; + text-transform: normal; + font-family: tahoma, verdana, san-serif; + text-indent: 18px; + background: url(../images/newUI/bullet-arrow.gif) no-repeat 0 8px; + border-top: none +} + +#bulletList2 a:hover{ + color: #3B6DAA; + } + +#rightContainer{ + margin: 0; + padding: 0; +} + +.rightContainer{ + background:#EBEFF7 url(../images/newUI/palebluebg.gif) repeat-y 0 0; +} + +#rightHeaderTitleContainer a{ + text-decoration: none; + font-size: 11px; + color: #777; + text-align: left; +} + +#rightHeaderTitleContainer a:hover{ + text-decoration: none; + font-size: 11px; + color: #3B6DAA; +} + + +#rightHeaderTitleContainer{ + text-align: center; + margin-top: 3px; + padding-left: 20px; + border-bottom: 1px solid #fff; + height: 27px; +} + +#mainHeaderTitleContainer{ + text-align: center; + margin-top: 0px; + padding-left: 20px; + border-bottom: 1px solid #fff; + height: 30px; +} + + +#mainHeaderTitleContainer h1{ + font-size: 14px; + font-family: tahoma; + color: #669ACF; + text-transform: uppercase; + padding: 5px 0 0 0; + margin: 0; +} + +#liquid-roundFull { + padding-right: 0px; + float: left; + width:99%; + /* set to 49% for 2 column layout. can also set exact px width if you dont want to auto resize width */ + margin:5px auto; + background:#fff url(../images/newUI/leftside.gif) repeat-y left top; +} + +#liquid-roundHalf { + padding-right: 7px; + float: left; + width:49%; + /* set to 49% for 2 column layout. can also set exact px width if you dont want to auto resize width */ + margin:0px auto; + background:#fff url(../images/newUI/leftside.gif) repeat-y left top; +} + +.browse{ + background: url(../images/newUI/butn-browse.gif) no-repeat 0 1px; + width: 89px; + height: 22px; + margin: 0px 0 0px 5px; + padding: 0; + cursor: pointer; /* hand-shaped cursor */ + cursor: hand; /* for IE 5.x */ + border: 0; + font-size: 10px; + text-transform: uppercase; +} + +.radioBox{ + padding: 0; + margin: 0; +} + +#generalSystemActions{ + position: relative; + margin: 0; + float: right; + color: #fff; + font-family: tahoma, san-serif; + font-size: 11px; + font-weight: normal; + padding: 3px 8px 0 10px; +} + +#generalSystemActions img{ + margin-right:2px; +} + +#acDetailsR{ + position: relative; + margin: 0; + float: right; + color: #fff; + font-family: tahoma, san-serif; + font-size: 11px; + font-weight: normal; +} + +.strong{ + font-weight: bold; +} + +#systemMenu{ + padding-top: 3px; + padding-left: 13px; + color: #fff; + font-size: 11px; + text-align: center; +} + +#systemActionContainer{ + text-align: center; + padding: 5px 0 0 0; +} +#systemActionContainer img{ + margin: 0px 2px 0 0; + cursor: pointer; +} + +#loginContainer{ + background: #fff ; + position: relative; + clear: both; + height: 100%; + font-size: 12px; +} + +#loginContainer td{ + font-size: 12px; + font-weight: bold; + color: #666; +} +#loginContainer a{ + color: #3B6DAA; +} + +#loginContainer a:hover{ + color: #3B6DAA; + text-decoration: none; +} + +#pinLoginContainer, .paleBlueBg{ + background: #EBEFF7 url("../images/newUI/palebluebg.gif") repeat-y; + margin: 0 0 0 0px; + clear: both; + height: 100%; +} + +#loginPinContent td{ + font-size: 12px; + font-weight: bold; + text-transform: uppercase; + color: #666; +} + +.input{ + width: 200px; + height: 30px; + font-size: 12px; + font-weight: normal; +} + +.butnLogin{ + background: url(../images/newUI/butn-login.gif) no-repeat center top; + width: 81px; + height: 25px; + margin: 0px 0 0px 0px; + padding: 0; + cursor: pointer; /* hand-shaped cursor */ + cursor: hand; /* for IE 5.x */ + border: 0; + text-indent: -1000em; +} + +.systemMsg{ + padding-top: 8px; + text-transform: none; +} + +input.usernameMissing, input.passwordMissing, input.pinnumberMissing{ + border: 1px solid #CC0000; +} + +#pinLoginContainer input{ + width: 162px; + height: 30px; + font-size: 20px; + margin: 5px 0; +} + +#loginPinContent input{ + height: 30px; + font-size: 12px; + font-weight: normal; +} + +.divsystemerror{ + width: 250px; + color: #CC0000; + margin-bottom: 0px; +} +.systemerror{ + //background: url(../images/newUI/icon-err.gif) no-repeat 0 top; + width: 30px; + height: 35px; + float: left; + margin-right: 10px; +} + +#loginContent{ + padding: 55px 0 30% 0; +} + +#loginPinContent{ + padding: 15% 0 15% 0; +} + +.systemKey{ + background: url(../images/newUI/singlekey.gif) no-repeat 0 top; + width: 51px; + height: 51px; + float: left; + margin: 0 5px 5px 0; + cursor: pointer; +} + +.systemKey div{ + color : #333; + display: block; + width: 51px; + height: 36px; + text-decoration: none; + text-align: center; + font-weight: bold; + padding-top: 15px; +} + +.numPad{ + width: 168px; +} + +.dateTag{ + font-size: 11px; + color: #666; + width: 20px; + border-right: 1px solid #999; + padding-right: 12px; + text-align: center; + clear: both; +} + +.date{ + font-size: 13px; +} + +.month, .upperCase{ + text-transform: uppercase; + font-weight: bold; +} + +.newsContent{ + font-size: 11px; + color: #666; + clear: left; + margin-left: 40px; + margin-top: -28px; +} + +.newsContainer{ +width: 100%; +clear: both; +margin-bottom: 15px; + +} + +.infoContainer{ + font-size: 11px; + color: #666; +} + +.reg10UC{ + font-weight: normal; + font-size: 10px; + text-transform: uppercase; +} + +.reg10{ + font-weight: normal; + font-size: 10px; +} + +.bold11{ + font-weight: bold; + font-size: 11px; +} + +.bold13{ + font-weight: bold; + font-size: 13px; + text-transform: uppercase; +} + +#headerContainerRight{ + background: #9A9A9A url("../images/newUI/pricedetbg.gif") no-repeat; + height: 41px; +} + +#headerRight{ + background: url("../images/newUI/pricedetbgtile.gif") repeat-x; + height: 41px; + position: relative; + margin: 0 0 0 5px; +} + +#donate a{ + text-align: center; +} + +#rightBtnContainer{ + background: #EBEFF7 url("../images/newUI/palebluebg.gif") repeat-y; + position: relative; + margin: 0 0 0 0px; + border-top: 1px solid #fff; + clear: both; + height: 100%; +} + +#rightBtn{ + padding: 6px; + color: #669ACF; + font-family: tahoma, san-serif; + font-size: 12px; + font-weight: bold; + text-align: center; + clear: both; +} + +#messagebox div, .errormsg{ + background: url(../images/newUI/icon-err.gif) no-repeat left center; + min-height: 35px; + line-height: 35px; +} + +.errormsgs { + background-color: #CC1515; + color:#FFFFFF; + z-index: 9000; + background: url(../images/newUI/icon-err.gif) no-repeat left center; + background-repeat: no-repeat; + background-position: 5px 5px; + padding-left: 40px; + padding-top: 5px; + min-height: 35px; + line-height: 35px; +} + +#errorsbox +{ + vertical-align: middle; + background-color:CC1515; + border: solid 1px #D41616; + padding: 4px; +} + +.errorRight{ + height: 99%; + text-align: center; + text-transform: uppercase; + color: #CC1515; + vertical-align: middle; + font-family: tahoma, san-serif; + font-size: 16px; + font-weight: bold; + border-bottom: 1px solid #FFF; +} \ No newline at end of file diff --git a/posterita/posterita/web/css/modalbox.css b/posterita/posterita/web/css/modalbox.css new file mode 100644 index 0000000000..4685eb5a24 --- /dev/null +++ b/posterita/posterita/web/css/modalbox.css @@ -0,0 +1,101 @@ +#MB_overlay { + position: absolute; + margin: auto; + top: 0; left: 0; + width: 100%; height: 100%; + z-index: 9999; + background-color: #000!important; +} +#MB_overlay[id] { position: fixed; } + +#MB_window { + position: absolute; + top: 0; + border: 0 solid; + text-align: left; + z-index: 10000; +} +#MB_window[id] { position: fixed!important; } + +#MB_frame { + position: relative; + background-color: #EFEFEF; + height: 100%; +} + +#MB_header { + margin: 0; + padding: 0; +} + +#MB_content { + padding: 6px .75em; + overflow: auto; +} + +#MB_caption { + font: bold 100% "Lucida Grande", Arial, sans-serif; + text-shadow: #FFF 0 1px 0; + padding: .5em 2em .5em .75em; + margin: 0; + text-align: left; +} + +#MB_close { + display: block; + position: absolute; + right: 5px; top: 4px; + padding: 2px 3px; + font-weight: bold; + text-decoration: none; + font-size: 13px; +} +#MB_close:hover { + background: transparent; +} + +#MB_loading { + padding: 1.5em; + text-indent: -10000px; + background: transparent url(/posterita/images/spinner.gif) 50% 0 no-repeat; +} + +/* Color scheme */ +#MB_frame { + padding-bottom: 7px; + -webkit-border-radius: 7px; + -moz-border-radius: 7px; + border-radius: 7px; +} +#MB_window { + background-color: #EFEFEF; + color: #000; + -webkit-box-shadow: 0 8px 64px #000; + -moz-box-shadow: 0 0 64px #000; + box-shadow: 0 0 64px #000; + + -webkit-border-radius: 7px; + -moz-border-radius: 7px; + border-radius: 7px; +} +#MB_content { border-top: 1px solid #F9F9F9; } +#MB_header { + background-color: #DDD; + border-bottom: 1px solid #CCC; +} +#MB_caption { color: #000 } +#MB_close { color: #777 } +#MB_close:hover { color: #000 } + + +/* Alert message */ +.MB_alert { + margin: 10px 0; + text-align: center; +} + +.popup{ + text-decoration:none; + color:#FFFFFF; + background-color:#333333; +} \ No newline at end of file diff --git a/posterita/posterita/web/css/newPOS.css b/posterita/posterita/web/css/newPOS.css new file mode 100644 index 0000000000..1758d4d473 --- /dev/null +++ b/posterita/posterita/web/css/newPOS.css @@ -0,0 +1,723 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +/** + @author tamak + */ + + +body +{ + font-family: arial,sans-serif; + font-size: 10pt; + letter-spacing: 1px; + color: #000000; + +} + +mandatory +{ + font-weight: bold; + text-align:right; + font-size:18px; + color: blue; +} + +p.loginHeader +{ + color: #666666; + font-size: 36px; + font-weight: bold; + font-family: arial,sans-serif; +} + + + +div.copyright +{ + background-color: #666666; + text-align: center; + color: #FFFFFF; + font-family: arial,sans-serif; + font-weight: bold; + font-size: 10pt; + letter-spacing: 1px; + padding: 2; +} + +label +{ + font-family: arial,sans-serif; + font-size: 10pt; + /*font-weight: bold;*/ + letter-spacing: 1px; + color: #000000; + padding-right: 4px; +} + +label.red +{ + font-family: arial,sans-serif; + font-size: 10pt; + /*font-weight: bold;*/ + letter-spacing: 1px; + color: #E83530; +} + +label.green +{ + font-family: arial,sans-serif; + font-size: 10pt; + /*font-weight: bold;*/ + letter-spacing: 1px; + color: #0A9409; +} + +li.errormsg +{ + list-style-image: url("../images/pos/error.jpg"); + font-family: arial,sans-serif; + font-size: 10pt; + /*font-weight: bold;*/ + letter-spacing: 1px; + color: #000000; +} + +legend +{ + font-family: arial,sans-serif; + font-size: 10pt; + font-weight: bold; + letter-spacing: 1px; + color:#0A9409; +} + + +input.text +{ + border: solid 1px #666666; + /*font-family: arial,sans-serif;*/ + font-size: 10pt; +} + +textarea.text +{ + border: solid 1px #666666; + /*font-family: arial,sans-serif;*/ + font-size: 10pt; +} + +select.text +{ + border: solid 1px #666666; + /*font-family: arial,sans-serif;*/ + font-size: 10pt; +} + + +input.medium +{ + width:100px; +} + +input:focus +{ + background-color: #CDD4E9; + border: solid 1px #333333; +} + + +font.greencolor +{ + color:#0A9409; +} + +font.redcolor +{ + color:#E83530; +} + +font.title +{ + font-size: 16pt; +} + +div.main +{ + width:800px; + border:solid 1px #000000; + text-align: center; + overflow: inherit; + /* height: 600px; */ +} + +div.header +{ + width:800px; + /* height: 110px; */ +} + +div.menu +{ + width:800px; + background-color: #D8D8D8; +} + +div.content +{ + width:800px; + min-height: 300px; + background-color: #F4F4F4; +} + +font +{ + font-family: arial,sans-serif; + font-size: 10pt; + font-weight: bold; + letter-spacing: 1px; + color: #555555; +} + +li.submenu +{ + list-style-image: url("../images/pos/buttons/bullet_red.gif"); + font-family: arial,sans-serif; + font-size: 10pt; + /*font-weight: bold;*/ + letter-spacing: 1px; + color: #000000; +} + +img.topmenu +{ + border-style: none; + +} + +img.button +{ + cursor:pointer; +} + +/* anchor sytles */ +a:hover +{ + color:#0A9409; +} + +a.topmenu +{ + text-decoration: none; + border-width: 0px; + border-style: none; +} + +a.submenu +{ + text-decoration: none; + color:#666666; + font-family: arial,sans-serif; + font-size: 11pt; + letter-spacing: 1px; + font-weight: bold; +} + +td.submenu +{ + text-decoration: none; + color:#666666; + font-family: arial,sans-serif; + font-size: 11pt; + letter-spacing: 1px; + font-weight: bold; +} + +a +{ + text-decoration: none; + font-family: arial,sans-serif; + font-size: 11pt; + letter-spacing: 1px; +} + +a.forgotpassword +{ + color:#0A9409; + font-family: arial,sans-serif; + font-size: 12pt; + letter-spacing: 1px; + font-weight: bold; +} + +/* end of anchor styles */ + +/* Auto complete style */ +div.autocomplete { + position:absolute; + width:250px; + background-color:white; + border:1px solid #888; + margin:0px; + padding:0px; + overflow: auto; +} + +div.autocomplete ul { + list-style-type:none; + margin:0px; + padding:0px; +} +div.autocomplete ul li.selected { background-color: #ffb;} +div.autocomplete ul li { + list-style-type:none; + display:block; + margin:0; + padding:2px; + cursor:pointer; + letter-spacing: 1px; + font-size: 10pt; + font-family:arial,sans-serif; +} +div.notfound { + background-color: #ffb; +} + +/* tables styles */ +table.view +{ + border-collapse: collapse; + /*border: solid 1px black;*/ +} + +table.view td +{ + font-family: arial,sans-serif; + font-size: 10pt; + letter-spacing: 1px; + color: #000000; + padding: 5px 0px 5px 0px; +} + +table.layout +{ + padding-left: 10; + padding-right: 10; + padding-top: 10; + padding-bottom: 10; + + /* border:solid 1px #000000; */ +} + +table.main +{ + width: 100%; + /*border: solid 1px black;*/ + border-collapse: collapse; +} + +table.main td +{ + padding: 5px 0px 5px 0px; +} + +table.topmenu +{ + padding-left: 10; + padding-right: 10; + + /* border:solid 1px #000000; */ +} + +td.buttoncell +{ + padding-right: 0px; +} + +table.login +{ + width: 800px; + /*height: 600px;*/ + border: solid black 1px; + border-spacing: 0; +} + +td.loginHeader +{ + height: 210px; + background-image: url("../images/pos/POS-LOGIN_01.gif"); + background-repeat: no-repeat; +} + +table.content +{ + width: 100%; + /* border: solid 1px black; */ + border-collapse: collapse; +} + +table.content th +{ + font-family: arial,sans-serif; + font-size: 10pt; + font-weight: bold; + letter-spacing: 1px; + color: #FFFFFF; + background-color: #909090; +} + +table.content td.total +{ + font-family: arial,sans-serif; + font-size: 10pt; + font-weight: bold; + letter-spacing: 1px; + color: #FFFFFF; + background-color: #BBBBBB; +} + +table.content td +{ + font-family: arial,sans-serif; + font-size: 10pt; + letter-spacing: 1px; + font-weight: bold; + color: #000000; + padding: 5px 0px 5px 0px; + +} + +table.cart +{ + width: 100%; + /*border: solid 1px black;*/ + border-collapse: collapse; + border-spacing: 0px; + border: 0px; +} + +table.cart td +{ + font-family: arial,sans-serif; + font-size: 10pt; + letter-spacing: 1px; + font-weight: bold; + color: #000000; + padding: 5px 5px 5px 5px; +} + +table.cart th +{ + font-family: arial,sans-serif; + font-size: 10pt; + font-weight: bold; + letter-spacing: 1px; + color: #FFFFFF; + background-color: #909090; + padding: 5px 5px 5px 5px; +} + +table.cart td.total +{ + font-family: arial,sans-serif; + font-size: 10pt; + font-weight: bold; + letter-spacing: 1px; + color: #FFFFFF; + background-color: #BBBBBB; +} + +table.cart td.label +{ + font-family: arial,sans-serif; + font-size: 10pt; + letter-spacing: 1px; + font-weight: bold; + color: #000000; + background-color: #D8D8D8; +} + +table.cart td.contentname +{ + font-family: arial,sans-serif; + font-size: 10pt; + letter-spacing: 1px; + font-weight: bold; + color: #000000; + background-color: #C9C9C9; +} + +table.content td.label +{ + font-family: arial,sans-serif; + font-size: 10pt; + letter-spacing: 1px; + font-weight: bold; + color: #000000; + background-color: #D8D8D8; +} + +table.content td.contentname +{ + font-family: arial,sans-serif; + font-size: 10pt; + letter-spacing: 1px; + font-weight: bold; + color: #000000; + background-color: #C9C9C9; +} + +table.orderheader td +{ + font-family: arial,sans-serif; + font-size: 10pt; + letter-spacing: 1px; + padding: 5px 0px 5px 0px; + color: #000000; +} + +/* +td.copyright +{ + height: 60px; + vertical-align: top; + padding: 0; +} +*/ + +table.display td a +{ + text-decoration: none; + color:blue; + font-family: arial,sans-serif; + font-size: 10pt; + letter-spacing: 1px; +} + +table.display +{ + width: 100%; + border: solid 1px black; + border-collapse: collapse; +} + +table.display td.label +{ + /* + font-family: arial,sans-serif; + font-size: 10pt; + letter-spacing: 1px; + color: #000000; + */ + background-color: #D8D8D8; +} + +table.display td.contentname +{ + /* + font-family: arial,sans-serif; + font-size: 10pt; + letter-spacing: 1px; + color: #000000; + */ + background-color: #C9C9C9; +} + +table.display td +{ + font-family: arial,sans-serif; + font-size: 9pt; + letter-spacing: 1px; + color: #000000; + padding: 5px 5px 5px 5px; +} + +table.display th +{ + font-family: arial,sans-serif; + font-size: 9pt; + font-weight: bold; + letter-spacing: 1px; + color: #FFFFFF; + background-color: #909090; + padding: 5px 5px 5px 5px; +} + +caption +{ + font-family: arial,sans-serif; + font-size: 12pt; + font-weight: bold; + letter-spacing: 1px; + padding: 5px 5px 5px 5px; +} +/* end of table styles */ + +/* buttons styles */ +.advanced +{ + background-image: url("../images/pos/buttons/button_advanced.gif"); +} + +.continue +{ + background-image: url("../images/pos/buttons/button_continue.gif"); +} + +.complete +{ + background-image: url("../images/pos/buttons/button_continue.gif"); +} + +.addtocart +{ + background-image: url("../images/pos/buttons/button_addtocart.gif"); +} + +.newcustomer +{ + background-image: url("../images/pos/buttons/button_newcustomer.gif"); +} + +.checkout +{ + background-image: url("../images/pos/buttons/button_checkout.gif"); +} + +.delete +{ + background-image: url("../images/pos/buttons/button_delete.gif"); +} + +.neworder +{ + background-image: url("../images/pos/buttons/button_neworder.gif"); +} + +.cash +{ + background-image: url("../images/pos/buttons/button_cash.gif"); +} + +.card +{ + background-image: url("../images/pos/buttons/button_card.gif"); +} + +.cheque +{ + background-image: url("../images/pos/buttons/button_cheque.gif"); +} + +.mixed +{ + background-image: url("../images/pos/buttons/button_mixed.gif"); +} + +.save +{ + background-image: url("../images/pos/buttons/button_submit.gif"); +} + +.submit +{ + background-image: url("../images/pos/buttons/button_submit.gif"); +} + +.refresh +{ + background-image: url("../images/pos/buttons/button_refresh.gif"); +} + +.piechart +{ + background-image: url("../images/pos/buttons/button_piechart.gif"); +} + +.barchart +{ + background-image: url("../images/pos/buttons/button_barchart.gif"); +} + +.timeseries +{ + background-image: url("../images/pos/buttons/button_timeseries.gif"); +} + +.tabular +{ + background-image: url("../images/pos/buttons/button_tabular.gif"); +} + +.bigbutton +{ + background-repeat: no-repeat; + cursor: pointer; + border: 0px; + width: 127px; + height: 42px; + font-family: arial,sans-serif; + font-size: 12pt; + letter-spacing: 1px; + font-weight: bolder; + color: #666666; + padding: 0px; +} + +.smallbutton +{ + background-repeat: no-repeat; + cursor: pointer; + border: 0px; + width: 87px; + height: 42px; + font-family: arial,sans-serif; + font-size: 12pt; + letter-spacing: 1px; + font-weight: bolder; + color: #666666; + padding: 0px; +} + +.tangobutton +{ + background-repeat: no-repeat; + cursor: pointer; + border: 0px; + width: 87px; + height: 42px; + font-family: arial,sans-serif; + font-size: 12pt; + letter-spacing: 1px; + font-weight: bolder; + color: #666666; + padding: 0px; +} + +/* end of buttons styles */ + +div.space +{ + height:10px; + /* + border: solid 1px black; + background-color: #0000FF; + */ +} diff --git a/posterita/posterita/web/css/orderScreen.css b/posterita/posterita/web/css/orderScreen.css new file mode 100644 index 0000000000..f15c9b34ee --- /dev/null +++ b/posterita/posterita/web/css/orderScreen.css @@ -0,0 +1,828 @@ +#controls, div#centerShortcuts{ +background: #9A9A9A url("../images/newUI/footerbg.gif") repeat-x; +padding: 8px; +margin: 0; +height: 41px; +color: #FFFFFF; +font-family: tahoma, san-serif; +font-size: 11px; +text-align: center; +} + +body{ +padding: 0; +margin: 0; +background: #DFDFDF; +} + +.divider{ +color: #AEAEB0; +padding: 0 2px 0 2px; +} + +#posHeader{ +background: #9A9A9A url("../images/newUI/topmenubg.gif") repeat-x; +position: relative; +float: left; +width: 100%;} + + +.backButn{ +position: relative; +float: left; +width: 28px; +cursor: pointer; +} + +#logo{ +position: relative; +width: 133px; +float: left; +} + +#mainTitle{ +position: relative; +color: #FFFFFF; +font-family: tahoma, san-serif; +font-size: 13px; +font-weight: bold; +text-transform: uppercase; +margin: 10px 0 0 10px; +float: left; + +} +#acDetailsContainer{ +margin: 5px 10px 0 10px;} + +#acDetailsL{ +position: relative; +margin: 0; +float: right; +color: #fff; +font-family: tahoma, san-serif; +font-size: 11px; +font-weight: normal; +padding-right: 10px; + +} + +#acDetailsR{ +position: relative; +margin: 0; +float: right; +color: #fff; +font-family: tahoma, san-serif; +font-size: 11px; +font-weight: normal; +} + +.strong{ +font-weight: bold; +} + +#priceContainer{ +background: #9A9A9A url("../images/newUI/pricedetbg.gif") no-repeat; +height: 41px; +} + +#priceContainerBg{ +background: url("../images/newUI/pricedetbgtile.gif") repeat-x; +height: 41px; +position: relative; +margin: 0 0 0 5px; +} + +#priceValue{ +color: #FFFFFF; +font-family: tahoma, san-serif; +font-size: 16px; +font-weight: bold; +text-align: center; +padding: 10px 0 0 0; +} + +#priceListDetailsContainer{ +background: #EBEFF7 url("../images/newUI/palebluebg.gif") repeat-y; +position: relative; +margin: 0 0 0 0px; +clear: both; +} + +#priceListDetails{ +padding: 10px; +color: #669ACF; +font-family: tahoma, san-serif; +font-size: 12px; +font-weight: bold; +text-align: center; +clear: both; +} + +.productValue, .discountDetails{ +color: #333; +font-family: tahoma, san-serif; +font-size: 11px; +font-weight: bold; +margin-left: 5px; +} + +#pgTitle{ +color: #fff; +font-family: tahoma, san-serif; +font-size: 11px; +font-weight: bold; +text-transform: uppercase; +position: relative; +margin-left: 170px; +padding-top: 25px; +} + +#productFieldsContainer{ +background: #DFDFDF; +padding: 0px; +margin: 0px; +} + +#productFields{ +padding: 1px; +margin: 0; +background: #DFDFDF; +} + +#productFields td, #productFields table, #productFields tr{ +background: #DFDFDF; +color: #51585F; +font-family: tahoma, san-serif; +font-size: 12px; +font-weight: bold; +text-transform: uppercase; +padding: 0px 0 0 0; +margin: 0; +} + +#productFields form{ +padding: 0; +margin:0; + +} + +input, textarea{ +background-color: #fff; +border: 1px solid #9A9A9A; +height: 18px; +padding: 0px; +margin: 0; +color: #51585F; +font-family: tahoma, san-serif; +font-size: 12px; +font-weight: normal; + +} + + input:focus, textarea:focus{ + border:1px solid #9ACF30; + background:#E3F3C3; +} + + +#productDetailsContainer, div#discountDetailsContainer{ +background: #EBEFF7 url("../images/newUI/palebluebg.gif") repeat-y; +position: relative; +margin: 0 0 0 0px; +clear: both; +border-top: 1px solid #fff; +height: 100%; +line-height: 16px; +} + +#productDetails, div#discountDetails{ +padding: 10px; +color: #9A9A9A; +font-family: tahoma, san-serif; +font-size: 11px; +font-weight: normal; +text-align: left; +} + +div#productImage{ +background: #EBEFF7; +width: 90px; +height: 90px; +float: right; +} + +#editProductContainer, .rightColSubContainer{ +position: relative; +margin: 0; +border-top: 1px solid #fff; +} + +#editProductDetails{ +position: relative; +padding: 10px; +color: #9A9A9A; +font-family: tahoma, san-serif; +font-size: 12px; +font-weight: bold; +text-align: center; +} + +#editProductDetails input{ +margin-bottom: 10px; +margin-right: 5px; +} + +#customerContainer, #changePricelistContainer, #choosePrintDetailsContainer, .inventoryDetails{ +position: relative; +margin: 0; +border-top: 1px solid #fff; +} + +#choosePrintDetailsContainer span{ + font-family: tahoma, san-serif; + font-size: 12px; + font-weight: bold; + color: #333; + text-align: left; +} + +#choosePrintDetailsContainer table, input{ + margin-top: 8px; +} + +.inventoryDetails table{ + margin-top: 5px; + margin-bottom: 5px; +} + +#changePricelist{ + margin-top: 10px; + text-transform: uppercase; + color: #333; + font-weight: bold; +} + +#customerDetails{ +position: relative; +padding: 10px; +color: #9A9A9A; +font-family: tahoma, san-serif; +font-size: 12px; +font-weight: bold; +text-align: left; +} + +#paymentContainer{ +position: relative; +margin: 0; +border-top: 1px solid #fff; +} + +#paymentDetails{ +padding: 10px; +color: #9A9A9A; +font-family: tahoma, san-serif; +font-size: 12px; +font-weight: bold; +text-align: center; +} + +#quickDiscountDetails{ +position: relative; +border-top: 1px solid #fff; +padding: 10px; +color: #9A9A9A; +font-family: tahoma, san-serif; +font-size: 12px; +font-weight: bold; +text-align: left; +width: 300px; +display:block; +float:left; +} + +#docStatus{ +position: relative; +border-top: 1px solid #fff; +padding: 10px; +color: #9A9A9A; +font-family: tahoma, san-serif; +font-size: 10px; +font-weight: bold; +text-align: left; +width: 300px; +display:block; +float:left; +} + +#paymentDetails h1{ +padding-bottom: 5px; +margin: 0; +color: #9A9A9A; +font-family: tahoma, san-serif; +font-size: 12px; +font-weight: bold; +text-align: center; +} + +#contentContainer{ +position: relative; +margin: 0 0 0 0px; +clear: both; +border-top: 1px solid #fff; +height: 100%; +} + +#content{ +padding: 0px; +color: #333333; +font-family: tahoma, san-serif; +font-size: 12px; +font-weight: bold; +text-align: center; +} + +#contentContainer div{ + background: #DFDFDF; +} + + +#systemButnContainer{ +position: relative; +margin: 0 0 0 0px; +clear: both; +border-top: 1px solid #fff; +height: 100%; +} + +#systemButn{ +padding: 6px; +color: #669ACF; +font-family: tahoma, san-serif; +font-size: 12px; +font-weight: bold; +text-align: left; +} + +#checkoutContainer{ +background: #EBEFF7 url("../images/newUI/palebluebg.gif") repeat-y; +position: relative; +margin: 0 0 0 0px; +border-top: 1px solid #fff; +clear: both; +height: 100%; +} + +#checkout{ +padding: 6px; +color: #669ACF; +font-family: tahoma, san-serif; +font-size: 12px; +font-weight: bold; +text-align: center; +clear: both; +} + +.itemTitleList{ +background: #929292; +color: #fff; +font-family: tahoma, san-serif; +font-size: 11px; +font-weight: bold; +} + +.itemTitleList th{ +padding: 4px; +border: none; +text-align: left; +} + + +.highlight { +background-color: #9ACF30; +font-family: tahoma, san-serif; +font-size: 11px; +font-weight: normal; +color: #fff; +text-align: left; +} + +.highlight td{ +padding: 4px; +border: none; +} + +.totalItem{ +text-align: right; +} + +.totalSales{ +text-align: right; +} + +.oddRow{ +background: #F7F7F7; +font-family: tahoma, san-serif; +font-size: 11px; +font-weight: normal; +text-align: left; +} + +.oddRow td{ +padding: 4px; +border: none; +} + +.evenRow{ +background: #FFF; +font-family: tahoma, san-serif; +font-size: 11px; +font-weight: normal; +text-align: left; +} + +.evenRow td{ +padding: 4px; +border: none; +} + +.itemsTotal{ +background: #fff; +color: #333; +font-family: tahoma, san-serif; +font-size: 11px; +font-weight: bold; +} + +.itemsTotal td{ +background: #fff; +padding: 4px; +border-top: 2px solid #656565; +border-bottom: 2px solid #656565; +border-left: none; +border-right: none; +text-align: left; +} + +/* Auto complete style */ +div.autocomplete { + position: absolute; + /*width:250px;*/ + height:200px; + display:none; + background-color:white; + border:1px solid #888; + margin:0px; + padding:0px; + overflow: auto; + font-size: 11px; + font-family: tahoma, san-serif; + z-index: 9000; +} + +div.autocomplete ul { + list-style-type:none; + margin:0px; + padding:0px; +} + +div.autocomplete ul li.selected { + background-color: #9ACF30; + } + +div.autocomplete ul li { + list-style-type:none; + display:block; + margin:0; + padding:2px; + cursor:pointer; + letter-spacing: 1px; + font-size: 11px; + font-family: tahoma, san-serif; +} +div.notfound { + background-color: #ffb; +} + +div.errormsg { + padding: 10px; + border: solid 2px #BA0B0B; + background-color: #CC1515; + color:#FFFFFF; + position:absolute; + float:left; + z-index: 9000; + width:300px; + min-height: 60px; + padding-left: 60px; + background-image: url(../images/pos/icon-error.gif); + background-repeat: no-repeat; + background-position: 5px 5px; +} + +div.mask { + position:absolute; + float:left; + z-index: 8500; + background-image: url(../images/pos/maskBG.png); + top:0px; + left: 0px; +} + +div#indicator { + top:0px; + border: solid 2px #CC1515; + padding: 5px 5px 5px 5px; + display: none; + background-color: #FFFFFF; + z-index:10000; + right: 0px; + position: absolute; +} + +div#cashPanel, div#cardPanel, div#chequePanel, div#debitPanel, div#mixPanel, div#PINPanel { + display:none; + border:solid 10px #FFF; + background-color: #EBEFF7; + padding: 20px; + width : 400px; + position: absolute; + + margin: 0px; + z-index: 8000; + color: #333; + font-family: tahoma, san-serif; + font-weight: bold; + font-size: 14px; +} + +div#cash, div#card, div#cheque, div#mix, div#debit{ + overflow: auto; +} + +div#PINPanel { + width : 200px; + height : 100px; + position: absolute; + z-index: 8000; +} + +div#reciept { + text-align: center; +} + +div#reciept h1, div#reciept h2, div#reciept h3 { + text-align: center; +} + +div.floatDown { + position:absolute; + top: 560px; +} + +div#shoppingCart, div#cart { + height: 450px; + overflow: auto; +} + +.pointer{ + cursor:pointer; +} + +.selected{ + border:solid 1px #9ACF30; + cursor:pointer; +} + +.alignDetails td{ + border: 0px; + vertical-align: top; + text-align: left; + font-family: tahoma, san-serif; + font-size: 11px; + font-weight: normal; +} + +br.clear{ + clear:both; +} + +tr#customerName, tr#customerCode , tr#creditAvailable, tr#creditLimit, tr#openBalance{ + display: none; +} + +#receipt{ + overflow: auto; + background: #EBEFF7 url("../images/newUI/palebluebg.gif") repeat-y; + border-top: 1px solid #fff; + line-height: 16px; + height: 450px; +} + +#receiptDetails{ + margin-left: 10px; +} + +.buttonLeft, .buttonRight{ + background: url("../images/newUI/pricedetbg.gif") repeat; + border: 1px solid #FFF; + line-height: 23px; + float: left; + height: 21px; + width: 95px; + font-family: tahoma, san-serif; + font-size: 11px; + font-weight: bold; + color: #FFF; + margin-right: 5px; + padding-top: 0px; + padding-bottom: 0px; + vertical-align: middle; + text-align: center; + margin-top:5px; + margin-bottom: 5px; + cursor: pointer; +} + +.buttonRight{ + position: absolute; + margin-left: 110px; +} + +div#leftBtnContainer, div#rightBtnContainer{ + position: relative; + margin: 0 0 0 0px; + padding-top: 3px; + padding-bottom: 0px; + border-top: 1px solid #fff; + height: 38px; + padding-left: 7px; +} + +div#rightBtnContainer, .paleBlueBg{ + background: #EBEFF7 url("../images/newUI/palebluebg.gif") repeat-y; + padding-left: 0px; +} + +div#discountDetails{ + height: 430px; + position: relative; +} + +div#centerShortcuts{ + line-height: 41px; +} + +#discount td{ + text-align: left; + padding-left: 5px; + background-color: #FFFFFF; +} + +div#frameHandle{ + text-align: right; + border-bottom: solid 1px #CCC; + padding: 2px; + background-color: #333; +} + +div#frameHandle a{ + text-decoration: none; + color: #FFF; + font-weight: bold; +} + +.error { + font-size: 11px; + color: white; + text-decoration: blink; + background-color: #FF0000; +} + +#pop_overlay + { + display: none; + position: fixed; + width: 100%; + height: 100%; + top: 0px; + left: 0px; + background: #000000; + filter: alpha(opacity=60); + -moz-opacity: 0.6; + opacity: 0.6; + } + + #pop_container + { + display: none; + position: fixed; + width: 100%; + height: 100%; + top: 0px; + left: 0px; + background: transparent; + } + + #pop_inner + { + display: block; + width: 320px; + height: 320px; + margin: 120px auto 0 auto; + background: #FFFFFF + border: 1px solid #999999 + text-align: center; + } + +#productCount{ + font-size: 14px; + font-weight: bold; + vertical-align: middle; + color: #CC0000; + text-transform: uppercase; + line-height: 450px; + margin-left: 30%; +} + +.noProduct{ + color: #CC0000; + font-size: 12px; + font-weight: bold; +} + +.salesFiguresHeader{ +background: #929292; +color: #fff; +font-family: tahoma, san-serif; +font-size: 11px; +font-weight: bold; +} + +.salesFiguresHeader th{ +padding: 2px; +border: none; +text-align: left; +} + +.salesFiguresRow{ + background: #DFDFDF; +} + +.captionStyle{ + padding: 10px; + color: #669ACF; + font-family: tahoma, san-serif; + font-size: 12px; + font-weight: bold; + letter-spacing: 0px; +} + +#productImage img{ + padding-top: 10px; +} + +#productEditFieldsContainer +{ +background: #fff; +padding: 0px; +margin: 0px; +height: 100%; +color: #666; +} + +#productEditFieldsContainer .prodFields{ +width: 270px;} + +#productEditFieldsContainer .prodTaxFields{ +width: 100%;} + +#productEditFieldsContainer .prodDescription +{ +font-size: 11px; +width: 270px; +padding: 0; +margin: 0;} + +#productEditFieldsContainer select +{ +border: 1px solid #777; +font-size: 11px; +} + +#productEditFieldsContainer td +{ +font-size: 11px; +} + +#productDetails td{ + font-size: 11px; +} + +#productEditFieldsContainer .checkbox, #productEditFieldsContainer .radioBox{ + vertical-align: middle; +} + +#productDetails .checkbox{ + vertical-align: middle; +} \ No newline at end of file diff --git a/posterita/posterita/web/css/popup.css b/posterita/posterita/web/css/popup.css new file mode 100644 index 0000000000..e74efdc479 --- /dev/null +++ b/posterita/posterita/web/css/popup.css @@ -0,0 +1,30 @@ +/* + popup.js +*/ +div.popup { + max-width: 600px; + border: 1px solid grey; + padding: 5px; + background-color: white; + /* The following properties should not be changed */ + position: absolute; +} + +#popup_overlay { + background-color: #000000; + /* The following properties should not be changed */ + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 500px; +} + +span.popup_link, a.popup_link { + cursor: pointer; + border-bottom: 1px dotted; +} + +.popup_draghandle { + cursor: move; +} diff --git a/posterita/posterita/web/css/print.css b/posterita/posterita/web/css/print.css new file mode 100644 index 0000000000..56bf0f385d --- /dev/null +++ b/posterita/posterita/web/css/print.css @@ -0,0 +1,76 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +/** + @author tamak + */ + + +body, td, th, input { /* redundant rules for bad browsers */ + font-family: verdana, sans-serif; + font-size: 12px; + voice-family: "\"}\""; + voice-family: inherit; +} + +body{ + margin:40px; +} + +table.header{ + background-color:#FFFFFF; +} + +table.content { + border: 1px solid black; + border-collapse: collapse; + background-color: white; +} + +table.footer{ + background-color:#CCCCCC; +} + +th { + color: #333333; + font-weight:bold; + background-color: #CCCCCC; + text-align: left; +} + +td.contentname { + background-color: #F2F2F2; + font-family: Arial, Helvetica, sans-serif; + text-align: left; +} + +td.label { + background-color: #FAFAFA; + font-family: Arial, Helvetica, sans-serif; + text-align: left; +} + +.nodisplay{ + display:none; +} + +.big{ + height:50px; +} \ No newline at end of file diff --git a/posterita/posterita/web/css/screen.css b/posterita/posterita/web/css/screen.css new file mode 100644 index 0000000000..4c69f4b028 --- /dev/null +++ b/posterita/posterita/web/css/screen.css @@ -0,0 +1,118 @@ +@import url("displaytag.css"); + +@import url("alternative.css"); + +@import url("teststyles.css"); + +body,input,select,td,textarea { + font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; + font-size: 11px; +} + +h4,h5,h6,p,strong,div,form,acronym,label,table,td,th,span,a,hr,code,pre,hr + { + margin: 0; + padding: 0; + font-size: 1em; + background-repeat: no-repeat; + list-style-type: none; +} + +a,a:visited,a:hover { + color: #666; + text-decoration: none; +} + +a:hover { + text-decoration: underline; +} + +img { + border: none; +} + +table hr { + height: 1px; + clear: both; + margin: none; + width: 100%; +} + +textarea { + width: 80%; + height: 200px; +} + +dt { + font-weight: bold; +} + +acronym { + border-bottom: 1px dashed #000; + cursor: help; +} + +ul#stylelist { + margin: 0 0 20px 0; + height: 20px; + padding: 0; +} + +ul#stylelist li { + list-style-type: none; + float: left; + width: 100px; + border: 1px solid #ccc; + background-color: #eee; + padding: 2px;; + float: left; + width: 100px; + border: 1px solid #ccc; + background-color: #eee; + padding: 2px; + margin: 0 2px 0 0; +} + +ul#showsource { + float: right; + padding: 0; + margin: 15px 20px 0 0; + width: 100px; + height: 33px; + list-style-type: none; + background-image: url("../img/viewsource.png"); + background-repeat: no-repeat; + margin-bottom: -30px; + text-align: center; + line-height: 30px; + font-weight: bold; +} + +ul#showsource a,ul#showsource a:visited { + font-size: 11px; + font-family: verdana; + color: #fff; +} + +table.sublist { + margin: 0 0 0 0; + width: 100%; +} + +table.sublist td,table.sublist th { + width: 50%; +} + +code { + background-color: #eee; + padding: 0 2px 0 2px; +} + +hr { + height: 1px; + color: #fff; + border: none; + border-top: 1px dotted #ccc; + margin: 20px 0 20px 0; + width: 50%; +} \ No newline at end of file diff --git a/posterita/posterita/web/css/style.css b/posterita/posterita/web/css/style.css new file mode 100644 index 0000000000..1c52557fad --- /dev/null +++ b/posterita/posterita/web/css/style.css @@ -0,0 +1,566 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +/** + @author tamak + */ + + +body { + margin: 10px; + font-family: Arial, Helvetica, sans-serif; + color: #000000; + font-size: 12px; + background-color: #C3C1A9; +} +a { + color: #be0027; + text-decoration: none; + font-size:11px; + font-weight:500; +} +a:hover { + color: #666666; + text-decoration: underline; + font-weight:500; + font-size:10px; +} +a:visited { + color: #be0027; + text-decoration: underline; + font-size:11px; + font-weight:500; +} +a.left, a:hover.left, a:active.left, a:visited.left{ + color: #be0027; + text-decoration: none; + font-size:10px; + font-weight:500; +} + +a.message { + color: #be0027; + font-size:11px; + text-decoration: none; + font-weight:500; +} +a:hover.message { + color: #666666; + font-size:11px; + text-decoration: none; + font-weight:500; +} +a:visited.message { + color: #CC0000; + text-decoration: none; + font-weight:500; +} + + +a:hover.submenu, a:link.submenu, a:visited.submenu, a:active.submenu { + color: #be0027; + text-decoration: none; + font-size:11px; +font-weight:500; +} + +/* +a:submenu.left { + color: #666666; + text-decoration: none; + font-size:11px; + font-weight:500; +} +a:submenu.left { + color: #CC0000; + text-decoration: none; + font-size:11px; + font-weight:500; +} +*/ + +h2 { + color: #be0027; + font-size: 20px; + text-align: center; +} +h3 { + color: #be0027; + font-size: 18px; +} + +h1 { + color: #be0027; + font-size: 16px; +} + +.titleleft { + background-image: url(../images/titleleft.png); + background-repeat: no-repeat; + width: 202px; +} +.titlemiddle { + background-image: url(../images/titlemiddle.png); + background-repeat: repeat-x; +} +.titleright { + background-image: url(../images/titleright.png); + background-repeat: no-repeat; + width: 21px; +} +.menutop { + background-image: url(../images/menutop.png); + background-repeat: no-repeat; + width: 168px; + height: 15px; +} +.menumiddle { + background-image: url(../images/menumiddle.png); + background-repeat: repeat-y; + width: 168px; + padding: 10px; +} +.menubottom { + background-image: url(../images/menubottom.png); + background-repeat: no-repeat; + width: 168px; + height: 15px; +} +.contenttopleft { + background-image: url(../images/contenttopleft.png); + background-repeat: no-repeat; + width: 15px; +} +.contenttop { + background-image: url(../images/contenttop.png); + background-repeat: repeat-x; + text-align:right; +} +.contenttopright { + background-image: url(../images/contenttopright.png); + background-repeat: no-repeat; + width: 17px; +} +.contentleft { + background-image: url(../images/contentleft.png); + background-repeat: repeat-y; + width: 15px; +} +.contentright { + background-image: url(../images/contentright.png); + background-repeat: repeat-y; + width: 17px; +} +.contentbottomleft { + background-image: url(../images/contentbottomleft.png); + background-repeat: no-repeat; + width: 15px; +} +.contentbottom { + background-image: url(../images/contentbottom.png); + background-repeat: repeat-x; +} +.contentbottomright { + background-image: url(../images/contentbottomright.png); + background-repeat: no-repeat; + width: 17px; + +} +.copy { + font-size:10px; + color: #666666; + text-align: center; +} + +tr.noborder +{ + border: hidden; + +} + +.borderBottom +{ + + color: #be0027; + border-bottom: 1px solid #be0027; +} + +.createcustomer +{ + border-bottom: 1px solid #be0027; + border-top: 1px solid #be0027; + border-left: 1px solid #be0027; + border-right: 1px solid #be0027; +} + + +table.content { + background-color: #CCCCCC; +} +td.contentname { + background-color: #F2F2F2; + font-family: Arial, Helvetica, sans-serif; + font-size: 12px; + text-align: left; +} + +tr.contentname { + background-color: #F2F2F2; + font-family: Arial, Helvetica, sans-serif; + font-size: 12px; + text-align: left; +} + +td.label { + background-color: #FAFAFA; + font-family: Arial, Helvetica, sans-serif; + font-size: 12px; + text-align: left; +} + +td.rightLabel { + background-color: #FAFAFA; + font-family: Arial, Helvetica, sans-serif; + font-size: 12px; + text-align: right; +} + +td.greyBgTextBold { + background-color: #F2F2F2; + font-family: Arial, Helvetica, sans-serif; + font-size: 12px; + font-weight: bold; +} + +td.contentnameCenter { + background-color: #F2F2F2; + text-align: center; +} +td.contentred { + background-color: #F2F2F2; + color: #CC0000; + font-weight: bold; +} +td.contenthead { + font-weight: bold; +} +tr.white { + background-color: #FFFFFF; +} +th { + color: #333333; + font-weight:bold; + background-color: #CCCCCC; + text-align: left; + font-size:12px; + +} +.nb { + color: #be0027; + font-weight: bold; +} +.loginbox { + border: 1px solid #999999; +} +.buttonwide{ + background-color: #cccccc; + border: 1px #999999 solid; + font-family: verdana; + font-weight: bold; + color: #333333; + font-size: 10px; + text-transform: uppercase; + text-align: center; + width: 130px; + height: 18px; + } +.button{ + background-color: #cccccc; + border: 1px #999999 solid; + font-family: verdana; + font-weight: bold; + color: #333333; + font-size: 10px; + text-transform: uppercase; + text-align:center; + width: 100px; + height: 18px; +} + +.button1{ + background-color: #cccccc; + border: 1px #999999 solid; + font-family: verdana; + font-weight: bold; + color: #333333; + font-size: 10px; + text-transform: uppercase; + text-align: center; + width: 120px; + height: 18px; +} + +.button2{ + background-color: #cccccc; + border: 1px #999999 solid; + font-family: verdana; + font-weight: bold; + color: #333333; + font-size: 10px; + text-transform: uppercase; + text-align: center; + width: 160px; + height: 18px; +} + +.pagetitle +{ +background-image: url(../images/tab.jpg); + background-repeat: repeat; + color: #be0027; + font-size: 18px; + font-family: verdana; + text-align:center; + padding-top: 9px; + height: 29px; +} +.pagetitlefont +{ +color: #be0027; + font-size: 18px; + font-family: verdana; + text-align:center; + padding-top: 9px; + height: 29px; +} +.buttonClass +{ +background: #FF6F0E; +color: white; +border: 0; +font-weight: bold; +font-size: 12 px; +} +.buttonClassHeight +{ +background: #FFFFFF; +color:#FF6F0E ; +border: 0; +font-family:Times New Roman; +font-weight: bold; +font-size: 36px; +} +.border0 +{ +border: 0; +} + +table.officeTable { + border: 1px solid black; + border-collapse: collapse; + background-color: white; +} +table.officeTable th { + border: 1px solid black; + background-color: white; +} +table.officeTable td +{ + border: 1px solid black; +} + + +table.content { + border: 1px solid black; + border-collapse: collapse; + background-color: white; +} + +.label +{ + font-family: Arial, Helvetica, sans-serif; + font-size: 12px; + text-align: left; +} + +.label12pxbold +{ + font-family: Arial, Helvetica, sans-serif; + font-size: 12px; + font-weight: bold; +} + + +td.borderBottom +{ + border-bottom: 1px solid #000000;; +} + +td.contentbold { + font-weight: bold; +} + +.orderTitle +{ + font-size: 14px; + font-family: Helvetica, Helvetica, sans-serif; + font-weight: bold; +} + +.ZZMessage +{ + font-size: 14px; + font-family: Helvetica, Helvetica, sans-serif; + font-weight: normal; + color:#CC0000; +} + +tr.noBorder +{ + border-collapse: collapse; + border-top: 0px solid #FFFFFF; + border-bottom: 0px solid #FFFFFF; + border-left: 0px solid #FFFFFF; + border-right: 0px solid #FFFFFF; +} + +.border +{ + border-top: 1px solid #000000; + border-bottom: 1px solid #000000; + border-left: 1px solid #000000; + font-family:Verdana, Arial, Helvetica; + font-size:12px; +} + + +.borderRight +{ + border-top: 1px solid #000000; + border-bottom: 1px solid #000000; + border-left: 1px solid #000000; + border-right: 1px solid #000000; + font-family:Verdana, Arial, Helvetica; + font-size:12px; +} + +.daySelectBox +{ + font-family:Verdana,Arial,Helvetica; + font-size:10px; + width:70px; + color:#000000; + border-width:0.2px; + border-color:#ededed; +} + +.monthSelectBox +{ + font-family:Verdana,Arial,Helvetica; + font-size:10px; + width:70px; + color:#000000; +} + +.yearSelectBox +{ + font-family:Verdana,Arial,Helvetica; + font-size:10px; + width:70px; + color:#000000; +} + +.customerDetails +{ + font-size: 12px; + font-family: Helvetica, Helvetica, sans-serif; + font-weight: bold; +} + +.header +{ + border-style:solid; + border-width:4px; + border-color: #CCCCCC; + font-size: 20px; +} + +select +{ + font-family: Arial, Helvetica, sans-serif; + font-size: 10px; +} +.boldgraysmall +{ +font-family: verdana; +font-size :11px; +color: #999999; +font-weight: 700; +} +.bolddarkgraysmall +{ +font-family: verdana; +font-size: 11px; +color: #333333; +font-weight: 700; +} + +a.breadcr +{ +font-family: verdana; +font-size: 12px; +color: #999999; +text-decoration: none; +font-weight: 500; +} + +a.viewcert +{ +font-family: verdana; +font-size: 10px; +color: #be0027; +font-weight: 500; +} +.breadcr +{ +font-family: verdana; +font-size: 12px; +color: #999999; +text-decoration: none; +font-weight: 500; +} +.darkgray +{ +font-family: verdana; +font-size: 12px; +color: #333333; +font-weight: 500; +} +.bolddarkgray +{ +font-family: verdana; +font-size: 12px; +color: #333333; +font-weight: 600; +} + + + + diff --git a/posterita/posterita/web/css/teststyles.css b/posterita/posterita/web/css/teststyles.css new file mode 100644 index 0000000000..796871382f --- /dev/null +++ b/posterita/posterita/web/css/teststyles.css @@ -0,0 +1,50 @@ +tr.good td { + color: red; + font-weight: bold; +} + +tr.bad td { + color: blue; +} + +td.money { + text-align: right; + padding-right: 2px; +} + +tr.bad td.money { + font-weight: bold; + background-color: blue; + color: #fff; +} + +td.r,th.r { + text-align: right; + padding-right: 10px; +} + +tr.total td,tr.subtotal td { + background-color: #eee; + font-weight: bold; +} + + +.DR +{ + color:red; +} + +.CO +{ + color:green; +} + +.PR +{ + color:yellow; +} + +.CL +{ + color:blue; +} diff --git a/posterita/posterita/web/images/back-menu.gif b/posterita/posterita/web/images/back-menu.gif new file mode 100644 index 0000000000000000000000000000000000000000..dc02cd77a1d527cd687601313ae3da957628e527 GIT binary patch literal 715 zcmZ?wbhEHblwr_hxXQp_mAfjk>$qd#I*ZKZiIdL#|NlR+?^JBxDVxG|A#I0TN;mn` z?((eM7SOa02o4`UtfHcF|Ni~cr%#_he{t8YUE8*8JAV9lXxHJ)z8w{9Q=FWfV<(+n zw{FAZ$4{?azYPReuU-wSUAu16rb*MLO`0^V4~VDDifY?CZPu)1%T}yfwQAF*tqHLy z*Kc31nsapCqD85xsSKn5#h)x-D79E z@#POD6+7>}EB7%IIrXCCXN^V0?L20gf78xCZQWUS{`&K;jE#-C%>|6??HwJgO}%~n z6B>IaPMI=!>Wp4iadFN$bH&vq^prI;l=URk=g*xtmz8tlCQb=eeJvR!B^fP!Rf)}; zHyo5ulMy{}@`Q}?frFffH%TZfiCnvWL+R{!R^EH}RF(K1KY99CNtN^dy}S1%H2FV% z6qOPXkP`i*De;>3?LEn`6V(n2@7Z!Oho`&Msw@*R#`-#uLB*&?80VUWz)qFOS;r*ad^(f)^4buvoMtem=P+b0Al z9)5I&i;E-TY?bK~9#x+i8i`SkuWzr)e|_()wfXz|dj&ZJ_DMAsK04B_Y+tvB;q&tg zi|zG+5ytfT>gMGA=VEu4v0T~PE$?q<^Yio5t^6nU$^C8kc5~(a`TX$bUy^%&hYU~3yZ;9k6nN+yk~p@c=wyyn^oivq zUTdTLFRm^-{r23ZdmAcpSSO!|$T{#O;x8{MXRf)ZEhACaT2A GU=09q07TjV literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/barcode.jpg b/posterita/posterita/web/images/barcode.jpg new file mode 100644 index 0000000000000000000000000000000000000000..e3f0042f332d5f8ffdaeb7bc5bbfcb14421b7bc3 GIT binary patch literal 3993 zcmb7GXEYm*yG|qo^uTdP88DT-DRI;Gk0{n9kLF+_B4;$Qt#>_a9?I;KG_ z)0)u(-fLI^)C7Ar%eu{sdD3zUo~-4eynI5_1@Ak@VU@P@oNRBM+;_;raUJ&mD&7=0 zR5*HJJL^M*%^=zkJBxKmfr7nPj16~QuJ*9cI;fXNe~T%5lKkb1SMj>{sv<&3y7Dxi z(z%Gsdnw;8o_;TyuJ2IAQT|x@`sTp;Aiws=3*Puk+0%X&u9B-X#e}!7o(nj~;z=D}vOU8}P zx9>$`OU0?wYaWAg1?|(&WxqBFj(7EL6m4tjF;d z|5`@oSX!MzR9EC6!srXBKyu+AZ3f_^+WuJWK57*@)g4xDpX;vjVtN5ttIGpP;nUJL zS*A1rhTKM$JiG?ukvqCQA>$0VrT*9T!X3 zSi{G)l6ii9|3UGAleDe6^s^Mii~l-iuQqQKipUi_GGBlNy#(j=W=!?!2M5 z&raW%f3SSi*s=ff`=y9up-nm!a2G$XKG`?&MCZiTn)3n>r}QU|Syo7OXyjLdVO#}E z;~N_3dDqVxmg?i3WVO>H@8MAd*`_IKQ7KaX+CYlQehgBh`ymrGCPezv`ojqNj2818 zjzHmU1>o>6;yA~W$(dl@@#4J2xJsvI#WuKNeMZ2@CC#8cm3korq#R<)QnGoav6gb0 zop6W-elSHhz6;co+Fuh80QJ7{o#5nMN{r9J54~=pI~J6jq?6yJ3gXX=3qM^v^q-*Z z9)kLH483j~0j7?E1HCIF1)8S$Hx(w>YbFbA=6m3`TA~hplQ-VIgHUZ&A_Is!BY%3^ zj9XW2i&hK1&zNA{fk~Koo*SQE9OK5$jP`F?_Q91oum*or!#3kCpCC`}PpL&?=-Q8M z-bQEN+c^FPJ>N??TnX)yeOd4{q6(pcDkAX9K5icUSVOblau@kxsh8mbFu9AiyX#VI z->3ETmMY|ZF8a#l${*jwZ~>9rq1x*~RIXiii@c=-&S@j;r{$O;BWpwEUU_pT% z_2q%z%=Sy|#mvxxFMDHUp~0?h&z$vm!UwFZK~cn#(>vz&Ra)o0DH&LUe+)h5g#<@- zT(^3(V&jF+jC34|=3R!ln~X6*en)Hb1D@O#UQC@nh6lMP!X#(LMC*kej+zH1c6QG^ z2?sZ3PxFK+R#2@?0sHK!`5`mb=hh5axk{S3ydOQK1X}21G~6|-k~Y~OZb|Sx3$~~L z=I~wp9HQ`w?Zb0{xWgST&uT;gPXfPjf;E-h=^nB6xYMBOzxQ zIhPQkc+#TCSO&f#A!vUfhyt~BXY~F8CRj_h4c(Xey5@Z@)l_BW9d+Bj>Biin*|d#! zQtWdJmGIu@E4_#1w}QJ?J-&v(#}8ppF8{Rs)_SeusQ9@pmNE8&)t+8yw)fMNn-jUR z%E>Q2SwUXC)e;iQJk_>+2l~Sn!pF=sLPha~GiNZ=aJ)Dc7ATkXR6KKD!aZ443q3H% zeLHJPCYiuEmlU0{D5h;5>s4dZ?^TLU34JsqtHzS@N-JcU4*-dRA z&Kt#Pr+4{(wbQuak8qKWy)I>VWFVwJ9=bfjbQdQtP>!DNh*Zv2R&pZ@4k!Lek4(d8 zMb|^%MFY+57XW97tv=VdOl#bXsfEc(yR*Bx4p(fQ3EE%hBs;3kZFxP~ey0yjHY>S1 zO4gcDIjI*U=YquRkQ<5Ye_Gk+!)J>%gl~<1J?lKR*Lg--=_&jB2;->GZ5LeCNOrieeG3?R^wW54BEbmYKb$c5rY0P@=cYk6b*W8eb3vdHTyg^ zs}MSQtPl`Gi2j200p?*=KyFImQ9cPmc@-##Giv6hx=8GS zby8v{^j9gr?7@7}3-L+jOBY2e3%0F?tdO=6sQ@xp~GMd&qOXkG$fItk>JH!669wQ+? zg*`DF|Mb)Rh62=U%k1oN(7o){@BFIWdW~WaZn-Y|B#Ea)BD4^h4wjkUlJ1GXg4uw^ z5=bwvzv+zz!r*p^;w8S}FrntsFozB9I~9}OAEnLw)DX3)crxuA%zOa|>d<;e6R>>@JuOw z+ZCmbUS=Yd6Hnpu2m zf?Gd(=z4!P*(-AS0~Qo1F%2lVDV)z=l%y9_xp?^2Z$?3(dzgtEJuMqz8A9z{cgy|f8(XGdxl{WD>?dscV%v=GtN&WzIatm z7r1VY??j6T#1+ZCUc8IA9bJKaeF5-o^AsD%>wj>xOJFMZh+9BybPrS{)TM9XgAG7! zU}lyAX&|8TA;e$`SK4SES6o{?P?fmo5;@aphfFS4e8OL@yb*B@+s#%P;4cnSnt$OB!2* zrln?JByV2r=~0&}4C{;7F4|iD_V>=kQg@@gp3g7^%MXiL=3B~b#=C;I%}Anx*29_) zO2_Rs9UKW=7B0(TtO;uMh=V&bbew<)aa}OP@3wxL1zL%Of6%(SAi+Aoi2U?g#}uen z$~OmxlVD<6P44Ed7@;(^`mtKvVX`MFvi&l}>z_TuV?v1G4nCn!a{HicmP|}QU01gdx L!qP&uFUI}@a9e8b literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/bg_header.jpg b/posterita/posterita/web/images/bg_header.jpg new file mode 100644 index 0000000000000000000000000000000000000000..10dbd74e8acdbe80927dce4af7f5ad0b6d1dcf08 GIT binary patch literal 1792 zcmex=R-tZb|xz{bJG4g_o*9GqNST$~&{V890g0&u{{ z%)-LP#>T_J!6U@S!zUyHk`WOE%L_s%0VoC6gTnZKfI*OhL79nznNg5|Nsy6Qkn#T! zh6)BoFaWv}1{hhGnK&V$j4&}E&Bz3FumDgw2P4q^KzWFqFk|9HCg#a3q9KNkjf#P+ zf`t)sdG=REXwFh_;TAQ zXY)=|Jzv2yau2kvUJji!pLXA=q# zNMMr@An8Peb^1T51_NnswV^_~Ae`iI1OxVTk@iz-zyHKj>DQM=&A;uNE#Hy+cK&z! zZKZKh#T(PRbV3((i&iW;8m9r`L_X>k{g$!l=sYkl6vz{aSbbDX3&s@#s*HlEgmMC1 zyMU%V>IQN5R)Gx^`|=8#BB1FYML?^Exrgc z9M0AG=-Ra>FliCY7`XHA)rBp;{M1Mzz3ie$yp%lf$F~l zWgLvaYQw6Vj@CNn-Pirk5N-bV)qjRuwfzG3!G7SiRG+}}`U-nl!zb2H3>>U)SQwu$ zTQR)7!ahNpL(%yJ8)F3H0tepT4fzflg7XVB1Q-~2Ua@8fFxNeZPf(vA=di%v&SA|v zmiz`y7L7`Va}Cy|j8C|L1|ca~`+|kx{tmtaL5wb+80S_syt`mlv;A+*{qL*)ZaKGK z;N`df48^~vIr}+ture__FuY-4PwM=^G{IVggMmr?!Kx)p4GiiJxGn*0X1v3|_f~^} z;Q|8(gKdNH0tN=jJB!Q@h;TxcGcbJ9FkxU~;7{Or!MKz`wnMgy#bK2}Lx95nn*d13 B)&>9o literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/bg_td.gif b/posterita/posterita/web/images/bg_td.gif new file mode 100644 index 0000000000000000000000000000000000000000..dc5fb474764673a6debb5229d0bcaa53fd13a4f9 GIT binary patch literal 1928 zcmV;32Y2{KNk%w1VU_?x0K@qRz*y~zJ zlPJTe6qljp%a|7h(yV3kBhH*UA@F2K?`Nr?3@Wnp;Ib>yq#0jDf)=d~yr_HTjjVSs zBBHDq(roQYw=M^yVVP~@IH{>qkeU{*WlL&{Hw7f*7UgQ!F5bLi_fqnEGa)s>gFoE^ zYD_^mHH=+$7)`o#hsJcjp35kyuivM6&`MS7bMw_NpUKfR%^S5>)iP(snEV>{580S& z7v_Sy(PGiOd;7i%JRM|quBAPdJzHc|+sr*zaKyFrh4azVm-Y=aFLtsXjYCy9?@3`q zCCGCyk6yic_F%E*415R4$3s+t*_RLhe&apI-v$2tH(gyZ3AYh(@fpWmHP|fZ#RKaz+%Px8 zjr*Oa!IMx%38juF@;KUb0XEa3kaQS0-(^nF$iVROFNsh^qXilan<(fP4IN@&<>eZTyO>L(WRlg*8KtJW33FQQo`e~_}RHpc5dxj3j z6lEDsLlupW?m1$VlumG|rE6-6+KQbP^eLz>irNdQD3o{Vq?N9kCZIX`_iA-Y$vJDS znG}JIVY!MZ>65AY`YW(irZ+7AaK(-VjZNDr`-EYp_L=IqQi~r4;0=@4ot$OYXUtW*Xh5g~s{9v7p*HTccalYo-SH@+&a~{*DW<27p?7 z?T@h@j3})NADQHh4@W%lz7&BM&5d${GsOE!;PlQ=r_3s_C~l07dt1)j<#9GE9VyfLIxPXzJ4@{+wN?8F5Y{r! z`J#~w7q#mIO+QWc#AdIoW1FX0y>`2Y_7!s69?V_$*mp~u_s@H`N$}rn2X6G>ZGBC* z*qCRo`R0h@U9qodx2*R6&_M3xF)p)J&cVHxOAx{9uX8TD-HB7Yc$Dd;?YB9ln?4Kb zMA*j_>l8Q*d+f7wUOUgXPbskOqhC$5WOKy(fPF3zZ~XDx!=C)|wtqftzTPObwAUrOEtaY zAMl*;zsntOfB-O{1`&8N1uk%E!O|F(AUHksP4E}{fmZP@NI(r1kb|D9->Rs^CRYiq zU^AJ)N7y%j6atWi8FZoil-EH8f{um|vf%?srxzXCfrqEEAO-;-fGSS$iddYY0b!Ux z8KSF!qMH!MnplbdAJ{C4E1Y5#1(3xyYVn0cjG7V07eZm(kcrK3q8WcNBKWD%if(kH z5D&;jl!@<%U?hzg&nJ`L>EMhP@FND-7)U`55_xgtSM%(bNH^sVR*u8~BqcdON>(z9 zm&D}eis&!Kb+T`td`u`uSv=R3a*epmWhGM?f!VRLT&^Tv(4vQ}49qeKeXL~!Zkfww z?lP6Wj3F?k1+-zBkC83V;Ukl9uQcM40N`w1o9XP`F@a2iz{2>+B z2u=cw^PYf2B^;xP&VO+-cle8CK;F5>Zrbvj;l$@SEjdJfcF~{e6s8>onht^*$)L+b zs67=bPKI{>FL|ANsKx%d&h@l2DHfFqM(0_@dUCX*<=kf>r8&}w)-j;FTTMzIAWs3* zlK=?_>Q9GC)SuqdqcY8;AzL{^8sbz%Y^a`8div9#CZMQTHR?iRy1{d5@{k~;+C*O! zRd`aho>tAOT93+Ab2@aX=?rT%!w6Ml%D}8r^eI|}s#dJBRi9mbYrnusQh?IcF=aL5 zS;3jsz83YbSQH{ie+f~!8rGT=O6*kgT2;O}cBqiOqGY`a*UA>Qq+--8PdU5St9}-= zTLr9JXUaULGSI1Gtt&_1S*PCm_P4+du5fVzF zn7DSR*ytGc7%6$hIB9taREfFC38UEw8fx+>T53van%aq~+G@$_8tVuvTU$tLo9lFKS96bdsUA;tYoh^i|-QC0O9bO|&URQqJ1dhHQ$nKu? M9{(**KT`kzJ6L&uY5)KL literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/calendar_icon.png b/posterita/posterita/web/images/calendar_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..92cb163d12d85551650f4de881999b04f99e89b6 GIT binary patch literal 1111 zcmV-d1gQIoP)IJ)d#M@l9v%S01Ku+L&tQfJnBn;%;sIiw%@-fHPd|8fSN$=8 zmF6h*KR?erQB{Niu4*v=FkJ*MZ)z+0XruS_-qZE^fnxByz&HD8QqDmF1Q3BPz6)GF zD+7Tb02D%<1+_GeBCVL27{iWng_i^YNFqt7d<95?1S$H51As+e(`oLCqEHNg_^bEp z5981?Dnz*I`O?4_tyPFH5D;1cf9Jr=3WSBt2D8I8sXQak^FSL96y=f$LMZ@wmIYcf zi6YO1l1x&O z3V;XVI4U8$_wytfkH-MblZ1$@wGdKH51g8nN~-DUsk>@S%`FSR6cqy$0M9IhkV1f2 zN?ETr0F*@mqFTKUl3VgiNq6|9xqZBPvVL3C>dTy@T)s--JUX3DtJ{m?ISK6?wcAZ* z2C%ZSBBZ1z2Chz7*B8xhx1*Z9GCS9kS;aF2fY`?`vzeU=Wy1CwA;5R`CNKc=9bx2+*1;~8!lbYTIxm^1ktQ$4(drJCgV|(B;I=xDh)ne zTlq|^1#z6jvqccXl?8hRfSJ`5QwAIQ>9R2#w3WtsE4=sMp)>t69@xq8&71vRuk)z9 zwffesl;Y)+ryFal%|;`)=c7EXun=nvl`j0;hmrLY%fJ18=cgZjjON92+dfP9`1k|> zaVfkbW?~1f`1xw}R2Ybpi95_}Gz^dL{qpM%-(G$1lgDGRx0ij`cYF6Am*C9WNBbio zD7V&Txl&TXYt;b@0IDcmtLD6uQsDZHcZM5ZSl_Tgef!Oltew|3qsETzh?F>xq*e$5 zOdyHPG@Oqi=t%qwVK}C92jHh dQVRbg(chHD9DHgcb!q?r002ovPDHLkV1fq25s3f* literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/ico_printer.gif b/posterita/posterita/web/images/ico_printer.gif new file mode 100644 index 0000000000000000000000000000000000000000..de27b46458feed6a5c5f8559959197df52c6710d GIT binary patch literal 212 zcmZ?wbhEHblwpuz*v!RnhSB7@MZy^d;|D3tuV=4+-m&1ziOW|sL*A|4b5X+m|Ns9C zs6g>23nK#q7lRH+7-R+mOJl%E&((V^UZ36l-BF`Y=?3d^rZqX-8XE1pOy=ynA)Rl0 z_m)wpTlwdW4KpWwjM()i#Cy&Y%TSJWb5}D&?p0%H-cVt4A#bI|=BnIhw{Cne`;|OX zoP+H}P@;p#9SwFSmMS+c7AE!vF4pE&yLP7fVv)e0P*KGagAfsw`SWKlTD+u0kii-N DAp=kr literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/iconCSV.jpg b/posterita/posterita/web/images/iconCSV.jpg new file mode 100644 index 0000000000000000000000000000000000000000..231da309aa99205cf777e06a484616a40eb6d6cd GIT binary patch literal 1752 zcmbW!XH=6{7zgkh-jFb2B_y$c!7!qN15DT`QU}CF zi9|g!{Vm%l#>U2^jTTns)Ex#!#?+NZ5Q>V57-fvws#R)KZK5{yKNnmNunK?*s1QO2 z$YBu>76CT`5&#H!S=yDre-uIvLdv7i3W`d~vH_6_kV8O_91@b3MSb;Rs8vc3yJ9&m%hH7c_l0R#y16p zH;al(ZdC|`qRJ}qx79y1G&VK2w6^`&-tnZftNZD*o|l6|!>>k0$6k+1r+)b`Ju^G^ zael>x0MPHOKV|=LVP!5kBoacRS6m1=j;tXpQeK;aQr+c*_F>|5sAm=MyVLUTeXpo% z0n+ zLA^b$9{6UsElbQ6VbBMI0SXMHgwZK)&+#>p8}iqstva7o+FKBECVJWo5)&a|UMTb0 zIgPQ>#qgppxcNeb!KQWz+2($~U*GkkF>HZ)%sHt*SFC0(c4!sbXL)trzc}*zNo^#* zd2p<@loxtr_2lVx_n>(D4BrTmAwJaE+#_>A@-g{h<17;QlPC8*U8-4@kF=9UUG6N` z>~OlvR#r#zGsK6PzwE?we7ySRlPyOs+zQGLy~C>r+$Sgw&QV|HnSOGFv&md5E;*K_ zYyMo{o+hS?ZdrvU9wQ4W=`6drc_)v{EHksJ%AW5MU?6zQm>P|$F5Q*Jys|9qt5>ly zdU&!b`#{Z1gv|t>?ep1w!%BVkn7huVAr~8xF)yTtlOkT$IZWrgS+e%>q_7Xx`aPiY zi}5V?NL)vqv*o834o~buCk}Zhl-Dene8O2ndJY5s>9W8>tbXhIkrMm7ury&;xVLRL zJ;hyA7e8pl?g;i`d{k@#GeYJWNuk zPbB2n?x;~j+!3F$Yy+zGtIOsu4At5%G3p)$HWijM%(=NO&}Ie}9Twjk+Ff(}s1%Vy zsTzSnYHkg4>3#pua^yz#>r5D&n4~3HcPw{TJhOf^`)+O6cguO9>`~HNe^OIQ=Dl{F z_N}K;HIKS?z(B~@fnA(!k@z)}Mr)$4ENk8wlMI--KK@c@2+bwEtIq4?yDCQ;hQVH@-RUjtk0*#RUS3iZd|iFj;nS!8^F>$}-hGS~{5o zgWc(Ox~wJ&*JYKokstR}OE5nBw;AWg^F9#6NmosZvswdE1ADIB9y|>Ld@05IY4FXp z^qYB-)7(m%;eJ%EP1~HmTf&&M)5=3OwOb;(eV}G*i-aUS6 z1Gd{XX{EMUv^@&nDav<Az*c}O)>q(;kplc&f7C?;&k-KAzv*PxAYNVuCm*0vN^w~*FESy zPfBo@Ie-egCcdNJk)9oL;UP=Nsoe2;W?;H4CiO;!qikCz%9ogq!+NFaC4Px|*X91! ItKnzA0-i<}uK)l5 literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/loader.gif b/posterita/posterita/web/images/loader.gif new file mode 100644 index 0000000000000000000000000000000000000000..240d4e17dcb58300339b6eb0a015afa154de7824 GIT binary patch literal 10819 zcmb`NXHZk?{Szp$gHS4+7b>F{7L+g(6RnsW|Ctwc%I6gjx$~nI6 z9xr_TKBKIo{@v)Sw}aguXK6F5?fp~3lgm@{>-43~#ntVqrjJdXwAGEzo7-RB57Bq` z_V>OXd>Ebowtv|9Vdf)kVQXh^bb6(&ce13e|KRW_r?M-luvO%jz-<>xQ#VTsVNY8( z8(~vBQ>+8p)Z)CYlNA~uatH>%0RVu=F|)S%lgGE!bkr5j%QFB^PRX7efZsO>fE)`8 zM_AZq*c6vLY&2tJKe##0V#~LEw~wh=7)>w}l$7Vv?Qkt~pwR7ZnL!1u)Z-dkH5fu{ z+c`&MOsn#qny#De+)MeXN!v!$W4CP3sNLaEx#WRHH9^mB~8I8abpkcU( zHgPRWy&nX8X@&sNny=FpKV4Pmo)WGT+-Za%xF|AE+8yZ>LUU&C& zHn%tQz3Zv!?fcL&-Zt4W-8EF%%2&k1APa`V;LI$i*q9-VMc+7hSwFM=`0?fI{?6LQ zSR}px#{lcOj=dnFMg*{L`E(6rv=O)=+VA)V=I;dXfAKTotD4iK2yz}9k%I8JYrrk0 z34Qh0cpQY&WxZEEHvWUIvgh*VA!p%0_DaZ%$~FAzhZh>@M%V{f)M3>AMY zG$?QxS&O%OmMFu7)B~uk$QfWB>nGhCYbAJKth>vu?>m_^aUXnZPxZX;{B6LgF?A#5 zN>qol;28;|ex-3wHP=vJn*Od?FHUY&z2uf0k%>!oNA|8gvHx`C_0nIH>+YN50mhxp zP57^}(~Xw<`KNr9w%)XReJ>X@I@n#TjBE?sN~`;{+UENF*>tKKe5g>4dTC*@b~v_-kA=qy^vY=>&MR}kLSiK*dP#=3)2xYX;paCk7(tb;6{BLI*hIch(!-yemeA+-z~{Bd|WEt z-1Yh|8>2|&b?m~EThbclF*HG2&e)Nvj@($j``taE5-d8*;DdpKS)d8Da5&L)^qGV| z>aJFPikZ_$z8>0yd*zwUQCvS9b!h+|&q%qmNbtM)O_GGy?y$BaCs0vVra^(|NZ>nNWbgK>LOySdv0~a&HvN<;>L$Bhts2l zJGLc^7$VjAm=2M}0ovrj40>!#x~4!PluhCMISeX^6nW+hs#nvcg~-6IdMv?oHAV~! zC94qL2oGA`Ns_s-Tx!d?+!-ega7i@~_tBo^{dkVFiE8Pm zt#`|Ah*bH zAvw|W^bNoLukR-Bp*Mau8hskv_`_O7_9ysfyNK|N@7tEz=N`Y7@4J!*F?HXJPPu#d^sNcAFdfKhCu@d;|C7Y>KU$dGs#+do~=jo1eyaicqTlLd9 z3Lb?C={@}3)6j?+DZE#~VInT^98Sv0g@vk-1d@?TG%LDAuuAg~@X(PC-7hMh_aQ>A zWm<+I$9#KelS%EKqg^0ZLPB-a1D`RgP^J&7qeBkQ$&1371yC{3|tMlYyaM$VY zMSq&!TotYE^wnGn&%b&V7-p6)LE%rO4*$pR*#> zYuWb5q#hOoNDr;&`?%zPU+ELvV?mfJaN4+)lZxxz`X2ltaA_Flq|`FxtzK3HVlM+g z?{LOVe7<_QC(60qOMf|A|Sz{D2s7uj*zOwq=_{S=y; z8<#tn^11v3KW8>nc7XL-F_@bS{jd}|rs*(uxRMog{zzao@9{@<_QHblqxI6-t)q>~ z&hy_ltH=CrG5r%4p#L5hL5#LorYkmkxCIQ~#3wb82hVFyVQW>QRljf|9k4_w11rMM z7KcF-$$r5Ue0Z2ov>g)d6u}zcn-oqWQ!;SLPM(2~;0%Yg3aDkA(2Sy9D4T$N*WpL0FlFhv7_p15tfLBO`qX>&d~H5g62Fz{YZEnC|AcIWx90 zK|w5jVOj~XJzUyerElm)WY%5Uh37EyhG!`e_viVebbu`Y9xzn-915kzz$C18!VOhI zcPxj{u`i3%u9_AMhDv$T%^^l)FALu#a8G>fC*r3L(njb5opNe)+Wj2Z(NEYBm81zaRGdLANQkpV;;1pC>F zPTUj#c{3}3`%|-aZc{@UmF{>P?98@%i7Q`8RCc-F8OI6GMII^`+{?Uass`Hl zU~FG2kN4d_xe%hiIo;>$#y~COw~Xc#Q0#8sGtUS=m9N`B+Q(*$w?DgQ26*bz1&@8> zt2(ERnHB0-3GGD~BOsd&O2{GH*g6RWni^5_s&uTpkL@DSS}25MrrFDU4pA*3P4$H{ z3c}i|=An|0a_>i6im`4%jZM+Upl4&0^TIFm)R_n0(B;XEkiEs9aamh8IVC)(g(4O% zYeiiO(vDFw3zTA`;=$}T%IOe^CW@ZVa=TQvjoXZ6fp^cFgfnRzILTEgOIK}*)sBA9 z3h||g_figd%XZdsO3V6DsI(2n3k1)Igp28{5^Zu+aSSZg-P45X zkDSvX*Y6x;LoezBmP1(F4yF_iAh1n~9+gg^a!~`eQui^Ehdm=2x?y{4DseG%s-dxVPH0CnYaf1T-5|IC#mxa0A?u( zXpfthSUgtF>%M}?BYulq*u6vX&`T-0xgT~;$w%H% zFDH%uewSlP!C^l|9&njW%mxT$L^T+CkwJ2MH&X@=T?Y#M;Ce6aXsdfiUW2e@*eM1^~NsTO}baiq(B1! zft`7wm5Nqsn2yM7R*vY=-BBie@WsF5p)y|hvGa}>t@2w$e(d%tZU6W(pmE{n-taT@ z&#(Ux5r+Q(S*+!ExWK7yM_tZ*NX$W2Rypeg`OW0Thk2Yh7!v6f=;i0`@8}cg%Zl)~ zBVe7;46M-}p=78Z-p}! z58S^WxwkQD$28!V2VTr+lpCr2!8-LsRUQYyKW3%M%dlw}Z-ikfdOJvvA;L0XR*;cESk8B~DD?HVTnluUZ~RlyDV_r@D#_C!GuY zW^t%k+?%UXfBtLASGBHqj+%=$I2=y>G=xKwD4*>#%_6(d-X@H~8#iLbk*Pdr;_O@Z zFCDoF^qpBMu}ohvOu35QK60c>mK{$aH}gx&)G!KMv<~pUeJmKxg0~t9iGTWilW)fc zT_jRxtR|dI>fu}z8K74XAj}kAF}*uj0q8*2&2l?1Em_H}+zJjO;1?eKJoBJ$`Pbjek z+Vdo_H$-TwFxy1+W{3H0%@x1UP0Z1J zX`m_-D{wYzrdYvlr8s;fZ$d41Qc#grK{Z*mSLhKU+P}(6v5P#edf7i_fB6Y8HM59# zYV1=npEU1yPRCJ@I2?@0QZ39KtrLl&!|IbRYb`U0L>8Ql+79?Gof;O7h)UWB`mt4@ z+9KW~kZnQw{MEwa8wXUb&13DHrNtjNZN;D!N6dL)f=`eSJ7ouL9IZK?cg;6QvdFU= z)7C;-fDRM1u{@;}l?Udt>YlE3(Lx4az&C=Fr}|kX9IHV0MML(0w+%Sm`vh5TEPc4c z{NS=e%*9g$klPzC?hlX0KjiWe-eKp$DFsmtJ;2f;b#spwRuAEcs6;mIVHr^aT= zXSxK0^ptaYL{3+M8M%ZU7DQU5@rC1u0?IU{3nnHDAGLX|YWUOe<(rptMGYM3SEP41 zmp`t3seU!*Db)3NQ!3-un$3| zkX&$-=-3qB7s1Klo{_dVr!eo+#Tj-M7)vDNci#74WrecB1-b;@BRZmBCu})E%TS+R zzW>M3X;^{K*hJPJ z4cAr0lE9LG92+>ODu@z6B9B8X#&^Z<#z}G- z@r|DZpeUS&S*b0DWEbNlErkOZ$4XBETLS3kD@EJxR8=qO%i~WZ9~Iuak+Ub7oeTxB z`#dcbMzxS?F_J%uluq5Ati$}JU1Ie?&ZHjpYq~wv)ai0F9J-Kh{{U~^j$vl>2t(e<9RU0U2W>pjJ+KG1kON>I$Hr_) z=c#ZW*>|s1kq1so&Z(m1p~!1{%P#{jbecSD>4Xi;DqJw>+xz^Mvu^wAd6BCoYi`6g z_sk3xmFt*K*)MXLwj_j*#UIj?app&rPe!rviz*@WYwUvUyAdD9$MIY7h zdFU|!WQcum7+o;$1z$G_>RFL0%8b#FqI@Vj;&DF1qYo^a)AFR{j^I75OE|A77nkNM z@Rgdkl^bkY4QpaHqQ4Y%@N2LDZpsqExq%1mnve59BeG*LK^-|lxwf}=icCNunX+Egz_2v;0u@J-7m1NA6a2zup0 zns^Gj6|(28{Cx!NqOn53zd+w&+)Lb1Nw*p1LCRSM66U$Bqtn-Z?Al#E{U8&7d94hK1~DSF z{+G3!utoAe9D)4z9Eq@|N?m^!81CI9a(xEVFWjU}yNV{>K3-PY#MxOuNj_*-1S~iN zM)dWDQi5Z{u~DRGR`;-kKwpNG)c7Rd(^(#NVG()O0b#|+jHDQxM+Di&HN-&!`wx`3 z5?RZCqolW&3DF%F4C!GS9UI6Fg>{e3j2FdD&x{Vt6%8*geGIkhhOZAax)1LxPGuJ& z);>d1hggS2sFHH2s;&;3VWN!MkAVyv&`M!CeuBu16Z(gvF#dKFDK&GA$N;fpF=4Nk zMJ*;4p)jMXyK2Nl`Nze1<1P#DlgvchvJgUxx zoy#PjUTN3@qhBPB)yd7qkM7=lh2(ps)RxA6PcK3Lwq>)k__-^NA3lRyiYrVDb+R}A z3^>aiO0qX41X_bUzZkRWr<34s{5V-7rpg1CLYn$KCcn$=**A!bWmcwDzFtH7{BfbY zWzunU`!}Lo+#s!=Ze^xTZ^A)PF&&^SEK4HEJ48+baQvJHshNC( z&q3ALI<87LiR5cp*<#kmXGJIHS&k;5J#1|v6`B52o&yWIVT3_TE!eq`NIdp|m*_R? zvmT+2QEFs_*}fpz$z3Pc>V_3P6Amzu7xrg~>dG<12J30t3oA{Fr+|IoepAE@q=}H0rrK_}Ja}nMkfp+ZR z$xU+XTbWFZY1bQzkpi3>flO4<%tBeX5>Xz*eiLeiA||d=1&Qb{+E(Lx-*@!T#NmX;dbEOV%Kr&XYfV`UsZSh-8*hnQGDMHmlYJm{{7<3L7bQAiSFtJVz{ zb(S+ZQ5al%Ske7-U%7j_G+g-uwrX1*ju6*`+#5D2J%T^3x|YJj^d*e0O$GsNTfaua|n%anx3V7$h(N$fuvFHX+=-az!(c z3lf7NUOg+=`REUFl`1prxAhMCoYrng`^G3`P~R^0 zLJzR03>VA4Z~e`YCvJbe`<;G%bEM*5=_iv7^v^m4`dwILU>vF`da&YUja-AAoDnP)CUEW(~HYpbwQax8R&S9%JRn2`g?LAZB7sH~Y@=5Od|HaWXzv@s`@lkDLfwLh8p9-2V}I5$|g}`KopRuq~rJ>Nu2fJ zaEii{k>`myApsd!TYkO*o2 zoV@J)e)Z~97+Pp~KAdCmb$TXwrqc@B9!%=XMl7l$GkK_omRSiol55!??gzKxb*JOg z!U}u3R9)HcO5h@WxT^7N>Sl0R z3ZqPMk9QFD*!NwLU9xd!hILD6$WO_27^6pEi!lhWwrGB#7%>rLB4M@IIHpb(39B8{ zG>PVCX`Cis*-FiAIIf|sQ)|lYGlQ;9^pr%sm>!c4-MmYw#I(UB=9<78h%IyJ2>Vt5 z2NOmWf?YCPZBD)jHO|jfZv^DGT6zP>3=#&ec^su4;{Mi;Rwi-LYetg2%Jwy?jK1D7 zwuaAAuDmjlH}}{wcOC3i3=Uq?dfhihgPRerl@hk627MxD)55Fv*+!!o^~VZ zANNjJ@;0QYa>jSa)4i@65-~H);QtIi=OM|4AqDPFOG9y!6K>uSXOQ*uZ^h7qC70(n zgfA|U%^Qkm`ON;r16oSM-|_sjeRaD2yE^$NQ2rw(|EW$G|9grM+UWckq|K%JO4~*y ztG%l?uwq*W@5ZC99Nh3gU|9+BZOhd{!uYuSgRm&{}?Y)RB{N> zC&(X~;uT(;S>h2I>QkA;iUz@0Eq^lv21T8INrbQp2r%{ZAll+$VO>lkqfD(0UaZ4o zBdu|cCtflh@3=VD8tb&cIx{=)>cjTV#(dn`=zb{S=<_D%*X^DAlc{)bIA7H7#>A9^ zJQuC{SL^Q?j-AmCU9}y|b>Sr5d{$G335y?7-f41x7-A)5A{@FeinqrpYBk@7y|mU2 zXMy{w94aon&lU;2RmlJN#bDN%?JQpds#SZuT%y1|RqDwsLhvF*9hW^phHwrRr(-%( z2zIEC<>^t`Ws`QG#s1gKym-PJ*CE0a)udAWCVNJEVWR}$`D%CZH?e`BTd%6#L6if=!$sNK!PbXLKpJ+o6= zLv50MjaOY9@}+QiM`<=;>a9Gfw#;Kdwq>On?tR)FL5JM<&RJ;Jh~4#Y1r*t(F*#TsWj+)kpl>9H{JBie+>RThg@S{* z9s`4S#i_VZdwo@QG~7;jiDYNYpG`3Aw|rqC9+N-?t?A2K1@}2n0f~uH#04{JxV5DE zZv3i5{D(6AaH|OC0xJym)*1`L2uy=LA|T};KZO`^wZOOVMUZu_fNU@b=x#KgB*{Io#V?*Pk6}`)x5i;`Qb( z5TRY8kZ8AiKe<#^@@}+4`z>QjgU5*iHko!NMPKzN)s9@uEt0!k;-9^=vbrsU!$0bI zDWsEL@`+GjOsjZw$^yiwvm?~io77P?>nbIQ>EhU%w!^SEVCv``Y`@UuqBXo;@5322 z%M+qm1=1iiCM4?md`yWYHhMh1+-l}V>bg>1E@&nL@V5GdCv_|T(30Og`FC~lZ!P%` zPniA}Jki-yy20J#RU5b{QMKXvjAdd0vnbq8%yk2qWWB9wOr94&A* z|MfR&<;*E2F~gw&zDj!6*tL!Lthx%&M~tL;L?Pc-a6QK+K^t{gHpR>>t;yC%pyDB( z+$AOQEw?_;^So?&e@CSP!pzJe`%rZXJF_}eaz-g4-KlB0bN0@KpMpDIwpzJ02mFn_ zmmA=hNl$)R{+)6k^ zW_{2HTi>wq=1GkbK%J1KTQ84lvHo;tF%~`2DUegVe(>CLvC?w}hoGC>+GC z!^B(Byvw~=e(jsIkyUS5!#cPpg(q6QpW}P+vDxs`?-tc=a<`40`-N6zN+-*D9G~Z8 zr~-sIPy@V_2SN!+o&p_+G2#x4lG~)w+$C$Q-fC$K+Dd?KC-W>fPT2D6b*_W8?l!8u zDb@AL#BmlREv9@wU9w=lwN-1;#`>1L?IWSEw$piVKD8W1{VgdFnJAl*4<~bCuU>k0 zc7KISh+@gL3%yeLoohzG;4prVHLxmkmu%jsu|c)f=ffY8!-}u2d`&E?5pefLxOo>r z%vqVFTyX0SV}43OpT42?FaMU5k1BG3cN*Ylj3M)~PA&Fkf2#R|XDN=5AO@cF#&ac} z0LY!w8QU}A52@=5CJ*1&Q9HgGU~YBAJU*|yQqiMyb>9B39;0Pk&dn@v>>qL_^NTm= z@25|O$N#EJezzz8C+7TP$n&4}1opqc%Fa1f<%nvLPdi*!b`F+%%YB4`-}pydIXGs( z!Vq30q+ftPo)}0Ba(BR!!eNmPI6_=xfH^cY3HFZFJUrU>HaoTfG&Kz+&dx0`%?!f2 z*4jUYL0H#lpFe%sUYhkfT==&6!`YA*e&&WfpV+1Vl>m^3F!Krjo)ou-atK}ed&0xW z$YIo5QzhCN$?@lLel=DtS1W==)$Gmcu6R#8jKfOSRw2JD6K1%(x#}v`mo51@jKyGR zu`}e3XETYe$a*LHv3Y;BvW*Q9Du83RIj0I_h#<0|RI^mo2L28^!jJHmYeDq>^e8p4 zNjpBS#c9OYwn3u@d$uR^Vy$|Z z_m<`BEOpNaAN^JuH~6$HPQGQl5zZ+K=AH3rQ-<&?83>neDb3Bm(wHSrM#g&s4uOza z`)Rj@Md!rM*E2QFN_0~96O>M9lUy*X@BF&($Qr5%II%R0Wz?w zR^pG%KfM;Gy82n_W)RtW#&{IDS~VsKhgC1AP=37*5k(SRs*YSEAd-( zD4%dYzIhY=yn`_X2`DAUuy=>gj8U*Fe!(}+Pg9SPop1*Qhn}@z56-!mg>-&Q7|jCc za#*qZ{3;rH5t(VL{{ZA2tfa=MUtZV?HHXq9k_5!4RJY;R^_gFi(L=K zDR>-7C90=5l2@~^=Myb2Q#z!cB@3to6Y$JT3CXswC#qt;g7P~#m(Lz*<`wlv8`!xC z`3KDuex6?9!RD63?Zaz3)Meb_{3LA1d>i!&mU;_wdYQGHTkKPYiiknqo`P*Fq*}WZt>deV@TdeE3R9 zpv7QMcVG)p7u_)cN0GoU&FQBKWCq6_uN%E(>E+AU+|wW zuWPdHSNK=dX2?6297;p+c#n-4`_BD+-!9ns+K@dp?LtUCG{NE)mrkvb%*uwy4&VYx jw5t7ITTQgpdDVx1x3K@zlz(6aCISFl|Gg#i@8ACeCmTJM literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/logo.gif b/posterita/posterita/web/images/logo.gif new file mode 100644 index 0000000000000000000000000000000000000000..d990762f638b3834c27fbb04ec8b48e722c7da5f GIT binary patch literal 1543 zcmb_b`%~0a6u%`_EQ5lfC1{8a>i7b@Ztms}AOdYFw!-cL>-qw@KuAhXYv4>GvN|eQ zDw5a22V%He=<3K=&Y1Y1NH3*43Rp53AL(G(7^RTT?Q_3>LuY2^yJycipY!>A&UfE@ zE6HG7X(eIgF;P*XeM+=P39=Fujg5^Gze^&u2cGzbz;FLwP(m0XoDiWlA)}N~Mkps# z5GqxXQNkEuoG?L{RK1)M&Isp(3&N!u6_f}@1Sdiep_md$iDX1_A_ZtGUZ*sF2`@Q7RdgoJv6@wt_Xl zKpHGT3pFeTHlTrpVW|YE9KjhAj7g;rYmsrzxL{l=xnO~!;7kZ6B-DcxdYR-*3ML^B zet;&XVF&bs1Qdcbz(5)-(Fz_|3~WFHODgA789735E|rnchqcIr;6lPz$OQ`&xfEQ& zM>q`wzzgj#8fsxB`~Xc%!wztQU?>D@fPpk7K?^*v7}$W8>O`s=W#kBni@`|f!&+oQ zd&!iq+Pzg#JE5{!yNc@7j8?8|-l-hqrs=&Gw+8tSZocQenXt+Iw01Bprsh)l*rCf# z8=_ZT-ZR`i5W{EQI&X2O*Yq2_-HqG)&pc~$ryfc^5anMGl3rMQdE>Fn(lN%Fhg08q zBV&I3*Y&@}Rd;wsiSE?wOQosCiDjcljlxH{RMR(tAVnUE>|8a@Hrt#M82qFs%Wr3`?!94y zw^zLVVC0B^!Y$_BB@vd!-6PB96yB*?=Qh;^ni47u?U`Z8RpXp(F?rX*$Nq9GBjS(g zCf5?@$jq1XqMIMzdfjb~2w(H0=9nupDzk^Yvn*=V;&Y$&qPCrWB2yl~NJdZK*YVc|+Idx%zoR zaMAi3#*F3mP+zZS{K-1qi5}+y#}a${_EyIQXa0=%!?yRkmU?oV?$3L8VCuta{>a^N z+}1SToPPYDu)g#9`wcbw>MDv?pa1uVFT8Qyk6(C2|I?Me%KCtVduQz1f8pqn`sC`V zsZDxU&hmr7QI5ryGj~JQp03?;<&-sON1ZF2Tl4$A@4QjG_TuD7%PD(?{^@twuKt0T x=1ILjUuzATUES^2Q@>B=_%I}JT4B^{?NeHV6Nl=(D`xlnc`#&MMM@l*^B<==!P@`; literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/logo.jpg b/posterita/posterita/web/images/logo.jpg new file mode 100644 index 0000000000000000000000000000000000000000..77c8b5142cf182faf994c0eb46d54bff3dfa31c9 GIT binary patch literal 3290 zcmbu+do>M#?64doPvV9qJol=qT+frb-fNKYAI=NwK=i@<{7GN8mqJK zYQcRKv!hSDbiLk+x9tzRl%}et2iG?+G~aHqW2Yt3_JG~NL-xmxJ2{{D?xc(NX&+xd z|A4@==fWc*qp;C&@d=4ZgyfWK*V8jHv$Aj8E-Wf8DZTS!*}p2Qs1K?i);xOFKyPen ze%{i`WU;$@I6uF9H840dJi;9v8y5&g@1~~T&&Kk8wEs)?H|#&IabTl@-1_G!XaQ(ot%`VA1}Md^mZOwKJbl6?4+ZHZ z5Y3`wgxJV{^i4Qn>mf$&mi{o#3SPOoZ$WJQp4)B1WbB|CR!6^CnBrhwiq}rX6)58h+)vCQTscS-D6hoW^qFG_NW@i*d2qFiyjJWY_|sOs&wgy$*(MN zZgR~ns*PwgPpjPMq-$(qXj7wPacIrw`s?QmL|Tb`iIJA^0aO2!$q9`jFIqNhu*fE_ zeHTOBmtGTbC)vGZgBIH--pYHKO|=Uu-ZBBg*VHn_aApZbenP-aC+#A=S#Dlb;eXv0hqu)5vFBuL<5$JZC;xd|7GoHp+gBTWF)(K7T{xxs#jrq;>3t zO3)J@Ij0aCq<%xFL!$mPp5h0Kfo89q2AiiTJqB{K zroinq5H9Fph((^J92a^=d%+?~{gLIYmtrm|H!I7L3ni@R6TP4SA^KXNBoj;=?9Pc4 zJ9P2@auiFHYAu;R4V4RMDpA5W1Qx5TbI2Nx%!jq*n-)Am=9q?;c}(ge;Oyt_y7x=M zNArw-(KCbZ>fg@_3k^)_4tt`58>&#yeN}FMI{1v`eV5ab&ew;k-uHPI4`vRYdtPr^ zo8LXy_vFcamxCy!Xzfa+jfYXeF37F9T?0ieb6gzEE5RhCIQ-SUuo|j`S@j^AUrA9+ zK*MKSkJ~GEtD^zjq?HV~jyMYOQUx|x@m)XgyY>~t=t9B+20Y^R+`@CWfQ7XEh&w+` zB{Rm8Bz*(OrH#bP;v{B!B&St5$58`2xrNe=)V%R6fclM*r_1I}Wy%c>VXuJ{to>0BaQGmGRP zO#tESCG|P)UvaysV>5xYY?N7DKp>%@gtJ)b>*}UDyw+2vjv~ZnC<`&ovC*$Tj4xeS zPT@ToBX+dCV}z6QxQ;qd{z`ZkD9`QTl2qSx>?VjfhMewlObqvm6h19=NyVC`dyDcMBZ+O+dD)WI)_R>`$d+_}g19)4qE(L)Sau^{~>12*qo z(;kOtLQH3`DmwD82dkCCobT5hCv=R=_moXviwlp~(-wJ2vXvf=-{h~)jEer{9I=Q~ zHs|DXBh3@SlbYK*<^#U8FT-|TnsDW<$t}AjfTkE#0_B*P%U0hJpCt``XtIatxNGoN ziUzLr9b@)DhhbY#h8@WSG#?p5KV7^q9&E)n+Lp)ji#bz&<8WSw@#+)OK2l$Z5tLd- zw1Nbn!U}?2armvCrUr!QJee%gyjhwu)%07?wE3I zg^*mzh?d)knsAjO;3vb#bKB6MD1KM_kMe}QVn$Cul+q>(Z*RIa)K6>fBqzJUt z^%u;TN7;L`xs{9L8bB%q#`z!+}i}tvnerbNdE9x1y zfFYVMHE=l6vN(FE+@;a-ba@MPr%%nH=I!-M+gIImLa#rld0VaGl~*(~81lLtS<+S$ z7r2al7k}Dsn!Bhhq8Je!4~p}1iGEZW!1d6=8B)&5fFqZC*AEP(6iqMXJjVDHy1#%L zM1)0sL805ohj{FFpH|%S&R@tB?4?yQFE*LMlZ<`z1Dxhn896ZwSSK5FMreScIM;zw zm|mU~b9Gh6ub&J53S~iB!t_Nb3CQaP=2g=tLkoIILHxYW+6}XUP*%DJfR$P=0tw* z-nE3!6c%G_o{wgl{7$rnY{i^TxaEPnOKJo&R+)A6j+ZhZ|E5>3dyZ!ddhtxK%Wn-g z__S*;FD6)?(8VCTUth1P&Sbq|{(v2FEuOtugV|fNVX3vt0hi!Vk2x~ZXZ0wgCl8Y; zc{WuYSZ}7Aa}i(i!QcN>m$Pr{v*nR?5qG*q2Ar1xaOp8`+{(VSUWD=5p1Lb{Jxm}O za01cL%nZ9HTw2pc-{`G^dj05%8_CT5Vo{LAtwX2?bSGoNLF9iHoR<_0I;s&|W)Nrr zej$?@f=zim+%&j$vu^E;BV|)8Z=`Sb1wPJIvz8Qgbo=-7< zuh$KF?45@wp3T5W!(no`Qq{ zBRYY$5}HU;>nXas4yRr4@(*X7RhX0Rl+fm2U3ki!dl9BhR$4yQUX3Y@(L=>F+^feY y+pQ%{CGN9UDgH#;jpjSvuskb|=IU0uq+7;gIqjA1Hi3WeKDIdN_-=nM8~ZnxgFL1H literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/logo1.jpg b/posterita/posterita/web/images/logo1.jpg new file mode 100644 index 0000000000000000000000000000000000000000..7b543ace265aea38d4921efce92f3571f8d13ab8 GIT binary patch literal 7468 zcmbW6byQT}*Z=RpkP1k54W&a#my{BM5<^N04BaunfPjQ_NJ^`8cc*})(#;?#(kUqj z&-nR#>v{hA{l53EbMId3p0n?H?Y-Y;optZ+?CmmePgy}p0RVwOz*F=I+^&EJ<-Key z0YF6sfC2!33*dlA08F$6LZ1ML2Eh8u1^_b4_$ju8kwy$`}RNM_=g8gbc+I>0JzxLIM`UYI5;?Xc)0j? z$q4S=xpSAAgp`Pko`#Wuo`#N&iIsrC-8}#Ugo%j(#>Bz`qtgcRML!3?#8@QEe6rZ2FjE|e3mJbv+(%rN z$5ox=8e@m70%op(c=!~QRMa$V>>T$WKm~<_MMTBKpUBB8C_YtE*3{D0(S4z(Zw|Mx zw6eCbb#q5}czPkdgM#0LgocGj#3v*sCBI8aP0P;7&C4$+EGn+9sjaJTXl!ck>i*o* z+t)uZI6g5sH9a#sH@~vF_I>@w#^%=c(ecld)3fu7%U^%E&=v7F*1yR94;L|-3j++s z1mpbS0%3Tf8zwOri7i)>OuCqDjUJG$y>l5N#rs5KV!2X11oKDD`BEhQ#j z`nPD@0*-byLW%4scU=P3=R09$RSf^7@s|ew%d!6&_O}N4fe-&ngA4$Gfq{W8*MBMyz1rg8W8;9p zSQwb-S{ACmgtAASGZHCh;Gb%QZ*(NAUnh~ST3FfRU`zqpzH(;lVmv9aiuSZJ;Urrg1!i8t3X@V-W%o9f%-H zfwZp=zk_j!apsa2$N6X9gTd_%;{v~r=|hU?dm_qhjG~+Sjz7&WdS#GuxVvpgh87Wb zRF5s+TGChLojbx*9*8&Td#N+J2?}EmRcZHF4DwXAceYkwPbM90T7QZ#64;KHm5#?d z>Pm=YmwL~Q#teC=X)#OUl#^+ZP8!>v6{9|R z)aaMw$Jy~PQ+>EkOwCOCG>`e`3mkjUKyRDw#ddsrezCX@qIX5f$+~B-JzmJx8?r36 z_zc@OtTTg2lpf)jr=?1+E#)O|EOiUOZ_?HpwMFIC9$fpq;yAwr#_TQH1`LJOe=NLSCrP@0>qOu5==@V+?mZKNhT&{7c^0#@wpFik80PR z^%cY+Br_ZxN7qjl^Sp$8<>TedAq#BpxpSmJxV>{yo`JI^US0_+S~wxD)3Q`@=t!PUQ!L zrxg(K60a34hs;-b^rW=7O1y&g913Ok&orx*$O4Qff7?9BK5kA0YprdpkiHLIyCMDE zK3{gTy*KUDoRx>Xp>1gTn%Ok4LES+K4RfRQW`Xf3pXXL%Vf}zZl;KL*yDp@GTC8iq zx}3%3*`6HPzCkF0;y1}6sZOdYMmFTvXHyONbhg`DfPfP$9fw}Al;8{Q;WF1aB0s#q z#HB$p5o^f&ZE^kb(}h0g?+8qWgPD>rd&gl_B10c+u|8>qyrsnJF|QRV&5iS;oW2Lw zl(8#o?=PkdOGTuMGcXz7v=TRWbRQe!Pji>WVBJA*@^j|vA*YAT`+L7>lvbZzU0LbM zax7SrkJuBTw5es@Y%>tL!#D~#Y?+c*yU}SaSdWE>COKL~?vc7)!FpVv%4I7Z?8FBy zG$esMSMOtur(e3oHDF4$UP=2Oj1l7XNeZ0bl>WS~zIJk4ec_-pWknkbiy8Q0?*gSx zK62Ug+h~KIxRX)%q}ZHy=3gaUVo&g-C^~fA)0Ug$IOUs8K5|r4PPc1L&9)i#>vi)OXITRe-&vzcHMQ~d$PWIMS;J0|@9YS- zL2q?g%D@upSN)#y-H6K)Vb(A)EEO_gR5*;ltS51SGO06phv-gQ@I?PkxaF2blY-T# z;@f%AUU#Iel znuLAx-5{7D(2a*^m~fU}C8|kDvt1lrbx1e#X3yk*WpNePoj1&R<>`a8Z(zic%>K~& zp@+eHG=UL&xwj@1n|DTP*W(*9bak?}R2Tw%T^xoRl-q)rxs5sV;JZQU8%LVGVPXR- zc5;GO&zih?WCtvKzn7KUwxyEVX9Uj)E}$exbq3BQWIFCdRUf3tV48CGQSZ%eZ0+^U zRLGqy|J?oEy6s<9zEG@s3yhvkbA_FACb@K(MjRIwopfzJb%8xPt48G(w&E5+A(yq( z`)u(_epnWhkL$xAn$|yjk{U+UKxV1G41%c z`vSR)<@~sFW%=_4wsM=a6V1n`#2g*i7L4bdm#iM5<|66_3Ik0#E357Zd7gtd22f3Ta$6HfwPG>}6 zvK^PoPb0#oLi_TOMj=*?OF|$B%n+5Qr=&sHG?t@y{u?n=o(by;DzUH0;nir*_4ErO zd9;`*BH?zwMjv}@+AuD9_zOWFgIQ1Gu|l;LvQ*wfFf{$ej}5Lz5j>FmlWms5Z|kS& z-!il2zNOE7i4t*gF<7o?s;TuksnnKySteIIz%Q{`xu&Z-Gc^&pLs*sMYIr^%TZ=r` zv#0V`nQz{4(#fiOX)x1W9mKphr)WAWX9iacZXl^5r;BB!x9L1Oe5}+*S8%69eB7*Y zn18&lk8fKU_j_vsS)ID=EW{+9{X=CpyyUX5ygl$pEs9%;p=o|2w0m^QE9PA{Mat#@ zuK`B_Q7?B@p^fz@(sf9+{0p@uj!owyfKQFU%W}=TLAyt2RoRE@ym+R#zD)eGn#y*r zGKpY|)$QJ$LnJjrn~uTcK>@+WR=R&Pa>vucWgs;Vd( z1z)ssvVuw#l)n8KqZ|XW<(wJr*-h+rL{X zcOa(3QHP<51VVZHH*|q}$iqX68p9#@!-Mqc3ug+0AHJxNOOr*S6?v@f#B8iZ^v9oXk8#+nH8G@eUPL2JlR6ms+~REesJ2tQpBPBsfg%v4mX>YsJ4a zh}5`~7U`?RcY_#e+MU?@*-QjtXP>l1@>|q+{61bN%r1S+BgAUI$0!ztk1?8%HDE%2 zv8!yI8vjMD+NQJi=gS><MSBc zLumqvj5=ZFTr2qaQCV~?3??@fm&dSxYZsvRZV0vY{Vl%?)vzgTsYBV~{(JA#{2feN zzAb8Bt!dL_6$(~8VdoNSra*}Oi(V|MW2`avbY=_sEksAaM%#;B z_I`wH_=@ZJU`)({>jJy@zs3jjtfJW#Wr(fU0Ld7f6WsvrY9}S3Zh?gh`v}AHD@K8pD%EhXET{qOy zwO}zxwbH9UF&~d@QW%=#ifL$~M;O5Gk4` zbhfPlud$)#EE*qw)#})j;BBDex@)QUmUuR*`)f|%gu;@O8BKBN*QyA!Bg>>jdyfdA z@CuiaSeW70abx87JP|4rwv7?!YK0VX!?^nhG6;6mvOYE-m#6qHi24)}Ru~bu{5Jcr zIOAv}OKhC@}>QE{w$}|{40^&vn${Cj*G*KQu99^ zy%+--MAC;16&G>Z3!<18T3y@9!eXT!RnS$$XnU!Gf-^rK(&kN-R#duFc>~4)nV#k5kaOi!k z%BA+SS(p}7jw+XE2y1tpebV%==)aVuYO_ne`WV2R<{VWq-m7VC@{W2QJ0l33Il zcG&#>dO!rYphDMCicl-0|5DTnAjxTDYnG_Svt%*g<)0# zIjOqQYKNbLF_*U9fwSSNQb&%OT}IdovS)}_k_?@7CsCF2J}5F!3E4rU=G2dA=?G)5 z(RoEMe_PM2@5a9ytE{MvS+rI73zgYE8=^el{}Lx#fQSz@MaP*+A0w)zp;nmXK6n~8 zaVFb#p~~&jpv%XXxi(L?80%W!07+!!szW?qeUmIHc6JNAm{QPH-EB4?S?T=*7yMZ! zj*`0*d{9t0^E{IuChO!`)9A2IJl!egV-fnnBK5678+ijm8Fc%dkr_$w8+HZxj7FI5 zA!Tc!`9c%}+jhZ>zNbYhf&b$cdixA%#TaRJzXQ}%agh(<*C-eE=@z#3QDh&7`iF25 zE^2}}e$`MFEFc(DXyQ8jWhlrb}SiS2)=G?|bR;qEm%n8)WP)PgSZcXTc z;-MJZXYC)$CpyoJSjpNU&D?|DV(ebr!jv(35CMA|=8{(aIzbm?WMj8#-SZeYbkOie zW0J_TH_uNgl(9cV6q)Oli>PnLhxL-!`gq52HY&_BXyRJnQ$1A2NYI;UF!`RmeCnXU#G1h6xLEZIsz7J?+t$&o2vmB*0=j*s| z_>T7B;(X|%NzAL!?%k2J*x%4q$7SX0Q+rC}oLHqm_Hk1#>U&Iq7zZv>k4uS_RkEa! z>d8KAH%169EPKxA*3`RePX#x&FhYRa2J*RDR||H0d*lp<8f3>v?LVUg_c2Mx<<%An zizBkc)+yhNuE}h^6@@sY6jD)zPkrv#;Q z>>nF(=4~9dyg1J02S2-rz&tcEVJuq_okFAx1P=Fn!gQ;0mZ1U?k})f{ap(|}%P@w= zkTNPvZh;vro1!F*OT>pLiel>BJB2|0sUG5v63UN+NECcw7HBNYREBvtuiCIfb~O@C^uF#^s}#d!UGYa))pGbA0iB=qZgkU zH@a_D{de>nqhD%zYTEClb6D+DkmFU#Yl!K|a{~7>t`ic_nRZ)$#W6xN*~F`t$zi%` z7k^4!gJ8vwEA3ynYo7}x8i8Bd)4yHulR?4l1|j(6SrLKlu3$24H_}hXMfnN4EH+J? zh1t}}BJd?R@i3m7(G9wTwItP6#nFnGwI-x~iZF^S2C`PonozB}*=9tC)?1q&U zfu|X)N{)Cy^yXlExvpIqF8Z}@{D~}0P>fy)Tk!pj4rxUd#b>LWkF0E`xehYGc`^F= z9F?E(I5_I_q95G?SLKO2G{5@ypH-)mfOXy|%?ZGT$U}NalQ@qkI$Zlm+>bzs-4`FMM6(WNp1q7Z_(QdrIF5&G3r;5bsB-Dseg*yTxnT zOw?d8wWLdX)m|>X+#x_(-0pQP)u- zS0%o^ZZK&yQJroEGaO?B0!;ZqXwiYHwLuveE+mxB?5 zH3Q_-aKj#SK{&pLW!S8^9o98mi4RE5f0R-&x^ZP5S>vvLlM@}lB4JsS;y!pbVY#%5 ze+zV%SD`+dh7{EHq&}6DEi1(8?4!*NCq&}pf5gYhi#bJL3QH-@6zHT5uRp91V)ICF z$n+#d&2C1-km;!&&JPju7#u{Z8DB&=3#gEjv+kISYi->E`M-h-=7!399*(hhHVMBi z(f7OQ0ZH2q{xWH^6G>W5WJrD<@pE?exY^X*R(x&MZfclMP15{{LL;86Je|ANeH@wE z+Ank}m*Y5oO%9&wv)t}P8}iTDilw3DMT^BnvDEA~b8~J{dn(05GD7I((mA|~17)~5 zR(RK+QAaxJ_k8MDjzTm&H;th6`1n|PdUR0u{4yw<7oYw9z_6jY1$ z*k{v<(u$L@BI1kB;*VRWc(Y!iKi7*3+OF8%0z@bNYg(vxYK1;C`t^jJ_Rqshe=7{` zao(u?c4+L*yanc@FDEEc+uCQ1q5{`=Wapv_Ld;sjdr+m1#UhT5S%*ZSyurtjXJa`! z;ZpYg`F^8Q9*kKG69*HpXOU}yRjD-SjcP88GN81u;&u4ZVVrqw_;pbF7*Iuer_Ck&nYlf&(bXPTGjpB6hi=n!E}?3j4{ R2^Kf~-@*E0a{J%T{SVVgCK~_% literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/newUI/Thumbs.db b/posterita/posterita/web/images/newUI/Thumbs.db new file mode 100644 index 0000000000000000000000000000000000000000..4dc2ce4a3bd5936e2871d039b7f2a96cb05134c0 GIT binary patch literal 41984 zcmeF(2Urx#z9{-Zk_17J3<3fQ5=0S@JR*`s1SBVwBw2E11e6>E1Ox;`B!>~nStNsi z=G>%6FS#9uB!f5b^qw4m`yKcn1lRo zl7iqu&=?{J!T<7i9Pm5VFVjT`Y3~(Qi1>^zjF|7dRN`L!Z8O$F5D!@ZP6?g<-m-{nM>JWSI&l&6sS%@8& zJ3>4_uKxH$1CE&A@{c`M{?mzK3jM6F9S0XI^fma`C9(VOzcb;1Qs}qzvGYH=t~~5P z3?>=KQ;_SY5F79km0od~&TXtZ}fPZ%WW6KL{8StN-|JZT_TL%22^B-G& zV9S6%a{gn>5o{TNJ^!)iDYo1w2O0in=RdZLz?K2n^B-G&V9S7ibpES>_tXIm;4z>H zXaU-Q4xkI@0r~)T8w|nR2rveo08fEufC*pxlSOQjnHGuuREtuN@_P`6k z0dNGI0B67ja0T1|cK~}fdjej7H{b*K0x;kufGyLp$3QALA26esS;$2tIYl`L4mhZu zU^fsm0ZtLzbLX)C!Gs6?gYt&l3@ofCb9H8H$68dkzm5yVYQ6AMic|j{=|a$}MSv zOKMLE*&L_@{G!v(v)?Ojq*m|S;kfUCgHa7buO?Ay5bgm;NaA2U8>W@YE( z=6xwCEi136tg8Oj)ZEhA*51+CKQK5nJTf{qJ~zLx_;YD_Wpxd)ySIOEc!WGY!R8AG zg8OT>{v&6<%NGU6*Eu{qTs%T-zHrXD0k{-+_*ZTbP)e&2K6SXnCg69T>RxnuaU&7? zZS@`MXO4ZuG#r9+R}t8({gSgkmNEZ-DQEwYvHv$;;}B9@9I*3nDL@5$#)9aL;@g)z zytyV^?YwZ#=iX*QXW67c9_~eEEvDB!RNmb~G!GwmD-S?e5HBvCo_%S;K*C4lKj_|_ z7D4!QMELf*aHUg5$3GUOI8gEvy6QAK2-TC7fJ3lP6(5HW3P#t z%BjkPerI3zT-fL*jX=d4)Cy9ssE$}tJR*ypTA%q~Ad53grif8_IOk6cq&?+1vM_7K z>Fk4hg(`wN`N9`H$%FT9++KnYNT16;$X|$*F>@76+xd~of`O!2LU$~)V7rD6u$@6I z=>82u*sLB5LH)!1(n1P6vR08SiaAO$wu>o-DAnbKaIVc0uJzEZCUg2Yp^e-Hs$?G% zx1)0T;m=O4izCA`F>=``LCzoyWO-Z_#bB9+N|68EYs2g$p9XGY!IP-Yj8iW`umS6! zhBZb-4|Rc$rNP2P;K=8y+0D62Q>UXbee)(_|b`4RR8v|$<9EAhhmHtN` zuT~}YR_^!KNJ%ceLRXJ$rkrX8qA`+`NdUz+t6%$)B^eV}wmO^y^xTKi@(7By@smnqBDsTO8Xj!e?e?w@yFdB`V6 z<7)415!Zjr%}L0Q%z&2C_<>>Ft(7j(leb8?nGZenfbPtaiR%>%1{jmwTN0(Dc|R*)U-- z!ePN011Tek;vUO1pymyq@Ob7BKl^6mQ{;;mxBUE#=?x{rg^MQ|snjOIYzW>)1h~`T z@7#n(smm$$+zJTo-&qRb3>FgEyeK;9K~c2CKI%D=rc}gMI>aSjk-g$xySrs>Qs&A3 zl}w6L7dBGXh7PsbIDiH&+}{ZeGbYsS@_j7vaa#@Kj+4bj2bJg4c29J5x@y~h+*%(c z)6ehQ=JcdOSewk&{*uj)n-KwW3t5_e^mqY{Occhd+CjGxO)^9BEoe42wk?*?Uiie( zanBp=GsZGjruOagx~@D;b3&~)c0UlYznM!dl4-HzBh##*cWFDrN4m1FatH&-r;jo_ z3R@QpIT~jEJce-dhizQFgMKqPT(qE5ong_+Ow4jXnG80s$U3G-BebiS&hi;$NiKdy z!$e4*(kE^w$3s{wN8dvUhxv32M9m$#AKG7kcM!UG#RUT~Ov6C#2^~zo8AU9I5}wJ< zVj%tEddIYnw?f%+>v`@7T+Zs_NdnO z;SyC>Ua~rZQ|7g6xW5AX%bRY`>X>O$Dd{uCD$BahPfgS)me%hrPcxVEAJKW}Iet+s z8(TO@+Z0{!vC#BbLQv6`*zvN)b1~XWNLT5CDmaC#n;u%EOAS50owz1O;|m3#fFI%7F{ z((7%m97S?yMGb$)D_Vky)@iJBC(Ga6PubE9K1at9KIBuJ_ z2$Z5jiH>|2P;ELKl$bE9+=I=r4YIZBj?nGtpQboXS3O6`>`YT#XK4z_kO|L2!qp%P z+016Pz5{!4h=Z4Suyz6H86%$u;kf>3(=L3KjH%;=$YefwD4bxKYpULory*7WRU^q@eMl7Y5SA;?F|p%Qmhu4@GLZ3hTY1ji5_B5byYTgIXW<&WsQW9hphm z?T;iH3_zzXW53DJoBj10(Ebo6}CjnVuOKnS?0I;j!LSY?HOgC>P_My zBeDW8kh||rF^~bv{AToEJqD5jGkOt)3jUlncczPsbS`{1d?5AhEY4z2ig}F_xeBxYOi7-QYUF=C!j$PsR_I2`+b@UajhoD zYDC+!+F-iph_c`gR}OvTLxLv1$I!VL6gW4DSi69%&2Qih~Or=qWUzn4Ah{W^ky1b*B}K%K6^j@J0mqDIkk zXGVN(&1vKZj4!^CbWG3RoFyPWy#2Z7b`N=>2jQQ zBZ1qYMHp;F73|xuHBdCvnD5;aM4DmI5K-x}aMG(J%Z}0krM8BkLiy2e2W+K=+Gb1M z(Wk}_H0HIEgqP7*DcmrStO4!7Gw_|b9l$Hm?7rQ-2o3!Jtr3aa^OZN|D)coCZ)**( zg?})Aq7eIC{L5yKL%74_?#xcJp6VGy!UF>d=w`=2BDDAKkRjv<`8!`A4eoR2eiODH z9rQfONlP$Kyum{qk+1jm!vd$vb{nb#YD%w+5*qBeg@Ii1fbBmJ+7gd&z(B}+FIuG$ z?h)iH+`$(e65LSuVj$sS>pW6$))Xvog2LvNYu#O zd)duB(g}*trXM+TqJ~flq3n#1lWW>^PhULF8Oo*RD)d>wKoW%)qtnGWN zkKevjv^3dJOxKQCKRKAicZDOEJ9yElMgX@Rmw0j+ayWZaXC(Z?6w#+_f{9l#ii*M$ zRugn1h0`!*rZ8jPDEb^(m zc#z*FySAdZI<<%Vpn~FCHxq38CLQ(KxLd0|={lt%htZX~9qtM1fwjU5WhEkmS6uNQ zZLEAfcXNinTayoc%UxefVAN9hv&!XWN97}^XT;Ah&XYwVE4K~! zX@eVf(jHBq`>JnG?xn7`5W8!5iM5>{3in(ss)`slWsLW z6WK4IEv;9%J1Ug&Z6=p>{M|bRvfD=vN&6|67UTmL5Mk>Y)00itaz92$q6bK0t|h$4 zWw28Tr^~?O*timC6%;Hbs5_ZPO;<+8^2m_;@@=KT0^6*RWn&>d!&W&9Lc5=n3hmjd z6d_u#a%W_VYBndfPY;Ru(hJ_6)JZhJce!Rz;#DO(F4GlM{YGU4Z#;?{ZRSiO6&}1E z{fuY3`rc%^O3`M!u;4>&QqMfe^&YmW_-i^dE6qyb(0WMvt6e%(-)vsG3>rAhd_c3&%>bM_2YIiz%QIIYz z-EL`aRXD7(F*5i|C$y{Z|6li5IvQ;_TCN>PPYQceK*- z+@n+n3vKt0ZQYCO*nv_alz1jJcswZDm*$4eaMeOg0q;n&+ zI}Q!e>nUTlX37_fcV(%Fp}o z$hYZRTS`qi`jj`t5uPnkEzHjlxjUinRx?#^j;?yaD|h`4^xfN8jwbH(S3{AePzKl! zWoZngVGnFGbnXqx5(ANzBt&B%-55w~KGgD|adXa0d@d|)y6a~yi$4v@_+VFrA2hv( zQMx~iGJSU^TAH<@{Vvza^qClNq4G(MDhfSEPy(D0(3PtnFp$~%GbpPlq^T-MNEIaX zHKYMKWY4hAT1acQV!EmoTVouu*kEg~cW6)Sp=aT@FXwmPK1b$icb8lA@ci=;&L7;Q zWQiO{dB!{KsUWWOAr-XiVN0O>qPZrfy|F&;Wl!wx*$pp+3l9$~Eb{QyDBig((zbQR zY=7~8XZlz2 z9}W`q_*?qezUu$ZgiW6Stl&KGNAsTtmVJc%(!lgr|HmKb*!e%x|8csspl%&PQjC|@ z|MAqgzfzS3*}2e!Sk1Szwsn%+?7Dkls!P9xPUmW3VxoytKjlr@+#;WPZYu@RfF|92 z^kgN=sfA(bj?21yDn<2y@si`?=KfE|7CcZn&*gD++_M24uY0aGRMFt764L;Ofu5G;qCRrlxD!uYBuk&+YJ8_59a` zK}wqJ)+c1~Y;mp&54DQ}iY&EK*+Zwr=WfyL9`DqZeUIN|-!yG^AJgBeA*)>aa&?C$ zN=jnP#pC>HgF&4L=-?Py)2sM)not|Paf5Z2J`C^Om$<`OrXhZ$W_1JV=nJT&qA-x= z$8u$!*727tJp_I#y`2&Kn7l7Bf~KAh^t`N!fe>mppggM$Z*Y}H2={;M#?y)~=D64v zGokhvpPnQ3CE>MdysPamd! z4mAqKjQv*r&;3cR-^3t7|JL%~50nA^KmhOxcnt&sK>&7$MhFlJgaO$8=Lj&51fqa9 zKr|2o!~$=DI3ONK0Nw$KKoXD)ya!T%R3Hub0HgySfehdikO^b~*+34E3t-dD2lE1; z5GVrRz-OQs_yUvwr9c@_4pacx&sBkWHBbZ80(C$=&;Wb|8i8*>6VME_0Ifh9&<=C} zoj@1x9q0ynfL`DS&cYKW`Q|i9#{YtfuFz< zunepKtH2tt4r~CMz!tC#>;MR07uW;#fdc@W?h%+Hfn(qVI0aC^8Gr_UsVH&&D*yjb z$NvAJ^8e6lz~PD;N9@UCU&rNo?u3+p;V5y*)isr_X~)xk`nD%9hRkKJBnb?}Q!jF^ z(E7znwORN6*zSjjPxk7N9>O~Bp&jePmRh7AVnkzyCNpcCQOhq)wQeBeO`Ln90PmPN z-P6vBF8^~WEv@3@w9G_Ak9 zQW12gEK{K-^RaaADW#NqZwvjz{4Z$kuJH423Tvicd`>gMqR5~*`9I2AlN2;@w@+zS7(!3y(M-A z<{}xR*)IeFIdN^B>IIP#^TwpB!UKBlU%DRE*xpmNjOW^1q-g%!yf&exIxTSX!h5sx ztkA4IYm-9YBN=-jWCUr zkPZ;hU)w3RE>A=G&Guez?YVKQr9PJhwIDE-U}&5QF`-M4sRQhmXF7deTcjn%1%Vn=eM;~#XoA@l)!uq z0d2Mq(+emlv7%)e6;m0=-!he>G!$WFrXQnXIn;47RzX&4V<4|A)XZbQGp4uRG4)0G z+&$yz&JD{D6JpKDysmV#(GbUDyX>QCM5njEt{z)7`IK2J37NKc#|KrI9$sPfn2Fhk zt6+55gdtUw{$p(lxlPNE9cjEe&Iprvbv`VDfs~^4%ajKh?Nw%aMMC&aE=zQg)Yk4a ziEd`<S}>ySZUv4ja;KQPv{6Y)afNS8r}9=Vq5+h(OXWK z)1DIY_Hl(|AS}{|<&?J@fB%9jy9x1w1QN!EoglMUarA5V($b4AwLvLNkjZlwRKFz+ zjx#5ITFd!tFukf5aXNL^Z>XXf{v@wQc#(kh(%^znhq0C3h1ct2RjJmW%;f@yJ1s}4 zb;iC>kV8~hB&BRzx)t5r(npV_ygFDC>E103Yb>^UO3d(YX$O2ymhYUI5*Zev(tNK0 z!r^k^SLL?WR6O+$9_*{)Bb&ZLNo%isa@Y8l&@eVm5C;jIzGQpd)h6EKa&1FmO2{+! z#U$g4-iia>GMOC~md+!N?H#4Ty60XtM!IpKw|9#OT>3T(%dRiRY4P2GTHEtQ#RU(` zOr%A>MWj})x7>)%TfJm;ZMe@aRW@EhPt8Om$dQIjqCZ)LTYh@&mhR+4w9&F9bK@h&`yyi?t!h;F8w?=}8iRAFpe2L5u3^z?Y)vyo*%IhJ|} zA!Y-C+4yCzgcD%TO`hg_H+9)HzlU4k5GS4@#w@p;egF#^z^kORgRl=rAK!J=mYb`pK`=48t7B) z4(@(<RoIHY=<6fkJC? zKQ0=~8k%v^G7e@I2zGJ0gZ#I{oOkbMZAsXrv`O%mczkQPAw#7gw7;N|4K1}K|!Y)=&igB=iZK^D> z=mvX@Ta4qWYrz}Jo1dxC6alFpOR}}cAKr52gYnfkqf=k^q;W9C=}+`-uQ~A`Xj?XI zMsS-M<|;HwJNeB=$+O%{Dl;*V*Fg*9l2_2vBi_r90+>y*6YdYcRO^}_zE{1)OLxc; zXXy_(X|zvx6SPlWVj!9{ACPYd3`}dyh3?AJJxzLw*baovIl5nJf$hYurj2O{3%iae zR;vngD$pDAlziYI4UjL_jyYsB8n?Htb|E+4Xz&_8*_?sP_(3nB9(@X!H#DUfWITo; z^ZIwTqri8gUzygX_xkPUSzgDP9z8jB@w<3?QA?86JrZUT!VEu~^w;9W-fGl*|Dvn# zJ&%M5w@Qv2Ig;huEk*XD*2`xeH?P;rYPhe3ThYvstz(*MOAB8=+)-ZXea9&id!gKQ zNinw1%Hz+d#R|*d>a8X7Fv{oE7UNln?vozY|2pD!qUObPsY*-M z#^3S9-BxQbo+FSGfq|Uiqr^cc_iYRWk;DbpCX6Urk=sQ@y>Fg-p7*5`cJqI;7<4WK z1p`5L80Zh51^o~x^H83W^*9V9c}M=vP_8Sg2~C&Q2Kvcqcec@Zpp(D#`Tu4uTp7Q9 zMEbzWu;C9T!*%i#wuHLqqnBX+{r|fa#iRL*hYFjow7_r;t)I3R;*qs03@n##^zI z$gi`1`6o7geDLWD00?{i64v@>D;ot1sQoQ{(SNq^KY9OO$^Ri(=k33xfAg0+82?Ek z|H<0~ApgYReQY`UNArIP#QhoxeqHHrtily0$!w%|#LT1-n>di$&9R41w1_>x$7zOM{QywU7Z5kE~dYe-;x{x9B zZ`+Su^ucJv=%l)lMqiOg@}M-Lg`k#dsgzGTQd!g22DXK`U>?s0VxGnPh}okJ>wc`p z$W+NrPtc(9Gc&Mh;Ad6}269YuD!FN|<;^dobdcRG+%VU_Rdd$9M~>7%vw=~OL7HG- z!x*eJ>UXa}b%A`izk(*F+pp7qP(C0ZQ9ogsZp{#?WYS-<%W>Gn-iaW3(M?C%mH>%* zcTimsg%WaGP>#@pQjY5(gS2+aGY|E}Qyxw)pR%hz@uTFEHTcN$`rXGwD*39VfkoPf6|hHYQ}46B{|HXAF>cnrR#r!A&2u zr8=1*p^A*_y99ECcod`lV%kC89K-MoWa3=bfTmf)sm-(V6Lc1w5Jy?Bs9>Qm8HsS` zE*$X^pY;2Brth4N8mDs7p~72VcO3C8gM;`q=|08P@HLTd4>-n6G`KpXN(_1%?wmIB ze=>H@I$Sdg6m1?(*b}rVstF`&T-`L}{JI@d-Lf5irO$pld(alHbuVj8hFxy$^%uIm z@auG|J=X2DZVM{D3p%xR2o6tg&!K%w3w!Dk9-+)qo}XQH1V0t^e?Bmcs5iOJnm?Sq zv6qvGzKQe^5IvPg$95S>u~5qkejUj@&q#83`^ptT$oEO)9O1buyk~lOyQfZFFlB1|nF0fCeLtNXHN| z=+}PW^6anyXls>n6!>e>qT#5lhu{6s~<%fUs}V6;Az&VD&b3#mV+G9WII3@@sG*2d|V zhttt(#g*f6c(vY6X9hiOeCkl(nDu28`f{w68B zME8-R)ld7(tT|lOQQ1+&4Ff5u_{u_w)M(|I=f5-|pXC$6p=_<0a@FJVh~=|Kam3W` zTzb4ra%G=th``muK4j3f9I6(bc_zv8WisTIewr|xv8{H7{?i8GZ}q?IpQQf3^jG}z z|CadY#z9o*_+fEQxARHaBC`o4o4@OQ=~2i9n=s?x!bOPCu;sK!pKMe76zlgV5o3l; zSq?@tCnZhn>|65pG~=oRCK--wp@*OPOSdnr>FqwRuy@NhTs^w;xpehsE8k~@-~~i@R^T#-1Fa%P0zhTlBretMXU1EI#+rgtrqqx&qHT*SHC~k5}MD|__&QuMH zJH<#&i^a@Zy-@$WqTN>6J2tPU?nOtG_|KK`$;h_kmei1;0g7jz2A`kw#OACIz1Nn{2cwanwQk44}-x0|CJyV#vPf%%P^J=SfMhl7NYs(oCGZW&d--1b+0qud>Fi#nXg(aP8ZVg0 zd57OW{6*nWNonfs0ikR8;HG4Bh>NwY_sLZ4k;Yj(m32awO4}CFj&aF|Tw++<+jrnY zKd)4GmLbe~0_ox{)-9N4``v7^w&re!jVLasKh9FMq4DA8fiftKbWwJY-q^<0jiSPW z1s5HTlz9^B=El4H+|mAutVNK)j%m1vy%YLO{kR)pV9nJ z=i3(+Pk6QX53K|5)4nJ^mHZZ?d?C7+ZmMH(sn9B|Oe(FgsbHcvL)q3kM{k0ynT8}Y z&@4%D*{6h^fSlu1MAOgBNN(d{{!HqD{f2{4>(K+yN-PXbiffD9kGLu%-cgprdzt;s z!x8=ple5;-NrDZpkvm?9+j=Dxmil@_=i47qF3E{<;Cz+(1X_9w=pXU*+&k3pAin*! zfln31UrMbjy+4om-eoNqHF&odsELPf*B1VQnRt+IyH@o=-Os~-r}m4={3-L+(fF|n zAMheZ{mGOsmF`TOFZ8I3BhrMc@VLrpxp23p&{x22k4k964c%dlUHS5P$Wp`mYK4IrOIil+2G0k+M}J`E3jx zxOR$~77(%2wY!t#=|$YsIrHi2$^LzJW)OmpZ_#PfE7?w+_|jSoP75MgW_>ISQxDgr zBZ|zgF1lyOvwruCq4?T6rvu&T^##L5J`jOM@kA6_RF-=8EkfrtUYz_<$=cPRkBbxj zr=V7sMB<`fg5U|R9TZ#H{{A!B!w8nWU1KlywLxgKPdjuj6@>%t=(_~!^9mMheQwbJ zf&IV(t$kY%EoJ%`Dpe5-?j(&l9re)*+U2jpIZKlO1BK6lrsM)>UtkA#AI*}VK+;eb zDnSF_t(yGb5+KiigqA&G1wmG?9l|q+Dw<#thUol#dZAn=)9h$p29)J%J0EEDKfCwN4NB~mc0zd|k0~Y}bfD*utIidn{ zYJdiy1?T{JfB|3xn1IUwGXS1%0bvEM0Bis|zyVwZt^u3?7jPZm26zBofDgCFK z-G^YV3OoYT0ChkEcnoL)T7Wj71Ly*JfIeUV7y?FsG4KR<3OoZ$08_vWFb6Dv=YS<( z1y}<%05*L)Ft-O@01kj7-~>1WE`TfG2Dk$rfG6MucmqCwF8~96*=K+FIV_l8p1<-} z`|G#o%KYi$FGu#_PzIEY*+PnpN^!k4iI*@1eu$jTETy98K@mHe)-4RWBIyJQS#Uk? z*ucX7^E0w;USUz|!6bprmZ z=kA+I-9W}kret=mIlit9p44w1xyjq#Omc3WLcBAga1XzgD)nVjNtQK?+9kqRy?=XXtQj@iY0Qh#~sB{wLww|MRZQf_JeRGsIHP(>ft8c*$5<4YG$ zh{Vjzi%?G@l^}72_NnM8q{(4kUugrQdzxnbz!szGppZL%Ax(elxacrP++>KZQoN18 zf%&q;kwn>brCWAXY%|$u3t3q^xitMLTJ^rhftfkA`UnR1qH9qGA)AGV9u+d`CA$}^ zp5&R%R5*;!+;H-H|11R>;>)GixZLgLLCSo;;+i7IYfY0#8OC^yIbRoUoW=JhqSVX% z-kLj`Gp`R)&Mj>rWqgDRJB`Ml$H%uY@QYC0lo!Zte|!0~r1jRz3q}Z*HhyyVfVtL$ z**)t#{qa$G2VU(fL!W2~JeY4TxKmz{hr|YIbr|e2oW)ivg}b4R;%By3lyWo97AB6X zXY4DtV;>=luP*3ao$NQ_h?e2YGn^3oQ5sH-7tHAFVXn4^<9}Bq??kQvA#dn)|4T#S z^p=OM?XYsb`}Z#`72jnin>g%^#P`By7Z^qkV|Iq)7GM{VS<@qrtEz^J3W}J&>3odf zYu2WCFssDz?0B~`D%x{7{8@>!eUuT?4!UM`l{M;d?dQIOux_n+UDnX+1`jTt@53t~ z6L#Ufof;RDt=@Y?QP+^riGidBzTc@nTR#QStS*g*1M~Kg@PkojFGDNq{Nv1vZI^4K zm5SOvkXC6N5K_;$$EqN~UF+wLG{RcSPjUw$r{sn^%{*+$ZU-`Yk@?2$ar#NIE6%3T zu6iz7E;EW&l$u7RC~!ATaI1K+gf%=@C03A7DOlypnQ;#@{-S>&;Z}i~?pFfgH`!#K zDQym$Z$$E%f4sG7RL`WTKF#++6F2u2(h`ZqT|P6mZ`1hQDd5IJSTBSOJZfX`P4@8~ zIXnt~#->TH;V+G6(qC_go&=){&@L-1knP2KWZhiOf|j=djcx7RJz>S70xcT<^gHdP zsvkF=1~qHBe5jgU&zBlQG&I?hxHmmgJSZgYQcJmr!;3ig)v48UzN!KFD2*JtqBa2A z22m8FP@X;e0O(%kYHv6#i#2?ny>_xsnfEPBnb-nOI9 zCv_}~#*XBFzsjiJUP6COf$L-#w1c2^K||oiayHPA`}PV6PVak>i5Q4)!^uAOwHNkv z@~^K!JFA#w4{^331(!djoeV%zaW?gyP&xOW9)M>-Wc>Y0(26U=w&J2dGs_eDOEW87 ziW&AJBMUYIN7p&0o=4iw*%PjjONFKDS`JiSH1lVrixlZKP?KfRDTKOe*m{0G6wD}i z7Q6rZh{kX2r!vr=@n^XI`rkc%|F8bz|FQn#(?hS}%IK6`#Z|SCw)8wB*k$W>n5BL2 z5t?F0U{#7G8aBs`plVVcaJmz>xQ*BK!r-Q<&I0K~t84K?(VX`S4{tcRD!YEW-m%+a zFdjHIa138?p6{)( z5z6P&qKWTZV{DHLrLBlIl)fw{y}qgCjp!w)H%D3&>LF?G4<1C3bZ4*mGS?(tOB!a} zV;`>$7r%J-dK~0p6Z>;Xo|SiY&BcL)0qsTJ4J@S2dS%&{2lVaj+dFTo3m2BTm8s{) z)cI}7ntC)1haPNmNQ%?PPUF2!bc$XdufGC%ZfsS&z2iND-@bQ|;tUw#P>9cg|vu_mJ$s}vIbbdTXgw_SbgG+E{x znP|6<{;8n#%y=sPF~ze$#zgiIO$BukQToN*?v7qjctLwr?!1RlkC@)@l*j67)t*P~ zf_h+-Ci~>;PUb~lDlPleY5&mEP4XxKd%LiSn}_gMzO3s4`tEzp#LWtUyDuu+*^eT6 zUO25H$vsaaEwvOnBNukzQp0H4RlU}9zQGgQ_X7%!{T=5@?$FV5m?Dgf#PJVCTkn)5 zPQ7lCxNRq?3L0q@$wLj>>EKo>wX@pkLJY)*9L-k$5r&Uczg`xcG~TY5(OP2UXMxUC zve!8BIM#;V@YHm#y*_*Txy7dNyV``Tdw+RS7emuEVFiP%AC+rPU$uJ92}`)dNFh$6 zWKOkw#`bO_{c5X(`Fnh~9^OOy*EgM|E@>gXvX!zOW3Mxrp!I~zbiH|Y&bCt)E#n2+ zsIoZO`dkx?YjJo28#$OP@NTZ1XAYY?6XT=o;nB%Zcp7mpPp(Gu?h52GPXliJ*~9#N zm$K4hSaerNoAM>q7{l#j@Q{-}pU)?0?P`x}_YVZMD?Q9~o$#WVUS_0ocgnMd+9%bQ zjd-h7gz`N#WWR6mNH^{-ugBua$R(AP=130|%jM}BsdOi{Cu=0mp*11Tn{PsbvIds* zTdv8uhm(bWD{*chUKiH7GUJs(ahqtt%4xZ@bKGP|mYTkNAkOsEIC=}9HQd~KB=PZeyb1Y(l z>b*tw?#DXouUZJ1xfMN;eql#t>PI9jFg+f#higlAS{DE1c)>r4AKd>J;|I6?4dV}} z|2FmjT$=u&@fZBy+Vc_EUhE|BZ%Cg6tcL>lqv@-F^!NXk{_TH5`q*@To3MHMXOk^R zKLhXAr3C*C>63v~T?DY(@Xyl5zW)-WpYXTz|Nnk|>tF4k|7+q0r-#-94(#GFif7zV z2~X^;YD2a%YRck@X0G4Z;!VP5abo)eH}lVDU;7wM0AH}?V?gSEFL>cM^)~A5rI!vf z^$wdOLb=)N!bzW`Y)iYi$;bve)9#4{Y*;UKE4RSCJg!cLai0~*u(vFkaz|1*FOqsW zO0M6SX|9e-`I=cjjrsp%6e@3%#(#Z>BW{sY|G;oHSZ`(zGvG@<@>I_ z@|L#wb$M|Har=@v1yRuH(0zLj@1B(KuCSl}!cW^TcRP9>we-H4W*gub*g`30hglL_ zo*PtBXp*XVDDGUyXEYmjooHW@r^DHJ)N3v^H&bs~WkE%+Q!&;_zsrkerAMK0*3GoWZKigDJCYWFgafGOw zux}X12}>D2>OyD~@(Bp%fN{uBD`O-hwZ}H!*Sb~y%ENeAa$zwT@C=^U_#PgK!aaqq zSJUM31%A6>E4Q{c@nN}!QMk;8rMhCn(PhWKV zP;uw^DgI2bS-5=-?Ala2;jJr87ro9MT|zCsKcD&Ej(R5mpKRJ|3WZEefqw63q;$jjZ^$QJq`hHj7x7dMmofPp3CU3FcD zHRp+^c7&DoNWWomfQB_S$>(pwY!97|Dp>RmNdgt0@r(#{TUAS?S&$~U@v?_F#FiFw zyaAzc-4IrYfFdhIF&(Grvij__M}AKA#5Uo^QaiJF(S~^jgMNUdbqGqFrCSf z&P6dYk?qjcqRbyQg5oL9HnU4US3HSPbg~e9K*UPQ&iYK?t0}3kTy}LupUr{kfO&Mx z>JZDB^1DHCfvi>G4fXGtcR48C={eM1h}z!J&#y`y-d6Xj+kjrW1_fo(UJhZ8I_4e}whFJZ(yCLzqSF~crbrw9>c`sAS zJt~qLo>LUjlEf+Mr`M#=&f?b7Zcu-l+124A&TwsSGR<4<@r7?u8nOaP{Y&&locJ8~ zG~b3_l(*^};Wa|)_S&uR^IDufAi2(V$2N*yiUz%fsQr;TM8mJTyL0s{RZaq2nu_zw%X_L;dR$Tf3f68POU(Lbc}; zs0RU8K}1SiYkI@R4@If( zcB7vbpy)iF;aYrqDkIj9L1WD;-iC)<&U?D%zv80{_D-L-{KD||6=>=ulo0| z=coUJC&T}<=cj}C!&2qjn#JY)928>3npSss{>OfP_q`Y0)CK(Fc_tj(F?Ty~CEVDm zE?=4#E}K^o;FDL`sWH%P|DMY^kzqJ0A|XsBi3k|4MQJ?^Y!ob}Eb&!AD<&#^dYU20 z-b=sQmYdPb99U_LRH_C2toOoTv#ku|q2B7bwMgl2dwZAVn7l>^54ViLGa;e7y0B=e z>B~Lqy~Z-~sgf5wma-RmFFvm}o6hiG7w>R&sXj>xC{Je2;P#ncK>! zqn9n}sMoTu7VEi+*oTaGc~cZpx1l^#j{-eLtt4ey#C+mQ_+AFi%90``l%4Et(IK`R zuRI)T$f#19K74KOpwEL{x(3~Owa$7}k{pG^$Iqq2Y8i7V?_XnS;AT$jmo1=l7B|=1i`7(!4KG7(PUG zIbP{OLA0If$#6t)SF9QKT2^;zT86hjT8U*&hdG>f6_RWF&81E`!dxdRc}1_hIb5!H z^489Vg8^=gYhpbaAE(xhnCteKMK_sc1dc07E%y(ca8*7fTeNYHW@Gq0BnJPY&o8+U(N zVK$l1KV!z3PUsiCzO9Mk&sI$@9Mtf6-*R=TxliZ=vsTAdODgd63tWhtSir$8cX@-* zQ{$@Q$`bi%9R}4>-mypCbrWw*@NPbl&-6HJXssg>dRIWHD4!xya_7ozqPL%MZjZ!H z`b`YiZq%?OnI-l&J-eR0?Wi;%E2WhQ6C5mCUH0<%?pS;E!ELy7P0ox_&8odl+4@hD zF?LgU=Q7$+MHVW>Y}awsYsf>aqEKn zR@mG&qr1FvkYazWJf5C6??!Z2CU2(lMFsU91*1ylgDp8z38ptzDQ82G$mb&NQNX#2%iH|s+)G6c2$4`zaN|>i>tSDA9ZXut#oXh8I!ZpoSM|~a*~~6s7@k+e zBw7kxX04jma#&t)btu5F7Ht!&r&n0%D^34M^#K_H&e!(&n&bwWm3W4$t#IcN8dsVv zO5GbaSs{KLIJ*J_?7Reb+ZL@1HT3$OYhDMMRmME4`R?i(GbxbEaqgRt?T6Xf_ZHSB zB0?hG1dK$S+_y>&VEL4x`bqdl5Zr2c3+o89#3_m?tWEN?IID|i|?NUZc z=PLWgo9_z#&{m`UM$Y3rN=lwkxq~x~!)kGPeY&A^KdRUV-XkSH?%Ppg0xR6BO{r`{ z?H@Z0)H`%P=b%9_<)Pym&w~8ilip?1EDI;sCTr_IpNdbi98if;F{cY2h~O%Hs~Hz# z98q+1V{}r&b%pNzeCVs50KeFMD(za27E32QIEcgKa(8+Ltm^7b#mT*g<~L= zerD|v6J5^S&7?22@>2ttv3Hj?X9xomealwi}eFdp5vdqhk~z7Pb@Jb2CVqw7;{5#aO^+)2qVyrSwZ}4HvtfM3e&TQy6~(_e@$0Pnt-1-*SVq z_O2~oU*adTh@UobgjNL(?Hi*ak8KD>$kQJB)XzE&ha!Y|jp=ZL{ z&H5GRg5#HDBPZ9A?B8uP-h)qk=-@0T^o-IRuJ2Blif6ax`aXvmurYXZ9xrytHKJ{% z&NIGYCrL$m>zUuCMR6r5+}@RpxLo?)O&L-qr|~LPq`4s{`t=M67{*2kp1?Wxeb@8d zT4%wvxVSRyGuf@q5sMJ_J)Md$wTrsOiaGK&y3>cw&K7EY|4)180uI&oHt;Q#?kW`} zgo;p#bRniw2T76cQKk?vuDOSqQc;SDNR+1BRZQ*_rd&hrcXGdmaT}L0#`xZ?f9E?o z=X~{l&iVe|ch1v#p5NYMyzhF~+I!DlYp=c5`>N>DMA^gN_I%O~8mP2iN4IXi6cZfk zV-&_;9BE3(koqJryoC<^Eu;+fPHx}a@ABf(kV-^8-#hVmUDsXwZ$3w}wQdAs_}@ZdEV3v>pq12=%1fD7OX+yZU`ZonPjF5nJ$07T#(;0bsE=v*Ri z*!utv0AJuC;0O2vkATNO0PqAL0Z)NvKp+qVpm~JAJ`@N8!hs0jIq(8_2}A->02z1% zL<2EEED#68186>puulS#f!DwrAO%PT(f|tZ7I+7I0y2P1APdL_a)9?hE|3T010R4M zpb#hmih&ZK6et7AfeN4!r~;~i8UQU%9qc~>^*{sA2s8oBKnu_cv;plv2ha(00jO>_ z?1g51{!E3>eLz1j01N^{01X%hMu1UZ44?z!00Wo+n7|~!0;T{o@Y|R6>&}n%>qq>r zKMHL2zvTbyzx`h(lep{#9d|li)PH@VBf`RZQS8k)yQNB=aYkAGhPr(Edl8XT9eQH+ zDSiRsVJ%fHoL|4GCSuyB*&v$!PU6FdeBLMbJg=r6wzxua!)jItr6+WppT{q^nrd+Th^ z8?4SY7ne|570R!sw&Ttff|jpq=DyeMN8hL(<2YLyxkq_rify{i=5|`M1I}-An{sXL zy}_8odK*5A0(;*~9FB7_wtBD3CTh!@*rdE}|CAV|!kD_1IV3^kDmH9afzz@Vj*`g^ zx%}xZoPrNusodFwHDxO}3ZuVTuyCNrL2`l)ZYmT{a<4qLP($^kuWFZs(wZkii!VLu zF;V9kPsQNN^LpPN7W zd>`7LO>n-@wByg)M>ruLE&weAn&-DtFxWrxFZ(eBXfRh{FT93fYpTe3@-@@L`{WSd86E9atAq55+;HW zM@xE?>y*hod(T$WPE`_RoNxlvAihfzmqwm$F}8ovqx_4Il58>e4#*`4GRuMg2T_A6 zuO>%BM*K#MN=%({q<{%OC6djOgPK!bGTPdWTS&zZJCPf%?!us-K}T zO1Xm6PuQ~tgQ%V5mE5(HT@%>UbvyBmtO@}$OoPl#5KsWYW9+unDTKO4p}}Iz{Q_h} zjGth6v%P_Ed86SIgb5`yJ7rL3@4?cK;9)7wQ*M@;I=WUC+76B;bp{)utqq!v%Wh%| zU{>k>C?N_fhGyu%ywe#9fmi<%S+M_Mi}I!Y`1xak1c z`KOb7dKVZjRn!1YfdenKWEcHfGn-DXZTw$@>g?C=LQU0kiOB#dcV6}I< zn(SH;QjyVw!01kbbhAe&p?jO8I-_}xBcX+|sKHLHOZoD%AVRWeSH(z9?=ca-f!Gs! z2=9%wNh9eChGMUj_cY0e?6j(t8|uCsa<|PtR)r*kFBr@Sr>76C=9PBxewdcLdQ!Y7 z1s9?!N!7hzHu!Ea`KGEY{kUM^eeu3?Pb>vmKBa7(sQYQMLAsFckj34ws?sF>u&lmw zU;TCA>kI)S#sbc|S%oxJ4|#05MMM45iFA$jRXOKg&R^NtF>WdpC0H54uSXp!%`rXa z5v1l8qESQ6teXtl-nE@PM@yO+%jhQawVY0@g%X%s1hKk(XQ^@T$culfSt127A zr6Ar-;*zm`ox0G>WU08B;j(cdY`4>4r`r>=F@6Jt)0h$dN0dpqy3))GBG>aCi3*(ZaD#u(FqsNPl(^?Nf!`L>2=;Z_jw`vOD^x0<0P z1zOXc8jJl+~R+UV6WgMq3!9VIS$Y(w1;ueqDO>45EIl5SwJ5nbLYtQ}m3WNBP$pXvxvp ze~2c|b*9DzI7YuM3))jgx~0@mSt~da=7rQs*zQPyv^ZQpykzpEqc{`eO;hlztCPQLPd`bbVre7=nwxL-k!k6n8 z4MOyHxPCVw%YO79{~7(qvWWw%p^{P0$@Z7zcuuoIBD$gIW40x~K)(!(Nh_D9$cip} zNWz&N8;8|E4PiqoiK7ojFaZLF@J$6<^k~8e=3ZbltF$4E7I;+(U)ERd6juLY^okpu zGD2iMo%zlP>b_cYff$ z|K;~{|8Mg9S^EEM{O-?=-|YSi#-GsfFLXEy-NWvisTLZ1(!a)^(CE8=CV~IUX}hRx zG<{EAyubVuuZq`xim+4AS@x26Aji9ch%w)vM~uE8PN@W|*GeVj3siTdYYXZw;q z7nyAq`|LS$IsP&2e`+L7&^lnR>DsgJF@v<@Fh#<3EK3K+FpaaO9*Xk8=b47QTUGcI zZ&ADk>q8Z$YgssUF+ z-~v_vD}hx2H^2j|2G#()z*>M0;0FYNb$}p%&T&Bbk^b{X;K%&E|GW8niLIDyC$r`% zx6M}dJ1W!dHpFVV;KJ)4S=gRk92LZ)QCFEHKsQo{dv`HL3BqJbK|G3DjFI}d=o-SL zbL$jR5>qMfL0T1}UtFggr1ETw`}!qkUaW*ZhT*f$Ld#A=XYv`sq>9qk_{)ZPAMpee-UfdC}!a~cJTkPtJ zhxQjzydRRb2E1(0UUgu+#qMM7!Mryyjr~Ts)+S-5teX^8%AY{n`V{XD?nS_> zacdkQ4+RfoLxfXTa z{qT(6;FeLPDdUV>UD|6S%GS&N-QO-t)rRME{(P1A%8L$n{5*W*E4jwaRxGTAi`WB=_})og7Be5-s9l2k1P@{- z*@w+0Xp&P1ADJ)k6|43GrjsU8Ta?_#S}_^CM>WbWNV&`)y3}i7{(FR}Pnieb zeXnHhB;LiK#`}n?`3O{Ply*` zdN0PX-dR9o^BP<}C6PSWbJ9PQCsKWhPNMsUd#3gAZ43CSY?f5&NWI9(+t!VlsgZ+g zvb=q8_f7mMT&xESVPw+sGp}mc{2rc<77=qB3b+zkUohEQ*jsZwt2UV1 zb|=5FbbNNBl=!35p|0&bhkowXu!%ZhKDT0n5}QyQrujm*K#fN2L*vee=Tyzh&Yk&b zSBCO(F`+$rO3#ImId9*wBcf57Zs9FB#qFUZv~gGIJ|l{ojEY97YL3tPGba`A&0Rk3 zo?J7eV7q=(L(O@OdBQraVs7HA)sE2vvdjZRw9Y)7C8WctwkeWVQ1IGOxix2_s$TIn zLS&b=r*;Oc^am7%46aX;ZqQuDKFE% z*R?P>Gg~l|yqoQ)4%}3gDP#jXyi9#{mcZDdIao_i>0v3YOjXmQ@GcMyOwnDpeo5Rc zPIhvso0ZX-@+HB=@mH<|1zp-HTTrUFoc{{xC+(aj&N=jrv$bCIJPS`*&pp(}wlccx zx-T_-xM=rF0atDA`={Mbo5b>EcD;|;G=7g?O2JQLfPB6rZOtV-SK0X(u_#aFyu<hFEF)S?zDy$vT<%j{^Xbh+kd z5m+$vcAm*VgG0lX-?v0 zZI!&WM;X8Fc9@OC)op?&l=C?F@UFy2yI@)zS#me^XOg?==r=Hyd0(iQ zskDRxTM9Sa>U_3(JT^zTAuW(<3A9AmX zC{RZ_UbgGwUGYVvRmN#s3qtce?PWuKpKC^D+ST8?cxbDlIfI6C2hY0@5<;J~`Kik5{u)Y))w$6bGdOIWwPm54egPeFb4 z@BcmyS`2>vc{ou%y^L>t|9c&j*KQC{BL zyK5F<3p?VLimu%W}JFbwj8DFpf9bt4J-NuZyF>aUy zj{jbnW1Fy9*Lq?zO8Gywwzp7JE=3Av*gIidpbej;d;I)sfdKACE^Fn=k;VIpMhWzI z=lFoGNoJUgbX$Bv=k8g3xvO7gx*i2r_ypZZ_BG+V)sVWe=?^Qaji(8DED}goE z*9uk6Qj(_@uOtooN3(o)7=A1ZmdG^AWz z_$qd#I*ZKZiIdL#|NlR+?^JBxDVxG|A#I0TN;mn` z?((eM7SOa02o4`UtfHcF|Ni~cr%#_he{t8YUE8*8JAV9lXxHJ)z8w{9Q=FWfV<(+n zw{FAZ$4{?azYPReuU-wSUAu16rb*MLO`0^V4~VDDifY?CZPu)1%T}yfwQAF*tqHLy z*Kc31nsapCqD85xsSKn5#h)x-D79E z@#POD6+7>}EB7%IIrXCCXN^V0?L20gf78xCZQWUS{`&K;jE#-C%>|6??HwJgO}%~n z6B>IaPMI=!>Wp4iadFN$bH&vq^prI;l=URk=g*xtmz8tlCQb=eeJvR!B^fP!Rf)}; zHyo5ulMy{}@`Q}?frFffH%TZfiCnvWL+R{!R^EH}RF(K1KY99CNtN^dy}S1%H2FV% z6qOPXkP`i*De;>3?LEn`6V(n2@7Z!Oho`&Msw@*R#`-#uLB*&?80VUWz)qFOS;r*ad^(f)^4buvoMtem=P+b0Al z9)5I&i;E-TY?bK~9#x+i8i`SkuWzr)e|_()wfXz|dj&ZJ_DMAsK04B_Y+tvB;q&tg zi|zG+5ytfT>gMGA=VEu4v0T~PE$?q<^Yio5t^6nU$^C8kc5~(a`TX002t}0{{R350Hx300004XF*Lt007q5 z)K6G40000PbVXQnQ*UN;cVTj606}DLVr3vnZDD6+Qe|Oed2z{QJOBUzfKW_SMepzL z*?5)vnXr^-@mq~v#Is<_TJv!tH9IQe$@Xx30Dl4m?CIp{=H9&7-_qpj z@$&Na_V>}=-P_s8t;X5r<>9oxu=V))t;fI5&dBfV=di}q&Ctl)z^}#1!s6l2^YQNR z_4fPy{pIZK+vn}2t)%$)_toO#;n%^Nt);HK#<#b(?d|Q^-PrN-^x)*+!OF_W$Hdm! z)7aL|?e6dH@9^Q?*SNj5^z`$uytMfH`|DE_v7Q^$@+uYl) zwyn<6!SC?!+19@4>g)FN@VIM;P5=N05J^NqRCwC#*lSzbSQiFhNFotI4oL6_;vuC{b=qK$I+Xz#Vv+gl@7g<|P-q!D?T7b6AA7YNE^pUbd+%Us zvHiGMY?dFDpVm+7|H0xQ7NY(A7RQyM(T<>!bm{vn3=x8=(rL;Q{SFI3)s8?qX$u8u zH@N?3nH4ckx}#Azn*N_G4oMxo<@6I6%H5fJK~aq=_stfD8jQ*iH3XfEFQlfX+!}Qx ze4~YjL@+!_3T(FWE&nOEIN%yOC)PU~H4MJ1yg;_~-0+z22Q16&6NVKzRfjwP1ed_zA3i zg*8U*O1&IMRBp?=xVZQmEHTY-U$r_!L!g-&bz+X`4t(d)WtnwhDFsip&8{Fwn?C$Y-BAJXOA#XK`_RhKI zdKm{RiY;3Snxy>@I2z;yA7(lgGa&E3x|;RV@bB*M9w! z+hA1ns)v#B*^{x*P0SkNT`$lbbO1 zME0ERVyeQj0n}Jv{oq}t;(WYbiBc-f4zs z%YX#}iTOaK;&}X+uf*nSwGJ!E(%mmvP#Eld++;eN$nw9l&R$elfpTnqJ`jt=_)zHh zEEWjIGmI!o&9${JSS8e?pJ6B}4r^%JRure>NuS5FsBIQf4$MD%o3GdOr9Z`r)$Fow z_7)3VDR7fVlvd3Kp3iKn%Jc0jXMc6DrhK_F|4%-@l8@I9{bf-Uea+=ztJ|c9(jI1G zjt{S#Wi`}ip(Oz5kGJ*uO1}QgL#nr|KKb+-)^Zv0xdlz4EyieCK9N;l&1@?$nkRkI zSpY%x{7TzHPCj@rJzbDxabu|&{B_W>aAuQjDtG_l{MF3NbN(t6a;hq(proTr9lj3V zFq0r5Yr-dqvS?jj9=41o8G*_@Oz2l1W@es%^_*o@Cx4b`zeP~{jbE9ZeqdyJV#4Q> zcK=@cLS3bf(PX@q&t4#FW;+xLIh6BCDV)h*M_W5O-6I^ zL?8rB&V;tNuN?bn1f}hMwYen95?IsymMq;u*q~)LN$27Z%ZlT}hgTuT?)!Qs9B$j` zgJRKfeJYExuV7lxqE&?1e{`%aFGmI}i`gU@j)%|Al&f{!0waQoXeKxtSzcSc=lJLY zYXVg^ZH!*rXx>|0jYJ~1;VRVWv$_`xBA>}7|7fET?R99Lt{%b>#H8%gO_B=Uv2 zEZr;OVLH8+?g$J?!XH~++cT_UbLr`l3|9xAPn1NT3|sX&7z{>cA%k_9O)_L-@4W|< zR;$G@Dz;|L6tAUISrR2!1W~qb$W})LQ?s{UYyQtI+$4M+`FW=0_tP{y=53kUUc{s# zj)J%$iGRI26*pvgbU}c}Bv|dpn337yda&vH^B^dlvL7Yi z@mSG(V{GAdZNNf>0fr$@qv3(QOWMNm!`ZQ3CJP5+#k*3l*t}Kjy}A=0vY@brM-Tu) zpX+wmyQJ-?{;c0BBEdO{9*y-|@c|18>k#HI2%TyNO^>vt!|h)Na{HGz1Fvj_hb{D5 zJ%*wsV*087z%uTCq5yIDOd+dU>g5^AA;fan9>~#P zUFIDp*E^prm1K-f+YNrkz>AFelrhp8wtB(G0M676;-~cnG0H;6K!E*vgTNlL6VXu? z+HC^fZvPTp7aBxoqy?Xu1lqCx9<&{!C2rKcXsJrvG#yNhy03)|QoT{41~uw_oBM|R k{QsPv*4L~bm;VVc0HT!-jb!e$TmS$707*qoM6N<$g7zKgCjbBd literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/newUI/bottom-right.gif b/posterita/posterita/web/images/newUI/bottom-right.gif new file mode 100644 index 0000000000000000000000000000000000000000..9b13d8c5510c283db97c04a13cdb174c3f8f7b16 GIT binary patch literal 225 zcmZ?wbhEHblw`1B*v!E2|NsAIPoKVd{rdT{XWzbk`}FbSt5>gn{`~p!#fuN`-~ajZ z=ilGI-@kunfC0syEMTS%hy`)~W}6C0C5a+)(*D?0VKi$&P`gqbEXuqqd7bMZ``K6l=H=J|`1 XITkNtWLdt5Gi{X|GaHMLAcHjkqAhI` literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/newUI/bottom.gif b/posterita/posterita/web/images/newUI/bottom.gif new file mode 100644 index 0000000000000000000000000000000000000000..5d8c4bbdd72a86f3e849becf59c6760183fc5244 GIT binary patch literal 869 zcmV-r1DgCtNk%w1VbBLW0J8u9|NsBy<>mMH_vhy3?Cb06>gw|G@&5h&{QUgz@bK#C z>G}Ej_xAPx0000000000A^8LV00000EC2ui0MG|K000F4Fh~iiy*TU5yZ>M)j$~<` zXsWJk>%MR-&vb3yc&_h!@BhG{a7Zi~kI1BQ$!t2G&}eT$ky@|Vtai)odcWYXcuX#v z&*-#z&2GD8)WCaAuiNkVynfH``~QG}f`f#GEOCa3ii?bmj*pO$l9QB`mY0|rh?$(7 zo}ZwhqNAjxrl+W=o2jg=uCK7Mva__cwzqhzxVyZ)zQ4f1!o$SHbGpXK%FE2n&d<=% z(v-;4*4NnC+S}aS-rm*U;^XAy=I7|?>T2QZ?(gvN^7Hid z%*b-4&6_xL>fE`lCeNQhg9;r=G?dSxNRujE%Csq(qfVnrol3Q;)frH)YTe4UtJkDi zzlt48wyar=Vb7{v%eJlCb!p$qolCc_U0`wV>fOt?uir{}{|X*VxUk_hfe$NQ%($`R zA&DPLo=my2We<@rYu?PcGvCafLyI0wS}W+%s8g$6jq^0?*RW&Dw&;4c?c2C>+pDd+ zx9{J;vGER0ytwh>xP~KN&b+yEPRgH4pH98HpXk=JYv0a24EFBe!;2qJ)+4ccmDnW1}I?vY5xsq;DHD_R$zh*Ht6783qB~}gcOPu zVTBlGsNqrguJw&-F}aS-t0j5O95Qyc*pVB?NF_Q(;A z0T3Vn0zMXL7|%vs_CYjcIs)90(>g!sHB!^>Zz!vs_Lq&w(9Duu*NFuth6!-KmxVqs_U-2 v_Uh}ezy>Squ*4Q??6JUBz(4^?BJ1oDv(QE>?X=WZYwfkzW~;5X5dZ)?+*kCd literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/newUI/btn_changepin.gif b/posterita/posterita/web/images/newUI/btn_changepin.gif new file mode 100644 index 0000000000000000000000000000000000000000..104b1c749734a604f8ec4fc3bfa716af3feecd3a GIT binary patch literal 899 zcmZ?wbhEHbtYeU5SjxnZIO*K|`}hC<|Ns8O2gky77MaTID7jn+r9e_?%g@|@G0Bl7cXDEe#LN|k@?xD&(B_d`Tq3P zkKcdpz5n?4fTD!Q28E_-Hr`F%VjC77uIE(tno}`B&b6IGGwY6opwjUcUZ*Y|%>_#s zSX4Qexi|zhcuc?@#2@4_X%&=X1Ay2|GUrav#nzT`ZROKxtU3ptPEV+NnK~n-%Q9_d#=$C_BEVn`0BGFr1^@s6 literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/newUI/btn_quickdiscount.gif b/posterita/posterita/web/images/newUI/btn_quickdiscount.gif new file mode 100644 index 0000000000000000000000000000000000000000..1fc42b3a69233a28c4e4f57128b9168f717bea33 GIT binary patch literal 916 zcmZ?wbhEHbtYeU5SjxnZIO*K|`}hC<|Ns8O2gky77MaTID7jn+r9e_?%g@|@G0Bl7cXDEe#LN|k@?xD&(B_d`Tq3P zkKcdpz5n?4fTD!Q28E_-Hr`F%VjC77uIE(tno}`B&b6IGGwY6oppttNlaramO@}8Z zCU68a@n|kc@t&@-cO%cw-eqTIYKJbnva|TrLRJ(zH9pIiI{$?_I7w)^opF#UeoTFKWSv1rvE&aN3{6a>FMl;U92x>CZC(5 zt?t+J>&ug6{~b=x>liHqs&Y@%GNk%Vd8aXnwjycXQ1L z1(mO_PV|aj@7epi^zO>{_qOhqHO@bO{IdG>KDk|Q>aRaOJ>7nCLoJgt=N5fAq5TZM z|K2=4zsUKd+2w{WXI zaDXYmP4nrLkg&|BQzOzWpLRx-&0Na5M?%Swm32zyvzZxU8ysfkY&-dER^G9nYIBON zWvb5-brE7z6iW#>G`E3G>&1eWTaiv|VgiTS#4=1?y;wZK&8kf*j3e-f$c(gAFPF`+ M3Op*{$iQF?05`Y)Z2$lO literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/newUI/btn_resetuser.gif b/posterita/posterita/web/images/newUI/btn_resetuser.gif new file mode 100644 index 0000000000000000000000000000000000000000..aa942b4c88d04c25de203ee91085b80bc87ef845 GIT binary patch literal 909 zcmZ?wbhEHbtYeU5SjxnZIO*K|`}hC<|Ns8O2gky77MaTID7jn+r9e_?%g@|@G0Bl7cXDEe#LN|k@?xD&(B_d`Tq3P zkKcdpz5n?4fTD!Q28E_-Hr`F%VjC77uIE(ta#2{2rTX(v{a4`e3oN3eQ9Um8O z?_pzW3prW1=yZ!fyjRYJ1xmiNO<7g;cuY+D=Qp3%ZI+JvrzL(}?)^%4XNIiwnf|}Q zYp#{4<589{)`X{#6VjR2SZ+*u`)W##`!v>kt{Gjz>Q}et|8MmDFjdcYqus~6tFub; z-L{4wU1uXbF*~}ud~@2J(=*oH*jXxXJ#UV~x+kY+2+LSJC^SyrH&HbFj?FFOfbBtd z*~HG4Z+&odW^($!=R3E(y}i{vTIH;H@ykoIU$@o9n1A?id_U`*YrHbsi|=gVx2bsd z=U{W!wTKH`Z5j_5|Hm9S&|`8f<8iOWvlWkf^=_Fbck#c`crw8xu7Fox%wWTTNj_#T zpG*#L(|kH5#7Z-1YD7>bqkfx5fFolN)f@79xtP@=v zI#?yAC_JB6^X=vH`GwOaG_tmASjZ~Xp|BHUGkj zFP@Tos*I-+PQR_%|6oIfkKXL_PZm9qnvkF+*-+!R{`UJHd+N@=|NUN4R3aiQOQ1wxdhzr*bBnkb=FOZst7y)`c?=5{&0V@|{-W87*R5YzwtUMr z2@zLj1+D`J4;?XkhUezA=BYC5&-PeMPXEW;!|T*1 zbWDq^*s?ut)YP2KUfc~@qJJPq5#mig!R2|ozI^Sz&l>YTH)dPWvt4tiuRFKzv;Er- zkK@%H_V24@n&ry2KVrW9zdv_ZvOjQJo@f$VadWQ9{U+{z#rK;9+$`j4dHgsMtLGX@ zJZzJhSr#FmC)cL2s9p5bam94yWfk`s|Hm9S&~0!`<8hD4wT#C-T9>{jb((*Bq1+=L zbGVz8Mj$7ZHhKE`bt(>BZCM%q`+#m^X9k ztfDy!=P@i;G+43#hBt%@96}S!@JaqUF-?8H-jvYCA^6csJ7cO49 zd{KefjhW%>?Xzt6?mxJ9=h(xiY>!{OeD(Sj!*xdHXP-Vld->)2(^o%!|GD@62{@SE{Z9~E1V}F-#TX%Oi`=dv$x3}a+>}g=Wy|ns4 zpm;niOJgW=l1OU{QOL3zFVKvuCK38>c>1z zZ9LfY{=wmHdH;QTetv#&^s(Q0xxK7$Z7Lxe4*U20{mm-&;Qsmg{r~z#>)= z&pOe?p@UU&O2UI?0XL0@Ev(ZfG_tmASjZ|RBT@F^VY@=#!ZuMS5yPXM8p~EZ>hcRQ JbP-^%1_0AxZ*c$s literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/newUI/btun_save.gif b/posterita/posterita/web/images/newUI/btun_save.gif new file mode 100644 index 0000000000000000000000000000000000000000..f728bf2da966849ab264320f89fd0760b58f2655 GIT binary patch literal 867 zcmZ?wbhEHbtYeU5SjxnZIO*K|`}hC<|Ns8O2gky77MaTBHUGkj zFP@Tos*I-+PQR_%|6oIfkKXL_PZm9qnvkF+*-+!R{`UJHd+N@=|NUN4R3aiQOQ1wxdhzr*bBnkb=FOZst7y)`c?=5{&0V@|{-W87*R5YzwtUMr z2@zLj1+D`J4;?y6;PgZV*S0H}2}}Q-pU?UK zpp4g*)Fu|*J}q0V$)5Kvuz!AY{h!jnlpW-p&icAPe$k+o&RLRP7Ww3Sb%#q=#~6Lk_XJUSy~TIREv Lej$b~0u0sw*1O{` literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/newUI/bullet-arrow.gif b/posterita/posterita/web/images/newUI/bullet-arrow.gif new file mode 100644 index 0000000000000000000000000000000000000000..838613f26cac13589b34bd568422332a40634bdb GIT binary patch literal 343 zcmZ?wbhEHbzxVIozj^cK+qZ9DzI^%r|NrODpI^Rw`Rv)V(9qCV zuU<`>G->VHwG9mo&!0b!h=`axd2)Do_`Q4g?%cWaSG8lB}$(88c@5{rh+I z>eaoyy}y3_+O}=m#EBChK72TR`t;7u&W|5I0!?Nh0x14uVPs%1X3znt1^J1At>nPW z0yaSog~N%9lVW^0S{5EkoG2^a+2%ZBkxIziu%(S1o0J$@4^DY#q0#P{VsJq~V6}h` z6N8LI1DBYByrGm3Glv8#Goz}c9y>cLgE1#RzlOTBI0K`g6N3;VqntP^8!NZ71c!>g S5*zbWPh&+kp0*W1_I z*T=`l&(G1iy1HhX&&S>FL2RZtX{V{s=Huh##MIr@&(Y`W?mBI%cdOTWoW;Vv!rtWQ z000000000000000A^8LV00000EC2ui03HAy000I5Ac9zvV4i5I3X>&{Yb=|tHQy^~ z5`6FfJi%`_0UD1;pF%-c@)U-sl-X4Fme?#7^5{My+OQ%)E}O~RLg9OECkF3<9Bxjp zBlGz=&(GVxeSv~=e|Up(6%2C~iHvd)4{8(<43z_liUWz4m6cLa5uuR+$FT^a1Ji?C$XO{Qds@?a2KbNHE|#0|XNS{Dn|q008tL z2GBrH1AuZ5A!>Zc4}iyyAVZ2A8Q{RklPEza9+;4_<;V>P5}a({5&+Ex4HCSVa3BEA UpFo2OEji(Z(W6L{CJg}qJAIbTpa1{> literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/newUI/butn-addnew.gif b/posterita/posterita/web/images/newUI/butn-addnew.gif new file mode 100644 index 0000000000000000000000000000000000000000..8baad87b5592d5a5ca654866d69843f6317b4bae GIT binary patch literal 1608 zcmV-O2DkY~Nk%w1VIBY-0Qdg@X@rK$);Bz1h{oSo_V#rwP<@D_qtepIx6~-0uzX;B zfzRS*dz5-cZJOrh*hgo7;NaCvbfjB>sS^z@cXYlFnt8fb)jcb2G{xEuff=>7Ve z#LH0k_s`wzdp%^A<>lp@x+v1=X6We2@bK`6oqS(|n_GE)%gd~$$wki2&S`B?`T6-= zdV}%ti~s-sMQW3#w_8wpt=HG8Gg*bV#n|fV#O>|v^z`(MrJJC_DC+7)>FMc(oQr~< zrF4^{PH>Bgp^`INioM!g*4DSsPt z-{0PYoNU0`RY7EeVT7bjc&gOhG**7B+S@L+)=f8Cg!A&pa(G#Kl7)krfsLeOa*l;e zcBt*@-s9uU>gt>5=+ZP;evPLk?d`Ps`d(UGR#AGWZj6{~ij-A*rP=Ie#oKS}?4wnE zs!w>UQ+1M2d#-DZpp~wsL1vBX>f_Vrd0>XCE>nL)LqMymhUVts`ubA(`M*+qvAfq% z)8=UM^5x;-;6`kYI9`iOZHkkrURi#jm#?9+(o1)avRZwdRd|(Bd#pV@J&vfSldPuj z@Mov7F5m5S?(S37=VsLBVYAalnXsU;!99zqGgW}LMsT5wjEwK<;yz%2{P>mW>Ag}@ zP+5SfaFM4|e5}05H91>=w%1B&ji|V|ZJ4l!`}eEE!^3HYk7tRbVSs*ahpxlVJ-^vd z+vD(%sVM*d`7>IS`1qjn^PH=_*VyT3fQ4^`i*UHaUEt_Bewd_vo2YY+Zoa<0USmS( z>2UY=?d$7-+Tn5T?&H1JFSgiBP;!n}c7RxXkMZ(Mc$SpH&ARaLqoKnv@bIYr|H%9J zs!wo%hM|{lj-I!-a^>Z==H|G8n1#dKV34G5$=_v*rO1n+T$`^+sK_3%&m-{b+050P zm#uQV*JA1E<@x#9dVyb1cb!*znaJW_-Q`MVh?DQ_&Y`nP`}e#0`mwyo&CugxbB=Ja z!gOV8MF0Q)A^8LW00930EC2ui03HAx000R80RIX6BuGY`Ix-R-TzJr6LxX}o37nX) zqQ#3CF;1K_M@FPbspMQ4NwQ=~IjKI%;P_7vM;UTXN!YWeiOrihZPJu*N=~FXRRmS3 zvPO=CCaq9mSjx0%Q&g>*^js6BN|-QfPBlSQ%)lf{V8h!H*n#)nMEvA9#N1Xi&1B93qEZdNRiqAE07;< zb{0hd1uDWKJ3c~{+x4OK2N*yU7&CXTlPXo6&h_*5ikgXdq?at}W+0TWT8@%CA{Hcp zumBdE-MZz>0zD4>p40>0V9BFyIYQz8szJVnzG~~34MU*E!=+0e^dP{(fgKn~4Z431 z|Dyj3T^eMw0U+sk@QWsIyrIc29;9PM3=Bxqzy}S;!v=pWWT?zL`4C_MIhkm(4>JCQ zn29(ROb~?vFi;4|g`vEF!;H#wz)KqF5VFq#Oi0oP6AKhU2s*ZWLCYbpLDEJLF_Pe9 zAzM%Y$TdZXutFa`_Q8b+Md%QKA{QVD1072?`DB!UgfPH7T$o~n5vIU1&j2BOc_boZ z%EBZIH}u)e7QLjAffR#?1BWSUz%j%iQe;phEqEY;2Q+$y!U7MN=3x&u1SFBdAe*!U zOfW-iGDr$Zs2EM8lgjc$C^+2z^+y?KxG+r!S!B`35JNPQYX%SUvyA|V2mk~CJ-{lf z12)7#zz%1m@C+-gJd?s1^nGzb1&9bCKq3l+6AB52lw0l?;E<8b5tiiQi6>`Ras&qu zo-l0J7Sb! z0~*#);DQSjSmPN3Cp>_!5;O>~FBr$fqQcBGA7C>PM9iS`3@D($04)`aLW2@SSG+F( zV000V7fd%@!qZQC!N3JARB$iRLLh;}Dx*BGO*AbiAokc~i`_yr+dMGJDoP+B#6NuS zfrJ@cPw~Lrc;}t>6lC-ZGiUz({rCU>|BoL({`~p#_wV103=Lnue*O3F|KETA zef;?G{rmTC-@g6%^Vi?Me?Pwe@a)BtuV263yLa#Kkt18TZUt&&zzr0CvM@3*h%xAZ zlz{AHVEw;9wJ#-eUdF0*I?{Uzbk3LL-ml1uW;FeCU_pV0j#U2%m5HB%tma?P_-MGm zF0Q|&?DX5J{SP)&_*}DNdH&gZLB{U;A9mFEt-t*~x3TVj(VPDbjZMuht!?cMd|hl^ z`fU9ZCQh0>W$Lu)GiFZfn>Bad`~{PQgxFa7^;uW0TD@lNy7e12ZrZ$7XyuA6J9q8g zvzB`$H@E)5BS()NKXLNZ=`&}K2?%gs)ED5ncKyc9Tet7ry?6h?EnXgd-e=EWynOZg z&D(eHKfKlF`11AJ_a8rh{r>a!-!I;0j1nFj794Em5Y~!0u|d&^MPJ5ij>kqN=MF}l ztUD(*CbV#{uM*MQuS%Amg&Lvn`63saP&_Vvw_H;*#|e KX>S!^um%8%klFG8 literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/newUI/butn-card.gif b/posterita/posterita/web/images/newUI/butn-card.gif new file mode 100644 index 0000000000000000000000000000000000000000..8eec29d7d7b3561f3bb3c8662cc88785941df49d GIT binary patch literal 1561 zcmc(c`CHNl0LH%@3SNn4YA(sEJR@6~M~{fkbhf4COrO%+%B7nnol?3+#Jo};HHSV_ z!tg*~BH}p^L{PERN3)cQ6ud2sP)afnR{JOR{_y_tKJWW{p65Lh5q8M$#{+;rFb4oa zp^(SpDHIC1TrQDFR?_1pt!+m~NBjHxWpde=Og=R9Bsn>GrtDgD+!;2TQ(Idnl}fc* zZEI^QlgV6S7QKyf!C*p8CB_yN6^nZZ$z*b6WhJeuMzyu2(P(O!Oag(x<+dc`R3>6f8LYJ zoaiP2K9&);o=MeO()K{z8Ah^fM^%e{0to^gjg8FaG5d0H(vcy1ILS zvvYFu^6wTDdbktr6y7WQ^KP*_iG071_<%zF0}LssuF8f$ysVrV40=v&H8-~*kIk-X z=R*vvI!&An_`HsWrk>u%d;>#glTIs>E-y*H?0LU|0W9q4$naC=QNfEj*&xhQp?s>c z@-&ps4=^;Vd|#N6m7YomOg?Igy=W7Ba;(+ubYIkMp8gh+=Yejd1>s=&KCk*3&+_z! z08DfE2nJ$pd*J5LD6g))I;@C;iXn4HmJPgx4$K=Bp%d6H0woEV5=pZyrxu; zk^eRQNTz5Znsubfal9>Q<~zFeUty#1_|TEEc!vK~+^T1ILz3=N{#TJ>Y4Z9D8rKB8 z(j(3Y4;iXCb+Tcy14%JV95{rUlv-Ka3t3Z=JPT)9>coKG=|Sl^mt%<><%)roI~5l< z$ZJ`Yu_!S>0tl2Us9t0Dv0B>FDdB;ZxT8qI+tz>9!s4DlpE>U~f%^hzQR~c1mKg#F z1`)Mpmg2h($8L3GEC=2~RHDcIug?PZeUxLJ!p(I}>hS0;+UEKav^z(Eht3_5L6&~d zI)Gp5VY}`i!uCuOEirXxV)Up8^d*%`4jKxD;=6L4Nhwo#yZuo#%k6KfiSQjhDGv*b z2{w5BL+1GDqQKRKDt&(yj<_v49-ox?wX1=nF4Hh{SJ%C$Ft^#V=v6A(JoF9mPPV;k z#96#WAO~$4LyDh+nZp}J#`_kal9Gg*kB}9nNaXG0^53ZQm07C{dTNTJs1}4$s?lb9 zV|Je}Orj|v00?a-sxFKD#jU0oOl6p+i2;Zn%G$Sw<}l(1h9jbYolpc;mVjduWC=|A zO_&(|uos|TswTiiP^SX52(pKY6mul`SWoVN4}S^bgj$x+?T$-53eC>lzmRKzMiGo$ z$`ImqCm@<&>_bFB^=u0QyvMmm@xzH{ah*TL(`SwA-BGbE3hDGR`Y<5oD%}Yu4G;j9gh@Tf!Us`|1jp4GX7yK z{&&HLZ5E>Ngwd2L!G1jimeVE2O1-qNE}bX=L*ZfM)rk#^-OmGVSmZ|~ar?!O%8V17 zO$=Z`RReO@lNZ-!%X7+orwdsoH)aO2y?G10-y_`SA8PAgS6eizJ}q*jI|FL# z=AYPBmCFaCYy; zd-6|vh1Wm4D%Txeo{n_b`ZRMtU8oh%&m3NV&sQA&qzQRu1W1Vl`#j+b(uUB=2A0*Ln3-T(jq literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/newUI/butn-cash.gif b/posterita/posterita/web/images/newUI/butn-cash.gif new file mode 100644 index 0000000000000000000000000000000000000000..9a3e64b6eae816995698b0dd0cb8830173cd0dbb GIT binary patch literal 1677 zcmcJM`&-h70*AkHM-iz^bZH@3sQH-f)Uiy9ONx5Rc`c_+v1xfWQ%_G9Yh`#T@*0t0 zqA~=jbmn;_hsa$dWhlJHvP3?>nHk# zitd*@C}4W9IpsyU6+iNBK`g2n7J0R|Ypd%7!hBJEqf{)B*R`~Y1+DE*6w1!7?w;Of zef`g0s4bA1cI3-f+M&UhL$6;Aw+w6E=?(8cj89A&Fi6Y{%rraqaejUV<87QEBfS?f zrX3sh0NBzoFrC+76Fnwcy}a{n+f|e0!H0p3{N4ilz3vr+L@p)MWPjX)M+9fzca0FA zE(@n1^3e9O9}xekw18Pz2KuU`1kioLRe2=ubtk9{M$}wnM3A#EmKeu}!Ix%&pw6yj z>zD`bAPLmPv1kch3&3|jz2?WH)W%lYn={1C;?693W1?;!6UU>!X^q$WWUQR@G=KmX zFXp|aDG(A^0|gii=Y#mEPU%rJ3h52_PA`6!ZvP+gB`1$2ZiqS)V=H%H#*7kN_IWKZ zSA5pJNfs{>JM}k9NQ;wQ@D!?jLir)|R%+6V=z)h>mzsobM{m5xHfg|~dSy*j+u8*k z|8ZT1lBlB3xtw4v#2LV$P_h0gI6| zoZ*_Cf>0J>8F?AFfo?NoS#c6Rb>*(_TheEq`Q}bU#23Lez!ewh)W}ymo)B5qUMch* z0650{fN-yO1ulYOlAX=*Fn4WKBszl^fhM_yc5e!|4TEg<4Rv<8=f6=}&Pw!jQ$e8D zjb)sW&AVzsoN>e)8!DZ44)c$B6$R$t%OgQWkwK(gqmZvozO;km-?m~41>@NYz` zBY<|hrPU)I1$$s&Wg6^ok(P~gO1U>y<*+-34lDR_X5wGlBMoGz*D|dixy7EAfbz+( zG(Hlrh~(5jmM9w#lZU?(EDs^Ts4Xa30@AJ@1GZFN#-+f2IT@M*P}$E<@wY}2UrE0Y znRGw}R0OGDu+z>Y6lr0_AL0U#K4>?$n;fkeYZQ3LI^#ZE$kLTy$#PqgCY#8u$a=&xV zVImS235X<uY=agW$TmU8hq4B~j6W?yVvjR*8o#IBolrX&(E^@Wdj8YT zi2|Dc*3*e$m$x{r(YtLZ9*wz3N;GqE1fNr2f)MB!`IxP3NXC0xOxE&;Lhs@XD?55< zwkGowS_Q=G{@pocXKGkMRmOVdOjneqDxj{_T!j&vc;f1$0hGQ1*;SI>HTzRbW*4;O zBX{+qYC4sG@R7xlWwG6JEhg}OecNV@4RB*&OJv&m;@IoV>x(bd^}Z%4WADby@;EhZ zV@1R0=v;b{2B`l0uxf1{X}yj;M=d67 zzD7sJrEV-K%}(=~6W`Ne+b~D0DjN(!W4 zh0I&~1`@2(k|_>i?JZnI6?&F%40E=DaoCZMj2|QK#{V}jxQDl?9MQ8QJS>lRhP$kw zDm~7I6~zB~X8FmoKaKSQ6iZ7m$e5#D65>CIZ+W%lfg^%9s^G_B% zk(!X8CD~BpxBm9~AA9P~zyJMSQdA-$TQFCuzO$>lr?*xr!bL=)m`k8UV0!WNIdhA+ z80O8KI;&{T!g&k}7R_C{Z2qFzi`T7RShjr2HVF||W(BST2M--Sa`f2o6DLodK66%q z*^QZj@5HDCS^FW}nrGZbzD#AnK zy+YG;gXB|lb{Z^WU@=X+c4p=0Wq$wX*cE?b@%o~Aexac#$BzSyEgW?!N;xMCHfM!S z58M20OXQUozDu0i(!!u=NEZRH1;MbbPH8m0ez|JKkT%XCA&j!Ey!!$!8Wh=Y|6 z=e8eY5zEkc?8tv5<8iOWvkE0=(^(mdJ6C5XBH$n^{{qdl>Y{6z&*xS=TdB^- zE>ptD+`y*wVnK^o){BK5YO7u>>M^TgG}#kz-~iKeVV%odd5{Z`k)LYt5EZR@rNJJlplEi;=_8!&3Ey)|(AS#IkeNsiq__ mD&}M~9@~7uP5bSZb0>+ZI;wg!5}$H&L6uCOE|B$}F<7>v%Qrl_8to-+cX@AvNh{>R;c$t(KOW+uz$CMRlsBqu<-#ySBRf`}^#_yRf@wET&5Q; zRCtDzN_Lo*nwpZ1lB=Yxl9G~|nx6mv`uqR?l9rYL0000000000A^8LV00000EC2ui z05t$Q000O7fF&gj90G=ih>41ejEx)(f`g5dl$DE+4VIdf1D&0hg`1*?od$I{7ZL`Z zh@qsU1EQ>lr3qFasTT*Uv9SW4ti7MWv&6u^zy<_0Lp!MwJOsSP)YaD31_ugwG%U{& z1iRPcVpv8+AGiuC6KtT;2U~)wm0zl%fjVM!IOsF6M4IJK}5fD+b-N}nGFzV2_^I}hV zI#>pvfh$#n2>}Y21bCpS)2A|?I*m$Is#F355}<&YiUoiO0F>IaO17-os~r;*P(Z_B zSO5_J+J$=>4lCA#cN03TOV=)5ya{U9ne&0i2NX4uN}OxAvE#>(BV%nDp@TXJHiS3` zyI8X4&yQOwFe3!V2PAotB!$o!w1FlVVt0v6yS8l%vt#G5f#8B0BpAZLaUt5sX9Wt# z+;~9YgcJ-EQse;fV8#jPDN;}Xk>de#?_zB1*dif_cM1zK5SI%XdCLq7np1cHVg`}= zDX5=lG9yQd6F{6dpBGxBQU(R{QP6-A8t{XhT}Bwu4sr=Vus{PqoDf71C!FvD5kKS? zhjaa=&h zg8&?C8pEcb-oU}Aoc18Z2P{aiLmE9iQpf^AutBdRz(B$k zBs}qi4|NyZ*Z=;k1r7Uwh*wEI@coHP3z6$raOWMBrM^B?Mu9HhXfz2V1g%A zD?I>w3(!K3e6G5RKs?-E^XY-j40vz?+<7tqLIPE+&;S8&Yao9A2JmShLQ?uJ zzk2g7ke@+Q@9TAd04-?Xoq0=AV1f@!G@!%qN;|+22u8m1g++PCOJMU*;DQrW?PqXv z8>XTV1wBlm2p23uy|9-j4JbhgE^q+~&X>UTDKG#IctZs&Fo71j@P#mpp$uKf1q)OF z1r7*6SQMy00C+3{h{1vdhDgLB8u5ro93mEKfC7l1kB2=BfCzwCfht<@idf8|7O&Vu z145C900;mIMUaFDnDLBgOrsjtXvQRnAcs2qA{fPpLI>FKj(E(Y9`|@hG>FlMa_pfG zeMrYb8uE~cG~^%wxx+vLpaYAHq$DRvNlJdPkqU$)Bp1oG0&Mcbk&o<8=U% zrtG9BNBPM~BH)z>06;838B18ca*(jZWM}{&zyXOS@}d~c gC?f4tf&*yuqaelT0V2TxONI2L8C41g1Q7@TJ6BVGxc~qF literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/newUI/butn-clearall.gif b/posterita/posterita/web/images/newUI/butn-clearall.gif new file mode 100644 index 0000000000000000000000000000000000000000..16b4e1d570ff68b1e7b1413528e5e045b5b24c1d GIT binary patch literal 1130 zcmchUYgdv70D#|@&`@C_sLcyrCTf;Tn{L@<6VXaN?u2I^k7XC>3^&5ga7#103`t*+ z3X^8gV6}Xus|S4E$^M)F*c08)>Wc=#-}4=F3sg9 zm9$J5{%Yn29uW#fY&KgWk+!zB_V@S894#r4cV_jlagFU4S9HB`YP+i#f;dq>T}`~g zc&^b*si*30{w9~V&}cL|ukHOWF(V^mlT+&Oq{j+{!eB7yH~!T|3Y1@3T1scq+glaY zOp2_ddEcR^*o)CzE|YV~9Ct%Evj;6Q{gv(he4O<| z^QkQ1$<)H7r$V|>#cg9R8W+8q;Yj<9g@-t?rx877X=*=@2{Du@t#C!*Nb z9Bup6L24wJzF_Wg;Gl00D-H3q&ZH<_=l6jQH{LVfPuP+rOb8hZ5AWM2YA1vy8(1vT zCkN$oK8pFSnw&A-7`CUvsqA`^_HpBIJSJbUI{AzqTikcHEb0*v(~|Y%HMaU>$RX43IMI0bT%LbcOXCmT6k|dQ%r1aTrvY` zpKCe9X&e=>SYMpYA(?v3<%ZbO=lEZefwca; z=R=h6MYmNNITx~yn=gooFQMg}OJ15Uii1jMR`^HKZc{rgR#nPq9i6{*xzB5%{91BW z8uGhPk_zdhjYHthwKdFx(5hBh#qkg?R%d^+yjYV; zN>Od$mE{JJP`oUDBp1UbCA|tHMhuY#kwkRmisXrha-~UWYFH61Bjam@^*oA p$OWH1sbf-&os7rOHU~`H{a->y(woQ1eOLV0yQhh>e zoHSdCGg^x=R)bG@tl;G7-{tPs+TTxdqU7l9#?RT&)Y;tN<=Nfh)Y#q6)7RhQ=%BOB z;N|Sr+1@Zzf-qHrPk5{?QhzK^eNlU^j-j_ud96`;t=HS%f0ef{Q-Dxe z)=qb-K4q5H+TOv%$&H}5-Qng$Y@SegtSnJ|Pk5?Pd#y58g^ZM*EK+_?c&kr$s)?Ml zeKk+u(?hnK4y_PIs$McdIa2i++^1ma4(h)!L-1wS14Jj**s{ zt;CC-wb9kt)!E*fuEojC(k)Yd&eh+3hLO+H*hX%jb&RiPgRPUR%HZSZ&e7Iuf0*Ls z>fYk#ijteZ$I#Z^=)B9{($?F=%hl7@+>ofpgNc%dkC@Qc;fRl!%hA`3k(R>B)5puu zM{1tL%+)wxmz=J{+u!72bd1K%*jjt1O?a%~hbIE^fz9N(A3$;&)H~vlr2(z%+S@4l$n2(xMX*Z z%+%e^*5Bjj>rQy9(AeS7*y7UJFx3~S%`^`m6oZ&sj<43tHXSkx-eISFjs}i z(c7T2%>V!YA^8LW00930EC2ui03HAx000R80RIWpk>QG#FITSg(Q@UBLxl_xHvE!7 zhro+yvUtgoMGG2l9=(Xvqa|cUjT|>#6e5I*9+oYs$P}WD3d@%)ZNiNCFN3o{FU|-8 z#%RZ!Mlblh<8$WBGeJ8T1!X!XP@_2+UKr4-l>-tnNWzK%8}@5iu^hH?m}8@cjT<#; zbfP6^jGVe-@s5)~>O+J?)B}8(L!TFpkRe0TJ|$nHCXX6(uk_jf8;}f&`Sa+ZAUlS~njr$+yNmE4!d!$1>A(>> z!oR=&{t(3T00BM}C_(}VI^d5Chln%8gAhgtVK9lb^8hLcBDlha3TAQ$J*PM!;)o=Q zI7AWbsM5iP8`43?3=UkAj|KzqqQs3j=6E9>uJi*<2Q$pz;xI78@Qn=jXt2x(OEl@^ zlTAW!i7)bW5JQnLP@v^H+_XT6DN#gGN0?-WIc5}zkkX1QifE}N0B}lBNinsI(hU=M z=BX#1b)aJlCyKxc=QxD+0to^o;E}|lj5f+BE1IOjjw0iDV5tWec+d+Cca*@398H8O z>ZqZTa|<=)%yPl17o70J54~XbU`Yw?U{b`bxaNB62%h8uPb?<{dqNt-;!w;WgDAtm zG%@z8m2C#w08(634uYz_Cvp{7j*+!cr{Uun7$_+^`f0&cj`aT_MIQAQa+{DVjURa8L+&H=O$02ySokuw=OSHW`? zJ_oP~A{T|>^f_Ui(}UAt05Sp9fKVOA1QYBrbr=^3{JQ_kAyN_w_yk-uGCU7?|&zrMb@y1UEE%elF^NqMrs z!NI(|yf|v8hN{*^ce8Yt!OzapcXoEg#KcvG!c>I6v$C?2k&#Mwu5N5>|NsBP!^2^b z%s+6gSc$|zbFW~K%UX-ZIBKUlY^hw0$Vqy(JZ`IAj>=z<%Ta>8Icle1k<3JOvP^xs zQG&i!hr&B-sYG?LL2|ENkIGbpz(#nqPJg>SZmTzGrbl?RUXIB>ajjN{!Zv87U5&_F zi^fEDu~~`4Icuj=gupjwreTuIJa4OBkI6P^rA&ReI&7#(dbc)drdo@~T#U$FjL2Jy z$2@MTPk*~Zb+S~2z&B~7Q-#1ob+JBhtv6_;J#MNvYo|MGs91@`T8hTS$j)Gp%B!!m zNqe@gvbR}@#eRK#S%}16kIG<=%S?Q^QGvccajblMdsBqJQGvZyhQsUY>sW}yV3N#4 zcCvbTc{**W%*@PTk;|>Fu&uGSm6Vjt&CNY;tAKxhR)@nsaI8*%ypglqN_)5R^74Ov ze!IN9p}E##k<2@7sdAmsuduRAe7LpC=d!c3kB*PKyS$c_m6w*5Uy#bMv9o!2c-`CH z=H}=3_xGfuqubfp%*N61@9%wld~j}Vt;l5C+}z&X-Di`_XOzoWS69@~;L+Uc;@t7( z=jqSO*{7?pp{1&4XlOohtUhtAiHL}oo1nMJgPx+N*3#QwkIR^smyD5?sHdl}zN*8= z!^FeG)z#HOK|xVZPc}6*&CbrGsIA}H>)F}agoA_d@bHI*hHRt&d8Qrc=;-O_>g(z1 zo0^)vy}rJ^y}rG_si>%Qb9AqO&~ep*(#8^@)_H(WOn95-sYK64jcLDoV+w*T0z)uF4ArnUOG z5azW_6PUMYQ=#kFuUF5v+jMCqsSF7J_)v=nj3ivraH*0c3H$Z!-@8weCP^an>Z{yO z4}X4t`RvuVUw-kS$DV)l)yGA8>{Y>qdubdv;D72Z*x-T@D#%455w2GSdx-?--g*PL zRKbYvrJ*7WJg|ZS55&L`hY?1^0R|XG98lwpIns!u5paMZBaJo=xg(A`+K8l&GzMv; zl08DHqY*#CK_ienTFIo4GagALj#YN4B^U?Xs3ntE{s@KyJcJ;E32??KXE)_kpeB_~ z4#NWqJ@7CDAaV>5#t?4^I>e!c4tnSifffp=p??NCXrhZ!x@e=38fqz_kRICTpn(E% zXc&Vkn(3s1hVe$Jq%taKp^O6m5{4Xd$T};eunw^d4S(QGjyu%QWM>^UXYf%yURO56y$k zG|LQ%%_B3zLo*f}Vv8ld9AdTArhp)T3LdNMg$*b#i$@t{SYfsuR*e0K6=;XFwiP_s z5fa%U!OcV2XWPvK+i92oQTHQq-;FolV~f=H+ai^H_uP2caYIOt*Buhtc-URWBa+8m zM&Nea;kO->S6(^U)9|pvFPyYsfhCT#-nuEp^pe5oWRqV|#0VzPfiYaxA~>*yCp>`z zUR(nQ#^}Y6jIoPr7>O4-5Rxu_(Iih0V;kdWMmK`-2__jM7kSV{k>HUBarELJdB8?9 zhOv--Od}xIu!xYvv5}7S;vyy~$W{>15gND$HlQ&8aOi>)3Yf(SY$1#mR5FlYOyjbS za0Egep$)8Lr7L3@5?UUimLY*+LN(gY7%cRl7mdLd{&|Ipjs&10<$*vk0MmZblmWSL0SanR19!OK6sK^( zJ9uG_6{KSTHmxZ~m*oT})IkhlaKaSCFoh}9L8?@>YE-3~ho(Mtt4@U~R;zl|sgiZ8 zQ|M|~qiR;Gj#aBoO{)_s(Nrg(wW?F7>sQCh)+x|ctWtGqQ>jYTxcYS;dCh}j#c&M) zj3Wa$SV07W5rGKYf&%);1_jiC1I6Y+43)@(RnwX=9#A0&s7);uPJ7xQtk$(bKtO9- ztJ>86s+P5=eeG#wn_JuF7Pqd&EpL5`0OI!6x2xSPZGFpJ*e=((L0EtQ_@N00G#~>N z$SyUsaSn7C0~h@Ou5Xp~A{P8W4?p-p7t)*FF07Zm?}hJq+q+)$s+Ya$jqiQ&Ti^Eb zSHJpAuO1o^icrk=2hKpRdk-97^oF7l&v0)S6nx)C{I|mRU4TC_kO2ocpc5eO#0+Kt z3~4AM83W*NBPRR<7Vw}QAQzd&NA9tbrTpU{d*a4f;6oO0j08R)`N>4av6sJ0<1O=n4_EfGmX&;C8}q^c z#$84NEF{5=T}(Ct02s$O0I&gMh+_lmXaJ49?BpzXq697K%n0Tng(5VX4UaBD5g;FZs#u zu!k>bK@D!u!X3;&bCRRH<|;?I%~#&?m&bhOI5)Y@bIx*?!(8TH_`)8vV1_%qd=E}{ zgBoa_a+gb83pYo((_Q`rmhZs~YIr)#!|w8;r=09EZ+XhEUUs$XKn5dtOI-fp5s<*- m?s(6;-uKRTlE`H411U%>E<*Ui8~*T!Pdq|mp%IP*1OPkDI^d}Q literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/newUI/butn-credit.gif b/posterita/posterita/web/images/newUI/butn-credit.gif new file mode 100644 index 0000000000000000000000000000000000000000..c547c536a6aed5e015ffb1dcc22ef1ce2f155408 GIT binary patch literal 2341 zcmV+=3EK8YNk%w1VKo3c0QUd@3k?pXrop?nx0Jd@U149d+u4VfM!(mImW!llk0!n2 z>5-0%T~t}j%*=#{eq~o3-sI@thIHorr>mx;cAuldzQQ$81K;1@ug+}C*VEhb{^7fY zb8~Zshm^?dijKBG#qs>0&(flwp_H73WrQ>Vzay@H3DqqMQj%kJ;3t*xP~t%Qtw!@s@s`Tp;TbCR5- z-v9sCK>DZHzemzJj{p;u#zriinVl znw-J!@nm**zP-4my}i(bdcDZTjEs?(oUCSMX4l)-jD&lmpq_htcE|hpwzSoyw2RjN z|9Fv?zx@BIq`jxBrIC=7t*y0qcYo#f{HxE?gpr)T&C=KM{GX(}+t${%y0+EN(TR_H zeSU!3*W3U9|D>R~kEW@;>hG(?$d9#BtE|K8@AvV(ij<*tw$X)zi;|SBt=9GGl9jB@ z_4nle|F-Ad>*eEpp{2FCyNr^LaBz7dDk^Gia+|(YfrNv5dwaz9{qX<)G&MV(qNC^Q z?v0hEx75-9`R&Ns;GdwmqNB8pmw$zekDHmNjF+3{_xZx$=IVfLp`w)k@!7oBx|nSzg-_y7Nl zjGVltjm9=tF_kF#pL0orM&E-qUd*^LW58_zxovw^5aI+FBzV}&xwGfb zoh5ua3`5Xa!j#MA64W5U;RB#!d(gZYc4!Q)VKis}I4usetXqG=;NgJr_2f zZRE#2EKks5_u90qd%(~PJ^FzfuEV?k{s6msatSc1^S)lWM~?)>%}W;#W3>442Z~e? zaYtAcNVwe6gCM4{7u+rI$>#wK;$?an-lZV1N5S#pa& zIGY5TftLUmtu$~24w@(-<1Y;WVuBC@u0`O74TM-+i7=Gcpadm4m;edPoF7s4~hZwRDjRGEGR~j2+4>(14bB zW~U68m}!Ptm zEX?ZR>?mi9L%^EgSi=h%cV@bqrkn!%C1&%5H`^i>B%lKpO#I-i9$Rdofd-cJ@dYX1 zw2Fc=&H!^uw!v+?t8~y22ZI)_)leG-E09r27Q{5uj30h91BDMjXk&{d#1LZ%Hm)q- z%eElz*26Ce0E+3Nybpn1IitDgbea6 zB&U4x(g%E^1;GTvP)anvh;zaXNPqwW5mZ>g002N_;{p;yoMQ$&kwjv&$Vew3fznH( zJen2{Snz-_Y$RbsIU8jEy|p?eln?|DDa-*45iLaEiYwNvt!dlC!Ob+G-wNZ6H!&na zhYdCmL5@7zgdmC>q{|_L9G7%}Ml|Y$+yl}NJb;<1gAAg0k%<^YXsxyJ#>)`~D;;d&UUloc zr;G{ZKK*T|^e5oU3_@I^01?wbH{gafP`Zlp#yFRL;@AKsb3_)7o{jg?q*2C8qN@ZGeATo zM!1Gqprdq1FhT(T0^kW={9=U)M4Aa+7(-q-@rh83q7y+O0x*QZ3#5yJ6DA=CBA|i~ z0f2)iK=F$svd}%ZKw1*k=!-VG@r`hFqY!35gJnd51&S!ZCBC5o7Epp3M;K!g%811F zrBR6{NaPaNm;^;8l97;10vKLVheNz#8JJuJ9EPwAPJqG$ggoQ=(x{A5n(~yWR7M$B zxk@2KA`OfG@%pSrZ!E` z3sBr532N}@LvIlXPfU~p8BJqFDcXxWtn?Nr)u=}A(2HiS^A;WTg$P0lQ#AnNrzUu* zCqnVkn95X}z~}`q9SRB+azG6z<-iMj;fpk)w5TaPsxO7m3lpSq1|q;IFigNxm}XU| zM5U@#v#QlJ20{&<@I_MfHBu4uLI`Gc<5XRmR1sjct-wq|L)9>YG>){Vfw*WvIS|o; z`jn+rH7j5zOWDc_=#aw9tY$aMSyT3)7`N!GXh+Lg2s8o*q)n}Am4SnZ6oXr{P^+HtUTL;x4Hr&;*VV3;N;|d z=-Aoi2XeMtoR*rJnpu$f{PnwS8@g+%6VE+gJ!@Kcw0=#c{SLmKTd*R{(IS1X9w|M{jxvOL7!|^1LnVnZeqh`&9jmby3Idv|5 zovpEeg@;|jIP1=f1?)XSOuv>!9N>SlI#f7lRm{ww1N{?u#ZJu8Y;bIxZJ`<9Q1GaQ zm3v(pm#7xQ@{3I3ZXy>t7icmuI&*r=jryX|%+2bS!tv0Ak&`j_aNF9fDa_1Vl1(KG zCM?Kh+K{yK=%l??ht%5nBrSI2a+~X2oy{ZBGh^bzv}hqkA(L8dv!=(#O__}aiW;36 zw<}s{xPAEc@iF59b{ByH$D+8soF>(!zf87dUthv3{-8jSxs^}PDCNeTkOQypZ!Da( zckXQMZ0`N>lg(BIt6vvhBdAc%%TQ9v$l-O`?9H~<=NYd$GfVjYTT&VR%mlS{(Oc}iC` zI$@E=&5MkVj!br`PF5l{TZt}Ge^OfslA2C1Rf0BLiqqMmQBqDybfrsHE1IHOO;iS4 zURhCku7iq4o~2>J!_m6LUQSgWKxmo0$xTIWphs|_GgyW)T8o^eQ7ut^thQaYzHnY( zTZxfHNlQkOnNrEmnk`a(O-@NXWRuU+sj|LJo~Tn&e6e9;UQBeTXK7@svt2)Dm$krA zo~T1YYnz**VM=nPJ!6x@#nNwaYt7bsNpYmMxxhDFjfRgvfr>b{!%}Q-YJZ9?uewy* z-@uiYmzSPeIA4!KYn&@keW9eHNOGiAfwn$mmOp2hJ!F=VoI*`^sZ4dJOLeD5Nku+n zl`d0&EmD0>SStVj|4@3ZQF^UWd#y59g)>=)zs8I`WtG9iz>Si3PoC+t`wnlW}uzT3c1T$7QRyM4F;swZKV^mqDDRSGU1Zy~BUJ z#$SPqH<+MSxW9s=u2Fb_Es&FvyTxIww^N*_NY>i2S6Ec4t+3tWxzg5{Nphq}PZETU zMNd}~pr>4|wpxggK$4qD!N!-v%8}pX+{DY6t+jDwZ7r0ZQ>L;&su5qrpS*EOQvAsu? zpfit>ke{kNm!U}D zV5_ojgN!(XjXaN;QKG6}!_8%&t5cz?RhgteqpVS-u2sgz*|EAzgpEJ5ze}{gPqV#M z>g>|Y(5KJVpwQWToupe-S|7Z>%#)i|$sLOcr-8cdQ# zpv5~37~Hu7DB~SG3_#-9xDn9Cj360U43M!U%a#mY29OCeI|kImVThH1kRGKGya4+lf_q-Dlz0`;}s(YT62Fu zEO`T`?wb@T22Gg(AW)n*K!^}QfdT^tQ1%4*XyGFefEiP!>l?6V6hcG@2w=g54>Rh#m?ZKL>%V22WUSnfgD zCPiYz^y?>~`k6$BT+Jw6+=6$$2@=@<8Be~v`S6dudyi6v{ftv1;>%}2zkvPw_DjuZ z&prx`|NqT!O$`Lr00}M2BqPihnoJPOF!4+UAb@K)Vc{Ax4A8}f&zy4$7y_J-$~d01 z0Rb1p%wVAt6*|#}9DVe`Mutz+c!Vv}2%ya;LSWKHB&*1B%nWL<5o3&06rp4hG^&%1 zBeNVJ4HQD)^9nZbz#v65Gf;z_gZ7@!I|TXge+3fgL`haLzZfWr*$ zOtKCb{3rm$ILzn*!57?c!G$HnZ164udf)(W3GpH@gDLfZ(~Arj7~>B)wdjBi2^?P% z%LWaHT*AmBTV=AzB$JFl4s$r*^2-j)(Xz`k*9`N_4&?C993l)c#}Ga9EW*$}{~YuX zK#TA*&ktC%!_!bhO~=zi>@aoIRYz@+KrHXDz}IH%U`E(xED-kBVt>8B96AdW5CA*3 C5a#Xx literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/newUI/butn-discount.gif b/posterita/posterita/web/images/newUI/butn-discount.gif new file mode 100644 index 0000000000000000000000000000000000000000..9255a33ee704685cde8cfdcb47e2bc2836662290 GIT binary patch literal 1130 zcmZ?wbhEHbjAsyMc*ekR|Ni~NN$39m|8J4GJhJP!W8pf_%55QShg?cG`PA-8>^o(Z zyDGNtluhBffTn%1lTO#py*+d5^_3T%Wpvyu>c4*c?mJGz(zh-cL$DCzsRmXn+|NrgZzyH7g7lk^6q~|Uw2q>tU{rL0Y_uoH%|Ngz8sylS{ zqu>93SCm!kZ8J}sb^gt&K6%$t(U@iL{{3SZ1VHg83)mGpAQBWO4DA0K7@C?}THD$? zI=i}idfSyP{TU}unL2IyjG41$&zUUA}Vl+Vvaf1#aKDYau1fb4{R$k>~k~ zm#<#GdHe4Dhv$MadU|qlYVvZwm;_ngF|r6scx+g3u$e=F3aPr~5I?*qU^`DR#bF?&XrCo10hpc_%^4jEAYzf$iKdH{o!MIbIr@{Z>_u^vsQM;2M%++yd4Dxk9CR!maK6I ztlg@>{NwZU?Va=M>ly$4O>d}Y=Hpn<@b6>!g2vyvE9Nt*x;QYhooY=;Tw0ztDvgxDmW7_jo$&A8d9pkngi#o`HWS}&JO z3Cnu9v@b}(L5QiKV6uSE5rqaelMt^a1qGc2uU4(u_UhH@4ac-zuUQrK;ShJw3590X zJ>Rkzc{es0bg(gtWWU+SEwegj<4L{OI-AbBX|LUQ)-QVvTk9DIC-!S)uitKeP-oq& P{A618yPeP3m>8@9lm+K- literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/newUI/butn-donate.gif b/posterita/posterita/web/images/newUI/butn-donate.gif new file mode 100644 index 0000000000000000000000000000000000000000..68c8385e6541ece5d099e10b2582a7824379a312 GIT binary patch literal 1714 zcmdVZ`(IOa1HkdK#l`_K#w~ad>�TA&u}+6s-eOE(3A!GDSr>Kn0<)nIeL~4%<+K zHPC@qU?WU$!iI9u2JD6ifs820c*$)AanWZ8nuzH4`@H-!`uqp)A3njML4F(KVi0#^ z-hjYMzEHUa@%;ui2Er$uaOPKNh=V;OoO=WZ%HfM~Fr|kJ7C7DtCNyyN5q$F!{M`W6 zzOZI382u59sexGuMk>IsVtCUJ)^EWhcWHl8fW|<^=LZF%RIM_TWXlv-HQbtC_K)FwV%QVvU2(NSYRyBY$uLo z_g>tB1t-JSy+kT0I3vbFd01$QKvIB5Miaav@cM_aA;2=MDZg5d6DRpOr=%qke$sYn z@fp~WtZghA{zW-c>1FA!kV?`(Bb)ne2AuBTrys?M3_NO&JnIWEZ~^pWz)=27v7~}W?AsD>O7Zzw6&Xu1}AMUOo zh#jh$i|`JoFg+ChRS){arn^5{29#h(-do}~Y`R7q&jH4GXubtTt3mx1?m-eZu|dZn z*ehcA#}9Xvja*^z1*GLc8Ju~*O+Lv_3X>OY&fNEcDQ6;0hTn_d9$*k5M$?i{CtGF#t&J;u_A7`h%T@ax=KUquk~E<%g0+4s-fl+&!&gEZ>vXi8RO1Yjfy&RTb_NagFYJ1kKW}NRvw<7Q}RiP z@5TPR>t<`)GIbF6R#azDsIn==(FSw`igni z{>#}%N4YCbh#ft&NbK<7h7Twine0z3EsMOEN;@eGh*t_1o=yHHPi&dWe2>y{|1WNj zUv~y2a&q^%9kIx}&)#H31!POMn9pROKU}bJOmJIe6bYg+v)Fl8QqEH9<^Z!TwT3V( zp_V=s+O9*N8gnImia;moSbV?=rc$vj@4fJ-B?+JW!CJXAr*1Mo7muhu#k6;SU^u&c zozaFCzJBVeECwwS%cQ8DM&qKRG#QEFbXpLKY;z+x3s;v(e5P`dR93nWxz1$-UEcBg zz?gf;aiWNxIk%_FOBjPqD#W(QLS!>zlL%Scfa&c-K`ZpAtH-psBJY4c-=^TRpeb4e zTGvIBMr<;o5*Ot(t?*@Bs65jh78`0BOq>wcIzsVS)vUn~v^k%tcXT5$+}>czqS3X~ z?k8%u=a`;}Wn$!iG!aa4Rr|Y(hT9`^p5FBRzeFCar8_VUnkP+#S-SU!R03IyD;Cpx;TFau z?b1A$q?gk%ueNs2*hAkf{VyxX*e*GIw!_LN>?X~VdhFJ0?=sz4M}*>h_<3K*vK}Kn z+;_RqGgvfhYfD8P0{g=3bN-?4wI)t8)`%HKy1(;sYX7%Z2z~WVS=sYPym>3ch5zvI z{LqPs+O(man+s`rgtYd4IVyHdd1=o3NOi|dP`J62qG0cZvEtn+3*#3PRU5~@B)^Pg zSc|=1O1V(w?}|$_qUo1}Pw@fFd9dp$G^Bf{Mt40`Zdv zK?M~Memo;HP%>xTrq!yoyRB>Ou5K^dOiA#TD2`b&d5f+Dx%zo5&myucQ{>*(-f6PTgXUUU z!$FSzT8|;#t&cI30m;P8w*J|+0e9zch^Y=S)FHfZg02eD6h189O6s5KzIu(W^fOd` zzA@3z1=M!|bY-Ab>Y^)yNY+&>e;mag?bLip5ZRlAHZ<3a6O6Zr?8wVHn%s@ySsHm( zfqAJz4$@UY6x)dG1kfB~v%uQg=js{>*Ru_1uCYZlMVEWpqz(=cCrBI!7Qh8!XpR}d z)VB9Kh*B46z$3DL)!1Wc=r%XInzFp=)bsL%m6CFcdo?(&DJI&HYyEGBr zXbdl&AxdT#svzOYBtbmge8ol@aMKlFi(s5Ly4cp|pvrw1u8BP0Y!=$MKzwIs2lD@_ z;9Y7G1hN7-_MY|r2}t@5M7+Bm9&@j$)AwYMI^CW-+N>j0q%t@7Es%Gb{iMe2y>B{P z$qw&dSXWw$aFKfGi>x5d)KY9mECw2;HUF-jr28K=?1rn)QX@wf9YLVJZ)}z}$aITK`wPT9c7?i3XQDK+z^X8#{-}FUq#( zg&#%9%oUjammAzyC)RG>*nRM%`5)?t@5Wx}a?dQ`YsZIHXbD*NJb6POhQfV6QWrGu zUg!L}_RUT>8@$yA2S{U&H}1-G2bOQE(<*1>{(^(AU;dG@^#J;L^())+Ebo&#%C7W6 z`>xC*u&0M}6U&upg`~2lhcnqnb<__I3Cq%o_YLR$mTkLRperoY>(a9Gg`qXz`0t*( zsj$b(-yOAAW7myHO!7MLX)1K%uOmwJ3Y@IGtfh$mb|Kp7^ScNxUjXh(NKW3LcWR*>Kt8a&|LTa2nWR@>ff=qO$ zEK+?*a->y(wl`gkG+UH2TZ>J2t4edGM{uG)W|-yW<^TWxoSdADjEw2&=`dA--{0Ti z;o(nttnu;j=H}-0_4QGDuIlRQFjRs)W0|YPI#&=Q-Cc~e>`N8 z&(F^;Q-Lm1e@=I*_xJZqcd1NvsZV&TOLV7Dd96=(sy1DVL~Ney?Ceo{txdT5jXqmhA_|$|X z>DI>Cg9hu`;Q#J&n5VGJt!Dn-ddthp+`*Cf?%CR-Q`_6zKWCTbhDy+f4LM(rOn0cI zxzzvv{x)5THCu@K_VGYzng9Q_*zoKB)KJ!K0MdFc%#bGkYn5|yqd-Pu`t|MQxq1Kp z>Hgw&mz${n=YQndz3$Vo>D0J~qQ`nE%n@ z;g}fpo)|r3mBZfFFI0d%WtRHcg7@Xk=)Pf5d91Ieh}O-?xvrDdjt=O+jn}GP{@|7J z!&3OiT5_4JJY$r{V2{JY!~g%IrBjUF-P_?QTTOSV^X=yO@8iwQ&FbRW;ka+-xoJ>( ztayyBQF^RTcc*(W=w%EtV$LZnTF;#;`ZlCkvsZV*U zF;#@Xz`)suJpZc1|M8H+d0sVJiZfY=`R1BBVv*IBNyygp+vD&wTZr3Gb^rh2!H8Qg zQ-AL6?*IS)A^8LW00930EC2ui03HAx000R80RIW}U_geEgGRi_Sa{IjLK$8Z$}r$T zphY4}iY(bkgd33}S&9TBl7-}#l1sj5TSDZEMHh2mx^NN1#kwFhXW}g4qDT;)GmBiQ z`OmdLL5N==ScEVTvH=0%z<&`e+hqvAt66@rASOUy1mzAUGHc#!VpzEo zCphUd(V+un%cX&+PC@R5>({QSk^1E7-U&hHGNAy{K{XHsBoqKo(F#P3?p%4ySft%~sQ;55eqr3O+o>F!HdKPKhg-R&gEO3*~4VMP*xun3C$A->36R7H$%1giV55z!;DQV=rVMf;94f|0L5#ihQb7f}Ecn8bOiF@G zHtHBd2$L_Um_Y?a_AG-3~#JFsy83S4%{%m8!_P)`bH zbb-U3I3(grETA}Y4WBr4aRv%?(kZ~A0!)&E94gEp=?sckvI#B6Oe(1gRG`4P8=6HkiZH5hmRTEgpb*9uwuYex z8Dz+lPYN%zAZ-hepwh>**h>2X3YhG%>>h9YAnqF}_+thO=%%Z#x@L5Ng1A4-^Fss? zs6p?eXsDp?zWnlwMyK@Bt409mgkx|xvN*E{6bujH@WVqeY>heXuyb%Y0R*tZ#v9YH zu?8BfK!e8}kIb>iB6}Q82)yvp#LGVPqd^o+L?MO`4)~z64>m`Ua}y3YAVw4+{F8@lSZ4pU?6=-*XP*^EB$A zoM0drc#Q%Z8yili)8%rlt*yO#_wMAW<956K)$;P&w{Ke>{_b!%*4Nj&ySr^R+v4J4 zZ*MQ3&$n8wTrT%a)|V@Gdnc$`b%U39jSUYEkB*Mo?JFZABhQ{aQ>)bmg8>9V zfj~gbd!T#yQX~?Y&1R)idE>?nlgZTG)dh>VckkX^T3Y((T)je}kjZ3Mu3jlGFQb0* zYhPcVL?W4TGp(qrtJCXs6B7y;hV^>=#lnk_fD1uTb#=8yqv7-TDwS$>c6M-Z@buYJ za=CnJdK!JN3uUv}sKbFeP>ED*GMZF#s_E(J@p19O!h+7Qc(|Y?@w>-Dp>S?)Zhn5= z9cQ&!`uqD4v$?0I=k@EqQPd$6iIkIa4u>&mK{Cwr4QUD8Vww1QFHmz3M+S=OL*{RiPq*7^4P7VaYTpoAv<$^!} zH?|MSmdHP^>E_s~`6xOkk$m^wiTPrY(`*#z`be| zMb+wg@wj-^>0Hz4tMwTHM9(>W?%NgNuxkjT&rZ!6@(p3~yPP$P(?P#A<&CSltp3C_P zf}!6Y{34UfmyE_al}a(8NJ*t@v|5YRx}eci-eRq+*o%I+WHK5DI0Iw6;n~?4_wc!S z**yaz{m=U!ca1*!Yt-TfL2Op5R4TEr*iW54$%Du8^3JchTn%^YAwJ~3XW;)KbRFjb z04NaiKI#2W0K^SIzv(LOLMfL;{3JAs3e<;}`QX!=3y#t{tNj*ELZVCnI_5#I*&V2> zjjj(P)!A@=sqo~B^&NxRdLEwH60`5=g@^g|O^F9YpWZW;|H-Im+Lzr*E8B54gPZVu z>j|&p^o;(5L-@3eDTY6_h>{%=a~eBOWwsPu>+tYKcs*pvJvz(t>aMDxh3pd*W6NP# zZ}(Gq_lP$gHLdYA?68juI}V(Io-__(?#J(>V2%atN{FTB@KQd{Jan{hbkLGp-VnMi z(%T;eQkb{*UjEz0jnzqZ;^VwQZ_`jlBUV(`UW{o6SmZdShCQ{!CgX@ZIAyMg>p$dv z!0X*8$A&S=!eUBO#`a(*Fc_Rqgw7*Oedl}q?|lUxtw%_N>;AQ6yQoj1_H0ggvGW|} z8kH9O(?6zK?51spnKHLmwE%!mi%QJ0{nI+=0?-V#n7JWq}y9>v91h51%)&7|Cbf&dPM_cXl7@R*o*_;O0zH^mz@IKMnm zC?W75h+##w4e9>yI%WW)Z#v1X|MNard%1kKDC8e{ID>XPIUwV|px4hCT};NN$e7~F zKuSU@%X`Y~lTN09Eri2l8xth$RXp+ZqH?%&-|JsG;rPym?Av=8pbv4&rD-NVC_g=v zM{)?xGBDo}{e=57OS`N6?6i>bD9<@v#kTy2uu6Y&h+j2s>yNs!AY1lQve)gxZunrY zjzHb2K-Xhg~bIzRfN6!0Dba@B}{$7_L3G~46dgNy%KrqU92#;&4#jZ zLH=D>uNaM?A|O}O@?4#})>Vc(VxurVxKgDMgxpNQc;M;_>S;g6aj*8WNuPCOztMk| zFqPywY0dagEHi|_C6JY$kLUX3nNe>!22HCl))QGVag z#Z7goMQ)(|{ryC2o-taB;;~6ea-~9RoKk$TIbe@RaG|wu6HIohF;;^zScX4mmp5IF zLu#8zailU>g-dj(L~NWsWR^y7qHl+gO#tc;9|oSd95Q-J^f|1ed8@$vEL>FMF&;Zb_6EKz+hRDvy1f9B@qPgwt-R)p~I@OF)}?d|Q*(9lbDr!iNAPf$d`fiYEtPI#(Od#y}%sL#*O z`tnR{cdJQqq%Bi_QF*OTc&a~Vm@QF$?Ck7L zc&kr%tN8f%O?IhGcc?B?fKPX-`}_Oz^YcMynMH1&^z`(!!q?>F-rh=b zrcQUNPkF07WtL2Ksp#nFF;#>4`T6?w?LcXn{@X}RcdGcmEwOtY$H&L$P9QU;a z`oJpd=;QITHtw!9`u6egzcKK?H-CJJ_q;PaWRg*OtoX7E;DH4Hz!LAkEB3B6_`Nys zlmPF(AUk4`@V_SLl@Pmo4&&X~v1kzF;^EEB&GVxt^r}?teBRoVG^=+Mb~NyKP6KT33^{@6y; zvzgYkod5s-A^8LW00930EC2ui03HAx000R80RIV0F`>zg009ghY{D>MlK=}1PDmlJ zA`&EAc-(k%;|3BQAccLr!Q%~&j2SQ9sOW-@i?j1I6lSEwL@_6u(#hUorPPF6B(7Sid~J)#>75y)pVSi_+C z3w&*&M9CzG)+1uK7+D}EJxZH{ywJb^LNpmp zCDXWr3o{Bd+2jBXz+l2Gb%am{0bqjp0vcctVP+tWP-BT7#&}|;nP8v+Lzux3aKN2+ zzK}-^K=cU&I>*QZ3@Oj}2}BK6z_1LS2T?(`kcJz6L6C?p$e8k%8)?A*Kq{#l2wrhB#S>#3 z&kP`k3~~-R%s_IUa+$i7%fCbS41q1*)xyKns literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/newUI/butn-login.gif b/posterita/posterita/web/images/newUI/butn-login.gif new file mode 100644 index 0000000000000000000000000000000000000000..97ec014e2c01ae03f7753d06ae2798534312a490 GIT binary patch literal 798 zcmZ?wbhEHb3}ldGxXQqgIPuK=`}aS7{P_R>|M>n>vAri9i`GYW9&st%Xq&g%zF=*1 z_c5!S6=qq>Ls}06HSP7O-RWPy+ahauc>5u@iY=a1+bpwJ#Pl40`t0$`*Dt)Pw?BON z@axwvZ{EK8@ZrP1fB&xDe;wU*^yJm2Z{NMK$z4@AW&h+2S3JwscvfsGo^w89%Bfwa z?>~C-pmpW7xmzw}_U&RI5h(s-0qf8Kksv=Yu>C*K_~G(FmcA29icaQO%@0sn_E|8> za`sC118=MLKiE*=qsMJ?l=r#Ri3T6dh8n;1x8MKRQ^)Ty(?OCkTV7gHyQZVFtGifR zQkq#(LZOIdTFLZc7KYi=XU?8FXWrZebIX=4pR=lTwt|GDjy~NTw{G9Ii*@I; zy?gfU+qL`9{^KW(Zr4?IlhYCx-+SpY>y>MJZ(hHC_3oXU4<1~6c~I}^#1MVH($Q}{PmOR75je%W-b|z4GRu7a|nLpR!C?%+%BN(B_ec@%e7t1FluJO z#Kp{={Ps;H8bu2k*foMz#heW4@S3g>d#J=fA4T51ZO+&@tL4D9wYRqywCg%`e|^1>(jF%dHa(Ao1*}2}6$wpjMmH8TbK6xYG;!HQD7Hw%%~;r|XQO1z z!k*g^aEOz4O2(s3jb$qyb?Iz-k;JS%MZrlSyJm(fd-RNjkNa$9HL|f~O>t`x3>3+H PGSSU1uvNg3fx#L8%0zN^ literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/newUI/butn-mix.gif b/posterita/posterita/web/images/newUI/butn-mix.gif new file mode 100644 index 0000000000000000000000000000000000000000..cb20ad935fad31c9d780988fdf4653f7d59fb434 GIT binary patch literal 1425 zcmc(c`#aMM0LH(VZEUh?xtuZ^J9bKS3L%$lD&>)k%B3Q7Eal$GEhQVdj&+XuVs6W2 z!(28pJqwM=Cd=r!Wv5J&+&w)Nx*ey^KXKmoc|JeB&*ypGW3Dc?2ZIg(cEAh(fI)=L z&Q76FI5|0~P$6fwLR>=3m9Rkn-}?I{c>*HH{9Z6UJ(JmbDK9s+yR-Xp^ySl+ zA{1kaa{=C66WR3oQ#_$3lgTXZJX2De$7uDskrX8015C3?~@!+xcgpH8jV)RZG1I7`?<$FC@i%{)(iaK!F_`Kr?C46e|!SKHc|`> z@Hmb1jLfX;9C|JePfN|szk4s|4jyC{=cbjEvu8s(R4c z%6|B$z2jk9XIHnl=SderijW|XCIk~{Z*LzGJ!*kO_DNqj6W~}Z{Pe`rCo`=>GcxEX zT5rV~3VpHH1cSv8*Wo7bCm@4UUV?@|5)`_HES(yliD6pHiMCU!?%QVe4hic%11t$+ z5$)xRQ>nGb6G$@ReR0K6V+;jfM2b2tVN66D90^qtv$pKXqbCHXYC0hH?3frQO&?9? zkS*KSGfup9r@Y`%`mH^JvbI{$v3`7-CcQ)fxQ;w~&Qj#t{ z)d}0Q{j6{BRIe^N^H*C(R6&4$fUev~EU*`s)xqB#uFWc0{3a=0U(b38h*d+F_9rCT|sgGfX7C0fQS zON47Hasqn1)c>mbjHWR4f|Dbl8qRN$INlPGuCK1&_dqEF*FL3`yNsZXiF#eRuh$KC$8EoCZmNJpP|Ya0fuqOWR+ zg0Jy4hk^m4fms#fKz0odjz&{W8BS&gRU4_Ozu~3oPCHTlv~N2ssVBEHe}ztsO@J4Z07l;6nl5O&Xhcl2qctQ*eO#Gd&fB@u(p`Q zbD?zW&xQcYk?=E+EZ8|)U8sFlbf0qFkIlLFs%Wl8a~KO$z^jVpi|PgQ^F`&zsZ zSUA_9TP6%;=B>_iIh$qK3p_EDwZN5{EzDoq4tHB@=}pE~HxHY+)wam>%tf#*w%T)T zUg?P1HvTSF4{V&0#O3b@AEZJYMJy_G7aesNX)3d)Y5znQr9tNKHu4l5D8)TYvlgk3Dtg z-~WCuDJl_>Eto4+-`UmO(_1SQ;UXeY%q37FFui#CoVi6@4D)7AomDhv;XH-~i{>s} zHhAIy?vJL z-u(yn?i_pglOkd=gSUCqCRb)Fi&w^NNOo^6`d$8!Tl!H!V5b#v)kuCxc;e<0Ll0hT@Y!^PKv$ z61gmP8ZZBMaz68aM%iB*8ZR#94KT~;Fv&bLQ#+e0Wak$3Qxn;R?Nok!j=#JUy zJjninb%{8Gt#$Rs7iU+;zqk1KW%Jv+`>(J2v$y)wlfT0E8(73TF_v;-n~?xU;9t<#e&i> z0Z*2ehzX9IEoQG?ES}(ImBA?);lLpswP4}PWpm12y_Cp`P;?Oto|5%y<%(smTtuB& H7#XYq69WE= literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/newUI/butn-next.gif b/posterita/posterita/web/images/newUI/butn-next.gif new file mode 100644 index 0000000000000000000000000000000000000000..ef7500e89fd6b30fd20c5e4516b3842358c81bbc GIT binary patch literal 1636 zcmV-q2AlauNk%w1VIBY-0Qdg@P@)1%bf<>7RWetFK4g|WWRg8(m0`CJG+K&ZvkpjY z5;$IrH(iZoz7big3N2EANtFRQVUjUgi!@k>PE{VV)sH}EnNNAFQF^UJY@Ie-i%D^$ zKWCRRScNcEf<@HCl-}VUb2~p-FP2EKznL^cBxEvs54lFHe8BPd#y!npF(S#J!O_S zV2?|6s4rB3O?RtDaH2hAmP&J`MsT7oQ-Dr*t50~UL1>vwcBxT$tvFqcGg^yHc&jv8 ziBNc~PTZl?>rZiiLMsA-qT8K7Xi%N8+ zE>nR#W0Xg5pig(IEmD3mScZggxQhl*i zfVMGKgL|_@S*!|BdaQo9M_#`HI$w`HW0FjDsbZxheYZnrzz}+}L@`x^fwoRVYnv=m zeN?3fOL7uXdaN*2fq}VDSF8qJdMbvJVRo-RQlJN3#{o>60#A6WL1~#WSA~JQN>FwZ zS9T!5;H6ch3TlipQF*L&lRJ!6wUW|oh@ zV`s$-YRL^jXqt@2RDnisp?a}If3`|ZcB)Nxs!f;&VxuB{v`UD&SW$ekTC5CI zq6t^13jhEAA^8LW00930EC2ui03HAx000R80RIWBM2SZi3@&)M=%SE^L4^oixIjp$ zlE8~@Y+%U5gb4-=Of-Jfm@1^3ks^6rJVEEgi3>0VZMwB^WQlsYRDW~ z6Gu&yLsG~PQA1>nJt;)uI3p7!${HfGq(s?ABnvesPTC|%l1B>#3Q73z(UN8CvMg=B zX>pRrQ`mYqa4fpM_h$BOeWE3eQgS(Co;6Hf(`L4r@Y<=kRA*1je{P#y*9(~XO2+)rV_%qzc zZ$)-H0qe{|3LJB?QyfO|24}S5*5=*?m;0vYD zVu1y0oY>8Y7RVNkCd^zSiaM=Oz($HJ=12txJnqON9@)qyjxC^EBMd&D;6ee998iHr zlRO$=Mi5{GVda!T$d=47005wjED%7T00mTH2?iJh6oQQrM;u{90c{o_n=zO;;Eyh_ zkaN$NZW_=@0Y(^6NDL9gutPCB*kR}nvL#^7JN)?5&o5)zvBRP{N zhHUU0kia_*oPr7kRfrmDr#*20Vgdtim|*JywVEJX19h0n$}JQy5Xl0w5*vvL3oxL8 z23#x)g&@poAX_NBHX{uM%R&o<2HP^bZ6JU6;6ooUl~ya*QC!2>gyPK?#zSAR9NE>_R~a2#;{b2nd(Z?;Ry{FhB`1g#1M z)=)q~(L@uyGzm%s4Yda%z|lerIi!&T)=e~V79lN+ku}z1w9tguX_xQ=;1T_Vtz?K79E1@9)M5)4RI5j$FC>@7w1| zlcp(F@02fEd;Rk1ef#!V&A!$*Y104yzZ8;|7KJ)!hW5KpKUO>UHp5T=ia%Mv&eQ>s zpg3V*|KGsW)ZEhA*51+C)!ozE*Do)o!Z>B>wCOWu&YC@E?!5U6rl^R?w`eb1v2xYw zHM6vv`?Sql8F%n+VdUJiXYao0`*$5ZdT7pm{)30N@~cW;xvF}4_fkd9 zJ9qEhfAH|p<0ns_J%3=!@cNDW6Avav?$2Moe*6C8=da&?{{H*UqZHDiVBpkQ%g7=S zabm;5!|ejfUUNJ)E^_T)RdboKz_5v@i%Y*t#&gpXR}ql{4~`g!WM*Si8;5vQn(B&1r?!>mxlO63 zN;3Ud`p=$Z>K&qWWmEe9#zm>t-*JgA<@s{X$6EwNVssNkJq|Q+**hpKV_^OA^7;G*Hmw&6>dHJ{EbLJ0 z(qMVbvyoXq_W*-4x6+*hd@M~|4ULQDl)ZYne1Xxg%PU?daA~kHr5rf0YR$G+uU2n3 zruBNwmTOtBSE)NJc)f1Vr>aA%B{>q9n2v~Lzu9;~ZS|W?XUtx|*?hq$yGcQjC*keZ z8%hmtx7~?boxA-(Tej}TM|IlocHUdmoy*bEF@cfo)iLe&d%j$g)@PIK_;6z1pKq_< L@Bhul#9$2o!V=`~ literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/newUI/butn-prev.gif b/posterita/posterita/web/images/newUI/butn-prev.gif new file mode 100644 index 0000000000000000000000000000000000000000..64c165c643276c212ef518bfe81517456dccc26c GIT binary patch literal 1636 zcmV-q2AlauNk%w1VIBY-0Qdg@P@)1&cdJTrrd5HqhPhQTSA{)flVP_HU$YKKZ4y0X zmSw&XH(iWbs|rnbtW0#LNtFRkRUWd{k5755Fjay?Y@I-8nKN03E>eF*ZlFnVq%2W= zIbe@6ScNN4eKuT+F;;{^YMfDfu2FieOLeC|XO~ZStTb7NEmD6mSA2IAD)a zdagEHicop2FH?a=aH2O}jY)E(I$@DWaimUos!DRDEKz<@d96WcnJ!a+FH?XoRDer$ zs6J(uI9`lLaH2L{icop1J7JMTY@AMaszz|3OLV6{XP8WNs4i1~N_3?{YMV7$h&5V? zMsA-yW0NdUeN1+!Om?YFcBnpNl~8)EL~NcdQhq#Rl1Ff%F;{~)UX4$8sxelBPKLsXkRDnx$s4Y=`K4q0kbf!;ut2kYaF;#7RF z3WAzcT(1p%w?j~Qt5l^2Vz>^0xlll7m{)xoEmD1Ij52|?PBB%4Oq&8vodUt&rC6;7 zF;|5&T8K1SiHp5nQlJM$ZJ$tf5_ybIUdI7fb|64!muJNcGgyXhg+XeIl zQ-NEm5KD3rKxmpVR)siVj&80mVx=TASchD>175!YUV18JsU=XK2RvhxPj{H3`}&WbFMsguResgRadMA zXTT6?!V-G2L``?7f3`|2QGZ5np+|3_O_&E_qas3Un|`!PV1y-zx>!+svRbSRRH6x0 zqzYE33;+NBA^8LW00930EC2ui03HAx000R80RIUb;6{YOI3ijojMKv4h=dJAFmy9O zpv4gwbG*ng1k8&US3qjaG2%)NFc?FQ0Aq22%a;>|n0Tqm#LSy9Czu!_Q|CW7bm$nd zVMB}KTqAfU_haLX8=zPv1Vh<%qm*y<;2+LOe!{AQ3zf*j0PW zr7iQ03l|OtPOl7-GQi1@0Sb305q{nO+mx?%cJ86Nd(TjzJ(l)G;Kz?p%pE8K>T0*I zfF*u>ELi-($R8nukV%1!G}1%_rKCd+JhHS>TY-$&(?o$6Ho=Sq7U+NohdStBK?KyG z;|?jEl*3JJ9CqlU1s}SSMhPV(F%FF-L=X%#^;GjrD&BNcTM{$YIAapRBw@u5Yy99O z9zR5o00a=wQVRe8C?ig7Yc#0<9#(`2WfXEmp@jhkXd#D`^o+twKmIge$}P2NamE=2 zkQv1pT3kZ|4Py{7#v6;!u!xk_@bk$&sF;I5ZA8351Pzk@87K$Nu%IaDFc7N@5%{u>sfsL68xUOtE5oo1%<6&*9|-XQ zvL7@ngbNY8qD`;t)Ha9<&nlbj2ZK1#1|ftL;=~hA05V4|)3ao3H(AsC=RfCAqbEP;$gS;UhC4q0q~1{ydpen%E&Y=8qScigdo8If-w ixkUm+Qilhihwi}!pi7~->6B2iffQ2I5s5_s0RTG%^_IN= literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/newUI/butn-save.gif b/posterita/posterita/web/images/newUI/butn-save.gif new file mode 100644 index 0000000000000000000000000000000000000000..d2f24c6f327e214a9c7ad6f119f527002c2f84ea GIT binary patch literal 2061 zcmV+o2=ezwNk%w1VN3uS0Qdg@`}_TuveN1A^@gg}N_w}s&gNBy!cKp@M|iSnj=f5E zu0nFK|NsBP!^2^b%wUkqKX9!$YNtAEsX=qET8qY9jmSK1t4VscMtHPQg1u9Oz*dLC zV3EvBeYszd%UFrTUXIF9g1$R!saA%%n($WDK|Icld~kIGbpz*~#PKXI)@ zb+SEft4DaWL2|D*X{I@Ar#x<|LUXTAf4eqlrCEu@OntaZeYit)u|##TMt8JHdbd7s ztxkZu#>vfEi^n%;r8jA%Hfg3eXr^3@$UAJPHfg0lajZOVt6`GNv$VB6ZmK$Ls6=+L zU5v;*Z>w92$3u0pNqe?BZK+d*z*>sN>+9<{Yo}O<#IUoq%*@QKuCQ5%#8H90M0T=P zhQncz%h=@dzP`R)jmOa3>R5@zV3N#Jgujuq-0t%Dy1Ki&yS&@v?@D{OuduSU%jf+4 z{rLI&UysVNv$S%Z(em>0qvRE;OFsNg}40u{?6O#Uy#a1ceCK= z@?nt3^7Z*YZmD#Z!Do)UqPf>@mBmzqzt!OFpu5~`m&{v+z54w8UyaCChr>{MvA4?N z+T-us8K^j(g~>hJa2 z*V~@q`@%H}y|LyYkywBy--|RVR zsMO!>+2ZYIlgnz5zp26BtHImV-|eHj*@~&mK5?v0fV>q?mgMU5a|>hk02^5*RH z+U4`-?etoOxpbS%bC5%--sbT{bg;d>zHE}e*yHZm;_p#?u}giq_W1kZ z=<(Fx?*IS)A^8LW00930EC2ui089WG000R80RIX6x1|f41_%=>T*$DY!-o(XvgxvA z;6NZuurS!jv7^V2AVZ2ANfHYaAQ!nX7^B9HgO?7LaDW+;!%UhEZstUjvnNarGJoQv zsZ*y=J8H%-;DYiW69#dHF2Olf=+K!}hxVMwK@3hbT)ln`OEV6GI{*IM8AIqnphF%W z$bH};?%cR|^U6I$m#$v74@lXa+qW=byoT=*Vwb3p9tHzIlps+e1qcw9D__ox83YN* zlP#wxftiG55OgGyp!0cjW)iSTyH*{$wdTpN2QYv`hJh|4P%2b_Vxmk1NW+UC7j8nh z5#be#m}vf-c?A=|uTQt$JUa0T$6^WpQ>18ECtBCJJMYGTOalfKu1KMtADp4ZMjvR=;zlEW0OLm_%6J2dCc*;18rAe-%^ufKQh+Ze-k>9o9=5#>fzLdk%Y8+25QmJC2S0+v`#8Ks#c7!V~jq69O^IJQW`06&HR@Xnc1 zsyXI|R%oDs3V<%6LZ4}m%ZZvDFt$wjltG2po>#iBt8Y`?{yy|KQ{xHIb zI&v6Ni9DJxBS1c{hEQy)udZ6d367jl&Iu>faKI1Sp5Rfqj%@V94;!68?nX7hYpzE% zkn3)^Cu|c*B%q+OMgsGMk`5lP)KKrXKj6FSAUWXBK?gZJj6)6-OHA=b9pJE$!yE0B zF~%D)jIqNH3z9L!8H;0y8|Pr6k2$NXGfgtPlzei;8h?1f1yo$n!_GVRd;tSN56wUi zA@%Tv(F_Q^(FFwb@N*A6FTJxYmvDoRB$*`84=33m)5_FU1HCE+7?gs+3v0i?0}pI7 z;5OVF@vxEGXm5l84;XO&gm&L@|IIhsYZtx=9*7`9k11}Lk;^Tg>|J=_FRa=^3sXGt zL<>7SvBM5iaPHCN8?^ui=?q-H14oy)@R1HrfT08EJLsST0s$0*OE|=sfetvl*bckw zwCk`c3=<@;JPgPqKLPX4Ptb_-G$c>M0yOkteIwdCKSA})EB`$WG$2odI{_^73@g#p zQ-1WylTU+(z3~Ep4-i1WLjL))us{F*Bm4uAPbKCV-^S*NJ66EkB;nPBr)koLh|7(0s(?b9-#^a6d?vgumKWm zaLQD!atK1OK@5;UgcuCL1~w2v42m#>Sqh<-L_k6jgrG}UvJ#a@h=DAP*~(xl)0VL; rf&$?2h@~{;9~jXHNw&$&ZhF%s*BnSe+7OX)n)96HYy(9s5)c48sCOKQ literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/newUI/butn-subtract.gif b/posterita/posterita/web/images/newUI/butn-subtract.gif new file mode 100644 index 0000000000000000000000000000000000000000..4d07a54c12059c493483638903a993344b9ca77c GIT binary patch literal 389 zcmV;00eb#NNk%w1VIBY;0K@Y z$Is8vnYGuty1HhX&#BPn$KCGL&(Xxx-Q(ls=j-lzoW*ym*TTNS+t$`WY^L7i=s0Po z000000000000000A^8LV00000EC2ui03HAy000I5V3JVNV4i5I4ihDgYb={CHQy^~ z5`6Ffyuoib0UD1;9|A#G@|Mo0w8wlxuh^{iYUp~uU;_dZ4hsx|bh_MCyU*XZd`_?1 z@9)S$9ntsQ5dsT(3wwrXdV+<81&xl6kc}G|1&fx81rVB>ni8I$5)Y!4mItP$1riLa ztgWjSuoesjr?saA4;8u<4!yp=y|cEqxT40c$il<7k z+Tr5k^8f+u_xAel?)U!x00RmHa6q8JgZ~apK*&&_h6Dx- jHfR`NVuJ<-UQ9Ru;G)NmAVU(I@S>#2lPFOFh5!INsDs3_ literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/newUI/butn-system.gif b/posterita/posterita/web/images/newUI/butn-system.gif new file mode 100644 index 0000000000000000000000000000000000000000..92d41f456336404c4fa301ada9d7aba99b65bc27 GIT binary patch literal 1215 zcmV;w1VH;oNk%w1VIKe=0Oo%HRaaB+@bK&E>htsS^78WZ^z`=j_P4jUy1BZ*zrX$c z{m#zL?d|Q!$;qp$tM2aZ=;-M0@9(v>wZ_KA)!*&q=H~3|?B3qqva+(izP{4Z(FH`3 z+}zx~y}iM~!F6?Y)6>(tySu~0#KzR-@%H&@YiY>H$h5Sy)z#Hgezexs*4Nk9@bB>P z@bU5S@!;X$?(+Auv$NUR*{;Ie($dn=(b41S^WWd!*x1+F+S=Xb@Z;m-Sc13Y z%gfBQ$ltrXyYTVwgQwK@`TX(m@GD`X%*)H>=H=7W)avQ#y0f#t!NaG$+xz?bm8H1I z*5>f=@AC2T@bU77hK0=8=lcBp#KXg}w!F2rwLWpJVUEi1@bT&D>7%c{zQ4ls^YhWo z%{pwUwXLo3@bL5W^Q5r8#KXk1w6nm^ahI9{kYog(prHg~qM@XrWPd{~ zQ&vh=EiNrBZEY@7vM#bpvbZj5fMa0#$w4V$3(}^(g9-35l0VCPY>SR z3=9_GJ?BfFO0P*tk^X~%e;_UVUZf+0&H8cnuNKiu%CjcO9*|JXngoi#L zQ~=<^fyIj$FJ|xnpu)qC5`9$2(gVN%3-4|iSjn;_O8`AaRuCDp$Bq{!Z|M9Gpr_BD zJq-YOVPr>z3O08bxp4u2fD1r?m;g#OfY1v>i{5+zRfbaz9CGmV31UeTBuJVp0U=Zd z2dppuUN8--!l?`yI3{e^dnLsT7zz}Sh?0T_02Mhn0J(4hEM5>!ao||-VecF&3UpA| zY=eY?86`lha0@nvj1?+sI8~tnMTQMmsE`<;XT%T+HeirA5@5T{O@ zfT)~80fjJ8X3U5(B)8`#G*FS^I0L2H*kpKe|Fp#)Gb6!vYLIou>00oRTnlOR? zQw=mp#~M{sL4poKn2|yXBF-?x0xKY4LIX8o(c}bZFe&2)d{Cf(lsXs?m7`YBoG2U@u;D|7X~nJ zfeH&ufB+Cne9%DxcTOt89v)bVzyT7R5QD5GoUrKwJ#cVe1xu8Gz^NkOF##NCc+hGG zuc{$Itg>S8!2&)E5P%U0d?3LA2o!;;2wmL4X95{?5W=emz#3}|7+_Gsx+SE00=6A& zFkD#`4Spl6eon^Pwb!`Gs zjxGqTyGGY`u~^G)YYmXZTqNI|gph-T+zBBGIlj5S2~2G}I&AtM?DO;c%=t5>hA zc2g)6ipB*+*Vfi-cI%2(%jI(2UMH1Gou8jyb6UgUup3-=y6q;bPNUJ#>GWVQ7>Wd+ zKW8i~EI1qvok?S`Xd_TWE|;6l=39d#uh(lZ7w0(&)56$QK9%EEbEyZjYOFI-SX65{URh zktiGvjgEaP6bP&q3ynrI7>!UoKonv!nS21?a5(E8yVYvdn>EYJDxVMJ@c>`IYhKk; z=jOyBvDT;-i$yRPj0*_)e10I{5BU8OiNxWu*=(yut8RUL-C{HGc)W(j`W-uW&}lS) z55%G|i9~F%8N7bC&+iusMLMm{YBSEzIbw)TUBO?Qf zMTUn51p+>s#rF8ZCbMpMWDpE^<4o8r*6ON_#bPlSOr=5rMPrc&M4hARO`2fX|KP#> ze|*hQDOD?a)v|io?e;j=oeMgzLZJ*pA&1lH3wj|aN~hCa{P=@?ef2SgyR1@i*qnJT zHwrRt;`3f^=G#Eeod_t|! zczmvV%<8MGpikS`FBZujeTItG)WR46543F!AKl?pnI{%rPXY%{9XD#3u~ z6XH!4lQkE=o;qhV7$67&{cZtYAYG8^b@~VtNAGrd97dy2DqT=()Jsa))H5y*;CX#6 zg;LRX{UZS2nN23Y&)-iXFc}Oo`QBo@7Bbn)97S&OhJvB3t*tn+|3}3?CBk8_7_91- z;a`3NhT4L;lQ*>s1pWXDS$wf;@=iH1Benjabeb?ZjNbLZT~uop@ecM_*7!zaS$$2( z_QjQ);t@2qtpq=m(XOpPwRRpQCtvM+7lk_uABMfIF3U@~QPI+KzN9U_U&69DXM)V5taX!!L*-pCZDbG2nm#x zzvkwS?(UQuXQtd)W6236O!pSG6zj^01Y*NA7 zdpa4hg9&?|A1OniU_i0De+?KYPl4m{gqBaLpORY#PLKY!tPD&V|0V&0+unFa&{kPX zMt(f9ZEL*c>d8^>7xn0g@hdE3_POS1AO7Fm{Oq@?hRTl~KJznptr{-w?dVk_i@K{P zClgehiPWNwp|h`LUK=kbCXQtgNmVO(Gxo$h5*ePYsOTc~nXwL1>9vc0L}pe}@ciDd zNnI)Vg)TDbKr{JrW2Lhd=pQ-zcpPz{rO+YhO|y61LKbvm2?c5fKV@6mkhg!=u_u&N zbd|lX?v3WdOk#RMl|Wq5fZHWaI-h?JiR`1;6`3~+9mG^AF1e%VD^z>KZ$5CqHA|`IIT^`m^yU-wX@AC-f=`~yOB$<{BCKsc?#5?}sqW+bg4Ykq zA6-a3AX)|(u75TSrJuv(O45%^LJim>07aPh5!gx0`LFw5`S}RUetBLkKtQC0A>2{S z?P(kl`2qOthq7Jy#GY<#&aLo`zMD-kOaO^Lv!)?GT z>uyk9p#O6j_io`Ky!Kc@&Y2c5{B+>}Z~%4n`yCNV~*RBjw9N?I)TJA-vr=; V-*K-8zGuIWOuBv<(Ta!F{tsonlU@J- literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/newUI/donate.gif b/posterita/posterita/web/images/newUI/donate.gif new file mode 100644 index 0000000000000000000000000000000000000000..68c8385e6541ece5d099e10b2582a7824379a312 GIT binary patch literal 1714 zcmdVZ`(IOa1HkdK#l`_K#w~ad>�TA&u}+6s-eOE(3A!GDSr>Kn0<)nIeL~4%<+K zHPC@qU?WU$!iI9u2JD6ifs820c*$)AanWZ8nuzH4`@H-!`uqp)A3njML4F(KVi0#^ z-hjYMzEHUa@%;ui2Er$uaOPKNh=V;OoO=WZ%HfM~Fr|kJ7C7DtCNyyN5q$F!{M`W6 zzOZI382u59sexGuMk>IsVtCUJ)^EWhcWHl8fW|<^=LZF%RIM_TWXlv-HQbtC_K)FwV%QVvU2(NSYRyBY$uLo z_g>tB1t-JSy+kT0I3vbFd01$QKvIB5Miaav@cM_aA;2=MDZg5d6DRpOr=%qke$sYn z@fp~WtZghA{zW-c>1FA!kV?`(Bb)ne2AuBTrys?M3_NO&JnIWEZ~^pWz)=27v7~}W?AsD>O7Zzw6&Xu1}AMUOo zh#jh$i|`JoFg+ChRS){arn^5{29#h(-do}~Y`R7q&jH4GXubtTt3mx1?m-eZu|dZn z*ehcA#}9Xvja*^z1*GLc8Ju~*O+Lv_3X>OY&fNEcDQ6;0hTn_d9$*k5M$?i{CtGF#t&J;u_A7`h%T@ax=KUquk~E<%g0+4s-fl+&!&gEZ>vXi8RO1Yjfy&RTb_NagFYJ1kKW}NRvw<7Q}RiP z@5TPR>t<`)GIbF6R#azDsIn==(FSw`igni z{>#}%N4YCbh#ft&NbK<7h7Twine0z3EsMOEN;@eGh*t_1o=yHHPi&dWe2>y{|1WNj zUv~y2a&q^%9kIx}&)#H31!POMn9pROKU}bJOmJIe6bYg+v)Fl8QqEH9<^Z!TwT3V( zp_V=s+O9*N8gnImia;moSbV?=rc$vj@4fJ-B?+JW!CJXAr*1Mo7muhu#k6;SU^u&c zozaFCzJBVeECwwS%cQ8DM&qKRG#QEFbXpLKY;z+x3s;v(e5P`dR93nWxz1$-UEcBg zz?gf;aiWNxIk%_FOBjPqD#W(QLS!>zlL%Scfa&c-K`ZpAtH-psBJY4c-=^TRpeb4e zTGvIBMr<;o5*Ot(t?*@Bs65jh78`0BOq>wcIzsVS)vUn~v^k%tcXT5$+}>czqS3X~ z?k8%u=a`;}Wn$!iG!aa4Rr|Y(hT9`^p5FBRzeFCar8_VUnkP+#S-SU!R03IyD;Cpx;TFau z?b1A$q?gk%ueNs2*hAkf{VyxX*e*GIw!_LN>?X~VdhFJ0?=sz4M}*>h_<3K*vK}Kn z+;_RqGgvfhYfD8P0{g=3bN-?4wI)t8)`%HKy1(;sYX7%Z2z~WVS=sYPym>3ch5zvI z{LqPs+O(man+s`rgtYd4IVyHdd1=o3NOi|dP`J62qG0cZvEtn+3*#3PRU5~@B)^Pg zSc|=1O zQR1~WYW9{f9$C{|Ni&?hQ_Am1WpEP E0NzMSr2qf` literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/newUI/headblc.gif b/posterita/posterita/web/images/newUI/headblc.gif new file mode 100644 index 0000000000000000000000000000000000000000..12e9bc7f6ae8e56782e3d27ad7951d0a310e1cd3 GIT binary patch literal 201 zcmZ?wbhEHb6lCCHIKsg2|NsA|PoF+}_UtJXJ_GT9LQkLk{P`2edIDlT{rvg!zkmPU zyng-W^_x#0KmGah=k@E?FP^`6`{wQQ=g+@?|IUB|DE?#t%jkeekev*yZVME;_!8!6 z7<75Q;&OEqm@r%DqmRosPnH7@9xH8(WNS_k$TVP?(B)*v!E2|NsAY@7}!!qW2&IL;(pfWWWX#f3kpubwDJ@3Jrw&sR|4Jtwt#Zrn^23WLjJ!x8Cku$wBw_G}d TK_KH%(!qocnp0aeSQxAUuts3E literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/newUI/headtlc.gif b/posterita/posterita/web/images/newUI/headtlc.gif new file mode 100644 index 0000000000000000000000000000000000000000..916b90b76e4908048a15f7c3ec96177932aebc51 GIT binary patch literal 704 zcmZ?wbhEHb6lBn3c*el+>C-3k%w_-o|Nr>uQ{u!k?iE{HN;i5|ZTtA~qfhNl%dF*A zIV)`PR@)b>^{d|<*tFNNczs0Yk*MxtVeN+!CY=8C@l#04fw;a?F})`~efk*Ib|@Ic zJ^AO)pL4ffCQLjN+PGjaW=qPvg9gS32%?K$!J^XIh5K#}9U>u-d$9ggfg z8r6OL(8VXQy(hkX`xe)KGGW50kk$ifJ-cIiPJI0M>F?iv3H_(f-Fi_l`$BB*@z39W zy?Xy`>V^v$eS6j&d5|>mba2c5re&AEe*OCM=g+9FV==wQ8HNH-{K*1#rVfY%#R&uZ z{{|)|Swjs524?2=?rtWxo(U6WCr;^hojO&cbHZ#>&^^8p_YCH=em|F3znRmtg2`jadOjBFAwgdQ*$JRCpFEsD8APsvS9i7 z`L>lzvRWlC&M$InHu9<}(F|VNJ@4C^4V(>E7&C-3k%w_-o|Nr>uQ{u!k?iE{HN;i5|ZTtA~qfhNl%dF*A zIV)`PR@)b>^{d|<*tFNNczs0Yk*MxtVeN+!CY=8C@l#04fw;a?F})`~efk*Ib|@Ic zJ^AO)pL4ffCQLjN+PGjaW=qPvg9gS32%?K$!J^XIh5K#}9U>u-d$9ggfg z8r6OL(8VXQy(hkX`xe)KGGW50kk$ifJ-cIiPJI0M>F?iv3H_(f-Fi_l`$BB*@z39W zy?Xy`>V^v$eS6j&d5|>mba2c5re&AEe*OCM=g+9FV==wQ8HNH-{K*1#rVfY%#R&uZ z{|1Jp<|bz5CJjSbCZ?9Yez)HK$xX6TrnpY;YtxXIS7KSnVy!JVdC`JJ3myAKR7Ezd zvoscQvg#9;5my%9En~FHrB6b_L&C;D{fN4mW}nan6(K#LOIq$ieS)`dD=G@=-suw- z)_Ec&CH(SLpO~|>f|!Ze7wHdu{6ByF{@KU(pMm*b@stG%4mPvO%0`^n@X*PfRmp3P z#Knn?-4e!eB`gaUAMclyHI?w(^u)uRCumj7%u5%WrW+*hD_OE&+1c5qvaB~wZhr1J z*RGj~_g1mS#rZ9LV!o?HUM^VX$Lh!%km1m}vTc)}YKiEog}<%@m2!d$I5yR@C!IC9xY4@iuCL2Zr3JqW*lXB7J}Gc% zkc(XEf8zgvYYUP$ew_Q~Ye(a@+@nX2?AWyP)5lMrKY!l3ZR@jpuNE&^wrSO&snceB z{PbhP#?3EZzI^)R>FLv_uU@;hZo|g?`}aS2_H^yqwe1VlZr-_e<;sJl^H%)-|DSH<=qkFgey7Pybg;cq@d(XPCa$Pt)cLDRPeh=ma7xvG4=b<_8<3Z+i8|O2Ae*Bg7 m-8bIi3-71ytLAGGoHPAUlQWc{7f5OSA*MX$=6FuBj#f literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/newUI/hicon-donate.gif b/posterita/posterita/web/images/newUI/hicon-donate.gif new file mode 100644 index 0000000000000000000000000000000000000000..c0188f44d8ca1eeede2ab4a66e809ee058b1c4b8 GIT binary patch literal 1185 zcmV;S1YY|`Nk%w1VHf}v0QUd@)a87%wYi9?Z|(Bx|I7rEy(!?S9^9rS^v7oZ%pB{q z6Q#-|ccmP<**vn+HjBY5)ZxuNcm`3I4?_VvZBV#mKkLWR1KFeW6_c)FqzB9`^S3?YbwU z$~N`EDQuS>?70m8{*^{xG-i<%oWw3&gcM7D6X2>Q^0+Bjgc6>_GA&~V-Kr;Ojvif! zFI$8Z;pyB^f)2~OoL7Yq|Nnnxj38Hn5`M2UVT>M3f*H=w($MNcpuAe+wJzJK2lW1j z|MHCg^pR116QO@Wqrg~=uRrg=SAM<*rlBdf$tj<5Z&#%1Dv+4GCtI#Iv`EYocT8gVl zv(!Yk-b=;VZn)M+*7sh*+(meSb$+8nUX$Iv~Dvm(jtOpCcF^}h<^t{>#9AakD~yw9@G=3vt4V^@VBRcT0EZ%|Nl zMeVs3ptLdI;N|A!=S6xC@U$I9eHf**m8ZXx*6UUO=7d*^7oWv9tI$4}!X96U7suaK z-mfl?x+ee76yDt5%-X_&q8d|z693OE|Ng91hZO(dGWh!Td$1>muPcDAA@9jnyVyu% zjT+(fa{vGTA^8LW00930EC2ui02lxj000R80RIUbNU)&6g9sBUT*y!miVZ$ET=TI( zK*4b+kk}xYtcnQ$n5XVW9Eg13yl9z+T zj0gff9Fye2&9-O<4j9M+BOHe!J^HDBtMOw9^nV`8fGeeD+a(@6qTztihJ&9Tebn74 z-$tOO1UP7?fE7)!!-5Nq$ngRadPrf!9Wz*Bi$G*7l7c6LxWmE?H%K!A0i%5L0s{}56st^92tz~`Y2=Yb1_S^*>55$5Odh|-$kv^Idj%SmwD;05(>198WQgBU|8@ui2Xo9!0~F%7LTNpuGUKJ xyB(Li7uqrJ(%f3b`pP0YFMK;^e$G9aojgBl4QG9}y0_ti{IlJ4_MQw3)&MEeI)4BF literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/newUI/hicon-news.gif b/posterita/posterita/web/images/newUI/hicon-news.gif new file mode 100644 index 0000000000000000000000000000000000000000..dcd84be349fdc7597a8830be5304342b2e3fa3dd GIT binary patch literal 316 zcmV-C0mJ@BNk%w1VHf}v0K^^u@bK`6iiQ0A{HLj_czAd-Wuxip>9)7FxXR(r&(Wj1 z*m9oF(A?`cX{NruzWDk2gQCju@$rzY(&gys$H&O)>+GeZq&aG*sHdmx?(N^--{9ck zl9H13_4WV%{{R30A^8LW0015UEC2ui02lxj000HKpeK%GX`X0m25jrTE*S`PZQph< z&Oq<~z@9)S;t>vnB*BvG9TJWNV7LYrA*v-jpd*maSOX+1a^u z+t%sRr{B2!+t5@H+abwo(xm8t_3l=S& zIdkUe)2Fv=+0wpH&9(aYg5L$R=g#}{=TAuMfqTzB6qgj|=H@;-8!~b7l;tZ|pSXDW z-TU|Vp1hbfYnDvyxfk!hJbL`t!LNAbs^v?UubA;txp8^NhM6-zef_y+-G-k(e=c6S ze8cuVn>KBlIeTtg->I6rzSXl2WtLaZnYUotv}t`4CSJaLsb%SDNePMDw{QRb`!}s| zar}hSzyM*O7f}4k!pOi7!=MAQ5ELg2?Ef1A*x7~Hbw$)TS%b7C1SO(kV%Ql~j3OCl z&YG<;Nz~I+kV8{YP*am1d&l908RWj!abxk4Ws@dNnmu>ktN#r5?%kWy^JLwIjVo6zKY#w>+O=z!E?s){ z+O>xdAKpFlf7Yy7Z{NMWaN&GzZtm7?TOZ!~y=l{?SFc_@di;37qQyIR?rdnRd;0Y0 zsXc!-Y}|bR;T=f{iCMGfE?cqk=g*%D7cc4Un^09%`QpWkmoHx~nsIW=mJMxftygZ` z`tFTZ{NHf73`Et|JYoi?MV zx4*NqGchIAr9tlb^XJc=KD~D7*W1Vcw`|!0^cut90E$0Z7#SFX7<53+0mTUe`~QZZ zrskH`w)P-~E(YEpu70i{-pRe~3^uN|s!ZzYOzh(9jN+0#Z4B%@oSX*i(srByGMiN5s8Nf4>d5#O2`x>DjpML7Ge(-_^{|ugCIxMI)#J> z2bx9g3&jpKG#+3U7UQv~Wl(8o;1H7&u$T}mz{V^kkz?}U03$Om+kr0M+o4>HtC=z$ zo%*U~zRtXpi=m{$VL|?Vp4y+kR3|7px9~B1Vp}nhiLptjPcUbOgJe+(ORv3#l)|am z&l%KZax4@cY))tF^7&D7vg!acyNQ!c#@|cJmBa;7L~fjo_7qaK;QDlJul2`8k55dN K4;SEIum%9e4=t|% literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/newUI/icon-err.gif b/posterita/posterita/web/images/newUI/icon-err.gif new file mode 100644 index 0000000000000000000000000000000000000000..dd9f54fa248fc64dca7c699f7490319809ab8bef GIT binary patch literal 910 zcmZ?wbhEHblw*)%cvj4C%fsWAxA)zUkS8@YkIT!iTUp(Wh`3>6^Q^h~j=%ro;^Lbw zE>9{epVZYoYixYp)%Cos?Rk6q4F`wo=H_?9!(UFF`f}2wyOEJE`up$2#=e*^;cjT? zO-IMqbLIpF29}qV#mB|nu(!9gw0zdo^t`+Krkh)JRn^Ps(+eUBU(cF#Nm22#lF}VN zztq&!JHf$)g@xxuMI$02OifL5va`=|aXs(oc#xj{_5AsJ@$paV>Ymiro@QctyKLFJ zb?e@(Uw=_n_U+Q8m*nMNbay{0EWDkY`(on6TYi3za&s?;h&(PTx)Ts^)7kkfJG;G| z-E}jwz1-Zle0}c(1${bv_`{YhuV>6SrK0j-+qQd^m2c+HzaTCBxUB5;?AdP?ExMwq zdEL_T<&-J0E(xa@8DI4D+|A0mYG80dLgIdM@}vCx$AyJAGc(V!uv{=TJ= zw`aGrw5__}DM5Y}71Ps#>bBC(oy@EbVgh#r_!$!tMELIth&iw_cSMTCbG&~qW%Sud z>cjhZvB-8aaZzPHCblaIixzP3GBNk9C^*=*&`3GUWQNDYBQ0va784eDY&_Os)Y?+v zxFEUVnztEizKh794E2y`Am#k%k%EPCR$EiyN(w z{i58($k@Qlec-~P0&borX6cSk%>kTzB0?VX<{UWGbJ|!ZV4hE-GpCc_t{e`BT_p`% z`a%0wB<%XqrYFc{xbOf|!`s{Hb}#-FJo=U^CNe`p%K6yQrpG6OXGG*Fu@*hiJJDmg z#Enyg^TtNu7YFt-H@>;CP$RMV1y>I*1K*1H^Yd&Qcn#L6C<(PVbu#_<{Q7u&laqi_ z_Yy|tTt%OR2aRlP3^F`L5ue;7{8An;F(^I|XJXJxdEg?EJ3*;K+Iq!?7D36Bgd;*) eZy4I!TNenri~8FH9+gVpknya_9<(Kj6--j-L6Sv|) z%DPAXv+hSOdwlf5i|Az!bJsk(bo*`A_E!a+lWQ(~tUmK$-HwYlAAZQ(`nqG$mAY#` z>Mne0zw;+^ShhKH>?O~I%!*YJaO&gv`tR~=RdGAHBMf6KX1pg(zE}4%J;7N^1o>J^S0KuqJ_5$ z_Px6O=!19j*^+IqF5Y@O_u221-CrYS+^9PDxnsqxk|S?2c76@$ys`TC|GW(k+uA!? z9{f++@%hS~cbD(HP1*iAcj>*`k3L3*1~)H1&~W*4Z1-7vCzqyM-|jsA*z@pb#)`Wg z=id4@pDWn=GASx_<+uMiJKs<4Y{}gAqUXi`IZuA2O}?DB_tk{Y|J{B4TORz)U3xdX zwySvI?YeU>eA}+A`uuHccjaR>X%fM`Q)&&d9fga zX`4n)Kw&y>udLLil*l723_?btK2s(rrZshIb_Px1WN6^%G%M>`Q{cSf=p-%qstN`J zmJ?0#@yCvIG-Wg{;xpU9H)-*L#>pyCB_;t1j$UmBc7`?yCJb(K7#-yf2#PQ~6V+pt xaA-KNph47LF{|TCB7$%U%9XVx8gST^g_ zob9*wUU)un{k4u2m*#H2ojKviCMAjO~q5(e4H!0NML8DmOh7sEomH4m7S1X`d^X|J;?#%3uuu7Tq0+ literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/newUI/logo.gif b/posterita/posterita/web/images/newUI/logo.gif new file mode 100644 index 0000000000000000000000000000000000000000..7d7366242b4b06fcd1c6a47a5a23490c1b6d9391 GIT binary patch literal 2397 zcmdT?`#;l-AN_3m%r*_nWv*qpge6T68I`8wVX2qgG9eo%4R5znvV&)&Yrt3Ge{`oMP^iPl{~9 zOY9;m?9WNo*46?zT>a+=M~@Vr>=k=nGnx>{0NF)%VxQ6ZKsu1e~k$Yjf3 zWs9xDUz$2zR7fOTF2DH22M&j8eL}$J=WzM_#+FVFhqJi2$mVbgOG>z0ZYrD2`K`Km6w>0BQ}AVz?3o4z-%-}VjmkGy*QZftaDY+`g`P&6|A zGVA@fc^L|WR#HMQ^kaT4E@OURbXc<+3Sz&nAl++70gZ`ReQFrJn}J-1S~zS^Pv6A6 zq(oGOAV6**hBd|25t%kK4%8z`PJO zUfrMnNf=W_l)v;ZYhciOKL1EL?TPKLm2Zp$W&E6-;mqra-D=3So>XUfOH+4*9W`Z^ zczDapM-EkZG=mv2h6_`<)V%0#XDhk#+AMge!E^wPwQ=?nXl}PfZ6?_Bw8tW8Eq+R5 zV0;uh*(?scq@$B}KfFIp(=kGNw2_I_RiBO)G%+SoO&c63@m%mL;>jLa3rdF(_&V1x z0=Im87^(D#tIsme%y24cjvDJG|obmr_=~TOezt)cwg@@K{@tED_sn67oj0u zW+w#@itf05Fmrc*U0W=l0FOb^#lvyPAhCb^{0ZZM(;I$910b$uvtO)4ZLT4W6fdQv z7;?ygDOk#ALmb*BSre2syEMjWI^r0JouMv_H8hgy!bBMrjZ#46AQuRw^_j=Gh~?mJ zfRs=Y!;w%&@CGBA69vpC_Z|WukrJXG5;f3gmu@jmn}D0OEalyV;986`aa9L0&6_lUr_x< zi=Jyf@M$w*y>p2PK#7&YGWI(Nq+ofl!1$`8698r6=_P|1S`-o-+#8n?rP9BAJ0A_72y!jUg;rZJkZVH|7_!wwZ@!GXrM1i|=OU zJIUL~4MG)wWG8Nl$3Wc^p}-s%{5XSv@?>JAh<$rWFqHd*OxB{39CHt&ge{Lk?q0<< zW+{r(&VpJ+{y&&gu1-FY)~)GhVb;A{t-4y3F|e3b##Y9S@7AP7w(A}e6QLut>3MB% zh0ws$)RLFLrN@0A@=)79QKU*=W}zNgR_%^Kfs=EL6vrDaKxF5RanuDxZI z>=!*9_Wp>iH>uIy)_bye!t7sZU*tg>i^>n46=iv=CLI?rrD@k0AFbT#hrl^n-<|6n zvpXW!X01DHzb#LTo}9%JKKJETiAr~kuJhfqj*+Fe^!Dd9WySENc)SY(G!|`tiNu0x z8Us}h0_L3tBm3`~ZWnv3%yS!Bspe!xq$=G^K6Wkvx#YhRhgVnBD2kt|8ZB`-|ET9D zF;NtngGjfi#=}3yZ3_#K)jZINitP59*4FA-m|$QH48!!C^^lz+`}Wx~PzQY!70}i| zI1`b&v2I*d&8tDHFeBBwZX6_9l1&d&Qx7@^!s12~UU_^=M;HUDBgXs8{Juq~NOw-r$g>|`0}-gSh?siQEEC){lH?Af6+oV5%@ zTeqv@i`y_9Av0$o2o@ow>O@I68(Dawn^T8({rq)=1_b)~8|vEua2$V@ zUUaKqJ4XE24KB^j#%{LQZE_Gvlx4S72U}c=q53HLdlAlGzf1<6hX=pP_OAP2T}y-T zHL}~oS46v}oVsHNWI0REL#)m&cgi(G=bXkwwkVtK=tos3bU4gTz5PW}PiC%$lrru> z5@P8QfQGSXAIck0KfjP~=0E+H71i~^yh^^Z+N~^8QWqAB<@*j-~$(_X} z7d)MAuPlft3PgK-evOL1%U&fG-665Px3HzM(51ZC4Vn79*!#OkV+{w$!Ci`bXGP%f z8031F>UkRv$mc5j zWV|;DJ8@vJ*%mKCdNEG@Qw#50`SC!S7~ZD%p$Zo9qoy@|#%HFTG0gHr&<`sgGmQIMd-DoesGn(I^-b|bG?tB+}$?~ty`f-*v10^8X8ND8ufFK$IXF>Gvs^4 z3St%lI}Qt3dTM;gJk`)N0blFYOxi3?nQHG>9;|t4-c`x=@PQPTmRhy@BGccm^sC-H z-_o{qdvZ!$ke<@=Gv~re_RY^@3i=OPDL*RHr%Hm%M*2Fa@8;9(o}Vzes`)(dO9cPs z&#`TpnyrB?XSi>jr)&n7yUur2<$N~{A$(o#h7_v>s9*i?-q9DV3Rp6}bJ}6&%F7IP Rwb1C`N9xg)9tHsH{4YjB5-$J% literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/newUI/navbg.gif b/posterita/posterita/web/images/newUI/navbg.gif new file mode 100644 index 0000000000000000000000000000000000000000..7c24e5bd735144e834c979ef58451e91c282b8aa GIT binary patch literal 392 zcmZ?wbhEHbJi#E%aD;*3|NsB5-+#Yx`^nQ6A09q=`Rd)*7jM2ie*X5}lNZlke}4Y@ z-IW`+zJC3B{`|!+U%s5Uc=`0{)BE@DfA{|VzkmP!{`<#32q^w!0V~k~ksv!6SpO$9 zYdB`k%UHE8=k>k`S74$io@P%xpOPqlwJD|tlYEj z;L&5#4$;leQtgB*nDzPwF0|3tw&XxcG literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/newUI/palebluebg.gif b/posterita/posterita/web/images/newUI/palebluebg.gif new file mode 100644 index 0000000000000000000000000000000000000000..25d2fbefebc7840f45a2d1591ce60ba3ef294bda GIT binary patch literal 277 zcmV+w0qXuoNk%w1Vfg?u0HOc@>+kpH>+a9b(ca|f|Ns900000000000A^8LV00000 zEC2ui0Qmqi000BpNHPKbFv>}*y*TU5yZ>OQDU4{IXsWJkdy$PR&vb3y5{&PB@Ba=R za7Zi~M~m2T$!zw7&Zu;Xf>N*8EXAtrdZpa2csvY~&*+*t&2Cqd?zr5vp4;y^IDXHE z)cb&Je}RN!gN2A%hlz|+i;a*>kCBu_la-iHdYPO{mz|(8pP{5Gqot@Kr>U$RtF5pY zud%cfv$eQEo4LHMyS>1&zrn<|!^OzDCCSVWx6Pr?(4ErLnbp>n*x8ZW+>PGfiQ(df bBj{pDw z000000000000000A^8LV00000EC2ui0Qvwa000I5;8IbDVxDNKu59bRa4gSsZQpo4 zixgApz@TtQEE41ejA#oH6aoyBl$Dm3n30PICJXU$+Kt9 z1rh=n@JY0&(W6L{DqTtwXaoa8nM$2XwW`&tE}aU6%C)Q4uVBN99ZR;X*|TWVs$I*r zty{EO-^!g!x31m0c=MKxtGBP;zkmY^1`8BGfWwFrD_+dFvE#>(BTJr4xw7TUm@{jx zyZ{1#1DivO9!C>nqcmABZwd>cgW6N&bS;7I(vvcd-&AWGi+MjO=A5Ofu@#Dyo zD__pMx%21Hqf4Jo-8t~;*t2Wj&b_<$@5_M)2T#7d`Sa-06JIbv0)Y4MNG7S| zl1w(~=R%WT?mRxq}<(FVGiDj5%mTBghXr_7Oi4X*-=9_TFDd(JQ z5@6?@c;>0+o_zM{=bwNED(Iku7Ha6Bh$cEHdlR&&=%bKED(R$@R%+>=3uw^jrJQ!^ t>8GHE%I5+XWPrf}sHUpws;su^>Z`EED(kGY)@tjmxaO+suC;~$06T9a)oTC% literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/newUI/pricedetbgtile.gif b/posterita/posterita/web/images/newUI/pricedetbgtile.gif new file mode 100644 index 0000000000000000000000000000000000000000..b8954d01fc16885c4783ce73ff3119261021403b GIT binary patch literal 209 zcmV;?051PWNk%w1VG#f+0J8u9I&G>+dA31uu33u5P=dZxhQdsJx?zsWM0K(_X{TY5 z&OC9hU5?8C|NmW*%TS>PL#|$0Iu_3wYkrcVw5FTO9h{!dRyKJ+$ z=17!dx)gd$QAD1J9z9>N@9X*g8Q=F0@891)yzLxpP0c7IfCOv-KsF065{b06wO1cy zm-cuSaBUy*KiBcX7YeSojE85no9cSe_aE`>P79X}X>OmqtA6@=?C8p~4{KEs1T9i^ z+Fe@>e}>But-)8VB@@_4FTC3clY#ex|LHCMu)Z7CF|X)dOJ@>ggC1B}S(}%>WyD=` zYkcj+Ssee;aEx3O{kV5@>0RG+2D>;*H;tnn*`yiA*+y&?BYGrL)} zjyH-|Hnz(DNWg{E4!q!h-P)ov9cy|oWwTDvS(dnqwfC3-g&gO6j(tc(2%T;HX=9+3 z>t5MIVYS{VWsq{&r?+1|p)*}Ke{C{)gUv2hl=OIJXI)?0*v?{FOwCNi-hW!&<;`VP zOm`lv(*yXZqv)aw`I&4Zi&(fKM(>Gap9J@MR*ubmiT3%=l z+d8Y=EVskDeX_8)%RP@{Q`F@YlHCFPKce{$?0;DX|N7r207(%5l~l2Bt>{aZ+^6R~ z+*&!1Ca2|i-@dKtbOvA)Iy>A}{fw?*ouTr6Qez}v$Kw$!B$Dx>2y4d5ba;XqxpzeI z-RuE*^u&YX2|?QRxl4A{Kn~=jE{+2Gmi z-b*^!`6kS(89&z3JzW^?!y^9WuUJx`Gu>sqlO!gy#VD*6JN-ztGe$VumGub~6k_s? z#Jwf@im^Cf%d7J@tlRO%Z3eRAECMhbQrp+JR7z1irt`QzgLN%#sHxLr?rlhH(dTYb zy4?JLwbqtP9A|ZI{3gkv@P1U(48NsL!6@WzQx-f*T!d=g`Bdx?ZcL(m{T3F{gUX2!hwOD)OxJm!ly(FUgvk+j zY3%tTb>R16+OTG-aDGtUxxIb}DjQf|nWmo9QJOx@aCbyeJc+{@b}+d>AhMBanQ3(6 zTmYy^eX9{pjM;p4=o(A~)hzZvp?(lLXv_F5M~)s=dc*x(;T zndl`UR6nNgv5doTMEkpAqawcb3+J=HXmAzTM+-9%FH}Qh{REf+)yz#*(@|ZIwJ&3r zwRSybk+xiG;HF4UO3=49^RTDHH&L^)WJcQ%JYZW=R~AnkZ)xj@e$=^k``IvM#dzcn zWh8Q#(AmL$P|@`rB^cNJYb8`N-r4wyMf4$uSwh=#Cwd}&W6p?zO^-0_C@Z#nIn&GhJ9{bj= zTV{YbG73~M9ZG`c7#{w3^g*U+gf5KB6SJn$puR$$k~sjw!f0ZU8>bYxLNONsUgA`G zp4e4aYlEK`_KBzwR`NAMG5e@_=>W+j~{HAm&m75OLfqhJL2&@!){u7TR0$B?7 z3lM*RhE&OuQJ?})WQ3H$2|+gc=7(7V8Bi?drK44<<<)~hYa$t}cfP3Sk&`6mERWD3 zgD8jZ=2s|WG084J1O-2A)!$n1M?3Y9mlVyvDl$)t2Z#rmJzZ~I_tFD5LqdI!W4m$hCZj?fhp!NDl zzWTU>7>-KYgG?VnpRg>R@jPsoraR$}!qvD3>)0n2|E9Qrm(V|{b)dY}HpTUOeLgPe zghz-+PId*{d?%fSeeF?5d;j&?f5KWX>5OkV7dO0QN*`40I$#K@SG=0CW6%P^JQQ zkk1pd#X@@FGv<6#Jq@CT%Pr@_6?aXM26 zpCTpDMx9Z9xi^s2ypMW09F2$du<%gGQrHzboHh=xV81cKoMLL61!D>uyvulj7FeKL zo&t%8S%cy9eR|aj+1gDbzt@qB)N~*0w&rHhq=Vv%~6OLxS z*rxQRn)cw%3t89{h}!UVXbcAQ4OsP)o+uu$FK?1PE|{A9Xo`}yHK5-Vj!D}eXE`(r z!!S<1+Lug+OAuiQn??*+We9gnKLX)4&MHL%A~3pJ7}ISKFluz5F(A>%<#|`-=Jo#0 z-LXgs0UzxCYRoBIY|T_AK=knYC&X!mHE5S*M>lh=3pSuq*G$q8eG*5l2MF|W`tqLC z!E*}2+&H?!mtnMsD=$T*Qk*V8(hfX5yBpBsv_h2D3*EgDLgO;dcBveEI=1`(D+&wUL2 zo|V0qZ?71GWdB`O=aM7yb9)Yu?chncMsP+X6AbXQgLiXouM=5NjF2Wv#)P)SzF}e{ z+cTsa=Pqo-X(&o^hV5Lx=av3i&^|wxqC87TIqs<`eNF)Jy}*YYA%Ks!hrZDaD`@gR zyLk7;R=ZyLsk9_r5&gx3EH%?R@vl O_3y`}39BFoSo|00S^y9L literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/newUI/rightside.gif b/posterita/posterita/web/images/newUI/rightside.gif new file mode 100644 index 0000000000000000000000000000000000000000..a0e4253901c144b164064b5ed088beb1250321f1 GIT binary patch literal 90 zcmZ?wbhEHblw=TLn8?8J|NsAIPoKW|_?>})LGdRGkYr%c0TCd11}5#6{+S2Y{GZi) r;T;wtB?Sg)x|IwY=`ih-I~(@87?lK7V-q=H-q(Tdv)_{OrY( zo42oBzIO4>y_-*-J-m43+}?w`&RsnH?)}@BuU|ZTeDB`FJEzZ`xclJNqbCneoH=^y z?u}z75B>V}>&2^QPoF*BwQt+Oqx(L5eE;U{tHZ|+eE;$N^Ow&L9^GwhuKE4@_uF@G zTG|?p96z;e<)WUx_TPX0u3Ecn!J^rVmM(7ZZ2tQ7%g2u&FI>K{eb??uQzlHGIjydt za^{?w>o#thI(_2&h4Xv+J65k*_y7NYhM^1;f3h$#FgP&ifII<;69)GG4GsJ-yxP)=dtEI)V(-XUv>6d(PZBy!tE-+6FVYgxFTDTD@lNy7g>ATr>3T%_SK` zR9W}z-M9b1!9)AmL>PG0)p;3A^kjtCFJ8KQ_RenLeq5_8Td40_~t!(K95U7 z;~2{WVHw32pTA63mD&7`;ltgp|K^!|V7y@7=(4|_!?;yp;(OUn5l-c}s2c(f?UG6= zZc_{vFKQB!G*y}saOki@0T+*tKxaS;I+n&kB&;PQPIPRoOp9)_#c z_i}1BwOI#T(b&buZZL<({NR${5-v55tL+P&cdmYJQ*wigueoV`f~{r11wI*8_Mrcl zs}4O_kgLaY>`B?8hH@ z7MzwAEfFX$!z}P~Wf~*LU&asd4GU8p9)$2aBs3OCIs_y%^PdxY*uuxPy|E=&^}|87 zL%kmyt3(|>II{J)mN~M?I|R(&+GMM6pvUA|#^YX#XBCgxPi<{z?mpb8z`*1pmic6& zhuTUNBPOPv1<_1eS0)@TKNNeYiPz!A0p|A2x*HgI3_XIJ`Hff-p3Tfyw({AmoMkJU L__R5MI2fz}4?$w+2*efY})5j zyVE*nrBm^Gi>&1_y(bbToQ~)`64iYyy8BpI+o7=bL%}TvB0G=7^`DBLa5|*rK*Gc` zas4M_dr!pmoeF6^5Zrnos{43c-^s*DXCgX|M0OmB={fQI*|UTRrxGTedG-F=)D0Kn z`%fiKJRR14IJIZ@_ix|A+74&*?fLunU(&?W@e@wHe)a0m#V4Wdhf*h=3T->|;lqbx z7w^aRoQUi^di28m@87?_digTAb^qC0FPHDV8Qp!nVetiqp#v0uvVa|{10q3j!odE& zfuX6nrL|Sv%z%lht+%hqx~G3~i^G)Z430CVs58$~R%Vu-w`9>0``#ssmufDS)?Mn- zCaJMSK)_T|QegM?eUc_Ntx6I{CFFFD%g9L_kyDbn=+ZXPr2TUfnr4Iej6M zLo=7G)s_p5i#;Z5g+{Gtyu3VMv72tnf>l>nM{E@HIhqLGB!tJ+hPNJ!rI{eO5qKhN)f;i4)eCN^O23SGcy{E z#w&q&Ka=@!aq(8JkR$$Z?m@+G5%s@6Y4mtWwF|BCPGEq;Yc52QFDJ4tLMblKnjFH2 z!8roIwC=!69wej3Hl)Hgwex0J})j2Mu?^-JTpLn(he zYqEV%aU+xGo6;4O%@4}%wS7<-kkJ!};N8j-UVYVmE~MgWa+@E#`*I@NHHv)gRr?JD zFEEn}$>3gwv2JGbA?ZE-@b14-JAG5T9K&mWkNlq@%^|G%(o3rA3oxCC&?|262Vbvec zn(ab~UI`4Zc%~nm;}7QqXAAyH?FvZe-pJ$z=l!p!?dq$xn_2vu*}d0ZwK+bn{o{Ev z=poTDyk>58*6ty3V|^VIN_>p&k1rG7$`vgByB?6mL62nL>K(K<3U1d(-b%7 zpsv>?TJwwm`Rl_mA+2SuAOA;&r6--d@Q!%3Hb?}mn|@FFTku>?r+ku8pL`q>McPjM z8QsnX9m7&bCOnf4{J_A5T%Nj%iU0l^*2Aw&17$a>aA0dmo~U;~`-8>o`rOQ)vp4$L zEY-%7XhDg08+%)&Slw6`wY9}dmHO7>33?_WLP)iP`As5hq=19j zfW`TPS$|qyoYtiMXBbePf4ovMy~Eq^Vkz8vNkPc_BfNShH8|zyEb>m_gIQEaW%VpN zjIuC`i69)E#6BHpsNGvZ5U95frt68k6qbx4gl6vT~-;swyKh{%cYibWXiO}lY zX+><;Ht2-4ckE^B9Jgs=pJBin+YYE6lDbSj+K`VM*20>O)mhay580|tyb(qUI$Eq; zFgCQ|ogY8Z1rUdDrih;Li8+DJILV%|-1V6KzEah|(s?L&MCsBwzT7BN^E*sCR*pYz zHqKC;(li~rQ}?CE{Ke82u2rhd3hz)+*h+I(W!(zjrgdpWaGGngDm=@;einh|>Q?)} z8%wMG&ITve#4aBKSKqoFsV5H{IrnMpozDe}uLIYvKl(a!bd}jT9QfkX*Z0AxC)Oo* ziXN?xggoAJW;m?%)B4*#xhFQ{Pv1Y<7>$}c@j@EA@oD2j!sE=I@#OE=T@&yl4T?#` zxzCEJoC_y6rwb0o^~@k|s@G?+H|sa%@Tu%4;~~dksk_bvMs)14M*O3_x27zCzF5cD ztJ1e7eugbl``OTsjob!@e^26bRG(Q@YR0D~RZz?_b>9c(O8*C3%nDieF>6)2D_(m= za%$hU<|{+s^>Sn4`oE3}TD~{)%ZJsmI91)>ZK^$-C;i~{+52trn#rkREd#f99pG|; zp$A^)2VT40~$g~TJ0`1yx`Vpj9yN*_V`IVliO)R zUw(BOQM&uSTNhBeoB|S-?)r<@WvN_Fb>4ko=MCrX1HdnEHxGhw5wH8O{g*T!1Yv)g zb@wsImvlcN!K9VP*|E5s5xlz$z=d}mMSnqrc$5J%qmpdtUos;QW#)5kTzl!4tSDib zrOdj^@|cb;7@)lal8|V=+gKN_S8nyq1Gn>sujJTSm0RgX^IQ)b>*f?3vif#J=fagd zO>U~k^pRbr?k@L?^V93@9KDQk_pvw5EhA4K+*RG{*RWDRiM@OLVzuDv&Vd55%g_5j z7u_yUtn!kU$}Qk1;SIiVVViK~=O-h*p^#OyL|AFt+A9i&u42Y_-#>EdVqYYB6+7=y zW&ggn?>T+7co|Uzp1ar&m9F9x!YZeY-u^iL6FsdxL}vqcF$}ndH}oW)|A8+~Id%=B zMi5;lP)X^KH3C3HbUnv^n+07fv)Z%ZYO&MjAM{$ewP&?E*Y0g0eGq%_=W37p?(fjj zg3?o>qrXMBzr!ils+{-K_@ufI5`bTcZl1^Xb+->z+JCL~U{znMav!SxeDzxs4X@@q zo71n3-uYU4b2RjNN2s>(8ousVr1m$R{J$DuLv?Pg4!!0R}^$)xS(qa1g8&YO{*!@c~sdSw}71f8o5Xi=q>#gm38X^KN!6tzlRGw!; zWRXBVYrjDgXEr>|_?UdkZ-XuoH9U)HAN>s7V2tl+jN)DzTS0Fy=RF_qvvQEH(_he+ zGaF;)E`8X9POuf6$B+%d2eopeO=~YH!N6l&$4t>~=tYA4ARO15JJk9oM!a~+WJAHRVgHi(5_`w$p)(h3dnWJirRkr&{d+H{f5|GbxpVxXo!;;3 zk@=Z6GpADh`S*vla(g}Q9r{4!Ihp+WT4rTAJm2@ zd43ALgn2LNqflB!pTc8QvhlsGloJ*oBQYxZyw{7GMA7Hx42QnOtXAfn=fA#fsxd`h zD|^FY5!wRz_Vm27fs=EDS*+Fg84$Jo8?|=QLG1V$Qb*_aPRp?4;E5mMif)6G5daB( zw{~Mx*D0@mQXH7NfcH_HKf)vP?#p-Bv?{v(c3Meoi=90CTQvXYu|#aXe9rc|UB@l0 ze{kPnryMm31ACv8luLn=dw!sr!qth@-ppC+Q+DE(y-xvA+aH7XF(h2C^=8cWQiwN0 z`ra}!k+JT+puQIft9b z$!1O;@!sSIs8^8v%-M7On|(3rRlEUf@`AT=0Ha<@K9{t3y-j(Rs{Y#0nz(e|TP2mL z*Qx!i&oBB_V=DDV%X`Lhs`u8UnMT3$X0H^LY=|8+o8oNtT9xv;eLs?3Fd*eNDCLe{%58~$2r?y6KCGL}YpmHN8%f-k?Y)0Wz9F8Dzf< zN>m0FnL(#!FeMpmMMgUS(FsDZiH7GR5IiJ;PelkNh&~0Pm!~xV${h5|9FEEyaMP1g zGv$)ZF-7J$AZrq&$(pv#l0;?A8)h!fBjzPppA}ilfb11e_L^VzdQ`RonXRN|Z%MM% zifk>@938tHJ^!2?(K&{woSn3s-6J`BH*<_kbB*nC_xtCXMCSrfxjR zckwT9jV^FQ6}Zz1JVpwPVBpv~98riHid3h($A z-it20;I9)(D-0Vc4Bsq_FfEF-D|+f*^gOyK3RMK96~&Ge#cdWPm?B|z$i!+xqX;A% zg-oX*5hEI8)+RE|UoX!NRp5^*j7A|*DD+X(e|&UvHc^OZeS#gj+#g*TjlM2M)zHv& zBj|=|G{zKDa1o97$55g%R1}6z!!SoM>`hF&DYnxN+wG6-iN^9!SUwFa9KrT&V#TJ# z19ruO{>8)5#S&DplvXSsDIVJ_9^b??+To`CakJ65c@%DuhFe16(obtIo0hEDm8@MX zxfoHRK$R$IC0n$TubU-WK)enR5Anh8fZ`3&_?1AMP znUk{28CZVazT5>;?y4+1oKx;jFZYm^dnwC(fE8ElE3QE*e4!P7=n4qEB2Zcpq^t-A zR^C=tq?5GnK`TShm7(;?dqBN#Wn~1gD$>5{DWvK-P%jK!1w~iBkXA*~s}j&v+NX)h z5Mm0H2)8H3(TRytVwRGa1FX)ouP%U87ecF%=xQ{*8Y`{FDXa0o8iIXIIi#i%T0=zF z)X;0{q%{r78WOO!*}j$xsii<`spwidz4l>^;m+mSc3@qneO))Ct_NDjL)Y=?bv$?d zK4qO4SU+H2KftdWhSp2a^-_AhTv|V-tRDwz8Yb-(5N!svP*{}?3 zT(NIlgEX!~8x`nACB1P=+Nf4GYMGIA97x)=hCUG_LkwvrgS2ax-d+{S$gIiOp~+Z4 zGKp#O!RrATP3E#DOI4G3?T%3Arb7YEhhv(*-PL@I(frf#W@}aRBk_)Xr(4bjwAjY9 zfG{ogj25u0#YxrTY(_rsKz0cryT*{+Fl2WI*+WM5QjvYk-du5bb1mSFZ_FD%%o_;f zO`z;ekm^ma8RfPEBV1eZ|mF5i)9)iW+A|%X6R=$XcJr(2y7!nnA9L z(8~kpl`(W8hF-&<*U9J&DmuxG(d@t=2QVlx3@U~}XE2yD23y5wH)D1>FuMboJuyrQ zhRSC!g)(NJiYYc@4LGm{16ac`ED44sWw7K7X1Z8w+>AZxz@EOuz7oNn$FLU}>?I7_ zKS$rysBOieZ7rZ}J*G{8X`5lRZ8@;#RctNub{%lLo^VIl@{Y$O{hiGA-SYOmTkZcC z8EiUqY{=S7VmkoX4j{9`T;5^1)nR4cc>vsbD6sQzY^OE0^BA+!M&5aHtMjyZ*BNlv z*+5N~ZEP0^+hxz}0?WIcwz{0nyU&BWT>`sZnVsocTJFql4|%uOR=2xQ=L(o}Es*0I z#<^^yZ%X0>$~i$>oM5c>k<&eQ0($vj^(8@c?dZ#Ym1j--kS&REePx_jO|5Yd(q5Zth^Vu z)r&Xh6TtlPKz?N`pNQqxF!^;=LO00m270{Uird&YBb{EESI>ExL zSWbMbFaX=bXA18igxn1+e5(?!?zuW@7x%^_i{L-csP{B_ZS@x-yVLpG?=%0 zNM$n=cw^|KXeban1aTBWMVuhkFw9Ysd_$7*QUWj5NYYsn1dA83Ey-aGMq2bft?z&S zawy6|9AB&*JNiDBIbv!g$#j&K-;h?mloE@jH7se}HZONuN_y0vzo+-Lr?ALz2(?Fy z86CmZbMYsn^%n9@M|t-RdCyBZuUIZMmkCGZOt36FP}UVIvn`ehnX-eUvVkqxWxRZB zdvx4lY|?RT`o>t=C;5Ew*gwUFMK+_I9;3fJ8WkW$57dvAutwS+jVW0lwnjgww?AlE zj#t)=>3NNdKk+`l$0b_tqx zjhlAEO}n$FJ;tWJ)YCqeGgq8ut_98b#?AQQW+3dDz_FPi^~?oa_e-tWJ3+Je;$}l| zv!U$Su(8>2^=yRYT%^<7)1bNMadT0)IVgKBRy~#OqxC{O2XmTF4w_Gin}_4()7kTg zvH2|Ze2(Qpp3_1>)>Jyl;5BXm&0fHcE#TA(c*{kC(_(qhVrASSF?=#nOUvQEG`#OT literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/newUI/topmenubg.gif b/posterita/posterita/web/images/newUI/topmenubg.gif new file mode 100644 index 0000000000000000000000000000000000000000..d03b3abff9b95d1898bc3003185fed216df3bb50 GIT binary patch literal 902 zcmV;119|*MNk%w1VR8T|0K@~j*z0GrK+p0uCB1Iva+V8sHUo_nwp-LmYR~1 zmX?~Dj*^m+mX?Z+j-H;Pl9H01qN4x*|C*kjo}QkTmX?~DnyRX*000000000000000 z000000000000000A^8LV00000EC2ui0CE5+000I5ARvxpX`X1Ru59bRa4gSsZQppV z?|kq7z@VxiA_9m;V=-Ag7M@UN61kj8n^Y*(^ekz&S}C(D{+iF|w0g~MyWd{|p)j96 z<@9@lrqsHv)} ztgWuEu(7hUw6(UkxVgH!yuH4*2L~6y!@0PICJXU$+M@= zpE@519ZIyQ(W6L{DqYI7snetsqDq}gL8#ORRH;$qC zAcw7dLG$Czmotxkyt(z~%9kVGejU5_=+d)`udaQ3`0UKZt6$H)z5Dm@mSR>`E04Aht<1PpY!rIuWVsiTfxb~)ymW^S2fnp~O*W}9E4spgwx zg6SriUe;Nrmwfi==bwNED(Iku7Ha6A0VJyEqKr1`=%bKED(R$@R%+>`m}aW!rkr-_ z>8GG#>Oi8Sj;g4sjG}res;oL%s;U7v&}yoXswyj~u|_(pti1N>>#x8DE9|hu7HjOW c!%Cp+vdlK??6c5DEA6z@R%>kov>^ZhJBFR*m;e9( literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/nok.gif b/posterita/posterita/web/images/nok.gif new file mode 100644 index 0000000000000000000000000000000000000000..7e9e3cff9ec5b8f23d3ca2e87a8b7a4342ab8b47 GIT binary patch literal 1333 zcmV-51;pz~5%B=EdUn6gWyxrQ^=!_i?e>?)v|Myy{j31*@y8Y^&9Kwd3vg{__C= zl9QKYqtV#x{Pgtn3R{zJ@$vCx1OteOh}P@*M*#xN005WC?vcpuk;Lte#O(b50R9ye ze7Wgwv*(qiu+Zl9$>jFE007R@)}zkwoy_l=%)-JG!^6Y4+VjQJ-u3$an8e_e!she!^>?=D$H&LKyu6^x z@7LSibEC+At;*Wk+U4>3ZL;UR!pFqj@x%`gRfVcwa)aLN_M*@7ULhj?E-S*}^VaeI zuGQ+V005-V@V?5_%IyE?_y5q)&@)PAlEUDht+!Z`y_?qjma@fer_nK&*%GvmZn5@mt(BuQHrna|No(^vxvOq==1zwS!Bx5*lQmj<`)@vr^me0 z>3xQb{tpm*r^x>m4rO%FzL-1Yy`@c-BF`?0OG;OqCbyT7i|?rE>)-{0TBz`()5!*qO! zcy@$%e}%ln%9O|MPkW!t==$jO{_6DnrqAuv)YR|q?=&GdK2LLQTxHtm^_ZEQpv~~r z-|II*Qvd(|A^8LW00930EC2ui02lxm000R80RIV`(*Z-N6tYASX(6zo!-xO!s35mX zoV8~d2n>VdjtoSBLOxIfw8)K`d-#|MS@0{|qZA)LzW8Qg1rjR^R#@;CA^`~@6a-0$ z`LN!oWhlNNSplsIl29Q)X?P${f)pMP%M?Mi0fko?(=6a%=V#u78w;j*665fKfe{LJ zB$1J%2m%AjB;6^IWz7OTjfnn3V+4l`Ctj-{fHkh)ln_*C9a*q|n>x1thVUYV%88Q= zG72HdX9@@~2{8^FiN`1i5rF}E6$`YXkb);0dLSTFf{KJCts+#a#Q}`K3)%KO8G&Pj zDrh*mc}r6QNS0QVNNgKm{9ha+*O<5egP0YilR9Ds?B0=am? z4-R+{g#a_eFk*?h*udmJPMQGaIe2t|3lv2*!GtASI>~~Un+Pdo7q^T7!!c|W_mGPo zAQJ%#v6$dM1y?w8%pepHqryJ++&KX#HvVBlA|N0#i#c_00*^GOpdpw*+Poq}C*ZhX r3jlmX)5kgkl#z}iG;Au66#zIAq6s#uxFSpdaM(cu7-V4PP(T1Xb)Mk~ literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/ok.gif b/posterita/posterita/web/images/ok.gif new file mode 100644 index 0000000000000000000000000000000000000000..34da1773649447a12a1e52e54b843a4af0c8f989 GIT binary patch literal 1286 zcmV+h1^N0%Nk%w1VHf}y0Qdg@ak1Kxl9E1RM)mde!otFnl$g}<|K0x9OK(Qc)$*p%@Q}dY{r~^K-}NzODKvH`$>a8kq_$OqPA+35n3h6Od+GH3=k@>b@$r|)?r*T#%;fjS;`cCRC!EXgj>PRYYBA;W|K<4L;qdz1?fI3Z zu-okUyW8|NW-c;iFEL;%zs1V#?(YBp|LF7l`}_O7-1KR%-PGv#va+&ouGsVQ^VHPT zJY<2Pth4X$?=s64Y^m1l`~Sb)^oqadhrjHd+K)VSGGU_7_Wb|G;r4&5$@2RD_5bs} z;rwK&)ir83!{GS){{NZG?@xQ5d8WsSpPJ|S`1_l~lOYpBp)dR)Zf_44`sn8e_svA?a>q`cnr zM2y5tkj6-y-GrybC}tkS-}ZyxZcJ^5;qUv_>-|M!Q$>(l7?((eCLm&VuW_b^*DC$0}Pxg5XS z@OGh%?f?JM=lEQAi%x-T<=M*yjJ?Z`@XFtkr0cZ^Gg8!{GL%&hUu9>tKRg#QM7Y z|N2acK$Yu&Y2Z-m{p7sF%Ad{fe2$&I-0_UF(T=^_T4Z5;hKx~)uR*CSt<&;BZ9lEX z(<@G4>h}NK@7Haw+Oy}Vma@gN@1%sj>wTqmFjzoUrA9Ppk1cH^!_(l3w}M8}DoxQc zS z#p1`~`v3p`A^8LW00930EC2ui02lxm000R80RIWhw1o<-3W0pZ*d(x_!-xNfD1mU# zLl`*0a-jj|YyiZEL_R?1ab#W@BSt0}cvHd2$A%%fbfNL-2ah9vAk-V?!{f`4CnD6) zv*ZV(BMNH3;O8UWPj6oqSb0Zd$p{{o{0uVEAqtX@M7-5&upmhy8mUI$i(ux2ky&Yc zIt+`#0of$PD5UC9LxnI26LcN>I(LSGXLeHn$(tb7m~$&ufItuf2 zhkb`60sDWX}x~03-$y+`N(?LfJBS8(b`q zv>s%WT|$iW%K_o@0IPohJRbvyWFVFf zJ^&N|I^e&Yfag;Hfs~btg*CwH`#%rLGXf9_K>0s6)c?oO{@ea%Iw}gvzv#d9-+}+r z&GUBv5jG$lkdB5z1VAN1K_fzW?gw=JEBoJN|8DHlq5*qAuz7`SMtFa9}E(Er8$ zR|Eh+ML|Qy!obAF!6p2^_WvqDM@Pkc@$Uo*DjGTlCV+?-iyr$GH-i)jDUK!&oWqkQ4no`!5R%9UT`N6YalJiBJLbXz1L;7?@I6e>6Y2F}%Y5 zl2q7RH^oD;c`lti&B&WVN@n4%!~dH34UX1FZ4Z!c{S5GV8GwiOuY4jjB7g+oX0wF; z|5Gp|D&D8uy?vFri}bGglxFmGfPb)^wb<=i(IR=RUgprB@H?qELA%){nPn8U+AQr6 z(M5u4f?OcXn3vb`2>$7NG$&nr?Z;udKXi#Q{ecpX>{k*`cD^k~E%);^f0Ld8U+zB7 zNn|2up8;RWAX`9NrYS`9IQ^ETdO0 zL`b!30V#j&9|jlKZ$-=|9|)fTa^kROz?GBV4dd1JScbb79OIj}yvv?|ayKt$3g3xZ z?^sohNl-sSg@c@8x`_)PX8ng6$ouHB61b_cl`CaHRx_4yskpV{YXCuwRe_sFJn=Ii z_+Em<;u%nE2Ey4~6p3KXKemsx{ZfH_qS0mfrXR-JDb3KswD&5O!&)+fdBBjA{$;2( zgzg;iozc7?pVFmrFU!A&@qT%n<|Z&y!}r6rmh}_b3hOffobU_?vb!0SaypJhC7-LP zcjRH&S~j0Z-u6(EKIa}pHKF1a4)MOD9=x~n$r-zPx@iz!uw2?u$O$0#t-^VdS}|)c zl5e>l`@_t8r?!9Cm=vh8fPwp^t=Q`GGk|y;^eyg4K{u`!#cL5NLLhJHa+@{w3*cO1 zdlod&g{R`neXYMF^2wQ=|1s@V6i|7RS@Il6XYh$S#=BgzL~$4L z*kSPJ*B^%;y%)c1yYN5RI^vYo*yWx+(!8gM6$4oVjyZ!QLZ2p+WHuy>I4U__4_ZY)TpXW6LQAd}NK39m2{)^Q*y$19L(`cd7}pJD7n^#7mbKU25i>-r zIs96OV~K{>sbh#n>gE2K>9E(s1eJ}!L1}p|vCjBR3w&b1d8y34J*;WqT6TEQmP<&= zjb0x>F2$xmtfD|P@10TRqCwS($e`@-KjAb|M0l0u=eoHsbCmVz7PG!rs`L1EnBc%u z2lpIHVKm*ni@f$;j5S+QgVpUK4cqyLVKA2JC8Pu@h4)bX;(_)x3w>#F{ifhP=o!@vYWu=a8_J8{%O;vG@+h~{ z%6?R49%s6FEw{LQN9u|;R`L5y$PEpQmZX(+^He>e;*mDNPh^!CGWao|)pGvqcsz#{ zJVs4g?-x34nZXgjSQM-Kkx8Ufg)9P7tLH7ttqMt7Af#;cErEB$w{% z&!9fE%x~Prma%)~JdixOi{EEm%*(mEMJHNoGh^_(*b+)tL^9j!X;-ER68&HBdvd8^ z9huAQz?CkhZw4ZUIST~HiZMTt@(Sm4{|4LHY52`=Idj!Z=F*vb|wwZU`%+q4Hd2G2D1&61IS-O`y!Z5tRz%37L4C^M48oL z3;M-=nQzb2XXUIdi)?8=gXIiYr%kk4f*}@S(_QHvSN7ae?x>%|VU#Z(kH(Iq) ztH3*7I@7^WQuaeK&N!gP^tUfXUiWocN>_VBol|b_bjxso!r4{xp|Byss)Yq?I-n<- zei)5_tPMe+VTFdRhL}ppq#Fr+EjaB+^*`*G4!%x(&R5{b1OV!bh|pAx-PTY7>~I-$ z?S@;F!_Z43Z{v#|-~DT^GoEVR3?m(nywSLl4RBrIR<08N0srP{$)7*Fl?ctHdV$rw zXF&5%v5CB6AG=@1QtVJwPnVOM?&6>nDD;=C7nt2TzWvT=axw542b_FM+zK3yVY>k4 zdcQa|Jw9Ph!)Au;7gvy z0(ZGpQqs2u4}VKK2iobJZ68!CLNyy(dMf1x%X92TL%A=`1;1>(U84Pn420DjQ7Ws? z-pCft+~5!7uo)u&=f8Db<+VO$ZFA8GQpw|eQaZ4B0dydd#CXBHj~&Z`jd|1v{vg+p z-w(Y@5Ux|o!&;pw9~F9WKi;-XYMWWrn>j?lrp9cETE~3%BgW)7Ur8R%uEXX=HmXfxwE^I zcPq$mubI(@^WE$ugRA^R9vcZ%ZAUu<@W53A9)&IDf+}1FL`!@-}2U!#A#lcx$bk%GazUC+RaS* zesZVAoty#Tu0)zvjV>dbn1sVx5c%@$$g*x`L{RK7b;Q!R%C6_QXd;HS;UY>8#X~`t7JGsg2!Hi9C>`Kqbzl9BIS6DDq?R}r7 zbI2+o$gkW>Wg{!g;m3cvvn-<3U3S7U-@0&G2_i+&ScdQlNhbmvjE(*22d2@Zh)TSM zfB_%xf~S%E_;;&<@;l67W%@de&>us3?Tr^K*$@nYwlkP%6Q)*~s-8x`z4d>G7r2K+dzm^CJe zNc`|M(^Ax^J>9qFKF&}F!K#4}i0r)BO|#cepMS@RF2P9aIMnev{nl9}lJo5;R`Q*Z zRju#uytQpHSV|v%$X{2cBmQqq9G=aljZcTlLpv8QSY<6?*&>`e*M(P4SEKdBj>PC6SvHFJ@?R56Lvx7%RZC{Oe^af)R}E#n0Gj92CD=keQ^JU8tJ+>3CGy~-qZ z`{M*u6_t8YS40OZ$7a23iwdP!a8J{0+1EUAHS*y2V2)Z(Zx&Vucedj6O~#@^HCK*e;_m(2_Lf%RQ1|SlTtS<~Rw{eNM4V@b zJO_3UiJyd?H-0IitVMTeMY9%0bQYDco*nV`|7!cI?IM$q|J3s?*XO|2RjB7vJ3Ri2 z6}+|jj3*~peS}yRIk#_W5CKsK?~rT4t)~cQcCf%h6#Z~RI zzotbG)X|8)reG&F4~;C;aP{TI*}bJ{xXub>dAP0(B?k$Qz9X&&s4tzxC0pgfX4rko zN869u+o8Wx2c_-;UYc8Ekh33@eKssYxHW68E*m1OJ--AFm=8Z#$tfmLb7zl+GG_li z6%*-(wod;N)%Qb%u(AYm{7F2D;r(Je@BcJ)7uJ@JduSHVK2Ta7U*zYc5RiXD_*nEsuGrw6fi};e zamW(JvP_h|iJ`z2oSal0l`@M-60vs~=H73q2yP8Q4dnvT6Vu}*%ae~vn2~_(Q%_^y z4%+4VJSkKQt^B%he!`&s%a`Jv}`#UdjeF(POo$vjZ;j&&|yVateZgL&&9{` z`LkIn$!Iq;@=w*R%kwwRJmuPp3*>&SWBc((Wk(`jF{C%?!Hpr|)pW|qaxNN_e40Z7 zJg;6>bRTS+R(W-H!Cd?)g`tiT4E;S)RmU9y5=u$y6~~Zw5am*I@94DTge$H5mphSJ z);l8#fXf^sz3$~@*zA(s-7^3dAX+XWzGOdM7|$~nqUx3kKJ~vi0()$K!jFTrayB-{ z$*mnP*e1EFuOdu}vdZqGIZ=LeuF-CC-ZLpi-!FIlj69&QHf8#SLSKJ>Y1w;zSg=6XX9^(ekVbw1UYmP)U{ z>D$(fC53c~iVAdkttmyUrxEwORtF-|=`efuRd(gZ22xce4v40c<0vQe(5BAe#enD% zhP)LMT8!pYty<3G%v}$>E1=I8OL+gZ@??yQ318z~I#P}mWZMCvthSz9Hxmmvu<6vA z(f##PS6ql>_&iZ5v7g!zpVsdMK5l$OKuN%99MipdTj(yAJqJV(gJ$-d&x_2pjP(wm zI;e-X!zJE6McS>okzri9n`&8#J;=eCWlhV?;X4~?TND_ILz;j%TjAwFj)p8nubxtS zEOa@}UKe#{1*&mU0PXo zbh3?>u2!eEB?I}ze%tyLQFf!fJ}maV=^DSef%L~8rb7p3c_|X)>CYBx9xFzMmMt9~ zg{|)J?@mrK+@w~t3%j<9_2+mCExNzES5=zIwMOQj0bT^elMhQ_-27#;Dltrhl0di4 z(BEZqzo`eie5~8-4u_0kQl|v>)on#~-6#9gi1xBFH+T6MHY@bDfgSz{_s(A;B24q+ zyXKOciHkYWP^VzpywrE%rc#T4@8Tfs0!@_2EKRH{+6$s~2&dO5j5%zs&?7doy#-wv zCA;v3P8yenn|Ae(rl6FA-)oyB`Qyz{;^J%8*XB7{Hpz#zaks3Hl+VAMDJ|R7Y}PUz zSEzR(RzdrJ&M^7QYW%cX4iCf=R+-^s0>iGa9^I3VB}aDwxZ@$5H78T5OfKy--5L+I zikjM4Cd=4c?Fg`G?abAltB&Xx9;k`uM49oAZ4wB@1uF*MNn9svy&2+fbt@>82FKY* z9R^gqI#$sYl{!kVw7)Z1I96X>Qf*IV z;RoaD5Q=O&6B&0b>7-gM)*CKCNfJ!TzoLq?YCyE3vQF}s72=qvDU1m!!gv`JoqPgRCe4Ui?JzYULG6wsw-77Py4kbUzpvv6!mz8C1nJt&d~ zo9IwqaQv~FaozOPJtKy*1|KqFQnh)PXteqS?jU^{wu#S%uj?k!*pQW1#Dz?t{~Asj zZC+PQlNQo0@1PwbP0>T?&!Xo|WFiIJ(5L#^><9j?^Zu#7{g_}`>R`|ooy|TkCI(>& z@ZwK2vIQHJW;cVSOU@yN(R%4@_7yB_tcMiXfuAVO-+i)72IBVjL1jPvPvMCHGi5G8 zztk()%-EMgk?Qp9tp?<>gLZ3t@!Uq@VD5{9<1dP3&pt^>o+y-H;_ve8dZr8Pa}eK! z7MH3UGNH+8jkZZQJ)! z5qm_td>Z8Y446(xT`Tjg(WaEuJd&@OBN7accg{Y_vi$TwPD^DiaX52&g^6d|8ldsS zTlr6ZX?r|+1}KT%tUn4J#+vbtx!Lr#Blo#u^X|?0e=f8JP%Pw#P5W7q#<)0e`V_~* zg{7YX*x4GT@yBa#E{einb_{9!QZW>tz22J9KeI)HkWFG|p+gA` z!5v0t_z}4{aRT$BLx=}eAVcZMkbr%l!dD-UR!K#7oH=Ug*`U$V+v3CEIf!TO>e7pZ zT)mb%_ml6hj)}O8#1syq03LJHy2Mf=v8yg$9vn}42zvx1Skd!$EIM3icT7H>BEPX} zKMX#ah@HO$XE!JbpC0FpUaO>${0#x7eNN4y_h2*A5H{##gxys)Gp6?Z>8tt1jknLR zVmU5AK!9*+6ZfJhPjLhudVYC=-nGh7R)G6$tS1nNCBwoYJkyl#UP&Pw+JWa+du5kB zHg~U}@JEM*pd~#j500^#*M2rw;Rws&k|r?|HVwU|?g5fZt(l0pB9o!DoZ}(OYPUAW zlO~h(()|{E+P+++YWcd71|d5-RxmO1hY?`tP;DD`8zdm=;LP8HU9RHn972g;XCvd6 zY!x`J(7(yHX!iXy#J-nCRVao3QNmNbgqqj<(2-{HZ-$vIw~^DFvSOOvb&HwKN{#M; zL&a{hs)3$%yzZDAx8?|yq9(oVH#w8mizPo@L|se$6pP`m(|2=MCwV>_KabYNH1rWD zv#tr0&rGPrxwN${tHQw|OqHQ}?4Y|km*OW0RPTZ%dZLVCw-HTm+{eK%xHVX_;y^cM zZmnkERHAax_XeZE*q*rfLePljMcC5mRSl=;)hR2NZdG7-dsJTTs+DIFS}{qI5--}% z`rOxvNbcZx`T| z7}b%Qa#Tu83h}dlNJ%Mme%OShj$5Yr*DwrK5;W;O6Bu{$&sN2d)-Lz)a5V0}@R2|Df(^L6!M+Us{ggyt2nGdH2ruvR+_4?D`zkUgW3wGWok%o) zGJFBTREgUpC{Dim#i)~C9W0PqL@8qF(wq`Cc72lh-*sz7^{jXfaEDnfIFErbzm6A+ z=lyO~P%D?V8zrisl?8xG;k<3#U|jA!?WhzXh?{ z@jPzmz0k!Uh?dUQ+?|Nu(1h+AR)zv|;GZlELlj*1tZ@u-Wo4D#pLU#*&g4GtpDM_( zterXNWJCqL>JTtVVvOPm+~VVrOzgJ|bs#wka1RmT`I1Ph2a zkn}~~01ZEUO-iCq%iaLbTnDeeSolvbftZQqPOMZ=y>K{_fU{#=R^S}2aX6lazY`r1 z;US97dEI4YHBUONuGnjq!a)yTR86Y_x{q7L40b5e2Qo}aOTh+0GDLdjP|p!7mz^txw*GE7B3BSqUhcK>1ihMl5za^7;0l7p&3+K4%v%!I_ zH_j8Okawdbt62rZS7#E6aS09tZ}I8>6BHYxFubKx>v}%L$JJzo{xHCK=UfMg(~@S% zpEc1uQ?Iv^AJNkZ4A6koiine;SABJi-9-`B+!YZhrJR3Yi;nsYEIW)zwA&Lg?&!3X zuiOSS-EQ8!I?JDlm8u@gY$V2EK_51IA&0MlsiXZ!{893)XwxtDKkFX7xjj&LH6h@E z-ZEKMR6ECKskPyla&Y%;LeO?PR;Q8@gQ{*g%#47?v>;w`gUFvt51^6E{S#(SM5J7C zs^`L93vl@>m=9a`cZ)pttYy1Am>@W|J^}Vm&*U6BeE~So_ky96=+v z$H?D&Y3bhKuFco9oV~iEG_gUewRsIh|El@D(G_fNVUm|Fq*2Lswih#4aPG_|DC!+B z`xW`M|MBH&9o341ZYmoiS{EY2BFx}heSc?o@0jpy#wVW2dYI&z&Z{~gSTey;6E{TH zT6oAmq>M=ec+Wu7gOD-+D8A?!Kc*&%b$8$TjJe&L_U&ay{7U#xQ0aGT1i&N{7%}TA z_W1Qnc8Sz2Qx~pCEoH=ZTa@~gsbI!t@+-au*=t+@U|b7YdW|e$5*>;R9TihBBc2on zDR%Ov?IT0Ek}rH7Ti|!AV6v2JVFLrT9sLT|LJiBVp;Aji=1fw4fW?XBw8r6@L_c0GwD5tdskU4le#AtTBU z*0f%n?@?Y8;$|w==*OtZ&=RzkMa|A0&NbPW9PZGaG3U3I4X?VZ2R<`gNzmj@6`lF8 zRGaSIkNjGToegxaso@5TtXtm1>bx4E?Xzw+%JywHC=IPEt<2s5xfI8w539(8qZ3uL zcP>tBb{%^e=-JO29xmX->o#dzvvQz(t_l#in)84h%uGKWTyv{)ifuzdrDgk1=I9hn zY?w_G7`%MkE&Mc6#%(}pnV5TPB>yv@;vIGFzMzXL585ZsFye)bFqh?Dn`85=M0S9R4Y5$fjt z;r!++^~d@6scFH}+@iaxo$GfOc?b2SH@keh0vX3jAbZg0FN#ADO2H1BWWia3#+wyd zep)r7q;5pgwbLSoE~SFtB6UyB;Qf)a{Ljw^aM%QTBmfa;`9~zF<7+D=EoC5(8hKd} z`zcn2?5~E$R=!t1TCX=Sr6W%=b8eVc`X$rl_K`rpk^<>aOHahs2e-(Nz%R(O$fUOL zM0e4MYr`UOKNxOd-unW=m-!;cimkY+s{!KdB!3F6-=h-a640UNy&<~z!SSw40R~#8 z`kdc_Ycl&`g>|gE^ZWXU#L!@$yIj@EmM}ynTi4C!I)*qr@jnqAm86|9;*P}>w614! z5zMs?oh94}X~3iG)8)OVy?6)W{ym zyb3Q3yc^Vz_SD!|JHo`o(2ZzJgG?sH8@Ii_{G9^l17 zz;+gMWpNflqk5T~a@O{;EvP_2Nn8UqtkUb*G z^M0Ulg)iQ)kqs}N;7x&8r`YIQDqE<8V$N6!-1!($+J3|GE@#gG+#F9vVj^{@4;G7# zB(%-UPhdUD5R=HcetDiPDEB}1E>?UNQ!QJf;Wz&RVwSTBjd263FB?uuA)hAvO0 z%1cM30+Q@_rY7{+Z`j(|;A2q*DyqS_i%s`cXDqrY-0(Ac<64>VJ(svzGoQ@K{0w<+IYaW$bKUjGN zB+M|CQoLq~2^SNGM>B?@IyE>S3`E!AGFr=8n>wQs^`9?>{}$AJVoEO~LTD@YSDd1N zM4!;HF%hSDVCirSZ>JVDqm%A_>`b}DAkV(G57nJo z2&dKz&@wRIFAQJjatx5YzTraj+eWD=#+!D6JtP`x9) zF{Kt`W2h+WMvT9;Cm5Mfo)?J(t#crmI}Yog0m`kj*Ezz@wTOA0{q9obYBeaQwOms{ z`gGZOcBvMcfl{27nqG+WHCf~94qblh-Y(tizSjHnftW?7#Z!Ke`Jlb;QMH|um*Hne zWQDKsS)J98o%3uXw-zjIpLH*(_m)t|627PGF z7#pC@;-(muz`yP;e0OHlw({*_&B(2K79 zsTO>TAC{IQ_jXx*Rj*q?DMnk>-Mmy$;`_O*&E#EITb9&E&@gTu3G!aGklmi}^|DYR zxshc%z9s0%7OcdI&#P9XlG@!R`O?+FgWyMW?p}T!O@xbTfOrkn7}5(T8l81G@|wyV0V1eap@3bf3w$itGZXuk$zp&w6khE-?~QX9%Vn{ z5WxSVzNmf&;o z$jHA+Joz-7EMbGVBY{0ZiK`(4!dwngE}0wXZcaSDF{&an#sQHxee-yCtHM<})Gdj- z3bUlH-M@#RR;3rCV!3x z@hTggR@cLgc{QhFv zHDwOPx^Jg*q50^N)2Ta!3rvO2W)d4^(y}zSn7u4I`L^dUMSkf{?r=setfj(<6X8)# z(LNaO3|mDktx~{ACYt2L&dSxg=ywCw>PVr*9-*J#+MA}2T0>7bdw)yRk4XS3`kReA zSn;H`2tQK-u+QO}|M;T6PbvVf2q7H*$8iw9#5+6z zT(a}ao=4&C_aRB#Glj9zJ4P-I8uP2pX`b^4>*jRu@=+W_hOhY!*D&aC45Y0sI7C7; zKw{O=wun-<(~8Lto+%pAt=d?2LQhr#V6uHik3s6{8HUYqil~=rHLcnoxO zIOxxZ7;kL{pQVmFoYjgw0|vOet0o`6)FX<&E{xN}pUK-D$L78*rXETkpjPE98=BR> zVryCubr&g-we6g((4MVwOdVm~lKRDu|LEXSy0Ea%`_Lo#L7-zcV53?8cJm-wFi-c*VRNAKxz@J{)7%zZoDi-ef;Qlprwh9?D9$zcF zzED`4Aw1@m@2G+}kccHJ=T&c{$dcc<&xwkUDm;D1XyFY>{j6$)1@hcIzDQYYx-8zh zs)mKpGix*Sl>T2g*uFf+ikMsVi%tyOn$6!$M8b;IDIA^6-IEDy-|Ew*P;bvmh&gdJ z`4LE6_##Vt-Zq<{SrI?wQoA%v)e@{Tuws~w^wZvo05DgKWE?3 zPp5;QD%EX`b^oT}kO;qb02d~pZ__q~wE>WHVR`wZi zcHl{@Z~J~|gHTi!NPbYCZewH|L)rilD49FBK}(sNI)bh(`1|Wj!CyHnkG3=|5YB28 zRkQBzsdR5$&)X7(V3XS*+PCTViUl>1-sRhBog#i)38PZOTc~tE3@nsLf=PVUX;WHr8N3)i1;sF5OAu93W2%HGDR-|<@A&uW^o4Pt-*!rn%-4IrvV(`7PV%En22R+OZ+sz^o zET$`vus_=ae1v<^-jTOxkg7|Zq4m>&uys&cDdEq6kIfwzy_wWzA$&%*lz@3YrT?6U zppa%5+d<(6X(dW$9hxMB2=I;$s2$bf3EVyUI11iHHC_)$Kx3BOwgN4C;Czr18aLVF z^}5?2xR8J~mg!y8;cDKrrwTi__j3>vztVci-G?^;`(FEoU0+opw_Y;6#0}DVQsZW#Clxkkp zhiLw*x--aJXpw{PXdL6tssn1C9-797Xs;T&rW%Gqxfy7kx}imrM4Oqng$c|oRxvVg z-L%ETvShys6^zwnbl)R57&1L&{n94>gXJ?I;zNJq=+xl9Q8k5Rk`@2E?=zgVjDMU z+A{U6dhIK^z}EGZT`zB9<6nF8z8|KDI&9K1JVo`Kl~7$@v~9QIqNuSY1s8g~=qI|G zKL-G76EcCxI@=`L>*Djr&Yg#T7(GxI$ZMLRpB^2i@8VbNl7%W+x5GmYd^?q?++~Fo z@{9*q+ZG(OQ&}_nqj+z_dx;o{O6s7sRaojT%UROT zrFHH`tAo}aT(W2*wl$??r3GQT&{o}5dn>!ma9&1YFEcCVV|W^+zzK4D zgAL<~VPUTmIjI0(zIiKqz}maU$Au=qbL%gMs>S$bvZj0SS`Q4#cmFvfmPGm!*mrls z(#9!U!FD9JHN(#juNN^v1{>S6g7Jy6fp%cV$Ta7-&NBEWqotoc4?;l&>19~KAn}>` zuJURNtm}LP$4lPt!YMTu@v{*ur+&@k>L5sIhq^nw!}v4`FAb8YyJr1`b8cavSnE=o zoWi8}9@~_;nsbvO*Rs6fP5D1ncj|pSf)^Q4>L}E>3h_FA0pT*WeXnd6FA}CCZ^Fp| zB1z9;FDy)+QTNOu^w*hIdF%ZN$?94LCgIz%NI^j#cS1ux!1zJbz4VkWWTrx^`otH_ z5JqQ1K02s*=ReWm%Z4L=jHgUa|Er6G%K^M`?##dUzJ5$%Ne;ySFM*C4<44#VrQ>fg z4ZJKCnrTZTrW_Rte`ivTC+eO7EGCgrsX8R=L*?p02GL|Ifg!%dD@)aCK}%v1b|V** zaRKnX03Wyk21draR)d52bc9~kVzsvtrGUDLqCD}B8qkZnFzGsTe@L#fwUZP0cpa=8 zTj{#TKY1=x?c?~xk78pX5eUbSi7gH|4$`4Q?sTs@&oB9f?~W;!%2l(ms;!k88A8f6 z)6)*81B|?c`g=Iv@?m|OkOx?}m(?0M3M{kpr!Ps_HX7P(v>0-xkFs$7Ba|2v*wB4D zy90~(yzulatT)sAAPrFz_>xjC8()sxSHn?G?D%^Yc{bV-n^UE46#XGk8g_1R#l!LbEpN5x#&MR>ckvz)*{wo*5^{Qc}*6v zbR4TCCDv)F(>?o}d{FV^Omb7qI&z8kA)?atc&v#_e^NCdhk8i!Oz}0pqJfcXdAuS` z1*K!S!c$-0KF$StHulH$nU_OE^okClDdjY?iiDOX$g!s746Fl!@?&-r>g=((yfdrT zT^|c5EF8Wnyp&0m~ykWq=#IR23K{JoZ1$M5PHk~KdJ((-bKGaaIp6dBD zu1-yB6SzURrSYp*ZZSdm8Q>~!sr1>>$Xd=thQ~F@XwH6Gv1IeM05y+bB_RQwS60z; zXgxviO__Ni!3WO+uKiKJ)Al9B^$%3~Dmt1|>IVtdAAKDd`lzW|e|)-TwIO>0{rh8f z_Lbv``|r~ak8Fy&CIc*U-CPAl^acsU68wy4N`8xYvPmHC=H1bO4UDVCI= zVU=s?Sn{ux^FDggB;8#%&RWG(w;juaBXpe|=jc9V_1(Y}xK&1Xp*Nvx$06t-TAEJrfE8WM$OXTpBjewhHC<6-G4IxAa??o& zUt(%;?=qe~15jEPjw-W4y!xf9X4pJ$fztAeF6#Co%$JBpzO1QZqmz&vvbNt7bGdc= zva;ckovG>lrLbmB41NyIe%k0aOPM}Q{y13ZL*?!01T#xlq-G)X+f0~LV;5)g?tlF- z({CeoyhD%go5~p``d1wg+|}E3wX&iDIsN=ZQ`)lzr>UAsn>K~-c^~o=SDTDaR03&3 zSWt<5pGuH^BIl8JV+IFuj5JcJk&q|(j|8CDSP@{nbJq!FuDDeEcd%7-`l0hxQ_@OV zvf>y;R?M8>yLK~N4FB%~maW8i2^iF7M19yoB~4|fbPEcxRA}KZ-s3I1ijx7Ph{(5* zKegY3MT;V^dwD7Y#BCk&sfU^KU!5qI{-_wziBB=GclM4vaySv_=8_E0)3=Bl7C|k* z*(-xWtFh3AP(q@Bt=_#8@~>0593qp@S%4(;Qf~^;Lzrb#nJWr>RDm9o^S&PLt)j9sVHxu5DiW13XTn(sNr$NOv3gd3$>0}6!Waj|rH zsUJtpgz97bwSMm9fbt<<0NB{ZC6QdSC=LmsDCE_}OTb&{#S#5H%RLrs`nqEBk z8Q>Jy{nM?=ySBlWYn%>RMXC!N#Ses`ZPD`etUDoukgp z(W{i2>9)7$D=g3@C6kqzzP`cM2npi}39GBF*4NqVnVPY&wD+{M`4$$rxxMV{?&ybz z>gw!sb9TkV$;k)^`NG1{(beMOCn&9_NS-x{r&9Wpw;`Rp4T{53VPvAFS^oa$?Ay}Z8uD=X}wqTsKx z^6~QgOicd%{;jRB`kkGHg^BBObG^XC@WsaM^7QJ{)z;YDwY9pSprzNMr1UE*{30UK z)!FXw@~apb>dnrIijM97|N80auCBDp6cgx3NcHyi{5w0^+T8YCT;AT{s|X3Otgz(e z=<*^Wsj0Bo*xZ7GhTGfT$dK+ui6+PVx*4 z>0x5yf`Y>f>Nxs-mUo`1;k_-o;5ux0RW@y1eG2rSp)G)!yRX=jz+g(Cz5y+1}#S)YsqN z;@ZB!<>u+``~Azv%jxy^<@5HgrKz^KzVY(&y1KvD*4f6!%jMg|-5pX21_ z-QMBe-Qf0CR=d2udwPDcwY}`V!0Pbw-QVNd+1$&_&gVZrv$MMR`1h=UVg` z%+bZl&*w!&v$MA8>Few4?#Rc?{QUgt>Ff8&$($e}>LDQdFE8;ZCw+yB{3s~PtgqqK z*t)p8;o9BXet^^0+lPpYkcW%Fzr@qi*X!%;+1uZxj+FTK`1knt`$k5ouCwZrle`ZP z^z`(~%FoQu*38V%x4XgVu(9H(s_Lhxyu84?yTI$u(CF*#sHm*dnVj_Z_`|}-=y7u5 zcX{V}eE_E6Obx zO0?*La%Cm}nK{tU4+KA6yoiF1N3}0suFl!|#oC-BN2qzFMwZ$U2iG24`NQ;|9~W?= zR^<`p1riKkcSMi!v+ukCqAZ80uTSzyiw7dAeFj1*dVC}=7nV(JakFh z-u(awB?O2U0dXjd!AA_}{R0gN3IxCr6+56KUp3fZU|$p%43eESZuIs^1p*HE0UQM; zkPaFdq!`XV1voem6>RJ0q6ZIsb;y|u5-6dBfCQ2_Mi;%{!$%_}4Zz0)YzagK z67w|y1{fGL5e1bPSfh&@I1bWBAL0>+!kA+i01q)}&|yFq3E0vI8te%4i34=j=|CDE zq@gFC#OX=gI)IM34jhC|gGK@LxPqoJY9`>rJ4XC-1`(nFBFd$gwgS$kjqnl4r}s!IP}2(vPTk(c7X;WOhH2m8oj`Cg(1qg<4zc1c%umbUTnYu z5ulLcO&B34kc50Rw=bBEk@+5FRtKnq8 z1vCCKB?CPkED{0*b+m!Y5JMDV!zA$_<3td(%pyl2rr>f1#y6-SOTMmf5%NqjEGAAJ zc_eIt2rftS3mF6;qr)#8STf5jBIH621>*GVK{&ez{jVyeltRuMrYuZCGtG>X#VBeB z@`o6IIMa;PL*x=nEYUvyQ*8#N{JTggvE+e^DI&}w00#j$;z%llEHQ&4jsL-c0I0xQ zN7wKC3`;Ekst`*sl;mPcA(n8U!7;}?jtl`ah|xIZ&DbEq8|3hP!!sT*F|S=a)doI{GmbPhzMZA5c1Nif(P{c-q9U5ypiw_B-mid>aEY<%QAu_ zA_?WQ*IvjQZIp6D=MZ?$kqqKc-101zh=v9n2Zb3dVF~sa0U2fx01Zr!12!lGE-n@V zVaOtX|Dr%4)P@QHAVPV6m_ZO45Dzo(Ll9ZW!UqH33`>x}6nEG{-!Le$7LcG2B$$N_ znlU}rrD6la2mmDiMllRzKq3p%8;8WS#xoT_0CXY?h7EFPgT*oK7?04w2r7_@5Ncrr z{1}BKX0VD$oFEhc(8LWC@C*o0;9qSJfDSFOxN$h*7^zUlFc2XIF=W9EIuOJ#;^B*U zRKgSTIK>viU_pAkQDkjs1}ZE;M-Gfb1CJQR2%KPsEa<=&6?h#r8gPULMD7xTxC9IE zaKT5;+zqX9k0L_{N6 zI~&+c1e&8j7~YW$2pHlD8E~aX?jV9!XkZ+fV89Z{AP9eCf|iy@-V~2_3tZ$O7AnBX2A|es80|<*uXNHaSuz_AQ~#DhYfB)0t-L@7;U)2LPF3E59G^Z zP<*8g){sR(_<{iqAOkA^IE!)kfESdofgA>a4-v$I5{>YIICz(@JrEpRACBt?Sc=+Yord?!2on9aFhNa z1t}Q8919jh^=vi-T;!r`AxK66JaANpBmp05!pF9lA^>4@f*C;WtOepQg(*zn$oNRI z0dU-fCi~#Ye0YGAAHau0aG)*F7{XDvk%4V=;>%wCvY0!ui!U?b%n(R36VjY!6|A-* nEmA;4v=l(+dacpUc!t5aV8G`-`xyqoc!d<&Lg+#pIv@Z$gCG}# literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/pos/-----.gif b/posterita/posterita/web/images/pos/-----.gif new file mode 100644 index 0000000000000000000000000000000000000000..2030a5f4501524ff456bc5b7cc7d8e49b636349e GIT binary patch literal 402 zcmZ?wbhEHblw(j}xXQqAVZHL|>E<6ke5h@#t!}K|vwzQ)xki^RU0S_u zvQzdQ*f*owF*+$aDk19Ar%!Vh&Y3)Ya^Hl$1&bHdG}W9sb*i$avaPFa`kd+Cj`Kw& zMs3-?rL?-Vt-CEgEj}hWrlYr`sWif0yaqpM1uUp zz_#AOtB5Qhn`j8b#vN-@mHnKf_jf`kdN zvzN?Y*x8pgbAA8DO)HwWHSDO}Rkf#lUvai5x7yKT$4{I*!Kaigeg4A5OP4S5bBYTw mtK7bG_ul>c!c6R{PoF)1@$#h@mw@v74$x0RKZZ*Omkii+FY+jMkvc6N4cZEcKOFe+7 zId$*jSF}vd}}C5=Z3a%J&7OIZ|0k0U3!N#f?$*%#E2Csg~s&Tj{3dOIn%&G}_ z7`ZV67zL`Kss$J37>lpEw!XQ$<)hWz$F;`?#Q~7?11u#2a3O)PJ?SuTTSG3~8a&tF zVOU^+!8v>rYl(wVY=F6M@(QWqh6_VBdbh&=ouG%|+r4Cu2;jOv$jv=cBP}3Mwcv!o z0_6OmfSKZ&fRQJTD#U2=g31`F+U;Z&GDAdR$Flyax{IF7twb|SRTaPwxUD#i1sD}g zVN|nWL&m)}5Cemq8(lOUV6a`)s~A$5i<)xYv7Oq09Zb4lfVN5cY9=dCtN@{}0H$)o z_ehq?xt~=L!%!@53vI7JUR$6Ffv<|H+7@1!&*IC24e?B^=@c#J(Q7mGbvATy)ykt- z=S!9$>eCld39gH6Rqdo|I}22w4R2Ut&KbT2pcnkC`= literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/pos/BULLET_reddd.gif b/posterita/posterita/web/images/pos/BULLET_reddd.gif new file mode 100644 index 0000000000000000000000000000000000000000..88c72711b77116314ad827ae125d82ab00357a6a GIT binary patch literal 1064 zcmZ?wbhEHblwc5L_&$YU;>3yn|NsB-Dw*f8Vy{@87>SjdVYM{yb^Yr0?Iq z@7=q1^5n^L=g$2!p?CiL`LkP^Pn#1-YSO#ZqzxN3T)ler&*MkSmM#19?Aawl-8Z2D4~_K> zPnz)YvMge6Zp!k!8k%3_fgAT|TP@Z7m z_|KrpDdVwW!NFz@VXc@G0SVpm)dC6@S0+4|>sF>AaI-M2ZFZNfR>+KGwJuJ_!hIe| z5gtsel0r5=RwOY8HA(Y}iM>=>)GKb-pXB4Yp`lxVm+SQuh0UrC4T2V%G-e%0xY#g< z<35Auks~Wv#TrEfGB&XB_Ow_rm=;bt&M-$rT*_xwiprq|CXVb05e|<%_}Eyco!QHD zKtO_#BYwe*1rH9%vlpv7GB7Ie$}QoDbx>rmG-A045iVAq8w#qN?L1y~Clr?~UD&{!wSlLrK&eHUM@&mh!swZU RifxZqIIE1mU7`bnH2_8{k9+_C literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/pos/Contacts 1.gif b/posterita/posterita/web/images/pos/Contacts 1.gif new file mode 100644 index 0000000000000000000000000000000000000000..e31cfab365ae3fd1277c23c9c9b87db90c9d3ff6 GIT binary patch literal 21727 zcmV*0KzYB3P)KoD*w+}^SAGY0q}v?2d*Y)DD7|B$EL?S^f79$pmf)K=FQC!!>7(=yEMH@rl2du8HGJAcFttwx9>O1`Q zpw2tQ1V3W{;HhJb zE5$D>&Bq+c(PT0f>F(~Ludkb~?k+N!G?7RI$8pd`W3&b|5``2Rfx;L;U_6v@x6d1K zd=Qerct|O6BN1Nt!Es)A;Z^g+SNW}H&hrc~4{QSdJMrx9-@nU$nd7NrNMm?k5bztm z&qospFWKMM$MA4JJ-ywbgu5uMKr4)@VpM=56g3s4s^YBGI+!o_Q`8-7nNF%EOWmXZ z&_)txi6^?hN>6f?nsT64V`A?FXI?)i_Vrdj`pkK*09ByIJ7fy}!7;#7$A~D+&jkU$ zB_)q^b>$fy8Dw~PkZdl46au9*TKNc7#ubXHiczR%nJJC1MOF_W@=s4WhH_*+*?lJlYdWc4&D5VH|A6Eo;!lx7@xKcd8bnOspW*m~c z$aQ7u>5v@mhW0chA|QXnH6Pvs%j^63#y9%;_`a9P_3uU-&B(|g7tUX9e|Vgu-#*6; zUzLm4e3x`n%b?Z=Al~9$eQU2o!#;iYIHJCD$v1oGsqZ91oG| z8fWaF!-L(BPeR4CZacn33wbym8f#3Etqkg$F1Du7o`k8P2}`UJfk% z70LDyPxke5iHFC{Jzsj2%Rma);B9sW-!TSw>KHkt*(cyGrP*r?yK8lJOG&Ti z5|dJTjw6XiB19t*JkKK%@sL6wr6dw@TL@t=K&@6s8;#bQwe?M^^*Zl zpl((DTD_eU8y{!N{V+r01AKe}dP8;g=QLVYB?sGWe zk#}9!Nu?5`Qz=r(1c`W@WHL@X8YLEsB85N*fe;{t*q#~@>R1Dy4aOLhRv2TDLNLFy z!V9mw&em3$_IwV{lqd!%zPs@et~noPbl(8Kycassp|tzpx%Rv!#B=P0*uJL0diYXW z`yMFJH=BZR#|AS53OZ8IId%^--`m5;+9KKB5j@vnXlQ`zv#Yztx){E?w8IS4?l4KV z#~ovUr;d?PnujqwUiW#I6daC3WGar&o1H@_O2=4fJ%M9?;F;YtNexvz#-RFa`sO-+= zvh?-!(9_dJM|&F)&qGLo4irjTqAOnk8jM1sa6}z#pr)hLRFp~(W4+$NX3$2NcBd*OkPckAuKCU@ zn)6ed_8ffpA%~;;B<&e%a{K_!PibDeq&YvWsn($_1Bb^Yy9XtE1|>>0&4I6At7f-a zU{>ZX+t373z|cS+Q&V&O_YAZ5#N@Ua*yN|30iHU>QLXt$ zwK~5NjWC>V&oewcz`#Hsxoie6;$gHV2oy>wj32s0M&l6R$U1=%lvSLSYA-jc-FYvxxCxfI;JTXNU9WTaP;iCgI| zR$+P_Hmgvs+iQD{jUr+$oB4Q(gePfbur9Z;@>I-Ch>uBlF)6+#N6&3dk*N&c; z(vQX^lrAiabmdv+J_U2bwE!W#3SH3mRPQAs#2}(L~7G?)EZ8h zQcVUhq1}}Rb`Kc7e@by=uOt?Q)0Z`$|8_v2;gQ3VcirvKl@|zLcFA!3yynDt#pV|5 z>KFX#lMeewByAaiHc%+TxdkXxti&fGkd8uM780Ii04H<;8WDprR-5eV0&nOE=FjEm z*(wmvb#YkfKgiMOdn~bFH+8`CvaqcMtKlAv#B69PWm`b~}lY&>jcM z64@9~0R#=H4rQVBZ^KSECfS$}MG24b1L(*Lq_o7H7!uTc7#om0c8_FyKq4JjUN;;+ zr}_Ttic%Hs8k0PDKr%KUiASMSg{w=jT(#+#2a}JHMnrn1- z4>RZA#qO1F5liPVS~ED%%ayCsZI4cH*WaCG3P|!cnSme408brbx7PeO^*WzSCcU@5-{j7lt~m8jnbe zu=&<1P_6HjU}%w`aN7>YS`_0p@tZ&IIL4JQ*zIs>Mlss&a@V-zo(V}L0;LMPdQtK0 zD~gRRI5aMK^sr=Cuf%a+qYRgqt+dA@(3ggM0wPY6DT5HVYtXxa5}KR7YcS-#5x9{5 zD66YqCf{GfxE`JDZRD~^4)m9f{M}ie=WT?BZ^-~*e*B;Nb&h4S@!a_CUF_YrhkQQQ zBJDO(5hy%aqaHX+Z}oG&c$8UlKgsr8435S4@E~+$A?nyC36zzRO0bi#t;B2m{ZS0j z8k^I)kJi&*U6(nSm5w|8pZj|l(K24W73k7u}a>IwF) z{yB+!Cn!UIZ#S7sR}+u!HurqtmA4NX-oXHW^hrJq{O@<)v!8p8943`Xp+adl##j)> zfG27cYDr#Meis+~57Ip}#*=$tq}w_`1}o)3%WZqEortX(tgjmqF^EUSc4qBn72f#J z5G2uvt6TSPm3p&tmKwk5&>=I6NB(t=SNvt{xkB`GHxVJKAWK}pJi|F#u0Wx z!&R(XaYu&J`0&&*?hgX~ao z#shnyE!CWG6+W!%SQ}hdFgdSz?v&!o-&1_$1w}3;m>7}-syTVINQ{u+y7nB}gc`&& z?P+88TM_;Z{(y#50?u94^mjR=lY)_6Ni-su--IhGHl!TufR1GN9NHf1gihWz_}I9R zXp!&`9&WuC)7Yo=-opD!#b9!yo65Dnr6;~fG?~G1B(<8)#`;QTa+$NMTP$K7!3uYf z0k$WbpEONO~sgCk*ApWx>ob2v06sWpOz5NdUuW-?~8WSCtxEUy{nR}I$}HM<8TAA8Iu zfy_-*ZuJjZH3Om6h{pu^tl-+L=IDNl3EbGU4&HFy#_YOb-?5A<9avg5C=Fe0)^}(m zgc=O)I8dotcsP@QXhdv3lhI9v-Hr;vd)vLslA0G<6KJBSa~t^*V+aAs2T zgL9gT*X?YM_X|Gpn8V&7NoQUV^{gs1fE%#{Uo9A><~1{mhN*eO%7(EME}$(V80eOa z^vO4x30jJ9O{i{L_R+#JmDVua=WzZ?z+Dp(jU{?d+7jDW&FAo3*eDuaKBIZ*b;VGx z;MYIo+3ScVguJ+FI5(v^drh;js`-^CT<+Q9P!C!%g|}dadSKJeFZF(q<;nk>j!FqH zo+On_(AC+_`0CPKjwJVXK*QS%U?3Tf#XyQ3L~l*T7{HSON-1{KV;GoUGrV+O@q=@Q z)qxRp-n(K=Or63W5fiB7ZQ9)m)q^nJk zii_<`ogaiXcgFe{jZm@yy#^}86G8$gZ3&%>Ku^2i)CG(5b+rjw;bZJRLV)K%wPtwf zjON8timeJ9*d=-BE@?A>4%F&!dD_Cmm#=G-f`M+qhaPen>66rhrYUIHf6?L-H10he zgTArd%w9dh@cK!z@lgQ!d%KyLUFthB!v5pexXvBM1hyGK2xgX-SM~)|r&xaU0XmcRftCw~fB%<0TUEGgm*khJpz(^oa; zr)@?}N*L%8JbsUbSsNKPFTAq`#$KsI*@sdMYGJX4AEsj)kgy}IDG>sqGSmbPcp;kT zdC=J=xpH08-Ql3aLTtye=eRtrdFHrccG<9dQ1XlSNOtv0JQp@gaDGyA;+$f3(U8l) z{Rbom#~gav1ks3PPNhR11|YnjhG}W!3LFVNS(q4=Je&C#h4tr1cLf+J>FUUnN=C(z z;o8yT*LWFg2G+Pk&~VcS(0p_5#{By?);GxKa|D4OO22&?#}&+lNN86A;BAwLIWOdjTE*+P6fmLlH;cXDm7=DX^LgT_g+)Hc3zXu zz%RbnVgHyzA_`k&c;&q2@_;G>T@>>H6}Qr6z9kU<5_`w29ZD^RG~git*Q z8Pm1cf*-&@2RMUIvUsMQ&aF+N=`68mgr2T;hF0eG$0Kx9>SVE)K$$zxJFv|Fa|OQQ z$>85iPt9c7+Va~Tl`#hC2~L0RG7G0%4!!?Z85{25o98P$IuS=;9iMj}c6NB*l^UF% z4t;?ct13tPtS_)H#MT@6b)_uaTByKU1xocWW_B%1+?KF}Z%DVHS&(VMzpeR!)<~eW zxI<}Z&j}m{=9Ub*1_Vp%hQIk+pVb1~f573P!;P3p)UiSDQhbuZj-v*r-o5hqN;al%r0A3W%Tyy9yJWVE_1q88Zg!!cvg23mctDM3DLXAqH+sXi~ zKu}Qjd3t$y^&`tm%k=bgqr*at8?S6|;A8)YXiTD()^TcE?5@1dnQI3a>kLoi!1JdS zfBlT29>DGa!3Q32**7f7B-wVh$~9Om!_t;j?{U}S>mzLzd=VlfvJM%G=ESuke9)YV zRsz2PIb`QPfr7yv$#W+ZnMk1Xj8fp(6`Y_#DNDe>3{P7{W zi|fR5okTpB-tKn#S4(@kv-B<&?i@7S$^iQH>wNQ(akDTrHPh4E+XEQ1uhD@Zo{V6M zn^3PnE#QDU!(U!mqkN=|h-+t92*H6}lE)59cJ)ajuC;|hU~}ekn^r}7($>lCYO^*G znp)%yD*Prw-wFzDCG?Kjxdk(54XLDshG*s#dqy3!hPh?KbFU~a&uDfHNFF;X>F<== zxJ0AM2ML=BX6LHRp7}dAE_{vBz5z3W~E54?-@%u% z_t>ss+x;4mEL>QmzU0s|-is-2Vyab=)g`W!x{#xz^k%JRKG-cdy2sj3VQgr&un8BJ zt*VcEVP#Anvhfyp_ZCF|dnLL>Bm6MUz^%@MRmVX9vx|mZ0~U?^>T?0Ji-srecX-eJ zF6or8QHHjrO<)uBlM6Lo`PQFv`Y-+|v(NkoRxX^NQd~hwO+1k#mv1ALPLW6^h$j*_ zj)My7)G8&Grmk@H#J4&3>}Qz0_yeR9r>$=vnH-$Fn#EoC3q(9ZBI1#XL|I&0C#cuF z?_J^q)(5!lX5i*zkYB9wg~CShlM4%rVq|0pzgEZTC~@P3*E#g?UPQfysa3(RvbXwu zE?jvxcMVtr*Ko{yWwU7un^tOivo^Wng-D+=)_L1O*hX@t#c6BM@|H=SmYZ&^0cbtu zW?k7hE>O_dEx0&oSl_e}#eD~DLTI2z5(MD;O{uR2u;#;+6VGz-3;&9(YbP)Q;z^Ie z;UT)a2g&8Sa2yY%48Ct`BYZ!=_v_T_HOl2p%H?&owpOWDHo5S^*SPe9uQ7h~eZ1$t z`ZS#rkMjHVhbgM>Gjv7pe~pYY+|$MU^5)1y52KeBm<1MrBDWD5c5eQnP+{RfAHNWd z$oAo(L6p*LmR6a6b&>A&0a8f^%3FwPja+4p@0KbR-(Hu3W_^EPH5ZG&AM)&mAh z{8j=AtTcM=PA$+%#G8rNnqd=?9VTOYzZR*#nK>GtBc5P&!%(e5Z>J!a7NnA*>EL1S zX}M|(K`wsn-*WD=ze#23I?FiwZwb?F#Q%c(=Q*F>1q>K`c z=13+xiN$j`u0g31i&NLQ^uk}DD$w<=5AwjTRJerZg_kb!fpmtY%?&3|x^((F7iemM z+ZGPKfdLi^sQ2t+&;*r-M@EK-#bYQ{V{v*BmLl|xc3`$jm|B%cb(tI0HcGqhW~9BD zC(kEr#Z265CWl%HD?`)`0V^AZ<7YMBeMON;3EH#5GRn;a7Z#g$9eZ5ehs`a6bOcf~ z3BH4YTE4qEG(>=OBvW&OT_YjIL;PO|8;Z_tfeLC|{_B6vg|GZOv{JNpbuuyWAU!?1 zaNP(&;N$x~L7)f%i;@OGu>F6nHJ;~^OvXtibfAmpPtUM#zDQCE0_`WBzsSqRuz}S8HExqL_yz_5I6O=-;i^xyIwFZNYY8MonMe)g2<6J^jcXrT$s|la$fV?tBU7eQ)H5%+HOq8kC6Ip&EtUMLB!Eq zIX{J3d5zNI1=ep|p}0KDW-Us=r0Gn$y#Am5ADk%k^o=t#c$jE3K@j-cy$e>- zt;7d`B2Wr2BolFZx;yFZ>m-*=lT0OuMm${C!IhFoBuO&f1qkY@fLfTtKQo88r=7(J znDfir6Nyn$mGt5!*XGu_frW+3+$L!FRuw_|GtYAJcR$YYsp;8=#>Ym9#^Q7g zvT$XAfuSVEuYod*me26*bEjB%^ggGF*D$b9iy+?%qvz*Em`m>h(H~BhgwT8v#Bh zRQDQJI>eK45{Wp`Xap%F#xbBYB5ZAwj>K^U5znDLKY}X~tjendmx@$=?+5fA8|US$ za{12iVw4bQ%~YIyOi;?)b9Vg*Ke1;6+nhkc`xbV6(+dqP0129q~5 zmuEB=XAEnb7CP?hwB0)W-GZ*Xt?6?ds~G}yix9E#xz&V3;Mz-H<_CZAuUMP83<6>a zNF`Ia;my|THR`o3W=?z^W59_(d;19a{0P49BZS0tCC2EmWo;(|I6~sMwnjbhed>-t zI?^`7I1=qRIF80~U0gRHa2*^cAd$$U%^o(mOmK0N?$2J~)TqbRYCwB5%1B3WN1)*! zRurmc*Z5Mx3;x&ZvvcXTwmhj+miCDxi|1CTuC)=9KE|(uksMz97GFI7-%;6{-A*J4 zVJmUJcUtkX@@GfpLxash{z8J@%5ps!g+atTpZHI<$=>q^9pJeNa13V~9uzPfP z0M~W#RhfmW>!h|k+Oh(wRfHdqEY0z{dpGI3Cuob?<2Oo%Kl&S==>@})J(6E~ugfEc z9XfJ$rbXDLb8b@et(O$vd`U4qZ_~7o9JbKw(ftmC-I9oB{enh8X`?KxF&fDrWvnAw zu0yeA!KXqM$_6gI_%%-azrTsrn(p2{_V0g`uC8IEZ1yq)fd(Y=^Ve8iT_6&P(%HEW zDP3Fn3^pwua+dvUyPQ^}6ki)EXgNUl1}1001BWNklZxJahd$62{=lyBa+G5@K9`}Yuy zM#%T%nCUArvry*1kU%JV{Y+_w%<(U9_5J@X2YaBdZMsxSSSc7@d|mPKc}=ZueS!P- z+X4{JvoU?6F=PipLOWgyV58D(y7XL&F|;LicIGs|q(-(4pk6ghop>4p@8Id|9!1tezC?E3dPbVmzGw<@NhrrOpe^d0#`597|%(f(x5c&>xz$grx|Y*!oyfu>yd znO!M!akjwag-!ebBCeoP*IZk!G13*GJ6F4{(C`m+0vn?N4M!rfeXze5DIIERll4lK z$;*b-ttwwFP4K5f|0n*t|1t4+j03|Ckr3%yF4$_|PrTdZp+gSYl-O4FtpeXrt!3XP zj^+!tge)Dig`4eRQOJ%25^wYmT1|&^ps;X-bKm*{B$|AF6mZbG0ns)#d(7I}6qU*r z>2xQlRQI;y_XY+)P~EDam9jp86gZAcwYJW}@;M4yn{ zCQy1i`>BmBAaf%giCC2GT%0`vSq9n?6f1SsioSK2>zX}%IVwTzwnD>yp9V0eW+>Gk z;4AYBOaDW0t3)c9Af3+Aez<_x?epr=y?j0PhdlV9yBHrbT)h- zOWK7Jf}1dZ(_BblqYBGKYuA%e7|hvzJVBUJ);}8VrG@Z~A8o~ub=*uyI%CuuObr-< zz^7bZM@opr@;`J!gb>uqHEPv5juS2=d^5ggtl zw_|Vu3=pd7W|3=S z2;oqxZ4m@D9LFIVP2W=bg%GGfQ7)ESxDU1}b8MDp36$Z;c%Jv()k`emP^()nHJ#3o z$!3YgVhE>2>E4{}A`BlR5xi)WSTfBo<#R;6le~ImiE6z}S1wI^YOU|c2>Xs-V}`d_ zHTc*!*P9UP&*9o7m3Qi(XJL_{1N;V6*DLc`G?la_B7 zKh{AFXn1L5jg8GB0*EEzRULc^7+D$dO<*pNvHx}tMb7Ot>XFd>p= znZR)s7q2U7KHG&JQovlnI(P#)OZaT8x#|amv9JTH8-{0&2Ylv>KF=Iiw7~7#%p|2H zy1;hvoW7{|+wTQ@_RDonT~N3V7!6)5PJZAnR2}N|5<5CP!=be%2yAHRy0M-62oTZ| zzf>qAa4<$u39eJDE)k13eDuD4?j3KZ?gu!IOK(pv?d=_QSvwW%l=L^T#UdW<*(~({ zHcJ&;DRCuHN0PyYg9+Z`az8&V1DHSlHdA%Q^Rx2{_;nv}i3c|rtbUWrS1qN3z~K7^ zDKs~h0~S`BDqm^nOv8a53)rZz=+jQRCFu1f%~zif_>W)mdFgdcU#H~YxZIJ@ab0`P zLeX&Qg5s;+4fw0C`#kruVr9cHHYDlqY1R}tQRtX>6o6`V{T3mhuyC%bAtktObo+ZD zBp5+)y~Ngf1%QA86*a|Htw2XQ!Y@8F#Qwo7)p|fOnWV3`mqar8<|Y0OGjG6g=*VRN zm|k3Fc6pWAb*@+HI9TFG_%R~7TaBNDYl2dZ&#!M3KfJoJL3d|6I8p9SKhGDg%ridH zOAuHspp~Xl^SL-3VW7*|mRvXV34#{F8w1nxn&W3R7bZ2H3kSv}hju%3w~OsK*>i1r zc;>q1^0a39hNk92TUKz_UP*tKq&>_MY7;`pfbyYt{|AVs{ugT1BEDZH5=q|V*YC#1F+%=r#@dI6C6CMVKuFiJSsZ5xZxc$w%nPkE; zeyJXundRK)kMkln{tvSXZ*Ke~44_U-^7SY7nS~p33q9Q(?RbeSdpa)TT|3U=^3Rcu zTNB_1228+(DaAvF99rL|VobBDXLeEZ;%UvfNlnCq`wmF%-s8}g6Fa>6^-aU2Y0bH- znze!Q&a( zCPCPk-56uv`=c%DIM5d3zVUYU4(5os5#os?nRME|GNv`mxt&96Qt=qB1BD7(fAU?P z$HxDgSS;X8w~+rN3}C)`lJ$2@@b$TcrQg`Mdl%7Ygsyg%iK%aMb@~GwoDkc7fYyq+ ztmo=`02M$`ox93E&58v2gkk>D3E=_6bJ`D5-jvjCr z?vo_q%?x4P-x(P+fFZ)~B1xCN!yjew(kaU2RZ^+m9nPc>np{G$S+O9GG1_V@4_wEk zGn-(rBgL+sG^5=alJO|gwQCrQMyT^cP{Z3Yv?dXa;5dS~XX5D?qFAMXMFN+wXy6^g z0a}N@S>OBu8h9&#QB;D;2H*DbWgO=F8bu-PbTmY?X zdN{l1V?^TrmRhxdU$5Z0F^o-9Au)7k4Sj8b_uYGhSS*gw8Yu*sM3kuK;6%cyy14@N z4ygNE4Od760wIiyd8lHQO<)CE9aQFR&;S7DZ%**NfATn&=N1g~dbue?oN68HwV0H2|mFha_bpN*0Y6J!eMv;zr zbaZ8#gl(-Qf2W2q#G?^gYaq4kNE2T!;$sP4#X`Yv%J%%k3~*tNay{Tn3rnlNQ!1B9 zB;w?AF%Cw*&2u+?j`X;T3L3b8Vs@d*^n9HCyDaf0h9!GOWz z;e&wY5;Eb?toGt7DfHMQEtHWwKqFho!q zN@0Fl8S_)KX=A9?>o#*~&}&;%S_uC}Wa}pwZ+5Y0zv}aa<+Y86H;W~5*)-{Fn#0Lw zxVZYOWa827Xdnm_v-1_M-bixqKI`oH0i3<6>FE@_>xe^Nr?e}9)pyo6wZgr^Kuy~< z1j@dZ_DtMLJTwXZ!`j3Q5J|@9-2HCWu3e;7-y|OI3N?&G8xLuqSgByN!u%AO00Y!R z4G<`lHruiPTfzX~P2$IZnqK8A)tWBOEiD7!CfhjBc9wYQB3ori5Liq+P?G66pVu!d z+jbR(g1`1bk6(VDM_;G3rQMB%ByV!=WY`6?ShO_)+SoqB?zCN;+0e3pbj$J3qCv3c z!U$-ecsEW2YPAAd`P(6L4P)4Milrn%U{ z8*VIIUvO>{=89HZ_k@c^L>#uGht^Q=Rz)F={zD-`GcfijkyH{D)Cq#BJ=SOf9YY9M z-`b+;2ceUy-|ZPaneNJDSp}c=+d!3wCRo!r7SGHiiYKuPmv*8L~ShG?0;mV9=t7Ovo&P{Wieu&}6^nbXY9X(q-U?mpx|M3U}5#L|W1Rs)18R+|XQ#L>FM(nf)8z-B)IFD$Q8sn&2@hh)ATgF{r5 ziN-wgeY@xy7@{M-j&tLi%&gGN4K$yT%_>}5gOYF82kJ>%;x{6PD>Iref5+#W&j(zd z4$Hc3l6E0rX;t&`YXM*XcAXba1gsYf6XTNM0sDFv;X$Hf3;?BSXrnPkqqW3WX#}va zzJc!t+j)R@S_718H43FN2$))72}}4ImI>aH33#jT46@L0srspv^>x|b)k&@`zx^)W zSUiRsc6uh$2|Aa)%+&O6GTz%<@zYnZP_zZ0ohe8~EM29rtUWWYdF{N-{$(@puKOIu zhU9jd*>!D)(TxSol_|~qqDD&S@0ASoOFBDjvM30PY@~r`x*O?&)_(XZcreCLS7~DI z0!teOwyHJa(THu_c#D(tW{35a9F_}3YQCaUqj-LfMJ(|vSTk_P8bf}pdu%|%^NXu{ z`Z_xRLp)_md`#%X2q2nlqn}qeK6#GKyAG0w+FP%M>;Lt%HT?re+J@3s&nhlWX%caG z_=v;qQJVx(wjzsi#V|Fgxo}0Zx^Bp%1&8)J3=T*#X?wCjH62aIwX+rI<|?Pnw6LMB z5*QPqQm=DkWsQmc9+cLYn_vI&HV&mU^K0uU1+(kSRq9l*@NXH*2=Ax{u+XsLOUrBP zzf-DIx24ADrj9n+;CK<*5>?_0UtwzTAcsaQ@e`h1##I|@8cG$z$@7|%7Ze7#XTQV2 z2}vpuCX6&xs)j4mnsb*Gn?>mA5IlUJ%RsLr7PFEbgv-1)7IrGuU||k6R_m;tyArzsXB4N-D+)#E=@c9}52(C&g=<*V zU!=(ZZwUyx9Sop<|LdIo_rJ#Rg_X63hkCo3E`1oBTOdZ`#WQq^^IV($0jtHwX-hUs z!@lzapR-pCoq54W-s3XTZ@oWbY)W@>R`c39#mbtYr&DnBu8{EI8UgiiQ76ZRtqM#n zz{<4+;y1oXPvL1g>Ms-31+;KETh#~&juYJhqX;zhAVDq25^*-TJikbLCQW0Z?6-UP zfnsWD1q@tWVsfp-CYJDxRYLCA`T#%a@T+ycu)4AN@Mft@CYeC#22#m3BS_aHlTf6W zzs%&^<88WJBgn=3a; zaP2y*U%gEJ#-DL$>vN=oD^}CHNg}BZjC3jb%QylY5yv))w5oWQ%}Ro<^ak^*n=Gzx z(3Q;)gk3;y$1uj=I+CT0O_nx_NQrsj66dhezlm)My)8?~-!2AF)2nC+05MT*$3bsSG40NMwefcE$v;T&@i~pLQ+H<&45l!XE=JRB78Dg<0bw6N! zy}-$-4c4|4Q7=Qp$zxwN9m2*!P_55X4>qaRMLnN_a?O{XBWX{kLRj|B4@U}SS2nn^ zu!02rS17ILv2g{!) zs@K3x5=(cJOectX9@-cRr3woho2+hbQLJcxVI9|z2uCKZXNd`!z@e@R)PfbHfEO;C z=jS&`Jhq32F3vBJPsPb6lXeBLJ7o%tC4Q+|=i=M~#=!Y`E}pW|Uj&wcRjeOyThf)c zlL7RJYkcF${VdF{to5|#(pc3`OQy!AXCkRK`U=nT`qXtQdk1kt!d_p{OwJnaKjd(5 zuO#X<7jASN+c4WzZ;-0VEXiVr@er(fn}EWuZ?46wm%e4*rRGXVgX7VzJ*k3Ev$p5Bf& zyM&tAsRgt#IF5@dUT5ClO=R#WZE5SwWz&+qyCfrn5-DsOdBe_6Ex{|t3z%2_fc4jnN@$~xr-eC|Gv+2FJI&GXs77x&9TQ3 z2|TC0S!`eo6@M0GD)==~{PJn@jjGSO(k#BR&P(@?aG&v2e6v!aE0YQd6(WeYVQWxQ z3c;1dWu})mhzay(&hXsDX{NEopEI!i`L?YWd^Dxd>b|A>_1-yYK%0XQ@-CPBA_6+w33nL%tw@oFp~~EEG_6EU#^Hp}fM%MwR(B79M?x=N>%Gi>;6vQ4amy zVLk|8OgE?jLU2MooTsgu7$@Na=ky1wRaSrsH;OGEmFvISP3?D@Zm_am<>bsfM|O@8 zSey6+Z$=x$l5dS+dU=JH=9eh|-zgY*`X)KbPA$r5{d+yH6}HQwW8}rufmbGo0hFl!9NjciF@8QHpxod_ZqG5N>Wmwc2F0 zR%4*MNItO9q)q($-k{{GCOKVG~(Q60TXAhZoo5N;I`sA!$ z(2KkUnLu%S%L!24z`g$nyF^=ej*koyMD<*f{fF@3+#m>OZO*aOm_T>GhtWYlVUr8I zllSNeSo_IeantPYFxL1X1l{xu4l_73K(SDu)@(AlQ0Cn160?=&+7Hk0*cTq+hvycU zQEw-gfN8wiyl~eM85!)>e+7Z$%_yj$<;t|&5;-UQu)-5hP3sH#PtCh>H=7T+oZBOU z9p2MJX&}$J^(JL2+!R8q(Pn9@N--Bu%H_NpslG}muOq|9Mdr{Nq1AT0xK!q+iz`SI z3detoZw-zyvwW7}UESn+0_vOXfC7iixcs^~WJ)^63si~fqrN#JyyXM{xOp$@Jw^BN z-tM9u?CT*6(+QV&JRrspHk-6IE;3d6ID7Z{`TfZyc;d(Nj6C-Vj;;Lx0h{DXLk#a2 zq_?Mp0&~l&oSt4_zOvPP>O9Z>^}{@HVv5POOMssN&f~$K1(x1-NbU$Mzha~dD}%J% zGA&&s?}XE9oO%T2!(Xw#WcxUviW%Bn;@WqOu>a;^CJyw`*lcsU(qJklT<@T}?V_k*`ir^ju@OO0mN#pho-ebsQpGBiZvO=Cz5k7`KlA(48mk=qg%Nh$ z)K9U`(%5LztcFGDk~{4o`JfETq`s^d;mr}@Y7jtw@)DK1k8n?5+@A3vKi2L@+kq&b zH9*#1Vr4VWOSN0LFx_JD@xSBf)W2nS@@(EP0PGH7b+gIR<|d7H=*z@f@4%YQ z73R_U1*PR2mCYLG%PX8OuTtL%$@LD?{ejQX|GwYj?BWT&d-9LScUkrwAHoKPuAv+Q zdyANyP^~m^PRGoM{Hoa}&YjZJcz*p%X5p=N0^`=IH~E{Djm>v&RBQBh7Zb@yB7~~s z3k8Bg7e`ippVde2LufM)z67p?7KRuZ9-zBaq}^&WxwyjAQibwHxc1-~9{=7+&fvqL zYk2S%@PU#t-UL)h9VS)f0wOrwLUfZ{DB+2`RDQf$dK)F(6F6n;NFRHS57OP6M?!(n zJ7+i{2rS3%+(jWDaO%kg{-g*W=<4HN=62(jPH|yzgSnLrx(fll#RA1#K+gKA;H}Wn z4nwM~7VFhIwWh;0At)M(H~uDFzwjA?@go?87w3OOSXYL2by4ij(GDGi5aa?Tj`dL* zD=_=i8r6%f9y2b#7ktcKAO4^4GrGwVez^FC>IPmF69DMJF_wo){8o1%D2(*?5^Aai zVvQii&<-87T7wcxbh%}mS_-8;hDV3#>MF3lS>@F9Jk#YhUYOC-pZ^ixe{Px!c#s$I z!=v+f$)CrEO5=%=U>Xo%8_sdW#uRUE|mIHSTv**S^^7#O9 zf;HAx{}e-DEC#_^!_NH!E z#R@$Wc`#62YC=H{m}|@p`cr+JCUxFGuHe-&0pLT!-`uFyerTL{r4M zfRV8w8nq_5d_Z@pn|hBUe2HXf%1Y;yRH(n#)>)IW^V>i|ak3TTUcb@z# zMJyk`^S@xnuJ^@3+JFmD*G5bptRT@|#Tw=GX7zLsz~u6itZdEGRSFmw?FRLPQ{&fC zS^(p-n+0LVk#1~JSbTa5?c@FSH|!s^zaD;)8q?9edd--@Rnq_f#T*OQjPTJy&h+jW z=<}i1Br-^JRDvL&SS(O1c7B_W(4xaW+|g8tsAKj+l>hZ#H2&)!3WbSlf# ze8#JvoKp%z7E=(m=9@@S_L-fs!=2Kn@!-E^&frxgz)Op?K5&HVg!ZlDLj%~z4kXTC zbQY&3Pc4=?H8synC0zW{kNMt@U*tu6^lJfc<0tWB`?x5=71jNfTJB!^If4J6PMNs5 zmx&wuu+f_Pz(&BD6nro7mcUrQNksIX`1$y=dkzfKsI^$Uu+GW(`#CgzD@P};1N947 zI(l&BUd(}WZNBj6r>JZ$aP7^b4Damm6-qiNpy@z5a-`KkVbE{eTU%@)eR6{gNKIeX zm+>LvS6w=ORS5v-I}gz8%Da#Dm%5~{)Rl1t{X~%!Ln~}^c6x!y#R@OXaOzKg!1w1? zxQH))FvsOm|Avwwa-XoD2L6+C%J@w^jNQ=dr5+EgiKN{`YTjmuU=kvj%Sd9xlV{(- z5thrFlxNp@e(6E(Jou~Z8W;vV@VVFMr97Nne1fk&{)gBC9J^yTxuWf`{~7l=om~}8 zh)@`|w5lP^l@K!|$64c~E+<>dydnv%HUXGlW$~8%{94X3Iy%@NC5sYGeHymvbxuys zFt@zb`oSq4{_-O{)@-wmm+}jE@Ta23>%74ovvQxX9|8W@g(^dbx)?tefiJP0j~zZk zAQ|u_mH5D>K0y3h;uxxs&*#{8%?KB!$}G;8nOu8@4)$bkx{S0(|N2SQNDoNrP{*1fKV+#cwFsMTLVQKIR0&~>~ zu(E}I;0AUh?Oz-p>?a@Xr(>;Ud2NH|CTCfwG&lbD<9zpl)11RQFAI2yKaaQj%e(()81d&^A_4J6=vW^%FuZhjkyGma7x zuD@q#Wld(w6&5NR?uA)B{pSzz{l#^b@lqap`BV5I-ujg;`t>w>yZN-j$8260e`kqe zUmW1c+ImTBdE((mTES#hen#p$9w(;25{Muw?A<@Y#f$6AO|EcuFC%ygrQ&l4Zl=z}rUv1$g!XbC18wxo0jgwcuB|uHz+rn$+G`coW;8?43SLjs$SAjlBK8ow_fDvS*Eg235R^SrS1 zG{1cGH`&=gnJ9C?7Hb^c^Z7 zR(yz;ICCeHek?ws=IifCG;0?>j^8O!+4|@hz1L*B@yFP22t(!0cOPQ!wZp8GSNY=~ zewISuJ^rlo*9zh5C%y1_TtOR$9oI>gAhRR z!?-FWsalKC`4(@Y*kPu<8|5y^LHEAEgR7aFqa9-7zb%%sjEYc zp8YNHmBi?4`hwsSX>)zXf3!d^ew(>oph(8_znuh#n+JsWXY8lrM1C`;H+6_|`M`advT%LI8yT z=GK<^#)+>%05=@pNj`7syn@baO-W4pdiJi#C7*PHEeT?Q97R0vmz9?PhakXJX}Npt zAi{?+P?#{UovNFCJ)5PJm;~w25U)tl=rf7-h-hJrp{*e|9^1>_Ylc~0-r#Fbe#vhb zDRAG@UtxA(j-l}q2d^Kc-3k-Ub2$ZmhNfVP5di`z;AejG(J{e&+YkWd12{%)7vzTw z`nui7%S}QOYKzVjp?eh)Brin)8>f!YDaAsLciwg_7`X4mSE)7|G}< z=;Xl!~ zekwWF&R61T+9W(1hh^1I)rQU`3dDsWN0061+au3#X6`IcO+UeAV~gj`pQL*z&kZ;3 zj5e+AycW$o^l^VO1dU$3gp{vH9RGsJ^zB7}+`ZNUwa)u}ZJI1b0aP&e0IJI*tYO!4K%zsSt$EVSV8 z(VYzM=%H3`rjfk(i#r&ao%A93L7J$i^tZ&nHR~$SX<0ff%(fr^umk0g1YmmwTncCc zY8+WJnTL|zFyB%T(h#e|R}tw9x5j^dafhbU+|KzxOw^nzd22azXo6>+n&K-@e3^Qy zLB7v&{MJ2$&Ls)6NxVO+VaSj|fMkv!y5cO@E_y-~QAOi%mFw_wI@K7INySH(MOI zZj`~{Znjoygf++EV>=m}=%>{RFCiQW*B&r>L^mr|<*99r)N6EyJ7Vk^u#I@|jXInY1V?B3O<)3LH8%K|9*RI9@H3gn5%|j_F3EiQ;QalzmE?=vT*9 zK@GH4oX%qb(+qqWmJ1|6TKuGOe*CH5=ppm;z?lq z=baOLEwj**%Nax+E{Y4pU^(Y-p)#?1kX`$SXthJ?jTWtT8^!rQbqNVHj`2s=@6;vd z@pWc>hS(QK&aKj3Q)*K_2Chpi;0;8aGM;#y+l2rV0Fw6+u(;$;k~$UJ?W}5#9Xd!P zJgb7eBu7M1Nq`U)zbaTFFH%DY4Qd=}qM%KtfJFSAP93dgh^s3hzJ8)#Pnb$~Rud%W zu|&uJPY3w1Bbb^d3B2U5KGPzsDO6bwpKzz}fwwq4Y?~1PEQ(kE$-U1=es-oT>v~{@k90R$$D0rPStAk|Aa2YsS>)7P$M%CZDp^K zCU6}j=$!TQ`y#lMutdLIVPmSv>ggt7O%X@E{R4MDHP%VDnd_Kr+b#rXAzm1>7B1OX zD)}R|<7zs=$E*Gra8)5xhfyI^^^zS|J~N~;6!{V23@TA9KgW(XEK z^+brs;0fWzcQ(+=_P66?=u7h6=$)!3SkQvYhKv>$Ny>y*wyl2#w5)@?HaILa8% zW~BZz(Yyp?r#OkuB?TmwE>RK{pGv*21R^4YE-Ew}XX+Y!&3kKbF2tZXlgS4sM0+K)8cKDoNoBUi>V+z`l{PL^ zj1^>s>F`1_!-tXt$qr>eD1Q^L=)fI}Hcj8PUg^}+cdHbMQ ziFbmCBF=efc8<^pI3RdM0-+Zy!I6M*cWgb5~>d!r||@T zokUqfVH;YlkhOA+mH8^G3pJ{hChdmz@Qq4amN*}ta;GEU>v&tgjL)u~r8Bv5Fl3F|jDhXu-Nj zO9)Q(n<|ge?~( zh=`L-xu`RGzJ1EQs0(@#5AG)3-j_-9E#g$LD<<2#=~>5rB+cgjo&Ayqe8hGO1GfYO z{o;cl>Q^7xAWiEII+8o1$6^VLB+vO};ZYu7HZhbqB^;k?C@JuwX$Dc&6!{jhA&SI@ zE~MEEX*AkwZ8lgfZ?U#qV{N(4`f`nWwME$U<9}lX38l%JUerZq-Ag*D)4G78j<@Ms zc=cYv175~U{08YNs*V6q+_nn=jQy~=(d?J+s4#AeLg}EPFkvxyKqXq_nJ)CO3Fv8} zXV9@wB%Au}iIFZS@oD36PM~D+0^@Tr{=D6Gv|AzVR!DWL#pYU#^_3dyYjrkO>#SGm zG-@r{E$1cNhzHzBi%lw8)^d7ac5t+0x>;qiU}@z8D+5BMsc2yqJdYc3AmE(8#u z%ie9?Z?2O+)qp)H1bsqb)Q}%G`&)(-s=ZxfM4X-h-4bWO{;N?Dim zqRuj}E4qP8wuZ?{dv@#i4bt-Q*=1m_E4OmH5C9+t448xR4s(lqLPq5-6}oYF`&xip zk0IX^5Of>zMN3dHwGn75?H1sac0&nUA?>E4Sqo`4+B9ly z>RT*lvP6QBq-rF#+TlUFq=CIr&BOH@H*`<~uO0qarY~-++PRGsIXh`VNJiJ)K z6~%=fSdDCalC|rTHbazG!kEOdoC!jIFu^Nwi z{Qh{az_+A6VBEGF0l<6{g|3|@J^|9TDa@cMwiR0F)y`KxJ$OF#4T_Vf1h_Vf0SsQrK5RC9KjqD^W50000)0U>1pr1DWCb?(;qL(bWiVM-HGCHUPMJ! zW@Tk%zVFYQSMXpw7!SsS@nAd{55|M>U_2NP#)I)-JQxqggYjVe8!^Pc>Kpj$IL@6V z3Z#{yPeZ5Hv}#SO21jVxGz1z>7aCTzrYrKmiiaf0g(8fB-(>ICqvX z&@UBd&>T{VlS(rJv^zFo%OYS|7M5ipgdh|S;@A!~Tm=*hC6v-gDJfT!=PADb%5DDM zcP}splmL&vB0_jT03TzVJ4=sLd=|}9Qt=r9J&sK*7z&U`CP<}HBocAr@hGu)oNzcq zBoe`K94yw(yjV_IWR8 zOMg!V*4+vnNaqcVwO7XRd%UK~9 zNhM=+cX!g?-$ORrLO2{kYfws|l%i5DVF^XRasiE}0+eK!l~RU7=#%-uWp!l(Q7=da8#4dgNQz^7^$J|KXG zaqcX~wB`?8m)~?8TD!a2I56B#S64gnc+7CO(o`xg0!7fO02)sRSudrT$@j2W?qjhs z#5TP|6KNvxBgf`K4?eZ4F!Z1f!K;n0Oi=7434LHK|GK8=$(oaaVv?H}kb8{2fYzuws%cIdCErkk6 zAOaNll%&AFRs?YFECPrD&7LByH7&LvLWcRY{3 zk!eYC;^-(n-JMvrg_IHx2#7L{@K`E#aem`TZdINm-a5$XQ*gM~h<2sHlTdQmh4g-$ zUcHej%Qg~&)`3UuOb1 zca{#N7(~#iHN9GMKxz6a6*>{bg&+zN8kV3wXx4rcr zCN&2u9vv2Bfp9Qr5ekI~hk^uyA;Lk2U?@O16vAtABZdXCY9X@2hzbTk_R@+8P=EQh)n zuZ9_5UQ@){WAdR5C$ZTbAzi`H`j=Z5w%}F=`;s zzm5cO?kqz}b4n{7QJNRh4R5C$479$!C5eV2gjzciu00Oi| zYh^gw-)gjf96+O$HrwjH)&y)D*Y&t|dy18nb+RpK!Xn3(+rlr_zs7C-6%HLr^Nk~r zO>Fsu&R+41ntyuq>-CRrUkkwvDuq3S8NM^*+QPFe(Ay_yF8Wy~yhN|4uf)Lns;t zptq-+iOKoqM+Q0iLK zwxxx1Q<88nNH`M0wk(uVpfyTsv{Wdq@uc*_sy?u~4s!LlK>AyS)~fb7TA{Q}XEw$4 z+nU+gX}U8Z-r9VImvd+78tmuyPeFT=vD}MgumywyQ1Rf>UB#=HB%vVu?&kvp0=1t< z0|5sd%ZT&UP0hlpCX*JlH49Wt`8Q0As2>vA5K4a*qFoQMur^H3+A^VN9MARW=x8Gz z3vsx!eB#Gf`2|J|gfW4k|NjxdxwFKT;t8$!O2y@AG>1bW+iJf{dZGpsXTPQ~=RHAeN9s z!x1v62$Qop?zQ|O^YP!{S3VDidkn`GD<()24nWz3cWx-&xGEW&HP?UiuvHa82w{Ln z!}5k^Y*uk&QZu!vm|oU=?u^YJ{HjCIw;43%J3<(#BK&mlx0+jz)uIGR<^# zw$s+0C7nzV2nI}&L@K0`xUOgRwW@KGg~XNfFa$bs@mmu#Y$g31N+03@g zkW*5k&gjADIT6AD0QM({VDw0U^crs5f}Egxv9 zAnzJND|%3HAy+o;vZdN_1FeWa91%=GBuOl4lZr!21bU-JM+Y1OplyL;n|?xbxc8hSpi1?Ka&6P35 z`P+)=C5wRDwN- zXcsNrVLF;&GzHNR#KMq>K+v}ZeLD{@@3jW$A5*%1417Xx%r!y*INT?>d`C0d=OBbJ z@Ls(r`S}IOc20As-{P~UZAN-6!a;N0*%i$@Hx%b@N>;WsO$otcM=VYswCHa)prZ{( zPp-kzj(HD;!<%E!m4a9hB7wRZpg}s=7K{$rT)6Tghu8jyrp_{!FR7}dG%iZ zP#b-B7n#PWfgS$8B7k#e$tumSxgOupiboTPD80R%3=Z|v)|w#@4AeMXDphyMG}u(I zg^OiNw%r(ug&rpI2bn4#p%NOvig(f05#&q;M4=;TI6T-e)4G8`cZCgvF*rwi;El`+tj_&o zT6eaHrkc@8(cRh3?K|V4GXwh6-9@faR|6G3rW*KA1mG7#e7)lGbxSam%{FsjWQc)* z9+JrfT4|)`;Z|JZjw$1oIl{#j6_gUJ6f;cZhPjrgrR;g z?w6;a;?@BJYS#2FFsXyS-?mW#RKM&=Xh{hYF~QiZq9tw9-D>eWFFFi%TC}wYECK7= znzyej-n=SV-7>)c#%CQK8nI|j3bcmpBFt~YO3oN`nHcn@Ar&@irF!44WLF_bqxV=n zF8q7TB%rN-nCZDk=vjN4NV*Bn^T@O`)09p!l-)XNTQo^k3k?_fn32H`B!F{g>C>8j zuTtUnZCkYU^t5yM@Cd!VT?9ixlvKDC*LTY_8jYBv7HfaH4K;d?_p7PluQrw`dgBk=HH8{0Ax z=E|7jXYWd8mKCi{g0DR7aAwq|IccQO$_~tIz@1YDdM-1m{j5wEaw}@}#(MI4K z@4M>Aj35&KSfl{!t4Ktg@sB4MAiB3qEAY_fxp$@!e|4^~m^9+sdV8w-zF8D?E zIabD7XxrH!-ke2ANoRW-H^XE0nF0CGl^HHz)IgArnIXK70M4D|E1t)HYg<HVPg~csRmiW~YlE%>5>>7r#Nr$Z1}DD#ddrp}WPnW}ftox2n-2jByvR&4aFP zXdFjiTkivK^EL(uWdj*qZF*;xy@rz(|z~b|dIb_pUeXX3Z(>pHvPN2ocmi0 z9zMobKO5%cpr0yL^~tFY$A*AE;qz;nw{IwZ@P_0&uSuix`YmGvPzTEVuFox);7irN zw;M=T?In!81hE%X9DkkX63VPZEwt&TLxVdbk#euAG;Vd8cMj~n) zjl{4Ecu`Lz?K<~;h(T#c#o)qB8?mMD(j3VViW`GF7z{8yHz%}G-n$cA#SlO>D)^Dq zKurZG#cu&4k34>cR8tdfvAE~X{72RrN0j-&!mqR4@@4+x=ONyp0~?JuOVlm}vK z3B|Pu#l1Prc0m)52>RLu{T%|S>Jw1Sky{o71PBYt71$|gHn(AMLo>gu*vi8T58Gs$ z1#Xr08<5{i1bc^45D7zDMsRCV(bH~Gan13Gb=WRLPa0a|=6+mLz7N_EqT@iZWF*+G z>o*v8mSqT5Y4H50V9ot&pol7wH^u~_K^PoNFf;Z%LmPigJky5Ikch>|v^3GPwKAHH z(z;owsezB2A#5ao&t@_ydV72D%4HA&t<1HI=r=PekZhKd+^#&!AAH7uUlW7=!#Fzcc>n(;Z!^s-_rXOcPbh@d$s7#bCHWCTq~L2Fu&hzrVocva{I*Gl*vhuUp} zNLBYZEMdUy$XaM5GfSGGZb8t7z9ut^6;;P36a?3W^S2alT$W5NC}I&o(5W*)$TtiZ z*EHA171zcT3u`82-I=jas;+)&#JC6e>JL^t=*d91>k*b#M(EgFBGn$n^Ca!98KTi3 zN4hE}KS_qLMgUsldQ$FDQo2F(o4ZuXA|A{Wkn_xM4%6N2i+f;cL-W#ml8bj0E1Q~@ zgy5;;HfIi540TyVLp}ihWo-+#@|u}t&8;cL?P<;Ys;2B3Nzv9UIDOEfr`4jh*?{i& zb^y8_8T5pSqq`oI{CIy!nhBKJCjvnG#2|bCx>BYdFBpLCc8l8+ilJ`H6o6ETNrUYe zF+R1Zc;!9Gtw~KV08gH6@tr=D~=ZD);v@dOaybNL8 z4HR5jURruAx053pjWifbKKJ`~>coNsSC{dwe3#3I{tn&E<{^Xym&Oz?y(1ayu=xB7 zHm61`vS~xku3u5(SdcGirk6BV#ueAbP3~NyX-Qg~JRlhAvgzv(G$$=WLErF_bq>y# zpy(PMohzGbyM8dqu}px;vCZT;R{bULrBpSYi%$>|2D&X?e#c`wuZe`~B03a=e9^=P z-nptMRp98b#S^6pztE#~DAd?mZgD|tCIMi<=wbA4EW)(ku+lc#) zjNnVB9YzN&BEB@cJEM60lH}H;LI}Zdx8U?4hXcJ9k+9)**R3&G4fHBgY?oo9UgoOF$B%28th<0A9Pp zE6r&!<7B%*NQfX%T%!BDqFQ^Ldns-fVrYtp7`c|V2fnn{ZWOxU$M zZEEN&s~%ZYzNoKCu3cd7asPI0b={ro?Xb8rr8wAc6L8@29m)4!F>3Mg<2Fy6v}s8R z1V+cdby;%hj-u?rp+1{Ok68?KSOfwF_+q)P({10Ysd%uOH^iK;7}q!!g0_TtwxDkW zSG@&KLd1sQ0h=3Fzr?|fw@7APEXyVo2++}%VP$h>Xdp}P#7ZqRoWn#0KRf|^{}TD9 z5AuVBxy5g8Y;2NFCw*O|aDp~Bzc2|D_N#1#5Bg3S7I#dTwd5K%C>1fTSTtxRvBt@! zVhp#z1KA5M`y9V7V&s1&rB48piuElcnUpqhfya(nj1JfY0;UM$;w{NrS0x);nt?8h zM~@jDU#%M~RqE9~)nLsB=6Fdrpv9p9Qx7047@t+Vd|om(tw<*Xzw(sBsY4c#kf7r32Hv*(Nar>z=gi!s zA~2jWA!OUCOQ3214DOE)fcd;B2HD`Qv_uFa@mg zAv1)#LcxohtezR*%V@7{aHzjVh2@A~LT!3d!*>q+EmM|<__6(=rS%HZ)BRSfWW^y`{h6t)6aBpEp}!?oQ(In5oXSVCKzbnzCIa(-Cw&2jwz$ zd5e6}=63uvCkG6W2sqGf@zimfM-JPh;wEpd739lsZyjze!)6JZA|}Mzn>PBd#_bKj z+{e9pMSR1D`+fd?s$kdm8_tbJ1UJVe?HP+iOi(Oq{^C{1TbCtG35yq>ba?!vO(ZO+ zc=hX8KCmk}1AIk6d)xpY51DzXKHGg`Kj8Ns*QOfk(o7reD}P2;#3dC^AhkwVHuH;1 z7U=SYDQ>VkH2i_X-h1F=FFUaSzaNW*?Czc}q?A|z#ni=d+(n!2!`-o)s$rct}Bh9+g#xvO^ z!S;*$i-z~`zQmw`Xc*RVF@83Fg&(Z`gsVl5-f)6@9cwULs*;TxGo8ALibfEy162dK$DlYN5^CW|Z(!|4c zTOb?vbLYNAysJu=I#pNW=S!=ax2`L``-qsZ;`Q*d?;8-PLY4%2oFoIbZ~I6AIC9u*twlGmM<0<9&9I|Ty(hv6_-$Hg=yJEZs0fv zT75M@eG>Njb;mX__)-O~k1Kxkmd6j@lw7-K5+?_GEDrS4yKt&pmG`JP;T<|2vSAN1z#(tY;4mmaPcb`#*&#?klHcg83!fnO$ zqQbIFn)t}WHi!C6)vffe;W&o#DjqDaYo-?z_huEd%bKm7YGDVoHVKXlTl95WH6q;W z3hwnT?o$Vt_(Zl@AS_r~QS|!PTii5F9-T=@gzI)pFbI_joWCJCe@(Kosrk%lo1?>K z<^z6+dTCX0<&NUkgkn3VNyY?+hiw9mnJhYE001BWNklqztEP2 zc59T|3tgz*d$bNW^Xi>-o{mHa1sslbdnaG|kQu`FBLH=6jvqfh$kOEGOj}=HH@4%D z$}|z_Ut?-)fuX(#!gCD)NX>BRB0suwlj)6P^fldI(p{~KpIuSBd(!~FvY|;Q1dkrE zIDN>byUiqjq%@Ne^6Lav);0I$6t|}oGmDyBQ4Qc)~Hdsgu1F`EN@7EMV}Ydx>sOEsV2-%mARq_w%XP!JAwhPXNX1RE_E z=3^ z!j*OMYi+~=9@=x!N)alr(?9i7uFV`{uw}P6bsU&m*1UE_a{jhrI}aT#@a4}q93Qr5 zZ8AF0^Nly#g6$lP%@~z1Ij`9%Xu=`rX|ovaw(0A%Xifsy+O zHzha56uAO)whEqo*y2E+O)O%-tTIY90;mB?*Hgkun`mjSV)7$W!%!Cbd!T9JGfZy& zkAz|#UU!UlZWnnW6lO7$i#{>J>2JOJ%X4WDKv5E0)(xX?Aai#ZxD3hI%YADM8TBsY~UTmh0UhSGS^JVwDfJ>lxRr z;-`;YRWDqvelZz_n1JTAAmG6KvSPT`#+3$`Pym+KG_PIon3&dNn+1=bav1jW0r?W# z95aNmzNKi-T0C{yVx-^nA9xMMCBTQfZKkj?0TO-I(`-8}`;gJP);^j;6a@+VVk18%`JR(r8xqI1=H z!)i%-(4W|9pI&tfn3Q+Wt|y3;0?RQG*EjAx$71tO zNoS+nNLtL7Jes0mT2pTSP%C}+mYD^Xc%L4^4jsjJiN#mbt(x5_WKDys z>Z^m!Hj8^xlC5n`b6PMnuXyQIvrxpdj|Dg~Z0wd?QFG~rJ%G94dfs58WCBT^UkKWfG(_oGbz7y;M!+`)dpe=}*0W6QqzJ@w$c_-N->&f0 zP?&{)2tIy5pSibO%Mk9{L%6RS*f<^;q8xJc?JtP0wjfr^W8 zJ@8zTXQ!7Jmk>Z zZeiPoSgMskdqJ;qYFV0^fyEuujhpxD1CwEBikb$^bi~vT1nmak8^Bh32%!2~)vDq7 zB~uU8nz3pDs)vr+j0~7!n1yAaOQYDa;Q|@utU^sjLm|%?}BSG zg>4CQuhpj5T1`WvPOCD2Hutu{wA$84HY0ws-puKLf79B=!EQAL`by!kCy${C#= z3z}?OHg15gmV-4Ghcp7cH;Z^*EI`-&ZmD2;PSM+K6ATFYx-8NO!`avFNPh9Q$r2tN zvH0v`4xO!*u~GJ?QGmsqd5)H-DLaq)%g0uun2knj)tKH(2et#26x^IHF(3af z!Ek_?#R`v?ZJI2LvaBQ)Ho5C(2={Fs`DNX~`rb07vgCVfYn#W{*EeX*wh&7sN%w{s z4;Pu3tuWB)f%KSPE%L^EoXg22660{H(@dmo8FBy5zvD5ptjMMl4gGSW&2lL(6k>%P9{|8Di%UH9sr zQ;RP9=eRDkwZV{hf$N1X+{8TPq{Y;x$3Q4V$Pw0=0sYX$Db8bz!43BG5Pq2UaJjI_ zccPB|yR&l(q1J2*P9Q+4B|+1fB5%Gd8DCLoTwYO6@UuhTr0Jn&n3?t1$~lBXRZs=d zFg$z8=IK*5*(Rgk%asOqtYK7r-+~LPIg?ldBO==pMx+Z-ullXIbB#~eF!tIHjpyw( zCimtEA`wU>EoK)KEzLHTg4f@b+!|N(bqXGT$e}eOaD9)YvEAG96GrO=W22-argdD1 z2Jzlt8#FeJ)Z9b=n$`X4{YfAkfkSOselqbi*WCY!>|%gHD}ZfVBw|teGx@`gO_L`{ zVS+-tB7?tF1pxZaA{$SR@L81G*WcTXZCglBQ`YN51}s#E%S(x`^0Pz#h^K$&37&o; z#>$GMIVR|CHPteqAe=sAb7asmxpdc0u2d)6-`f66Y?n+Hac;{@N_)bDUen?FYFug` z!1p77y`SIzg!dCi?YKYrLI|d2CB0oX!h(%$lPr4jVTV-G2OoABc^YHYujP%DYK=i8 z*x3%(tC?#Mgdrn2|m~u_P%JHHEz3*sxUt zx*FK1wI4K0e6=}rEf3>shU+6C6M1V-)+er-Ti8#3H;VB6biLm5IqU|!mUGy1TxnA% zGBKk_B`l&5L1(K)ZmvMF?~oHK{Gj6M zt+}}cwAMI|O?zKAv1piAmwtt#r~2t?gRO0eTh>G)ikTI~%0|8ZZEtCprf%3R<>2bP zsisMWO~qY3F3%fr-x7mk?WU;0v39qXS6Az-bp`JQZx7H_ zDN(Hva2#p@qFoZseeIA z-oo|FifmdbV{E2Vq@%Q8nnn^phz8s5qbw5T6+OPQvs3)i;_?dpJ>9r&g`lm7+66Y& zT~xP&lp4=dc%C8<6x^ItoH=aOK&sB@dclBR_Kb*ciyJPehG(lF+LoE5d_i+>(){7l zP`6b#i5o?K14mV*PQIX7Ue}Z>(9l8Tl?t+ghHz5p1Ev;!LW)$-) znw51$C@A=iF9c{#f$|!NagR-K-+lujI1aRBEoSEp0aUrN8hwlfO;u39G2YF!TaxRy z&H4wAoU%DOV%HYQxHqM^a#OOjYLZ;X4_O=>GTxE$^CQ)^^7(bRHv_BFbA*x`bES>1($BWCW zU(e+V#G+x!uEl}i8&oE5v%K0uEUa-|LjX!?ie<^|X-!wFFqVfu0S8;_5iz&H8*nVY z@M24I`HtkuUB&Vm#A9%J)Z*kp3&%D=82orX0tzL~!ir{mMl!viS>MzMAxJ0T$N`() z4pZgpHR#ty2>|y?guNnIdeGixaq+T8zF^wKwK9fYB5dpx+lI9b&AXR9<`y)WX2C

    JMr4qSPnS8NKv0PzeC(qiB-ta-U{cX+m{HO~>y15d69tpT# zUtC(|z)(M)aL7hC8Q>M}+V~E%C3yNFi=)FfnI=(dmkI=oUS8eQ+?|q)O>34`&EnE6DZzAS}3Ke!KH5hm0R6^Ye(}W< zjLj}A4G;G9U|BZNREmdEzu?dA{Q;xHEk+Ia#vn?uu;wzi?9kUC>MMi!6K)Bx14h(e zzHL_FTv|6EKL4o0@ex1ls_I1;O2gEQ;>JD2_^fHePR0eJgBF9m79FhybbOB5Tb!~V z`0V+tTA9<>b7(#=QebXT(e1aAYhh;f#!ZiFH;tEY=9JB$VN+GSwxPLl-D7;lgujm; zwm3Xu6N?Jde&>IGY5~T^JoMy`7+Cu!bhs}Q3weaItwiFjwRM*B#S&}Vc~-Y_Y!wPr zT**#}o$Uf!GwaMPZL=}G#>(OrTiZqQT2sPw3vFO(1ZzR+k4ykRxz5%LNBF_&+Qxsl zy^|xEj1!7CbFk?S&crnqSDqmq(?}OQSNngwii)w!co(Tq(iuH98kFB%^0$XYyl+-9K1v|$U(`L26^ps4ZvE;gVZ znUmUAOP-&8_KnP--*zsgNeWHRxa{OKabK-mz3y@Qt|FBZJaodQr^`Ysn3z&ryy~&B zWxjXfuuWH|sW9?9Bl#BA;QB3%p7;?1>;IIl%3l%*Lb$b+Xgoo{v2i_*rS&ZqH?~>d z%2RYbwhC;_tTQ{l%-pqE=9YKZQi>8L+*`)f0F*G%zctK1kZxm&Lp~M(0Lb+`--(9g zHy4(c?Q}AZ6N=E5Rt(uMGcol9Cr81P3Mn8yGacbGr_4f(QX4?;%_)BVuIZ^y zMB%d!JDfadk!doVQSm2eCvS4_SMN#|S0EUIgZ&nVhb_9>O*+<-yFuT}(Yw~{7ly;D zI=7;X74J3JBGqo*plB$`!sz^HOc0G&EG=u2!-7&lv$&*aYZII~>Cn<7D3#&n9m&nx z5~bkK0gGd!HqnS7YR5L+!#BoZ`PNN_7XFC7;=d#ulteOZMB@p90h_YxGQGUX{Mt5K z`2zVeg_$*`ug@`YVUp?1LahO$-~-+GDm1)uKKMC4fdl~1Ke)t&Z#>P#+4-e2!~MMo zOAt*r^KkkXT%P^6DGX$d$o3STG_U#P3e!tL4)lWblO^xnkc`hM9vZcI;)L-OJZTCn zZ5s+DxPDJ^@s?z1%@k2Se9Yp=utjT&F{&zFy;h)phxhyX)%60THY%a$npCpVKG1$u zuVd8{GBpXJ@9*VnYqyx2RrK|lir&W`4G;-KG%DEM)?B*gF*U1+M&a0~&0xP>Q%Saf z$wjz%qd?Q-|G<-5|B!@UAe3$;o=Oo4I+R_H$)!!^RyWx$mf6U&dSi~eZ{OqI#0o1I zQJ(h!-SWZR#uR?!{m&~6FW29iKU?@D1aN(hV%g(+8(TYPHnz5DX-X4}rx`RD9n(=oq&xVAlcP1+?B@nrQs>e47RL#x+}8 znp8>p`Wxz$akme<)Xlv&NObYYU4KflSXT!|cpo40+?H!$JdO&|CI)KoyD(YIIQ)yBvD zzW{Gxi$9MB)Zd$5Tn=ZN(^yW3Yzhtsf5E#8&ykLSlDZZbaJ>q5COvje+clA$Nei>Y zn`>M@rQzn7;;k!^=|!U!9zS7o;^3a_VdK*@faFVes*RW>&tFl*_xr<+X-ExN^)zgw zC$h^8+yi=JYFQ}=g$2o^U~yTIO512i?y8`Q_CByZRgl1u<`CVS6;ft&0>WdbxvQ$7CvSFhXX9qjq7nh~j>t<7R$TvBoETBA!MZoGtJM;xr`0vN!J37EZh zkJ0(ROJCtT1R_!5P5nfpA<7k(@r4y;*S6Rx>Ee|cu72+#SGEeZ_O4A}#eY@*LpX;K z^HpyD(4aStPx6l;UdiRV+dGA4SJyXbZ_5yfCg@AurEBROmeziqmZWElL0=85uNSyA z8E3TLL?Ww!pr5}hdFzU2*2Nn%R((&qg_8FJ-^h)%+`Be9eY0r(hQ$#kFcS;ZQ>wBN z^y-DG*VOghU0#FUbF6_lJPA!rf-$Ap+*C9-TLc1vhfW7fPow|+iVIh6gLmWmJhA#8 zk&^carL!c{DID8kb#sTY#WgkyWhPe``{8BYyS2a~yMbTwx9il~y{h{BBZJ;JK2$pR zeTE)tWg`>k>%o8(?rhC~un^uhs~eIlh382nG;YO223=QEE=!zXn4<>*g#Fb;3uVnK z=OxjIS#jetryWvp6EBeJ{->(~Pz@^ODyAoYvuN~rOVpHvg&IKEl}TeaH|ssu-dms0 zNHBYYMvf!M=QTS!kZm=&0n1PJI2LT>;rt~<^2R^l;nlxQ%-STL=_H*>;z`N)(kgf6 zS6SWhwqCl%tAFwaZ>{EP;(Z>N0w#eO3=wQ##J$TeY5V@L<_ zv|>B{<#wiceeDH8@f1o*JWnB|B45zt+!!MRLAtVjb+98C>9;s}(59u}{l zj={VCK1a6x8$!`2scZ-FSeWfXksC8hEN~8{Hg<8A+v@{NxMxU2DpXv}`c4pcXPv{rpJF$U za%jM*0Tm9K1*0nN?rS%S;;JZb1U?yt*2JE*irGh`H|qL*&e`=_>`#2`B@W+~2!#cU zi;7T45c5|%n_hyu=chS7`E>>g{|}*53+a{?f&rU_^(}79EVGe!OFzHK>;K|4-qou=kqW|K7HZowB*1>FBVST7>BfH#jr>H99M=63MiaN+ki9SXyOl zah>IDz4E7T@za-YaR=klEmG(D8DQBzUgi`0A=HN%pO^ry%~E;p2%}n6PIk9u2?T7U z2oNdW$fDuk|x{O#=VF8ca4T)0>BR%1w(?x zCB;_JX7Sn$9-jJ5TJ=?8nJyA>v$pT;`DJF;cDT39-GBab{&Hf41&pqr!*Kkh|9%~# z=RdK5_hH7T@yC(wc9CyK1K#g1uC9sUzHUOH5LUQ}R(G7<>>bm%X~l@O3=pu&bS?e` zcP9T6N{6Dg!nQ^cZ2Q5Rm7FOBj|WY8SoKdPG)B*E?PzY^GcDIW9q_^vfn5tXY3kfw zaZRiD)U0B5UbCGu>ktG2cJ18vO9NLIbgsrKT+<9iz6^yTR9wM!IY8n1RUTjXEwbV^ z@s=LKkpP8KgtnZZd`AIJPZ?E&V(&RAWeGbF%RdJu^6aEq8M;)IA0qD2Jc;kyF zxU;alda%E{17Qi8vn?!@D-@(85{=N(+C(%O!>yFaF5l(){F}_IKTm(w#Ny4B3}Dqx zAICC9q0yk<{i{uh)lSaj2Cm;#Y;2h|`?^}~nwtlHde$}o&CE;2rxi;p8rL)3JBLS1 zQl=?o)r`(YBCIX)hygrTf{ks+Z9`$ZLS=h{|F^v}iIL;H?)a~&x~qDho|)!0+(a@I z#l@m%$&RE13Mj)l#xQ~aIrtFW0ysc6_?YAtAeSHsg2VyhgMkE4EXWGQSd=AG8!d|x zht!aojpVF7-95eUdso$$!&lYaRHP_UW=53Mf1ucd?jZ-m_rAA$@BiM@n@jlGE9jjJ zQ=JsC@(aZL8-#Wp!e@A>HQUT5vQ%0<^R+pC`QrP0fb{8Eq~PO7^Iv9ArQ0##!xkxk zQz5)mtkh1_>J7rd0KTA~1HX0%VcBS!2Srh^EECP+Wh^L|DF2M*jc;*e*Wfp{1SH(q zdLem%BZM;q+5?>qEG*m1ELda;HqnT}6X!G@I;If{$kfpt&r+@l);4UG)@%x88?RSk z-yVg-`!)9NQStkg{t^eb@6O%W1+tf~P=#^{D)}~cd4*v029f41_IIZVnQ^>!9$i#0 zRH*eJ(FAL97XiaVvEF1pk)zx+TQA+@t=Hzc&A{Ks83^C?_1hBUeG;~6cd%8c^Flzk z{wSR*dd5OQOk1F-8mL;Ir0Du(Unt7K>TBFuE73SJE?c-98kFIY0iJhg2!keIWy5BA z)?#B*5c0$0k7%4cuE`d2hdk=>K&dRayJmBD&7xKpghL9aPsnod__*4iN!;rV{>MEI z^{Ux{YzcB%Xk@eaN>_}M9&VzcyPb_ z+2GW7doZ(LF+FQhZOHliUq2(ceXd{DRA{yYi_13icP;8I!LD(YvnMqkIHdL&H{Br? zlE=B9&y^vWhC-r@k$Z#P)k{3od7Y5CgenA<>H)70%`gZWI=b#f_j*uO1xv_v_l;JE zW~WQLXVK_%skb`_At*OQ%@KYADSS7--#`j~$D;gC!d58&fR(LsA?Ou9NaqW_$!G-k z_Z$2v+pHAEX4!f5Sp$N^ywHr9o_3iL10=o^-hOsvqP=bq2BJ&?wRx~i>`^)>{73_ zC^x&bF3&MDm+T8a$>3J6z~>a~eH^w@0mSpySoq`L=2z)_>FEKh3RLyuhY!dN;?U2h zg!8oky#5g5-X-+xtE{D;;p|a)GCdl6aK~b0!{%!bs(j;NkL<{GY6FTQbYJ`LGD%mX{sZQCq(Si6T#8P?FECe2Qdo{5>SlS`M$%%_Ma ziWK7o@(kEEALigSk+u3fgCfp-Cw$mq1put|9GAie_^Wij9NjZH;k+&GaRvy1u)zpL z*79?9)|lF@VvE6vcLiT-!JQ3A zt<(r7|ATYYe__(R0m8=igfM(Q`~e?^Vc_wo2wPBZcgWWy)3)C3(&=I5>SUHOtj{Hg zFK&{y?7om&&NIxzYYx5dDuK)3+4d{l&x);90P)jl)=%u^^<1&^-A<>2N7Dvw0D1aB zs)W}UAnHvJ%wJ+PeS*i14{q5&3O|)`hAyRSCZY=GpYU+}h$LWiom9?UN89YeN*tDN z*QMZV|IB3fIyNe{H$)&1AP_V#3>`&L==DspW#_n*tossMtpF72^cr1W^tZa-&6g_d-xHH=fDcvGY#U9} zFajZ_>KECFf1gK=dhhwSZp>M{J7ZzlaOOdcub1^U9#mp-Rt)|wp;-Kdm+W;$B&Up=Sx%jc25p{G&ub(j9`RV`6f%Ln`A1F zu{$Dzy>3si9JlfL;K_3u#|~=<9CMGe{!N8c9zIwEYx(D#D*Y`}-CxMwI!}aPC_pge z$E)k82%4QPnR1QIVwHNkN4ZIHF3I9MODwPF`$3w^y&EQ7x^!ySy!RLg{R<=PkHU5+ zfOz&Q*>i{adA?kIrqya==(^lI(l7T7+=1Z_680t;EBuVr)MM<8I*lM6g>V0cjK(7& znFYA_NxBB5I?UXK;_X?E<^F~vt>-{=u(U9NNRUt{h_1`O-|lqTELKStE3`T$=_<)< zE6iVAVx`*ZpXeG=*hS}YnYP0eYm@sZh1&{jhXR1?A-ovS&1bTu3J>htgKbI6D27UP z0^zuUFjMuHxxMiN+Q$R^_U3R;WwYp?$Y`(R~%$tiWF);IGWSW*o3g2bg z4oB_xZSb~L*fs_D=`^LskMVN3T0dTIv)gCG3BLWm7si#kUo#si|Eu8@Pw6<-DT^ z5Q>IfT_?>MDxoushhaSnZ(p;~XaAlj3V%qzTF2BPM8?M$pNL?1y;!!zW}(ddMuvQ~ zDek1X^Y8C)`O0nXw0nJ_Cm57r6V7`T2Fn${^rrsfu&oM^C}REAL+n>DpNfrz3HS_b zdr%Y_=5DE)M!QjCtZ|*y;$fB(e)99zI2QjiPS*bsAq1)~!sMas+)iXz z%a+KL?c9IO@aA*xajn$ow@-Z(w|;nJ>R0Z>e;C{80syRZg$p4={CTES_K!zG41_Pg z!OaRZO~nXC2^8ZznfZO%nJ7MrD7J~I1n`FfL?_44Jzgx!BAG9qIT6aB8vM!f@y zf=6i~@L;18jz$=tjG}uyG+J#I;%U~iCDK)qdG=jiePx!pj@b|HHjpQNo&QO;{K}g8 zkHdCb02WeoT0Jh*TkZ3uYMt2l7?$Z=4G$@SZ3_&;i_dS+YBWJnQ5BWwz*@=jQrIW{B2%hN?uyDL ziT;JqP|J;?D2&IVcy$j5K_D2w@AuK^^;k~jNaRYC8Wdi9pSRyzVU0m_pK>0TYrn1C zG+!ocw+jH|9>S+j@~DD!YF{jhrl`*8AEJvnilC}0KEDrtz>lGOsWzI-uBFJ7YTQn< z_@lSDd^b%B>DM=r=6;m{>7vf))c>Ec6BYo#Z1%X=Y$ zD5^p-U*h&gmU`RlUb)TH7p`*)>CfF$pF}EwEBMi=|CHD%1+dq0ygu${BU7#%+%p+v zm>e?vswxUX*eoY=tfUJR>Z0)cHQu-xC&7Sbl|-KS;iigFTK5^SBQ5}7CQj>Hr+FCL zJiB{*4BhLI6+*yG4K-DzXPV5%H;HFUtmat$(Hp$FoF&b@1j|+EyMg#YU#U!bX}x-Kso$l~>P*l7g-8F)s31HchrKXR3c&7gPQ z&F_ocXRTCUHtb{;;KD+l=nPV*Rpf448yWN!oM%U76TcRPU3O99-Utua_*B9N#33(vJ5VT2Jz7-57FMi^m)5k?qcgb_vO8CaQFSXh`@fdnfnD;qlx2Rjh(b8~a@2=WUF3GxdH z3X92z3yVmJ3JOXnN=V7d%FD|Oiz}%p$*IW5$;*KZVFYSrXJhB%;NX)J5fqUl8T>!M zAjrX3!&t-2sKme|$jB_n`2PrlD9~>ZFThC-ps$ zx0RKZZ*Omkii(z&mg3^#baZsj&(GW2+je$#ZEbCgjEu6fvf0_$|NsAHW@i8Y{{R30 z000000000000000A^8LW000^QEC2ui07d{B000I5pr&2Rl$~g*u59bR>a<*@D1a}9G0F=TueamCwvy3q z?-u&&g2Ai?eSrW3Cj95&eRLIlTzrU>FqSHl7!MT%eF7(zd5m0~o}d__ zkC7RiTy~*znSCmZYPbP?5h#RI3mSx^XAQ-o}M>v-hBP~b-{uKM~@zDZf<_`=utsI!TIy&r%jtS zb?VfNjEwEux9{1rCqF-b<;s;^U0s!xm1SjRw{PDrDJjX#&E2$V)Bpef)6&v_Bm*i? z{K>+|0JKU6Bn+~Xf%X4_WsIk%%*|M}F6Z^W50<(OD@+U5y|1~|(=)HYBPBrT$Py#* z3Z3~ErWkvzjaq+WP1)&KA)y8qmd0H(&bNK~Dde&Cy!xT&Mpqewia(8WPX2ybTPMM) z(Nv+%(8d=oUct)9+NWN@B+ggCFj-j66+=CY&8SKR`d zOjxT!tuL;S6JusHD3kQuwB)2pu%ArU#s-(A(-;_<^=uwmk-(nY4@DTYe$cvfmj9t zEkuDpm%C)9JYi7x%#@047V024c4F5)h6iJ2;REOKgaHf&PEf;ma@eU!>NGJ@F-!ow zd5jY6?0E9TIGEHp3Ou=rXgZWD`lZXK^OeeiEnoTDn6Hb903o|7$z&mq*RyETx|pI? fO9dotwJ-}3_ll7lb+7yoK|(^_B@$?e2mt^)k(1Pv literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/pos/arrow_down.png b/posterita/posterita/web/images/pos/arrow_down.png new file mode 100644 index 0000000000000000000000000000000000000000..107b59f444c6558a4c07b329bacc375d90542bc9 GIT binary patch literal 190 zcmeAS@N?(olHy`uVBq!ia0vp^>_E)L!VDz49!1)L1WG)8UD+?Q@{3x@@ou}>1{C5f z@Q5sCVBi)4Va7{$>;3=*S<)SS9T^xl_H+M9WCbY-@CkAK|Nnn>cGT9bTer*Hiv|iZ zmIV0)GdMiEkp|>wd%8G=RNPYSILOPOAkh56H^KbEJNqT3pA;A+SZ*c>O?(pYNNS{cfN(22WQ%mvv4FO#t0BI%)s_ literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/pos/arrow_off.png b/posterita/posterita/web/images/pos/arrow_off.png new file mode 100644 index 0000000000000000000000000000000000000000..c507cb5679c78334009c5b3ff08718d3b102b47f GIT binary patch literal 180 zcmeAS@N?(olHy`uVBq!ia0vp^>_E)L!VDz49!1)L1WG)8UD+?Q@{3wacAczE0Sa*z zctjR6FmMZjFyp1Wb$@_@Ea{HEjtmSN`?>!lvI6;R0X`wF|NsBrx^?T8cb}?(B8(+L ze!&b5&u*jvIVzqmjv*Ddk`oeGoY)*06;w4&oKWCk;c+;?p?Dx>14{&_harRXRz~S( ToQux_)iZdy`njxgN@xNAEblOK literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/pos/arrow_up.png b/posterita/posterita/web/images/pos/arrow_up.png new file mode 100644 index 0000000000000000000000000000000000000000..b4e9bbb3c9346aa3fadadb53b0dcf1bcf60c5435 GIT binary patch literal 189 zcmeAS@N?(olHy`uVBq!ia0vp^>_E)L!VDz49!1)L1WG)8UD+?Q@{2L>JG`730u;3=*S<)SS9T^xl_H+M9WCbY-@CkAK|NsBity{CRqxxUi2ml2c zOM?7@862M7NCR@TJY5_^DsHK^H*zu<@Ei)#pRqgP$N!0002t}0{{R350Hx300004XF*Lt007q5 z)K6G40000PbVXQnQ*UN;cVTj606}DLVr3vnZDD6+Qe|Oed2z{QJOBUzfKW_SMepzL z*?5)vnXr^-@mq~v#Is<_TJv!tH9IQe$@Xx30Dl4m?CIp{=H9&7-_qpj z@$&Na_V>}=-P_s8t;X5r<>9oxu=V))t;fI5&dBfV=di}q&Ctl)z^}#1!s6l2^YQNR z_4fPy{pIZK+vn}2t)%$)_toO#;n%^Nt);HK#<#b(?d|Q^-PrN-^x)*+!OF_W$Hdm! z)7aL|?e6dH@9^Q?*SNj5^z`$uytMfH`|DE_v7Q^$@+uYl) zwyn<6!SC?!+19@4>g)FN@VIM;P5=N05J^NqRCwC#*lSzbSQiFhNFotI4oL6_;vuC{b=qK$I+Xz#Vv+gl@7g<|P-q!D?T7b6AA7YNE^pUbd+%Us zvHiGMY?dFDpVm+7|H0xQ7NY(A7RQyM(T<>!bm{vn3=x8=(rL;Q{SFI3)s8?qX$u8u zH@N?3nH4ckx}#Azn*N_G4oMxo<@6I6%H5fJK~aq=_stfD8jQ*iH3XfEFQlfX+!}Qx ze4~YjL@+!_3T(FWE&nOEIN%yOC)PU~H4MJ1yg;_~-0+z22Q16&6NVKzRfjwP1ed_zA3i zg*8U*O1&IMRBp?=xVZQmEHTY-U$r_!L!g-&bz+X`4t(d)WtnwhDFsip&8{Fwn?C$Y-BAJXOA#XK`_RhKI zdKm{RiY;3Snxy>@I2z;yA7(lgGa&E3x|;RV@bB*M9w! z+hA1ns)v#B*^{x*P0SkNT`$lbbO1 zME0ERVyeQj0n}Jv{oq}t;(WYbiBc-f4zs z%YX#}iTOaK;&}X+uf*nSwGJ!E(%mmvP#Eld++;eN$nw9l&R$elfpTnqJ`jt=_)zHh zEEWjIGmI!o&9${JSS8e?pJ6B}4r^%JRure>NuS5FsBIQf4$MD%o3GdOr9Z`r)$Fow z_7)3VDR7fVlvd3Kp3iKn%Jc0jXMc6DrhK_F|4%-@l8@I9{bf-Uea+=ztJ|c9(jI1G zjt{S#Wi`}ip(Oz5kGJ*uO1}QgL#nr|KKb+-)^Zv0xdlz4EyieCK9N;l&1@?$nkRkI zSpY%x{7TzHPCj@rJzbDxabu|&{B_W>aAuQjDtG_l{MF3NbN(t6a;hq(proTr9lj3V zFq0r5Yr-dqvS?jj9=41o8G*_@Oz2l1W@es%^_*o@Cx4b`zeP~{jbE9ZeqdyJV#4Q> zcK=@cLS3bf(PX@q&t4#FW;+xLIh6BCDV)h*M_W5O-6I^ zL?8rB&V;tNuN?bn1f}hMwYen95?IsymMq;u*q~)LN$27Z%ZlT}hgTuT?)!Qs9B$j` zgJRKfeJYExuV7lxqE&?1e{`%aFGmI}i`gU@j)%|Al&f{!0waQoXeKxtSzcSc=lJLY zYXVg^ZH!*rXx>|0jYJ~1;VRVWv$_`xBA>}7|7fET?R99Lt{%b>#H8%gO_B=Uv2 zEZr;OVLH8+?g$J?!XH~++cT_UbLr`l3|9xAPn1NT3|sX&7z{>cA%k_9O)_L-@4W|< zR;$G@Dz;|L6tAUISrR2!1W~qb$W})LQ?s{UYyQtI+$4M+`FW=0_tP{y=53kUUc{s# zj)J%$iGRI26*pvgbU}c}Bv|dpn337yda&vH^B^dlvL7Yi z@mSG(V{GAdZNNf>0fr$@qv3(QOWMNm!`ZQ3CJP5+#k*3l*t}Kjy}A=0vY@brM-Tu) zpX+wmyQJ-?{;c0BBEdO{9*y-|@c|18>k#HI2%TyNO^>vt!|h)Na{HGz1Fvj_hb{D5 zJ%*wsV*087z%uTCq5yIDOd+dU>g5^AA;fan9>~#P zUFIDp*E^prm1K-f+YNrkz>AFelrhp8wtB(G0M676;-~cnG0H;6K!E*vgTNlL6VXu? z+HC^fZvPTp7aBxoqy?Xu1lqCx9<&{!C2rKcXsJrvG#yNhy03)|QoT{41~uw_oBM|R k{QsPv*4L~bm;VVc0HT!-jb!e$TmS$707*qoM6N<$g7zKgCjbBd literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/pos/button-login.gif b/posterita/posterita/web/images/pos/button-login.gif new file mode 100644 index 0000000000000000000000000000000000000000..ac11f25cda6309328ca99277697b07b2b6cdbf5a GIT binary patch literal 2366 zcmeH``#;l*1I9la3FFYHBuY%V79vEwW<^_0r8)^+jITW z+xKq&{P}Z&%N-jV8yy|}@#9D7tI}zqkjvrB{>l~2usT_t-JK=nC7mX(z?FgU=Up-{pfh4=UO z&xz;O*Vi{THs&Ss^AbsZemN}M;eUl!R8_E8tOcnwH#aw(oGzXf%U4$3R=$GFf~= z{KwB9WeW?-OG|4CMRRlW@bEAu1~bLyFD))Tj(sc^isZ_eSxVW&e zAd|^9H#ajgGk-bofBg>&>{BR%03Z#p`Zwd>PXMZ$fVr9h@(r~iPF2U^YO8jD>2~M+ zC^GUb0;i#8={4%qmUk+};6$RquJ6Vz8YbrVePPr>PbC{o4LvGV04N>wZyC*eSKLK` zVv4Fo{wJJOgA79Fq9VIJ0{=<>@M50nXXR25@n z3j}D*ae0p&11IWkQ6)OQzV;ET1bKxSxXY=mE<-q5uJSptmDK%M?=f-k zld7tknnLaK(*1FYhXxqI=VETG$kfa~Lhc5pMK8JI{Ue?M+HD#y3b6GiISZH2w=sr7 za%^vdBL${W>O{jqUztrNrs^8CX&V{?D7>=qP5pbqV@O)W&I;AB2pbQl{A4qaJUndw z#?EU%N>fqBb!r-YIKkpKMPT&d{iuLse>-!^^CWFIl;*Q0l`A2CX04Km*X#6(aGpG8 z|0t1pMeDZECpWL(W2ZR^6VZZiJW}$7f$7YCTRGmCI0{!&?{R44{xw50L**wef((wiBv9a*jhTQ-UiW94lO7S%F7Cg6FY$6CO5pk z$H6MTKMH~Eb>bnF{MiSZ_1J!vDoQd&H~c-p%cv2v&u4doaneaNLzRM%VXJEQ_=eD4 zgX-~N=#F80rFkbNtlFJ8VqM+CfX6hj8@FB4V28i~kf)EQ8&n(%fBm^nvv@D??9S8J z$m9&>{Rpth?*cHy1w5~0eeOKx1A!XTuXV&8I0Ta%HMRx&MP%bC`Ytkfrd95NHWS8L zI=HQ)@IxTeG7%l7V@nFK-kt=Y@8=x~LC-;zfinjOuK7S3qm!^hutI}e5DJ!j($FGe z`qC_NyCq^%j8wKQ(m?fSc8u0f;0_sAcj;UftL|a1q*j}Rjto?fbh9)aO^;h4IzYb)+BbV-jI zKAYH`KrCuOkbzZI?2DJ9qrCUxBHJ-HW1l^z!c0+KqQ{d7y=!_qz|+Ag0l2brP`{gR zY&E>FuJ62)e?E1w8%uG2azQ71v`N1kNem#+(GiLDZm00HzgK)?_O-gl=mFd~`tx|s zW>K6*%FXB$qsTL$8o1c+Z+MaGm>aR2#`C|6$+6jdB( zJ$+FOzLGZ>414T*%6~()v)ftwlWL*VXDJ8W&0x#2Hr;(HG6<-?FoVRs`Z zGm7^pP&zH1q@apXyG%7!f^{!K_@Y}<+D7Z_Ny)0R%ikjpvWSAVy{v%=%{&t}&#E(? zU#RQt`Jy*uxz!f$-Fi_w{iO5RXp$WweRnaeY?o=Fkr6Z_bX&1U8XUKOAt5u=>^RH! zbgJ6y0!!8|F*n%& literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/pos/button_add to cart.gif b/posterita/posterita/web/images/pos/button_add to cart.gif new file mode 100644 index 0000000000000000000000000000000000000000..0638845afe9debe6297848f6188169e070b2aecb GIT binary patch literal 2494 zcmV;v2|@NpNk%w1VSfNB0Oof9_4W1a?Ck35>h10A*eL;_V)JY=jZqL z_vz{B`1tsRiiK%#Y3S(a&Cku>-{0Wi;Hj;t{{H^X(9Wu@s{Q@_-QC^X+}zjL*Wuye zqN1Yt`T5t`*Wlsc#Ky#-p`n_ZnyIX*yS}^7(9oBgmyVN;a(QxccygbgpL~IQdx3k) z%geI1vdzxT{QUfvoR^%OoT{#>g^Pva;^NiS)y2of-rnA$qobjvp|Z8I`uh5yprF{; z*yH2l&d$!OuB)J=pwrXS%F4>o(b2}n#>mLX!oW&(BtIe z+1c5fo14we&5e?cv$nI((a*ZQy1c%;o}Qk3f_&K7*uB8L(9zJ=*4DAKvBJW_X>V!8 z#l^wI!Q0#0m70}%fP3HI-^TT?(XmJ@AUNaU}s?P@bL5V z^YQWV|NsA)nVItP^8f$;000000000000000000000000000000A^8LW004IYEC2ui z0Dk}~000O7fOUd{goTEOh>41ejE#&@=DX$0}`MXsR11q%cyT)5DHLjwT< z3>XkGqCAw-uDox+nJL56I@vuDqg zIfI5AI@BjmH%O7jS?XqDP@zPL8f}wQDN{FXL>>@eWY&dqCNDyiIAAK(s!QXzxti4M zQM79Rlct?BcaELAc<~~2dsc2-t8wTqontp|UcpTh3^-DU4U9Hp1BBh#*Kb|HX)~`) zyO}Uyyq*gizALA+Y15oF5B3b2^=Q(kW8ast z^Yh!8W55oO?+C~-o=WCX)|qSB!6yfM_T87De*57!n`jE&2VrZU%@KedCFFM309ZK% zl27MRbs2mOKA56~3sR@zY%f;$oN_C+$C`$36j6r?ab&fZQ9q)$8iFdu$lP+T&1l&F z97e_`pOW+;7e@eZ46$QRn#om_Rmr&s+I|<#N1=^&y%*+^`rU{bT>;2pLmeF4r<|@0AbM8? z4ZLxwgu+h9L<+mY(SQJ)lJ#2(Nz7zb*#;q7Y&Lkq|M3HIG! z0SURnF@b3wOyI%>@iyo|7P>m|guQQQ5yT8Pm}(shx>{g|!Mc)g*8(I=V1Wf5TnoSx zPHk_B$#6Je+6@&@YljA8?@C3zO6V%L0|8XgFTwatr=c9)VIjvHZDegM zVd=sF!VWp#rNP)1ko~b7WDBuE$;@4=1KBie0e}v=o&Y->E7&bZ1;nSY>T9Av*>g|1T&HiE7<*wOL-2zIm!hY)rw zfO=`yvaPGo2cuD%*mXmVyR`FtP(cO0zyHPzy3)bGZdbDfE$1`Olf!>R5TMHa#V<%f zLcezPfH`~*4i%7t`N(I!ciDkh6k=c7;DE1^O+Z%=FraBZpsN(%#RMnV!3XA`0k1iL zY}c}YuBwo)^0`Ze%(_vVIs_g$oMkFMBEtlAWraDApn#k!8{UfbIsBz)gr-43-oQ4( z518sMBXofebp--DKr01a)FKJxphFBwsDocDRGBu^p&oqbM?3iu7<7e%GcZ97+?&G! z(zdJ7jgSRtbCGFI;4c@*foX6^f!9u;qAK=_1$Wt11Jt<2Hf9k2FI99v?QA8)9POw_ zAZiPGup$Osm0>dvpr9R|sH-cu>n=Ehg9+NEHmJ#=V^*9%;9}6LIKF_B(gNEoHQB}u z*x`h5cp7z1r>hE(Qc6^^k_xcI87*yTNQPNJ1)NE!!azU+7y1AMAOJRVvXhi$vWq(3 znHP1UQ$AxV-#H7_r@2hYO>mMEodRPgR9$LP>S+(A@}#OjCG=d)lA~x=g_uP(N>-4P z)TgW$LL^a2QwJ>$X*?y-fg;dUBBc>OOZw4Py((6-suh|}b)6Xn3PmMV&b5{mwJzzY zFbNVVzIZCfD1l1=;;I9=>|m~$^2t(0Qjk*vRQR9{Q~(kRrX8oa6!EMJ4FD8n2E zr-)5VKQcS$R;^Q0p&On^lTlZM>*Gk3Y-zes*R|#Sk-3MLHEL^Xz*3l#j+N;&B<+>78szW zuIf0|i|9{(i$J+r_PCX0pKZD8JntIUtKm)UTuJk|4rv1cOj^)&2|6fFUGG~;Der7) z`&jYrw=^96OV-qT-u@EUwkn*%0OX*fI@o~$l6}MfMsKRzk9PAY1HLV5HM`$?Vdg3r zcAkcti>(e@N4{;cQXSmD1Bub4DsS0RjJG7?pX`Jp6-gy_-xHeb9w#d|Mu~7LB}X40 zr!4{iz?Wgu zq&77~QazJ}usQ(+smB3eE$do;Is%}!bp$XQ-~&iFn-Ln+a literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/pos/button_advanced.gif b/posterita/posterita/web/images/pos/button_advanced.gif new file mode 100644 index 0000000000000000000000000000000000000000..3537dcf7330a095c6540215078a00a83d4c71cef GIT binary patch literal 2461 zcmbV}`yHnRSxk8h+caa zFp5fw1_lPwXlYqlS;QbB@iB3hH{09W`}60|PoF;JgSz z;afQC-pazOk^Rki+4$wY5!5OtiPRcXoD$ zkVCq9x|&;>Gcz;C$HzOnI@j0NH#RnQc6KoLFq@m3+uPe;zkWSFKBiD8TU%TI6X5?v z`8!Ae0Q>;We**tJ0Yr|&e8ZnUi->$4^&&bZHtyxCNIz8@TuN%1j0_?}CXJ4xFfy}p z^IqptG7$N1i&F|RUi(^kfof_+>O_QvMVp01YTwm&w6VIndsrQf&7vO$20?vI%{`93 zs$TVt9n+JIye4sRC|D3W-#@p?t6STA&+8Z6+}qfj+hVV<*Xx`?0$vRC~5Tv3U%c8JLnk+p$`u0_eost-QKIK z#yWdL+uNmRPmFc^285kqIvyxQx`_A&gid40vCMk3Q8^}% z(u#VZHY?9{-&$(`i*RaeSwbTT?$5+wv9_B?ZNpg;NS?tUS_D8%3X7W93=$yHe-Kz8 z7#9OP!TyRy4;g-TY9Ia$oS46xE;(it z6VF^B6iLEalFw93cR{Wsg|Ft7O2I- zj?t6e@UkM{vSMq45Z)1^C5_LX0p0Y`k{gH(eWZRDp@|`Pr0^hKsPw}(e}O@XdyZ;a?5K#bYJR3M)GiFe z(O~m5EzUSiVXytN-1_`URgwhVTl@8S<(A}}3X$ygh_XuM>5xZY5hR=Z^D=Fa*!{j6 zu_h!nfJPKYR7yIQ#$3E|ZDs#?Znd4|^($L;E(1?fW}%j3S(G#UZRZ8~REDr)A9Las zsyzJu?0-1KmW??JmVsedyl`-sfKFY-9~Wkip|lV{^*rP(2Jzg=!C4^HFegt-9GBp2 zdk3dPDF&Mmg^Xrp@2Fg?H5dW>HBs~v(4O}S(U_}OTU-#112?2mNx}x)v&sb$mKSz$ z+J6$IY4fJ}E!-EknQgWh8lew+=qnB-ghBcrYt(0>K`Kgfej`gD{W=qnxUPLREKk<_ zlIShI#%-*|*)ouw#_b@ay}Q*eJ&@R^&Gc}Q>^W;|o9Am^OtOEQYgQEQyy(zYh%$Zj zsR*jln<>@=o9M8=MK-r|62zn;Y1Lq?WsFU==wg+W=sCB7^RB9SU)%+a^k^h8SBU&y zjW9ELff2Er`$KZiq?~j4Fnf&5u_w1=Xtyl9&B8;+s<5qUSvSu6xhH-Tjx;%UA<68# zK z6_QFB^kqZFZ_E%<3jH@}xb$%|OY>llz5+Q(pDR37TGifg|4$#mGNJ_ab>F=j{Ft$$x z>;H8^*Hk2SQn2V7XBV|MvtTcb4DHwKF(LmE!YVDbdjDQ_!IsDD+X|?l;<}V14 zXmx4Dd@VspOU8&27|z{4VFCz1WXnDa@9%dR9hJw+#RDojfPmReAW@DrAF!sTbq|gg zOx9db*$Dbzps4K!_pe3YMZ=@Wr$XYNsfHZzs@5ovH1R)6ANKjI@ih0UfND$Vd07wW~!^0)Q-w44?v(b>>!@k^9 zBMnMocXE_fmMEIJL!u~)f1Qk9vJOTLN?7dVD-#41P3AbUO07@_g5aqjU^ITfp!7fD Mt1dH262RsE0>aaxJpcdz literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/pos/button_card.gif b/posterita/posterita/web/images/pos/button_card.gif new file mode 100644 index 0000000000000000000000000000000000000000..7413c289b2c081e236c252cb79870276539d21a3 GIT binary patch literal 1883 zcmb`E_dnZ<0zki+VqW7KY0+qna*fb(i{932OR4II+81dwYW1~GwPtZ6BGuF$u}4rf zYL`ci#z>41a&0w&sy$<+s$TE^@Xk-?r}N9XZDw*s-_;&a1HO6!8yg#|tE*qWd|6vt z`}+0k{{H^r;^NWK(bCe=;o;%I!NJPP%JTB^?CfkLInv9=tAC*X$B!Qz4u>_!nx3AX znwsMAcqb<(`T6-785x{84wXtB92|TZ{xUZ=m&s(7l$Q|6#JRb-k&zMKAm6d^v4Vnv znVFgI-@liZm-hDde*5-qe0+RpXlQI=%s0?CH7m8dyE`i@D=#mP!C=(X)v#EsSy_3<|)zdZlld;j-`r7R5?9ZP+msOT^baXJf8Ko7a zbUJ-~eSL3l59@*5+}zyS+S=aU=5o0^J3FVRr|IeGySuwT1^9oUz=MJSz!OmaC-%=1 zfbSIVPKY2zl3qoA8fM=-P~o>VG0CNLw2uXMW;r|#4mg4|o`%5#kp zki5xIvexm)zmqa)b5{mH0G((Y43?H7=%)-N50{whc=nfCtR`#x`N8IN_FlGOQN?tV zRS(e-WfGZ=lxkn*+7B*S)w|ECVY2k9r-}o*jOxvQ*O@7P2#)7r-6O!-ay&`R#;sy& zy7e6Ej}C`@H)f(e6Jy~{L!Ql+jOMqHp_=7+oU^6`r|S-vR9zUL#AMt}y(Ig?1SYCn zbR!gHUUs!S_-O58ZIX5DNp_?266QtP4oX?MFL}%2y5#1GUm%mYGhmTf|0Y#xE!54< z(k?}J)|<0PpY#>FKf(#J)mAc*#zkY{aI46+aYt{eze(sb-Tm>fphmm-sPY!wWLrqQ zST;W{P{G9e?6t@#m-9wI8~6?EP$7sBWGYWq)nnMnfQZ!*r%2^2g$qwqGL9BxB;vQ} zDG!J=0Cx}>=p2nH^ihIdH!;J7Yrz1L#q~ZJcyft?sS@RdKg#JDBG}3Zbj?{Gl$ID{ zI${|NL;Wl|z(}vVv@bgH*%zTng1iR8vqQyXmTD1@mH)iAaTt!oStI5 zykbmPto9#8KK!se1}E!Csyw&$@>zuV%T?oSlK#S`_njrmdxICQ`a>$oDVzrI2* zqqv?`v|+`xO^D*+L8J=I)3q~Ddjs^M4chrN1d#%MNve5pm4lbU*gShA{s-1^qi)

    oQ4t9{e?krN(dWy4;bAGg@352LcSe$d@mfMU7+~Ly z+t28>Ro=tux5c2IGBf^KtzMEhM~$>hx0?{B55ZRa?B5ag-st~u0#tV%3**E+cGFKz zr1Ne=7}3d2%HBX56m%u9amdl`erDXj3BmcXI zwcIe3s2DOkM?kddG0Z!NjT1-|@l!C?Rtqo!TlI*0q&}830tuk2d+!|~v zYW^!L?vEzGFHg7tMehXNeeh?9G4=8|^d-Ex>jZc3;pWiwA;0)Y4I&k8W+#mg=hM8% zr65I>HP4K82a?S({1DGJ1%ZU9-wK7qo8Ib7H?M>WKOYxas6lV~4cMv^6~wCPHyo6- z4SFpBWNg}b5q`2>=i@tl9KKGqKg;l;vJNiY0A9PeOUUC2fUHnz9lgtrz6BEb4wbrf zfxsW7@`ZeoK}jJh9=}DAb?f4ga^SIpzQ+c z*l@_+E`z$m=#N0d3a4b@qyn?zXiU17%2h=@#t^fc4 literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/pos/button_cash.gif b/posterita/posterita/web/images/pos/button_cash.gif new file mode 100644 index 0000000000000000000000000000000000000000..720026d03d0bb649652cb5bea12191cb9a978b60 GIT binary patch literal 1908 zcmbu6_g~Tp1AxCwMX221wo=Ppy>pa#*88SiqNmxpS3@vd)u&TBD@zMG!I7zNf)fX5 zCX`mLJ9DHdn&AK^ngiT3H{wX|y}#joetLd-etGPE!CL-=_X17<(;>jp($f6={N&{1 z!otGz^z`QD=G4@bR4SdBnUP2&TU%Rmb91w^vtwgp9bFxq5>6+-bANwdBod8`j0_JC zhlGYu5-98v_V)HRr<5ZSi@tyV&gb))OlDSA7K_CqJ|yyZJh51umzVcA`tg8pps%m5 zxuv7jCL!j_moFWi9W5;_`T6-}m1PVDBRxA^C=?0=g3q5ncXoE}?CkXP z^bjM6+1c6rZvMo?L}6j!;Naly?ru_Q60?w5TVFdqKAxMKo6bnDsjulD=pPsyh$KgL zbaZqHx+u>mU%!4G92(5Y$>Fwg%c{!y`}>=kn#!xnhlYk;m%e7cWOBJ&zJMgwvj!9iwb=GxlY{{;BIIl2u60YC^~ z^iS!ZCxFZWDTw?>422pS7oYGfF)l>=Lg0&3nu3Bxh5{`+FfBKW!DJOM(=s#)f~@?& zC8h9pa41x^5(+PU`@W{SuKr^~T}^qVY{Ru6ZNK;BHJ$C{f(jH02>~H{x!uEpcO#-I z0atcn^qm{|Y-R7#HzX3Yw!RLLKyKUsfbDI`1^|(J^Pua-$H-l2#C9u525dxbC;Sm> ztZfkiKO%9I1rl46b(C&tvXcwil5`v6e5#3wJUUJaGm&qga1IT~jUq{J2@c6dSL-9y zHfCD${o~}c+*b+_ysf6Obra$Y0FL*RK9%=f5_vlb~$DD z^U#_LQ3OwCPx_g$TcRoM5E13tCyMYeJwrtkGD2HqT;dyrKDU@uY*g5pP2rP>YR~bw zlDacA4+u>`OO6m}ioK=r9}468F>6r+xP={jlYBxB?H^}YdJ+rxpA3T^$OV74znapj zUZLYWD89mkKU0-Db#nwy>OZT+0!YauptPi(jZ5sEZ@Fr0i&S3j=5Y&!4JVs)#c{gdC$`XPf-HLTsS zn8Sa<8>!k@`S2(;>SU?oXhlwdWXq4FeMr{a^=`H5dkE| z^2~$kmoQD$xLKKsP<-A_P&v(xce+bV*{7xI$lDrX1->5F_w+IqTx^}~PW4jcUlzmb zej_69sFMwfIZ!=oUk(@-;eAi_bOQ%f#-gtUnm4Ijq>@p!yn1&JKnZK&Yq^MisIBzQ z{LX9Kvo+^^!p}A1aq%&`J9y}pt+D3*0%6dqso{fdvpOs`!T_v%NN4thZrW<>9!oXg zGPQ&@SL8JBmgtLW`S-rEp{0(4_^{w)^MQ|onJ^*AOwpNobkyY%e)!kt-C%Rcl1YNw zkF+CzNT0l9{0kYb7x zEVL&^G^~WYevzt8?8%;Xx3GaQ=uc%q9Z|H(!Z9!r?>Zr0aRg86<1i zP8XsOmv3lq15rH%LKtl@QCeg`7I)}J67$#wN#h10A*eL;_V)JY=jZqL z_xSku>FMc(iiOS3&FJXpsjaDLaB1J)-{9cj&d|=+*w^9V;r{;qs;#Qs-QD2f;Qjsm z+}zx9cygkmqWSsxp`oFgnwpoJm)F_X&Cbnyfqc-=(4U{5yS}@Qla8vcs&aX9%gf9B z{QTnL;-jOZ)z#I!zPy~AoZjBvp`@Y4#>Uan(XzF&&d$!`(KoS3VwtKZ41ejE#&@=DW(4u@MXsPh1`Gr!T)5DHLjwT< z3>XkGqC>@OW7dXqCNDyiIAAK(s!Q3Vxti4M zQM79Rlcseu*G-(ec<~~2dsc2-t8C~lbz?VgUcpTh3=jfmOA9n(1BBh#*Kb|HX)~`) zyO}Uyyq*gizT2j>Y15oF5B3b2^=Q(kW8Za?h5;KLaC&@5BT?l;vOWP{4o#eJ=D@Dw z$X0IJaO~5bkB7#){Iv7u&F``i;D!Yp5D3_mrPxvD#Gadxe{TJ{_st z^Yh1XV;~NW?+COpo=WCX)|qSB!Pf?R_T87De*57!n`jE&2VrZUxe-7dCggV409ZK% zl27MRbs2mOKA56~3sR@zY%f;$oN_C+$C`#}*Z{`~Y-F{UQ9q)$8iFdu$lP+T&1jha z8%D+_pOW+;$3_5Z5V2!Vn#om_Rmr&s+I|<#N1=^&y%*+^`rU{bT>-QK0~{XQl}2%c zNk?RhOB&bZm;0I7XL9aEx94mVj!7Jb?lHxb0d92oLK|wZK_79er6>Re6lhSWamX<@ zDS{XxnrNpIZn_?xfCkFxW@!kJ1{83-5J#k=6?Uk77BsNNu4}AN0bwNU8pNrk{#h8L zYLwar2D_5brJlzYJDqYs6rpU3(@q!{Qv#sT6%vxBQ7f8;2@nCVyhfm@1G_@tVzJJt z0l>V;mZpXZ&HA~Yqzca01{P~L0YJUTE;uM+fwjs8V;-o5hM8l&M#HWtBviuxt|G+2 z?iv_afB^&+G^fE05I|6YX=Aw|jn;Jbzcaa7;{1tBl^Ll78@aO4OM&|LG) zrIoR(4_Z(ObGSL_;r5o53M#l5>Sy9V8mUcAN-DeO7~-@E?3Ys!5`-~^ge?07_7~?Aa)k zHUh@VX&r&?e#ZfL;A=D>FTL?C_nG5u{ue@kko${Yw$vG|t>FlEK|u*Hz%}Z*Yh&($ zz}a?XKe(waS#gjcx;n5o3be~EeS;tTkVU}@;)yy(!q$!2)FJS+;Ve@L(pv%(1dK62 z19+RA##+|~53a#oW?KUa;-CQs?5z!Q<5=e!5QP|Ia92&J-4BUKK{uFd4IO}A1vH>J z(@+peD6G{AIpm=@fCwvDIgbp_vXlfE5MAopp%Q)QE(U0>0h*&g8?IPC&HdnsYrvW2 zG$q9*6nV1Ob`hXK4);Eoex;q&S+^%L%ItCf~J8| zm1#aU6PjV7`G7Qi<^d#-CSI1wwbw)wO!-mMT&CnEILV1lfw2>@PKY7(w8vO^N>!lT zIj(G(N>r3m%c2?;D@gInRL!Fhl=8X16BdUwp#msD?INvPq3S)VS{1im6{}hOlTWvL zmuv!sB7iC+vMG}mBvtrO)v9V6SXQ$m z7`sHx4O6RH#NL^t2NkS3JcStms!F)R4G%wVFr0)A7uLC2wXPt24&v5xJUBFNc@&yf zMz3?7kb3okbq!u%`N}lM9_fPji>&Zsv)SVDZ*g!)-s4;|s$|;pPh!fcT>HAy`w-7Y z)LE@uTYFc$GE{N?3y@4zbsXl|6I!L+pS&;&Sk4kPu)$^Ma3M=udmR_0#$#bN)PR7k zPA)Wc8q}wpXB@dG7qgkYYFsf}nt=Z0X~-h3WXEel{FHY9ZO{=M;;?|cssW!Il}~A} zauoD(HnW=rFTpUwUlTF(zmlz&fTOyfHdzS{Y2d;3!{}0#w`|G61g!8+c0!SgoUykM z6%=+elg9IO7$m}})TVsf+qMV*0B?c=8d^YOCh*_`A6P(+7r^5lwdmJdU!Kl}y+BV&=(Jwepm8EMz1{xyM@8a+%M} z1wp`I2Rm5862jmG4%qq59LRv4^?c_H%wW$mn1KWaJ%I@f`p|@S0RakNjsT#6CJaFc zLDT_^9Js&&7AUl)4UOmtD4Nj_dGt&cBIyJaq#g&bG^RIQXbBja(-O$Q4j@5mMub2H XCjfy5JWy*$+&b60?lrAv5C{M}q+!V` literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/pos/button_cheque.gif b/posterita/posterita/web/images/pos/button_cheque.gif new file mode 100644 index 0000000000000000000000000000000000000000..6c286714bbd19ff4d59688a90f9d970863757b38 GIT binary patch literal 1990 zcmV;%2RZmhNk%w1VOIbu0Ooc8?d|RA>gwd=>+9v^<@oscg^Gpe=jZ9^ z>Gt;a_xJbc=;*1fso&q<&CktgaB2Sj{@~!?;Njri-QC>W+}GIGe1Uw;&dvS({m#(N zs;#Q|`T25ra=X5}(9qDLqN1Upp_-bS%gf7hcygbgpP;0mmz$T@+1KIW;r#sk#mB{j ziiD%1qt(^b-rnAzprFpq&e74)%F4>b#>D#i`m(jM#>U3HzP!lD$ef&}4 z*!%nY%+AcAq@m*C;@R2Rq@<+d)o12@So}SOq&yJIh+S=OM+uD19d&0uP z%FN2c!^7L#+r!1f-rwH2yt%r)x}Kt*v9z(4nwE`{jj61udw_e;($LGz%iP`E*4Eb5 z*45eC*_fP|(9zJHot=h@hQ-CjvbM5~k&Wf%41ejEHt4KXj6lloApem=ctmbe5i)oS~wlp_Z5$qjgAa z0z`eV(wF$sabt7%Dv%AjBv(dB-4GIMT3e?5Y+|jVz z;I`4l3FF?dQGzzL)a~vH3IX!-^9A+=Yij@i`T6$r00RoFch6qGeEayV`PZOGf-{2X zWP^t-9yWOf5B5t4fQ`qG9}{XEsgI+{jv(2%S-BF9%av^S1uzf*hbj%%3f>EVuVhM( zEL*;O8T9AJpl*l?g(Jr$Q#o^@N|o9ajvD|80O+VwW(Av`3w0(0iqxq~IcUwQP3n{_ zTC`OE-%gzyr>@<*QRTQ%0Eb4M7#-Z`^HMESIb^4r@$N;ofpIjO&Fm`pl2UbmU@{r)Tyu| z&z6l^&YC$O{ze7hCZr17e3zhcDn9igc{~aiVu&fO=tcl;98rh= z3v3SpAbMH2(Gp@b4*0II+T4mdz3nP<%bM~i-mz$jCxNoDC9 zH?VeVj+su00hJManuDBg@Bm(<&OVDkpHrIQ=afc-nL-3|Vo(5==TXR65^>1E2C+oO z`9=nWYU(Vx$j(8*r5wncgJdO48N{=1Y}*F7-xeIE2UP~a!<1uC23Nc4*0DqX8}826 z7+Nh%2}E#jWiTZQbFeU_19D(7B@ekyxx^e7j2uS*QyN@z!U)8XLd~5r908e7Q5*+u zBk1;Sfds;l#gtX7L`4ZF)F6k*Z#XcAohWZXZOzSA9aYU?f_-qoU2h#*a}-ABSsW@= z2cH{IOv%L;1ZXj(6H}jD=gD(?Fy+4#K%hWWF~9M0;W@`~X#ggZz3&?+#GwELpPmSn zbI?gQ2X$_b1ydSZzcEGLRqyS!0{9|;F9cBq{00W8*Tpck2t*|>2D4jjIcxr@$DVsE zfdrEpSI8NG6=+fIfa$tl;ChuGNOb|e1lJyi-&39tr}Y8In>~$BP558`fF2FV64EPq z0Yn&tPUfH-7eK)JYBF%puL#3Uz?$b*%^PnUi~9>#n~ zP~-ucqnaX=BdMtlY?_0cUg)40Dknc6dQ^=36f3(3ibu3D)R7W(Ax1f>K_5cSj>=OU z;smNs3s^v`!qh|{UFL(n0#;{+wZG-G(TiJ*5uh$}moSlW0AXa}pXOLcbREYzaadQo z-nBmuE#^K(^dcPXct<^sk&j;llyN=;NX}f$U5`m2cP`hy_R)y{ICr$8BO%#GbWxH* zMAOX>C8!pSmB~1+R19}+_{c_<(TS0iBxC>?9c3&)4t^})0%xPiw45(!j1(mkaVW=R z&hbZb06-knQ-?VmKn`Kjpak7mqqev$DM5=&Bkh<=a*l_0aR5*q++c%7@i2I8Lkd}t zLeK1s9Qg9(3y;Sutt@3Q z8GJs!tg_4(=R3d{`1$i^T2|T^YmCd~?(OZ7$fSvhiC{u-K|w)6a>CBej&G3f7<()~ zKR+`wv$?f7FE5YDWHz-nl~$D2zONk}8>My8LI@#Wcwf@8)6%okYd_R>(mVV5`U(pR zCnqO&cXy|zrbb3ava_>!d|q#VZ*yBSi^XCv7<4*4BqC&bdO9jLiaEp_8XC$c=XZB^ zlSm}LAiv(;-tXVP4-XGV#Y7Db4VF}tu-R-fncO$fH!v{J&*=a0<40Cj*2k8QFXCS0 z=H`AL`AqMo7nc{8SCyBPmvF{8qobp24x7W_q-Le2W~NrZtDY6ic64;Kw6`!nF<&LU zYHV(-sjJ~n@yExgwv++S<2o-`3aHF>aWzU%v{4 z!u|dIjEszpjg5Z_@c;ae3~26%fdGI2=>3=f-%kLrePAD^Zc|O7M8Xtx(cRVgRH6hV zqk5{ifEK5s@574b7g(Dgz8bh|Q%kl@I&9=?+*9jHOHsT2voXmHKaeHitBOPcgkQlD zUQ?fK?MsFVZIV@w_6{Ed|8=ua7Q-2KyJZ;u@0p>Vw_5iLoF6Qr#C1^84wFpP1Fa{dY^p!P&%INBX&+``=OdIE(Jb*x48j74gP1Pyu3;61A4lFhu1Fa z>1=oM32%5yP^u;VR2w|VJtg=)pr-t(^h^^G7XKSAuBZ+V`u93HCcjD5W z1UFwFerJqYTQb_j&-9t48chD74)I;lnXCJ$dYFrwi+!8C#$4|1({GE(#cKv_a-<*I z!XwYZ?}mjeJ!jUV5u(|&Jp6zr5>N>5Cr~w}LGqJcdpnMK_yyO7yU*1WY>;7a<;T3x zkd(&-G3r=j5)oNztQB*Nj=P7z>5;k=!nHNQ@T5|aN>D2Z=MrtHknVy%4c015(ot2J zj)B7uYlYe6&d(%YpDeZpLO-utOG4*=gS+M|T)5+{rnTb|cSgBUC*G;`_#DAYKy;1q z6G+-1!~t+;8g%_^5%$q7R({-_jvi=M;ABQgZt#>zVRY=IqLrIn(V!>hH=Cu223f%SYU0?8#>Cqk~- zdY1R8vRCSZGsnG?ysR46;*%5Xw2QpXb)i9_{#XbiXx`#j;>jxAg*Gd#o|(?*`>{S9 zs`uiBncHA>AG+GqK>%*Q>jFU@eC@=eC>tHtFGJq-v5?XhBzDn~ZmtvR$KZ9B_9;l%;)Kv;B-ofl33Xnhyw52OY$)N;U zDO+Z^L^=rE$)|}jn(k4gha**lI3L2Hb`pAJBT0FiNxalw6&T!&LMS{VnAP$89yH}h zR0zOkC~rAE9z?uCxn9S$9czGh0)-%n?_4R^$H9E~1_~tYydo~1-aaD&qQz~zJe8RM zVqcfkTGNAqJ(!LdEHi3UMD=6M(S#&J8uZKxQclM5(}9XniE{X;ls;h2AFIHKKlDc-c*bC} zkX1j`H)xoZWmM(ag#`0&Y&lRq_zIj58e)?zw))jXiaQstip-YV;Mo`{0kL=(VI=Gq zh|-3Or%c1`rizqfR7ko zfo^pZT~vLE6g%`hK)B9%^2%rV$ngu|4OG`FPp@T8r4$1o-DR?$+$=jnCKv@RPqdJO zHME1)3J2^0F_8}qatR7s-~(c)tYDmlMWt1Qs`E--r`;F$fl{UdP2rh2892Bl|6BQ6 zSe9EhTv7+07Z+>b*tB@tT8QestWK0!ZH`o|5D@~e9h6V0p$|Y}7J;0Opp1CgtH z_EYK97S+UONI5G>vHjvKwO$|6!yHmP9O{0%T0}Q;J?X*jyZ^E((S&i$=p-l9yzT<& zJ+^sI%ei2FoJYQlbN}Y<4CIQ4C7}CQae?CicdgA;>*48h>D2yNmA66r*X`|*5Dl9X`9q$TUNW_jV?_e} zyj9!4&g96#kgj(-JA+;V-?oc)Xy)h|!f7zOT0ixS-mkIO?yVZcu8}X8w75UHf5AUq zW5iwJcVRLCEbK`j7hST(jqLnuLW8|5P?)H(OnOvZaX$1BdE%nG{c?(f?3^T zp&`*`-Sw#aC3UwzymA03uf^M9t@O{)?+|!8(%54k`v=t8xWo3nTCaUkVMW+*&2(1o zvZ4Cin9B}(%=3ezb^NcsV1+xd!vxTdST)mKD3Gz>`mWY8&g31uOP0>Hyp R#Wu^_T9)j>Bk=%m=|3%MMO^>@ literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/pos/buttons/Thumbs.db b/posterita/posterita/web/images/pos/buttons/Thumbs.db new file mode 100644 index 0000000000000000000000000000000000000000..99b1dbba5594e8774dea6caa1cc12701ba61b9ab GIT binary patch literal 31744 zcmeI52_RKl+xWN4b3}v?N+mNH!XY84lrm&YW|B;i=@^QVStvp!G#HYp5Sf#ZIYZ`9 zhR%`U;BfxWseA8x@9lQq`@Y}%eed^v|F(YZv-eqNueJ6%Ydz0;o@edzriE$fP9DcF z^1Dq5Aw|{+)Ck3|&Xd4vB44(R2(kfQkOAui0^#dP1c8@7w*R0zum)wNhsI<6sV&K2 zPi%8afC``nXaHJ(4qyPd0Y(760tgeZ3E&4<09If#zy`1bTL2D#6W{{20z7~uzzb{x z_y7Sw7T6B#00e=Zz%F1nAO!3IgaHvi6c7W%0SQ0~Abt;}VZRrU0pxx)U38{FgpY`gcBd+ru*PSaBT*G2IKBuZg9; zwBFzO;Geurfovclem{xdP2$b^lcc|StN5pZO%*YRTAL$h;V%4Cq~E0bdj}g~6#R7~ z{k`tXT|f`e z2MmByfFWQ67y~ANDPRVi2F!sofCXR)SOL}m@w;dX*a7x{18^1~=6@CTPQZD<8E^qy z0XM)MxBz$no&d2odjZ~n58w;<0cgMPaS%?=QA%)M7kyDeCQ?t<1(zE=-8{q}QM1}Aor%6fpkPS>Eq)a4)8shhe zgd9psEbvbo$p$DR1tk?V4J{-ngdR#lO1goJlvrv=?F;WCWK87D+r(8UHXS#o5_KwbWL{D zd%B`yG{apqg_`UHFS})Meem)mAjPs3xWwXNgHF8oJ$KaP`2_-!<6xMg6Qs=kXlPBa zJRvi6)%6+yxq45Dv8~kZ0uPRojeu-2=FZ1f>u9q~dFcn2ab6s8@TEC8+;NWg*})zY z0un66FQVa>%y`b;VX#-Qx|cCR6u&PQT@yQv>C@a=Tg_}`r+$Hjc5Y@?Qz}O&t&p3c ztp#5-jlwX9uJ1@DAXL@~1Vp(BML>`d0y5$ts*kH2rl+lmp42aSSH=;0qoYn`_vN}{ zk|dY+P}OOB`F7V1QuW~Sd}Q`M+u%UI`^D+X7t!S(H`l$XZKU0==&V@XvkIPgGx8~oEd=BM+)EWHx@W_d7Q^BEWQ_B&Ug&P=Y{l^CCYN$H zYz zrXnoz>RIUzcRSLbKTY|xmw;@qEqi{NAI&~NhuR%mS&<*;>7>^-_6$q65}b6m(%mV& z*EgBpR&V%}acR)!DE5FCxyO}cFc^iYMD#jYCa%MAG@KMA@^hs&)AGMA=kaT9_Y^c~ z6P;B!E|SR*XX9$_V1KqtEc$S5Ip%B(?WShena~*}CLhI8oXOCn&pwfd(ndyhT)h=N zHHV|~H}}33bZ$`S8uOESQ$Nty-DP^o_pE=rV#a zElf$ZBsRXZ>-r`%Bja)eu?sM#jvAOsVUJ$Dk2|4PRMeT3nPOzOSvKvdp3Rv|kY@sm z8IpvapT~NbgHV3a8$eWjk*7r6;EN;>6?iyOR7Y|KB%&MqIe~U-1~Ud3&>n0+suE@F zS51Pb{UF~-E&fev(mzQp@l9%wH{ZRsME&WaEFY4ZRYPt8D z)Wn$|VyyervG=l4>}eUqA~t^aXqacH04w+?aM`MuQNwhmF7`CjU8TZgF2 zelPX6twYp$znA*k)*kwzs-%I^%>k#MM-%I`N_nWAle=qg7ZAsMQznA*k zwj^r&f1Fz4589ITPf~x|mP9MU_pbeITN3RJ-%I`5wj|C5*omqCus2wM)@=paxC4wB z#F69I-$z;a(3anQ@@M_I2Rhh)g8sZ4(f^@8f0-Bj=j+eaRpm^rW0;J~{F7dXpJ-+p z9h}q5+&}%gb(cV%ag3%yVh1;4D>VU$q5uUs@FfZtT0Hc&*Nnn;3p=W(tD1mp%XZj9 zZc9qJzA>9^-Je5don{6kaHtoKM^({{o)gn9OgxQ*#SDXiP@}TFM1@5(oE9r|BaRPFKg80c& z_~dm@PIc60q_qO0??gaq^p8=oY`)E4>B$CXNq#=7lS(pq+h&zgoq$wY^1!ukl1?3L z2~g(N#9CL0QhOfqUgLh%qEQiH&?zdldN6xJxt{Xul{*RiL4gv~TdD6BlqerQOF)VoOi5PHt1Z4`t2`#a<6tMPu0pYvVttanwA3cU z+xj`=%JcwpE}$7bVg`l0+x5t^dblE_%zG_$tu%A3bXCdO)p7L$|J)c)?VMPPO6ALY z3!C&cUYQ};_b|n^pI8T~PY*B!RreaV4dBdXo)~Mn=t@S_2O~3bEnAE&xwH` z73DR#*S2F4qwjG0bc9%q&x^%*_KA73o{Hg#kTNZXQj6jFh{b^u3RLYcG1Y=gF%q>Z zFUg$iD8vIUTOUbOkf#^a>p(l8IqeOj+H>z=7Gejh1enk4tfA?u5~Jd*^jw+<^m*;h z+T$aOYZ=YfA2!X$vYAC{CTJAorB3(yUOyVsB(FqT%6uVHm)9o4;ce`2afk(0sc?j~ z-8su)Z&lmML`&>aE4eOh@rBM|7As{1_XlPBFiX_~n=m&q%{MbN7%nyPNng+T%)jSS z0@<@ODh)#^^V9pdDKV*|xiyg+ak0+G23qP*YuchFr zhs-u=WKFK{#G*Hvlf@cqiTQI)oW8KlHMYf6`$5KlU$fGNvaa!t^j2D_rTvQzD(+&1 zG0wLRz6pM-Ef{7ITfZajMpg?o)-P`)mvOzdf=$|tx*=25Idd{P4&EH*M3+ zgI?RbrQM8@WY!i~kZR-5ldXuvM&k4nEH5PTtWmXUVi)&UFnnSOn@!~QRkGi8{elwd z)zlXQTcdR&X7;`vqx<|m$HB>BVpe8t&SB)Bk9L;PfoQcyW@;SB!>cYsJHbYe*{zM! zS{PiRw@2aF1aWUDdn*OD>Q;P;JxVi*Gg@Dk#-i}sS3a##Eb!oIWAS$AVX^LtNtydF zOEOL!RpxQ1;ge`_@Rgh%UM2S$YFNCRfK19gKoe7(==E%@*>F7ERflJB>C5%S zmEJeEFLPXHu1@n)FBdAsR$QsACdvKi?@T~MW4zGMj}ee6rxDZ&9kXOmfu#(STHUI%IH8l5@cOfG&U-rxAN3k5gQ)Y$sAD^CGyZC}K@|SK-TpSW zZ~?u+8ft*o|uX7hci0&?2_2YKSZ4 zixok~FY29D1p#3?0^_xy8jRP!sEH+E_tR{rK<}gsn71GxVt>;!cVhO2p~p$m&_g+c zAYOBBZ`>)Y%=Ho@0%u8oKAWyY+N#{L_(fkOD!(5jD7&IlH~1^Wjx=2|WyV}zT2YKk zi9~bdJv6mjj5cZxh+ybpQWeplB(r3e-=t>e-1*5idIi!WerP)m;o|B{%%`ggDi(_GgFc=$$0h_zXSW&4 zo;g(DB4op9#DCT@Y%Fm_+ZZ>TV~1uc-#vNy?e>J=GNs}#FM_T-q$guTS`)W7_ zE+zEF*6~I6+Ob-aTnK!XMZ$ZY(UkJ`gZynfB9rmHqr%?xQ>#i-AGe|wT zpEORq2tB3JJV2o=C*7s7x*u1sg>%O$e(FA4g5?Ry&Cb?Yq%xXrzbc}T7WYz))2#g= zwz4J1o`*z%_Tl6Tcbv!VJu7}!^0!}NblHcn!pw`}#VM>>P?0l(=UUWxO-` zfXgmQ8d-q|?XBYTQfO+0-6fsn4@-`U4z;UCa}C-hyf38DZ>+;}Q*&N<_es|p$2#;t zVOu8d)coPey=>@nMFp$I1f(=+e0k|pzu)S4O|JP5YB#1^1iA}(*jrZ5d`NUJf8el| zyfw66!%jS^rs&>?Q-bX0D~!P(mR#G)W1}_*g<&-+2?#B&w06bpYN4=_M%VniRGX6E zk%L#>uD;orMN-XtaUrK+j$AygsT@^@8a6eF?zKhF^Q#Hg_t4;bGBk^e_4yxDTjoa1Nhb+NBsLZ^vJe_Y_QpjW6&i{a z4JoOG5ktW|^X zU{n6BwTNhEB6|A&Nb55Lzpo|uY0ZD}zup8P{_n6K1wa7QSy)Ke?R>1|9AAi|3?42!62)j$mAg9eA2!d!-2)mGp_7siXW?8G`PIS zi0+jbGLbS;xE*)(wxOrRk?z?AEr+c#$1m?F^1i7{7tkSgJhq!M9XY75mFTp7iyqayN@VJkUuwB9M`(OLAO~(R3QwTa_bn`)X+P@zg@K55_91?BZpN0 z&%y*7L=k8{gb0LcFX7h0itd6b%}TYojAv?RpT0V;eO~r~laIsg4~hNqisShfjt{jX zMVe1_TAiI=*8J4h<Fy6arT;%qhVOWF;O<{K7o z)883t;xE5RbV?KNjXAEnI^NLi@`BbQElyd%(0A{)hxSUloxT@%Peg_LZfTf!j#K^n zgi5d0I&|xHkf%owW6TqAOkH#!as0q(q`z$IhlqXp1&myt-s?eMuiA#L za=y)wIFS0)^PVNdU;7Ddt+-$N@&FrVp{STVB|(UHx2LB@-wFw zR&~(fhZUTL*F%ij^9YEU=DL)Dp2ii=v_-2jEDv5ld;4rkw|sDtxs~IdJW1)&7s!QX z2~vyVQNtw^*}|lP_XGP9-{#A%<_}vOozJfnUVZwsSX_ka8cKxm!3UiF!&FY3C$~E> zLS(}Uy!~EmT|jDr5i#0gJF4y)!%J+^V9&$3iIMQGlJ0mJ!y^M(iTTUxp3km!Oq@CE zZb~(jk`j`>hbKRx&|y?oH1>E~-{E2`t-}NUzT!SEG0wX-9|8gbW*vI@u^GWii}{)U zUe+H_bwrETVD%W+loxuPToBiK`iZoR7tJ^x&C5;OmES%c1NOHaIp`{<;b8(I{!`%` zXzNmTwMz5Q*mrgH7GD3{=*U;k;z9Fz`s5J8D3H=o_vgycIq;QPfiClFKbbO!7A~TE z`2%~G8TjF?AUe$gv?f>3nCKuGh&e=)^53KX{E&aYglYYVKl@(%StXXThF)|yq-tiL zS?Ar7lvg{2EvyQ4Z5kimmpwy40l`VBShMPql;?JtMz3dB>tffQB#hlI-bg{?Qu~Ce zMd9@6&&r$*e-f^ync)MmaM?~=i}H)9?wgv0D6ug1 z<~hTr4b7QuqgfUy1{Rry$iqLCk&Kb$qHl4WM)|F0+6qw{9XyUbfA!YRS*WC@;$ojG zLiy3*MD-xE8*1a^BE;d?%Nz9@Nl(085aWFsv0Xs&$)>76Mn%QR4I?-iO|Z*Y!?;Wg z?~>|)OiAl*p4M2qNEF5GR=CTPk1f4Ps80w+ssA{At^-(7P=nYQPOC`1-4pYMMp6SsyZ zZSyDjM}%ZyRyiNe;za)Q(n2gll44=>hH=Yh`|~V^&dH4m`rC(uN;e974=?6>XP8u? zZ5=aIq{{-{L{ahczj;F;8svAUww9TT82DB=VX>Qdl=&}abuDE)!j+S z9yN1zB`=?}E;!0-Ie72Y8MKT}KSgCaaLP*ILcc?2ndqqS1|GT(J6AfxT(WQNp6sTf ziSpm5?(3jM430|uB{=F(Ro=)7<8&k1Vc5ilGwHc}w`qxk-JaQL{E~sCe{gu;Yu8DQ zSCnL-tvJ_J8Lgp64my~mSu%#C`_sNxkakK9w-vY4ec%AW%0h{9u3 zd8_pEuQJQ_2`zspE&$VABV(%Y1e|l22-XUdS9l6 z5v(ietc&yUIbr4fAenhotwZEf_KjIh&FyJ48vL?b=3AtvsYj2{B@gz=`?Z)ALR?sN z-8#>t`}2J~3-hU?YJv5av{&~|VFqz7TJ-uy^Afb5JT6RGWZD_s^c0B?i-{o(D&BUm z#Vha8db4~XK1C$7_w%9PzT=%EU1xi4pBXsAwJZ@(88&x*-)GaeK2F0!7rTF|)&0JD z4hlb$FY#yBzsA&Ed+XOEGxyQZ@6Lk(JC}p*&lavVQVG8`^v7Oes>xKOYG~4bLqM#A zl0{n7ihU0?Qxvrq3JH~7GdR>B{?tai$a`9kH1()Z|LEV5y-Hr7G+CMGp{N~JtUAZz zwl2I6&gqi%ILF~n!E7b&WlTnuPMKxqyvkRTLj*`Z zx}Z7wzsU6JpB1kzws3_LckPu}I*2cXnH5TCCk^9kxjNZ&XOpcrFc;#{<80>)f?90Z{3jRBja(9Pa zpZ~o%uR(8pT`HBQx6!qO9ffXr9mX2v)W`FwV`r~Yk?oS3wQuUKO{M9@1um&Np5oMf zq7gIF$#hNqe$v|%@g=*rs83M3FGS^%U$I5s6@Pv%iHv1e&F zvRL%uQ8TV8Rczz2Tv=Z3jKaSxvz56|Ij)NDh`n8&oQ_Kz8Ju2en=(8b+jsRymcM!2 zlfg1FixfFl0kix|@rjCAdILM++`W%@9r2=9o9-CVSbfzxTgi?073$E4P*5aV)W3>o zJJhi38_FZU$Tq$GPbBS@j+!Y-ey*Cn1~ z-UXK`c*uum7tl1fZJXkHMlKoQwV+z)Y4GK1b*&gfcI7gmfyza=1?Lc88 zF4$nqv+Q=t!IORdJ#sCkfkhU7E}!$7efV&`?wE?I%>4miEsYl{P}Bysx!==tw3u3Jb$kJC*`l$mzB80 z%>KEJ7=Hn#>R-0Ma+P{W)C%P#ZsPxf{E5-(L>mIJ5X5W#y=@W_yrcM=3W8XVCxhV6&4A#*O?SbvO-c+GHmQJk5)<{4$Nv{cA4AYU zy$Sj_W~qvY)t*DO%J{@6Cl#1DQYj|6Cf2tv5|9;P2fgts z&PKcJiK{yTb;TQ4{3S}F1E~~MDEyTUVQi{JgA>gH%6U9Xk7IQwg3Hvrd6Nr`9G+M` zyY>Di)#;CSw8>^j^DPVYx(f*io2S{RO`VBFm5bfu26G$w&i=$e$<$r^szuUV=TI}w z0iP0=j<7AB!8zUW3>LO-uf9?oeQ?KB%cpT8;gv5>ht+y2_^Xf>i3z1Y#c2%h%T}%N zXtOh#EmNiJDb!d!oHoNWME{iW@(_bQMMjMQR-0|Tb$usHWo?FE8*aZO?qDidC?m6J z`>h01(*c@l8mk*I)b+CL3olEpR#iOfHE_Zs6&pQ6s&gH)?bw+5PPI5&Nf)pMYEV5n z>%((>>@nE|F6-y}jB#6rDwsSiG~b9y9qYXiTkEg+{*>eM3k{`c1xsevfXUqhu^5NS zUco>o1wn_q`=x~XlOB0^SnT8Sc|A7!?gj4zKPmf*wBtP~W3wRzLceF z{${34zc0PXdwca0A^d>ZO2M)}*_vxJzN zZ^NjLfaz$RwNTF7k?#7NzU-sKNuxraZ zDTNiEjuTtn;uvFq1%vxt&xiGP;;JTmp^mnf2LSfxBiX0^@PzAUyI9&T^+ zzwL&QzIcH85?dnux7cB_D0e*qQhr2MDDrEN2l!1ArYhz+JJ1*rZ7k83R&5Ff$$_+= z1ADVS=VFT2=Ip}xcfL2mQk3t3B)^IM)wUZI-AJu2-Eae@u%Z ze3=86^Qmr~pN)>9;vq>rzFhOe`hqHPf$0_Sn4lh_hb&X^x`=OXL2PRU|G|&i#Jn6v zTt`tGWlTIypo|(&b+PN4wxYq2m9S3Uur5V1kFLix;GDf`4{orPAPR^9;(!Do2}l9b zz+ONGkOkxbd0-!)04M@V018kBRDk_}DsTW$1JnTx;2@w090Ig}!@v>XD4-1-1C9ea zzzN_apbO{$`hWp&3NQqW0AIia@Bz$#(||c}2Cx7u0V}{7umNlVJHQ@r0L}u$HaZ7; zC*VBb47dQUfE(ZrTmU=(Pv9cp1$YC*&!)iM4?zEP{PX;w74*@6NBq%0>VNy8KmO1k z|B3Z$Zn4#8j~(GtH=Z$>rWl>vNqS3(vUQ)Wyv#Z+EK|XSI^nm;i>@J3PI%Tn0)l1j zuu|jHFg`{profoSv+Qp>h!ZM?Cq3-a2q>`lO(e2A5};y_jB5nA5zlY^WhLA$40k96 z`mvi6ezOX3iJNAWQb8Dwg=8#s^I1Mj!llfL*6FNyZ`}KEozL0@p#yGo=P$er-QprE z%g-DACQ(Rh^n)JG-8-e+jU7bc_@6dvI^w<(LrRqMjyaZ%~3LsvR*GRhMu ztSFSO)xk*V-~y=cH5OpCydV-ysaFcMkBCI^`aJ$%IY z^NdA((D0`!C+Z&Drn@OoH5*(m@@{I8ibs(sP-fV14BT|ME&M#VD0;^oG7m}e8wWJCN0$!@ z+{&SDXtp~Q`uek?_o!&34=ZL@nd_sBXlLIn=|^^Yi;v424c_nXOK(`dN-9ek=qtMg zMUNilHR~Oi@j2m~0<~YvySu_3&45Q`<948^Ozj?_Leh#u zJB2wkmifa-*cp?1Odd76)*CipY+h7Q_$YSX?UWMcoc0Pe;?yokx@nRq;i5`$hWaH} z^esfvpL{c|WC`!4#IycPhcqc!x?i%YaXVty#R&+_+;l`cXd8Dpb}1>n)E|B~5}n+x z+LGC%hWuE!_20H`i>N3Ox1Z(T;1But!+-TZ?7#XSvY!ywZ#$>3ryoo?aLR1<&S_d- za>O;{KYj5{5x#aj@An20n+C2Ce@=y&t!25)7h`raKUf=$AotP7biXL4$KAxV)N;$< zu4ec5I*jV|?9DmHrD-k6-N`hkbf$*x!HYWaqVl&O3njV z?J&1A7>=|f+ts*NLgho?QSIP$Mch)YS^n&U5l117q7H>4nIA*6-Geuuwx9{KVj_*H zeobn-GRmc&-*r-nlXo^R0Z_s9w?CV(3xINc7v_N$07) zR4p`&i#e=aBWOoXqiL*ssvyN6VM|IWz_oz)lI{-G6=Rg5&f z_DY=P*EIXwhbNVq(i;|UM)r(WaynPgS1J@85faOnpCggWcuB%?FUt9dPr%9J%F(i8vPe0tlYB1aG7@^#vWH?^5sN^?_9^6qb5K^;JTcF8eSU7+DHqHG6kqrTF z5XKF}kd_J)Fcfs9{cI@6Vpi#d<;zk-IjGCTH8GpOZun*Oi_=f5UlP_g(L+G0SLD}u z{9+mo4T-k_{tLD5G4OOH z?_cESVelvXC(IvD|9F1jPtQgCk6*vK#)EB%6rNXH6#KZh#BFqg@BW#DSB3o&4@oz2 z>v3IfX7Oq2+eY?arzF1ADRIZ>}EcUJN^*brXB2swhjHz~sKl)6Ms(X4M_e+*!x$T;Sx$sWl^Py6Q7y`TVIiJgnNj|Izw7pg1(aV)-k5_Q`YFS6FqlN zTkMy&GUIaL6v~5PE%*{dpx{>_Dl_PaBms$;s#s+qAOqT;aVJc>PU_U;APw~dda2&#J> zsaWPeYK+3K;!oA0tM_}N*L|Txl^Hh)NQ2w&Pq_CkXLk6Vyh!{H?PQ($c?~^83k7EQ z&IR1tJWq_6#*Q?ci9ovA4xch-)+T!-w6k${nZ&_T|K*|>YLY8tLKdn`N`rB(hVQZj z>$z!5<~ocE@p)4Ir=MICx=XTv#D>lHJ9l*JZBlyemw!ll_bzpvFvIu7HEr*d5;kS- zceWSH&-Wg*a_RDai$z}xSyO{>_%_Z%)5)DI`5QNc#rO(cebcutB)U1$#E@r=uOJ(J zh0Q}A9k4K!BsM4wFj1%>+9|_nTwZ5t}xXr*!GVx4o#$AbgDv!2G#Je zOU(%CpZ+-aPWZKlarhL=rC@Rmb+hJYk-feOo9GCLEhaT|=G=tDeGKuLbH{MSy?;;L6tTs;Pm7IQ} z;2n|>R2Ukgu5`fZWq=7+p6~yokPBVW+t1SbOfd z!fYiIs!EBw`?s&EmPi*iy?VBf^}Izv65Zw2DO(X_9!q9!k(zD$c#%0*VA?CX ztDkGD{3m#l5g2XUD*9Y_mV@6BkTKM{NZDNbVhCm|!LUH)Lc-$RSB_Egs^ixR-q}7o zCZ>9>+@D1;i8n<#rg1R{vz|wOJ<&ZKpW*#<#*p&{9W%1nE%}JIni4e`vxEA0)X`~+ z3l$&7&3e{G7U%X6keQq4NluT*RT~0Q+hx^+_sXak;(Y2l)^Db{`yBf|!>X~cb&70H z(V7pVX4I2j_`OehsvjEGUx;5Kb5e6BBaL9B%yl;KQnf}0tG1b@E-^gKrIdVy>G3_g z=f0qa4rj%u15?$_x^kcJxpUUdVa}sy*2tA>FnHb5i|aG#t9N%4khmWs$C4&Q7syDN zeZEA?qCRC8cS#w~iiU$}$c$^EfJ6mzlE8O#`_(qGDqt> z&2bexA-C^m8|sxO;3E^uH~1(y&3Fqr2ui53RB2qlOo#ToIjgAg-psB4zR?y;JtyZf z$4g9R;QSzU-yXdvzFV zq^21qf2{rb;@C=8?oExGX5`wTYq$6r&7WwEKm#AG4=AmW89J_oB2TYr-<}&%-YRjo zkx#>^TsdqDDN`f4mEM*~-GgH^`D98P3&jg|-LAquDUqOc-~B@V5uF>aCNJgV3p_Qh zqHt+LboSuk*4HWP;I>1{IW(Z<~g*P1H|#n}zKm5fdX4M5<&(!t5} z;KkkNmX@rR#RC>`)pb0J%%Bn;%(kCMI@Pv!aEs>)bced=8eicfZY!TUIe7e)J^|r^ zClh3NT_5#24^}9Av`y1eTGP_QzRAx*q3`E5`wV(1yviQeSx%WZmZMd&OKXxgdcAb- zv*P4am(4!a8cFqre|y)_rZgT~5k$F$YJsn*KC8@4U8eleR0?!A9+X!#XA@7E^=^=c zxz{1jr?IlVw_stNXhYOTcqltS z*orC~FKJz9jine$dMigxF-{v?*{m+XAhOl0@`KQU-t}AC83oiB?%!nO2#$8Hc=&)k zgKk!St@kaW>PsX-jcqqw%DpX&$8@;8oGL~BpNTo66rSA zDCf!VBt2Gt!$`Dw=27bH`P}rCE?tnTyVkG@gI1yIr+i-*dynvt+ZB1R=_~O)j$q$r zbd{<@m5Gz?kt3bvyFSvCo@`JYMvQb6pQfOsr^#JvA$-?f- zZ63+Ya;676dzBv*oIA5D==4fcjz1{6_N+tVynI|xHH!?NhG(9lc<$fjGaZJ~3)wjBLpAa)skyc?*9;Jf?eNb2% zBa^2<-JHx-skhOz!JplwkCa;4CT+WQe(NdMcD{V0DsB=_g?P;M!zudFLCm-6pBBCT z)GSetk^NAsDHx)_9ofV8!>ZBSEO=M(=k~Zplri{&W7_al#l(A5xq$Z` z{kg_j>*qNShH3k*IL;KlQyRZ$C>^oWUE0HyFFtH1W6UWP^N%F_>1QVA3R3o9wpokR zjq98$iCyH3uwP7uuv_&`RKZyV`J#lM~>R8<1zw5HXst9D7d6Nt$ud<{ElZyByAxqSjFwzdP)}R?IV=faemn z;Di3`qbl&L0TS?t`vdSKs{QcGA;Rzr0CMn34qi#YSuuE57>;ESl`ro~z!RfnzZ{Fh znFH`H@kr&%bM?PIPnZwp$H=~OrDHHZ-VeVAa2Wp7;I{#YPapp6lSri?;m`Kxc+!8* z{8{SX5PxV2zURA8U*abHZ^+;ASNZS#H{|aR`CI-J|N8YV{MY^mxBf5NKYFEq)c?+k zu>W{|?Ej7D$F8BUJXf+6MAJ3VUaMzxSWmiNP(*T>u?aKgc0p%MMzo7r}69wiUYHP$Nxe`~p{x)WksIv(WKhs!h!4DeVpR1miXKc|eFTwk! zg>NY4uukm3g2lFCY7xE0|1<+_?OD8jY4sDHHlKiuE}*N{w_sTZ!`!s`W*8iIbRUg3 z3W*;dp&Trs=A*eQ$2I%fe-5cCmV2T2ly0;1=uVmacDpKzh6Q4DjuiD4)k#ksJ85rt z&#Yu6r{(o`oIS*H|85HaT_g|)0xkiUfnXp6xB^@SLV;^Q7!VFb0Fgix5DmltvA}g8 z4u}U5fE&O~AQ4CcZUM;vF%FT)kL}-o2Y!}c2LI&xu^;P)e*FH|cYfLI7s33!-~aj_ zjDNX46RsskbK5fZ4Gl7`{da%H;BgBJHYB{uphZJ93e9o0crWHvbc2-hOFW+>Vl=t$ z4W;~lUR)^2XS3?(hK+~Ta{P8^d3%uGa$D}K*+$JY*OEYYwtU|f9z>EVggcXfc&`n>?V#$C^o@eTNEH_bH-7PcSvZ?Mh!cS%JNx)(_m-0xQB4fEvdhwUln z^|8byjc}61>@&ih-EQ!n-A(BfU1q-+zaoQd?!9|R=(vw0rn}mYwp%(}|3F);c135u z;&k-O_g1GhU+%Bfj~9GTn(dYwwd+p0#gAvn{x5iz?5}^HO!%i?p|yi&r2YDNEWcCP I{-uZi4{)DwqyPW_ literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/pos/buttons/browser.gif b/posterita/posterita/web/images/pos/buttons/browser.gif new file mode 100644 index 0000000000000000000000000000000000000000..561173d83a7cc91d0e2c468cf647d2b2f2a3b8e9 GIT binary patch literal 2009 zcmV;~2PXJONk%w1VOIbu0Oof9?d|RA>gwd=>+9v^<@osc=jZ44_V)Mp z_vz{B=;-Lp&&`F3g=uhU-{0TY*w_C4{?5?O;Nak@t*YJK-Knjq+}zyZ;o)+4a{c}N zyS}^m`T5}C;G&|Ua(Qyl(9ofwp_-bSmz$TewX)aQ*My0L%gf83pP#(Gyx!j4)z#I+ z#>D*m{Gg`tqobqF&d$@*(|dt?*x1<0%F3XipoEHqj+2hY#>SkS zocj9u$jHdi(b3`J;i#*qtFEj2`}>}rp5o%-Es%4u(D zp`@XFfqa;qn8wJ)kCcz!;NRQZ+sn<%v$nIHot>YfpW52mp{1eT-`xI*xA^} z$;W$ud)?mM!NkG6z`ccwg~GzZ+1lBBf_%lr#lyqH?Ck9B?(X#T^zZNQU}s?P@bL5V z^YQWV^78Wk|Nohpng9R)000000000000000000000000000000A^8LW004IYEC2ui z09ODi000O7fOdj|goTEOh>41ejEHw5MRk&sloApfm=ctmb(Wr*oS~wlp_Z5%qjpMe z0z`eV(wFtmxb|Y@Fv%AjBv(dB+3=0JT3)IEZ+|jVz z;I`4l2;<(cYl1(u)a~vI3jy-;^9A+=Y-|7k`T6$r00RoFch6qGeEayZ`NseW0yTo_ zWP^t-9yWOf5B5t4ppD0m9}{XEsgI+{jv(8-S-CQf%av{T1uzhxhpG+N3f>EVuVhM( zEL*;O8T9AJpl^r@jWfq3(>ZjaN|o9)&Km#-006O*#YLN*3w0(0iqxsgIcUwQP3n{_ zTC`OE-%gz?r>@<*QRlo_5GRKn9Ub22^HMESIb^KrvRNAofF6jO&Fm`pl2UbmU@{r)Tyu| z&z6mP4jVcl{ze7xCZ2Rv%c^hKWr!&;SQbMioH=CU|f`10TwfK?xUdu)v2IOfbO$by+$o9fC$s zR|Z(bKtvb`41lE@Xv9##3?4{T=>!3kz(G||#nGZ)BKXPFR83xR0SQdL0F?u9-0%P# z4txlOlMiqp2N+DsAcqW0mOzIGOwJ(36lY2S=KxEbsX|>9FiGqK44g+HXGX{|M;p6J zbtaP++#07sev!w~_o zJj56-9BDWZgAj01!DIy$C=AC8bbJg&Y&(*S+X%YBTi{Af7N`Z2L&R|clZxRhSp!U7 zaBa;$0}Cu19DEo6zAy_B@w{+^{P6@ivPNNap2?w7bssf(g%f0mLG~MG!y(t)fM3Am zxN_jE0UR$x(BuP?)@6dFQdb~{)U6)+Asv>(!KiU?IR~9|bWn%*K77OR#2ApH4VUNn z;;TUbb*a!~l$#%H7soPuJnjTAmx^?xB(*R#B~%k$s1!pNeuz%w*^-^oB9tM8$qr-EAZWbRs*9ZvSHM%E}e z3bfM~`?$a^a&nWMTqGl*5=uF2O*dtN-6^?a!?>tyhBSN=AqyF&$jFJ1S|V9=l#zfr z%(68cQso3^$i$Y=a+p{`WFWB_$VSZp0CG@|9q4d?Ibg|!L^KaDi2@v28k3l(@+30H zBRDw#$PRD#!JnE^l*1u~EJz7xcE)lYeJq7LK>DRxzSf2S48THmXoCwTT7(~TpaTcM z=m9p$(Tj5QqX$qxNDq(zkt(31a7?MGSmP8q7_y`%eW?OOiqV3yn|NsB-Dw*f8Vy{@87>SjdVYM{yb^Yr0?Iq z@7=q1^5n^L=g$2!p?CiL`LkP^Pn#1-YSO#ZqzxN3T)ler&*MkSmM#19?Aawl-8Z2D4~_K> zPnz)YvMge6Zp!k!8k%3_fgAT|TP@Z7m z_|KrpDdVwW!NFz@VXc@G0SVpm)dC6@S0+4|>sF>AaI-M2ZFZNfR>+KGwJuJ_!hIe| z5gtsel0r5=RwOY8HA(Y}iM>=>)GKb-pXB4Yp`lxVm+SQuh0UrC4T2V%G-e%0xY#g< z<35Auks~Wv#TrEfGB&XB_Ow_rm=;bt&M-$rT*_xwiprq|CXVb05e|<%_}Eyco!QHD zKtO_#BYwe*1rH9%vlpv7GB7Ie$}QoDbx>rmG-A045iVAq8w#qN?L1y~Clr?~UD&{!wSlLrK&eHUM@&mh!swZU RifxZqIIE1mU7`bnH2_8{k9+_C literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/pos/buttons/button_addtocart.gif b/posterita/posterita/web/images/pos/buttons/button_addtocart.gif new file mode 100644 index 0000000000000000000000000000000000000000..0638845afe9debe6297848f6188169e070b2aecb GIT binary patch literal 2494 zcmV;v2|@NpNk%w1VSfNB0Oof9_4W1a?Ck35>h10A*eL;_V)JY=jZqL z_vz{B`1tsRiiK%#Y3S(a&Cku>-{0Wi;Hj;t{{H^X(9Wu@s{Q@_-QC^X+}zjL*Wuye zqN1Yt`T5t`*Wlsc#Ky#-p`n_ZnyIX*yS}^7(9oBgmyVN;a(QxccygbgpL~IQdx3k) z%geI1vdzxT{QUfvoR^%OoT{#>g^Pva;^NiS)y2of-rnA$qobjvp|Z8I`uh5yprF{; z*yH2l&d$!OuB)J=pwrXS%F4>o(b2}n#>mLX!oW&(BtIe z+1c5fo14we&5e?cv$nI((a*ZQy1c%;o}Qk3f_&K7*uB8L(9zJ=*4DAKvBJW_X>V!8 z#l^wI!Q0#0m70}%fP3HI-^TT?(XmJ@AUNaU}s?P@bL5V z^YQWV|NsA)nVItP^8f$;000000000000000000000000000000A^8LW004IYEC2ui z0Dk}~000O7fOUd{goTEOh>41ejE#&@=DX$0}`MXsR11q%cyT)5DHLjwT< z3>XkGqCAw-uDox+nJL56I@vuDqg zIfI5AI@BjmH%O7jS?XqDP@zPL8f}wQDN{FXL>>@eWY&dqCNDyiIAAK(s!QXzxti4M zQM79Rlct?BcaELAc<~~2dsc2-t8wTqontp|UcpTh3^-DU4U9Hp1BBh#*Kb|HX)~`) zyO}Uyyq*gizALA+Y15oF5B3b2^=Q(kW8ast z^Yh!8W55oO?+C~-o=WCX)|qSB!6yfM_T87De*57!n`jE&2VrZU%@KedCFFM309ZK% zl27MRbs2mOKA56~3sR@zY%f;$oN_C+$C`$36j6r?ab&fZQ9q)$8iFdu$lP+T&1l&F z97e_`pOW+;7e@eZ46$QRn#om_Rmr&s+I|<#N1=^&y%*+^`rU{bT>;2pLmeF4r<|@0AbM8? z4ZLxwgu+h9L<+mY(SQJ)lJ#2(Nz7zb*#;q7Y&Lkq|M3HIG! z0SURnF@b3wOyI%>@iyo|7P>m|guQQQ5yT8Pm}(shx>{g|!Mc)g*8(I=V1Wf5TnoSx zPHk_B$#6Je+6@&@YljA8?@C3zO6V%L0|8XgFTwatr=c9)VIjvHZDegM zVd=sF!VWp#rNP)1ko~b7WDBuE$;@4=1KBie0e}v=o&Y->E7&bZ1;nSY>T9Av*>g|1T&HiE7<*wOL-2zIm!hY)rw zfO=`yvaPGo2cuD%*mXmVyR`FtP(cO0zyHPzy3)bGZdbDfE$1`Olf!>R5TMHa#V<%f zLcezPfH`~*4i%7t`N(I!ciDkh6k=c7;DE1^O+Z%=FraBZpsN(%#RMnV!3XA`0k1iL zY}c}YuBwo)^0`Ze%(_vVIs_g$oMkFMBEtlAWraDApn#k!8{UfbIsBz)gr-43-oQ4( z518sMBXofebp--DKr01a)FKJxphFBwsDocDRGBu^p&oqbM?3iu7<7e%GcZ97+?&G! z(zdJ7jgSRtbCGFI;4c@*foX6^f!9u;qAK=_1$Wt11Jt<2Hf9k2FI99v?QA8)9POw_ zAZiPGup$Osm0>dvpr9R|sH-cu>n=Ehg9+NEHmJ#=V^*9%;9}6LIKF_B(gNEoHQB}u z*x`h5cp7z1r>hE(Qc6^^k_xcI87*yTNQPNJ1)NE!!azU+7y1AMAOJRVvXhi$vWq(3 znHP1UQ$AxV-#H7_r@2hYO>mMEodRPgR9$LP>S+(A@}#OjCG=d)lA~x=g_uP(N>-4P z)TgW$LL^a2QwJ>$X*?y-fg;dUBBc>OOZw4Py((6-suh|}b)6Xn3PmMV&b5{mwJzzY zFbNVVzIZCfD1l1=;;I9=>|m~$^2t(0Qjk*vRQR9{Q~(kRrX8oa6!EMJ4FD8n2E zr-)5VKQcS$R;^Q0p&On^lTlZM>*Gk3Y-zes*R|#Sk-3MLHEL^Xz*3l#j+N;&B<+>78szW zuIf0|i|9{(i$J+r_PCX0pKZD8JntIUtKm)UTuJk|4rv1cOj^)&2|6fFUGG~;Der7) z`&jYrw=^96OV-qT-u@EUwkn*%0OX*fI@o~$l6}MfMsKRzk9PAY1HLV5HM`$?Vdg3r zcAkcti>(e@N4{;cQXSmD1Bub4DsS0RjJG7?pX`Jp6-gy_-xHeb9w#d|Mu~7LB}X40 zr!4{iz?Wgu zq&77~QazJ}usQ(+smB3eE$do;Is%}!bp$XQ-~&iFn-Ln+a literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/pos/buttons/button_administration.gif b/posterita/posterita/web/images/pos/buttons/button_administration.gif new file mode 100644 index 0000000000000000000000000000000000000000..62bf4be6a9c8d53fc38fa95f9fe13982d58a8e28 GIT binary patch literal 728 zcmV;}0w?`PNk%w1VTk}50K^&q+1c6k_4RpqdBw%WprD}a?CfxGaF&*qyu7^6&(DK{ zgQ=;h;^N|HXlS>$x0RKZZ*Omkii+FY+jMkvc6N4cZEcKOFe+7 zId$*jSF}vd}}C5=Z3a%J&7OIZ|0k0U3!N#f?$*%#E2Csg~s&Tj{3dOIn%&G}_ z7`ZV67zL`Kss$J37>lpEw!XQ$<)hWz$F;`?#Q~7?11u#2a3O)PJ?SuTTSG3~8a&tF zVOU^+!8v>rYl(wVY=F6M@(QWqh6_VBdbh&=ouG%|+r4Cu2;jOv$jv=cBP}3Mwcv!o z0_6OmfSKZ&fRQJTD#U2=g31`F+U;Z&GDAdR$Flyax{IF7twb|SRTaPwxUD#i1sD}g zVN|nWL&m)}5Cemq8(lOUV6a`)s~A$5i<)xYv7Oq09Zb4lfVN5cY9=dCtN@{}0H$)o z_ehq?xt~=L!%!@53vI7JUR$6Ffv<|H+7@1!&*IC24e?B^=@c#J(Q7mGbvATy)ykt- z=S!9$>eCld39gH6Rqdo|I}22w4R2Ut&KbT2pcnkC`= literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/pos/buttons/button_advanced.gif b/posterita/posterita/web/images/pos/buttons/button_advanced.gif new file mode 100644 index 0000000000000000000000000000000000000000..3537dcf7330a095c6540215078a00a83d4c71cef GIT binary patch literal 2461 zcmbV}`yHnRSxk8h+caa zFp5fw1_lPwXlYqlS;QbB@iB3hH{09W`}60|PoF;JgSz z;afQC-pazOk^Rki+4$wY5!5OtiPRcXoD$ zkVCq9x|&;>Gcz;C$HzOnI@j0NH#RnQc6KoLFq@m3+uPe;zkWSFKBiD8TU%TI6X5?v z`8!Ae0Q>;We**tJ0Yr|&e8ZnUi->$4^&&bZHtyxCNIz8@TuN%1j0_?}CXJ4xFfy}p z^IqptG7$N1i&F|RUi(^kfof_+>O_QvMVp01YTwm&w6VIndsrQf&7vO$20?vI%{`93 zs$TVt9n+JIye4sRC|D3W-#@p?t6STA&+8Z6+}qfj+hVV<*Xx`?0$vRC~5Tv3U%c8JLnk+p$`u0_eost-QKIK z#yWdL+uNmRPmFc^285kqIvyxQx`_A&gid40vCMk3Q8^}% z(u#VZHY?9{-&$(`i*RaeSwbTT?$5+wv9_B?ZNpg;NS?tUS_D8%3X7W93=$yHe-Kz8 z7#9OP!TyRy4;g-TY9Ia$oS46xE;(it z6VF^B6iLEalFw93cR{Wsg|Ft7O2I- zj?t6e@UkM{vSMq45Z)1^C5_LX0p0Y`k{gH(eWZRDp@|`Pr0^hKsPw}(e}O@XdyZ;a?5K#bYJR3M)GiFe z(O~m5EzUSiVXytN-1_`URgwhVTl@8S<(A}}3X$ygh_XuM>5xZY5hR=Z^D=Fa*!{j6 zu_h!nfJPKYR7yIQ#$3E|ZDs#?Znd4|^($L;E(1?fW}%j3S(G#UZRZ8~REDr)A9Las zsyzJu?0-1KmW??JmVsedyl`-sfKFY-9~Wkip|lV{^*rP(2Jzg=!C4^HFegt-9GBp2 zdk3dPDF&Mmg^Xrp@2Fg?H5dW>HBs~v(4O}S(U_}OTU-#112?2mNx}x)v&sb$mKSz$ z+J6$IY4fJ}E!-EknQgWh8lew+=qnB-ghBcrYt(0>K`Kgfej`gD{W=qnxUPLREKk<_ zlIShI#%-*|*)ouw#_b@ay}Q*eJ&@R^&Gc}Q>^W;|o9Am^OtOEQYgQEQyy(zYh%$Zj zsR*jln<>@=o9M8=MK-r|62zn;Y1Lq?WsFU==wg+W=sCB7^RB9SU)%+a^k^h8SBU&y zjW9ELff2Er`$KZiq?~j4Fnf&5u_w1=Xtyl9&B8;+s<5qUSvSu6xhH-Tjx;%UA<68# zK z6_QFB^kqZFZ_E%<3jH@}xb$%|OY>llz5+Q(pDR37TGifg|4$#mGNJ_ab>F=j{Ft$$x z>;H8^*Hk2SQn2V7XBV|MvtTcb4DHwKF(LmE!YVDbdjDQ_!IsDD+X|?l;<}V14 zXmx4Dd@VspOU8&27|z{4VFCz1WXnDa@9%dR9hJw+#RDojfPmReAW@DrAF!sTbq|gg zOx9db*$Dbzps4K!_pe3YMZ=@Wr$XYNsfHZzs@5ovH1R)6ANKjI@ih0UfND$Vd07wW~!^0)Q-w44?v(b>>!@k^9 zBMnMocXE_fmMEIJL!u~)f1Qk9vJOTLN?7dVD-#41P3AbUO07@_g5aqjU^ITfp!7fD Mt1dH262RsE0>aaxJpcdz literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/pos/buttons/button_background.gif b/posterita/posterita/web/images/pos/buttons/button_background.gif new file mode 100644 index 0000000000000000000000000000000000000000..c6beb23d710476715e47eb35c2e77b3adf1f1eba GIT binary patch literal 2181 zcmdUs`9IT*1HeCH7&Du4m-|VSa`Z&Rli6|HXvT^?I9Inq4yRdJLQa=C1-PD=V|Jvr9`$^YioD z+uO^_%X4#cJRWahVPR)yXLom(&1NqyE>2BNegFRb@bK{G&!6Mt;}a7TdwYBN`S}C_ zflMZIRyciqeYv^0Jv}{>lamDn1wVfLV6j+3LqkL&ae8`se}BKTvokL*ufM;)x3_m? zb)~zzduC>)y}g~mV2q56kVvG$!ouwA?9tKDgM$M)oxZfZG(0@q*4CDjlQT9p*3#0# zWHOtZn>ifL*4EbQ>gw9s8kfu6+}vDWUq3oJ!sGE98yo)<;QtEcJunCWt^%6>RsZ({ z5IVx5V&k4Zi+`SwnDpXh@~f2itCBjV8JRdZ9FYyjkxcRAoZP}9N+CWQ@wTKigPKi2 zX&He&Rtwe$^7BI)_ywzJwXMzV9i3h6t@RC%?!JD|mro5{hA2s++WOYX@%rgcqM}d% zKIm*Oi!)ub!fl-Hg>ZRmJk|z%nZ8jYH%#zfnZSbDI9S^EKTdF8-w9;AtC0 zi_}BsB_D5FGCEOiCDlRWcSU2g93szK>giu9NR~FC1y!G$8H(84VGCHkh&lP+ko=%K@yX)2zaN%$3I=r@5JqdcE z0a{oUz#v|P^F#^T{sV7)reG|eCb$I3!iuYGH;1bH4dfwaO$?p?T$b4B6v7PUFi0uS z+v|Q*Z7$H)4iN}+3j!(>lU_7px6n$;PJJBmvv&94$cRVJ70z#3yn)Tl4vVygoc8T}Se(WH`8>MTb1+U!xfU~=jUo97VroEGxdfxSp^AWjS>y zVn!w9J~o6d#|+1=8VEB+`o^xpGdrEr!pXjzZfRLC@5W?t(iDKCMZOg1QZ(R*_a_0UhHSLL7guj2@us$U! zsrVEYt}EIE5>J(4YJ^$%O3OPLS0$*sDP5BbEIlR_kyXSh9XefJdrV)`&G_9ZLYUK@ zk_p_cMu`fq6uZtz^$Z#FuFmdNqZHC5GnJEB;Y;UY<_U@CX}49RvZ}6Vn>}$gCR+Mc zNAu3ERv(BhX*Kd-nxVB@>n>TPapLRz1vD4zT~DUdOWaYR;1N*X2J!e((Q;zpc~}QC zpiUdknOvkqoCCzs|44+_taXBeq${%&8AhA*4Ym=Xogd{|=63#XBQV6MzJwGe;nPVX zeZ65Gz_?^%@$Q{{E?#>uewA>$vO56M`dAV?!tuEGY?vE^67dTeBNoZKF+#rnqQY(4E?;c=g*`*9V=<`S!IuiX<9X}3taK(c%!_N9XbTuNwJ_}$P zqQmW_iRJi%x|S(T_Lizu)$6pzZrLEcKV@wIosLYt0ZZdY1nB;x#9M*%g?8r3OuYO98hn_CGIQz{Y)El>0-~OS14Hj)7j? z#je}M&ai7PXDeR`*Z89H*8$(D{cNGsxO_ETp`^hI8`VAsXo}BDSiRRT~FrW(=b+WR&+!M1U&xVVkhWek?-l#o$Q;1$H9%(q|Bai&oIC zj5i;Uj1dhmH$Rh>n$XJn=Eo?1E}(qmeH`liv5db<&y@XZGUm35G`0O=rFaJCVbN3D zQHzW2l^I#BVp49ZdYLt%ehmy(kdmyWR@3Q>;?`4YzN2QE!(4n3lA`O@^~H>$8El4P z_C!8tQlOPi4 z)r28-*qt%M;+gcpU-bBKFoly?%SbDU*^Mky3KAODjiea5xmYHPRE0byJDUcvZS(@S zUcJG{0@%C)Wdst0jPw@6Ijeo}Wvi#( zZG9sm`Tdu9i>l*E4q!B!MSVg3HIi83AbF~p>Oi5141R)OflxV9xZ&qvnFLS1gwd=>+9v^<@oscYH(`y_V(xJ z=lA#beS>}9-{0uy=;`U{=;`RLv993Y;Qs#p-QC^X+}y6RuBE7@hm42m>goCU`ThO< zbb55q(9oiyqMDkTp`oFXm62(1Y0JyYpP!$?#KNSgq}JEgqobpKgMQxL-qqFB{QUgW z)6>Sr#^2!IprD}G*w~t%n##(`oSdA_&d$il$gQ!h!NkG1y14rK`kSAd(b3V>*42H2 zed_D#R?d2`d%)7IA3#l^+u=jO!5#HOjHud=Vg z!or7*huhoR!^OkR&dtou%+1fuk(QC{?CfA?VD9ej^z`)a@9*&N@bmNY@$vEh|Nohp zney`T|Ns900000000000000000000000000000000000000000A^8LW0049VEC2ui z09ODi000O7fO3L^goTEOh>41ejEHm}QgM=#loJyhm=lznah9H%oS~wlp_Z5%qjE}Y z0z`eV(wFR1uzi6g{lqL3f>EVuVhM( zEL*;O8T9AJplyf>bpyvGQ#f;?N|oBwO&b6T0N9X&g~ghl3w0(0iqxq~IB3nPP3n{_ zTC`OE-%g$Trmo$)QQ@?C;AVy#7#iB>^HMESIb@vr@)*VofEtXO&Fm`pl2UbmU@{r)Tyu| z&z6lEPMSF#{ze7RCZG!b7VCXvR!~-zHQ#FB<;B`^3{utLc~vpxMjCIdAcqH0wZYg~YN0kqeQ`DQ z*nWArR^o`Qy)~3o1;7y<3U9FCMrs>Ag`9FHHU?LMId&Ifh$*hvMgVODAqNU`$VglN zkCow_1-=x(8a6F4V;f6Gg@77ls=+`5-xVjD1!Jla0t9nFU?y>F z3}7dfbxkSRTP8%1+E980;Ko)SSha?U$IXEN0#P-900WTSNZxlcs8PZjCnN!>oDA4C zb+K;{>Artqj5CzN@Csm)QySrc!-vBs=GE{fI^2nZ2X2pG(PY6QTl zVM3fA*5!m6IVekJ8BeGoMx7j3F~AUNoWVv4mcH@K};V z9i&Z-P}q{4#qm=&)S@TjIG%6;;0@}L!yFC(hbc|)N$aaoTiTYCoka$gbj;H$jmR1b z0Z0yQ(7~aaQWUl!g)B(PW_HGM9epf?J3zWvgoat201UuFa##Zk)+q%YXg~u8fad|` zNzZrE^PUG-Kt2zU0DUf?pP>rqs958aH+*pc|2(KZ;fc_G>T{k5ji^5(dVnnmVg)gX z0TGB$g)vm%qadvS1x7kjkWxSeBvpY58o*KsNPwjqQaB{F=&KRmpX_K(0~LW@PG%HO4UKAAP@jM+=j~N literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/pos/buttons/button_blank.gif b/posterita/posterita/web/images/pos/buttons/button_blank.gif new file mode 100644 index 0000000000000000000000000000000000000000..26707e2aed30d34811f635ad56cac4e117a3d530 GIT binary patch literal 1671 zcmdUs`8(4M0KmVSZ47NgjV_b(C3&QGid1Xeq{CgxlTvD>MU z7Z(?2W@ct*XBQS0=H}+Mwzg7IQs(F9{}bT<$-Y$x2mtVa@$dZKPXPHXA}%B}EIfil zj*NO8O~#{*PP}=WfJCY$BNNh2BxR(g(=zF_q-0e(Zoj2mUOuc427$oKAh7&`qN>WT z)!$fOt4hk?tiw38Wl>30%a0OXsgja16s+9A{@Kqf91xcC*zgfS;h_+nvW}@~Wo7XE z!UA*|dgKTItgbFE0&K#f@7VI61eS{<}=QCv?wN>&^js?)Q_oXoUN z54MCdKgOW3{$#o`n|bWaERiY(7}!1l6k!9%RcQj`;wmp;xC^J=X{{^y%Oy*rlGA0hLa}#R{9e6NNBY#4q;9+9YNS+ zM`%4#Mw6%rP}YUJH|?#>wH;55>j6kt$6JmFeNAUk%xI#g=%GE#n*{=0j1;8?ah!HI zSd~h;p?+q1`p;J8WbSE4z`GdKuxzF%_3wTBJ>ls!ZJ|hu^Sku!BucaL15EwaSv3|X=pNH?gddx(hrs}sy<+k6XfgBhrOi>uI)Fn;K`IdN@r#B&?Nyj`K zzNTO+>_2}@;1#c(&Su3&k6Es{DEbj01*1i}@?ZsGI59qSoBtK4PBIIEGQ~rZXT!9u zXo@OS0Ie+q4mbeH@@MMsoy~g3gb82|MjblVn`HWk2KPJvT|-p`bP#n~9*+t^ml9#- zMB?@wg;xqLyeRuPceC-JeEyKY~uDnwGH5VT$#AyM*(SHHoKJ<71 literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/pos/buttons/button_card.gif b/posterita/posterita/web/images/pos/buttons/button_card.gif new file mode 100644 index 0000000000000000000000000000000000000000..7413c289b2c081e236c252cb79870276539d21a3 GIT binary patch literal 1883 zcmb`E_dnZ<0zki+VqW7KY0+qna*fb(i{932OR4II+81dwYW1~GwPtZ6BGuF$u}4rf zYL`ci#z>41a&0w&sy$<+s$TE^@Xk-?r}N9XZDw*s-_;&a1HO6!8yg#|tE*qWd|6vt z`}+0k{{H^r;^NWK(bCe=;o;%I!NJPP%JTB^?CfkLInv9=tAC*X$B!Qz4u>_!nx3AX znwsMAcqb<(`T6-785x{84wXtB92|TZ{xUZ=m&s(7l$Q|6#JRb-k&zMKAm6d^v4Vnv znVFgI-@liZm-hDde*5-qe0+RpXlQI=%s0?CH7m8dyE`i@D=#mP!C=(X)v#EsSy_3<|)zdZlld;j-`r7R5?9ZP+msOT^baXJf8Ko7a zbUJ-~eSL3l59@*5+}zyS+S=aU=5o0^J3FVRr|IeGySuwT1^9oUz=MJSz!OmaC-%=1 zfbSIVPKY2zl3qoA8fM=-P~o>VG0CNLw2uXMW;r|#4mg4|o`%5#kp zki5xIvexm)zmqa)b5{mH0G((Y43?H7=%)-N50{whc=nfCtR`#x`N8IN_FlGOQN?tV zRS(e-WfGZ=lxkn*+7B*S)w|ECVY2k9r-}o*jOxvQ*O@7P2#)7r-6O!-ay&`R#;sy& zy7e6Ej}C`@H)f(e6Jy~{L!Ql+jOMqHp_=7+oU^6`r|S-vR9zUL#AMt}y(Ig?1SYCn zbR!gHUUs!S_-O58ZIX5DNp_?266QtP4oX?MFL}%2y5#1GUm%mYGhmTf|0Y#xE!54< z(k?}J)|<0PpY#>FKf(#J)mAc*#zkY{aI46+aYt{eze(sb-Tm>fphmm-sPY!wWLrqQ zST;W{P{G9e?6t@#m-9wI8~6?EP$7sBWGYWq)nnMnfQZ!*r%2^2g$qwqGL9BxB;vQ} zDG!J=0Cx}>=p2nH^ihIdH!;J7Yrz1L#q~ZJcyft?sS@RdKg#JDBG}3Zbj?{Gl$ID{ zI${|NL;Wl|z(}vVv@bgH*%zTng1iR8vqQyXmTD1@mH)iAaTt!oStI5 zykbmPto9#8KK!se1}E!Csyw&$@>zuV%T?oSlK#S`_njrmdxICQ`a>$oDVzrI2* zqqv?`v|+`xO^D*+L8J=I)3q~Ddjs^M4chrN1d#%MNve5pm4lbU*gShA{s-1^qi)

    oQ4t9{e?krN(dWy4;bAGg@352LcSe$d@mfMU7+~Ly z+t28>Ro=tux5c2IGBf^KtzMEhM~$>hx0?{B55ZRa?B5ag-st~u0#tV%3**E+cGFKz zr1Ne=7}3d2%HBX56m%u9amdl`erDXj3BmcXI zwcIe3s2DOkM?kddG0Z!NjT1-|@l!C?Rtqo!TlI*0q&}830tuk2d+!|~v zYW^!L?vEzGFHg7tMehXNeeh?9G4=8|^d-Ex>jZc3;pWiwA;0)Y4I&k8W+#mg=hM8% zr65I>HP4K82a?S({1DGJ1%ZU9-wK7qo8Ib7H?M>WKOYxas6lV~4cMv^6~wCPHyo6- z4SFpBWNg}b5q`2>=i@tl9KKGqKg;l;vJNiY0A9PeOUUC2fUHnz9lgtrz6BEb4wbrf zfxsW7@`ZeoK}jJh9=}DAb?f4ga^SIpzQ+c z*l@_+E`z$m=#N0d3a4b@qyn?zXiU17%2h=@#t^fc4 literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/pos/buttons/button_cart.jpeg b/posterita/posterita/web/images/pos/buttons/button_cart.jpeg new file mode 100644 index 0000000000000000000000000000000000000000..d88f4c78c289d0690e82addd3cfbbbef44b07120 GIT binary patch literal 524 zcmex=aLrqClMa#g}SWDMZPes+#!_?B=(Z$t8)7U$}%gNu?*~JlL2qQNSj{u*5yr7`G zqmHVMBgx?Z0R}-11`!4^W=16jCP7AKLB{__7$ksB1p)>nz{Ru0}nGJ&~j!$2789@ z?8fe|buLG$RK99R^LSXUy;aAWZ#ToYpBLUaJP&^I>RMN1+Sf@IQ)k|}KG{qB?B@OY z`N{S3Z!PKJk`Gz~TUK#bbIZPX zTlM8npJk?KazNL@P`3tV2R;kQq8Ym^t6spa#*88SiqNmxpS3@vd)u&TBD@zMG!I7zNf)fX5 zCX`mLJ9DHdn&AK^ngiT3H{wX|y}#joetLd-etGPE!CL-=_X17<(;>jp($f6={N&{1 z!otGz^z`QD=G4@bR4SdBnUP2&TU%Rmb91w^vtwgp9bFxq5>6+-bANwdBod8`j0_JC zhlGYu5-98v_V)HRr<5ZSi@tyV&gb))OlDSA7K_CqJ|yyZJh51umzVcA`tg8pps%m5 zxuv7jCL!j_moFWi9W5;_`T6-}m1PVDBRxA^C=?0=g3q5ncXoE}?CkXP z^bjM6+1c6rZvMo?L}6j!;Naly?ru_Q60?w5TVFdqKAxMKo6bnDsjulD=pPsyh$KgL zbaZqHx+u>mU%!4G92(5Y$>Fwg%c{!y`}>=kn#!xnhlYk;m%e7cWOBJ&zJMgwvj!9iwb=GxlY{{;BIIl2u60YC^~ z^iS!ZCxFZWDTw?>422pS7oYGfF)l>=Lg0&3nu3Bxh5{`+FfBKW!DJOM(=s#)f~@?& zC8h9pa41x^5(+PU`@W{SuKr^~T}^qVY{Ru6ZNK;BHJ$C{f(jH02>~H{x!uEpcO#-I z0atcn^qm{|Y-R7#HzX3Yw!RLLKyKUsfbDI`1^|(J^Pua-$H-l2#C9u525dxbC;Sm> ztZfkiKO%9I1rl46b(C&tvXcwil5`v6e5#3wJUUJaGm&qga1IT~jUq{J2@c6dSL-9y zHfCD${o~}c+*b+_ysf6Obra$Y0FL*RK9%=f5_vlb~$DD z^U#_LQ3OwCPx_g$TcRoM5E13tCyMYeJwrtkGD2HqT;dyrKDU@uY*g5pP2rP>YR~bw zlDacA4+u>`OO6m}ioK=r9}468F>6r+xP={jlYBxB?H^}YdJ+rxpA3T^$OV74znapj zUZLYWD89mkKU0-Db#nwy>OZT+0!YauptPi(jZ5sEZ@Fr0i&S3j=5Y&!4JVs)#c{gdC$`XPf-HLTsS zn8Sa<8>!k@`S2(;>SU?oXhlwdWXq4FeMr{a^=`H5dkE| z^2~$kmoQD$xLKKsP<-A_P&v(xce+bV*{7xI$lDrX1->5F_w+IqTx^}~PW4jcUlzmb zej_69sFMwfIZ!=oUk(@-;eAi_bOQ%f#-gtUnm4Ijq>@p!yn1&JKnZK&Yq^MisIBzQ z{LX9Kvo+^^!p}A1aq%&`J9y}pt+D3*0%6dqso{fdvpOs`!T_v%NN4thZrW<>9!oXg zGPQ&@SL8JBmgtLW`S-rEp{0(4_^{w)^MQ|onJ^*AOwpNobkyY%e)!kt-C%Rcl1YNw zkF+CzNT0l9{0kYb7x zEVL&^G^~WYevzt8?8%;Xx3GaQ=uc%q9Z|H(!Z9!r?>Zr0aRg86<1i zP8XsOmv3lq15rH%LKtl@QCeg`7I)}J67$#wN#h10A*eL;_V)JY=jZqL z_xSku>FMc(iiOS3&FJXpsjaDLaB1J)-{9cj&d|=+*w^9V;r{;qs;#Qs-QD2f;Qjsm z+}zx9cygkmqWSsxp`oFgnwpoJm)F_X&Cbnyfqc-=(4U{5yS}@Qla8vcs&aX9%gf9B z{QTnL;-jOZ)z#I!zPy~AoZjBvp`@Y4#>Uan(XzF&&d$!`(KoS3VwtKZ41ejE#&@=DW(4u@MXsPh1`Gr!T)5DHLjwT< z3>XkGqC>@OW7dXqCNDyiIAAK(s!Q3Vxti4M zQM79Rlcseu*G-(ec<~~2dsc2-t8C~lbz?VgUcpTh3=jfmOA9n(1BBh#*Kb|HX)~`) zyO}Uyyq*gizT2j>Y15oF5B3b2^=Q(kW8Za?h5;KLaC&@5BT?l;vOWP{4o#eJ=D@Dw z$X0IJaO~5bkB7#){Iv7u&F``i;D!Yp5D3_mrPxvD#Gadxe{TJ{_st z^Yh1XV;~NW?+COpo=WCX)|qSB!Pf?R_T87De*57!n`jE&2VrZUxe-7dCggV409ZK% zl27MRbs2mOKA56~3sR@zY%f;$oN_C+$C`#}*Z{`~Y-F{UQ9q)$8iFdu$lP+T&1jha z8%D+_pOW+;$3_5Z5V2!Vn#om_Rmr&s+I|<#N1=^&y%*+^`rU{bT>-QK0~{XQl}2%c zNk?RhOB&bZm;0I7XL9aEx94mVj!7Jb?lHxb0d92oLK|wZK_79er6>Re6lhSWamX<@ zDS{XxnrNpIZn_?xfCkFxW@!kJ1{83-5J#k=6?Uk77BsNNu4}AN0bwNU8pNrk{#h8L zYLwar2D_5brJlzYJDqYs6rpU3(@q!{Qv#sT6%vxBQ7f8;2@nCVyhfm@1G_@tVzJJt z0l>V;mZpXZ&HA~Yqzca01{P~L0YJUTE;uM+fwjs8V;-o5hM8l&M#HWtBviuxt|G+2 z?iv_afB^&+G^fE05I|6YX=Aw|jn;Jbzcaa7;{1tBl^Ll78@aO4OM&|LG) zrIoR(4_Z(ObGSL_;r5o53M#l5>Sy9V8mUcAN-DeO7~-@E?3Ys!5`-~^ge?07_7~?Aa)k zHUh@VX&r&?e#ZfL;A=D>FTL?C_nG5u{ue@kko${Yw$vG|t>FlEK|u*Hz%}Z*Yh&($ zz}a?XKe(waS#gjcx;n5o3be~EeS;tTkVU}@;)yy(!q$!2)FJS+;Ve@L(pv%(1dK62 z19+RA##+|~53a#oW?KUa;-CQs?5z!Q<5=e!5QP|Ia92&J-4BUKK{uFd4IO}A1vH>J z(@+peD6G{AIpm=@fCwvDIgbp_vXlfE5MAopp%Q)QE(U0>0h*&g8?IPC&HdnsYrvW2 zG$q9*6nV1Ob`hXK4);Eoex;q&S+^%L%ItCf~J8| zm1#aU6PjV7`G7Qi<^d#-CSI1wwbw)wO!-mMT&CnEILV1lfw2>@PKY7(w8vO^N>!lT zIj(G(N>r3m%c2?;D@gInRL!Fhl=8X16BdUwp#msD?INvPq3S)VS{1im6{}hOlTWvL zmuv!sB7iC+vMG}mBvtrO)v9V6SXQ$m z7`sHx4O6RH#NL^t2NkS3JcStms!F)R4G%wVFr0)A7uLC2wXPt24&v5xJUBFNc@&yf zMz3?7kb3okbq!u%`N}lM9_fPji>&Zsv)SVDZ*g!)-s4;|s$|;pPh!fcT>HAy`w-7Y z)LE@uTYFc$GE{N?3y@4zbsXl|6I!L+pS&;&Sk4kPu)$^Ma3M=udmR_0#$#bN)PR7k zPA)Wc8q}wpXB@dG7qgkYYFsf}nt=Z0X~-h3WXEel{FHY9ZO{=M;;?|cssW!Il}~A} zauoD(HnW=rFTpUwUlTF(zmlz&fTOyfHdzS{Y2d;3!{}0#w`|G61g!8+c0!SgoUykM z6%=+elg9IO7$m}})TVsf+qMV*0B?c=8d^YOCh*_`A6P(+7r^5lwdmJdU!Kl}y+BV&=(Jwepm8EMz1{xyM@8a+%M} z1wp`I2Rm5862jmG4%qq59LRv4^?c_H%wW$mn1KWaJ%I@f`p|@S0RakNjsT#6CJaFc zLDT_^9Js&&7AUl)4UOmtD4Nj_dGt&cBIyJaq#g&bG^RIQXbBja(-O$Q4j@5mMub2H XCjfy5JWy*$+&b60?lrAv5C{M}q+!V` literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/pos/buttons/button_cheque.gif b/posterita/posterita/web/images/pos/buttons/button_cheque.gif new file mode 100644 index 0000000000000000000000000000000000000000..6c286714bbd19ff4d59688a90f9d970863757b38 GIT binary patch literal 1990 zcmV;%2RZmhNk%w1VOIbu0Ooc8?d|RA>gwd=>+9v^<@oscg^Gpe=jZ9^ z>Gt;a_xJbc=;*1fso&q<&CktgaB2Sj{@~!?;Njri-QC>W+}GIGe1Uw;&dvS({m#(N zs;#Q|`T25ra=X5}(9qDLqN1Upp_-bS%gf7hcygbgpP;0mmz$T@+1KIW;r#sk#mB{j ziiD%1qt(^b-rnAzprFpq&e74)%F4>b#>D#i`m(jM#>U3HzP!lD$ef&}4 z*!%nY%+AcAq@m*C;@R2Rq@<+d)o12@So}SOq&yJIh+S=OM+uD19d&0uP z%FN2c!^7L#+r!1f-rwH2yt%r)x}Kt*v9z(4nwE`{jj61udw_e;($LGz%iP`E*4Eb5 z*45eC*_fP|(9zJHot=h@hQ-CjvbM5~k&Wf%41ejEHt4KXj6lloApem=ctmbe5i)oS~wlp_Z5$qjgAa z0z`eV(wF$sabt7%Dv%AjBv(dB-4GIMT3e?5Y+|jVz z;I`4l3FF?dQGzzL)a~vH3IX!-^9A+=Yij@i`T6$r00RoFch6qGeEayV`PZOGf-{2X zWP^t-9yWOf5B5t4fQ`qG9}{XEsgI+{jv(2%S-BF9%av^S1uzf*hbj%%3f>EVuVhM( zEL*;O8T9AJpl*l?g(Jr$Q#o^@N|o9ajvD|80O+VwW(Av`3w0(0iqxq~IcUwQP3n{_ zTC`OE-%gzyr>@<*QRTQ%0Eb4M7#-Z`^HMESIb^4r@$N;ofpIjO&Fm`pl2UbmU@{r)Tyu| z&z6l^&YC$O{ze7hCZr17e3zhcDn9igc{~aiVu&fO=tcl;98rh= z3v3SpAbMH2(Gp@b4*0II+T4mdz3nP<%bM~i-mz$jCxNoDC9 zH?VeVj+su00hJManuDBg@Bm(<&OVDkpHrIQ=afc-nL-3|Vo(5==TXR65^>1E2C+oO z`9=nWYU(Vx$j(8*r5wncgJdO48N{=1Y}*F7-xeIE2UP~a!<1uC23Nc4*0DqX8}826 z7+Nh%2}E#jWiTZQbFeU_19D(7B@ekyxx^e7j2uS*QyN@z!U)8XLd~5r908e7Q5*+u zBk1;Sfds;l#gtX7L`4ZF)F6k*Z#XcAohWZXZOzSA9aYU?f_-qoU2h#*a}-ABSsW@= z2cH{IOv%L;1ZXj(6H}jD=gD(?Fy+4#K%hWWF~9M0;W@`~X#ggZz3&?+#GwELpPmSn zbI?gQ2X$_b1ydSZzcEGLRqyS!0{9|;F9cBq{00W8*Tpck2t*|>2D4jjIcxr@$DVsE zfdrEpSI8NG6=+fIfa$tl;ChuGNOb|e1lJyi-&39tr}Y8In>~$BP558`fF2FV64EPq z0Yn&tPUfH-7eK)JYBF%puL#3Uz?$b*%^PnUi~9>#n~ zP~-ucqnaX=BdMtlY?_0cUg)40Dknc6dQ^=36f3(3ibu3D)R7W(Ax1f>K_5cSj>=OU z;smNs3s^v`!qh|{UFL(n0#;{+wZG-G(TiJ*5uh$}moSlW0AXa}pXOLcbREYzaadQo z-nBmuE#^K(^dcPXct<^sk&j;llyN=;NX}f$U5`m2cP`hy_R)y{ICr$8BO%#GbWxH* zMAOX>C8!pSmB~1+R19}+_{c_<(TS0iBxC>?9c3&)4t^})0%xPiw45(!j1(mkaVW=R z&hbZb06-knQ-?VmKn`Kjpak7mqqev$DM5=&Bkh<=a*l_0aR5*q++c%7@i2I8Lkd}t zLeK1sgwd=+9v^<%Noc`1tte=jZnJ z_UY;A_xJbc=;X>xdS-{0TO&&{c=ss8@{;Nalh-Q9$WgxuWR&CbnxfqUWM;r;#n z*VxyWo0s|d`I?%Vp`oGB(9oiyqTu1+j+2h6t*Xn*%b%a0-rnB){QRS%qt(^btFEiE zwzAgO*3Qt*go%XA&dk@@*Vx$D-rwHK&CABd#?jHyprD}P;^B>wjr#ifyS}@eoSf6s z)5^-q#Ky#Yfqclw$j;8rmzP#l^+d*45hE+Sb41ejEH<6NP3c!loJyhm=lzndX}D=oS~wlp_Z5%qkB$s z0z`eV(wF$s#dmnSLv%AjBv(dB-4GRSU3)IEZ+|jVz z;I`4l3FF?dSAsjW)a~vI3jy-;^9A+=ad7|u`T6$r00RoFch6qGeEayt`PaZo0xp8| zWP^t-9yWOf5B5t4K#s?c9}{XEsgI+{jv(dGS-G-~%awBY1uzi6hN=zM3f>EVuVhM( zEL*;O8T9AJpmc}|t%JuUQ#^U1N|oBQ4jljq00`N0CWV}y3w0(0iqxq~JZR0TP3n{_ zTC`OE-%g!-r>@<*QSs1OQ0K=U93JTC^HMESIb_Fr$C+|ofX^(O&Fm`pl2UbmU@{r)Tyu| z&z6lEPn^V^NlIAM1T&R!~-zHQ#FB<;B`^3{utLc~vo0M;v#ou!jgy(ZSeRYN3`#eQ`DQ z*nWArR^o`Qy)~3o1>g~#3U|y=$5cgNfI$N)K82ieCpHFGf<1N@Vu&fONJjv4G_i;O z3VFyFRRj;%A*CG$;5g!Uc%^7xToy?A;T&@SnIIk*Sa4j41-=x395yjABOQ4}Fy)*X zC|H?(_W>!@0aC_Dz@K5(1*T*jc)8zDdIeC&Rw7s>2Ob$nDM21CI3OhtQgI-G1VDTk z6$cT>5I_qOM3Bb_5|p3;crU!5fd&#BF~Xiwf=Pe^Ua$bh7&#CSrVNqV5y7f;X}X3I zG(c5Hi++LNC=F6NkQWdUED+TKd`|fQ2T}1EL=aO-V5uDr6Ax8{S9?&CeR7j~q!gkb|N48T;F=YnhwjkO6lq8TK zWe4rnI)@QbV!?tNQsyv66yqL{#T{f6EJ2iZXyDu(ob@n=zy#Z2W>qR$`T$df+Tj8o zUD`2108&1H2N3s0C8fhrI?%BlU}|g!3oNi9rNwt-`{5l{ZyIz9GvoGwZgN0t#{(>t zp@R}h&>NJ&672U1J_Rcx!!+LiuucR|a=h+=9!60Q7a-cC~ z8*)Us!~k?iZbuP$+i@=7a@v7!9!bL!_28o4p>NE0$ne5cUPl%52za=FcfZg{mj`ue zEZ(q3RU{p(4rmoUy1}L6yLZwsbF6slFGQQI1J;5qWe`Wi8Ew(nqo*GKd+yOu1I%*| z@KG2`Oxb~z%0JKiy`w)cZUzfX?I{oAuFY*-T9}f-^1wfB4Q)dI36Mw3l7t%6U;qUQ zN(^FPB?OTNDrYKKoVeAX2w;GNQyD=7swEd2b%8?^vJi&yprOTZ$T8i~Q;6oHK?iw= zNM}k>W7tB67QHA&Gs2;d&h)k7xbP_lI6xFqvlz$>DM%Z#ikgzNq$UM1H9@+Qa6&<&jI7)AT)nHhlgK!+VXswqWL z2~rNa(T-+kEZ5P;Qn*8;Y(~hS)d>IrEVKtXq~N7U*ntN;fB>2z;HEg8DNc8a00#6F z0SfRb1A=gwd=>+9v^<%Noc`1ttg>FMX^ z=l1sY_xJbB&&}xQ=-=PpX>e(Bcyj*!{@~!?-QC@)t*WW5so>$@+}zyG(9Zq+{rUO% z-{9Yuo0r7K#G#>~(9qDLqN19bntOqJ;o;%U&dr~npUcb3)z#JB-rl35qx}5**Vxyx zwzAgO)}f@K&d$!|=H-NmgwfH_`uh6D#>SVNm)+joyS}?~d2^topwrXSoSdAXprFdi z%5r&f*x1;}$jH~(*UZk$`}_ON&CT51+?$)5q@<+c;^L^QsGgpl?Ck9B?(X#T z^zZNQ@bK_pXJGU5^YQWV^78Wk|Nohpng9R)000000000000000A^8LW004UcEC2ui z09ODi000O7fO>+1goTEOh>41ejEH+8M0t{vloApem=ctmd6u4z`eV(wFRX zWP^t-9yWOf5B5t4Adbh69}{XEsgI+{jv(XAS-Fyq%aw8X1uzhxhAIu$3f>EVuVhM( zEL*;O8T9AJpmT@{rE|w6(>r*gN|oA_&Kv*=00hx@<*QSZ!2K*xuk9vkN9^HMESIb^~rvM%pofp^%O&Fm`pl2UbmU@{r)Tyu| z&z6n)4jeon{ze5bC#FJuAWN$}t$O(Dy0ep0j{TjvT<3CT=rKVjCd`!YO+OXx{dIWD z%kj@mn--3o9qWB$R!~-zHQ#FB<;B`^3{utLc~vn*2OM^wphpN%&B54NYN3WleQ`DQ z*nWArR^o`Qy)~3o1>6yx3Uh`( zQV9VE2*NfS4pVw58JKj*F~Fc?)+Gm-J<>LmUIEatRR~ta0hbO_Mgh+VQ+6OH4i>a< zfm8uxkU;_$SYW{gb&+7hlr0D$SpyBQ5S6GT6u?FmZY(f>98f?}2ALVe3RwV6RA7Mz zI^sb`i++6&DN}evFr^DovEad{Q9VH?l{(Bi<*HLcK!O}#)Oo<4b)0L*lv!+BM;C)m z`Ng4N)+L0yb&TKuT+Z3S*%Ef#5eKwXHis4mbV6VOrgeCLM*~!jux$%=H1Wg#lyAI% zuDVp_ki(Q)#G5X?>DF~I1TTQw0aO7~$QciE2>cY4!9_U6luz8jL8W&jI%BPij-97;?%1X@$3 z(esoQJS=onMb~k3RDj|ECdmizjd#gD*EuD>6h`Nn9V%6)#guBqa0A#_#KFasUffYa zrgGO2x6c*SRe{k+r~7x*QAdzK&?R4hc>)dONH}!T;Xz$>F@RmC6-LBS`;;$NxgN=C>~X9Q<_{5anNyC*8pra$Uzrq zAae}ZfPI~2LKV7DhBhQ2$8@JmG{PU6QX{1Oct}VbWXl{{^r9Hes7OBAk#f$YBbEh; zF_0k=4O6%#B{9iKFC-xfE2E{>*k^|yI#ihwbVB2($trAe6P##6A|lT4J|J8WWCTSh zyC^YH`&kr{9Ce{cnP`OJK~5I&QXJwKN>B^X)u9AcC^a(iEXrb5XP$+|+4QkI#8Ki5 z?=nX&#&J-H6l7%T_?UkED_{c~p@$Z8A1k`ijboZ4A~!il%XCuzGH_{`zw`hzfi;qY zH7j8Vm*bi-5$aHz+?99=1hk~Irt0~L@RcAXkBqSG$ zStxHRQZk^V5PHNVt@irg=$kNkb>yGQ2mm|cWaoJR literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/pos/buttons/button_delete.gif b/posterita/posterita/web/images/pos/buttons/button_delete.gif new file mode 100644 index 0000000000000000000000000000000000000000..8de32e1fcb99cf218007361083d47eed3246e1ee GIT binary patch literal 1915 zcmb7>`9IT*1HeDK+Z+jDA}Z;4=uoc5^AyEOMU$IH&(w0I9w}w4=Vfz^a^#$CW;0}p zCh<6;v4$FBh0R<;A`0aQh3EVH3E%fm?_b_Oz0WvetgQV#frG%uo4}VZU#6$0KYaM` z@#DvtnVF@frHP4&_~iJNm6cDQK21(eE-x>C|NebyYO1rVb7W+MTh0v*3*Ok+P$(3G zgM&juL%HmCa^%cXt;S7Sd?6a6))ld09b0fk-5ZONxt2j{EuZ=jiBY zZ*MP$!xX!Cv*w`48$s8XauY6G{5D0P^xv80{+^1Z2F}ts?PcD}W+k`|ivHM*&tBBPt=^hvu zXyiA(eDyLvKc82{E2}7LX=xD(g`YovUR+$9ot>SVo5Ka-=I7@Z78bsK{kplinU|OM z?c2Bi3Gn~3YZVFtfSZ8Hf9Zcu0K{fYC^Fc!<)*&F^^D9cb#-m3dKUe9 z4wJ@U7joD+RBcY^Nj$i`0?va&AgF2xyy979LtSIjD}G}`RW*w5AF7Y9tZEQ3+gJen zRGxVcm$#=YC&j0eYO!Mj1H&1YoVss#{>g9UQ7bd`Rhh1->-lwmOyb>mAd<0hN7kIv z$?dc25s@O%*DfdeU1jvnnfrJTtVg!_NQh!WC=XY@)TDLrM%HR%N<&}Z3r2hPQrxjI1$eX-)8~$BwOFrzCt-r5rhE(beda{ zH`>qoZl>;Gj230?B*y%C-FYXrATjt336h44^14Dg48tZko#_Z_&EV?Kf1r72S$bw0 z?nb;u|E_79;D;X!9=yd>DfR?{LWLyvYt;6~ZXwL0u@E(Th0!*H5|uJI{UwTF>1wTM&!EznDC51Q7b zn94j0P2b1!(PRlKosFZV`5ESCb_HH2Vq?(N;NU+p1Nmy%5ce7qC`-+VcG`~?6^4O& zdnt@m3C6m1TYuF&5(srwD2z1UU#j8U4i3XW&;#PfSFi52LPC6wSXq;GkInmVH#1#` zUKPsj9@96W1oh}v5Z=mn0%1TjL8n4oDZYsMTfT;*W0u4OwF}nGPjnl=HsNj)88ZuL zfk$3o>FH;`F{*>@C%ttKx+4mDuE~DJt2ye??RVH%<;B*i8sR+aCgB4ZuqrMrw`A{p z)Lpp&4Uv1h+ffRSxRkcNpp)-RT&_guJ%Kiy{O3`SvYpj|Yko0X|Bf6BG;tmvY;fC{ z(I%u9mb{~9*>a`XU(wB~>DkeD3!VFHy;Uxr3R|O_ zJId}!2lm@sO<$LBR{XUH_>8H6`o~GsgSmzG7k*%wwVL#~Vu$^wbv1Upb^HCeb*b4} zUDxu8CI{@5?jtDE+VmQKybCscD$dL;b_~P#GAeX>_Qn;Y#RF`(={_@}2TyRtaBoRS zWL2|2fpW}N&*>Mu7M=}DlnL7T^GBhAoSNE*{aZ~xo=`K|3QB~%-lbkiiJWHNI+0~> zp%?0V_Nhx)oMoYgX`8vAo`ou>*okmq59HzAW_NCvtXCh7zR2)PW+Ads385+4$FKNp zwC^Q5oIxvLA(6}NY%}MI`-o6SgH107^MFSge?5Jm3#7xBcx;)<7VK%}yYH{`k{|8o zf8uOAUxEqof1Yw{k4}sXm!PFtcEBM?_fk7K>vBM#iB!^dsTN`s?@(%b1ZfL0d7WUE zuE=u;vV)t&03o{-G#SI#;-4e{en$hOG;a)PdD9XuPl`R{C_o9U#SvzFdJl1*P35XM zD!Gceg+(^Jpa5$t`)_fVfno4-Sd^QBh1eSe!^U7WSqhL^J|Aj$PC_|k2S9kOI&ZPt wqWH1;@>&Ot94uM=>|&9I(*cKH6l6^8VsY#gpkm7csfGb1R{BsB7zEh-3&A|35&!@I literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/pos/buttons/button_edit.gif b/posterita/posterita/web/images/pos/buttons/button_edit.gif new file mode 100644 index 0000000000000000000000000000000000000000..e5df0f5a91e902e42ea8fbf9eeece483f59db836 GIT binary patch literal 1846 zcmb`E_dnYS1AxDYByECMng`o9bdqk;ddL@Vy#fR9T ziIGYUjoH^;XVi$e7O{icHEPwYd+&dEpP!zeo?jk|Tjs`B3C@5nFy{lTtgI|8Ep2aa zfBN)kZfpcni2|yxw*Llp`g3Fn_J9%=>PEb>({&z-oU`X#Kc5iUf$v1 zA&bT8@9!6hMDfY-lyC|ughV2fm`vt}4&4Gc!3k zIqA&wA<`*NQ=;&z0yNbGox}o7A(XeQ6a8TGUY-?-# z{Q0wougBKb*6Ql&+S=Os`ugVP=9e#Dj*pKsGBP$cHvT8T{}0VQ2nYatfQ$bm|9JwO zI1VFHBO;?{(e#%wv2k=Cw5eB8GDAj2Fd>l+%I>TAm@;Z1jlXt&bxT0u{Fe}%NP6ci-&vF)$1e*U<)s=p0BGr_l@ zUa9=JvMMD7+SuHL?m%5#0bp-$XA6)(6g};8Z=@XTKH3{ba_Atofl-V&`6F1j{Ql(*(PSoi4& z=-GBH2Ltb1tCSIi9uxovnl!HDN2cXS25CcLK60%M9`y2TmKb`!R5%__-p>AxQ!-v_ z*G3@#G?=oyQp3WgvvA(7%4bs7ooQ4$R`|3PS7rSJW}?soOkc#!QNfp0_Y^NxuN6A9 zIZO%kTJLTXyOW%|-Ss%Q40N_)B-{qgzQyuYcSsG*z<%WN&-SIh`lTloqw>uhx~|1B zeXe2s$Bp99-Q}9{WQX{p?CN{-ZnqObAZ_g)#+uDfimOLKA>G|y`fRd-tx>4u=R~|M zJ_S4JC!TE^AxYT}h{;X{&~_yP9oG)Cd)_Q^@nhr7p9f&KMZc4)@zeC;dMv{UN|#lI z6P|#~{l5D#ib*8b zjshcwJ1DGl0EQNaY&{;{ldjHk@C2h%B88_qW`p53Zt91Rx=mpNBa0s=>-v2l09y3TO*T~l~ z*fi+ZxGqw2I7@gm#ILudOE3LRA`KdH~XMJMx`nhP3f&0v&zQ+Z3Pt-UP@YD)?` zOPXt*J^kdb6qE5juQm&OQ!@2Bmht@!X)MY8J_Vpt=jdBy8`CszWUS6ruJ141~!~fek>SFG*inUuD-i8m`~Cf`Qad1 zm=wL4X9LHc%On=Mz_QLw)EFO+|5m1QZCmNYwZeB~)ob~=D5L!c^Pk2K4|}&8IXp0; zv)1n@jqIfCsYP=cK-hPic&y!3%!}1pxMcW8Iu4rHd~^lLg*HJ;SL}ud(_D_&b;&SqY$prG{aE zK%Pj(YFs)_MGk7Lmp=q|eqbI~N;3t{w4!{(g`XFDeJwSuXXTWWO7B^yTTh)zq;ZrI z$(jI|k5sO+rQSvml3_}G0DSXhn0+RO!TDJWti-p1TnI~%4ADCF**iaItR*E+@xB;X z4d7$S(rOI7^`qh4gfoC76$wJv@*`A{1cW@DV|ZR8+z;=NDTfZnT3iO72$2UP*Eza%+z%YOyl(v~O%>WQ8&3(V00!!!t%}^sg=!MD?Nk%w1VOIbu0K^{v`1ttc<>j25oVB>M_4V~_bZw!cq3P-A;Nal>{r%9< z(82`A5VV&8Pm z-MH@mKp!vm>j)}=q;jb|FrUz+-z*aPRxY0c#w4bAERgh>3}YjEsti7m<+}l#v#6Zdn2eV1I{?7Lt>dm7<`Dq8Fv3 z85@+X8y>Q=v#uEz76B9sMhTaVbdag9lpDsx$f~c(#>TbHw9y*V)YY;Z7Y7-<1^^ep z6pE~`&E@9D#O1Tq8nV{3?Ci4{2OHc38R6ilQLH#Hqq~k9Iksy@&>%pN6e^4~kl~W0 zM?d+&vgq<9O@IYG#=Gh2Sk9e^h>5y2Y$(#Bu?BkF>Om_)Xy{ty)4+hFhYRP5Ayem} z=(DEIZU*$)m2F*twv>I_uv0^Y473DR#Msf?V4HI-zI}_A)U5*-8XEBMSMJ>n7&6zC zhu3Ieixny$Hh3VyfVcsvRytrI3(vEbYh}i;8Rk{QNGlN7EqYpL1_dxgpxc!cHf`K) zSwP(t;A~k46hQDWz_f+~)u*>*pnw7P2n>#TU=Sff1HZZ*C~$xvf&v2AGk2K&&Q`2^ z_8cm271+6E4-v>Wn*bBc)<9biU@$@dftelX!2t=*R)7P$B{)HF4-lZhY?)Eh+htu* zpaCxeXt03={4rM7Y_SB0K>-XZ7#s#2Aeh+%24q%%EIHEH;{>`zSil1fRKNg(Lwb0T zGbV~iVg)A-g-$b+u(*MXr!k1Y0hv7zON0k_&_QMlco19xevOF%0~JKr00F&iDBMi- z#nPk(4Rrt!id0S2=WLX?2*CysPSfR={|Sm21`o95q5^GZ78*?uWEKIPHsPefPJ0H0 z3NDDuri!A4YS5*PYl=yxnJ*roL4*jr+M!LA&Y2Kc3++_WPj!R>ss*BEKMRT_D_&wD>ZG6lPm+l9E1<$=HfX7*dJrL!Wy%u4j5N9`?tkmVr~p&2 z&9Eq&6hq?h?|OV0RYRn zVv4V+2$RbDDfQaNID;h?J2HJ*aDb5_Sil1S01Ti22S~sH5+HyF+#8&VLkSH`4S;7W z-~kIrK>(Dc0}RMu1|7h`4tnr|9h5)_C4hhun(%}tv_dfUFa|&*0fjI`p#v`1f*RUT T1OhOC4h?X_9*#f)Apih7kj;e; literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/pos/buttons/button_login.gif b/posterita/posterita/web/images/pos/buttons/button_login.gif new file mode 100644 index 0000000000000000000000000000000000000000..ac11f25cda6309328ca99277697b07b2b6cdbf5a GIT binary patch literal 2366 zcmeH``#;l*1I9la3FFYHBuY%V79vEwW<^_0r8)^+jITW z+xKq&{P}Z&%N-jV8yy|}@#9D7tI}zqkjvrB{>l~2usT_t-JK=nC7mX(z?FgU=Up-{pfh4=UO z&xz;O*Vi{THs&Ss^AbsZemN}M;eUl!R8_E8tOcnwH#aw(oGzXf%U4$3R=$GFf~= z{KwB9WeW?-OG|4CMRRlW@bEAu1~bLyFD))Tj(sc^isZ_eSxVW&e zAd|^9H#ajgGk-bofBg>&>{BR%03Z#p`Zwd>PXMZ$fVr9h@(r~iPF2U^YO8jD>2~M+ zC^GUb0;i#8={4%qmUk+};6$RquJ6Vz8YbrVePPr>PbC{o4LvGV04N>wZyC*eSKLK` zVv4Fo{wJJOgA79Fq9VIJ0{=<>@M50nXXR25@n z3j}D*ae0p&11IWkQ6)OQzV;ET1bKxSxXY=mE<-q5uJSptmDK%M?=f-k zld7tknnLaK(*1FYhXxqI=VETG$kfa~Lhc5pMK8JI{Ue?M+HD#y3b6GiISZH2w=sr7 za%^vdBL${W>O{jqUztrNrs^8CX&V{?D7>=qP5pbqV@O)W&I;AB2pbQl{A4qaJUndw z#?EU%N>fqBb!r-YIKkpKMPT&d{iuLse>-!^^CWFIl;*Q0l`A2CX04Km*X#6(aGpG8 z|0t1pMeDZECpWL(W2ZR^6VZZiJW}$7f$7YCTRGmCI0{!&?{R44{xw50L**wef((wiBv9a*jhTQ-UiW94lO7S%F7Cg6FY$6CO5pk z$H6MTKMH~Eb>bnF{MiSZ_1J!vDoQd&H~c-p%cv2v&u4doaneaNLzRM%VXJEQ_=eD4 zgX-~N=#F80rFkbNtlFJ8VqM+CfX6hj8@FB4V28i~kf)EQ8&n(%fBm^nvv@D??9S8J z$m9&>{Rpth?*cHy1w5~0eeOKx1A!XTuXV&8I0Ta%HMRx&MP%bC`Ytkfrd95NHWS8L zI=HQ)@IxTeG7%l7V@nFK-kt=Y@8=x~LC-;zfinjOuK7S3qm!^hutI}e5DJ!j($FGe z`qC_NyCq^%j8wKQ(m?fSc8u0f;0_sAcj;UftL|a1q*j}Rjto?fbh9)aO^;h4IzYb)+BbV-jI zKAYH`KrCuOkbzZI?2DJ9qrCUxBHJ-HW1l^z!c0+KqQ{d7y=!_qz|+Ag0l2brP`{gR zY&E>FuJ62)e?E1w8%uG2azQ71v`N1kNem#+(GiLDZm00HzgK)?_O-gl=mFd~`tx|s zW>K6*%FXB$qsTL$8o1c+Z+MaGm>aR2#`C|6$+6jdB( zJ$+FOzLGZ>414T*%6~()v)ftwlWL*VXDJ8W&0x#2Hr;(HG6<-?FoVRs`Z zGm7^pP&zH1q@apXyG%7!f^{!K_@Y}<+D7Z_Ny)0R%ikjpvWSAVy{v%=%{&t}&#E(? zU#RQt`Jy*uxz!f$-Fi_w{iO5RXp$WweRnaeY?o=Fkr6Z_bX&1U8XUKOAt5u=>^RH! zbgJ6y0!!8|F*n%& literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/pos/buttons/button_logout.gif b/posterita/posterita/web/images/pos/buttons/button_logout.gif new file mode 100644 index 0000000000000000000000000000000000000000..72a91a124c79cf1ff390f124b2503ff8c035d7ff GIT binary patch literal 455 zcmV;&0XY6gNk%w1VMYKN0K^&q_4W06d3o&Y?8U{!gM)*qsj0lYyl`-EprD{=XlS>$ zx0RKZZ*Omkii(z&mg3^#baZsj&(GW2+je$#ZEbCgjEu6fvf0_$|NsAHW@i8Y{{R30 z000000000000000A^8LW000^QEC2ui07d{B000I5pr&2Rl$~g*u59bR>a<*@D1a}9G0F=TueamCwvy3q z?-u&&g2Ai?eSrW3Cj95&eRLIlTzrU>FqSHl7!MT%eF7(zd5m0~o}d__ zkC7RiTy~*znSCmZYPbP?5h#R{QLLsKX~xq(W6ICo;-Q>?Ai0@&tJZL z`RdiHH$d?A&08RN_x9bpckkc7|M20%$B!RBefsqI^XD&LzI^@q_1m{^-@kwV@#Dwe zzkmPz`}ZFP6#t1j7o{eaq^2m8XO?6rgk+>DxO@5rFz7G<0mu;ytp5}g`ch67M&DYS z)2-lHbEZUAJ%8PEp2vTBS_>?CTvSe+SbzLY;Jg6k6tC8hbrDNc7EN{8aHCVgb6&u? zj4c(mp22G2TW-|OOL+N?bK1UT9Us$kl1hZrn=+EpvonN6vW55rg+!7>L^Fiblae5e z1`#13wH1H&{ee#A7cn zzo3w?piqXe(8dyBk&PQgghj$jl7y1dBT9sYG7{1w(uKoC64JFIb~q(Au^NP*i-@Rb zJtS%pelBD~!O}z8hTP(Dp6YC#ZrtHV6a6Pvw?w$t%ZTX8URwc%(Vaj literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/pos/buttons/button_minus.gif b/posterita/posterita/web/images/pos/buttons/button_minus.gif new file mode 100644 index 0000000000000000000000000000000000000000..2030a5f4501524ff456bc5b7cc7d8e49b636349e GIT binary patch literal 402 zcmZ?wbhEHblw(j}xXQqAVZHL|>E<6ke5h@#t!}K|vwzQ)xki^RU0S_u zvQzdQ*f*owF*+$aDk19Ar%!Vh&Y3)Ya^Hl$1&bHdG}W9sb*i$avaPFa`kd+Cj`Kw& zMs3-?rL?-Vt-CEgEj}hWrlYr`sWif0yaqpM1uUp zz_#AOtB5Qhn`j8b#vN-@mHnKf_jf`kdN zvzN?Y*x8pgbAA8DO)HwWHSDO}Rkf#lUvai5x7yKT$4{I*!Kaigeg4A5OP4S5bBYTw mtK7bG_ul>c!c6R{PoF)1@$#h@mw@v74opdThpSi8k4qnEFVXhg6 zT%z2{VzcaGLS}Ar$=q_MNqEos8{X%q=cnhF$I;or!ZN@QI0?*z0$;y=ou8kdo}QkW znORs^*xcOw^5x6c)|ON%l}IGtzJ25M@aE>`W@l&VRrHWQLdM6(E2=8?_V&bL@#yI2 z$jC@Vb;b7fHjmHS-Q6uJDiR0;DH$m_IXQ)eg^9_D6B84I!oh-q0&*^y!{H1L4gUD? zV{B}UFW?Uh479v!c^dna!{fBRYYmSGFD@=-u~=+2`}_Cr-QC?Z8jZzfQK?iupWoNl z*W24Go)8O#!k*rq@W}9;ot>efAu^TB<#Q(|C-d|3b8~a2rlxp29)(INDJiLIsQd8Y zLuGYkUS6I^BpMzbrvFX<{Q2|4$cJ@}bxbC+lhxVL(ZTFuHn%m?N@#8EZ4;9dL!zO{ zsma#&t@Vxdi;IgJ8yibYOUuj4=wS59%F6os`s(WH{{DV;cJ|uZ+CKvPf9P#PKmZU5 z82_93_X!}kkHf~rCnVyZ6Oxi&5DB3=Ho@r`BsDcniW(_5I4eJgT3A$Em_^Yn#@eI7 zRn^cMsEmw!gABC#Rc%XC+q?JeZ7uZ;^6f5I9dvDd3!hux`&vl}1_8nPnV&{_YevP5 zy-fM3u^OK^(}w=9OE4H{ZG9cG1-X420JgWcHUJrgzn}E@zmMLL#%vGLoZ^h)_?Y$tj!;iUU<{O{qBIY;silH}dsh0e6#V_sQN*=GIp8vUNEzeHT} zxg&cHvbu;eyBJ;9O6#g9=|XdThF8jNUeiqpI-I6zi$HKm%Wl6NTH1XS!Qrg-xaDps z!nGG-Fuo|?OtbM&@fW5j9OgM7j`TTmiKTI;1c!%uBr$~7LJPATVjh@n3ZF$b`A!n5 z+RR8k5Q^%k;vJl=L+BBkL~6L9In*!C^07uB!KnI#0}u$0WhsWRoo?)>h8UZ$GA{JX ze#mgI!!t761&;X-Mq@$H)DzZoxaS6krJg{5FrkweXqq0m-SO;$?63uV5fiEZ;-knAfvpIil%iS(sl6Beo{Q>HH!*ov8_e$EAQEd68wH zguEb(2T+S7{%TV1%z(c&!S9#qx95gXm7^&v1<}09K<(kH zX`?5o;Gm-{1?caYOC++u{*DYPg;-g9oJWN9Q0JL2`zo(9cPrtWn;D&fkExEL0$ zwS7~`Sa&Tj`m>0jWEcDY(ik!4l#>W%}@`F_B7lHKCagtuCywdM37jvC9DzD#Dw$+XDCjRgS zkjz=vZ^NmDcv89InQjlIHQ`Pprh&4}KkeV_TiM!gc)v>E8|-|snp;!pf9AgBZ>@Ua zDum(|L5;iVw79?;YrkUc5P;PscTgmSK=;g3rZf6h3c=psaT>wl=b{HTkW2XNg(S22 zu{T>m$IaCY@wXQz3p%G5XR==0{V3o;ygJ*KuGL41BoK0cmL6mCcLDc}N{0zO?C~yF-w+Dn>$v z^0SqAghe6vfE!l!L^}$PAb}0Bv+`Gf*yJl{@F8CLr9@pE=<1Xrzl3cqW+>kqDLP;W ofDWAQ_9Ql+D^?fU>fd$gv;DIjdVB>3J%{ScSDu8#0)W;30RP{*M*si- literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/pos/buttons/button_newcustomer.gif b/posterita/posterita/web/images/pos/buttons/button_newcustomer.gif new file mode 100644 index 0000000000000000000000000000000000000000..3a20ccd4ccea6f72b9d1536383acccc7bc78c468 GIT binary patch literal 3046 zcmeH``#;kQ1INGHu*o&#$YmQzC6%I3V#?!^r%tCM9Qg9(3y;Sutt@3Q z8GJs!tg_4(=R3d{`1$i^T2|T^YmCd~?(OZ7$fSvhiC{u-K|w)6a>CBej&G3f7<()~ zKR+`wv$?f7FE5YDWHz-nl~$D2zONk}8>My8LI@#Wcwf@8)6%okYd_R>(mVV5`U(pR zCnqO&cXy|zrbb3ava_>!d|q#VZ*yBSi^XCv7<4*4BqC&bdO9jLiaEp_8XC$c=XZB^ zlSm}LAiv(;-tXVP4-XGV#Y7Db4VF}tu-R-fncO$fH!v{J&*=a0<40Cj*2k8QFXCS0 z=H`AL`AqMo7nc{8SCyBPmvF{8qobp24x7W_q-Le2W~NrZtDY6ic64;Kw6`!nF<&LU zYHV(-sjJ~n@yExgwv++S<2o-`3aHF>aWzU%v{4 z!u|dIjEszpjg5Z_@c;ae3~26%fdGI2=>3=f-%kLrePAD^Zc|O7M8Xtx(cRVgRH6hV zqk5{ifEK5s@574b7g(Dgz8bh|Q%kl@I&9=?+*9jHOHsT2voXmHKaeHitBOPcgkQlD zUQ?fK?MsFVZIV@w_6{Ed|8=ua7Q-2KyJZ;u@0p>Vw_5iLoF6Qr#C1^84wFpP1Fa{dY^p!P&%INBX&+``=OdIE(Jb*x48j74gP1Pyu3;61A4lFhu1Fa z>1=oM32%5yP^u;VR2w|VJtg=)pr-t(^h^^G7XKSAuBZ+V`u93HCcjD5W z1UFwFerJqYTQb_j&-9t48chD74)I;lnXCJ$dYFrwi+!8C#$4|1({GE(#cKv_a-<*I z!XwYZ?}mjeJ!jUV5u(|&Jp6zr5>N>5Cr~w}LGqJcdpnMK_yyO7yU*1WY>;7a<;T3x zkd(&-G3r=j5)oNztQB*Nj=P7z>5;k=!nHNQ@T5|aN>D2Z=MrtHknVy%4c015(ot2J zj)B7uYlYe6&d(%YpDeZpLO-utOG4*=gS+M|T)5+{rnTb|cSgBUC*G;`_#DAYKy;1q z6G+-1!~t+;8g%_^5%$q7R({-_jvi=M;ABQgZt#>zVRY=IqLrIn(V!>hH=Cu223f%SYU0?8#>Cqk~- zdY1R8vRCSZGsnG?ysR46;*%5Xw2QpXb)i9_{#XbiXx`#j;>jxAg*Gd#o|(?*`>{S9 zs`uiBncHA>AG+GqK>%*Q>jFU@eC@=eC>tHtFGJq-v5?XhBzDn~ZmtvR$KZ9B_9;l%;)Kv;B-ofl33Xnhyw52OY$)N;U zDO+Z^L^=rE$)|}jn(k4gha**lI3L2Hb`pAJBT0FiNxalw6&T!&LMS{VnAP$89yH}h zR0zOkC~rAE9z?uCxn9S$9czGh0)-%n?_4R^$H9E~1_~tYydo~1-aaD&qQz~zJe8RM zVqcfkTGNAqJ(!LdEHi3UMD=6M(S#&J8uZKxQclM5(}9XniE{X;ls;h2AFIHKKlDc-c*bC} zkX1j`H)xoZWmM(ag#`0&Y&lRq_zIj58e)?zw))jXiaQstip-YV;Mo`{0kL=(VI=Gq zh|-3Or%c1`rizqfR7ko zfo^pZT~vLE6g%`hK)B9%^2%rV$ngu|4OG`FPp@T8r4$1o-DR?$+$=jnCKv@RPqdJO zHME1)3J2^0F_8}qatR7s-~(c)tYDmlMWt1Qs`E--r`;F$fl{UdP2rh2892Bl|6BQ6 zSe9EhTv7+07Z+>b*tB@tT8QestWK0!ZH`o|5D@~e9h6V0p$|Y}7J;0Opp1CgtH z_EYK97S+UONI5G>vHjvKwO$|6!yHmP9O{0%T0}Q;J?X*jyZ^E((S&i$=p-l9yzT<& zJ+^sI%ei2FoJYQlbN}Y<4CIQ4C7}CQae?CicdgA;>*48h>D2yNmA66r*X`|*5Dl9X`9q$TUNW_jV?_e} zyj9!4&g96#kgj(-JA+;V-?oc)Xy)h|!f7zOT0ixS-mkIO?yVZcu8}X8w75UHf5AUq zW5iwJcVRLCEbK`j7hST(jqLnuLW8|5P?)H(OnOvZaX$1BdE%nG{c?(f?3^T zp&`*`-Sw#aC3UwzymA03uf^M9t@O{)?+|!8(%54k`v=t8xWo3nTCaUkVMW+*&2(1o zvZ4Cin9B}(%=3ezb^NcsV1+xd!vxTdST)mKD3Gz>`mWY8&g31uOP0>Hyp R#Wu^_T9)j>Bk=%m=|3%MMO^>@ literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/pos/buttons/button_newnote.gif b/posterita/posterita/web/images/pos/buttons/button_newnote.gif new file mode 100644 index 0000000000000000000000000000000000000000..ea2c0cb5764cec01dbb1f629d8c16eb88314eac6 GIT binary patch literal 1836 zcmV+{2h;dRNk%w1VSfNB0K^{v-QC@Ac5ve2;`a9T`1ttJ($buqoapH2p`xMv{r%0) z&8n@c%F4>c#l^Cz?BS6&%@EO+}+~t)&lyw_6}Y=4+am)^Pr)jLx<_kYzxZ8Dln_NpmN; z3t^ ztyYdcneuG=w(7VI6+A@vO0I%3Tey_MLt8HA#kL!z>Qp?>?cAOW)5e{57Vm`uUyJ(v zo0PNPl!ISR7Cn_FRgDWbIF<~vv|-Ba!d1BZ6_dbk{ZcNBd$%strl|*q_MKX5Wq`6Z zNZ{+i!pe6o&yo%vPP)8!*4J8p$})RJ?bls$hxhAO(7gyWT*yFKWkJ@w6TY8pH8ObZ z+~+f{uXy`-dgfW+6#^ctR~%E;DS!e01|2-K-~!wch95>3ToBg+3qoL!f*2^kRBVI^ z(18Ndsb`^LJ}pHaG9Qx6}Rgld$ z>wI(M1}Ep}>9FK989=HNkQ%N47K&`4kRBZH>#o9fNKU^nJIPSe!!BUqZlX!`EU4%O zjSfGa?Q*o%rB3W}gLDdDj<*;z@Gh}EVNLPY9>ThS1{_Whw$~;DtU;TtU3JmgdNH>d zHENVZO{yL@y?*`Cdyu_M%0AsINYZ+!Q>Y`0& z{A8dxlMimh`ho*m0zfZjAJ@H%ke-Gy9H%3+Rk80N5s#bZYZYS`qi)xY8VM}fsz z%C!#iK!RN3JYP|dlJH{_FQJBm`e{#zs$!R?gs_AMBq0Z%V?mDyh%W}Z4hO#{lL$>` zg5xkzTvC)B@`T1MR?#7f)Yijru&5F)f{~0kvK!OrXfy{=Pn4!~HY!+Fx4ghh461Cl6g$pnrI>l%t~Zj#GP7Hlb9WK(T#b6W2CT{B1&0mOPM;O z3=iWNA-1MjaKt0KsH72RMjmLeHu-p$WQ1jWOY))wW2#FL1E6Cw$O~Gm zS)o#%a+D2WXFRbnPkP!joAi`PK0$?4U=|WSD+@dz=38VtPjh|`D z<`fx8QJ7SziJ&5|00GKaG~aQJw(Y2wF#1s7A$;Qk5#DD`h|fcx38Qfx1+q{Qr|s zfd`n?tN=)>TGz_fwysqG0Dvo8Mo010dkB;9@Kc91B^=E*1bG002AV?{LQe literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/pos/buttons/button_neworder.gif b/posterita/posterita/web/images/pos/buttons/button_neworder.gif new file mode 100644 index 0000000000000000000000000000000000000000..c1a9d54039d91ac4d4fb0d69600be0e2d0fdb690 GIT binary patch literal 2464 zcmV;R319X{Nk%w1VSfNB0OoN3_4W1a?Ck35>h10A-P5c<>lq)=jZqL z_vz{B`1tsRiiPOt=xK0i-{0Th;NZ>A&2o5h{{H^m-QE5D{ny#o+}zyZ;o*ddgxA>D za(Qy1qN00&d-?hKs;#Qd(9WTup_-bSsjaDwlaA2P(4eHCmz$TLpPzhzeBj~Wmz#pC1S#>U3V%F5W;*r1@G`uh6L&d$-% z(YwC8-{9Za*x1w4)5yrkp`@YV;^DHjvf0|%o}QkVoS4MM#Hp;Q+1c5uuBxP@q_VcM z#>mFc(a)Qko6XJ5(9zIyd2{>w`@+J)y1lyA*Vf|W;>E?q*4EacrJk7VDRwp^YioZ@$vuv|CyPY^78Wk|Nj60 z00000000000000000000000000000000000000000000000000A^8LW0040SEC2ui z0Dk}~000O7fNz3>goTEOh>41ejE#n2)PIa1qr?d2)DSp#KOkM$jQdUyuJy_(9s0Uy}rp;ZzE~Cyu{wz zyy3kL4hseX3*^q??BTiX@W0{C3Gnvs_Tuu*>&@=DVFdB;MXsR11q%cyT)5DHLjwT< z3>XkGqCfmp%ZoE(1BBh#*Kb|HX)~`) zyO}Uyyq*gizRRYxY15oF5B3b2^=Q(kW8ZCqX2F^qZ+3h@BT?l;vOWP{4o#eJ=D@Du z$X0IJaO~5bkB7#){Iv7u&F`)e(8k3Z5eL?krPxvD#Gadxe{TJ{_st z^Yg=LV*pN%?+36ko=WCX)|qSB!N&%B_T87De*57!n`jE&2VrZUwGjXuCggV409ZK% zl27MRbs2mOKA56~3sR@zY%f;$oN_C+$C`#|`0z#wYh<;TQ9q)$8iFdu$lP+T&1hKv z8%D+_pOW+;w?+VI2(e>Nn#om_Rmr&s+I|<#N1=^&y%*+^`rU{bT>-Em!y6skg+_6M zNk?RhOB&bZm;0I7XL9aEx94mVj!7Jb?lHxb0c~^$0~=|qK_79ettjE2#v#YtqzGcT zf&>yc5NM{KU5e>?cmg^qVoV8u#uRVB07s;w6-HbGYCNz3b0DapMstCph$v}kq=DZC z9{B2O3qY8uXJMt`sz#yE7JI3L)3p{?t7mlOgrsQHil($4EKpjnznVIlbx)=Nz`JQ& zpzOR4I8dvk@JXAbyYQN3?VtCm6&M-6?0ATVF zQRq;F7*UwYu3&bp!63(f`hXfmKoH6yVp0%Jx z3nk>bLDtH#;42Cz>|Hk-6R5!g8=kA-0US^GT12t@0zieYG{DY=vUdB*fePkku0{#I zPYXxtNp!Jy74Ht7YXeXq9-H%hDyJbE-p!Ck3|LkfsaGJ8pDJuYJzFHj|k|n(3HK7U8`kL~f5TE6gYI^?} zL4YLp7r#`cdm30n7Um^94k}9ma9Dw_l;A!TILudIAept&P=vSPWdpkFU;YSnx4Z1j zgT4wu8l;6M>Kv&>)0tj}z{7^KOeIKXz+hmoFfZkBzu40mC9134KE2LZ5fA3R!RYuIHRR4 z4QX9$SOBPi0H!mED}*1*Q<+4w0T8}Mni5z6n)0KjxlGATaFP?90%IpssjE=xY0u&~ zC7M;mQ(W0XR6R$fD77%kQINtHwW6ab7qRP9l`>UvNP{7LuCr7_W0@0THEiu?oSu^@eZ3Azb6+(?{P~BdQVW zU2*f5u>iItfgY4lKkZj({xv98(WYPrOW4Bn)59Xk@{2)Tz{b77dXZD?I-i+Oipo_q zB!k!5FzX=b*@!x`B`i=yi&v0JuT2pQ5Kj5o&dByDdluCcq(VDerTS~MB~4U9-DO$Y z_Ev>x{Vf|hq>TfBb)^KQ%b@6~y}wKiyShCrdNW&IxvLh)b~jEE&fJE4={?JWyCnKe?qJb@;<1 z+6hG}0;2TP1yRU7PF6&W65&*eS}8tGTLb`rH@)EuFUYYKc<_M_Fu=zQ2(plSEaW0H zKmkW)zyXk~fF+yk$#L6HTG*gf1vI(JNcORnmyF~fTlvdRE~|erLuHd~8OuLDa+9qr z4PATWUmUnm0x_RMDtRN&8l=5qyV0O%Uj00M}PKm-uY=tReW00l5d z0M0-Yh9HC>>Hx+KVvvChDEiZjZgd159chSAdL|3GbOH)e4+Lzw)1X!~1Qs1?2vi^l ekjOP7MlgdEh@b-<&^07@?Q38QJJ&S`1OPiXT*%%4 literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/pos/buttons/button_order.gif b/posterita/posterita/web/images/pos/buttons/button_order.gif new file mode 100644 index 0000000000000000000000000000000000000000..8fe689cd8091f48f7e5ee9e8b88c78a5fed2eee3 GIT binary patch literal 415 zcmZ?wbhEHb^ka}>I3mSx^XAQ-o}M>v-hBP~b-{uKM~@zDZf<_`=utsI!TIy&r%jtS zb?VfNjEwEux9{1rCqF-b<;s;^U0s!xm1SjRw{PDrDJjX#&E2$V)Bpef)6&v_Bm*i? z{K>+|0JKU6Bn+~Xf%X4_WsIk%%*|M}F6Z^W50<(OD@+U5y|1~|(=)HYBPBrT$Py#* z3Z3~ErWkvzjaq+WP1)&KA)y8qmd0H(&bNK~Dde&Cy!xT&Mpqewia(8WPX2ybTPMM) z(Nv+%(8d=oUct)9+NWN@B+ggCFj-j66+=CY&8SKR`d zOjxT!tuL;S6JusHD3kQuwB)2pu%ArU#s-(A(-;_gwd=+9?0=H`Wph2`bt`1ttt_V(xJ z=lA#b>FMd{=;+_y-~Rsoj+2hy;Nace-Dz-X+}zxRiG{pE&CboBq@dT?*Sx;GpP!%L;o$uI{MXpmsjR7Tcye-ia@EzJwX)&i;n>*NoSdBc`ufq)(Z|keL?(XjN^z`rV@9^;O^YioZ@$vuv|CyPY^78Wk|Nj60 z00000000000000000000000000000000000000000000000000A^8LW0040SEC2ui z09ODi000O7fNz3>goTEOh>41ejEHd^O>UBtln)OXm=BbjZkC>!oS~wlp_Z5#qi;iL z0z`eV(wFEVuVhM( zEL*;O8T9AJplXN;UDL)T(>8FTN|oAljT!(70PuJt#sr$43w0(0iqxsgHfYVNP3n{_ zTC`OE-%g#&rmo$)QQN3tu!hE)7#P&(^HMESIb`Ah5(!&ofEJLO&Fm`pl2UbmU@{r)Tyu| z&z6n4jTtx^{ze6$CZAg`9FHHU?LMId&Ifh$*h9MgVFk@dgZV$VglN zkCow_1-=vj8a4qjqZ&&}6@m-~l-Wa6BN!k8jSkph0VtGMs@{t_HwyfvRwv z;AjhHTtFNfES%v&rR1GaECgp5F=ZD%L@|L6c^Uxe87#bc#0cJg3l+KHzJWvk8s*NX zBU%-lQ9%Wey3hs+XMoU#7iTcQ1{Wz97nKL_u6BkBF*-UW0ZD}6!x^M*%0gW*ugdDg z&ar`82fCSCAc0nO{4o|+Fh#P->H6!h%c$xrRj*KaYI7P!_zNkOw?_4@&{m#DVRW9c zp;C45Ro5|DQkUEYzyVlVmk7m5rLeN?vf(Hjd>gxIU1hr)GmUUL2c2|qPzU!|FwOn8 zOHC)OwOq-{}65z3Ib^ad}{FH8<<5}RaG90f@! zPo(-3l^{r)K@G`J7fRHk)b~IT;iZPJ0hOpo1*%gmFfV6;!>ig5t68ycefQB@2`_V( zQsF67qrxE*VRNd-6ir;@GFSRMw3z$I@Lr+w;upop#65Mfgf62P8#r^Za+$G4!ExV+ zPP81?#ORBqqN5!xW5+xe?P$6IQwIZxzc$82W0c&Hsk|u0MMlj3i&ZLGbd-^RHb|^B z92z8TYLu4okx-6v93!7#*~q%I0RU`J&l})?fHq8NgduF7V%7q;q)aR_pwd$bX?aA} zPzXS8P(uzBmBQV<4Jl+niZ-(|mh0$aDck`PCe^YuGz4G(7J363Ou)`2_QFDU5?Uf_V1Mj!$$jj2nKAbM;v61YJlmdeyYbN~k=;J^kp(A269;st>L002AS?Y}1g literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/pos/buttons/button_plus.gif b/posterita/posterita/web/images/pos/buttons/button_plus.gif new file mode 100644 index 0000000000000000000000000000000000000000..f14e73fe83150b0983f59607fa338267640ed356 GIT binary patch literal 468 zcmZ?wbhEHbRA5kGxXQrLR`0!fy7`6m%AY=cDlQKD^XJc={d?NF+D@H1wPmi+rAwEt zUcDNX5ET(0QCU;jH=%Fefqjp6OWfKjJAKadISc31G}V0k`0?AfZ-4*(J#*$vN_I+S zZuIK)s~wrj*pBUIaI&?gA z(UI!+P;PhKB%&cat;B0>)JnOViHu$gvmR`y@DW=brhDT|bl&dl=U;yPUf2FOYunwv z`R{*bRF>4|)mG)1bTZ|)HRpDkbhkFvm4sKk0ykEgl>4n0gBMjmi!K-3UPI}tIEz!ilU=0AH5$28n literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/pos/buttons/button_refresh.gif b/posterita/posterita/web/images/pos/buttons/button_refresh.gif new file mode 100644 index 0000000000000000000000000000000000000000..554c9e7a7fb48a3d70befc45299ea27bcaca7cd4 GIT binary patch literal 1978 zcmV;r2SxZtNk%w1VOIbu0OoZ7?d|RA>gwd=+9v^<@oscg^Gpe=jZnJ z_V@Sq>FMd{=;Y0b~g-{0S)X`uf<|*r1@G&d$!9oSewW$kEZ!#>U2&oS5I> z-?Fx{v9z(x&CS``+1c6I%+AbvfqTZt#@E@`g^Puro}RqFy!-q6;Njrm;^CW{o1~-!`j-~$H~W` zrJ41ejEHp~OLCHvloApfm=ctma+aQ&oS~wlp_Z5%qjOGc z0z`eV(wF$swb02H5v%AjBv(dB-4GaYV4AjNa+|jVz z;I`4l3FF?dUV=5X)a~vJ3<2`<^9A+=YH9!g`T6$r00RoFch6qGeEayR`PU#y0y2W+ zWP^t-9yWOf5B5t4fQ`qG9}{XEsgI+{jv(2zS-J9!%av^S1uzhRhpG+N3f>EVuVhM( zEL*;O8T9AJplyf>eG|te(>QdZN|oC5O&b6S0O*)=MFpFl3w0(0iqxsgIB3nPP3n{_ zTC`OE-%gzir>@<*QRB2>@MgxG8yec^^HMESIb@h8l3RFoy?GwZYg~YN19)eQ`DQ z*nWArR^o`Qy)~3o1;i1Z3vjIQMrs>Ag`9FH`TzqF3BZ-$iNb{#Vu~xa5kMP3%;5t6 z9Wv5JM+9y}Ddh+ee1{iWKu8(FarJo^;~GDL7iA14rX`e-Y}oX~jBPjxrIc`1nVeJ( zM2Wx&<%PEf0epg4*BW4sd0c8k=@q~mTX|p=8)ZHjWe5*Ez=EA0(vd*~5&R%RY!5_< z#RYJP@W2HD`~ZSfOuP`m1V?;HfC6A-0Yw*05D=&v2r%%%1fa%N6;yAu=obfzGL@R6 zZb13~3Q?jERS0mp0fJ=Ft}%g~ZaBaI9VbNF!=40a0jC2(02(C*bw+6fc+FABSrTx> z!G^JMkq~W^4rIWsoe_)>r3iE&fG+}YTx;h9bTD!51OmIE#2RBn8HNx@^k9Vlx#wcg zEM-1A2M1?4tRe4wjoBM*5k82ls0#bE46C_ z$r^>xc?O3{)upsTlrpe^2EIMM?1QDf%Di^LQGy*+w{GAm0;zTdaKQy2XzYgI1gnj} zkZ(gL9UauwJ=WcBf5d-5J0OfTVY&abZq>Dhhpn}ls1sadQIvidb2N!zk zvF9F3Ab~D=8tK9i2N!2!&??)P6Yj?AmimkDsgg}PrM|om-aCIy`3Io?2?Dmo($nW3 zNJpgHlLytHvt z(To(>7!&EocNK&R0T}}sApxm1MLJTFmeeE?VGw>Fg3Sr(Q^5%o7p)beX#VDvMg=lN@1a881G@WABRByx`{{7Y31v#fjmU z-YCaHzOjyUG|q?cIERqQ>y9-NAO`nyKpGJTj)XL%c-W}OcquLa8M@&i1Jy#Z1k!Mn z!FeGUGufxe`00&agp9|cqYMSafn7wB&J7mpZBI$AMa0Dyyf=0Jx7 z!~swgOi}(KNfh8{(3M3z*7s+@GKyzqA4H)H1;?WH$WI>8Lvon_K=wm6|8B!@p zNxT3Mz(R9ig9`S!gc@i-0|x-;0R~FYe-iYd2UtKt51;^rE})?bh-gG@#Tuu;L5mA` zC`J_u(2O=zp##mRNF6HD15`l}EwF(NhA@OLOrZiWjcEleKvSB=)B-7}X$n#Rfu2%; z0zD0?Po*G$0a!x~Y^Vr5;K2@U+#(865P=AON>!j*HK-OBut6iX%GE)9AO|MkfCoI# M)v^vE1%UtnJ21P&Jpcdz literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/pos/buttons/button_reports.gif b/posterita/posterita/web/images/pos/buttons/button_reports.gif new file mode 100644 index 0000000000000000000000000000000000000000..add87aa82001204351640e1c31a3c9ff573332a9 GIT binary patch literal 489 zcmV<^=uwmk-(nY4@DTYe$cvfmj9t zEkuDpm%C)9JYi7x%#@047V024c4F5)h6iJ2;REOKgaHf&PEf;ma@eU!>NGJ@F-!ow zd5jY6?0E9TIGEHp3Ou=rXgZWD`lZXK^OeeiEnoTDn6Hb903o|7$z&mq*RyETx|pI? fO9dotwJ-}3_ll7lb+7yoK|(^_B@$?e2mt^)k(1Pv literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/pos/buttons/button_save.gif b/posterita/posterita/web/images/pos/buttons/button_save.gif new file mode 100644 index 0000000000000000000000000000000000000000..6c18606669157e3c930d2360106c67558ce33788 GIT binary patch literal 1896 zcmb7>`Crlp1AxDXAf~3Kq+qY3me!nW<`Q#Vs2iD0r+%R<)0YbGG`hAl>?2ORuL?~C z4b)V;@}xY&19TF2pLu|Jn}&IkseAV)yw6Y1FV9cU`3v}yR@W~BCcrcWSX^A3pP!$c zoLpO5o1UItSXh{vn%dmloSB(fUtizY*qEK2otvBUrTC7IkBd9RJ3Bj4sdQvyWOQ`2 zptwNNDN!gC+uPgp7xvPk+vQ{^G?8ZZTIR5=mv!?Ck8mzP{Rq+JV7= zyASWyHPp#uvazwTuV23o4h{|s4G4w8R90$1Nx|KqyXCy{FJHd&^z^V;EQv(Y)z#JB z-rm;M#%8l~a&oq|wrc8Y%B#wUhK4dTGdVe&4<9}-naqia39(o#n~)X0Dy)268UHlC zqpPFtZC!tV|0CL?gl7rk((&fzW`RI(FXu!Tya4i68%fB!xsBcp$yzpS!M&?*p1 z#7#|2;W6R#SUR_eOAVt|@G1&R3hVjxL&HOfjKq&0Kd!E>lDtVvOG}?VeUi)ND=RC@ z%gejFyJ=}@pFe;8p8)?42NlW?0H6S-|3?2l0aSKF1H=9br$NUiq-3VEI9b`8lvKU!KpQWm;u3f%Tv-`Wr3^25RaRSF-|&`SUt3Xy;JXDL z@G7gQmAtFys#H@`he6bP1>GZErK3__mjLl$tn~LV^Qzv(C3SVk=am)MI?U4(02GS# zRRFrD=+6$1x74l8WW{R?Lg{GOF!`^@9}KZUaLx6L2q3;S@f#h#1Kh;yzY{QBIajJ( z;zh|mn=msiHoZV?V9%IZ=qs{)qN!U06}39k%Jz-gLu?irf!Nzw_Q}Hp2Q+{Hq?DV# z!qPL<9vCaf^l~p^eZ&P0^Nb&^RuXo{9W!ckOGay*hjOm7rz4mL_IJ;&T<)B4=6Q{q zc(AZ#Bl&+0;CL4;&ByZnlu98oFIy#x|0s~hsz2p}0#GIiX?9&Bi=JK^b zemmYlDx2sxM7M71vuZh_F)a41|9w2k&Qamdd z-DsfuTiP$$AYL1<2gY<2RXiEx9wGGEFTgdtTu=QsG5*d*zmh9OmYeNE=g+Cs;f;<# zLDn*T7e&(DYElEAa(?t^M{RKK`Adbgz=8dC>~_hqoM5nL)SSi8?TMnhg9Stdskixhc= zkCw`m_l>}_(R;o&&FD7Ts=44qfZ143w`FvNv+6S;!TsDwC+jFmug3>z&R-;_2sM6 zs8%Ox`5rJ%IbThqz^UmcbQBJrwH4qCsM_)C?Tzw81ei(T4ckHwSmRWs6BXSuKv}Xe z`I+Vv{;o#v7W*aosYBt_fiQODbR?gL%)9uo;QC(F(dNUSDdZic)GEUsbSq8}ta+cq zS@q7-oR;5IWW^=gd6|#0=V%t?hqN0RSqMcw!JbUgUz;(VNHYDo-3~C|_u%&~Mq?%Z z_M%OqtxHH5jozZyJqUza7|R@M zc=*1Ysmuu7@{y9{gDBC1)iT{Bbzf2kxCgCd2B=j-G)xfFd&wk-+5vv5ie0XGEccz4 zAr8`U8mGkOhWbXx)5SO9!G4M@j8MVsJdtaerz$1~udsSg&p=WzQQAc$*jYIQS%9Gh z4}(fNZQf@Wt!TQlKf%7EgyO!{g3!?S*|u5$q{unK-Gyu@Cq-fdwZjjx0hqGb$J)}b eQ?-b#jnSCHoWwyjZ{eV5Ev~)FlQ0|rocafBf~&>= literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/pos/buttons/button_saveascsv.gif b/posterita/posterita/web/images/pos/buttons/button_saveascsv.gif new file mode 100644 index 0000000000000000000000000000000000000000..9f099f2905b578670e70182cf62fc62ca9451934 GIT binary patch literal 1742 zcmV;<1~K_ZNk%w1VOIbu0M$PLot>TE-{0BU*_xl4b9!_9{QS+%&DGY`!NS4d;NXXh zhsw*!!oYw$fKvD?d|RL_4VrN>g43)=H}+>>+9v^<@osc=jZ45_xJYp_UP#7>FMdN zv9A99{@mQ$-QC^!`T4H0uITCL?Ck9B?(Se`VD$9#@9*#M@bL5V^YQWV|NsA)nVItP z^8f$;A^8LW002J#EC2ui09ODi000L6z@BhOEEj5 z+^~2Ywqm2=p5``cyG?KtiG-??OzwAlpYQwsfPH&&btr%cYBzCndyR{8kaR06EF~f= zlZBC+kZ_!zc94ZAqMdLILKk(DtgS38BC)cvCAB3qG$0_jxV5vtz`?Y(wY<2xyEMKl z87Le=JeaSSu$QsL#=OWNHQnCc$l2n#+vVKfH8|?(Iqm8-yCNnc&rp`cwj#IW=-un= z?%e(B=j|U3fdF&tXs2+8kB1N;F3f=g1PTxydH^U;W1lj7$ov^(*lveOk|+-{RB6(r z#Fi0b>X=Eh=EEI0SmapHqe2Y-9JzWC<5y56$(Bfyo;(WkVND%QY07+R^I;AVJ9t7+ zk%QZ=q2zQGWQa7P%a}fto{dTsD%!Vbca-p9pvP7nUWFbj=dWZ_sSvBCbr`YjQ@C%- z?x5krLC=REaKKBJ>zmkgWX}R-I}@&9sctzZhPn8L;|e+8y+gNpY{S2s*?Ojmn0CyQ zCu!X1(9;{qe-uZ)M%(#jTExgDCMP{nVGbHP4%mH&LupBrWqrhcxv=T&n`^;)SKBfm z#S%LlL(p*}hgs_l3m+E0)Mat{nz?f)ZytvT9Cbn9Lwj-IHx+H<$+n+UH{5VvaoK?v zoI4`a@C*j-;ot)U1lVBzg90mjci?=p-ACLFA%u{D0v;03fP+3D(BX$O_%MJC4YhL_iBWL}0@LJ4j&X12({UWCI4Y3grPdJm3QX z66nC{oEAu6sFZas8iJv*dZ+-P4&L~{4lE{cX{I-DnuDpIe$dbd)FP0>jR$;i>JGSS z*Xv+T1wa9dHq5~PDv~m=_v;NrF6tmn)Otw4OkYxvss)=uSCl=KwmSUF1WRj_FWor==Fz zjmEx^4z;Fka8L(=yF{%5BE%$u#ssi<0GA#f4V7C5pzES`Iw1bx)DTU)L2kSC*3ED0 z1P9!3Qz=LPn38bap1Vs+IR~9|0{T#0Qr9u1nTg!d{#}Fy;zvA1?x3e0d+zO5UVKmr z_Pl*fD&>@Z&Ofh`e*jKLpomG0Xj6iuhvvPz54y$tNdWn0VGkGzU!YmUwT0Z1$6=7X zAO$1uNF*RQ>CumZ6dv7qhDjr8AIaJ$B^9V(SW=o7ljK(tACxI8b_tR~aOc46H3@$6 zsmZTWWIIKmDncYzzjW}gfN2PdOw5e;Uh*0y+6P7N64n*j6Qz-bW{Zwlg9>&~ zME*GI=ZUw05B=ET5Fb`iUP64A8$Y)x5a_@$J@CN^cF-W}ktd4bOUcU)(#NO#FoGMEn&4z6I8SiP z0|?-p=X`-W*QrhzxYM2Mgh2q_8Gw4$GXV*(r#=&qff10P5;Uj*HD>XORb=808OQ)W k7rM{@K+%d0K?4A&00cH_(T)xw06_o%J5tM3h5!Hn literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/pos/buttons/button_saveaspdf.gif b/posterita/posterita/web/images/pos/buttons/button_saveaspdf.gif new file mode 100644 index 0000000000000000000000000000000000000000..bff11a3d4c39a7e6ff13c1922261d0ae1b65906b GIT binary patch literal 1651 zcmV-(28{VfNk%w1VOIbu0Hr(tot>TE-{0BU*_xl4b9!_9{QS+%&DGY`!NS4d;NXXh zhsw*!!oYw$fKvD?d|RL_4VrN>g43)=H}+>>+9v^<@osc=jZ45_xJYp_UP#7>FMdN zv9A99{@mQ$-QC^!`T4H0uITCL?Ck9B?(Se`VD$9#@9*#M@bL5V^YQWV|NsA)nVItP z^8f$;A^8LW002J#EC2ui09ODi000L5z@BhOEEj5 z+^~2|F84IIk$P=vn@A*-oMc+F-FUlx&+q&HYY1mIZg6;qg>Z^-D=RD|A}oz^D2tYg zZI_Canw)cslng=_a*d{^EG#0ctgI!kB{Vc3AhNQrt+~3pA~d+VzL37T!5l(7lBtoZ zk*lw^(6h84HPzPE)6v?})7{nG-Ziw};ULCPkg)0^vC`MpIPvj0^f>kMIPcf^_Br$Z z{Qd=$cQ2lY9sml|XctV~v}ytAN!&qEqQ!a^`%$FmqvMW_K6XqD2~s3IlOH`wT+pLJ z3>>p=sdERfpT&(hb5^{$5v2Z(pFV#6?5QKD(2Y7c3QbCpB?J{YsMVUujT*#>Jxitp z=~3raqeYi;4J*{A&$1m2^mwX6s!UnntZK}PwxigtT){3CyO%G}zD6Ci>{@d&W?ff& z?T@XqOHax4eB<^^-&a%%!N>RDU7w={>Xm(Z>q*&lgL3Q*NRfdBZe$Dw*x}#<0|eM$ zg90n$<=cMD>9$&4-u_AGp$#B?C?QB8h-gCyARPpOKQ*i%fdxLaV8Z~rnWY+sn31;J z4L3;0qlZ69=v|LC{8VC*L!$VTQ!FB20|5+p)DeUdQs9G=Ep$Wx0Uc2wVFY9GD1(F& zG*Fa`Hb}t0kT)FJrkh0a7=oK{z8TaFECG;I4GVavKm!{Q(83N8*s#D35^(u|4OYt7 zfB}r2b$|^I_&|UJIxL!{1rqS+sgG?68K;~=*4d^}c@9`Z4uyL7!FeCFia-tn*l@rH zhVF1_P@Ga{R{#_!AmI#)&L{($KiZHih@&QJpNRveb%qK$teV3H5vGX)3R`Y~D*`z5 z*}|3-Ng(13{*5jArv*05;6tlViom9cc7f_Fk;taR9kn%pHi5Y&Okl$XHPqTcJX_i@ zsIHi%_fxHv?g~<{HXJLIkd*0waga!EOqphc;W|JKFTBX74H1|Sp$GBcYC`}NdD%b$ z5`bCSm@+IXL5vFf;H3deZ4B1NL?fA_W}FpPtAq-?&~K}SZeULbHdxS8s|tvamk8_< zAnXA=OK5ReBW4&By&)nQ6j!fR5Sv8!02H@-k+lX~jd+uEq29Sc7t(O``Cy!RCSmnn zdg0NHpLN<*XIn+;X_W(a-hr1NPUERo9_Hs61zk>f1?3!F6~)Kie8k;n;pM(nrXGNH zgU;0conFy?pmN?R*aL%tvfiD@LQjf zki|V6%&&c@LWru?V;<2&?sIz!-TUSwrx5TcCG4YMwCwYdH(gL#8laYgUdK6}=;U+m zInH?G*FI03Cxb3LP;J=9qw@#`4Jz0HfBJ(Q{a8qa6(IMFY$^#++LE}L1aSd$xcp^lacgfCOw$~Jsv;+s6^!pR>{g$!r+y!WF-s&0LuW_(v}HGz%6%~fDDX) x1dpIW4VJ+QW~}0tsxYPqZn?|=DD##AXo57SIRp&=paKxcCN;M?ga8Bq06XhiJwE^d literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/pos/buttons/button_search.gif b/posterita/posterita/web/images/pos/buttons/button_search.gif new file mode 100644 index 0000000000000000000000000000000000000000..bcebc9db78d72bd3338e08b757ed71580418115b GIT binary patch literal 1941 zcmV;G2Wt37Nk%w1VOIbu0Ooc8?d|RA>gwd=+9v^<%Noc`1tte=jZqL z_xASo>FMd{=;+_y-)V4Z{{H^W&&}ZA;N0BY-QC@Cd2*_)s`>f({r&yW(9oiyqH=h0 zsjaD@p`n_Zn&IK$;NjrQ%gdmopqHDMpP!%J-roHD{MXpm)z#IbqodBy&Y`5Cj+2gj zfqcBayu`-D)6>)X`uf<|*r}|k(b3V!$jG3epvub1#>U2+oSe?i&bhp~vbD08oR`_z z+0D((o}Qk~&dss3v74Klq@<+Q*VeMOvg709%+AcazPtPT``_T-%gxK;;^Nub*?fY0 zb9r;9tf-irnAq9ajggJ3uB*kx#e|83*4Ea=$Hm;;+^DOl#>mFQ!^54OorH>n%FN2! z+uOdtzQV%7p{1dZl#k`+<&~P1tFNot+S+@8d+hA&?(XjN^z`rV?_g(O@bK{S^YiiX z@&Et-nVFgL^78-x{{R30000000000000000000000000000000A^8LW004FXEC2ui z09ODi000O7fOLX`goTEOh>41ejEHs~N^_Evln@XYm=KhkbC#Z(oS~wlp_Z5!qjW=U z0z`eV(wF$subRKQ7v%AjBv(dB-4GaYV4AjNa+|jVz z;I`4l3FF?dU4k*S)a~vJ3<2`<^9A+=Yij@i`T6$r00RoFch6qGeEayV`Pbk`0xN>% zWP^t-9yWOf5B5t4fQ`qG9}{XEsgI+{jv(2%S-BF9%av^S1uzf*hbj!$3f>EVuVhM( zEL*;O8T9AJpl*l?g(Jr$Q#o~_N|o9ajvD|80Mwx4#RQw43w0(0iqxq~IcUwQP3n{_ zTC`OE-%gzyr>@<*QRTQ{0OtlB8yDQ@^HMESIb^4r$8MYofpIjO&Fm`pl2UbmU@{r)Tyu| z&z6l^&YC(I{ze7hCZ;aQCd`!YO+OXx{dIWD z%kj@mn|4hb80&pxR!~-zHQ#FB<;B`^3{utLc~vn5#~N{ zwn4z1UDov_kF*V?R{(HqrGZs!n0Q=N2TYkn9U@HGgH#N-V1WfMAoqb07I0w12jJld zLIfOe8Y34~pdp5TTz(k<4;82XL*5SgN zZ#c@~FC)xqb67H)#!1`|}u zv4p%fs{le&AWX?Z0Cm4XwceA}`@qT;9AE*bT=Tu(dCx^>!*uVB1rrrbzYzsmUrgCT z!W`5Q0hI>`yY~TiS-@`#mhTJt)`rsv7kcWk=N?NS!DPl6)6Vc#1Btr1f>gTN%YxKV zb!`{EU!D-W-g>4U*HaVz7obN2vJ|u%12BOE5+l~}sR{u&SVRPKHwY>Jj>aE48-%A# zSmA{k))--M-R-FQflqo!!-juK=)3z(S?yG0zYouv-4k^`-5WxnM!v54~1V9xH6H5LN#PFU2MWxDm4 zZ-r}Ib7WFZ#uq(v%fQD+VV7abx-t}fOHeqmCb6A#5QHmb3O$;p#s z8pg9^=tfOgQjA(C) zfJQZXQ3{k`qa`ST14b$V35@ilByEBK24Iafu%ROKfCoFYaf>4~;R7EisZLGG)00v_ b28{@+PzT|G9FU*`8qmN{mpX_N1Ofm%d?CTs literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/pos/buttons/button_selectall.gif b/posterita/posterita/web/images/pos/buttons/button_selectall.gif new file mode 100644 index 0000000000000000000000000000000000000000..03bb5478703d4ab42c73a99ac79f4053c35e93c3 GIT binary patch literal 2469 zcmeH``#;kQ1INGHuw`hvIEbMOk~-pe$t7pSv7wGj56UI;ob%LClw68NHY`OvlFVh; z+%|J*v79E?a(i56?!(O7X2zt#h}wD1U-A6%e13TU{C>S(uMgVU>6~?t4`2ew@WAHg zrc^4GNF)mj3nGzdWo2b?adB&FYkPZpX=$mVxQ;6TbeM^6lzO%FQuK696N-Zuf=5o1td3oW{ z;f>9Wv$M0ky}d<6MFN4Kq@-kTZ?C!g$(MQKd-@ku9Ett;E&u(mKOnaWTC|bgx&$3Oc(xS65fp*48#QHa>p*xW2xQy@~zu<;$l} zpFV&7ESJl3b94Vo;Q#yI6)@OQ0096VF#TKM?@s_QIUtAWV3?G)MA$(S|89f?~TTseeA!e!w{S1mB2y!N{lb>5h8z@5I z*2vc^KwR^9C;n6G2-=l$i;|%bF8%@tq(awt*<)$aSAz|8I-Q5D^2za5*rGeXsrFM+ zQRptP{S!Y8j*=+AGOS(&G~gld8r=AunMT~s*v?cdCczB+?RR3T zvW&2gD|RIb?DiJ|`@ntM7B`6ng48G@xl%fxecN8#U+K0+KL2oIWX7$ih1UFScW_4- zl+o2yq>B_%NrA+j`#LyL6HS<~e8M;|QYHma<2HVI5*Qf+Ywg+>j}Jp33qE;agK@e` zfit3W*!#yKkSK#lQyO6(ynT1^+pL_bkDdP6&G={$xS`9m#iI?~MPT*))z&mL&K zqkBID0MYH`IoByK>61@Q)OP+EXJP0Z^eoW)WYLQU!gZ)}OuLfbt-E>K*{67IKKQjIz?@SA&J14#N0|;KhbcTM17nmVMN35=!5ZeZgSPo zNqqv6>w+cF9LKCcECeQpQ9!k!wn1JCW>=6GQSeX*+8(G@j9~#%&5p?+zXNr1>H!Fm zXt%BS@Y=m<O&Qk(05ifB<^UojI13Zv|GkJe9R0u;J0_O~gh5U^!KlWq7x+Yzdc28z5GN03xY<0>FM9B)0%Ed2Tm? z!~EI;K5&XckGwnVu+?7HWSf=x=%JtX$lCZ%F2DT80q35k)wii&YX|amWjg3k7VXcT z0|I2dW1J25^ZJ)4_F8ZKBW<`K`KAHhh{c7eW2{>SYY6U{o_h48~^pc?51~MgR<}<5e7A5uOGENEPOh$23xl~E;pPu^`ERgk@~nq4}@LyJYwzR}7}y8o?BO7VCxIe4E~Ej^VbIoh2<4hn)<;tsNS+4e~wbQs9Q(Vw5M0SQuq? z(kkF{p0@BOOp13_(Bu)4w74`2vJSdb!APesIQP=+X_E8 z@->)Kvy<6x+WV_R16}zdNj)2ePel2*LXhqR<-6DqiuJwIaIEm%%;Fg(Pe5>}R39uZ z0~EQvf{lwofCAG+_o8bqyOns_m;F?of(0L>%UV`c&2VR16CZ1Cw?ecCYVJS+A_-_i LATi2dFkt%^&m%F= literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/pos/buttons/button_submit.gif b/posterita/posterita/web/images/pos/buttons/button_submit.gif new file mode 100644 index 0000000000000000000000000000000000000000..d9b2fcf53c517afc974804ce419a8e8e2e9060ad GIT binary patch literal 1957 zcmV;W2U_??Nk%w1VOIbu0OoZ7?d|RA>gwd=+9v^<%Noc`1tte=jZnJ z_V@Sq>FMds&&}xQ=-=PpX>e)&{{G(SprFpq&e74)oSdA<$jHXV#@X80&CSjG`}@q! z%$u8=proL=yt(4y;@R2RvbM6Mq@=~i#i693o}QlLTA+uNwCsKv#_*xA^jrJ>y2+_bl}dx3j|iiFnI*1EmAg^Pu41ejEHp`J#vzhlo1gYm=Tnla+aQ&oS~wlp_Z5yqjNuN z0z`eV(wF$s!a~o^1v%AjBv(dB;4h#hW4AjNa+|jVz z;I`4l3FF?dXo51e)a~vJ3<2`<^9A+=YH9!g`T6$r00RoFch6qGeEayR`R5=>f+>RJ zWP^t-9yWOf5B5t4fQ`qG9}{XEsgI+{jv(2zS-J9!%av^S1uzgmhbjx#3f>EVuVhM( zEL*;O8T9AJplyf>eG|te(>QdZN|oC5O&b6S0OXhhWdxg^3w0(0iqxsgIB3nPP3n{_ zTC`OE-%gzir>@<*QRB2>@aDyw8W-B=^Hm zFsFlpHy!yEF1hchQ^ix^&ZWax^<>MESIb@h8l37Fh>SawZYg~YN19)eQ`DQ z*nWArR^o`Qy)~3o1;h~@32?0OMrs=}g=a*rAX@Zm>&^DA_0lcwQ23E0Q;+b?DFeMmt05RnmQQ>$(T{xN$ zRhTD~K!gk6;m86DB}_o71}j_vfC2=pp@9ZFtPubaQ_j%9WmQ4-MvH!R&?r->O*O-m zB7h(U15<@rm!5P`NhbuGM(aijQn~@b3UrnMD*;n-A#0s()b*ug%~8l15^%)92C+oa zF-Ep@0>P}cV!{C}ohhU+WeSqf$pO8RPPv1hfl|T2lq%$VF1k>)tL_{)tl{qee2uA? z01RQ&IRjdH>g&bw1!H>hiB{3YhZJ^t` z1rqqi06|C*#7Z#GS@HoNhWT_<1+NTs15>WB2Dff#u*MqDV(rGxyq-s4be_SXQg!gP zVFjH}w4nr*C5sTi%OkI>0ya{LU^N|LPXNaRQ+n`h-hk_D9$d~rCmkKsu{{<{O^`dK z6KIKGIn>s=p@IrimS8m;IgdSf;fHg60+lE4XLfq)wHJAOYqPNg6LmrW!dqL=d4!~# zPkF?`Bj4+6={pndMvnOYNc{4yKQ-Zh0eUnbOGURafD%6VFd_>Lu&^WlRL3>oX@haj z)hUn0oi<^G7iL&vgu!*UBaI@O=%9y0o|$4}Y-vM_UKFDl^)F+P(oc|j6)_+&1~NlB zQIV{orX($?Nd_#|0xN@`6xm0DKKt5^62!mu3FSy^nuD9@04EY@5IK0t4~WhbBR|E; zE+S;#ehzgcMO~;-k3t`iK!lg#5XW47QUI*J)~9p9kc4NU!>{5HtYJZFIafU5{k)`~ zyD+g&1W=+4|MV~~g6A>Lfy27m^)5(xXfgNUAbCcJL?({WhD@|f9wGLjG;*e5?m}aY z>K7!}Wic+q`5GC)h)3}}%s73dP|$SK!vCoSVBPnnN38;Hah)Wo<|y3sSb3ov~a;A4}m5kuZ5lmariJ1hCK?*f4^2_CN*~xBvp= ziGX_AGoJR$Cju6*PXs7{p9}b>5(gS9);I+YVf<%66S@F?%Cn&gwP!;o3ebrnKnsFE zK@4Irgduz(3KR&bNGVW(l9p7Y6=;D;ThM|BxKsiXaH&jRDg*%xz#3{eCq?D~4|Ztd r7D*6-3tRxxqQ>;7GOa)i8o|`24q^j12tfxjkO8M!br3BA2m}B-A6v`i literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/pos/buttons/button_tabular.gif b/posterita/posterita/web/images/pos/buttons/button_tabular.gif new file mode 100644 index 0000000000000000000000000000000000000000..dc93499596a56f794028305ec74e0be0803bc8d1 GIT binary patch literal 1324 zcmV+{1=IRRNk%w1VOIbu0K^{v>gwv`11HaPZQppV z@4PKufuL|GC>n>zq;kn@B8|mm<0p(dq0mABzy)ZrU}!K*E`xR z@A$mD&hHk2X&hd9TzrNU7Kw_AhmDSNi-{PMlNpwi7IpyufrNFDl9U*h8Kb45po*fV zqNE$H8y>Q=v#+HT0u)mb925X_ade@rq!}B>#mT0ZmdD4n&a~1R)YaCq8yEl?QwjqZ zb#TI}%dpPp=*j1^)*71@gN#Vl7 z2pKYAiUjao!hz0=8I%?fCN!r7GtPX4i~@n5ii*9g8FFJfr6Fk*eE0Ne)Mv<=>C?af zqAUyrF>>uX@2pXoQw?gkaN%g!yj;Js0Il~hpV7;_{76=?Tj1rJd3zyeRk2_u?n z-qzqW9(D8#kQ8X}PzMqTc?v3JW?&m!bpE%Wb!nm*pa%;qFolA5CQ9jubm2u7U^DfJ zQlLYnVu2~OC16aIwn4CfJp@i*TXhmF34v=d-iB%ds>F?x;{^|fAQDC&OGDa(w9D~)mUG5X_x$wF8S`k6mtYDR7)7i7DbaH9j#-Rd(1-~* zSbNp&G-vH}w)4Sy|Ebxj24+X4*0xLmjtsi)?i{wyV7qQ%NTG}1!2lcZWfr}Je?`hr zqqy7o#lXq!`i`CYDMAJV*atK4s|*|c^ox9Ah;fsLtL-_-3~B)Y7qr!Z1sudM!1?H> zum1Y$6M(+^VqY*5DH`~8zRK*o&;I@ch|j?P06c&I2S~sI8c={GN}vK2IEF%e4-aej if&hfDzzQnx0OD(b1~({z2t+^uAmpG3M{s};0029QIC5VA literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/pos/buttons/button_timeseries.gif b/posterita/posterita/web/images/pos/buttons/button_timeseries.gif new file mode 100644 index 0000000000000000000000000000000000000000..1943bc0f2eaea36d510707da68f3dc4b3d5419c9 GIT binary patch literal 2470 zcmeIx`8(8!0|)TWT+BGf`BgE7_$Jp=sHM`5``Q$e9A%`ea}#zegJwRiNt-CL7-q(} zlTceCb_Qt{!^k!68H91=m@pyR{uAGyzONtNzrLU6{XB06Cwp^?053ov*h&VLmzNh7 z7QTG>GBYzXJ3G6$xcKSQr|s?S&CSiZxw);aEum1DoR&O4KR-D+8J`#*8X3yx^S^!j zHa0|T5MP8=yNkDB-O z>(~B){>tZ-6bhxIql3rem6VszXtbf>p}N;~-QRJ$dwYA^+uQs4`q*rCC#SQqxiKLz zA+IoxFW_@HoT;g)>FMdz-&1#XcHT9=qZiXzZLHzp;ljeg;TXm+Q$tHjOGj5nPj63sLw$5?v|vgQeK)$Gpny@v;B<3hVqNLd$8ukm^-yty6^gehgln91R&?JYy3C{0l<_f~i?<>H(&ehz9Vhg=s__x_MtS%u zuRo&UBjrwiJ|9I$L)itV-w?;4u_6G-_~FHs1|m$lnlSXsx7JyfMI%=4U=!fu*)+q>!Oqs4)^ZHZ%OJlR>sOL|h4_$DT_r^@%Q z1dZLTIer3JdS8isVgm;jx#UdjKGFnGfU=ft3W7TE;MXJj66s@a7jg5PXXjTama(G# z$@5hC^5(srUYOW>)j^VuIj~L7@lO{2rcRh`D&vDfT|NJpEeMnzFR~;1$J~RX$*80Z zB2%+q%@ZF&(3qoueXJj-SeZ(5da`1*-gFvC8H+?~XakO9xOULN$hp7gSQuMXaSD>K ziaz{+drmSi$+Uxf4I7KBW8Le8@EyX_gb1Jel?CP3;?ZZY8d)Z1odl0TKl90~SdkW7 z>&ULcq3{Yp$W*laC* z7lvv8bq`7)#bU|y(z8-23WRj>kdnP(7XR)7ofj0} z_b_cjmT*zQ5k*kbV#CnLk5+V0r#AIJpiBkyi99$u6*;JaW@j4%A3tawmD`~_34SWZ zyu5LyF%?O?5Vnlb<@wHF+{Z?W>!*FTe1HT)E3!0L<-%YZH>=U#b)Gy#rf)A0BK{gl zc=n4X+ZB1Mu@KXh8gZ#+@k8s;6shTQ;!1#iyZ91e838)>>SG-#T0{UlG$hI9e>A5g zKz3_2BnQ_N)|hT}A(~wvwnB$F(+* z$hGl^E#(GE1Dic@L;Dc{+^IUYLFz?75vh6eL+T-FV6#oOxK(z*OwJcb^Bzrr>GzA%=B$Om0#+Q zJc9L#MUq2(XNPx5J#I7>MuiB7Yi~$fLtrYEPI39}9S$Ygm!*nsY)lKC3d3$KL13y{ zOKUcp!J$1(ZJ{lMJ@&;8r?P@M59-&JHg&ZnI)ro?fE8V!s{BrbU@znHBhhfFVjRi= zAjQy_L}j>@H3Wdbu)L3D&<6x8c<;Q(@l90 z51{uE3W=6yBIQldZOBbL%M#DJWY_5#edm(_9%X%5TKj1tpTX4j1Q4Kk3&scAYRT3@ z+d>1;sh3G;coD?j?=T_=FA=C<_&~y7=&fq0@oz_6t*pQt`2-wn0R@Hck0c)a#%~Tp z9Y1wHiG;ndY9kxTvNM8S$LtZ0B_Hn!xCyHD!xa!_ys`|Up7sHiSCT6ObD1EQc<7T7 z(J&4o*{9^qpYkwSg!8W_IS#9ka;PdLczNYr7A6=#>Mm))O_5dz9iH8=ozfaU%(LzAx z6V=vn#Rk^{!ikOfpSh*4aW$L>2BlZe?HEkCzT#X$BRBri*2^Z(?q4?{V~N)t%v-hO zLffzT<&oz~>yon=Sz%Y~{q^1F!{yNG>th1@1>=cj_gijJy&tZRr2YZMFqG3YUIdph zvd3@56bGXJHt{aFUEva56?P>FJo!#{T;%L*g~Mjpd0tC4h`aMs&q{bhLsiWp7aE{7tWY}QT+)tWK z3m;#7dbsq*l1{vRF~6?}VZk9!0YNW_qo+w4W;0AAhAkNt S2~~_F!cgg}xT|P1aQYupm>Vqs literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/pos/calendar.gif b/posterita/posterita/web/images/pos/calendar.gif new file mode 100644 index 0000000000000000000000000000000000000000..18801096ac0892bbb0855d37207439ba4a13dac7 GIT binary patch literal 1108 zcmZ?wbhEHblwlBK_|Cxa|NsBbpFh8N@#4{=M-Lx9ynXxjne+dTA3uKh*yqEC4<9;o z=)i#k`wqU{yLa!79Xqyc*|KTVrj1+fu3x`?-MV#a*REZ;a^;Fu7ndztwq(hYg$oxh zSg>IJ{P{Cy&YV7d`m|}&CQX{u+1c6A(b3x4+SJt4(9lp@Tbq}cmy(i_n3$N5kPs0O z;pOG!?(Xj7HyQ%?Lg0Yn zPZmaCE@03BsRHE*2abOX`5ZDH8x|aFHfNBrV036X+%BNp#Zd6bt({qkMaxF;aa*sr zPRa^_3}?1(QT@Cb3MZ2eHwsCKGtKbayv%o&x|GZTiOCC(%;(oUwu9qyTZfQppPK8g zEt)|~y(S*J{6#?hSz#{tI2I&9*2wy0ma8 zNw{bzGUl@|3tJw$yX#>~$3|YWj)1}$ZyMRfy$s}bZ+>z1^o;Cvu@#FpKR>^~K6vXH z(E|*EOe!%u7#=mWFpG0NxU*og$>B3ISocrSKE#l4e{VfEzs;2AVe=16=4a=-ZV|nk zA43>p6xQ9FA?y?rIR;^)##D~SKWc$N3*RDEI7#I(k^P0wZUG8(Z%EETX_rn c3lE%{*Y|rakZ<_^lYK!Lhw6$12L=Xf0A$SLHvj+t literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/pos/charts/barchart_icon.gif b/posterita/posterita/web/images/pos/charts/barchart_icon.gif new file mode 100644 index 0000000000000000000000000000000000000000..417a1ae334833436d91791ef51b0892754aee8f8 GIT binary patch literal 270 zcmZ?wbhEHblxL7)I3mQ*d1~?hPYmxeQvEiR)}`6}JbU_mz2c8+zF($D{{QOmWtzpG zS4%(j#_Vj!T6TTc=UFp^r@6l{GyMPmKLc?<@h1x-1A`EQ4oEr3P6pQQ1uA_hne#GM zEppnp?-}#?#Xje^NxrS-+pZq>{+TkT^3l+sl9*+4&Nha;3UF-Y?+D`#U@X0%d%Y{G zOYv^HrHJ`7)z4g0k--`OFE3<1 literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/pos/charts/piechart_icon.gif b/posterita/posterita/web/images/pos/charts/piechart_icon.gif new file mode 100644 index 0000000000000000000000000000000000000000..4a8b0bb799ad87a1fe5a6e0143a09e3988195a97 GIT binary patch literal 758 zcmZ?wbhEHbRASI#coxQR`(Vb$ruvu8cK<$o`f*_2Yk%*bce8)L=lQmI-o_tJjA9;Fl{SKw>1nZ-DF**Bs&N`Xgy?6ir z7lq^^`_5B~?dIF+b-C!zaag!j_3zuJ$(uCamlhS|*#7^X;Ir83O{B)nTX%jv?)d*L z;I@s?|9|giL|Hz(9rEYZ(*Iu!{{LS8=iQcn&zK+eX`VSX;pwyIZ(<^j96ho0Twh(9 z&8z2g{{Nby`$gH>kChF|8_#~|0jmsdk?%YGyMPmKf}NQ#h)yU3=ClmIv^*2 z;)H?ye?wSPb4zPmdq-zicTaC$|AdK?CQoTqa$pMx3StNe@#J*povdUfIeW$2dGq+R z7WX?ZU$JuaRz9IVw#~a&ZC%aTvupR}z5C`J==72}eB{_Z%MO)51Nk$vkDd$J(Iy@k zD584p#yP(A&ARtq8lQQ5jN7O6?#p`$hu^N|7GM{%ZTA2CIZtQtQ=R*bnjEuvoEQt{ zb!T1gG5k>|pm<2O+3&}Sz=aRD3krrC1|)2JGDWm`)rt_ygDlboC$`u4t>@<{ag4Q>Kk~YvwxYPErKB#sGc7YaH?1IcV!VIEl%$EVll`X7 zPHLQAURm8=*y`F{ gyEC#5^yWuziQG1KhhNmS>$h&+)_C+-Ly^H60R7d8f&c&j literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/pos/charts/timeseries_icon.gif b/posterita/posterita/web/images/pos/charts/timeseries_icon.gif new file mode 100644 index 0000000000000000000000000000000000000000..c7409ab9bf36245ef85f88606aecf9b4869a4781 GIT binary patch literal 488 zcmV{e1WrD4%{cK`TzRZ>%;O-npDIfpSX_}5MDXl3)7 znEB1i)9c*-{_p(irT_In|NYNsWoG^L((w56POx=py^8j;vHtw<`Q2;(`k(mHKBm{Y z$j8ULVqmPRtN;Dq;qvJJ^f3STVEysKk&ln@f`5s{G@hNE?PXTA-o=;EuGWr${O4x+ z;Cj>LUH|;Q=AfDC#=!dHh{Wa5^Q{;D_~A>JTldc|``;*g!-#}|f_8Is|MpPnLq6|$ zGXMYoA^8LW002J#EC2ui03ZMz000L6z@KnPEES`10EZz4NW`2e!~@I)H$blh0RTI!A>SVW literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/pos/cross.gif b/posterita/posterita/web/images/pos/cross.gif new file mode 100644 index 0000000000000000000000000000000000000000..84ef48f08433b91892a7cb6e52aa8a3071dc3d17 GIT binary patch literal 666 zcmZ?wbhEHbRA5kGSZc=5R`0!fy7`6m%AY=cDlQKD^XJc={d?NF+D@H1wPmi+rAwEt zUcDNX5ET(0QCU;jH=%Fefqjp6OWfKjJAKadISc31G}V0k`0?AfZ-4*(J#*$vN_I+S zZuIK)s~svDFI*Qqt3rmO zAzb%{PAk*ygAl=c6|1tYHk}R92xDPLHc4$|VhYvL)-^EJ)Cli1=?r3ENM?WtXlbi0 zS-Nbg>GD-PynG<}%FR%Pn=7G=1V)q8kmN8JZ$@iUXE==0DkRjJ3Nt#7GmJqRCbg#m ztR_vP!*RocgUuX*N-q?e4zY*{D0|KE2wcQ2$u8F5(RirWU0W+`OM{^@YgfO<(iIUG znU3{{Xap?^*|>j3R-S6HE>Z;85paoUQ_)x+kykp5mT8kM$0m^D1lQu&`1oA)h^? zBMcEVJ@`kbSZ!i|Yi7;r_kpoLf?H}|&;)~lHyW_#XAlxjVObEi4OXqdUg};#4k3Dq z`}S@dx#7kOvmd`1=-&#R74usl_!Ddi3-Tp$ zez0%y;EvVT68I0?NEe9idX2d669GaGA=>9^go}pg{H$D~Rs~!S_8Z@Vp&M_;IrFv0 zY0oRgE0ur(53#Iwa&r67o8NhE?%g-g8)=}`pc~;SSiw%hc4br@*lEMrd^LvL787^> z?6D&Q#m!*WI6D&p4EPnLi9=7Vyy}{Bb8os%>-)^nNT*I;bxx{I(pc$-MMS*jwOC#) zTjKt^pPXJX@Orwr{j>-$YYvwt4vsJ1c-5-xCQ`{}4WeGrVrNOueEV zhRy_>LW5%5N$^tULch$(Rc1!lVPI~vBc6Wzud~Yrr6m5gcn^Cqr^wfjlqU9W>)&w6 z3TNF0_~jX;?u=>9^CWP_I|5dhPe8x|(}}LhiwQ!)$VO`rcKCx1}jT3g(=f4uknu|a!e4gA>|y&{2UOtU&<8eto|P_A4XF;fJJ2t8ZOeWAe# zjWXhPOc?zUdOPX)jKDdZ)g$PwRx)DG^W)|I)a&TUXWA;HfHAqp+Tz}Q+k1zH`<#`- z2I}OcL>2Yy$*zUGb%T<2|Lm67N3;9)XV(I|`PP z0IeFvTd)w`v6s>Pj*lR<Fc!ckcba?KO~`!mOB&(i0nC2>y>M8Wh$tAU7g8YVWq6{1-f#aJ z7+R$+w|=}8)rWpcL=4a)l;a3ZgbMJXRw+eLVAk;iG!Fj{^Y!_(Qp2=fNSHXU~ zAQw!fv`$+QcukBHp-ik45zHs>FC%~bEy&z_$3l>k2Qhc+btKj~@LVCb1*vKwf%j2D z@jDL^_~8YwHGlL~RDSbA*u5kP+Ax&5>T5~p(Uyud!oY1}ZgLV{*}uvTZMd*F1YJbv zDd6&b(g)=QBr$^STeKj!504DHaKo*~gO>*ZD}L``%zySR;PoT0q$K2?%`&OMAl-Wi zSUGguYicbKpmNW5iHH(7r7DsL5ri6ipltyWK_mrfpPmKRtoG7-y7WF_ z@mlI!cuh3|ITKY{LAWt4-=mjYB?W}~1s2NRa&94@{HOP(Z_q|}o;p1sNff^MDBNa7 z4SBv;Z8{TiCyF2YI$^I9mX_KV27_j#rwO6NPli8O(SJ_09= z)O8u|fiX~+g{8|0 zlMU<8s9zAqU5504P=?KOS=jC&%zlE1m^gs5e$bk8w6^U|f@iZ}#C&eay#viiMFh=4 z2TO~Eb} zz*D3;v=_7WY(*H1OV`0PN@*e$QiZ?JgP9@EZ5h;PIMNPC0#pWbigmo$gKT~Zjjz3y z08G3B@Dpl{uEG>Crbm_8at|gO9agCKHW*-OwTXbk5W(XM>ZZQRjBzMw*l1JknBQ{b zNfJGW(b{@3@Shh?AN;>xQ18k$s3|+KXC=vXC3Y zU@TsM^Q3r*8)2C?E+O;jZNLQ=oVg8*jZs=MuGV6rtn4gOrAURfuQcwGvp7|c-M@%Z z_qdH`>>#lKGXy9@3M**L68KvQ{MhI#_d>Kr=Cj+>nsV(}UAV4R;(8>q1GX?z*D4en z@j@3BpIaua_A98*^`h%@1b%e%?8O0EtBV*?pXmjoJrsL6JI>>@!Bh6klPc7yU&oBO zM8-|oVZG9i+?Sp{JDl$z3Awi1g9UZdMBt{u+{SbqRMBq79N!L!yVD+;wJf^7yzBHh z|KB}&oQ5R2@7RTALzbmp45w4aCTchFfFgDvPSIc{B5Y21__Gf$9n4+|aQAQ0WAD;~ zUGVH5Xs^}@TUNsKHlhMerV_SG>2_0AKSC@d#1y2mR<-k#5B~0E_`mwrsZs1Bz`r5j zYs-4b^L?i#LayyUa0~35EDL!8aI&)@&@|aUbK&sD#iP3$gN5AZI)1F zpK*tR>VXC^T4D_{RH$7rc!;91sQ9afH`Pkr|ESdj6=gov4W=6)5-gyQ9SS01FbnbI z?P|kL;Kkjq2UZ`Y=kvPwP~C*Qx~A@RAVRJsp12*U!7jCj(vLvI7~}{Dyyp}6dI&E~ z_1e18E%fkzxT*n!X!yfJo64o!v(<)vFbu*3_oLQ^EVOOd16{yVM8v({Zll=0AK@=H zfvq5J2UN^^%n(2?x=dY@_vAD3*%|&e)0#P|r5wFS*lwjnT?v;k)v5tn8Rj+D zuiL`H@QHSFS9Q!p-Cw@^iYh;}gVh=rSu&NSkRDPB&7>#;qE!|}bUh3lSp8I9jDG=P zx(oc$wte^epQwVoINZ@aSH9%5r*}C8|?Uc}{ zOeneD3JAQ9MuxQ-V;i=xmbX2!QMU8iwFqs8K>Dh9;KJ{ArVsBZG+P(uOBPaD0-GjF z&rmIprnDkMBSk?bO)qCiQY2D=9IRy&fYRBx9Rr^D=n+Q4e3hZ1J($iD(`r=d5n~z_ z73#8fC%{cTe3#a4gs9g7RAxNXE#7F1ZrDr`-Ni`F8M#kqb`Ex$HVe2e*o0Q6YIDu# zMjYC|lb6fubb@8;GE_>zGY&#tC$8}<0ZK`$BDHc&N+R=jzNonyb=Q=G=z>+GcU)4L zCevK^gd##pIgsj0zZ*^B{Je)onm3xGuinHxUv;Lr&h?N=6k~Y)U1LO?uTor(@^i0m zS)u#+ojVKF%2;=wgLIb-i@0y6Eh;!j3TfzBW{xS-sJG3`(V2iy^$L`MDm9ZFSHOkp zhzFsHrGcFpo zJ&#vi@`hH+|EEP#vFZH{_dIvf?l1ZFZ;BZ*ED@J)Nr*MODL8Yw97Zh%Hrs*OvknVxH|zw`?3`!Bj)fD3=V`-ESx zPM#5b@ftk&(viNa>o4t0&CRVz_h=%ll#xVK;Mgp#85U%c(dQ&#e0zYlxAFAsy9PXQ zzEyU?ve}m(&#vCId8D*w)ep9v6yK7+FK!;`Dc&_IcK5Z)=ZRbjDP;?ikT!5;vqUw= z7Ji_KyK4r#QKi6@!Bc{l--|ueGU=%g?@4X^%fZV2rQnMCL(IekD={ZcQDT@KE2S>D z??U#c)mCeznFVQyI(s~@=3`ueM#pgWLl5LqwFwu_wO zFF7454HHqLZ)2);?(3w?B2{|Pv+D18Hn?M=j+f}^qS;S^C4Y;$DxCG8>=0EN4f%b9 z8NiZ&ZW=v?@}2}?<-v`z317Z&EiZJW?dK&grBx5u!3 z+QHh)@0Qg|*`DSljVE_OC07*qoM6N<$g4IMU@c;k- literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/pos/error.gif b/posterita/posterita/web/images/pos/error.gif new file mode 100644 index 0000000000000000000000000000000000000000..8533edbb0870ea072cb593b4c7c2092f0a343452 GIT binary patch literal 1077 zcmeH`{V&vU0LMRvd%(H4Jl2t?NWw^U#?Xahen`)?)I6=N(ZjVKR@q87A@h`eXofNy zrI_bJ+10pd32lM^BOMgT^_5R`g>uc}#dv9r6j5s9Oj@S`BSrZxv z9j$3E_kboX`LGY|7dJdD#d}MN`Hs#EKOa7DN?j9Om~(@!Xcb*q%$Vmy2b&Jcs4gH+ zZi8n+pccp<{;a~N?XQV=%(r1g>g(@~mt;tL0zV6c>+J6q98xx#fW~8y07@8-g8G5E zh$R8K)tGSAyR4fo``~tMW*c%b$%dEsC}ZM3a4yy%wrn=Y$5LSWq|xxrxH>8&Z~*oC5UDGKfoZ!!63>Y%FHOpz$D1XEXer(2tx1u5n>KdrJxWCt1ugbqM?$AC_9H^ppmkec;bhN3!R)*{@-HY zVFubN$SlZU&#><~-(+Ve&QqbhS4>~AX!K2;!QkLxckpuHpN`_`Z_a0JU@?#RoO{Lc zC3_4@qNN}k^8pv1QYMy=Id3*>FKDb?5wt8w#b8A&nC?j^_aPG36Gt_o`9jIs5b=U%2$;&0gYr45te5#)qu!&D}0`Y6~k*u$B-z#~y{QR6|o= z1&^z9IGjYK-kjf&_S>TF!0M%0o0Ye#>2+>8zgFaI@Re=b92Hjgl-S&EZCR<=teNSU z@6q=3>Q%iN+N)M%1e@u2EQ{4#*LFSRaTa&mIayWqisn6w9;N!63NL@cpH=Pm_Py`C z!yBx>zTCfe!LPde|K=Vq{pNj8 z7B%+8LP9@Yh8j(`fBxk^gVgLqpvruFg513?479_;}7q zQmA2P^0hY!Cr|1#e0riOSF}Xx#lI(O-n>8aM@aX%pnF rwz@;o?%Qu_W%F@AY({UO#lFTB>(_`g8%^e{{R4h=l}px z2mk>USO5SzmjD14Z`WEMkN^M+Oi4sRRCwBqmwRxO=XJ(^@B3Z$+m*D^YIg9=bvxpeV^x??_8cEB9RFH&yfuc z4Qn%*%uXrggHkF@mTl=~xh!1Q6+#GC(==B~St^xE*DT9AqG{S2#bPlEIG^|M{{8z= zKMyz@u4^q83(w~A`HdBomD=r#Zl|fKk$H7>gn}UqpO<2xAjZd&VmOiT4h{~k?Crh2 zGMmeNS5?(h6B84A{eFM!^N9RT0>NM?Xxr95I*$ElW7BQ=-D}sdxVf3a$OvN>E-?K5 z`}D`-nA2JGYCoQ)CTbTgV#!^1v18jduJ-nN+dJC-z%Y!ibUOVn>2&)0p-?FIg$M)! zf%)Zf=}4fqcIBqcn_1r6Oyb-*F24CD?$i{Xsw#wO;?Xob!2lp&bcCt#aZ+c_payH1 z`}j~rqAqcbe~$q?Cx8HcLcE z3AT;vx;U0aadHx=C=_G;c<0r#@b^|SIXTf7i^Y5g4<3Af-MV#dM@I(|psud2RZ-;b z&70fsm5PiVI|foR*3m&}a*}yFcCh$c-@?*$T+{qD=*=idiBl+0xoQ>j_wGdvg>X%i zTs%%;Jjw8p!vuAm&24RR`SRs|+S1a}cIy}H-1&8-P$;}!-_X#q^`3j^K5zh~R3h2g ziIvYYZ^sT+J@X9n)~-dbuV>`!SrpqwYT7N&?P3xC-FH*7dpB-#GofY6nEtdIw_L(0 zl~5IhsYHSm+rPq%_>i7RBpQz%J$lGAO;fq|-h0PaLL^*ud3KhNcI19EC=>JJUWqu$=UkkOMTF{h`orl*mLg5vk1 z8V0UygX>bv3Y`-%9PCJrpbpr&vVSG|X~|qNah@JCmfYi&HK$ z{68mHzGMkCfqq2XabSK8XzUR=6tS#4uw730T`lN%n!bsSW~Absr`g+hTjt*r>x z#dTe5)5O1cF?uM3B?N&-9wuv9nE5=8>!MWn5EGNcUwH*BlR>MfKrsxkZAz1q%-OJk zyBA?uz z1T7dO79YVZ7I1OVs;ZEKgT$VG8hu~@ug`~CS&0!2V}!%#6+Ti|f5n0Y3#h572?LF) zX_|WdoH-1iI)&}H;5eY`2q6$sVrUw}Z@q=76Uij$sVTDAES6~@gp2O? zBge*w?)y9RfdLetl*v%aWXQ$i2te_AVewL0{`@g?T{nOxX<3#C27?rahOo^tQc-5= zTv3pkhE!FYOoj{l_Hp`~-z1$*GnLDc%Vu$G8$}W5J|ALeh~B?>0%KqRLkNTrD6^(Y zi6R6P3S4>jU4p?NnyxEAP<0$fczs^XsVOwmLa6FYZF@YFQz<5|U89gnVFQJ}J~F8k z)5RjTZ6kyL*P)`S63?jM#@HCz%yd8sfjUb>2!Q}p%OW{Cir4E!3LycXlv28dd;!(x z#hI;d>G3e#-%sM)ISQ#14iMV3iH4`1V!B+$DwSry1?V0R(z2-AwuKEZ{wt=(KyzJu zs*0f~cohY&lz62?1LiJlrcfy0x~>BVRaI4YJed+&V<>iE|Ko*L(YN++uE4>)Kg>}8*6$RAwc*05u*vx|MlP0 zhC@_`YpJQKMl&7m-2Er4dFdq_UB|F(yoz!w5{e6T8#XXBJVLotDgzU;SS(&28X9EY zU8@;rZzmg%qX0Hg-P%g{$tOvd%b3$ygb--{DwOeYZv4X!NIdr(gZmFqQyZqHCWKcv z09gF!qulxO%ecCZAthdq2d~G2?yq9r#*Oqvql}DE_0M7jRXrGzY z+HJRy_j)Pk^E2Speq=I5^lzWQ)89`GF!bUpTzcYrXqx^TLZfQU8bm0B*YC%ut;Of} zQ}f^-q14pS7wvU>dU~z`gVN*i9L#02h3kENta$vdDb8lG0*oI%O!nYUF#-WRp&-iG zIDJok5BXhR+_v8!t+uL@0jo5_?IMFCBARLF>C!e5JR^Yl01J6E-9*bcJ zfje7jx}s32C`^C!5ye~%Q`hd3Wm;)S)44zy&P8(sXpQj1IW7b*%_7Q)Y^S zPfD;XsIDeZQ9(_8J*wZ2x3ZE_MFoL>`e#1*)m2{q@vGTG?;Ls|olgG%$lMepJ*kO_ z7fzl0xm(aQ*1q&Ih001KAOQ{VnPs$DLbr7LY!q%PB%fhWtEzabs}UX#9>c%^D!=nx zMzYg<@U!>r_Kx=R>2&(-NF!-w57XMWKai^cv8xcFHo0BCG%%=TQr z{?O&_?h9}I^dMDBmayv=XE1i{B0CEvW-o~UBdu??TIo25Qi)PBNon(D!p|RI!sp}l zS6_9H9XmGA+1dGWE|)tRiA2obQpEt_a5&r5)%Bij+jkG%7-*~x*NHFv*<*z7+s4>L zid1hew(HI$AfUP~!nVOQvCCyF*TvZN08Kx7j=BdQ=P$WM9-f;|I*ad z)W1g}k@QWxj*gDsUQAZ4S~Ym)%$cu`kB>h+GBWb$`6WyIt?Spb>&=7YQz`n-o+bIq zb`s}0NXO&UEnLW))>dlQwbHP@6}7sWuI|fx^uh~VxqLa>-roL6e}Dgv^ZERdNF*}# zg;ukT8#gA89Xs~;l`B`?j>Tg8qP@NM1OfqL(H(b)=7r5HU%#HVP!Nw{P%0Klrcw+I zkI??X2lPjy?&#=fvAeswx4XOhy<9H$j%8UFBauk?3-5*i+qZ8o10TNj+G`g+{`ljS zO-)VTXlZHLT3uaTXBdW|sH&<+DILdgEX%SBg<>g@7)|!{^jwX{<7bP-;%VEqFMT%T zzw3zo`}hCG2itZ~6iH`iCj$dF=W3kC&HER#Z$- zLRnr_MM+*sQBB)iUrp0QQ&Gvl(a^-w+Rn~SRnNuK*~Y`%*3KGa2qPCaHynz{|gQXo8G=PrAu1K+N?aNp&Hrx#0FI1$4FCWD literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/pos/helpIcon2.gif b/posterita/posterita/web/images/pos/helpIcon2.gif new file mode 100644 index 0000000000000000000000000000000000000000..01389860c4a8ce4cf7bad0644a21fdf5c35f9949 GIT binary patch literal 140 zcmZ?wbhEHb6k-rySj5I~;J^U}h6W(`|DOQ}{(}LKq4<-9k%57YK?fuXQp>;`n2~km zUy5$fs})bLX{omZ~H$zTltY`iib literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/pos/ico_file_csv.png b/posterita/posterita/web/images/pos/ico_file_csv.png new file mode 100644 index 0000000000000000000000000000000000000000..1192a9a715ccae51868c7dba63e960874c236248 GIT binary patch literal 230 zcmeAS@N?(olHy`uVBq!ia0vp^{6Ngd!3-pihitnGq}WS5eO=kFa4`z#%bU2$ZUqW) z7I;J!Gca%qfiUBxyLEqnf-LEdzK#qG8~eHcB(ehe(g8jpuK!*b<>uxBd1r3l>)*JI zp--P7Lhb+m|Gd1svgcY-ff9@*L4Lsu4$p3+0XdGIE{-7;w`$LLb1^7zxL!OJ|2w`g zDof;wEJykS?W3y#qo=$un%B1fpzj^mFE)F2o{9ahzPz)vU*ga<{x~Vy^3!b2JWR(= TMVu@E8ph!1>gTe~DWM4f07Xh> literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/pos/ico_file_excel.png b/posterita/posterita/web/images/pos/ico_file_excel.png new file mode 100644 index 0000000000000000000000000000000000000000..378ae0b739b72f323e6213170514882df938e369 GIT binary patch literal 242 zcmeAS@N?(olHy`uVBq!ia0vp^{6Ngd!3-pihitnGq}WS5eO=kFa4`z#Ym0t-2^3-A zEbxddW?Nn{1`r2~9IT>rf=%FWFM^3L48*S~Qa zL!UlFgc>g|@Bjb*XOx9q2TCxO1o;IsI6S+N2ITm9x;TbZ+=@LL&38b7!zEBI>dyZz z?lTFK&rN@RY=wt!I@`RP=TE2D3qGC8?qAN}znhsOT_H2GPS5Sfj)>M{sV%?k{a^JR g_Ey7OB9R@3``UZ&88d@BeIx*fm;ZK886+f`vVkYNq6*hWMJ6X&;2Kn708zh@CkAK_reIsWQb7f*}C=I zy?g)v|7Yma&(6-y&CTuKxb1F;Ey$IOB|(0{3=Yq3qyafzo-U3d6}Mu~MhhKqU~##4 zvDx$6{)Yxpao^u-9F@3v(evW2`R6~pI%M4Ib*3a*V(w9`J72PEZ`-nOm$mF%Z1Uji i5}p@*znf0JSk7%;#S}90d-+C?3p`!@T-G@yGywo?sb@w2 literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/pos/ico_file_rtf.png b/posterita/posterita/web/images/pos/ico_file_rtf.png new file mode 100644 index 0000000000000000000000000000000000000000..e1e825579539c988f8b67eb7f5e3cecfb82cd0ac GIT binary patch literal 1004 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%G|oWRD45bDP46hOx7_4S6Fo+k-*%fHRz`)E9 z;1l9%Y;2sCmd22FX6DS9XU?4Y4+cP8qhK@yMnVWYKC1%CH*uaWjv*Ssx&4kp2NXD% zo0t6mU*zoYc3~h}L}|wX!TCZDmNXgcR5+Bv5X!LAaju5mi+Q}0W=i(0Xz5X{Q{vf@ zww~=3ugHG$bwAgcs7757nHD_Fq^_qn?ncDVTdVZuzHu&|uDeXoDx zHikZZh6uI)|Ns9!uQdy(hOs2bFPOpM*^M+HC)m@)F{I*Faza9a2n&-c8ynllB83J+ zuLK@pg=W*0CY)zDg7x`>*^DA4A35zkxuM5^_2Z{U2BIAunL;kUh7r6G(+xWgD&*ww jr0!r~>`+|7!o+a>hS>Q}oaeU!jc4$5^>bP0l+XkK@!Cm* literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/pos/icon-error.gif b/posterita/posterita/web/images/pos/icon-error.gif new file mode 100644 index 0000000000000000000000000000000000000000..397b655ab83e5362fdc7eb0d18cf361c6f86bd9d GIT binary patch literal 1669 zcmV;02738NNk%w1VITk?0QUd@0|NsJ0|X2J00{{R5ds1i7Z(~66B`>G9v&Vb001Kp z5h)oOFaQ8I0021w0Y3o&E-fxEFEBACCN(uSJUcx_0Rc|{08I)CQ~&^5003P90ZlnN zZ2HgaR#tRYR&iNbdS75? zU|?otXJ=+;Yin(FU|@V`YIb#ZeSCg?et>}h0EGYmiU0tO0055<5Rm`?kOl^o005Z) z0GmN+?~005%|1f>7~rUeD5005~41+4%8tpx?M0RglK2)Y6SybBAy92~17B(5YS zt0^g|FE6h$GP@!ovpPDDN=%4PP>)+%g=J@gYio~fZHaSpjd*yLX=#~kY?O0znsITT ze0->1U$sL+wn#|6N=l(?ZKHd8zjAWJ0s_Pf3(Ero%L)p|939OP64C(y(FzLN0RhLMcRH8%DjAoeXS{Ujv)EG+gtJ^wQ^{W?3v zNJh*-LCQ@{#8XqnUth>oR?f~+Utj)HQ~z6A@Lyo#VPouQYVB}x>v?Q{t%gd(L*0R{xyxG~vlatYag2Jb&>V$^kk(2*{ zf&Yw*|C5vdnwsaLq~@lni75b z|Ns8}{@~x^A^8LW00930EC2ui03ZM$000R70RIUbNDv$>R;N^%GKK1uH+KXhN+gI) zQmI(8v}vO?E0!usk6NLdNb;LSjN7_}3)gKMEm^BfQ9=}oWJFkzOv$3fZRN_A+GfF& z32BcxoBv$pj74i3x2G;S3XK)B)FeoEmXWL#snn`jv}gsDrLa^fQ>tQ`viiu;6mb&4 zIih50RjgR4R9RKTR}rL1lO$0B9ElMiAmt)9>blUBj4Y5687efWvLQo=T3ms|nUS42 zGT05w#%K~HN|L}(qt>OeA3m=K#Zlp_nV3Y10NJUdgV?}Dj3P~n6lR(~fAPA&<^wy< z3SY;ip*i$tjvF;7)cwO(hY@E;pU(dEJAMvK96x^EuyA(#I4D2W)wt>4TNE8YjvOf} zG)mrhfAgFX#~WKj)1E)1@X?1HY^b3I4=}g`${ckFf(Rmn_^}B+|J5T5Fy|aN${TUW z0S6mQFhRr!;UgPsq@e^7N-V$&6Kb%bq#Sa*Vdfi^>~mm0dsJzqm1!)YL=j6Upi2{A zuE7S7XQmMhKT=kc#-N0zk;D-~AfZ4mcqp-i8dkz#<`P*@Bc(t0{IW!$Ngy$V5I-1@ zizZxdisc(i!~o5u$IbJ_rv6JTkwg(c{D4CNyI4a65=m^j#u6#8*Ipi;`17AUTJ(BE z5kdIy0|yB7l8z8W9HFeL2U?Ou5|`ZbpQ}X_F@z60{NTU@$Nckz5JFhX#WM$9V(qqN zczc{Zzy$F_4?N^RzzK;Blf(}}6cGhE|5-BcwnvOnPkU1IumcV|U{F8}13B@74?zS0 z#dwzlam2`nic7|EPvkH$4mJotfiVMJGlaxG_)rEWKMWD>&Oe?)03;wIQ58SrAhy#rm+eCjRSRuH))@dW!7dZ& zW5o_u2R%03bq^haWeql1000EIv_ld+Sb#9`4TvW`^x8Ju-~j^zOmNFONd2>m2p`;_ zHs5>m&A|f!9AH8(f>-{JI5cc`2#jD0Go}*+k21NqFv0{8KoG$M PBfNl1GVhQS5C8x>^BLCH literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/pos/icon-info.gif b/posterita/posterita/web/images/pos/icon-info.gif new file mode 100644 index 0000000000000000000000000000000000000000..58281c3067b309779f5cf949a7196170c8ca97b9 GIT binary patch literal 1586 zcmV-22F>|LNk%w1VITk?0QUd@002Ay07w84PX`%A3LHrS9ajJYWB>?a019mY3w!_= zeheW`4kS_$BTNt{R2C>w87x&AE?6EhTN5*F88u@cHent&Zy_^VB{*RwJ!T<2Ybrfu zEanAeNJ0@02_k<8;bxSjRY)#049Cl8e5Y1_tY3bkWN(XQaEfVlk7;?7 zZF!SzdY5*8mt2auc!8LDgq&lBt7(C!V~et7k-lw{yKsuMageiql(2i8y-tSTQHA4U zhskM;!F86%bDF?tGlSHx~QzWsjj`Ou)c+z$A_QDf}_NMrOt$@%8RPR zi>%9lsM?CJ)Qqyzkfy4!pytE%CW@Nu*TlB$=|re)xF5pzRlaC#O0*M=&Huzs>kT8$>*ZV^`Xr3 zq{{ZD&GV%F^A_)Y{V6-P_#W#@Xx7+U3jK?!?;j!ruDO*W%II z<s1(&F;b=Ka&^{@UjA-Rbn(?f%pA|J?Ea z-}(RG-{a%sWQF}}=T6!l(LfBVqwLzTzdz--gr zA>~JRUspdjz=SD#uW#3T=*1z15PotP*O<}1TXI=rW8fk~GqY79KP}1YrcVGlvzs zDl$nW+ZJ<7GW-rh3M7OOB8UkZSwRrC?KL;(Q+JJH=Ywg3PC literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/pos/icon-question.gif b/posterita/posterita/web/images/pos/icon-question.gif new file mode 100644 index 0000000000000000000000000000000000000000..08abd82ae86c9457172c7a4fdbc527641cf28e48 GIT binary patch literal 1607 zcmV-N2Dtf0Nk%w1VITk?0QUd@02fyP7F_@vT>uhh032%o9CQF5e-A8e03mY#BzglW zcL_0l6g7B5MoUafO-xQwNKjc)QdCG)VMGais%VD1YKp&Yk+f=&xOI)E zaEiQim9}=7y?K_jd6&3+oV;3t&|-(kYnQ@tj>UPC!+4gSZh?S#&mcD?Rw3D8!n4hVIpuCNxypy7?lBc|sslAz{ zv!1E8nykH`pQ59qrl_Z?tE#T5tFf-Ly0EXZv$D0gx4OH!y?~j^f}_NSpv#4+%#5bO zjit(rsl|+~%!H%Tg{shuuF;CD-i))_m#xK;uF0IQ!Je+okgwa9u*sgY$DOs#l(p29 zwb+%o+nKY|oV(kBuJ?(u=#RDcm$&DYyyKX=;G(m`qqxkgwZo{l%AmW~pu5Wy1~n_!_~3H*|^2hyUEtQ&D)~F!=r_S`L&GoF&_N~(Sv&!PL&+@j??Yq$Bv(odm+WouL^Ss^uzv2JK z#>vRX%gf5m#L3db&e_e*)63J`)6&(_)!NwC+uGXR!PV)++V9BJ>B`#d#N777-1y4d z^3d1g(%a?H-|XGp;>6+p%jEve=>OE=@803%+~e!f;quVt`_t+E+2!%y==0m`{@(Hb z;NRop*MI`>g(&|>+<34{Oa!Wf0xe!3Pge_@yBbqQDAy z^yqLDY^(Y`Bgb#Yy&t*SHt<)MmubQE= zM_%4K|K!o54GAF7UTBq*Ob!?g0o7_ijR4L$#5Cl7WQu5*Y1Gi(Bmg6D)2&N<*T z_(l=0(9+Fy7{;fLf+vi?iGtvWSYtTY0MiN@9f&f^H7LmFMINyXBrZBDyqCps^d=g7F3EF65lHnZVrI>UYlglJe zU~oq>afkv8HsRE$YQu zh#-bkqRKD4cwz`3RWxA(1Qnd&3}YuvgUT2`;GhH*Q&3SwBCD*Dh!i~7&_D!W@DWW; z1F;hgDs>bA#0Ei30Z1pS2x5T)7=Y0SG)EyV5IfR9lMEkstO3X(t9(I08OcCnvDYWD z6Ol7qAd-p~6!7sjC){4MV~P`tbU^{7d>1~=99ZDpN7scTEv^xRGv0Vk((EBd#a;&l F06QAMRrde@ literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/pos/icon-warning.gif b/posterita/posterita/web/images/pos/icon-warning.gif new file mode 100644 index 0000000000000000000000000000000000000000..27ff98b4f787f776e24227da0227bc781e3b11e8 GIT binary patch literal 1483 zcmXAoYc$k(9LB%H%(yfgGuR9b<4z3ocd29*O43CNd(`UWmQ=H)a>`a4DYpzOx}c(x zSlvdcWJ?+unZaR-H7>b~v1S^TyJ_?Ptx;{_9t|N0Ki69nENoJ2v3`>&g|W8&busa_So7*+dD)$ zvLc<>kt@t%F{f~h9qzG`vt^ZG;7|7JumJBhJ9Y+8Lf4suZE^fH#5_9C`L|tWUS6U8 z{=uOE0fBzowgqiH9`W<?y6`^?T9Sbi>kIro^$r3_Y4hFwk)R(#Q}G+VFY!jG?tX{A@K zA7Ak-yF;xiAyhqNys9yLRL-ovzEyCSA}UpDxeZO_LcSl+NfU}@28A3*bVbNWrHA>fZ4D_larvD z0o4={9|wFI(DV=ZJRp1#nxdfzI{Lyuvvho356v%?4p|^%j&Mta>}F3~{K0|F!GZpTzVLoC6_EgdgTr?dzB>V$ILvD;-4MrIlR(m27G@h~>JlYZ zVAt|_ro3YUVh;qD&xzwC(+MYO@wD@Y_NS8}VxR3300jn*@X<;}{z{$rL zTQ1Ygt3r~JNZK6NqxROCFAF5#=}AsXB5Gp!SiKu3HLoB=^T~;XI#AbK!S$~9M1UFk{5%nyiu}%*CZiIbNf<7_U*)eK2jmJEb7FxOYX=;RObGwm=_w(}-X91Z& zqYL6B`%{}cDrkMSM*JWx2`jXogS!VNpUr25HWVJ_hwMpzlk(}y+|3YZ)%_6gfm?u*PI1fu~NtNN%<%o?1bnQ|HcP z+A{@eE%wEmbNMT^8Mo3bU$&{4r}IL6UfVqFo%2t*Tz4deYD9aVZE~6`7TH{nSG#4; z<6vfan`>!V4h5%@)!a#Ahc&Ef--@I2iU;@wEYEC-zjIsI(0PM(`f?qQqf=C&8Tb?#p4A}3P=ZzHb8 zU%2?008r{GmdfTSw5X-f*JnevxfSlSM{Cc=no(Hy6^Zi{dugQHUH~t06Bw zQt4307HjGF&8-z0AF;fZZq8-%?^|4nr#0y83LDz+toN8`gZZg2p9Yd5@bP-%L)8(V zUmmP8OS8yf(llyk`BV+l3sY@pR^S)K>*+DB$}jc0e)m$1w?{Mi5Ahq5K8vj4mE(=f iL}jwpve+-)v>A%!R(IJo>4b>g=O(U+TOV&$}rKAKDKedCtt*EcB?qSVV2Qn|gn`K>|aA_tva~NxIS6ivlK8Y)&wo znd8=c?di)F-RbT~_AoLqG6(@71B;))NzLO6ETU(x6u7D;$nvfBp~tk#oJrcZ_etKo zJ2&w`uz-S=7VPw;8w6OVX=Y} ooN`g4+Zp5wO~tEfvh1i<+%WWFV>&dA&3BgXgepibTzv+Q>jpTf^MEn%17*nZ^ra$_eAWuXrolA4yD MoShYsK@1Gm0QBWXo&W#< literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/pos/logo.jpg b/posterita/posterita/web/images/pos/logo.jpg new file mode 100644 index 0000000000000000000000000000000000000000..c6ab5ebb2a786b491b91c3370b53e0071dea81e8 GIT binary patch literal 24817 zcmeIacUTn5(l9;*0TBrbA}B#}&RK$pB*{60z%D^@5z-NIT#KPwg+&(r_BPN@4*W!@hI1CPg#hI6_j4n&c)Nk!_LK(UQUPJ zz}^|+;_U$l@bQUC@Ci!ri_r56OYnUo0N%Kk`2H{Cj@C@Q(RAS*`;_$91xhQvAiO5b7o+6_lAtEB7IDhsm#o4px$%u}B-yh#1 zf4yU!K6UCe@o7?GVp4KqVq)^68!`E}BxL`S3@~p2G6Fylc!q<;0AQ10;gDfrron0x zVw$mJKrT;U9sj;p83$Ap+!J{C1Sbhkf$H!p5(~h_`GF(_uyC<(uyL_Z;NuaTz#$R@ zkz_cym(K8?kkzt0%iwlT0FONCdD&G)CJOC$R)RwAf&Fs$%+WeuK5klj2%pO+zt3_l zMi(OAnCU4(IiNQOMN|Ye4SLOQDX_+7J*bRp9)fRYSG5c;?C9IvdKmxWW$Vb|uBf7c zt#@!jPIcSp(jFOrjSX^(d(0C)-U;Dj7B2Ch!38;RV>o+4;9eB@5eM(I`@aY>S$%X5 zjF!`(u=WtzWX3yU0G~y;aR6i@lM*7YC*ld6`-6pl&jIV7EMO)8BAnwg$p9H(M>pa0 zi0`b~Dvf*ZqxUm*#lhn7hD~L?T$idRoeoS__?JtOT-z`eX!;_@Y?X9{zs?GUXrbv^ zH)oY!?Zl~Tz9ku}#$Dt77pjpW0THvPb2V+e4EVWjQO%c-y3HPddTF@Mg?IOB;xr zoWfWVYKm?<5J^Ss)^tx}fIx=%wAzh?)L{VxEoU`V8{L%g2U`#4;`}Bfom+?aFtLiQ zlGhve9y`lN)-SLA<4kSldfQ^*wWtD*L}+jJH9S1 zdcN9u$;mc%Pjovuu_YlA1BfFRQTguDeLBhx#-mA38IxAGla?kcwu-7Kq@3cDcE*;7 z7oO1}1sl+z;o`UVYP$12)TOIeWKPO7=)4^3TNk!GG+!0(>#oT5l5*$7AG~vyINo2P zaC{9`iHsYYUE(wme|3Jp5c|D}HS0iqMfpSrYQ@Q=CcP8YCH>&d>NNx13!lc7p`PgH zQRbG*G^)MUhK{WrI1U2#xWXgCnUm&v7ZRsl%Ose~%VfM6$kbyX;J_P-R;EwDyyuZI zl{&Smq1m(DQYFL6lANeMSUIz_QPeiMBHWF_058HvB#ISBRZ#({gSlQ_222TZDbw@N zr{Z|!$mRSb43KP_hqNu2)icqXHT9j=#~W+AnA+_rMmN$Rp6yL;Z9QLMBc+<1vR?E& zBjEG{4;I75D__iI$+Q~|;w$+(wHP12SAI3vbm-LF{b|~Ra+R1X>blIamswmuEW@G|8RD51bAej6)q7&T(5erYF(uHmj z`l#pfp-T?+mk&krZ=_{3Dwe!7?wn>>Ep%252yLyOPMksdyKIN;6`Q~OVB<9=cgkol4f}UDvMD2@QLk#zZ84aKQ_4D zZE9oa1XXnkPN;e&h5_tw6@`mQKM-sUGmDJ}!FnjE$aYy)CqD^WS#PgOL=L;U1?M?Y zos;CFF`YKDzJRJLo_eE}A@VkYv0S#u?%`eh=<7ad>B%tDWgmZr5kiDrcG1pBMvv^7 z^a7pa`W)wi?fe`iWXAzR@HT47dn3D-+m4&W-fd=O-RVL7^v14n%h=ne;eMLyEv>cp zy;Li!19yWJn_QJOaBOwjX=GDgafvk2cg>Dyzs&=J+JOP^=LEZM0;SUd2p zGIV5N07D69btpOH#<}WT&x7QcP_t)lK>3}_UG&sGmTYN#bv!<+Zp!KN-^t0 zPOr15;X6~as~A8ORTbihTpismy8rCP<%D{(=#TJO>v0TF4)ziceEXMWbbMLWTx*6? zy34&Uv$D>t&(@Em_m|CfO|D>o#=P6sq8N-IUU=6dbY#v{xGKl$3Z$ z`BEy}$&;w&gM<^Uj|90o*7k&hdHCu6VQR+xlxV?|t)CWhqJ@LN1 zJ8`kS4yFU6z+#&05IL_xCkA*Lkp2n-xT3r2leMN#Mqd#pvE8byg|Vk+(QV79fbScN zbHLfuQuDVMV9MjZ83u4_a2UuaI2{zNjGM<4>sbDJ@^u@YkoyuT{#^7^rgB7m<)LXa z{^*L~+X&-H>OI(`S3;eZj2Y6YT*8^hMO!LDTLlCgh*>YPMyhO&oZ zzQ0$`y$1vKZ><{|7pH4c{ug0)$VrAH8ir&R(rTQWGRwXsu{#EQEP2FP0TqHXAZeM82%J3oQs3uL1LJznC~uzl_lav^=lKixn=Z~Vq5 zffCv{dX()f25=tO$s9!I_?s@nB??7M>@dJ7*s_^S9n!4Zx?yhY)EaC7g@;xv$io{e4`0*to}(;#;x%z_Q3`Ci&d(Si+{B-A zWlv%GG!70$oHYG}{|Ffdps`t%Dce35s$AYBPWU=r z4sCZ+{OXuL9Ws4*w{~{yjjD6{LB)ZAOP_nE?bxBkdr(a2ho=toKd<}e z`CPxQp1yzqtoj@Fc_$9Bc3{gS`}i2ZehQVKTd$|A4|aFi=yPjjlQ~~`hn0EbwAD-x zb))z7m}39-fdMe%n02y;e=aQqdH4XatIBG)M-zMiz`qDCSg^tWF^u^bMyf!Bc*OEb zf1)%6>v?I;6YnD&&iXgp_l3*RqUmS>gLRyaTeC!}^wr@Hh@GkB-u?k{-thLFBg|_Ax&@#}Orf*Tx3KID&U@aRdIazC)fr zP5J{Oa11vF?>}gSk0IQDLXPwN3dRAz6@ zD%8gF=lE4m7pL#>V>YyH?Y`rWS;O;iw6}(O=sT)MyJ1Phu0xv9?FUR3;Zx`8d80&jqbY#H!rqIXz z4(<^>aH?#JpU3ncLx9+@B-)h06+rB0uaCjumYd}J)jBLfniVZ@;DB; zf)r=|e<FFxL%j@jHV|ldY%VX{0#CzM)m6xA~ zj~9@Xx$SCc?Ev+pw}OHzRVmibZyH$X?IBXE2EuB5YOZonJ9{Nxcc_l9x~{dagS9w> zRYsan^0vfnCs!w^rzQPuCr4)wiQ7`F$C*oj;Uh3FEB!Hvr-Kx$p_(SWC%FD|u=k_~ zEkWD@VqEk#?v_qaZx?q5dVU@eRxm?%h>e8yHHGilfiWr8?|gfEd-He;^0>I$^74y| zi}Ugc@CpcUgB08zKF*$&x4E4?7{Stx*|0bKBiS$2wKqJjEm#mC{c%y(pdQxl_O71x zF3$8vMO%V)1y3nfFE4wDgn*@(m8Ce;k{cpu#mCLh53%C5;ujL*wz3iv0TGs>!b1G4 zg!JEwgo4}me_!Yk=0~yg^pZzWiR1OA4k&S`w2*+fkhqAbfVi+E?_Y6X?%(J&?QcUJ z4X@cdL7hE7UZn-a1iw@N74vHnqd$}I3-JG(eRH|~K>yTcf50S^>^(eP+v4CwkGjvFDSsqZbAi~~`22lh0g;~*|3vvC@o~wZl?v=BrH{W{`P*-Eek%Jr?T_?o zV7Cjg^tAjR75_8sf2R#RJhh?!Mt^^_g2$1Cj`v7Iyxgs!AUWfo-7H9>ruLs3(aGt! zD>-gQH8rqTbGN?*g($eYI30KKu9of|(4!KhSbr38-0bv{$E-=%J9~IqI$J}PuSp*d z0}w$Q2%n|s(J)|X^KXU$N#1`+3pU4(93d{&USP-V`6EYBK2fNswTK9}mAD9$TS!n) zoZCv+TAZ6t7%DC-W@BwB$Zz>0$Dh(3HSm$f{aU9V8hZr&vz%{(Fqjw|$Nuc7zK>`k z|7k?~qliB<`|l_Q#QKkBbp@@@#{)gYniuK_J(8UV*s<|{Z&!%5gpG^4lclG$y_2Oa zl=r49)K-%BPw3zC`)!N^=N8~BgZGbl%aQp0_kX_&`A0JTEw10<`bQG@N5sFi>$kZ6 zkp%t`@o(+=Ev|ngfqz8&Tf2UX>mNzr9})l7uHWMNM-uo)#J{!cx48b11pX26|EYEn z{<-r3bq2RPyup2qpPa_PotN)UV|ci@xF>M&PMp9yi3eV%2=MR-P7x6jo+2b9BK_te z_WkiK^4B{SK0f|wqSNO|Nzeb^IF0#W!EmrZFRMSD#`r*|u?&z+{GWZs0NfKe*mzjL zcc(FIY@DC5zkVTwjfHdMG=_(d1KzMbu&{B+aDfw`*O;sp-dRh~Ym8hV>N!5eH>a(S zg6FKhFu4bAGRq0+L}!#+do&7PV~xqI5TVqCcs32p5wP4pNqC+rC{|t}t5SbZkBu5J zzjfp|2K9On_sx0i-}sJ+DH+<`4oS>?)jsy=E4#R|k-g8Or+GCUG!#QyRbbP}lz`=1kcKAB-bCW%x1#*n%b}vfcdD$28cl{q3uTp4Rxo-+G z3CRVXi`HSzur6=J_ZSeKyLO*aHwJX6J5R+TB2Uc<@zfJVWL7k>u@BB~1;u7n{>rk# zPY!QC`@8+Z^M7FZFMet29BX=G1!V?S#Vux`Zzyj48P%jdgzp+NAHs1@7JZ0T>LQG| zo)sFV2d6_+q2{k6Ut$0R6U;O`V`kWKZFlps{|kBREruGV{J-R6K;aNQ8Xmw){I%fX z7P=3<2fulGc@K z-qT8IakjNUnCaCo&dGc%y&I^hy&pO-(O@1r*Q02}{3r~j8nqP$D|bw6)!-i6yw^ix z?+^7MNE*1kaY>5l(eUVJZG|g=;^nxs*T0_mo94vygW`#EsJBO;?-L{&G(7AvS>p=d ztVZT?tfO1pyKiR;YMpEJVWfpVl38k4SZUWZo#LZ=`4ZuVvV#$I(4;54S+_%NNbf2y ze3tUj>1KTxliMQsR(CR5TT^EK!ULB#Y+X4i($6L%g>2h%##J23bVZ)$8QPDOc>BB2 z6jj2U?GqUyv*4L$8Ra~$Upd9av9;BPKupL{&vbccOa`8$3JAP9Dlk93uc3H;l|Lfy z;iLT`xS0(ka8yUB_+r0hjsCqyQukcR(|3*Z)o2Z!<-~4U^2jF`@J~*MW>3r}R;m#X zuKHHN^<8P=vM!f>(W9`DSqV$w@3hI_4q9a3ioXbxYT&(ApFZMDIFk0PIwo?Z?OiP1x|OU5efK0(83C@e%^e=1RI zd|NLDsMv;FrR{UsFIiw)p9@b5Pzuf2;~pY}6meCn3>8&LNuN3}SD5+e(`x7@R3v&{ zk6a0ew!?#`=!M^uNvzi@ebT(wXiwfBf5P4lHlo#rzHlNxJZCXDrkIJqc>>#)D$~p2 zD+gJ40c&+l^{YoVf%5UJ6w0IzwWUHD^AiiobdwFYf)j*-`De{DRAr`58pJH?;zsTo z7U)Y`^;e~yS=9^@dhKbYo1zqShV172qZP4~b0s{S`x-k9g}xKP!>e5@wbF!M^Trl_MQ@M4Iy)`OIk9_^hM-FqN=jL+IB13Zx3x$a}aVQ7J?E-8& zzDuj=h?lj`QG0X<=F$nHXfaO%n)BGwiiA~M{qh%-ISbvM6uXz!V?yBBMYFME73c&#SdR|?ONmmT`4_Rug@!PXTB}S7aONo+d zSxx)TuCLsR`ts%hEa?vPD@5x+TNVQ_AU@4M)X3?VS?pTI03vEO?!hv;Mj}y#%SkO^ z-V@MHGvn(V(XBV76ro8eie{uuF1yRX*hn=|S4i$7r4E#+u+r zs+1r_0eG(!L)QXK%%{(I%RFl|DJrwg+mdv_xdhY_J!eH6B#S zY^Pu!J4e?<_r(iG?XfPp zEuqu{VssQAYIqFsT9plMxY(dqMp%=s!?#@_ZYCr?>!BGW*N$eaoeATQ#-oO=`Th^b4nIqgo-f zY{hS*;`$6i@g6xoOmjbnof8Y=K~3iGhmFgVPneDnpI%sf7&e)f`G|bs(%}Q0O<2Kw z>3p&Who%;dDaJle4F)wbYnx8JgRftujLW&bmZgw%-NU`?iBT>9pH>r0iK!t;ze5s# zg_9=|QPG1?C@zz2d24yl|NisGhjFXYdV|HDeLRL^((-c4mnShnsHINlEG*_x44pA)mmds@yDoZ`;CZGd{53ONW}_kVD@1dr0dz@&R}MA| zS73k`A7&r3xRlZACq{3vl0J^G-KQp2wc~K*@9;YJa3+xf$7=4^j)-Ao<$TdTq*1P16cFjj*bd!b&aao7-K_ox!J z-o1~CJ5WJ)k?O4jqf7}_#f%g_4N0h+0-u`*7vX*8+bV~PCC@{VluDwu*XV4t&>9DH z3w~?jnNM879!dn(<0fFuC+Ug-B)CdC>fHwXMl)Yz=2Q`6Oil71!UeRm&%>Hcb`$t3 zZp4dgxwOQp8fv(|X!~Ung&7n^?G9zX*;;#nFigvQCtR5*P|>b$j@Y@6TZ>e?a$kUaoP-4RHX6Xbd0XL z5zbwlG1>RY>w2+2EB`t?&m{L_%ruL1GS0S$qnGAf+a>tN8*!?X`LJI3745d{Woj#a zvZ)>>L?oU370rOBoJliX!MSNmmo2#O`oI?Y;xBFSCKqmZ1tE> zZ`V6a_$qGsvA8VrsB@b><4pABjcbsuZOEH$v(KNXj}yw`Q14~BTQ-L0%gK7cJdf7D zVY9Y;%~a!T!ebLEYUy~N#U=~Rl`KyYaFA{$c6gk$Kf4sF;O8{pUhb70P1e2hDSh~T|&y&3ce#TlKwppQM}L(A~kBIv9!apS9ku?9Amtn@DJ z$r>i3DFNm?jCZ#W#!DZNu#NCS>W52Qn1p>6qk8;K(K3FzaKj)Ut?zTQcTyqJFrII3 zG$l#=ylxvQ^A!tXUHI75hbAQ?d-%CW6Y^PvQ)%{A@IlEZG!?FtOCM~X3v^81aRhsY zu@27OTF{}DT{;E>@PjW8>tMc*UpN(xj%SoUXkZ^0<1yPkF;#S$03NYlM0unK^X; zyZJ2c(AP{~$4;0zvxQ{W1x3bY(3|*tCW)7jIJwkPJ9WpfUx}??HTy@4g5En@k8h^$ zBs{h}2{AlgIfeQR%&a12d*AyMD2Ji%52v){jlbyVtxdhMW~gu2(6!iLEAon z**@q-9K)y&zNRo_aHIqc$)4Qi@W2WNsAb=SE2an?GV0X!SDidZP$dxQbUBIbDV8~r zhWgC_Iz$5d`b9jgGjxrU8J!GDQWmnKLJ`CBv*~GWrDp7s6;AZ=yFO=3T68R~i}f+< z=d8cc`G__h-@S#?(&{5dJ(cmwx3&Orpq8M$_42U;H8^{@9%1nLS`acq5hI}y z@=we0u*gGcnvvCzb+Q?!ex>D3KCRCfLxqzZoYV1+&qCkWY|?B}(Zh*D&4uG(s9if0 zDn-C3-bf&1HYVB;inj6TZ0ZUyel4KXkmWpg+mX9qv*Oi!XL@@ayyq#kDLzx1_omQ_ zK*+VddIMeS7SeMb^71swm$6bAvvS7LOa_zH5F5!k4U?5s4=KT;5Euzz7Z=>SLa*&5 zzzBw}Sl8PjWTGUeVUm>ccvUy^R=aL~-SRo$1P2S-s2T^I)rg|Rgs0Q}VL4$Rw<-_OPDTfHyXgGKCrQdhpzL@bUk3Q&3O0AWP4aX6{ znrf9BL{pwANx!3eLvBd23NFLA`r6bWe$W*8;L5AuVRNkxjYmrJ^SiEhDi4sTP%D{3zi)3Zt7!ZE30Mi8Z9Lg zcklY)20w?n&ceFRwth7LfitZnvv2anK~tu_TIi!p|3>hNF1XU z&)`T9tR-sgt=}M;F+_8xHu}g|VLcOoSn;{v=^K$`5Zgx(@9 zRIqTwoic+n08@uo>G`0W;)3oMw64tZy<+wgUU7f*z(Nr- z{H?oU{k!gpi`6;(p^eybEv?HIyWi}KiE_0fhFbplI{vkSzV!;LYfn{ zPbHhO75bNxQioHV-Y}hc%`UTYUp02~s)gnWvJN%`GrrFqAD_#nGgHbQuCvbeDR0t~ z`Ni3qv94%Zv!Cr*Nsmd77xhlqMMFj|@h$JJF_i|&DkRCiZr9y@MAF>QI}2Z|HY)&J z71KAxUz_o>h9K@}JS`Ev!%eumq*#gE&AtekG|?s2n6Kk(TX#DwsYoi+di3OsFs1dA zs56S99nm+Fc8aS-o-_BfysTOg?2|HPZw?FKF(beL1`_53iTAFw^i#E8#{iE+>rp*h z3p+7JrmKQgZ%U}JgA|~bNsTB>U}<_ZEcA}@<;Gz_TI>oBo~jUerx+W_MYsn z)}1%$>3o{Jp6r8GabAGtW|tQUCl7i~nbC%5`zNjb@t3{e<1}4653){-{ogI8Pzy4LNK{ z*{K_Hvyu;0d@f%v-U;^oe4t36(jy5@5FEm35oT9A1(2%U79T0LsUlWp;V@2E+1sn< zQ?u6>QZgKr;nfL;`)A2zeCP73C+Z7wbyoLc%-jwb3~X`WCtJ)T_hk!imN!W!GimT7 zleC@gTWf9pOrc?JVTZNr8dS&rnl7HguSaxm00R`y7QzW>_u;(za+T>{-^v(){Veq! z%C(Aa|3NZZ?d6%01YQd9{7UI4TE19`c_Hl%s`kxbG4qgTuIhwi zQ0|ETl+7LKEy`krQeeZolH ztLR0oQXkVAI*#oYt&udt;f+d@Iw%9DwcYcYm#rEhcpv9T{Zz;DDHVpY26i0Ou1dcg zD2SS?$|T9Y$;bKWlTC!3wq0_pJDaEFw4v_BB!ju)7E^gQebzi5+DVj|^Ip1W&rqeMCQ2EseNzsps;DUrWZP_y(h47lw-9 zvbbF1)VP2_x*Y|*$cry-GEB1a({%V~JZ)IIRP?@<*0fBJ=56hp{G1*uop$gT8%R$) zPq*Y^0GX@1Lqig+L#|IjU%ks~WMzVZ!Nwt%lU|TD+NYTv1K=kUd~A8_i-YXFSPpOZ zjhB0dmheOksBK#J0XT}M_#skX=?^&< zm%wQhFX6(zu!&=U4%K(*_7KUtkK<^F@TJCaVc-lL3L&Hx1hnh{8S8LbGVT zWxV0f`qct6@}K(23WQuI+F}duUg5h!!LP zE$J4k#IOhbypIpZOGs3ywAh>Iy^W@?Mu}KO^mi>FTu`x+1@-QfA^Il(<0(N#_^K zWaUV0&33=ck`fk0moR!JA>!0yO|{!{m)(#!Tixxu54A?7JThB#Xh;x|?Y@#-lGLuR zUdidkFNeX&ra1lRzSNkj*%+;fZ>7Iu<2)hKdC>HZMT zgsdXn7b6?V!QcV=pv_j(rVDh@775rEI@=CjB_!qnGTxHyD75o#dZ+aU)R;G+Qtiyt z-np|mK zGatY7yq<38T%jM@VqYv;J>j%+-hr9MU|^g?dHKuos)&&heu`SoR8G%YMb{##kx3yd?-K$RiFV*}+JN7dhyj9h#jxqF#+=G8#C zkrQ|JO9$I<3UxHsAsA-d_G@ekxq2qqwBrzMBVnSVG5;33!E4rk9v4=ql@1%rRSQ7DWdga zR~rgEz)Bno=GHser9Z0^GUV?I$BT_5kMz{o_1kg?t^j6iFhIsdqStc)@u#zWZ2M@v z8ys@2(hjEv)UGasJo2wooIDJIeGyNP94ie)!ZInT#g?ATistWIpxySAUVao!bWYYx zbauK?s7YcqJ0pXN>2Wq6h(h9@N{y5w+i~7L0A=r?_E&2nBG3z^?`CC~R6+ciR*9C03l-B^nmr z`0KvgFI!vxvMcu&tf@Ljvt-|X0eqG>A@oka*X@SQC3|H^$$iq>tOp|9DaMj9a5k87 zCd&)bMRWPZ$Ud0RP1BD9TAp_l#w5s?-_dP8iC{;+gN@q^Qra|L?izuOy`mB>m#kwK zO~3%$emjeAB8$&6MNmbu3v=#5;UsRI<;vT<7pr+n&Rw!tvl=}uxzuowQ|x1c;O%^^ zrMx3;+%oqb{nhO*o!z~!4NI9KH@9vDEtGEK%g{#fFRl0r@yQc8kSmq7-Var{%aKcS z_X5#7_fc?c`B5><`y@03t+zjFw)Nt9zWvKGWvJV-ulk@u(3c0KD5lYM_MX-Rqloj( z5O1&7;X(@niY#XPg78^BA8YlY4HT3wFb z(hz|4Uil=F^89@fWa!0(lkh@5ocUKfbm$WvmX9lJyrVw4A{;WLQ)es+(Kq%FdaCJk zkj>rYNj%9n3iD;x^f(#8Z6%wYFrl%sQzctjAN!=0!SfE?)Anr<7ka28PgePyReI^v zNv+}vs?{Y83UF?P0oL48>aqzAr7O@a6||v>>Dj9RhTvk&CE=CIiNx1+7GF_svdRrw zWG|jQ3|uS`DPh`AqU-nATz*a)*7!7R=3jR+)nGcSO43c2I-@jDqv&*brJCWHq8&#Ztw7aTG=7?m)q6++f1^y+JY=|0 z+C^ZCa;Y!5ir8(r;9QjRB%a1hpT^hr`49|n<7sKjcxmMDip-j+_^OSMuQs<}`)s1L zOATeZ{;L$_njzltD7HHfW9BR|!1>|w z{nW&yK3lzf-{%XTwzn)2DzgHj8W)_8D>G58czjU6*R2xEG+tdcN&|s21K7ykBNd+7VM*kq&O2_FkSQd~FjNxKIhtHt%qYh`zG;ihOmrUA0NH za|->I=LU2bk}j|)r$K-qdPdad{O{^tf*AyNw^yukFNCvDF^iI3HlC)fkdy5~3tY-q zMt8VhRaMnRzsWNWHJd!N;>Q4V=bpuAoC`_==ZsJJpZU-wjT028UF}^zWujU>xPC(B zOgf%LWzL}^E?EzKU`Xy;(Bl7})jqdHzk|!|lFxaD(_Q=kN!Gj)bJ$IAXAmtv;BzX~ z96t&+EduY|`I68x~cU^`9B=Io8G2K?}Sfqzno{~<9uaauIJ0zlnSn3{VstWng0dBcW3;Lf$yAANS?DQB` zZ^=SZ6j5Q(IcViY7WE;tBWzHd4?K)dtPcMwI0sO8+_JX)D$NT6L_Ut3?XVz)z$p(y zOy6}BbVx%xAEuGPsjg@OfF|*M{>kM3C??Q^`QsZ6UFMlM%UkajL#Pbay0fw#Bchbt z_TWJwvLS3bmWAM%tF_*Z5SmN1>aZ*E(j*uFuiWxgnq@fcPO#CC({BC13qpw=JN*Tj z4~i!n;PGUD58d`m+#F+~8Gf?l8=(Ts;KdoAzyz# zfjQ4FgcX(5{^gsObH$DMI%XzsYnS2}WQS7&BijgYpFN3Mp-VJZ9_*krp3aCG*4AQ# zy=`k>C>w+%u*KKd-d&WV9)d~N20OHyRP}5Tr-d==9ttFGF-WDxZsk^XnP7F@;>-hI z1jVkaLemsF?>1hPpqOsJnzvYJ;$~SMIUL-lOW4xbvNpG-O)6)oeOIN+qKYVrg|6pAFz+r_7R3zzXzFjD73EHiPnan#n>JnCOv~d4wy3$+c=F{vf6Go7v4%l*9X3Ek(9h!x)=Ink}*ITJdRd4sUi0xs-9%2Y_l8#2$Qg; z!Y(J<)jr3C>{*$hZHiS8NZ3+lYY%EjC}{}=XMT4$67JxFFl<3`z(M(omOn9Hz*7gzG44BpBK-Y=h>b;d-C#gNm+#ign-x(1meWTK-b`T zNfcVa>BJ;nFaqcS3;;A*18N_Z1|SOH^La;N5Co`sRP6?EdwkC*MQ%^9ri}I;1)WCo zwlsrp0X2Z4A8lf{s{lS4Pz(T#LT9fn7>c?8UOeZR0e;0TY^-k>IxyhLhB&={*e&ne z4rhO#+RIF9mH&8JLSk?v7>iWPmU_Q)8GIe+nOw12t~AxZQFQr1WC~T6)16K`YP0r4 z;uFF`kyMPu1_2_j0W0bkh@|v7?l+Z1?1DzNK>XDr63S#DU`do6R`9q3ZH6GfU7!ST zIP4N1M8czu&27BWOo)bg4~ada!21nG11gh$`4or^*=)6SO{`|2H3S-0y!we=uk|p~ zyL})rjeIbB1g)>?Uw0`LD!<>$keGjJu}+zG(C9+`M@l&1UxYZWtcoSK?`;=rV3$n=t<6=!m<+$~&`m~wv#nS#S_oRh!l;JOW$iw8&( w&d$1cY0d5VcPKgd>!){Q%y_(c?Si6H$CGfysognM$#`4=d3_7{Ga1SL3uq%qaR2}S literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/pos/maskBG.png b/posterita/posterita/web/images/pos/maskBG.png new file mode 100644 index 0000000000000000000000000000000000000000..b89babc2f12a93b80cd1e3e1166d741a477a4229 GIT binary patch literal 137 zcmeAS@N?(olHy`uVBq!ia0vp^AT}2V8<6ZZI=>f4v7|ftIx;YR|DNig)WpGT%PfAtr%uP&B4N6T+sVqF1Y6Dax?djqeQgJIOB_Y8hS%JyGP=M1- fG{{}ip@ETMa}q<9(n~jWpfUzeS3j3^P6>fq|JJz$e7@|NsAAFRx=_ zVq#`yW?^ArWo2b!V`FD$=iuPrlq$m6er~larU1S5Qz;R8&+_Qc_k{R#8z= zRaI3}Q&U%0*U-?=)YR0{($dz}*3r??)z#J0)6>`2H!v_TG&D3aGBP$cHZd_VH8nLe zGcz|gx3I9Vw6wIcva+_ewz09XwY9agv$MCicW`iUbaZrba&mTdc5!iWb#--fb8~lh z_wexW^z`)d^78if_VMxY_4W1h^Yi!j4+sbd3=9kk3JMMm4habf4Gj$o3kweqkBEqf zjEszmii(boj){qhjg5_qi;ItsPe@2eOiWBlN=i;nPDx2gO-)TpOG{5r&&bHg%*@Qn z%F52p&dJHi&CSir%gfKtFDNJ|EG#T4Dk?56E-5J~EiEl8D=RNAuc)Y~tgNi6s;aK8 zuBoZ1t*x!AtE;cCZ)j*}Y;0_5YHDt7ZfR+0ZEbC9Yingw+9?&<02 z?d|RB>+A3DpD^XDh z%$+-T-n@D9=g(iTV8OzL3l}X~w0QC2B}_lB#*G^{ZQ8VX^X4sEwrt(Hb=$UW+qZAuv17;1ojZ5!+O>Q4 z?mc_Wzi{Eg#fuj&UAlDn^5rX6u3Wu(_1d*-*RNl{apT6#n>TOW zx^?^Z?K^kw+`W7E-o1PG@85s$;K9R(4<9{x^!V}PCr_R{efsp-vuDqrKY#J!#mkp3 zU%h(u`t|EKZ{ECp`}W~S3{Qdj)-@kvr#Q*Vr5+5+%gm}6*hE&W+N=R^FWngSMm(IeWz{A+U ka7ciG9L5J*hXzK54hDw*UCaiXf#x%Ky85}Sb4q9e0AilBl>h($ literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/pos/paginazione_ahead.png b/posterita/posterita/web/images/pos/paginazione_ahead.png new file mode 100644 index 0000000000000000000000000000000000000000..430ef3556a24bee8717241b7072ae77f0251f7b7 GIT binary patch literal 996 zcmV004R=004l4008;_004mK004C`008P>0026d000+nm#LZ500093 zP)t-s0Be2q)2{#j{{sU91Ox;H1qB8M1_uWR2nYxX2?+`c3JVJh3=9kn4Gj(s4i66x z5D*X%5fKs+5)%^>6ciK{6%`g178e&67#J8C85tTH8XFrM92^`S9UUGX9v>ecARr(i zAt53nA|oRsBqSsyB_$>%CMPE+C@3f?DJd!{Dl021EG#T7EiEoCE-x=HFfcGNF)=bS zGBYzXG&D3dH8nOiHa9mnI5;>tIXOByIy*Z%JUl!-Jv}}?K0iM{KtMo2K|w-7LPJAC zL_|bIMMXwNMn^|SNJvOYNl8jdN=r*iOiWBoO-)WtPESuyP*6}&QBhJ-Qd3h?R8&+| zRaI72R##V7SXfwDSy@_IT3cINTwGjTU0q&YUSD5dU|?WjVPRroVq;@tWMpJzWo2e& zW@l$-XlQ6@X=!R|YHMq2Y;0_8ZEbFDZf|dIaBy&OadC2Ta&vQYbaZreb#-=jc6WDo zczAeud3kzzdV70&e0+R;eSLm@et&;|fPjF3fq{a8f`fyDgoK2Jg@uNOhKGlTh=_=Z ziHVAeii?YjjEszpjg5|uj*pLzkdTm(k&%*;l9Q8@l$4Z}m6ev3mY0{8n3$NEnVFiJ znwy)OoSdAUot>VZo}ZteprD|kp`oIpqNAguq@<*!rKP5(rl+T;sHmu^si~@}s;jH3 ztgNi9t*x%EuCK4Ju&}VPv9YqUva_?Zw6wIfwY9dkwzs#pxVX5vxw*Q!y1To(yu7@< zy}iD^zQ4b}z`(%4!NJ19!o$PE#KgqK#l^dCU$jHda$;ryf%FD~k%*@Qq&CSlv z&d<-!(9qD)(b3Y<($mw^)YR0~)z#M4*4Nk9*x1lt)=I7_<=;-L_>FMg~>g((4?Ck9A?d|UF?(gsK@bK{Q z@$vHV^7Hfa^z`)g_4W4l_V@Sq`1ttw`T6?#`uqF){QUg={r&#_{{R2~!R`#I0001E zNklj z62b%sAO?h92ooTH5auyJm;eC;CBXp91PCAucK`$sh5$eSVF&;O5QYFifB^u3o&fMm S004R=004l4008;_004mK004C`008P>0026d000+nm#LZ500093 zP)t-snVFgO)2{#j{{sU91Ox;H1qB8M1_uWR2nYxX2?+`c3JVJh3=9kn4Gj(s4i66x z5D*X%5fKs+5)%^>6ciK{6%`g178e&67#J8C85tTH8XFrM92^`S9UUGX9v>ecARr(i zAt53nA|oRsBqSsyB_$>%CMPE+C@3f?DJd!{Dl021EG#T7EiEoCE-x=HFfcGNF)=bS zGBYzXG&D3dH8nOiHa9mnI5;>tIXOByIy*Z%JUl!-Jv}}?K0iM{KtMo2K|w-7LPJAC zL_|bIMMXwNMn^|SNJvOYNl8jdN=r*iOiWBoO-)WtPESuyP*6}&QBhJ-Qd3h?R8&+| zRaI72R##V7SXfwDSy@_IT3cINTwGjTU0q&YUSD5dU|?WjVPRroVq;@tWMpJzWo2e& zW@l$-XlQ6@X=!R|YHMq2Y;0_8ZEbFDZf|dIaBy&OadC2Ta&vQYbaZreb#-=jc6WDo zczAeud3kzzdV70&e0+R;eSLm@et&;|fPjF3fq{a8f`fyDgoK2Jg@uNOhKGlTh=_=Z ziHVAeii?YjjEszpjg5|uj*pLzkdTm(k&%*;l9Q8@l$4Z}m6ev3mY0{8n3$NEnVFiJ znwy)OoSdAUot>VZo}ZteprD|kp`oIpqNAguq@<*!rKP5(rl+T;sHmu^si~@}s;jH3 ztgNi9t*x%EuCK4Ju&}VPv9YqUva_?Zw6wIfwY9dkwzs#pxVX5vxw*Q!y1To(yu7@< zy}iD^zQ4b}z`(%4!NJ19!o$PE#KgqK#l^dCU$jHda$;ryf%FD~k%*@Qq&CSlv z&d<-!(9qD)(b3Y<($mw^)YR0~)z#M4*4Nk9*x1lt)=I7_<=;-L_>FMg~>g((4?Ck9A?d|UF?(gsK@bK{Q z@$vHV^7Hfa^z`)g_4W4l_V@Sq`1ttw`T6?#`uqF){QUg={r&#_{{R2~@urTK0001E zNklwrj*pBUIaI&?gA z(UI!+P;PhKB%&cat;B0>)JnOViHu$gvmR`y@DW=brhDT|bl&dl=U;yPUf2FOYunwv z`R{*bRF>4|)mG)1bTZ|)HRpDkbhkFvm4sKk0ykEgl>4n0gBMjmi!K-3UPI}tIEz!ilU=0AH5$28n literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/pos/success.gif b/posterita/posterita/web/images/pos/success.gif new file mode 100644 index 0000000000000000000000000000000000000000..59e2108ca19c64f15b31b1b10856bdfc17c34a99 GIT binary patch literal 1169 zcmeH`{ZrF*0LMR!aod29(Ra#{d2E2UrUeuznsn?o6p$f9>UgN!JP6_kt_KjMvSK`K z;Mf=-u&ua>3Px9mU4UnfgcOP-B%_NT#xfE{Abb2i?fZ#-?qBG2_rCYNetqA)k7XWB zIi%zO4*2U5;JzoMH3QHb7E#XvIsn=jp)E9^W3d~#I~zj-+rf@jIxy^rJ0Ha`fEZOU zxEKJs13?c6=>Uk933`G+FNjjJ6F!Uz>jYd44;YyNCctludA32s`V=7Dbb$fHY9nJi z1Gv4+xURt6#*jp9RP)I~ zUD}D>Y?l?MsCaWQLpk(%<>&J9krR4TOViK?@7z{aPv(Af zOL_j=^4i;HE_|&qjA-g7&b3(2b$xTee4|G{Zux9lKQL(-nlgWNcWCgw`HKhIu{n$N zhp~|*)A+-Y(O<{!-Jcw`4Sn~^#MI)QTPtHTD__n$x;eY{y?uG{;l}*J*6hm4l5Nwz z?y&#vwf*6ped1VkY^*u3#Z}bdcCBrC9ZvMOEo|9=|Gi2+MqOJ@Y-1fKJlJEx1-+=- zjc-CXfn%Gb2Rca~?jxaZ6M9Gj-y%@|7IeAcy4UZdP@k8epwEvHC`mZo6y~E`5JMqK zkvN5u7{oE3A9^9-C$@uQ&_ns%Cg1N{UE3FzMzF9pf%`k((Uz^6EpcT1I3 zr6tidZ&j5?=a-j8AIp^Gg8g8de@_CK6i8=92`e7N)LEX-9A9Ak#H|lcPp$1&=L!xL zyv@u+BQ6afUpBKN!3gJc~|ua z^4i(ur`7f=$7v0<9r?^G4f0ewDUQ8o>q~7B$m=R}>_~1DeNGXh{_|3@Y}B@Vr%6AM zWtm^w~$F6S7ZdBf9Z99tyiy|_RHV&PeqLc8J z*j2h>cU)6Rw{z1QB_vcSp%(?|O_36*f+*dJkVJ@t1X2Le6-C4q3sw|S5iF?eiWL+q zh+ zgFm2rM%_FvRU((jQY9H27Y9e+84wylAOJLx4RHYA;18o&Vl>Sl#>+)khvIJT*??5+ zsal?m^6<}8Ja87)2>kWeSUW3>r;e3a;X44B z^Bu$i$bdfk(}aJBvj3E&{NL~}&!AnSLxErz92J;U+Nylwh*9w9uwoLZ?x+On6-|sn z!6>M=APwiI%KhVD45I_n{L?PzO zB9mwEAlBb5iYIr17-m)soZKRbI0fQZ3KvY555@!JlJtHYQzI%Rb%2kmMv{qyJb^4u z6fT1p^4)ic7!Q)QU?yWo=;%RxlT)M;MaFj|l0+&@5sC$3MLKN52#iL1kHlyYS4&dJ zCBXu*K$;{M@F4-j%*+t<3)57>C`TAxO;p$&z*vbG^)*#4$%s_Q zWrBf;f%0e~IFbH^%1D;T;e`4ZIvoyi>L10i6=#EX1{g3SzP%W%TE}b*MyIf96{8XW zuYd*WHgsyD)3pFjKFGmOfNK*`4%+46+6aL^xXS~EKVOn8NaRL9iRVBa!vKFSY>g;y z!5$bC3WZ8xP^kU0su{uCC5T z3w5@t3G+YcKzR}{DbSo@c*G3gmU2tGc z)3y7rw;ep)*4-C3J*%)}d+nL_2X8!r<5RL1uC1zT?&x{T1UMYjmVoI*CK25*6-=G9 z2vCDeGZxW#-U>FVK|@qauZu-;mo$GRH(Hw~bA4e+LKPrexiz*zCAR4D17qFgg1cW; z_-hTUzp0?S2^e_nn@r#fUaw7PUv8M3vx$A;*V13o=B3T$yrfkKda4p9rCVOlK9V+7 z;WqM1+Qu(S&&58gU$#^UELJrMyE;pWw!ZS#O&V)YTly-mygtCV9kxGHbo$7{1kQ@H z#g)H5-L2hWMMJ4#zh&y?5Sg&pNyYQt`jKk@XRq{Dy zR}+RT;wH>=XCA(<1a{3stD?Qjiza873=@5MtpvZ1KV^Qn;->HE=IX6|rN8CH?>W(M z@PM08boRA-?$W+WpY&r&Fe}+k?%AEaeG`%mc6B7`DqCJJ$$QY;a_^HaE%C|yOq%2XH|&JTB2CjqL@hGnb4VT<{ypF2dr#9N~1h*@xNz^cW`tEdh0{tadP)|aq@O`22iWb1DYw7xXr5G(QOLf z4`Zh*#7O|(uODjefDH!Fr~wi0B|Rd<3C^T#gJ1q42l#rX5?q;HrJdI1c9<{Xc@3ybLJ}0FiM}+J!HW z@gNLCA|T3^XP|U6pkgPdp)lMxAS{InLRb%lQ&cdzN3oMtupbKZ)5Ux!gX)~YPv@g> z6NG=vQlK$8J{-b@SwcZJgs(x^LZnC+LKwXyveN}g@SZ?mpme!_mkMD=2s5NHQCtX* zgaI!jWe}V^2$sX(7|H^!Bx5EPE^=&mwj3ufFHcU0AX_Am%k9S{@zRo{d=6KVo{=P; z34qFGv=z`oeanGPc6ah}cei(TK(9ap>Az(T2>qKH9b1*itMS;FAvzbo(Y`hQMw7tP z#S>o0@yox_l1l-oTLABpH^0#=HpAnz0D#)dgY3~k=S!+wp5Z-wcy@NSgHXV8Kppxu z{ab;rl79^h`kn*&y|2FGj8@$)IH*&3@V20ka%34vJORi4kCXUsHyotaAU%df38o9A z0x|ql9GqoBaS9x6F<&SbO2izY_^(FzZ#EmG0}86|s>o0Y(5n5D3CRB!~eMz*NA4kySd3WU|3*Fb@=h#b7yD1J;9buodhC zyTLwC2abXUa0XleS3n!M1v)`DcmjIC8}JccAjpUs!b0>B6T}i3iZ~;l$S5Qb2}h!k z3CJ`g1rZ|(WHvG%S&Xbi)*}_jPGm1~7->MxAuY%aqzie3yhJ|W@HhsJjWfbo;fCWp zasIe5xES0NTna7|my0XFEyJzDRpNfa)#4g(7jSL3PTUh*A0FW8cpbbc-X8CX=i(#r z6YdOp0I;Z zOK2ioC3F#b315h6L_^|GqBk*=m_SS+W)lmECB*H-gT&LsHexsN4T(h3Az70=NFk&N zq#2}Hq$Q+{q#DvmQVZ!GsgF!1>yw9)eaMmIB(j`bNG>J+L_R@oC3lnGQRoyCiZdmM zGLa&tu9@ar)jroujq8T8QqIMo-U-%rLUv!p`WF9(cd$)7JI9m>U{M)^)mHZ^;Y%g8dMES4S$WP8o3%J8v8Xa zYdqDYYFcS>HIp>wXqIUn*6h&iW3re|%t&TBa|v@7^BnV`7Fo+mD^QECRiL#+>y*|# z7M^9!;<9+G`K+z1)2wbbiEYgeWzS$QX8+8-#O~GB(stF3)6UT@(>|u%se{+C(h1cO z=@jei(`ncFplhV-uPe}9q`OY=rs zb*Oc&b+z?v8#NnWn@pQZn`^ctTTk0G+l{tY>~MB&cByt{c9)0ZhPn?G4&6AkWf*ao z*D&$0%3&S$410h3Ecw(oXecAxv04Wx#YPVa(Ur8)K%cR$@RJ$%PqofpGsrzpCM;;a) z(>ykKba=8o$9XRCJnKdD3h>JFI_mY_+ud94z0dpi5%wd}M(i5#aHRD}!N{#6@A;Vd zB>7bMbdKVTnl@_ls7_x~-z48k-@AV1etf^}em(xS{xkf4@_!!S7$6Ne81R4 z_yWWLx5qX!3^SULKdXmiL73$6w8VB=8Ze6!c8@nZ9!R!xW#CRVj~BeN#(Pp9;Cc z^}-i3LS~fDc$*fPR+Xj{#fxgvDe2SF4~wF4l_rbb8)8K%tbSMa)WZW%_7X=&1#%& zI(y#it{?n=sF;JyNuJY~XP#G(*F86Q?v8o1d1>>0$#=|Ong4oz{QUX?qk_2w_Z9>% zs4i45looa@9I>$cN5YT7A1^I(SyZ~{OA){5{9?z&C5t~T;Vn78)M@FurOIW~mt87$ zFW$7Av|PNreTDCe9V?kDb64J56|t&zHD`6v>ep)$*PJVHEh%41TdP>xxh{O&p;C*| z<)xq2r><`+3n;7EV7Ot?hPNB}8(TN|ZQ5OKRKB?U!)D>;>lMKjwUt(tC0j^avbH?f z8n?B1o9DKj+YPoa-u}5tT-CWFYDd#fkDWVr8SW~s##Jk-AN@4>rz<~?{`t^u``r~a zIyH;;fIW&mkM~a7+rDqizQ+BY`*$C(Jh0&)>tInWQaiJ@w=T7=^U#DtEr-JnH`b4+ zKX}C9NYzo(qh-gmj};%M9WOYpJdt~%?_|cwrwu6$_Zkx$Z=Fgwb**W9)1}j6PM0>w2QRr_s=e%S`Op=wEA=fSTaLH- zwl-WHef7+>&}$dk#P@);-?6C--IdKXn&8PAT zGu$kl|HtXi9wM8735;pJe`SO(kY8UJl}+HFCcq(h_|k|c64C$9kRKo)5STJiRvbM3cb9Hm~@bvQLjt&e84hap5 zj){$nhk+IkK60m|3TMdVimdFMnYr@|78EZ0aZ%CARjb#OtX)^SzH-afZQHAM?A*0) z|AB+Gb%zeuH=b%beWv;Bx$~`8ueG&zT)%O%>+Ze#-4A*mK6?D(<*V0yZ{EIp{{gCP zg20!Ufust?{$Lk;zEr(ll2N-5TsCSrlRz|eB5C=LCnsgH%$(;@*a7enwSj8x64k4n zEN!9bSh#jszCcaGEc?$4%l})JeKqWxUEjTUEsDXw;=irAal z>SJSGy)t-mqH9c!?AY__CtqrPznHD+JYW6J;l%{5?KMNqT$4M^Q1Tb4#j8_JuWxLE>?mcYxLTmZn>)X z9Mq_jRdn-l!nni4qH0Z-WuM~P4r{;cC{lv^nH|1QO?|&CneqH&`^Hc=Ygw`WSk0o$ zIG?=Ex=)Kb^4@6XebzO~u3uWI{+NZqW`OnXWS=Jv) z>zSszz{E^FvTKUGo^+(f(K(t9Y6OU$JbayBpuW z(Q@^41ejE#gp!cSLL&_Y z{==s);zNiOC-$qD(OyS{^g@apNwVZ3gaMQPTr5%$f=Z5LUTUNw(__p5EBB?uIg?3E zls9wg3<{Gb&z>%i65N@ye_ z9a@#S){--l#H!u9c&!rHD?vhmzkmxcc(AvyVZVX@4mQjfapJ{{3p)-BIr3z{l^Z8k zOgJ)u%bY!b-YmGYXV9fZkKUYFGi%e9Nw=0P8@B5MxO3~?&AYen-@t`qr3l`puYY4 z`19-E&%eL_{{RLk;D7`cXyAbe9#|fkbh8x}UxVGHH{W^_Zl|7w6^?hIh8v!jp@)$@ zNZx`H!uOtufFYpbiY&J1;)^iGDC3MY)@b96IOeG1jy(3rV|;>5z#eNtb{OQ4j};lB zY)VGPq>&6Xncb66N;xHwNK$5{gH$ew<%R}?Ddw1DmTBghXr`&=nryb|=9_TFDd(JY a&I!bwc;>0+o_zM{=bwNEDyRt|0027xppljU literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/spacer.gif b/posterita/posterita/web/images/spacer.gif new file mode 100644 index 0000000000000000000000000000000000000000..35d42e808f0a8017b8d52a06be2f8fec0b466a66 GIT binary patch literal 43 scmZ?wbhEHbWMp7uXkcLY|NlP&1B2pE7Dgb&paUX6G7L;iE{qJ;0LZEa`2YX_ literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/spinner.gif b/posterita/posterita/web/images/spinner.gif new file mode 100644 index 0000000000000000000000000000000000000000..39615c89252d05f980b2cda99be6b153b26b20c1 GIT binary patch literal 7823 zcmbVRX;hQvy8SW_1V};x0Ydl!0V1GHLQp`I1Of?2B_JvetqGu_wKga!T8B(P!~lV! zqD2i;wTd>*h*JntP}Cr()S?DN1+|(0ZLwvz^qhO{J@@B5>;3cndDr^Z+WXmiKl>HN z$AyJUIRFRvV;cDL&p!hK0)GGf_tw_djT<+1+__U#RXsH|HGh8O*x1;QKb}5z?AYMo zphBS>7#Ofvx}HCOF*G#%`t|F}m#>VBjJ$vU{_Wehot^idK7CqOS9kvW`IMBDzP`Sg zn3((bA6TvZd3kwf&z}9_i!Y>7>7G4%4<0(y)AQ)@<0t#~?|=BPJ3Bj@N~IPR6(=Sp z_V)gK^vKc9&dwV*Zo=X4(z3E!w{DqCrky)?Ha1@0wtc(NXl!U`ShsH7iWMs#+_!MK z+#5GsR>z47x^&8F2&5s^Ee);mHUSIXY4<}EY&{tR2+`er* ze*DC>#>R8!&b2hR-ZnPL<%+v^@7C7TK6?D5tLtI?nX~Qf?Kf}Tx_I$o=iSbhmX>SR z8dtAg{q*Nw9z3v=l<4;D+t*}jUbALRMtWvtWo1D@!OB&udA$efngx**|{#XtUY+`v>fH`->MZo;`c^>eZ|6?jE~+#x5)eE4|g%$b?1O-)U|{r20NH*fy<Fe9Nb!$`PR@4wd` z(1wSHo7>Hw#y^G43tPW_y*KE6_3G7zs||04hWcl4?H`b=kqo{Z{Q2qA%I_;5KYFay zYU6~$zF+z@8qLj{w=yy^GBYzzo;*dPdFSrPwcBiha;Dz(bV$x$Ma-0keFudly&>EfkJm%4j;URYmr_xyc&y1NSt z3ndb%P$YcP`^0QE&zm<-quGD+=FR;Y&GO~Tzy0>x*|TToX zpGBcidY|;p0Ft|7M`Po)>({S$-n~0LJx!l>SR9+WB!(}J<;-EhAOHZ+Kfw`LU>XRX z`JNdP4gjF1foTj?WY9OM&@O?i&4#Mx0=#cRrRaQh>j6s0#y<1;8lgJRKN~w{ugd?L z6Gn~{kDNG=UYYCIi5DQ}C<*A$}ND^KC=m8<6n22`XHeNFh*bHnm=dKi_!A_gg*% zSqJruA77H~gh}=i;fNx|y&u1Pe!3@^4q6cGJUCQm6;g;1BxiZ93gA2JB26il{IG~9 zCt8@|Trl{-Z5Vm+YV!6gK6(D0X$J<_RfNsa@Ry=-ITKP)V`_Q7Q=MIM-LV2+KE12T zpsP4TWA*ljf!(acR1&nYumzf4jLKqV>t&18XdrV;G%qx_zm*`w0ZU_Y7(VT)Er5?u zPRNtpMZb~N(C1wpGK!&T8v1}Ho##eySy$0i7-0tYb9bKC}m3W^|4g@c7bM*6Ix?q)92TH;z;Q?iR>i2sC&&#buGM#ppQ6I|zJ}Zack6xHMAA!yV&Tl5h?Y;$Eqr zdwLP^ng|qoznO!UpD>|Q%2-KUwvjj1hHv93NpTvzr(aVie9@E(D;|1zgR;&q*@EWp z>65_y;P>c&Y4+r(hV>R8j&v|j){oo?zWRRTE~}Y}|C_d$f6x{KU;qyQ{2$utB+B)+ zanfqDPICLppuObEZkzXsHDyd(qN}9UPZ_*2D=W)d#N@)7wsmrC=DF^k9_%p_5)y%i zUV~d&M_yE};ABn|c8km6Inbr&hOSxH-f$*kzRvA#x*H|4ADTK~_07U46~D+2a1_^XigeA7Nm+zmdfziF{6WmiYSKR z&OhAd>Tfj-SEA>QP!`;gIKAa9U~CRmUN<~&S=?u|iN*F4Krq=`d#&}?uUh9{Mz~5| zGsBu90wN=G!MILUWSc`oDdR`Qw!l;moaXq$#%*tVGGyIuX>??u*U;_VT`B7)zCiiLEHY8s3xrUZ@Fr zT+AtE7d(uD|1Ak3=rtLAozXB6l*TO=I;L^`@vz<&vD{yd_Qj>*t?l?&*n%x^QaH<& zgrK2eU--@vxS1WB5nwnnaHZ1jddF6BaTMayRk*iBYgF~=GD-TQZbzR&fAF8=Y=Q00N+`_dAR zbdU>9929cPr~Z6$N)YL8Uc^3y2I4Rq9L;7An|VLf0gku<(oZtCxbwqaO*b*$+{JB3 z-8(Gqon!vP6&4m@(Z#Lgcq!4jntlkKB+J2hYj+b=E^1~@`+k$8 z6y-%}m1rZ>(kLACDicZ03Oz)Q52l;^2_$2PbLRxVbFM4I#{qP6@4W=GUDsv z!KsjTy@_H97VfF6IKmrf`^y=8@%%agF-Icrzx~MP`*uw4LAdqqK0k|f+TdB{=eXc2 z)&|S%K)7b=JC%bAG?w~G^ND9eqdA5lBM2&=M~Ow4;K{@3D~bwHTUZ;SV|2U-J)_iS z2sl^G@O&;A0mT*y{A9kpDpvx8!V(XqR*ilXcm%q0bc7bUem zW^uBMpTh+>lm%2Glo*Q$TAnVHe;EXoO`GI|l885nlBLOMe#bdq+?+f1(rk>+_YWue z&%bPzlxK7g41E@M8~VFU6tXZK0>)(ZrQ zt6>5Sdw9t+_>;COQ0xT>38Y-AHMY*G+GlJN(*r@rWsX!&zAQ%~(fcKob^Yx7j3DHw{fTyTj&0@8oGibj4sq#5N_41d+3q=AH zY-boalk`M#QA~$b*HO0U%aOdeZGG9b(L&y9f)8<=u7#zZ!^540IdC(`-lE6jIJG}^ z`qfKvc=VZHs6pWY9RMy_CRETg7JcGT4qO}!b;bC!RnFZr^Jbjf-~(4s_RgP97#dKd}FSO`ZzsE2WK_%J_t)d z_E{?Qi=fWz>CSAZmJoTp6w&U)`0VC%U+ITsUgRw%Ov0q9;2La?B-;DW&8euLZqgFo z&&&c(wg^Ty6<~5@f9vVtP5&MDf>8em0RJQ`b|&a~&zyhlCo*eg5NvQJ=o$K>VzA}Z zS-D0jAL4JYxSPRh7p3Wt?3cpfo%H=J7)6ozXNvT_%E&NrPRao532GcW zWkMx>l}z0J6^I!FpvxJAHVQhDM2}r3-Fu;RI7H;k2VkUU!!bYgq6xmo`AkuO^Px_+ zk+dAyu-2WGc`2-?nI3{V;9TtaB;%0&wG86=PM;9Bt;*}cmVvvNO+6Mll{<3vKz~+M z1!}VNQv3YbsVSI`R=~X)CJ8A(WU@5!|9!&+k-! z$`9G+%8dpXoykl-RKo9$hCu!|>^aO}P5ZY{FP2c3sj%d~u|CFOn?fs@y8ARVfLsMIilq+~Xk!SZoaZH1}bO#4)HFNu_*xpoou-xJj{( ze^e>`pMStl{$W-dXymDmS$I!rMAzM^mR0UK~)%5*S4`=0HJU7YHS`;h}PFegKMcWC%l8*lMnWSa9VD0!+UfLzOlY8Q1 zfQ9f5w6!7c3Jfo(E3t32WNtQ+YNdGYQg7f1dz}4jq#ke${);v+%cK*oI#fCAg~-Dur_pa}>c3 zA?%38b1Lb&@Su7Fgl5OU)*YO-b~RxeEiNwrN#QKK+xXB0{+ACg!(NBO-F*wg?R(A_ z;WpyO(8QdU^-V~-jK7-qA6F0A!HlX=yR-^r8Yz!V3)l}6z}%|TJc~G(?}xy+JYKK& zD*qPgZ%aReO)S|ZUWf;6Ck=Y&PZs>Z8(xR=e0tipgwYdv-&Ms!D`pu>SnM5B;f@i) z#8L`142mBs(AONBGa#D`P$X+10Md0pVooPYofonu=e<$0oRx5W=aQ2SMV}SJ@Au0C zV=f5Dqwh)UOkGv`wrt-UCed6tHY=_Xt+g`TLSc^wQw2S!SNHi_oJ7_oBK@O#G$J=p zk1m7w38*VBGXZ5q*8-Qf{TFKYmoXIso2JWMvI6LN@!+hErTWr#m~w<6M)N9MdG5|6 zQ^v{LUJDMe8FCojCIwN{PPbCTtVpX>HH*UeB3iCzw}oVMhB!Nn4*HbBrnUY98y)uW zVqpQ*xz*vs1p`JJtF1!d<+!v;?h`g}O786e;VE*5{E{D1^DC_i9mY;CVfV<*U0$z_ zoD`EcRwfH7fv^X+9dvytXJR zNp8k?=2-7V?dfDG(S6nt<+mMsBWs~AqJF}df=^J#QoQLlnl;a9pc#+t;|}~C1#arE@{w8m5<6jBPCX!o2ko3qIIM$9-<`3lCY4)JY5!RI5zwu)Dh195Cic++83X{H-7j{ zQ`ExB?YK|tn~pL#jy%RY&o|G01wLd=`O1HCE5v@h!EOrmsgP>vP)8+_oLbv2=XIo} zXm>)t-f{=K&{mbV;G4ve2b|4XTMG}!vbVr%Cz~sIq)jtc#GF_XgF@HZo!Rp>1{DTg z*MN6vtY>Z?0!k#>{=*X(8aTOgo>t4_NuK*5A?kCy`1PNpbIxkY1{#xIhuWBg z;~h1e)GL9YWn)KM*A~|#pe+;MS<{_hD>h&!TCZoE*{|?-ztQ8~&>X5Sztxb z$m?oZV7DakZKRc1B|y63xO~qeAX^MUYcB9<&VqC#bDGIhGG5@+XyPf79>Z^*{Eo-2 z>m4;kxiPO8w}bV`4siI{lRBSjP}1f#ZIm5A2Tg@QFpilvX^fK%EL;$QhQsDWVpGi_ znW80mg6HK*IU6?2RBngv1Zp9iIjP3^AII5Za$*WoOkJcds}2ypNoW$@AqbzARyOcz}z3}sEp6` z_2v?E@+L=Yqx9mR<1sY_*^lV<5h4C~XRthgK+S z+p-4%qt|gf{5hs&Nd=~p_*XC5w4&|$k9)?sf9{Y6Rx@@3kxG^eyWpAIqnkBeX~&|^ zpG9?4on|+C-v3BiW*rtneM(A(vZr_H@dQx(v zf3GNrD>m}VqVvEv1X|)IxtxfF47396+ge(~-)TmWXe^u8;=GuoLjmseQjC8!$kHy%bv_M z&~l^a*G!v+ce#OWawF@(4sefNDn}Mfz0^d^qa?@B$yL>+kQI|P#hyNyP_%0%S9b>z z5eex)z#zo{pRAsUFV)VpPDLIKL$(r1D%aK;MdV85P*;5Ii#YlzdbCFYG^oQcook1O zh9~xxhE>YXt5DEA4|%X#Q{5fJZr%l9JiS5M#(^zhZN4^LVN*kX-kU1NS|Wct!*J9S z&p18SEiZ!=;|KYtt@tq!{K`3!i$}=Jg4#-1U;nTDT=nm(IR^MY_A*|AS1c+*&%DHl zrL)~RouQSYWIo!YxAQk7* zmTgZjcf7N#V&nYM;)82MLs)gwkf`W3Y_}?Gx~VZCbVygUQ?Sov zLiRg^o}m)Ew7}5GWhhggV{kP+bRAWNE@<62ohx->5OIU3$gj%vC{&VoNo$lF z{(PPv>>dGv++z)}d=2w6;4q-R0OEqwqRq~6R0WE^RV;vE94S^1nJ~!26X*2~6f7bd zcyS&Iv_Jz%m>Nat3?CdV~fQl?NYad_)(($4>^`~Uy| literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/tango/accessories-calculator.png b/posterita/posterita/web/images/tango/accessories-calculator.png new file mode 100644 index 0000000000000000000000000000000000000000..7de1c447d1e1609099a90fbb976249241593ee33 GIT binary patch literal 1382 zcmV-s1)2JZP)dqNeV7fT!p zsz8E21Ox|=;J_6jp@I-XoS;<^YDo@26^XV&G-(sj3fiw4FJHKC#?sY0Rf_N`mDE&;Uf=>PnK z4?pS(1_QeWk+NY=ojzIhgykp8uJ_-2_aa~xpzFFj7!2^mS6_2&`X>y-XtJKxVX;_v z<>e{fdh-o5P4kxdof!b&=U;!}!t1YcZ0smPhC2(M^0l7m36cL&LpHjGyJ$*ipXu_B%9Pt9j4T zD4-AmeaGNN$ma{hV+rE%1VRX&E=O5fim?1d1whxeN+z{jZOpnEC__=KEeU9AvvB;x zAv!v27=~o*g%EDHlUz-+1VS+&feJb z#Emcz47QK~Ek|fHgw<+eadDCO#yYZbhl?qA2Y1AHe1Im`b%tfR@w9WHP905yIgx z09USDVR&?ucr04O1qTM%SdZ6mgG0l_)Cf~kQ@C6%08*(G)6>&lRxo|ifRhiXsc6B0YLBRI*HeR2P>({RX;P3GRw9F}r zLMoN2#7w19D2hUx#nOBW$_Ne&apL4erL9KSOWZicYlLJix=#PVAQLCY5oJzYClDN9 zW@e^R^{iGahYla4P$)Ftf^v!;KU(6>+#dkAJzjeH0;sDiwOnriHL}9px!X0I&ECP} znMrI`h2rN%qG@>|Y7C><7Dy?PNRo-oT5}B#*Wrdt+`#Y& z>AC{SB5Ta$u$ef!!(L~co%N{7xpU`mI-LM)ZEbP&+EqNB7EVD)hRIx#7ELH2pU+n& z2XH!_)n;e%^o!VRHjn~@B&X@9Yw_xt?7()703k&B$_fRS zj*Ntg?J9owxzMw5rH;X&k@5gjxgi3a{+i z)jt#pVE_Ji)+E~&ec#)=F4@)9MI_=hB0j~U%joDRXV0FU%FVdz`}+ERF7;JKh{T!> zKlE^K^6pjla_P!%ShWoSV8qa|crnjEw-g~I)JEbZj-$VKj4zLN2Y zF`8p>j4=xeY}Jy@%`lM}r=xu_x2C5kxW)S_->Cv%t!;7~hoUW#PT#;p9L8^^v8srO zua}g5HKrAR3J5}?Il+=eOSpP%gwCbQu+}zJu@i~A}ETHa0%;*8)WWh zRk}CE&o*GjVZr0RW6K zLEvB-Qq6)0yt-{W=Z1&bv2zEjRh2|Vi;!UI;W_hZF9R_Qo*CrD zm$tIyg)MYT53VDtE|1PgSKQlj^iLAd7uLrhiVBD zsQq6&8br-vqRqwy$1xERszTm41D&JIA&XBa&nItSt<807*qoM6N<$f+D3yH2?qr literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/tango/accessories-text-editor.png b/posterita/posterita/web/images/tango/accessories-text-editor.png new file mode 100644 index 0000000000000000000000000000000000000000..c6b6285144355d00fea50993b3e9a28f8e73d2cc GIT binary patch literal 1523 zcmV#p_UfXN+p1j*s%@C10tfqPHBvl54(x&+G(7` z_1fOq-I;rMsAs#5y|!cEiNAD5M`!Nb^FRN4=bRb%e}^h}<0q}o3;BHbjO*IJ0$8cN z??7SivIrbJc(B5C-JZ~dA47!9#pn3?-ZX75bO5Z_j^FoV1cK z8{;UYn9BGl^?^u5Tb8gXnUCV^**B@Lucxx2%2rC%-M$4y0$S@@%eJl1ga9P#n>pNe zn#9^>KselXnpJBW0XW=tio5E*gotpc?G#?k7Xdibc8XZ_7m!)oNi`4vVGv+hw$fU! zU5voG)an%59@>V8LF6f31#mLAo!$ZU66;MjmRaR7@wO%4n zd0)9XN+}YFB(`m@DN6vTaU2I@4DIdh^A@^OGNnkT)3~mSh@{FA5Rs}V`*b>eM}d}7 zLPR2ESC=JVjHz@S2N9v8qhryG?t~0LOG^t{YbI|DrFN&2e=uS-+lqJng4tQR1xc+n z#u!>!T2>UOoDx?qo#WUm2e{n#W^!la<2zfnJ*m!g|9a!^dXE2A1MJ_w-?c2uR!Siv zoIH7Q$w1q;Z(nlGrM@#9d*yk?uKtVdJD%p5Z~vTR??09I`WrO#kMNQc60pI15Cd^M#ICK_|%u5ppY46ac!sy)vW5y2QkXJ_YR;aul|1DzI`{NH6jI4 z@p#;d+TkQ<=9A(#|4Q#mgZu}b;nHV_1RJOpmfh-qB4Pvii!)Lz2)4RV% z{H|5>_V(JAH9V&nX@DRIR>xv7HzLs3*tqBx{N+!F7&(88z29#oRkMb%&L1$5@#z`# z8N4Q>)~x4=Z+wf*4>cCMsWAr6^BiN$oMIFm!Wyl$HpXC#p{uKFfxZ4P^P#s-@a(f+ zLradKi*NJio(uz{IVx+{v!(GdQuQBa^p-H%-3>rfQ&Ut8wTR4VNP3ptx~LC`2u)2* zb21Nt0N?jHapXsw|LYMvFV4??`b(5jtg1+ns(+9j=_grx&;7(=F&BR3GLGYr&*y9B5%7J#*a?j>WzT>yh9C$i6bb}EP*lvaER<4ct#KR&%d)U6i_)56 zj6rLS@B20L2xPO_lz>R57E>BN$_F90%X`s}@qAB9d&e61&_F zka9l9ahRT-o=+f?$t0_)s<13;-oxdvoOXRXj4@12O(lU^U=qk_AU-uU<@NXX)7RH` z$BQl(N+~vP-ptI*j5A9>1J^a+gTr@)il|TY;X2*XU0UvySaxo+n+5;?002ovPDHLkV1isi_sIYN literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/tango/address-book-new.png b/posterita/posterita/web/images/tango/address-book-new.png new file mode 100644 index 0000000000000000000000000000000000000000..420139d3070de353e65802c2f320b120edd709fa GIT binary patch literal 1897 zcmV-v2bTDWP)Z*^eAo6^FljYwxOFX7hN)W6wCA7z{DSkj2>mSwfIEAP596 z@E^bnc|#-;+d~lI0iKWoiIfKrAQa+AQ3MD@L~*1jau(Zo8{6YqJno*Ep5CkOJv?;J zc-qqr4#`hyU3DGRJzt%3>fBQ>Kq5p^rXYeh$o^4E^*L^`?~S)+kG=BhCx4n*J=JKs z>P97zi}S;_-t-5d`XV@Y;>gkJ53im0**9;!?rv?h;UB_;_b#oBKl$b3=C0|zc~TS6 z$i`XSm|9j zu@#*51WmVw#rrYAviKRI_@~$ zBWUmQINpOKL7ifBg<>>M=v6jx**%ibP}8pKzIo41 z0E2_lt|(t=6^J5Hs0mOPP>t?dB<;>R8_fxt^94-RrTnpdJ?Dbc>fqO!UzBjZt`Xg07_x+d+h$jM~{8n9#4-`scm3wjvIB5 z)zf6fgkHJ`S8G&er?6hvVXKtKg#K2}MfYBV-jZdOI0|SqLON-cBpFUu+SM6g;bsH? zWyuGAtc;Y%ObJxfHFVOgs&>*0L@;6hF(FD}-7b({Z(%%d>%SENtr45h$!Zh|qmCFo z(-(mraXyy|Z$c^6TQthr?q;q7DBMN|Q|v;x?G8?>jkpe2Az3Wb7%TPzqHrXpc>m9N zKoK8JoL@W+FZ2VT;~;b$WYd2az~&>|S`&&1;%J&9d5TvSsgDl>kXu;;t?{c3qU)=e zFrYp@(zkPJEW;xurl0;LiKn^xn_m|<&i?1Iz7&W^9QwX1fVCFsftaxp;mR61%>bzG z-A#RLh@jfQt+!a8o}^WX5v{208SA}@{g0Mrmhq81i_bn!cIp(l=^0O8e_sR~rAlGs zBO+L9kRE}Q5<110p^FPtW~UHGQ{O#8ecQdAWD;fNW&z%!G&2kj<*7IkGqoDt(2(nB zJ=+%nv>FbBZeFc1o0$NhHZzH67&$XXxLVz+2>_>^k}Q@Pd*?h(yE71=lUa(TB5RHh zwHj`z1WMg~YY`U1sM}(VwcYCNNnA~3b}zY=b&`b}6z3MPu8R^u8%w(ovwC0(6AT($ zy5~W@lu&j;q+Y`<6cCu|15ijl415GICPUm+bX$Q^bjK^D`qJ`2)X5BSE@bZ9CEj`F88le!IL~bd&{oI?o`>sdCMPFp zwll2tag-wPToA$0`ZhBl1Lr|&1xG8i*0@@6t+;#PzV1v=#hAWM7=h%%FyKacoxi>G zI%}&{LSN%L8b@pXA0=^sAS~Z#P~B)E!VnMxO(5M45D0`y!E?{Q!hxv*U-`nPHoNhM z(o6q3Pi3vn#kp(7T8V(L_uB$cfU5+5X?c}uwZX%mJ&fnMx7}3z53)`B`bL|x7s~)> zt=kK8C!YX3dgoA|2T?f9R=1J(LCo-Qe8-M%rzn@=XpONJ*VW4NlM%Kx>P-LvjKZAR z*l2trpO5&<%Ww1TuO4G;IRCy5wnKQHgXix2Q2OpS9_3Fb-eCEL?*?I^1Y|&aI{-ju zW&XYI{r2}S{`GSY9f_`7T~a^!)eD0?3Rtm&ZSNyTY0ve-7-$UwXkL8##kUmp>o3_&~3JQt5H4yQ~}ew)~5i-({=n&ei;khuv?(k1K5PxA*Tlt j46uC|fE4KT)-C-PEc+6U3+f5R00000NkvXXu0mjf%OQdD literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/tango/applications-system.png b/posterita/posterita/web/images/tango/applications-system.png new file mode 100644 index 0000000000000000000000000000000000000000..565f406dd147d585f47374e20544996b3542dbd5 GIT binary patch literal 2544 zcmVAH^(GUqo@b?!El-*1o0HEJDptg2<0pmCbqKem#dezS?F+s%WcnB#ryQC1VV*1`CE4JUiWW_dZ+1=Y8{5Aq? z`ogk%9{!ElWPGl!uEyr>AKEsfWUkQH)%HMg(tg?M(UX8V+vifanie=~8_4Qm=x9jfwf?L$S?&i;?Q-)l zj4=BA)4P5}jV2R9!4UrX!mHBI@K~HrH%KfJr4<4F|`Hd!2iKJ1_s5fF<@@J&R(7z0Nq+b9r(>ap%xXC4UHds);(`th0$sU z979!k4n~IDXluJNu0**9Zs0D zSyF5e;xZ^9m8-F#(v*l-x?c0@Jx$rM>|AgcGxz@^!>uPmA ze-xSqlovaoX&ML!s%FjL&wlaMhB@;VZ!RjGJ9kFG+>HFvdE>6`mLRFEe`r`$RcA(e zs+67MB&Egq-1_x(q<_EFE#vuFvjU3 zQ4yjjV_$JmeGo$0m6-{^J8Bm2zkTxAH~?^}s!^-O4ELZ9LR^~cN zfy5Y|K79@xm5`TZht*<0n%x9S2zW-pF$zV|AP5pHR%_G|FjXZZ;0TzitSKo`MOIN( z;)Kzt1EmCRw+~enxtLX+0Yam=c=;j@9DGaE5);T##vXg)&7&J-RjCr=qTOUPYES?1 zaV{R0!E*_*0fEO8!t%PMmSe}>-&3R$! z1fg&kzy95B7>&j+L`iH`Wwn)nGy&6epnB~NlU>oyZr-?NZca`<1_u4t$B^R~Zd*`< zhL>KCb@udLRYmy;Ns~Hx!q237?y2(P;<877zSS5G2{0IV$dZDtt}$d~+t7aX3f_MA zyUtE)P46oVn)eF*$qFY2kknUc->~`Mc2~R2^qo9N!7>r@fJ$Ld(qsbWv2G;@P zCk{vYrur32X56=BHQ&?iL1wxYlv4P{BM{>Xii$FE=8ibetMb&ia0gLm0BCvGj_EH_sE&t)YtLb3B zF9FPf=UCE1N5^qc6%}zo0wt3Nmnv!CIR;Ts;7oU7^ZI(#XfPZ`lC$Rg{g+@>?t54A~CaQmmyb>+U2zZx~Kz3bL}zIDX=!CWsMK z%+5h>UMlQ1BXoSC5{$uOHXtk8hD?VQBOVWSKE6x-+rEFunYm_|EP5!ih7D_0=w(&i z^PLqaD4u5!C1w4cHS<|lrsKlb7jf{=JK~%FIxdb55AF8({QghQG?gq|SjkaF@XVflf+)p)hj1EiGT| zZ)rMyL=B_C*suvkP1NQ>%8FZ1G*Bxa^l`~OZH`?0*C>KPPs+^ zgcBZ&MZ+!bp;0X}+X_$>u7N?$?;B_W5C9OGvNtj_3;>^S4gj~HX5(73 z#l9Z^C}lFBMo%>!sK9?qe9fg~px>9kw;7!huTAmqW&Z&pdN>M(u2oY200004588HS&8xA82V&3hc%v6C1lA)yHbN)}Qer39sbN+U{J z3I#+(p(+&!T2NL0L9OUcM60qXq*bc~iV~f!Do!l&Q7KOM0T~Rs$Y{*Ugt`80TM4r5W-Z1=#!58 zhZO8==?Hw#+1crSmb&8825i~#18+dnz6bJ0bq#e!^TM`@Xib%(>pHro;kYhl&SY}Z zBoT|bLuUqZ#p2eT+kahyt5;LhbX3Pg+QXuf*k=N`_m0PI6$;NUUfNN) zeANn%K#)wQNu|cIObat-;z|ciRZ&zGzu$|`AD~buGTMK{@>P7CzxJB$KVQDOZv3Bsg8O)it4>T92B)sL|H8h?;O7VfRolhpDW;3C%kn)65f##TXk)P{?;d z@fgw2D2?+R73I=;v*3$*J)L?e-u}KJ%v^?O zq{ymO%UD?3gW2Cnrtc3(S!BpuO*-eHuC^XcQwaux)YsQiT{TEu?I7V`Kbo-&qhhU4 z)a9BhLz=2gx{v^zQG__9ohQDrG8B4z{k7}7y{FEAVp3OYu;!``Mh<_U(aF<9o3>z7 zwu3B?81n(3C<*|s>mr08;8)NU9ZfNiq7I>Upcz+Sn}4q;I>)`5P(nxosII3Buw}~@ zRiM0h&GldK4-SrE7qZN6^s?^iC7ga|6TZmjs9yF2(zS7&ain9jAeyCm;g`z7=h6eh zgQ^Imn!|O5DcT1>Cdpf7z;8%PsM11FC(8hpYV*A<3tMYY6=Ja%%}oYt*R0|fKWyQ{ zo?3pt^#)wW1lL45d0fZBmCO>J4p)Yeq6$aWpvqGy0_>azL;}Y?tqdpq%Dje&5dyim zQf^0~JhgP?a_^bGL8_uED_5?-QxV|4hn^-Fs^#{(e?}@9!zqm86fzX;6pl4EOMLp= zaTic@S}8b-C>C`n9zfw8vYCU#5>avB;Jgl7nr{n%tpMD8`y*FGYpXp1ftkw^3VEoj zs|5u0?f0{N$9~qXxtiPV`W*uULpXK@w*)a)NP-mH6%?EmSjCm(iFREm-@W(2V0j%73SVt(ZuTb=DZD;Gb93YDz7&F|fAs>jbx(5p{V(wR)9Yw%P;s3+ zQc9$h=fq3ruB^v$Hy~(5FpOI)kjf5o_=vzXJ>H_ye;e?=GUdOrDO?p+GN}yVut7sZ zL%G<@eDv|B=&0ZyF#TkF$C6%_I^D)~#KK z-|y#{XMR&2cRomK%fj+~Aq1MPQ?P9$(mdA%f_`%{w_MRwibaWKS$I623#^aF6Wnsk zt(-V$cXKY%i2AA3@-n_!%!xOBZ5STj+kcQiB*H{8=}IB?lmP_18XF$Tdi?>0 zhf*YynOOx~*Tr!hLZKj6Ub&jrUi&MNNMugP^MTHNLXG#|Jw&9shKW=yzKbn>ohN1%wS(%4%dBhx;3T& z$Z_VyiBvjKu=05QA@=|KV`8z?ECI)HX640%r;owP2-}`}1%IRpJD(#rF_C&}|BgRR z>y~#!U0q%J{KmFE$0}}~-`c9jM&ej`lbX6Hx~|W;G@tH2Njj4x6bxVROb9_ZT*aHO z@8igklQg!r(c68(JUiI?$l+rj^aB>)&fJpuKRIpwln$lw^Q zi<;0>1<7oYbS4czWgs}~zRwq+vNFWB=XP@R*lAjqET!k@5o>JZ>|gf&>y=%A0~7&! zCV&s{o#^?fdtp<@GBca4Z)#hljb|qL?>h&ms;MFxji9J1AaNXrU}cD4WvJZeKA)d} zKS=M%GyL}FFHvxH8k(BvIdara#>YO|y?6W8(wk3be&&Bc5QqR_AbQirJ07gBZTfOc zd%NKa1Q=V&x@V`T5I;R)wjks6bH^3WXx6WSV#XbC3_-JA|rxX>41_@ae zQdm|V+pwn& z7yzzx3bt(}#xu#T{-K_CyH6eNavUcI`~YGyltUCMk3AYBr-=MwqUzvCG&dP%sVbgs_;aG7eW0_SG9UAlMC_#ZE!mKFGu RQpNxP002ovPDHLkV1kVygbx4! literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/tango/bookmark-new.png b/posterita/posterita/web/images/tango/bookmark-new.png new file mode 100644 index 0000000000000000000000000000000000000000..621312a89b99cb4d8fe2f5e88c9e7c437042d941 GIT binary patch literal 1532 zcmVZO>A6O6~}+)-uvF0Z#z!oCJ5}rEv;k6v4bF1fGQxh2qV~l zV1ZhtC}G0_AvP>P-SM%5P1qHoZV(IDAc{aBpn!@h(v~`MQpc{pCU(=Q?bsfBX6$$0 zW$|X*@w^$QAwAO5n>Y8|dw=(T&OP@%;SjsH&Vgiuzy59eTZlJ@L>cF5*F;!L z0EA)KEh5a#%~7fD;T&x5)YvFj+56SREBi$F243L zx`3EoMD>F{S07jq^%h9M!|fFi$q?y$TY%;;05~kpg^3(+&H}KwxX9vShMw*cUAZ#3 zY={zzB0_0_MEcfE%U%M&TDw1a5O`P{VYJ3GCXoZiXaM^A`x$uTAv{&X(;FDIil_}l zmchPS_r8sb-UYWAg5AQo9gI!xf@T2EC?W?zkRp{%Cjf#V01*}!7nz=hLT;NvPRM7o zq=H$Lv1oIr?!AuPn+NP7*cFIM+^xNRC_uw}KOp6&iCRM7djS9^PoCt_$3BIpx-cq_ zmNZHg(aeCoUH7hX=bb7?3bi+3cMfqkBZmwlb)>MyH`HT(BLV4^8K&Tl~Vli4=)38J=j0II$Xf} zSD>+qM#oQ%_Vd**eS)Q>CCcS30KW41LH_j8G)u)2Gcz-+uC5-a9ROPE1G#Zu01f-j zl_&Y!XU1^OF+4oH52lpj+_`gH7{AH+v6EynnM4R6mc5r4b#)p2gcanJ;rq09rskAIRuUS(9lpKwo0i)tXmcMzX00V)YR0z0_`Si z{ZDJn=;-K!g`n9Q3bd}eof`07{9BXrP=E(f!1FxD#>P7Ke_()nDIg;EjQIlrG_3WN zty6pB_x`oG91P?{L3Kv2t~iC~l{VMEdY z32EFBH@F~5bYnt*Ay8-tQIv&BV%(^hKqM6tsL@JF2ST(+t>e&AXn_`n8QPim&T#=9 z>0dP3xX_cF+?RLnIp24_d+yD9@GqO0%H(>B8D#lGs51xAEG$W)a*dqSC1Xef_@)f} z9_6HiPoY_r7+(p7EYQ0cH%7t~s}6l@42dZrptqPoI#`Vrcn$*9sDD0ImLDBTLi%S6 z)46M07(6vK3ON49AgdArOE4vs*iSlWt_6KrNNY7n3ba>mI}sm1V`JkY$8kOrkp;GG zTYne-_^EcvODd10IGT)T0ca6uF}Ab=LqIlYKPufA-xBV`2MyWW z71q+;q3COid-;(8v6qRNBuzW4O>(9+UEEEXd_KcDvY zc2=%jNlQx$D^{#v_3G6K%V|4*o_O44aPTfgg?aqad5xFWti$oGA$jl9vCC&kOodHNO_Y_D5eNkEJdbtj*3sA3M@>x)*RNj(;JfeJ_$6Az zZ{5|LZF`J!7Z%YGUBRHc224Q)Ym5S4HGM?e^>!W)PUFijK0!Pol{1~bScJ2!CwaR1 zd3NvKjjFP0)vAmtwY9Y)`rzQfgX8vyh>pM;K|n+}eB=!lR+i&RFK(XTy2|{DMa=3? za_GI+dGBBwot>Qw4i07#KMauBLRB2cp}f3&Ov6q{Ae~Op-+u!`hVigvoqD0+wY{S`s4q>u)Tqtj6#61K_%8e!6slSu^u7#-g*clcAxZ zG2oL`{-+3t2-~+E<(-{%eDn2b{#a`$DlBLFwhvKNDk>@-eHVyKI5!~yRi&(SA@4S} zJ~HuSl0Ry0gzBRe*tv5js!Bsc1G{$ZLPRoSI2V07Y#14lR9cuB{L9Zm92 zDNt8ehlr3!B-pTF1Ic8PjT<)t(A(QfeSJNBeSK`+yqST40YrrQ`g#(H1e-Q(!nSSV z@i^<(uO~Y@drajMDlkms;>C*?V@M`F-W3)Wj))6|LK(0vTee`^_Hdz^A>jA>f9&e&swyolHO5TompURsG#XXQ zvf6=M9}sMAZhkGDP9Fj0F~$E1fV!^Rb>hT{w}IIPuz|b>J_E=GvZe?;#r*=4z#X9H w;c9Kb;r_NbQ$)Z6Tp;~`%-E~(fBVnb?@!n4x%5A|9{>OV07*qoM6N<$f))6TnE(I) literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/tango/document-new.png b/posterita/posterita/web/images/tango/document-new.png new file mode 100644 index 0000000000000000000000000000000000000000..e6d64bb90b32dfec83232de6478afc1a6b335b8f GIT binary patch literal 1008 zcmV9&7>1-t%; zZoBM??ke>U^dD4er7kL=hDJeZLn7jm5(v08gqI)OnbXC!k+JW?xKusTXl69mbH4MM z@xcEq@?UJK$`~hw1@dkN7mNd7!v<|zXR5g`LOT&)eSQ72TrT&mh?I;m7-R6>>yxk%nY!jFra=|`UYN$jJFw$o6!Q~hf9-+XQxm0cZ zJOI$ON<^+(?>q^>$`OG*B(MkM>^|0nAkF)!0Ktc~6Mw%ewATx-0 z2=>Fy#)6oaAmto-RYqh2Z%eTNabbvae=k5%Xre;9nY`Cxo3Q|K&2t~+0bbw5`9+*Bg4+i7q|>%JJZgfrw$XMK(PuKxMWP1) zmY0{W>pwdb1w8NJv=RMSizu_;qj``kQ{8>c()+Ea(0)p>xdkyNp>qyZjjXz5Nh%eb zJ_06CKaG(SAOf&5#fzQa`ScU_6UFA1NR%C^9_W{0asp;?Orsp*IYRUtB#$=>{POGf z$mGS7-aUt|f-L1XOD{mFpjwHh3d#hRje(RK4xrbrCP4qK*Ol9z4QaP$ zB0w01u}ZUm;sE+(Xb;3G&N>H11xP%I05&!@FlI1uh6OanWah@e?qL{S$7*F|CG}!T zQk>+WI7tmb|J9u4iTE=iTT(+XjMA*NEST6TNGiioz`DnJl8oemyOdkq1z9qR=SBkP zt&A)XRZRu!2Phk3PF1yBE|(FB-UUGr{Oh~`$mjECz&vmawE6)`KxJ=l@5|NI)h|Rk zFN(X9=I-w9SHJ>bfdjzz`fv=G1MUG+ow>a$ literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/tango/document-open.png b/posterita/posterita/web/images/tango/document-open.png new file mode 100644 index 0000000000000000000000000000000000000000..2b135a17f38a902e5d1ec32560e0ebce2f031bfa GIT binary patch literal 1437 zcmV;O1!DS%P)p)cZOpP!@x96Ow$ym zX<}Ixz1A=cgb*f>+l%SP_u5;xZV3QuUv)x!F*!NO{rmTeX_}(720&}wzk3+&8-{^x z+nMot{_EGT_iYxy)vH%Oi{tob<3xmEI4CI7z7B(edXQ40l#&?%aU7qyapMN9Rx6W% z)|%V5Zv)V5HhJ*i!5a~e!-*3oIDPsw?RFc(F#L=F%d&Q=)oS_KvuBx?f*|17v16oZ z3c!U67l83IG46TT76bwHdL1D|JtM#{jAp4+D$mZ&W(0Vi$Kv85VHo0h9uFTrJaFdc z&!5i-saC7Rar}>r03k%J)oT5?*=%NBURzt^%9Sg$S}o!@W^r-xwOI~753ixs)zwb7 z+x=TcfRu7Gm&;Kumr+UqkR%DN>oPw-&(hKo&!0cX_xq(gFixI4iEZ0dDitZE91&1; z97lVeC!#1qYt6>S1{W`0q|s>5>2#QxnPFyT=D>CDwMmjttJR3(*tv7(&XbG)px*6v zlll4iT)W){;L)Q;T)TFSm6a7-*QL|xym7X+Z8JAFHzH(tc{vQj@T0+43qUDVcN`}X zLgZZ6#q&I-r>9BNwEt-q3WWo${vZf4wj@b-`t)fmgt$8*0C?&9zB+a46k2O4l?sbgvneuYo8^`Q4q*Hu?fQ&&wY^e3;G6O^zQwj_>=lLika6nr1sXK@^d?LaV7D&PfahEM}qgWB7Gl-4Np zUVqo8RWD|*uXm+MrO8y3ynaaN!y@7=gtzxlAk|az`O(BG!;cKRUP@o;AV+k_^ z!-T!7zjHz=HDQu6kuzCYYYKt-yuTeAhOzB9PTBW;Y}-aDh0~Ty6>_w?397dhkDcD$ zHvQ`IBvO&2isFPt(+!E@B>v*=uUCzM_?l%|1VKQtSj03fntn=Q!X}K>*y&UQ+3jXc z|GDRrQqxT&ajMWjA#bu)a}lQTISd>~wAP#3+uKMf5kj!#E6Rt8bQ6t~Y9zyPi*GPS zD&4;ak+V#yo7)|gs6S=|q-nY;rPP*Xi71L#b7Bt9zC}As`q}jeRc{@ry;={Jqd!BV z5MuXSw_e*ZQ)zrMJOeLVtyYw#>BP;OH}PhF%DZRI6GW0!?M|iC8m-0;{wByM_$Tz%gdn=oMg#ZHRUf9l!# z0!-6v_`Wam`8;)3VoqAb7zFWm{{Zy(f%hfeGYB9~H0v*%Zld%bMg$~D^3wA>Yi@3i zns|q~@*M4MijqU0-zzBfs3`*>1TDuSiDm1nyTAH!M8M<6kHe!!kLJIwPY{~3EF3D) zjpgV_ui_a)n)Pd{YqhYmz40ON7SPTJSYBR^78VwsH1xtxNHvfD`R%^s2ZNAW2xRR4 z>*>eu{{_hPJp)mtd_G?;&HnHmF?nbvP2$|>KnI7?I*sDgM=2R>RqB8PYyxsv06-on r0h55ue-9~;04~ts^=tWi{O|B@U?oS4YH>IQPh+aB~gKj zgitC%r2tiV^-CWhXw}k6i5eC701|wNA~k|Ugp^jsRIMnGmWJ{QH7RW%F$G(G#@>f_ z);lxz-hS}fv3a;Wl78utj&x_QX3p>Y@0oLU;Q!sU+ih&$zI}Htms#ic=LhrI@O(XewqWtr zMp`;Dyts53@1HtJ%heXz+uMiTvMemix_bp)dF2=LYra%7Hx{d5*|tCM(zDZ;^I!!9 zrj92hWr0E}f+b9skNCQe}b z#0WwPgp^1rQBoj;hoK~o)>ZQA{tuY?;6q&brP|$+jyR$q{!lWM-M)KA;R-+%G&e1y8{3%?RsumS)oBk zuT5335Wl5^uA>3A?O|FLq46bT9Yw$GB85vTnFJu4&7x_aHCWRe<4wOcfci_;9(duY zM?#$cS37>grNn3AGr>S$nHrvitgC40$PgLlBUI+2tE&s8prfN>FpWG!d3pJr1FTuI zW_EX1?}Fxw&8&F#8CJe}f^a}19`WNh6+S~zV1O$%`fS1B_uKf%@;a_wy-F&T;>wlF zghJub0rCp0UcFjbrrDWuoUiQNyZ6JP{oy{kZrwVc&*wY2=|`I)*RNlrq&UFyPt~#O z&_#L@HkR(8q)Trq%Y~K{e>~sK*5%WAcwz? zwzihS!a~B~aOtU2r^J~vXHLL~alCfz+P)n-c8nW3yG*8^!$%qcnA0$a^2h|Nf&zpm z=u7nS!G&`iJ$jVMwNr>z#qm6k&dyFO%i_w%m+|?1tY5nUzu!N)!jxkD`gNIIyLK0k zssYz^$0?;~Z*Rl0ELvOJsGIsQLU^1#cb1O!cI>Q;X_y280pjsEE55ao0|(#6&e}|x zIGIQ!LQhW*wUZ{()zirjH+`R#FMXTR;$l*%G_L0|eR@4Y$iOX&PzXUXnWU;R%D}(? zWu+wq0zrb~Lr5u+QXqvyr%*m2!takX zv3k`SIy$=;$l5r$+$cpxwPMfnXly);ZD)vt!)Tg@5FVcA;y5{Sxf}zz0kTx_O&MqWrMsjRHzr$5_9E|)_o zHQ4`^8g%(t_CpGcbcN)=!2>K=vVH+2xe852M-d-g15&6V@LnQ{{8!iR#mZV=~4nkf#F2lu>gb+ z!)r~`Fbo}Cw}vO%kP337B1#Qj=hx+tauzLIc+>Ag=D6{NO-b*D0tqRK5RVl&IM^P8!#r;a#-kaVhZmEi$R{27-gD2K z^XWVH-WkLH9nxJ3>+9=37=|$mMB1$3s;c_q($doF+ZN@!o-$2yc5!jB-Qoa|jg5_2 z;Qa^)AtC^0XJ>6y@9XRHbG;XVAdZiZZ}r=@O{r8OolYZ3;cgBN4z@(_K>~`RFfuZ7 zYw_LPT@1s(wrxg7M_VfRC;~@EM*s*ReE;d`DOXol02B%Z01}CWzdkfH^fUxyS#DBb ze}CUEUdQ?QIhjm`cs%a=f`lJUKv5J94-fr$sZ`?RG8q7h#Uguqdw0efhJmi@OioU=RJ>&Z2L}iKJe$n|kk99vVyC92P!uKPvu(RQ z0=lk~PN)5O<8ce(`uZB%wnH(pe1D01S54FOFQQ;lNs@deg8pK$*hI9qx3_fy^Yil` zb#!$6V%v5Pz{SPItx1Du^fk`w3e3&T2}PC*hG~Ahxw+|YBtLp#VL_E;`S<1J<$+`} z$=cc)V`F1ftJS8&w;iv$h;(&zkLe@mrOFIHAo?2rPIBz-Y6Gt-+) zCILvLQvL$)wO<2a8p+qT7< zH?J@2b$taa%Ss9%I6Zxbq9~l4yhGD8QmGU|2yRptAOx-ufIzq)xM_#DncS?2M!!JU zt5~+h`1k~l<90O>0B{_KN~OZ!vmqSEq5FdbvCdc^qMn?v4+w9I#yG)Q;Sa9=s$m*N z=;_dV+HoA-zWo*3ws=9>dIqqwvjc!>nIQsA z3iS8)^W|4xV_8-xu)fD1e!Vn9Q50Ujd~rj-yoZ46I!sJt$!5n9Lg2ct*Z;uSb#XnP z@O*A7WAE2$Akfr;e;Q_kvj0AT|5|~@7S#8E8i_>AYE_TMVzEHqz4IO%yTNlGwPa)1<2mOT}^Yqi??da=HBT_V)I7z@I>&e!Ml0Q8y6tNIk{Bq980Urv+RB=Rl?L1+M^6Kz-uk j0FGxCVDh*-?dkD1XA7znF`Ov6&>(Gu>U)dl9?n>GWhWaqsrPp}NjMeP4a&oT?i5 zznhc;_wV2T-S_^6Jj8>~fk|c{$31nI37R$XjKMjFN@k#>L+DbqXVQXs(V@&0O zRWYqKola*W_*4Q#a1r6kl`EA>Od?RWT-~Vzs?s1Lynp{5V@xIBBn7(N?ra2#0OdO9 zbUI_Z55tgGuU=uTWnp1~^XJdgZnuvu##0f<=Vb-bG$o26(lli-7_hUm!`9Xo&1Mr3 zL2J$G>gwqUJb(V28#ivadAHj=lK*bE%j3t7iJ}Ol6iJeB?%X-r?e?!J0C4;EZP))I z!n=3xDr=zGZ1VBrN369NV|e}gHQ&E~$MZba*4AbxkYyPna-=0YoeoN=%Cq6~=g+`l z;fV;>u3b9kdnNUc^wDaG>gGS{zP|1|~5T`)H{M-)XEV|euF z5kU~3wPr9F5Jizw#ac@khP-(3f*=UEdiAQ?{fP-wN!4gHSXx@*;NXBHNr>Z^BuU)S zEF$>6kLP&=L4Yxa)z#IpVy#+Nl>=#-j?MGMl~P>3e3|@>pp?S%Jbd3L2m+^w=Xofl zh@yzi%}uvPuFi=RC;}IW^m;w!=jYko-E~KHF;&)Dr%D{hL{Y^2{5+Q~U7DQ$z>_CW zxOMB6o3E{{xi>->hD1?BtyZJeYB3lLc=qfWS(dp}_`XlS-)DP!n~N7O9s#c;kfy22 z)tx(ch~wBP@b>N7vFkV=d%Ye2XU?3V*XuDH4$)epwPs~yg?_(Z34W{s<%0-deSQ5% zd*%mI?qL|Rxw(nf+9{#6o}ECIy?OIytm=#8ir;xFYOT3&;lgYLiYX{tu0VO$RceG` z$hU9bT(_K%itkGyRT+e%+H?c0JnTSxY*8vEEU=LUUegLB~fjY4K_3PKa?%uuor-=M^ zD#Xb){PgM5-#{DCz&2ou8rFao&;%BL&L{WJjNlw@_5j!gz5x4B@#pj>@Z8UF`eXlO hW`Kl4*++oO=f7U1bolmc1l0fl002ovPDHLkV1h9_E3E(k literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/tango/document-save-as.png b/posterita/posterita/web/images/tango/document-save-as.png new file mode 100644 index 0000000000000000000000000000000000000000..5c9f6b343bdff4e1295342362486b2cc37387ecb GIT binary patch literal 1837 zcmV+|2h#Y7P)W5YejnogQRf&kAw6ru-H~|Vtq)@O46<|mV0o#}a z?Bi~Ix4Sdb57<}RkYbvk{-x2*>^*wschAiHH4Fb|i8}>Uu6VIt8?jCb(+DDnAZ3(3 zj1jMP@7wb3Jp(9P(pG5O?jNF&oH?^uKz#9J|QnC2i$pz7d-u^^Q*QNeL*9V;K*9TLtcVE65K6Ade@_~wyfE}>N zxQb-jqcA^0EE)=bcbCAthFs{B{S`oCF(q*mw)`19~~b3d&SaUK3P~4 z{q6ddb8@fW$lxoDF@}=DD8GB{aN?7}p}BXv6ms;yx{;n`gt_Qz_4xS70lNRT^^e!C z4gKkCcfYbNiRWuFo+dTq@wG2kL@msQyO|uuRiJ$N_Ep-5nul{w>^8={90&v!Se7*g za?pz~H0ePWHOA??mc&;#_d+Nr+5N^_d_C_B#+YopQc8KA_nPB4>-X*3ml+RWj~-}k zU6k7Yr`Gz{>(;GX*xcNVlro#p7(>#@@aX1OkP=*9qqX72kVi>jKGKe`bLUQsF{7Kc zYuBzP+S}XT2VVNG02xnToL%+t4RKA(Uc7iQe}21@@3p;oOWAB&B80&86j~d!G2{d+ zQfZeNtA8~n_8ar7dA4;K?d|QGfE|DtlWX*#|G@KCf|FK#tLd@F3N6c`entsD**KS1 z-sogu!&eB0f>=^uTM_}do<*i%hDKG}!>-dP?zN>uqn={GJ&!@Jwwps|W zaL=AS2R;*ESR0ovT}m>U#Pd9s)K}1d&0+7+fAQ!ewe$}R;iP>G24ik6i<9wr{opyA zj8D9}1m8__@^m-9`Tjz*@=2vqELyaPQ>RXS2N(k|W`nI-wd(%j;^KuD2#;|xRD{@ zxF~&dNlS}zsk|?b14lpL2W#V0-j|0l1|bB-7(CCTsi`R#2n06V7GS}G1-204>3BR& zGMU7-ZHzG}rSN?p<$L^e!)$_hobSHOLo=oj4BRx*yl9YzYD#$P=m#{|lU1G5qb#-->9UUEuZvhZO ze0#}~B_t9F0DRxa7?Vw6j6rKnz%u-NL!7hcFLG@l!HP#J>H4Ub#K0iWG*{!gE}rM% zc^Gap~2Q#Z-ikV5JIet$KxD1a)geK4t(Ed zqFNt^uFfNLb>2DFwr%R_>Zq@;XaD~FPXWIeF`_TUVlj>%KhBypYsksTnJ~cJD3i&s zd-rY{8XC}AKLG!6!W`Fi(ONTU(j*QZJUF3*^XJc}w6v6-o}LNChr?mC*7WuDW%o(e zibu*GjYhHU+d1^DibkVjo)guTD_64p>`Ws>xw*Ln0)Yu7%FWFk^PH$g=7Lc^F!~a4 zucegA_QzCU#4?+koByX|caq~cNGZouAPboNU1wGq1=d5(WSI$uvu4_fOpK*%00%@23%*zuB-vh1Gx^>I>4 zUFz@ee*p-N+=@fMWS{`Z1A@TBj>5#{a`Qtd4J3f8z}3;$asfn#TZr3yHGNL`!z~RY bhk^JvK%sGhfx2y<00000NkvXXu0mjf^huI9 literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/tango/document-save.png b/posterita/posterita/web/images/tango/document-save.png new file mode 100644 index 0000000000000000000000000000000000000000..db5c52b769e74c5ff883ed02dd4f96e604f2982d GIT binary patch literal 1971 zcmV;k2Tb^hP)PyKrkN=j13{7l$sh8kRr(E5NL&1 z>!1#!rDOlGGqnS){h%GE){$|>KiZj6XZnZJPIa)3EiIJ}(L#$lXqBKHAfN#Qq>Cn- z&Ayl2_ujp?e}sKa0!SU{^vs-j_v_vB+jGu6cOU$pMOFv+#AIiFq4h=gm^qo0he(dDAnKv}nMC^z~ z(Np9LKIv4PWTLG6z5b!=v%P7w7n6c*34cds7n=9Ua))@1PNF=hvvaAV^ z!+xC6Yi?xu;&uiG^8{)v7s{fNXJ34oFH|1G7!$5nN-5v>pLbpN-aUKv6ek1N<2zbg zr=<@5p|$?mrcIlcc6N3mr3^PT#*lZ5+_vRuqy#U}Xl)o7^{GjxkanD%J9lD?8L!qe z&pdNycX#(2z!M(}Q1tcb`Ar{;h(R%b#flaD;gue~`Q%F%xy`mELI^xxp|wF9Lo8z9 z6g*~cd}_klFMY9@hq_kN-QE2Fumdm?_8Q;G?0e*2(Q7t*b=mE=r!C8(V|ESSzkd-= zzu3dlg`cIoEQ%!swj~jO=WDbvXl*b8wryFBlmcVm^~3LTZs0uM`0`v*sT6H(ZOuZ6 zrMq_R+ILxi3v&OeRjbJ7^Z35c%8o`dgD$%d{*&8oX(N*z#VrIF491Lw#VrQB@YfT# z#enwa8UnAtk)wV5{98-WD!_3ZmM>qKJC_@qt9kXUV@$0oM;SvlUu57Thxg77bLM=WY`#cSZHh7*{{H4M9(!;x=~Nsk zC8MLGG&eU>QBkpe-MV!(mjw_)Jg{-&M&Y_{sgKqgr4$d}-NCd}j91?}K{{DRcBDwo z^-y{&q_x!*%)G9WeFxv++jqA!^SVlmF$f_r#^C!t%a$#RMk0~Tmjqa{WQi?=xUapv zoqRrzZQB@QP)ZR50V?qM!RGly@j2OdhMQ(jBN`biq?L&%H?`F8^1*lLTrh)PE z!qX$A#C2UdIywNhY~Q|JUIdU%r`If6w5T=`iBKpMkWvx^0iNekEEXvii)a<_=mR&C z%MNpP;3MYGo<_VZ!mV@bdF}09>Z@biaqEn5z2|uZL4a-Bc%DZxnPkqKIWrF*KD^>0 z03pQJR<2x0E|&u!2m*{T;U>lywAMr{!;dz%bNu9K2D3TV-ZGQk_s@~b4)b7VGoI(+ z`#!$!69fTLN|aJ)t#MtK#fukXS=N>b0PEJRtF5lCUe(ahfa5qQrO4;=0F;-Phs8)K zg;I*ja>)I7TwnnTagQ*8Z8 z8&j(iM59sS@i@t3l4LT8=Xp4egOm~}C6P!3r4$PnF0{4Q_rrxcAcVNPy}cdRb*Zhb zC7aDMGBSb?f*=UOwq;o)lSyFg{NJ2T^ShrkP*H9pr9^9u)_N>ov<}~qQj$ugsIIQ2 zzrUZ3jt=(j-Fpx4<5D5|Ofs2dWMqW1XV0RwM#{1Duq-PysI?CBq12Dr;QRgr&&6Uf zg!s=rXN)1A&*L}_T5G0EnS$2(hR_2*%=0{K+YVnGe*u-AC8*2IkDn{)__!Lx;nJhw6?b5c^)k-Effj`nwy((9EYZ+ zCUUtPsZ^?T)QKKi3?iBCBB+Ir34qW0OT(K@o!k3U4Q?i+IRo}002ovPDHLk FV1jL*$BzI2 literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/tango/edit-clear.png b/posterita/posterita/web/images/tango/edit-clear.png new file mode 100644 index 0000000000000000000000000000000000000000..5542948bca68a69ee870e7a52d03116319dde91d GIT binary patch literal 1682 zcmV;D25tF?P)=WF&{CV_9@n0EH~>m$0VH$B=#W-b8Il^pX+x7^ugKXTx^D5^$D zMUAwuzHwpT!~Ry#e=`>Vv2b7*rdN&zvAD{3@TrT)(J|^9*E1;?j4U?T}A}A5d;j1y_L4G z|MJo|&zdjHDd4R>f}d$JgbDxo)lC~)t*KBS+2|0Zi z(FWtElcAAw7fv41N*1p}Q!>cG0TxtM*_;mH2k-vY{`}uNFgrW1#Lu>b=}!K9J2e)I zrN8C&jczkDPC6dKRv}_5nP5S~dL=UQ4~vmbF1ceD!*c=v_~nC^2dob3OE=%Tu*hB- z#67Qu`W3A}8LzZ|U%7BNmQYo*eINW`P5`~HurwnJ$BVq)%7&F+z+1756R-C0#-5|p zIg40eh#Uz7WDRQfLv*$PX}Xg=9em3$#Ag=XbfaFm=r)3VVfOES4Jl#L-m)66DB|<^ zaD>BRTGv~EKhG90Z34#*uu(KPA_&#S`yHBn z>R|>9N_kA1^{5-S2J-#RYB8abafIzNMdL?vZ*vmR>#yc6nX2J9C@2;qDQD- z{kW&d-SE!wm-*r~0}O!=(}_q{)9j>@2@o=*6G2MKi-`n+xIA8xF%5(W?uuq6hK~{t zbyBx-x2vRj^9#KPc(Jz==d1w&{3|1ebwluwk`ow)LLxejMN%j#aT6Z(;qp`?M^c#D zC}lNkiTeJ@*x-H^-t>T@`qpo@idyl=@ea1m3UJ2|16ocNG&My|wV~vaC`yiGJW6R* z9f=7UiOe%Vjd5c#ej|r%m zFfPv;iYu0*XXCk`ufJo{Lp<5vj}veLHbA(V1gwCqyBGhq&FNj9$_BS#cu|$hSRHl9 z69F6^4^B@lp~2IXRX5=9G!q@YOe%g}30-tG3-!#G71UZu_0RR9107*qoM6N<$f|8{*)Bpeg literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/tango/edit-copy.png b/posterita/posterita/web/images/tango/edit-copy.png new file mode 100644 index 0000000000000000000000000000000000000000..3348ee08fd8fcefa1b65a454e1ca6126267216f4 GIT binary patch literal 723 zcmV;^0xbQBP)LE$lq)T3AJjC7XEIa$68}xyYnVs4B|K|TZ zv)KUuI0yi?wwf26;b<|-g-z4=S+6zj#?8|Kz!{DfuQaY^sgI53`a+Um|ym8$`fH^ZGT_xM3LY>$S$|P=HpeCG`(` zy@kuG*%s;Mjr9tkaA0X^N$S7cc>y4sA|)ae3I(tKe->dd1zCjR6?5$Q2Yqpj0YB*JVj%3Zl+*(4i>dAVjPKoO6`RW$D_^?slwToN(B9C_oShT3-T4BA!GrZhjZdu$ZP9ml^jJGXbYcjr6fw@v(r4VYq#0HI(2_~?g@7cB8Fk&x9!=}gY_lG8mz1Mcv z*Vdb+^<$MewN0BgMaGMx<2BUQ)@E|SH>IVf#XMf;t5Zo{Q}fzffL5fWq{alS7bl7x z7r>^{cNdl{R9CHBZ3oB?ckbF*IGN;9N}}4GdlxVIs(tm!uh|t!w@%defdDl%I~Lni z+kzPdGnteGixw`jJ8bIPlL4sPU9;Zf@#N=Z=TIReN=r*MCsS*u1OQ6sWo1rRIOmX3 zA~*M8>To#b)b9G(GZQ7>xpQX@|AAGFd?NxdU__6QkF~!Kmg}IZ@;2QNC1Fo zT3A)K(xnjkhX0rTgz?0jn)=3^uN0|_*&w9^r4(n*Hbpq+C#M8Zy`}m%Ka{z#@2hrKtrR$;Sx+wtwfF6vz*45n= z3I=b15CYBxN**nBQi^qTbw4d08{5#(U{e+QpUal5&`i?;0H~@BjYk@FZd&UnD&cVf z{CL!?!-sTL9UW4`F!9*pr4GfWzAdFB@z_vkxH2^@HQDEz1|b9pA-H_G&59Y( zQ(L!I?;kJ6ga80gx%uUf48v$@yWDCKLLeoOk`Zcjm7UClZGsH@wa2a3w2k1cl@ zh5;!h6osJaY?EO`_zx!1|3Ux&h()dEPM>Kq7-Nu9A{L8bMcFDhW#kw2^?o0-IsaH% zvPd<}(XZZax8sw4AJwTuO;uIZ)h`WDRaMn4rPy=)#IbOEDhQ#NJ-bNdQu{!4*h_MA z@>qQ6hi?rb5C{yq-M$BYtWyR6fY3;Edv{M~Fcb;`04&SGyt(rnib9u{EGTtFA`wU_ zp=lZpA8FJr!~9-FMTPl)1MvI(QPZ-XYdmsD*E9`MN<<=2EL&Pe&Yk}ZLI^O%aH08} z!3F=e+$FfpWonDs<5}x@wY2CK=iAp<)?KHgyUOrgpqx_r>Vm>T zS7(2J_+oo|*Uez?`-%`r5pGsrYHvqcQWB&o63PJ%02>Do3Nf*)V<-U2MsT&OcO({z zt>LCwcztlN@;}YZH?Q^eMHd$ryBMY0{-P*PKM-Ia;3bs)u6V`_t)sU$JTx+L$}7Z- z?*jYFfru*b_ed-jxxFdfRXsl%!iX&*xy$8(VVaBpXVw6{&jN2MLge)Z0&Q2ix?&}B z=C~N}+kL>a`v5FTE0Plv835e4c{AkY{E2S>v3R=xmiXLmGpOrejCI^QbxdI$F2xRy zrda}57Jpt2+){*C+8YQ&34pBBRGUTVhWh{%O4m(KNzu9o2Ets39b=O>0GgsGug}cM zN$BkBiwe&7-U}c&-`myK7tPJcNKh!<-2iA~Aq4RHwZ6V+ZdR7l#@L-B+8qGSd7j(l zf*uYV0M3q0?q%%bjFc3ws;cM?1WZGS-`oqJ2=VKlK)_U06-ho{Qi7r!919_YXbS3j z)a&uUw5;6w06>TZ0B)yKAwcm9K*H~VwH`%j&qz*wWKKbW^W?d6`Vg>b9UuWD0Z5K} zIY4d@^5SQ0ZTigYY)7)s_lTR)js{@uGe82Nbb(vbY?M+E;LdV=rwrd??8BKkIp3V- z^^#M~&AP?8lHhimg}J#NhpOV_`SaoHoHx8+S#RA2r?|U}B>=I9u?<<2R?MF@ON*K& z+IxC}L0wlFV`9a^h0fuT5qY|$<-pU1@gx8q7htu(jBG{uv@kc<{ZM*3wK0Z~PzW8p zz0vMKfVW8L-!8<*0BjiDL*lMrv?Q&#S5vyO2-udHnyTbwW;&95J^(;Zf4}%|YiqF0 zvL1g0Xa!)7eFIt#6sIw^8>4?Rlu+6?#QFaBh1h!p2;NQ>cQVH180P@^62MbV>9fg< zJq6A)2p|NdXS+=ErLDlZ+pu!Hy&x`3?@3A@;K1md$}v}d`#wH0Vocjz_CHHMd&M+J RSE&F1002ovPDHLkV1jK^+$sP7 literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/tango/edit-delete.png b/posterita/posterita/web/images/tango/edit-delete.png new file mode 100644 index 0000000000000000000000000000000000000000..9becb3e2f3346b028b6349ccbd3d1d0c633b2d06 GIT binary patch literal 2049 zcmV+c2>$npP)CFvO5sLT z+8qDmpZs8KyVws97(aT<12FLL5h7+ryWIveUro9dnay*|3?c#%q0wlp<=q2dX6nRa z#kK?{?t9{UAbMO1Q54qs%nWNSW@l%SW!bg_wj$$s9!5q+uHGx9PdjIeiTj>-^xPjG z{n=VPtp$u9JvJtUICs}Qhkb1f_V-WXp$8vCr_;Hrz_mKvPKjo-iC;YZb4*5GM0dG^ z)2CkVvvXrpCm!o;R^Y+m(NPywd}M_~9LH$2TIh5-Xti2b71-RVF$T?M^O{=|$9*6I zsALqlk{T3-k7QQuMQ(jzw-+A%YVW%2JGB5CBGh|l(5#~)Z#Ae zz3X0dmpgd()Eh15?C8{q$4UhN<42Dj@_nzlb94xoS_z7*j~6DF01$)_00<-mKm-B- zBvxc60&RJ{c}^nI9mqVvU}FG5CGg{J?<)X)qX0k%@wMA-o$#$=Fo2uyID(t+IP#%7 zUxVp)aQll-W8bSMftP-Xb9a9k{f~YjI`!`4!xMXlRW~Va_{?7qUe?1Wq8Jm8 zd=qdE)i>V3LbHZb;JxEVkBuk*aO|pvEEX49=q1JVa^glPEmn}-A%sv;N^7kJvsFs5R$4N%bIw^o z0!k^Vq@pOQc!3{y))oc8$y!~pPLw3>#knztjHh#LbS{O25X3?VCxmcdw!BhE3Ms4* z!ZKi`6p%_f5@Z=%3L!`-?UdFf5f#;1)UVg;WmpMaS(ZIOe~`fO0;iNJjn>xp1L1j|)k<5XRN;9Z`M%FaYb%v1j4_$# zdCnMvEYD)+T)LG4D2k$^lqS!pTq~8=sx>n@IyR`aF2W$>FbqM0`o8bGdcCf~Ah1%( ztX8WTV@w%UBhpIcVHjetG3YaMUn`XbzMlrZ&qf>c`~8G@>n%W%COxGjYZH_pQ8pTl zaA~PMU9Z(trBcC;9m9hcrl-#MzK_O0LkB_Nj4=ffx?vEyTCJ|M)`e0k8yXslN?Wu& z&$Gt!tkT*lt*9TzedpZP1cVT&b1n-4k9Lji8jhk!y?f^LoAr9#YYYxnwbtcwuY0j5 z^7k8!!6*zv_I#i7Ja7Af?LNSKdFfd-u-enVHL{gCM9WrED04UXmuQJj*+k zN~I#DEVWi}&LvAri!)&uR_e8Zrj*hurKr2yNlu|-pMA?Yr}8|PNz(7n&(FPo;o|i4;^M-*vsU$!Bwy|> z_oS4?pH4jYYhzSPO2GhBx7&-?*W6&qO3QIk;ITblGG4jg%liBDmJP{vqM9T`l`fg zvEA-$PoOO0JTG$NX+1JBe086y)oKBtw|4LQzP;s^1Iqy5oFgFw1Hiz*Kn|dfO^`|{ zV8yqkY0_K2ws8xkH z=lS;k4L5*FrBbN^swj(`*lkZBP1B;iuwZwNj5VF(z09Nu0Ei$60D+hZwBpS`V1NXz zjBA5f6`P5Oz)X~;d6?xz)p3toi)}+hRc7vPAV5U&z<~q&)~>zz;ZJ>f)bqWlD2i3T zy%xor&B)5fA6uA|b#$Gq=|(V9uUB+n?A!K6n27Z#rH0rp8VJ3+W^`CE-`aP>rE)F{Nnfks#rN8*Efj&J%ZJI fJpc(aI{^3(h~l=|a*{^800000NkvXXu0mjfXRP5w literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/tango/edit-find-replace.png b/posterita/posterita/web/images/tango/edit-find-replace.png new file mode 100644 index 0000000000000000000000000000000000000000..0f1b117ff791666419bc589726ef043d30a2664e GIT binary patch literal 2104 zcmV-82*>w{P)Stz+8LL@I&?aY{^5+Yag<6sg41zCtwU!hHUmu62t*{?GlYb^ycY<0$;O+F=+*mLy4>K7ATVk}ypZx7$rT9>+g8Krk2}JRZg{ zbnJFJIXStMl`bPECl^V&Oi%!X5ai_KpzC_p6#;}0=l_i)rF>{8$j7Z8QC(Bb_Zu6@ z%JiTrDw?hl3XRbE=_hpgI$2rYfXn5+3}7y>Sph7|ngI|T3eeTv!H@6%39{;B&w(!X zANz>maE#LY4DPzAhz)l%F&G%&gAd-PeEA9-4hH~=qOfe)vN?la5g-WxGEa8)_Kd0-`qEHNC8bMUyIzZ}@d&L?i8v2iUeEiK&Hv~kw2zM$^KCeH?N z;la+%c5c4;79t73b8jB!`7I5sxvqfh3_C8ngx6zdLqjoj6}de8Vhcq@CD@&I4jn#( z&*$Uh$&)E1uNuHK%~U%W^s}sNIWPR}1P|X)Ly6aeJIz6w!%mvRfh)~Py4yu*VK#+% z^V$FDDb}oBLpVIjiWMs;FE9V^0m9>9JXu*xMH6%lj8p2(B$m*KC6Z{GhNdOalX0e} zr&)MS#n4Af4=u#-dbJRb3YBYXR6D4&sS8s%#R8X^c)K5T=fVg(L*A zc$~ALapFlGQ%DR?Xrw!3!r>4I=Dh>I8?C97Lp`!YB))I?-;K<{w@Bz^Ho-qSJTnafvT!xd(wFG#Vs_h`xPtj zz`lJf{HPUso+yAhlCZO@gMYPrNOe^WX-+3)ML9fke+>tY1_+J|+?m7K0^3(Gj>a$$Vm}X9HHjBK4ghHbTA*j3lT8au6qu8A6Ind4iV`n%Uj!~AM!4Db=Xu7qMuC5N6 zUv1{jrj58=Zu(CAlVJNh+tPD%&^!4{qS64?(%{46WEI?6Jw4_FGXpndI?nO%`+5F(c zWM*dak3GL9)U%(p-&=(~6(BPFITK+UNBZ0Z!ac9&-7x*=wryA`1-5VB?v+)sfAQkt zYKJY2zP>&bMWLjmglKFEUDx@}>hIEjx{r>|b^?I_kw^rm)5+4(G8$Gkuw+RomT9p2 zytS`whUzMSqVmdhb#>Lkk~n(g7#@#@{QP`E z;StgtPHy`4tt1i&qLCOy1;s2bEJ2oKBuPS16waL+VJJArC+|Mb^%YrESJe|abCkqn z5MLm{7omCF_t*}edj93v*8w5Kn&r!v6OBiRMk|mciNT;BRaU9HrjB?#j;`zE=H>$D z3zf}g!)CJ~%QCU)QQmF-Ew|T~P*AXlslk7fh>UT(KgpSRHjg~J8*kxKU=9Fe4)yo< zuU}GHN|q;+_VyE0SJjg5T|_({N0wz2MWMI17sD`66eacb(_?;ohyKLfjW?2+;bd~) zAdyIfW2bZ`C}8U!-pA=mzbxodXBfyb>uZ3*ti;-h%z~Fi11XBwgCxG@oFC3`bT70nRN-C0r2FL+k!w7 zz@|-`L|$$l;cys9l2BC@m&=7|n)rM^Ow&Y?Bq9?de6n{to9=7Gm<%vAe1hPpM%#c) zVeNXV8t$XBvy0l=+A9NGY=&XXIiRw#GNr)l+wWz=JsU}{yoIqNuW@oHLD#U0rbk|& zwtg*ezW4|szTTGX!csh&b$54TnkHulPM{hga`Ow&Cj5NipW^c&H>>V_j+z@9=N$iy z0V*pi5yGNn_pe#CZW9OJ+f83!isjed&J!=aL3-wbuax^60|4yZ`3(K1dSKrk>TiFD z`XAkfWeG+`CpZ@xPbKJuX==0CQh9VW02#6@PYEG1GBPq!=K@t#5kg>^2JUnZzkBs# zvb`lUPC}RNrWHj&RaF#4K~WTBS;lU+PXl?tIFN*y#V8%fsjsiUySTXcSxJ)8u2RLT zwM1`k?+a~hZSMgiz*)e$7{CGK01JSuFYlHARdCL$9R`5S%ss90euKkcGS-)fe0000%I@_UxOQru7OTDilRQ zQ4}o8!m=!+l$fSjv|VpZ2(hH=`qz4Ud;1{ld`fhbX`Y?hk_NhIXT56 zf&yUMHo;&J!!QEt0@${ln=I@3{igvaHC`0JvaF&3g%FI7k7Jr<(Fu!aGh=Y#D?QjE#+9nr6{}r4$HEDqI36I zT3SR(iK3{Kmz7glSw&5CEsCPxa5&hyb?cJ@*tU%j;*pXJhr^^&%Uu84HC!$iUq1L6 zwY5QdAv&~6XiW_b8B4jq1jmgZLa|2jh7 z`=2r~vq*iFmxFs6Ir(ZQ&+pjDZ-4h2ni^Z!|KdxJRX`~PP*?>*2&V7ep}YHaeEwRF zy!R*mb>HBdZ*}m??{)K?x4%Tjc5>{@6{eyoPM-J*lT#Bcr-^x^jFT2SK04f!&Rq>fXk8-~X7!w8g%CFY?JJg9st8ZF}PY z#iSaW80CfCd-&j^5q7q3qH}u_s>6Y*s%Q=ePEEt@a#2(1=fK_&KfN@>wyoQlm>fq+ zx$z~)zMQqJ3bWBD-ZC%!H)hxw3L;GlLt5z4L|PVLqX?T7L()`R!R^ThET=P61_I2@ z&y`$)bvL4{W%LZXo?&`^2~*FoluV&(3Jyg859R&O{TK@iNeoNi(FAwyE#Pu{Fm$~n zK*<~cxOwv?it_LkO><&MgJ8hRq7JI&#GyHHx?Q;49!%jNP+3XaGmSKDswX4CwhR^% z37k&nBY{gQAf?Q$RaaLR`YL^WT|Md43NJqw;N#nOP-U8Ow~7N3VH>EzMp}?D1=9-# z)#V!1eiw6dbJW$JAp-D175*xM^$oPPwh<16*s`Ua zs$c`xM;`F4H$zNKO_4|>n4OJoT!B&>(WZt?+_-U#`MD_PzP+D!e*7UL6Ei&D>Z7_s z#V{;J@1?l;&j-Bs_HH6=HH?iV=-AUq&$%8BA9`bB3gj@A@h!6iVKq5BFuh@_z{JEDiP#e9bcPqcu!sKs%V-h2G_WASYiN#_FA&^qy^?ET)laY}TR#wuC|9gz8sw%qnb`h+tLvuPYrAaLQfKNZW z#lXM-;ZTI8#ulWMM59qOO=EmwjL-iu{0A)Mza?GQNu^ROFE5i!CP^d` zBoYbY@i?heilax~VsqQG{Q1fsu`H9O=0;jJH`3YJ3GfQ6t%3@mc6xgHN2gAm`o0jt zQ~2fC3v2dZDfXPNM%Gn_!lk}T96NT5R(A`7gM(PMeHBpibHD`zfodSI+E)u0)I3*K zUCnDnp4))6>gl#;+gf*Q-+sd7c1A4A{3s+x20000Z-HRJl7>A$v%EzX&*$-%mc%!W(R|T(17YYk5UI?o~uY^Sc z{sFpTE%*lrx*!UrA}AEu3%wCVtWZ`#Dz13P!~hpxIKI(U z@|uV?l$G82XIWV}i(w2N?eEt^ZEQR5*Il>A*47OcYuC^sQ`C^2p=s}LeEshQ2w2cn zte;<6Frpm*F8>aN!sFEIduWFZGMP+&z(@y8)0mx|L*xdlXYyoIdgyt#C+1f_KUfFC z03!I}zgg#b=;i|5D&+I?hzKBv0EpLb=-$jszweLQOQiKQ09hI={_{Cc9=8zbTNwff z#zQy9#S3rw*X44VYV{7LX$3?*@W90(K&@88FbvjTeFNLJ0eENQZB(%7H~=r|^#=f~ ztUSZjt6M0g#x?gt*L9Yb&eCY?qm)ZNKi9{L={^LYWEgXGb(Q7iWtz=aA^-r>H2ifk zZtP(I1p|i$VcWK!&ZHqCA&U}O5Cb`N1VzL31ORcA+uPfZBwQ+$LZXQ>5a&~=R7xy9 zYW9f%rnO)o4CD5OIG|X7q!z@@G$>doJjU#-{U{a;H;P&iP4}qTM>FuhEg0u>IPKB; z=&=(m!b+tQ5*Zc@-h*PX7=rM2(5Wr(X4ik6CNH+Q*^9^kAckO~1(Sv2AwoOgAwV(< z0v`--kf;UGfo$8RP$)!T`ey^f80_m)Z$zG8u~=gA?8CD*48t$pp=GMKAbR*nDy-|e zFKn77ylP1EF~Pd*Hdm$FhgU1#X%HW5H6HD+NA`y5R7 z^UuBL3p!4R?|=9Xr_)IWAU=Q_D>%w$uZV~*UfZj2^Ov7!HCv=oR?-ag1zcB+6ps4r z)g8wnolc{a;&$aWf8G5P=b(d~J4UD5nQjdzrO0MyhE6q_rlIS4sCcj1y}$3$>2&z^ z+BdY@ZB*A~etwRHg++Gm?h?rGdBWnPd=dPJ9Zl#!DMQ;4&``h$VAlgkA9U2mU*6n%1+HR%3`p(HB`no_vu~6N}ZlRFC*?c+Y%$zyD-}&au z&JZ)>K^AeZ6L@^ummZ&X*Yn)70D$d6!LJ^l=6+BDv~c!{RYJijk54Ok5CT{{e~oil z-TFEbX!ZECIrm*akb>H(dS&g?FP4)K%^sh&_`V4c2m&fb&2G#rtri=XzfzzG^{B_E zHQpZqA_x*72n38CJd|Gu&#E_aHK*$b&n|7-ZLgos|A5D*S!OO3tj^fh z_!0W`3$WRQ%?5InVvwcc=cez&6S48H4!ouBxMu;6Pg_j_`(_qbYqix+<`vH*0k)O-56 zud&1uzgHhmFx075FBE*UbpHBBSI%oxLe?+@Zf!Q;*6vT#lyW3w4JY9MkgFEMG%bvd zj938nr^2Tc@c6W~RmHXIm(1Ou1kFAG0Fw%UlRqSTi54)VcO>U1an?Yy3vuG~@rZ85 z-uG|Ozewj~6o}vV-Rqv(Ci;8JElAxFv;gud8$jGKcnWCQ?Erp*KC zIXKaBJYt&WcE4BOor#q#1Dk6q78K>?<|1J9K#&Rskgt}(!EXFJ*vh>lSE3{1Loyf| z&3UuoJ;5w7Y;*zuDqMB2!UCtx{28%r>ovbu_h-v=W&y&2n({i=gf#-m76=0Q&NB3m zb>eW#zGx^K*vpKg0NMp9e=$o8=`Dj;l=Lz_SWyF}Y_f*liLBCL1t~h-HRlkcb2k zDMX|u0swmZd)fkBa>Y+ujj{N7B|et!O2BRM{{EheXKZP~kP#GW?m+0WbOJ~ZO^HPi?D-I-Z@Rh)4kw5h(x^0Lp=##*zNcjveFS!C+x=g(!SP+wgD|a?&Pu zP7Fa!$fU164o-xU8bl<3l(%90fD)HVwznQAX`EZL=V6*OcF^rX8}#?vph{K*-aJ52Fh0c1LTj{=OuFt(=s#0QfxqS%9&xc>U~w@jtNu#h8l^A>q=~0302SVsrhzm6%u2 z>-FX!IRO3@{l4YvV7qm#)_w&5x_NlW%pipV#GC2*)zkaM1Bk$Alsp5SP6q(b6TjN5&vp3=Xo2yjp{$HjMoWQ8Y47Fs_P(5#-{T+cy=VU(0=Vr23Vn)*n=t&##vteH1lGz-Hp)1QD^r zHWv@PAaR6q8t{8Dyt;O)o|-Ozlxjp>d*mDC(WOrnj*Be=;v5?9`Hhx`BKt8w4(JRZ4cn-0$iU~jub!Zz&-7OsDwq4}#34f;`k2mr+g z^(FyaFdk~I68J-4#t^FtyX>QgQ_tw&zx_*nhcccw`e^GWeQ{aX4OS|6}Qz#}-6Ce5dV?@56Wl`02MnQvgJ2cYp?{ra?1kFp8f! zfpJd*LH=2G*~jqA8tpywT>rcX%U5jFYub0oPS~F;%YR#R5l1QaW^rj^@#nODKSnGzZxMj0m z&ibsmeD=-P&K~_;+Nt^?c4YPc7O02sWde6Rwk|Pz;lWF1kAJK8P{+mhj%KHHeH51Wrp|^FbzWS*x zx-%Z5F)B-KQGQMAdU3LcmCKw@9=7=S%ni0U{R(0)WecVmQzx-}zM=F~R5vtmN znsJJgux-0$TOQIK8f2dsIJqxng&IJ@s7d04K;a{^0GP0rE&77-yw9FF`r6g_KMff}Ak zUA^Logu$vHGd7F}@5~B7Cd?8M`_o$(=di&4W;JWPYzd#5mEBqe_XMLh-EI|W2*AN>@ z_?FKvuhS}QL?R-SP&t>Pd9f3XB8fyk8x_#In{a;i1P7Ni)zy|)g@VD;Bi6`B=IPHo z%#Q)1swSuD6o^|z;-y?Df=MLu!nx6WeH(3+)gd<&F{g$GV)Nti%z+)d*~P@igiLPK zsH%#p=5}rui4|WL{#FQ*GXt1szsuUDrPd>L_2E=1?nXz4&B^clf~Vd(PAa!%(gRgB zIe;4pPiHQGxqT7#laI2lv4PcqSg@y(s=yL1V+P&hYN)u1o}rFLB^3fDwn z^(rdv`8YLqHF5hbbu9FK#$qvs_8#QKuU_Fwv1q|{kUxUS9Jmq0HHlbNgD5-j;W zPyjO(Kz><~cy7!`pjdR;08>Df5}#0>;RF8*=LG0fU`oJY00000NkvXXu0mjfTzv$L literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/tango/folder-new.png b/posterita/posterita/web/images/tango/folder-new.png new file mode 100644 index 0000000000000000000000000000000000000000..fcd15c018493cecd0498daa8d0f2e1cf3f4126e3 GIT binary patch literal 1399 zcmV--1&I2IP)z-K!S}0j0Bh&te);ZX=I05*+DB zsZhlEzxYo?X2Sn^n9ri9PPsuy+eBJHO(0s#s53Bz^0@%_@85suz5n1U0#Ot_Ow;tc z4<0;_HDR0FCM4U~xQmz+Bw%z3zK7?D*(g3ayCyz)@ZNuL_wHS?EJH*P5kd%v2&%eD zfJcuWeY4;1e+PKD63^H{tM4J{9gMw&CO5ED!8iyba0f)?b)8mfrd58l24JmS?CtHP z`}_Nd2;Tb@$Vr|+G#ZV%i2UFLK#%Dl)psz}_o4D0CjJscZ-8w84&w)C^lu_lCoIr; zZDQ*ArxzWNZnsO8WrPsc@&rIcFvdj2n4jLeckgG$7=H2VWBY~OzPa`0$nI`ucB31a zDBcCrB#9S!TG?-+2OSi!IwvfKsvH=DtN>KC==FNFUav<8VdcPy_*npedcEG*+}xzo zsd01jW41N}Th|v{+i=+UU2Jp*W3LhXtcLy99N0kj-a?Z@2se333mBhspxJEFZnyE? zjUcSu0$;D! zX}8<_ePH?BUh_paaTQHJXF7X~W(loAsfLn@Oi;g%@CQUD%-z$rFH1(#ts9R%-u~iW zp4|G;hd=z~Z_WXz>U=mH((m`_jkeq)`4t19y1sWm=#Ux)r8W^b4Aa_ zDBq@58I#xofHG8RR3;?RgrG4+`39r>8sq#;%J3F@eHomrT>*p;d=y2?TQIB8s3v4H zcO?K-%hBY{(n(3l$_}+;N*sAaEDPUYly#VvZ<81Aqx`jh8Nh5ZnJ^lSDBL!+G@*RD zxDo(>mkI}?cbOHNbZUoGD>EYFP_;~pCi|mZnzbE_cLcPz2H>14qbQ=)YT?F~S{mcR z)mpG}0>h-(Vp42jO#p<2GZfE^+-O-QGY4Mw*8o&?nq?W&Sq9uDi48&Yl>km_!6H~n z2coAnDv@QDmm#2^t^qjbN>wFobZBV8wD2z#Q9TvV0S%?U6wN08)F( z&PNbsJS){IM{58gGRgCtku9+e!||*nFT-n)Jq;IxtZ>F~$$P+iuOhODs?9V+33(Zo zyS}jXt2ptz_7tVCC|p8?;TnLdPMmXQx)7>1A}a#UpH_OIu)b){a?}8m+~Xuv{`9LK zAHz@90E~z@l4d2SA$PL+B7 zp{pIy(bFla{xQ%6M&|&Ij*k8)x4)M-AM^MhPhLU%>S0udhkyI+&(DpWd9DGQ&**AE z`Wm$zAV3Bj0Rx`dcCmTpnQ#qAUNe9La!&rm{vV&0_z$|iO8zfMYH0uf002ovPDHLk FV1m5tllTAt literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/tango/format-indent-less.png b/posterita/posterita/web/images/tango/format-indent-less.png new file mode 100644 index 0000000000000000000000000000000000000000..7ced16f725eb81a8a8a671bd52a85c61af075bb1 GIT binary patch literal 767 zcmVA$jZrg35hBQsLkSG`vPIyAO%30AP7b=7g4;nv1 zh>2%IR6;;wK)qoQ@J~=NYWN#adLi*Z6GJ@Ml#Nh!$3weezuNA$CBDgIr!(*D@7edA zd7FX%Y?A%Q?A%PQR66KBPC;2#@|~y8o*5h*GyoL)WT|w}{c!5haq2TW_bj!&y?p}s z;{mX2fB$dGg@q8PY61|B@kq;+s)!3ADt+giZv-q`T6!BwXk=vABkTrnTTKA>3&WTt zTGnk4pmE_N(WU^xq+odXdg}p#rog$$S_lwC_*emgrXZUgstHh@Yf%cSf3*|95^V~= zPuwl)AMW4)fhysVSh*b@8mz3YpzFG4u2yRZz*=mY<)^Oe%s-#wcJo$Xy0T(0%p#c2y`(ta1g~gW?i$#xLHGqcy3)}!-zkOl(-7W1q z$a18Tw))4gDu7k{?X9h?jR*H8>FGJ|ij=z|dh_2@1neyyk1;+vLI0(G-1)5qVYgf^ z7qj}-9!LO5YcQ2c`O@0$*3H{>eX5wWv9WOuhylMXfEb_(`1y2Zy0g(Y2QeWi?Ck7F xfC|praU3`WoTMC)R^J&)fC1=~FQ!Gn{0E>T@=8f69(Mo$002ovPDHLkV1gQFWT5~6 literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/tango/format-indent-more.png b/posterita/posterita/web/images/tango/format-indent-more.png new file mode 100644 index 0000000000000000000000000000000000000000..6a18867ca760573a9391b9b5ca9d72a5c40aebee GIT binary patch literal 766 zcmVKqY0$Sy#XFcU7^!9=~NNATttg2SL5G#>py zybB^C8a)`j2&ib(KS52{zktDBNIb9>6Azkgb#1zOsI%?bvaW3SByaZi{n77_=Xtli z@Sh`Mf0$pG6E#ikYb9VTCggh#^&U>A(>j1)pVTz9@79gmt;A=3;a+lMW1}7T=^{{# za`|`DfephTk!S-9$9S~qNIu|(Vf^ho=R6%~G!_?^>aH0dAM+e<3W14g z&=LY}U<-6t2n0#N=xC;O1hU!lwj$d_2b`e0Ou!Dhy!>+8wdr)4+VdZpfS2mAv2!j5 z%x7nR#{}F~``I0wK%j3z3(Rbliuw8G?FyQvx#s;^C<3*h_O_Z^<-x=I6bgmr6YvAI zw`eqqD2hza+(DA1ZP!*R4G^$z)O8(A(@<5Fa=DD6lqi;p6pKaTd*T3Wec$5l>HmA<0p?8NoP2I?1X2*hH}8F z?)stYIX?Dn9XVj%9E`-;mo=7_U(|KL zvj)tHb-Lj9kH#;0dsAdGqgd)2EJCO4hHbol3=9l1a&`nkh}BI&AOb=2ABjX59vbG< z$~*k`v3p{07*qoM6N<$f)vPN&;S4c literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/tango/format-justify-center.png b/posterita/posterita/web/images/tango/format-justify-center.png new file mode 100644 index 0000000000000000000000000000000000000000..a0db2bb30a816a81a0993c8d0087cc27d1e2693f GIT binary patch literal 526 zcmV+p0`dKcP)4}dC?Oo91UGmF zPSFjC3*5QT7$cp)uqYE}rqkMKr{Q0ff0DlMfAfZBfIU}@|1la5LqeiXm4fxU_1-?a zIQKkn4FDFuNJ!MVzk8@sAEWWJvsf&S0DL9@SglsS#)T=Ruso(ShpZR5KIt7QE3>@yMbk?r7{5qgWKF9qTK+Sx|9Pt;(Gy5h0HiW z*&O)3zY{MAAm<=`YS95E`nP6a3sjpuGh$K)>Hl^waGYr#9k1_Su%7 zRlO1bX=hswnaY7eA<2XuMLsgs4=a&GQ06rK% z6M#*Dx2NG_yGnIR@wHqoYXEFOyd56`I00~s*b&p076M=m;0N)=^c%ot3z&@a%bp3J QWdHyG07*qoM6N<$f_GEirT_o{ literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/tango/format-justify-fill.png b/posterita/posterita/web/images/tango/format-justify-fill.png new file mode 100644 index 0000000000000000000000000000000000000000..2a34a8fd6c73c1592787d3b78877e0e1566ace2b GIT binary patch literal 517 zcmV+g0{Z=lP)*h(l{5vjS?9HU za(3EkwblTRf6{eVm7D9^H1!z_A4>E2`~Y|l0mxb|zpV=kAt)4zfKbNwtSfC17ef3# zt8-chYzhYff|VM86!mly0*pqFR$w}v%VYq(-c@W7)ozeo3-JeApoT0Aka!E?2&W2Q zBLlfyjz*(F@cWMipv%Dau2l!TclFsAKqnp))!S_uAf9Ln0JbtvtJTZ_gb;MQU7|aU z?|{))5Z~%(fW&8kDL{C?Edh+jPufMMRj=1E%76rDx7$Q_8qWdaKcRmM;){j>7$K+tS9BRk!0x7u}L2X=|-L#8`|6NGS= zs4iqW2NH!a`lyW#nY9qw>e@dqYc`wZg8)U~SPqs-B`vL`%1o!zb081ANq{_15b$!} zzbmJyE(9No#UcX~K)oIB14qCio+Gv|EiSMIzVI%lpTOn^MJv=M<|l)h00000NkvXX Hu0mjfS<~1A literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/tango/format-justify-left.png b/posterita/posterita/web/images/tango/format-justify-left.png new file mode 100644 index 0000000000000000000000000000000000000000..ba0e914a007b8e51a6d9184efba9a43a6a6dab89 GIT binary patch literal 515 zcmV+e0{s1nP)rqYlC2gIdYtZB8%yjdMDPHDmeMm+s8Fxb zQ)E+cQFksB5!=u{7jf)NG8r?IiN4ijhT;F-d;d%r;Gd(ye+);1Fp5^qG6k#E+H>RR zq;5oMD#rt z*Q6D&DVzjIMri;{G}bi)7?1C*!1Q|OW&r*EMQ#zX+yKj(=nq;Tnk)@q+=4v9r2-W7 zK(~AL(}Lvr&jld!Kz7z*1^8273?LIviptBq6}1A8PqYL8QxCM;?cxALgdhl@&QvuP z0klp*{!*)3VEix81xT0M62N5gAl;-JtyT+K9$)~z??atwz6xmHgtAM-1c1%O*=qo7 zHYTDX0H3w?F=QL2(?{v1tYE$7v*rz}4Ul!A$d1`oB%QT!1%4Bin@pCqVFgs8GLvn` z1x={_)v8Tq&4jkH=GR$-Vdx|Q>HrSer0023T1!!x&1R zgtx_FQ32or;_G-9zyW}L#1*mqXo&!<0em2Sn7#wpd;v~F?jm#EY;OPn002ovPDHLk FV1gLP-hBW7 literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/tango/format-justify-right.png b/posterita/posterita/web/images/tango/format-justify-right.png new file mode 100644 index 0000000000000000000000000000000000000000..2144cb915e4b39a88ad5670a109b642ba0105a1d GIT binary patch literal 541 zcmV+&0^`vzpn`a{y9qVhyI`!GDd4f3YN>{ zrFwL7+-kK}06^l4jM3WF<#mzz=nwAv`Fy?y;4K9pV!8aXF3dTH=T!i3X@1AL(gtzP z`OjEhQ#xQ%I0=x9!T^M5q-zK;9Nt@j>2%J`0J`0a+#<5wfXJHjKPZ9RWN857666ss z9Dq`a@%Ygg(s3LFL4f4{pBun+U8xr~XDvGrJM34joS zAP7=jF54|v3+S_09F7# f5nW6_0Ia_Ol&|bR+c!h600000NkvXXu0mjf(`xW< literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/tango/format-text-bold.png b/posterita/posterita/web/images/tango/format-text-bold.png new file mode 100644 index 0000000000000000000000000000000000000000..99ed19c58031509ba2de244c2f6cc0ca74ec4933 GIT binary patch literal 1624 zcmV-e2B-OnP)wC_xNFF zmuX$42#H@j*^@gtbMBnqeVua`_+S2GVVC2)`iT!Zayoy(W>YSddY{ee9*ZKsc=F9h zI<7iETgR75c4BPo(DQd!SY)YaCzB870`2=gol<>ORbO@7uFvPY%6tLRqv88+U9rTL z%5r?&H3}jE5g-T<#`A4Wl~~uZ$oB1TgZBeCKA-POmv+gEEGv8Ox~0ZBFrI)A1TFww z5V#<4PS81_Z#02BR|TAstn8idcjpDry5s%EO0T1)dO!G3z;Hnr7*E1q z;ehWNM{Vnl_ZzPofNGa^ZCYRF8k$TZn-kClL1GM(kpv<$2{4ui$Z>(bkp%8tyR_VD zlXhJdfTkypIhkOaS1$9hzR`p+dcbCp@MGry|EY6;+bnW^NjTxm`8ZnZeaynJx#`Jc z&MOA6YpM2)t7~i*k~u_EIdD#p83S>FjHb<`HEjmOA%TGlLM)ZTL^O*#ZmG4|v{d^Q z14xYRXFEZ7dgAm zh4%vZ=#l`6|^yxGI2w<^VcHe&UGS}cl2AWRAQhVUUIpkT$D8a_FxLA&b z@s8%$&W)#W!?Ie}S3d@K19;3FZ`K}Y+H$}tGq$;*rjqrKU#xnCO~p->k8`sf7h99B zZrJ+AvskjQg2|xGObffJxf+Rn7I*>4c70hJy%@8ADrhdGYc=M8%9q1aKir zj+zMgJQ#zf6Ox<|iR-AZskWZ(9o!D!U`YT;!ZR%mi|hmAX>gto=JQ(6GZewm6W@VJ zQfBUwl@by{-FVw-RJ!a4O=$pt&{Pgf0}Jh4eFM*w1ZaHlmG#&8JRX~>Vj>y?H%7al zT*j9_3`PafL)}MreKsF}aGvCB}smE)(k9vV4vS=W9tI`Yaj?%TwyJ)?WvxS$Z4q$F+J@7AREvU z@;7Spt(pJ`03sS47XD1?_|W;W$5sTclgLOG`HQRNklMGyo8!$K5- z^04R+Uoi%2OhluJ2@%nNiAfPul%^H`h(;cQk_c2NB)|d!f^;olk?zaxZtu>_@yG5q z+wGR;68~_L$;{sS&75z(Gjr});I948rrfE8C#%@^0e}&F_u7V2!mjof@og>iNH(K{Z)u>XN&8)Uu38AI6o&V9&)les>6y-aZ&)HH%ZQ&3oC;q4$M?~} zx+UKxV~Ge^Mh#Ix5NQ;+r9^bz9^5!<;^_O0mMjKEh5JlvM!1yI~uQ*5L&mB2*kSQFM2n2(CSJSCOg#p{*ba)~Ovw=ZKK)>Bk*zJDqpy|G=54>VASh-wHqIC6XT>rg7X;1;z%3ra;zjF6WZNwDbE``o zo^~C>2V`Mg{V!J{;n3vf#ufhF<`GFqqIfp!slW}LfzoF_%rP--&yzDM`nLKw#@>^S zwO{Oj*VmD!s_N-+i`IdlC?ushd7cg(CW8hd#4=%;M08yORaL7rKbdyTd&D`&8&*+1 zJQrCehT3OmfQUeVg$PiffH4)S3V>olCwwJBphv~cD-b9gu&KJDs8}&tnWrs+OWw@HxVFZY;0r-xL`M@K-t2NUmY`S;OxR71!iA}qjH!Hl7OfX z5Ge!_xN4dk9=e2thZdzgvBae&kw_4sq+Z4w>HbS*Dkz4KgpvXiq~HlC10ayJfHHc{doO~iYm?bARXu#X z@!hFFP>DNcDSe{J_=3s3bc~v0%`cgLE>)(JTWgI8T&k3*izmhkx;so4hGh9=iW-R~ w0PrN-HUAkU-X%LsCx1EusU#Bb?^+N053Sys8>beq=>Px#07*qoM6N<$f^;8ma{vGU literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/tango/format-text-strikethrough.png b/posterita/posterita/web/images/tango/format-text-strikethrough.png new file mode 100644 index 0000000000000000000000000000000000000000..b9b55ab250b38c51a6047680901dd5e3d4a30cec GIT binary patch literal 1445 zcmV;W1zP%vP)BG`?d6Xh8eNd=De1M3WP)*Yc zkswKHVxmDYNN9}7MiVtigdksxkP4{@DXCwq{h*kjK~YPkp-;-T&?nn=Te|Ju-R0lzle90$q&_skm&3&|%g z6hNgShu?f@BiovlNCANJDgV{xyR5RV@i2hBj|`x&tU8twR+P7PIsLQUfpOUf#sQs1 zMEVd0^k<{<Za}c00AFPRb6_t+nz<{ zeT?!Ce0$-w?O7%9@v+oo)S|wr)BDRG?H@N*y?uPP_}u;9TqxR+Q)-TnCu8y??M@%!jVk=!(7_>k&djwYpeQFV*SEV<%{p`q zdax!Xo(clnow5IP++1tse2i2IDa*@BC8I6{<`^v+JNn^vPfC=k2D0~^p1FVn0E1)1 zDfJ9Gkzmro?(`#TO$w=R?kWRtY_>YHAA!|Mvu$w$@9cTrJmBQmk+TAfGx+=roO5s< ztQQ)AX&>i+Mnxe{DyXZsBO^gXMMO< zoP#rfaSq0(3Ng;X7{I}UzX2ZfG0x%jF=Ql3NLs$sz&qHkCZH}V00MGkbB;yd?eHQy z)d0Ol2=0&vcg^7sOce?JA>kZgL4$KZpumVL0Gr*5C)cLw`t0|PAR2%T#V67=YFdzN zHj$P-FXD9+U!1E22la->X+&W*_Ap`Ey{~SE!|B7ORVE^-X~Bl#6X{Jghq~qk;37Ym zzuux68dngf7t!3=#{g1GsOLasF_!t~IqC1n_=% z+yj>|x#TO!MA=~3>n|9)h8Z#vG^nh(B+D-O>DHQx>krxT1Cm+%d5%tRxKjM`v%1D^ zH`XVqQ2pbt6Jty;_g(zJ6N-DF4;YxgG(E*E_!I$>nxd=E0k7NF(OOf{3P1v&1E2?B zm_zl!7^$_UqRr#+-t4zKVAKk5`v_Jht`H2&Um9LB9Ds-dt;or==p+?E(oz8p&F!*R zc6=Eu9u5$KFa~ut2%S%M9B;XKOHNy^hEWobwJuF32&4kQ^aTnX0m&@-q=1X6zal?n z+s~gZ!^A`gR)`ow$^a-4BZI-f*S+}BP-IR%>3*uc_S3%su*gOfnLK2Zh=K$&n-~vM z7B+^f0w53;H}7Ku0OT$AGtx45bAAHbwiG87=iK+FW(WGs(#tTZ7TX8{Q0T)@2g}rgko|!(d ziwlB+V$-BwGC6a;^PlhgeKT|B9N_R6mi>@VAa0NKOn?;JIr(w*Wa3Ga1uz&$ z`6ut^@|D>M6aa)6@?Wog%uipcDF?9ajR6#uR?eV=Z_1xPoBrA8M!!!57l2}tP%w8E zHBh#xsI+p%^;0Fi6OBnH1E8@`**p0u#5<@XsBtv6xw)gQTc|ompI^hOrO8BNp|Z)u zoH#&51!a`%S(Wpax%G(;CW)e^v4h@g>>y@I!b6u2E3=c#jFLU5sF-lv2@97xGuEdk zOpA%Nn9%PJq5G*9Ai@CxXK%j`-k=7v$%wg$(_@x8GuBTzfRSO}h7}pgqi!E!WC`^T z9(%c}AJVnZ(T3)(fK@i4#pT7CW$B8yK3`juF1h*!5o2zlu_RD; zs;pN4zc|`@_%w?NPPZSc3o|5%^W9SdP*hwg6Cp}hEKHJGpZGAtYQ)X^k3vEXeIL<; zRPE^P+J^!AG!vR1`>-r4L1GZ4Ma7l!YXkTcPjPN$JkvOVQKE3VdPQ(hy?N(+nIod9 zIa_wE-|Kg~`+P7N7zTnmax&wYPw^DLHh__leJk@)l@^y5$+IlDR{g-Qs_MbfIhz*8J4KNwdFf_+A;97tCkm!pjVbmxD}tJU9@5}wcMsf~>-u%HRuKQW zzZzOetjsVF;IPFih>J0$EZ%XV;FST)jFqomHs9R(B!J{u3a-{X402t3hl&b5T3d5w zPalN1P~F%e((M*BKlWoq?mV-Bu<};|$l7^44n*I$D8o)&9u+fV4EUqENk9sm9B)iW z*N^^otI?loSJ2WGKxXnx${636wext~cw@%>7#Va@nxCCYdc8XA)6A%8>VV%rC{t?a z%-MeY`2hj|INUuRxvk5Cc$*n6kB02bWOA#vr4+!SvGR=lKTuIYa~yGPnsaHtxG5CTGk^F^+}uullUWT5a3>bP{vg{*i9r+@mr>)yPcgt3-x%o$kHWZRHr zw^?M_jBcj~l~>!rg@E7y7Xn-iCE`MWb3j0Z?*S3^aUl>?IkFOEB+j006-|7@ec;lB z00_w5<#`#FR(B9Nsa9A_EL@=oS1q80hLS{nNQ3}*xFZC>DA3~#!Ql#G@%%KU-Su=Y zCIYZz%aL@GkrpP|ZKSR}h?xq-!Lt`3K!edblf=eik1}rFws{TQ9u>>x+K6nVg-f;^ zNxxsUr{#qJLK3?R7G)To^y`STNT_XY=K#4#Xkb^gPJM1QN2S+IXX_l!594ii+TJsW z1@qDjx9>OX2Jl6+Zp0=`Dn2aRDDNu$XkAQ8H%C^y38$+r`+Q#C+x1oZ@4lqu5w>v4 zfjq@xy}IRtca@q}KNck#Q2Fzffj-Xc?LU4Qi0DR~16Hn;q$k^%sx!z&ik5aaf&r~@ zvdICUzH0y7U~sUZ!{tVdnZd6Tq$JE?R<4yq>qY=b65E%zFhh|I1c}obs%sm4n(93O zzyv@Bpa8G{u#VF#VT}yHtPOe(*8Tm!mp0po7?~k^L7KuOI^z2MK*+EggbY0+!+io8c2ELP zLcr*=Mk$8-5&P=cv-9W~KuE>0^OxUj+5biR2M&CA&#r=^yZ`_I07*qoM6N<$f_Z1( A-2eap literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/tango/go-bottom.png b/posterita/posterita/web/images/tango/go-bottom.png new file mode 100644 index 0000000000000000000000000000000000000000..bf973fedc2ceafa07c68be16aa3e9b20cfb71df6 GIT binary patch literal 1263 zcmV%%mtVNP~dWr6rHLdMHr1?oJ8cqbj{A8%xhRN>8K*&Pz0=C zP^?j0m?I;X@sglwFy0WI07ydlw2*Xuvk6$n~0^&5eWADdd&(({smV2(U>GI*X?AmE}KKSO-kG?qK`>s8t z!(NmSXF?o#u4KFD3;qDBU<@V>5U8RGB1*!HWI@9UTHE$#J34>-sAavpUe1?SZnCpg z4~)3CYmT*k!}Q6I_?OZhI2#gamW%x-$?0F%gu(L+)-zZ?w#G9U3%=(w?~bK(oIM>J zKYjS{gkN-ddwcmET4@t%CZ*5r`)+5)xr^;?YW-Z4i03}ZuG5$CX45rxECP& zB1F>SB`s6N&0@5vXLs|C{>aF}wsrJY@=zJpx^ai zeT!G>@e&wo7(c3ksW;8%^DjTiX0y4*Z`RAvf6~7p06^y zPoR66cVERsi%v8V)Sx*u5zTC3xU8s;X?fA zSf%^2De`SiWUikdl8RGlo5qkUj~7pgXlnacpYihZukpp#TU-$4J?pazY@BV%q?}Zm z6jW0SfH$7okSgjJ3)aNeSimaAnAid@G_LmI$Y=@`q);VA1a;s<5K%tZ@=n>vlm&<+ zWZ#92c-F&M#rgwFvBRmuiJ$^5ii?#*f(S_DPz>s{RFIZTTV2+9MSy&iVP5^pYZImz z1%oL@! Z_#3A-gu7hy2|NG*002ovPDHLkV1hd;Whnpv literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/tango/go-down.png b/posterita/posterita/web/images/tango/go-down.png new file mode 100644 index 0000000000000000000000000000000000000000..dce3f15ef5739854e5fcf3d8f03f8da077d2617e GIT binary patch literal 1187 zcmV;U1YG-xP)ZYNV!0g(e6wAO<7i0wYb71?a{E z6BJPwZqT?T?g%tNV`5^^!~_=vt(ZUv;-fs;g7PpzsXPOrw6q2KpqQ%(T-o zEf*tU!_t!`(dq$yHT~WSMV^vpD}VK+YXO z5E-d_o4cC;B7zf_%Qi2DfFhR}s>EFZ$XYo>9Iil+1xrVRcWe$tw&9|6el`t73P1@7 zA)jd$KoC%Z(t?O#FuIN?iyGbxB_-DHUi1+r$6f}|RA+A4Lbsj+qCQwyv-I=ji&vF_ zL&#<-B3QAY9SVn5LTCr*4Z9G};(HnqNF+*F^ZGi(5g-I2!VkZE8(!<}_@r0`iXO$! zf9!p^a`F4CpQx-(oaku4*a#ybjtDCuDcjGDbQ>9)9C0p)2;xATpa^)WY8A&%{+Vt) zf2{uCM*C(lucB)p-Df}C(YWPAPj8Q{oH_@G0c}BBdcrokQs*!#g&%1AK;b78UZ94) zdx7TJ%37{=ceqpMk6-jB+P91Oj0te`E27AxYq$RVS>FUbMJgs&BHD62bD4hAi4MRE zbk;bbbDuR{&b+!}0cE`)s$jq2LhlF23Uw9SI z*LePLrhXz@fovr-4?Xx8Gs_pUYj1rjGUkn@Ixdan0pN|-*mlTWnL2Nvv-jrprE{yF z3p$dmI2~m(^);TKy=qUPJVj|Rk%bShWKYA+WM@zNrlyT%%Xs78769OKvpZH=)BdDb zHS3w`7yR~QE83G`^FZTy3QubmRIH$-r6oFX`me^u4Q9-FFN|0RQSU^%_E>AH0eh1ATGEjST>BU^5+=O!(T4-P=<$%H}h@^l<cctr&UKuJ z&8MIiZ1z6)Zr1;|*JGap|J#4v1fX_lq+S20xzOczy+E-q2UC~Y*@|r4{fd+R07T`* zswX#K#A3wo?7I1-)(!?h?*P-5=ayVF=;GCFg%-f|M;}vJsj~a`&8VIejB~864qLm- zzIoZOt5&aA_*y;}4d|CRR7D^V2*IQD4lr{ugBu4%pH3J(c}m?ai}I1p^;;aOBA}{x zb*TCtH&0%{Gy*|Gw;QJ|%}uJIX8--Op169( zwR3X^8h3H3@E2Y^2yV(VQivAC1HQ#&Qw?e zDgk4K=O0-^P|c}^oN6Fw8cEea;$uK~dHwRfBj7_q2q}OyM77K8J68-JJ%7RNi}J_X z8aR6TV0v>H1p=V#`fUSBKna--hYy|*94+fgtelIp8uwIZ1~0mY-nqw4XJpprf#J$F`@8mOc|Zk{;jnj6Q>$n872 zgVxdsj1fcyQALfUPDL{S%^*AhkD7pzc9e?igzXK$hlIqJ2 zJ7NTb!5|1qP>6kjIJ6UM0guCLjA}p-L?R3kq6Q;2OIIHNZKcyRw;iD)X`|`%5iT7v znw+hnwR8dv9`z0{F^P7NP(X~PUDo6sM)W0RUoOBz7I_{Q64{ z)&E+&b;_L=w3Lq1*m?*P3C0T6N@Z<~AXX4bYlE!GR6#>J@MJ~Xy_p_ z{1_%(b_d4V&Qn)IWa1_gOl7VHsJPB`)r`7|m(8_fzkA)So%mSGpPRRDTsvphJ^3jk z?`3b(X9Sa^xwkO)s^v&l2W3;$sx&AXDk&(xxnfAmrDuR57O;EY^4rGED=paKKiF{F z^x1=_ja(?-H+@V(dm0S`FTJs{CpTTql2t`E_Y9zca#@*QKJh<{s+GHUgfBKtzG2!W z)5kxM+jIOA3ZWSQ5lQxKNbV~%aSBMX6UN=FrE1VCfEW}yN5gLSN9!@>1^wpjmXlZ4b%tI@vQv4=_jKo6J)r7h=)Ma8o1@%B<>5}&bK<}|ZsE^A{`Ae3tsfT0 z51CySS7RxXe!`Vcn~;8|xh`Pkxp#nQU@FSlVJx+uruEx3ZgKsghD{qkdbj9G>7h)H z0??6-B2elAlT`Vt*jWH|*F9HRUpT5FS`p727lHOY>->w2_022SZG5#ugVxvqbU+27 zysuORQeK~RE1l10xgl+zh_s4L)hrVpv@-_{mk$nZaU)M2rkI7dJbYCYy1fqn$+x^z piQB5@YEwFM?C9++^uPUE>~HeYjU=^o74QH6002ovPDHLkV1jGcdj$Xh literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/tango/go-home.png b/posterita/posterita/web/images/tango/go-home.png new file mode 100644 index 0000000000000000000000000000000000000000..a3ca103e3511e4e013f19b5271d7fde2daef118b GIT binary patch literal 1774 zcmVX>3&26~}*fd2cq4$6&{HFnA2O$P@^>+9F2?x;Sc3rJ^dd zX^MoDs7fM1R0XNu+DiG9PZ3d-E)oQ~P*y2vE0qQnH3W&c4TK1qKw{!zFxX%`*kjN3 z?!Emm3tom*%7-55N_XBp@0|ZR=YP)J2mjBqPs*47AjGY`Fy~=yh=+M;KlmuMr?H{o ziI$q0+S9$g{edyxcp5(W!U61o#)#JMESNWMLEEfZ;oQ&=Bk44!`}zj*LGYa)LidB% zlMkZ&J6I75g-)+pzI<_8TU!_@aX`fPS>D>(6!yHo{t>?Ug#g&E)Q@UwYX08Y**UAe zu~8x=CaI~k;t{Qnws&+qv1Ik?TB%CvLSTo6aKpnC zj3J~H#yO00AO!WbwULor?yKLmw)TLv|9Gej?1lv~&pWbg&6?Rwt*shs!5CZ+U@u)F zxOIy&!$Vvhyur$3lICcXacjvshXX8dabRF%G@U;9J!75~#RN^0svOv>)RVO}HScw9 z*wEJ0-mXy!q{JD6y?BxFn>TrXXpqE9+gNq#6#q@c=t++fm6C9Y6FA4*#>U#2iNsR} zw0`Rt==;jR0j+-)Z)n)|m9DNCUL;bC+FIPm2G7CgRq{rb3=NVb6i z%!LbFN~gIJ2{ZrA-N^cSf*?RjiIfs+EknP0gY@3LEKk&7gdk-M7I4myN~d%EH*TCy z2f^AckShCC0KbRXQLRrb?d)9nrL}9L<@Q1dY;P~Yg$tZZr%8W#A?>^OAmee2F+?H} zX3m^REEdBULwLnXyw*8cDf=Ja zxUo4ge||9|*5ZNy^U+6S`}+8Bbd(vJH`DaO3m9Xt))I@w2#3Ry%9qJx$Ye5P&z_~{ z`R7>@3Q-dZaordSC35DoS=)Q{>J@9uy6;1e1kg(567B5*r9dg1F$CS+jC}q%-6JE+ ze)UzFUwjeg97-t?i3GmyW38<$V+_9UQ&UqzZ0S-u4jtmGl-$Tzq!2;O~{YnLzcp|vbJc#y=pbvWnHS`&>%OG%pSyu24e5Q#(xx3sYM z?YFtq*huf#7>!yJDS?olhgQl>YeP3MK;hUiE({KG>Cs17e&h(@dGi49JP*(FCOMw! zeB$yv4=<5m;r{)MtzON4Mn`!>DdJKh#qH*+05G3@M(+4=PWJZ`tY6P#hYus;ah!8V zDG@^4m-DIFkeTSD)^*U9H|)6M}rKg3Jhwvx~18Js^q zXghJ@TOaiI|D|BqEiuNDFIaMg0IvKE=NyGX0i{%CV}Jj9K;1MBOq6mBTj#W*wXP7*_x;M=^E{HR zNvyRcU?2r3A&MlMkg#$YthLi>RP_(SIfu2DWHO1?RaF3JXlSSa7|#ae@`mwTz^$hWDmP5D#RI_*5#&dj~{oZ|+F5j+WXvlW`KwGKN~mG!17&4=6HUasOQ%)iUkbdIiC3du9XDX zQAWv6jWrm3-~vjwL((UTpXvqO&iTdjg{02tOL5YvCkxBwFI-q+aI-#)_`Bg%>>x~q$m?L1(qSp!@*iX`vu;@0rbs`RmtiFb?@U&^dAqs!X9O3_Q`J{E^K#Ydzt0 zjE!z<-cNr1M*>Q>Lt6e!g}tb-zc4lm4Dz=luKi(C_<=39MDr)*!S4bvqCjVd^B zr@zZ*iO&tgUA|#hlGAyP(U}XFlUDGY%KW}z`@lytAqN0nr1gVCLnO(V7KVEQPMG6U zz!;YnBNYH3Y9~H6_p9e`mn$=&Jo`s*VDZPl<>>?BJ) z2H{(yDPhx!#Vd_^eHh4Dp>hueujips~s+ujF@2I$c%i(+iD~0l4kF3PROb;Q#=Em+(~9YOsKSv)11x zi5ht8!hUiD&|JmCYe61Q(B*aPQLjz6S)YyBGRtsfV6gAS1XH|}W0}W!0wW+)i5hPZ zO(@G*k1?m4)!R;cWtCJkR+GArxZq&pF2rMkW9`4v{utam?%teyUnA|xETP9n#+)w^ zLJfIYPY6DB95V5RCCoCUpe$!2+Pm81OV_PK3~G5(HN76zo#3EgZCn~ypr`!=f~9a% z>jLh+tih)UK!-K>MEAs00wgb4D`T$Um9H?gzH1*+3AYJWC$ zcA8|?ThP?pIO%q|4>r}%O8+281bNU{=rbI5geng@7cr0J8~|K7L~9FQCY>$h<`Hnb z-tSf`uNP)|U?clB(ERA&6)oLJ%w@qBR;~_y8Kf7f=(0 zM1uH1G-?9`6UD>?BSMUUM2#o`BuXqXh(gn7swhR%Xt5C90~AW2m6qCTuf4sU89(f9 zdmMdB<2RYhWcGGv=Kq`L|IFrkmb|A8g=jFtOoO^8pI;TUhYO zD|z4iwE0bz9l9&6^y_G_)}XCFumw?gJJao`P+W;3`rQ(daFPH(hhP!J`PO5!r&@Sy z`g3_d*6e!vujAE|ttD=(K@ZjfV>M}$LUAR4C_-BRvE7MftU+5%mzTuToiulx=VIGw zrcIh1kH>Q+)E@o~ZGDXK!<{eyfVMuq_PT|YD8vyQ1e64^5KBrY>Gax2dI^$VJKFa# zI@s$i$qQWSXkgZa7h@wv+)7uvgSJ#NzVQYIXzOgIDN#?%iQ_sk99Q8O1jP_yI(I{00E(n~qXkFebEWkQQ`!tpF%ja9jymM-U|_1>%4s3arH% zL9|7Lz#d>^{&*&joWY)7%2N#&&%~#VopqJYfG;Capd3Ltfw*#mYo!1Qtgu$F#*&ez zjJx?hMi0A(Z>zpcUT$sLjbaXvGZ+9T^GhHewoxP;L8%}i0jvdM03SpY6N_h%FU6Es zZtYAY+SatT_#1{7xwCs)U^ajQJ#V$ArmPGSPl1F{5Jey^K?HW6SsSe0KuqOOQaGEg zgrU50OXok$sin1_>hdvj$fKzD2xkIF2;c&IynS^l`?zAm0E>V%bPAOD~&D09sDc1sDQ5ax&V? zYm|bb{4q=zHj^LrR(N%F2hX1T&R_KRaT>`y?wP)iewhF^6ph-b>S!f^pV1dl!o-4E z?AW!v>(q(*KkK%oUrjdCo;BWzi=mH_2@r{C0xSG*6%l;|=7-PmJ8U6gMn$EkWXKT+d zS=lcDA-N{-Ia;wBibntf(0Hcp<+?4pf-7x{AappFS9}NBOA!BP`|7L22KrwRZOd%& z?5xhtn<)H!dOuiz?7k5|c5Y-Q@Su)!*Gg3W1x?s%KLh<>cmMzZ07*qoM6N<$f=h^W AWdHyG literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/tango/go-next.png b/posterita/posterita/web/images/tango/go-next.png new file mode 100644 index 0000000000000000000000000000000000000000..a68e2db77531cb15a2cddd62f567f030513b60fa GIT binary patch literal 1219 zcmV;!1U&nRP)Fd(Ls*Wa_5Q6f;u`ihh?a=O`)@EeXr|Ly9sZ zC=5b3BMHKwqR9S{L?bMO)t&cFZZhGEqz3tp@_}5zJx)hL7Fu!o|&;^gZF(;OA_T|6Jgd0l0 zQ!YoFtGH)szVrIL_irC&WgjdkwrAWh0$K+ogE&WzfXLJ-$IL-MSSuAOasO zUW;WpNF+iC1OlQMW=di6=cym@wTspYgC;v`G*d=DNO?_Zvij)GJxLkNulYHuasf`17F3`RqsJv{BAO(1|N{Zb&|wbRsAkC0$F63Z4?wm{kfX$hnR>7?EXgTQEmj=+Th zBftpm9{&V+vB_-Nv97bV{o?A%Rl$m@5$HA-(h^83jJCiEqm%*>-f0XN9VuV{gDqk_ zJn32dxHjLHZRkvNbiP@=T5SSMUj#(@e?q4Adnv=Gj=;NA5Fr7B(czN=!<<~E-TXZD zC+mWWnzFXmMzi41W>rh-@Kfm|G6~3Z1zvn$MHf({f{-csg-rFk?97+=fs0nDnqy)U zxi|M|D);X84j!qkJM~Af@JtP7!@A)lU)~*iYJmV)yXBJ}E_Ju!B`dHTfewf7*6jP3 z6w7D(FQv(b(+xY1Y*fqITZpIEC1dx^Bwzqt^+hlo7y>w`BrDJ-@t5M)`FKpTs@ zMm|o=9Y;y&2KV28F0QHlMy&(|e#QnLmxOBGD zl>D?laqd`h>9HTwt}s7xmA3A42uTCJLYcHe7Jw~=FfC^x`}gk)cK!ZqOXEKM%E@wd zA_Lq{i&uOx^+dn`UI-Wg2jRUI(I5$o@}aDv+&yq)@4@;V{-UPC{FgyAiZ1kgEcfSQ z(!K&5WI>UAAuo5F-*oR-4&_N(%y0 z5>0!N*ydiwAf#TXK|#&u+I8MN-n)D6dFaLezuUdn zt@c3g_Jtq6Kj+W+{l4e-bPh~m3X{a*Mpa+k;JJzJmy_@&-_4*5MM?B?En1DCl4OLCdP2wL~vvkw^MfWcAl~faU4&#hKb))y# zbnn)-H&(y1@ZriOetXwRtkaVsFy;tE8`Sz)GiQIa^~L5gZ+fMZirm! zX(y4oiggBS4aRAtkTk#c3D#L02J37n1{Z2$4ez$RIW(>a)NGH;cfuTAyKLi}MU_wZ z9bG3#X8LfroMGz>vA@2>SdFn79cp8LEuYP}Ar=UgG=Tt*hHHWA>f% zMBC*b$(nTd*Ws`r92SGc;H1W)aW2rqF)Z5E>^93kF=VQpA&j5w_d2v}>Yg$IL~1bsu- z(Ix`~&Xo`W861O|9{MwJ`m@)`*i_I74x9yR9acN6aTx9Jh>+H)v87<{c~fzYv%5at zzjO1mOJ6Ee(&x;z7^NjX(gQ;pEz%$jQVE0eKqI`+;L&rJi zLF$6qDTsJM)JJMV3CL3|x^3PPmK?K(TW=(~?p|8;O6hOi2Z^WuMCCbISxMj(d^M~U}#=vBJDZBI{MqIT6&Ya^XQzjA)?mw<#9)WLfnH2<5K ze2i%nyO5m&Z0|LOPJC##WjA(i{$ik|Va=-g$nE9jobEq_P$rk-zU@?5)7sQNni*_7dh2=V#2i?Mte=T z5x!mgjJqHe2QR12tca+xvPTv?qe@gMM`K607_;veow%4pHY8WjhNIPh3k}#j(SUdE zXWc$C)X O0000hCnQjUyjevOV}vKaVvHYABf*%6iiT*g8mJ111fo1B0zyeClm*(|?%sQ6&hcUH zF3Wb?vIL?Jp5)}t&d$#NcjlZsGYkC7Mx`Ce4o|L?SodZ#OwTJf@TF(ohawF{3IqiZ zfdB{qh(N$#v0z~^+qi9E*%Y2uELe=|V~f|ezE~EjEPx_~y~ns`2ml(%n;wQDT@WWCh)4l~g&~D#U6eK- zaRKt;cNGC_c=PcQe~`C^`WgJx(hX|!$LldLlp1sVNH(k}#D8B7qXn0_sc8jsdPS7$>6(I;d=6DXM5Y4#6Z}Gy?=iRze-`nJ?+*iV9a%U+%z}^YwcR zn(kZFGIz0mptlRghOlf9afq|&9yCv1tozUPO-;-@lQ_}MyRIrgvcq3>WBtt4%kOTl z{;l^%WTSz&+FixxOa|w(eMruEz(0Ka(EQ2sGk^4S%b}|Ruwae1@VfC6-+gk)+QgC6 zuSgB`g5!fp)mVK{=75JCpf2GF+PtU?T$Gq@1+!blE3AKQ+`sWZJ22i#JTGx5c zPpzNv#Qk?XRK4%`4&-baqyElSwS?2Yf zIoUYrwzN6X&3np5TH29Zr`zgkCvSWD!SxBPHLQdnrBLOKL)Xy{U?oJr8Kg}L%n<;0 zN(#H$SU!6_gaH;nSinZ`(T+E=naue|_H40Vm+B2a3xvK(4-Mk=Z7<~FGnhm$u4Cm! zSPC%2DP(y7ys_85(S8F79ywt(T;Kf4+E&0U}{Xx)I|B20kH8> z0!CI+2rvlGS0DutQ7j-3A+QyY5_f_sQ(wHy34^d)3Wfo6bs`5KSKOEE0E7$zNke-C z<+)tP`c9n1K`Ga{`(>OfCpad+NMp7;oH_0nLD7}E3V;E? zR|22__(cv8psjITq0op*--0}tyVL@h1R#nbqN4Vg0A5U=cOL+@yt8q%K+4&80AcJN z+^(DdT(EK}^Gn1_Ve(Huo|FJsxadN-NQo2ZL|bZ6JYlitC-;h?QAGg=T&_7D zoA*3KE^ZI|*L68XOR<&(@4;J>BJ-*}|DX;Zk|IYy` zHv6y4ynX)KSD${HTk;CtEw8mJ{xg7zEw*w>!L7ThmpvQr4KA|!;pg(L^*>*-DR%e2 z4zTP^X89)P&{L0Wh+nvJisNTKBQOc7maH!DZ17d-Hl|D#z)W;v=?>y1v~_Eizc?)x zx6;t^ElxvPyZ>Op^oPWnSbkf3Q~BcQZhu1qI?=cjt$^hA+5^iMJuzq2opZc~*5iO6 zA~+5C{@fuJEm)j$*R=U%&2#LoiHgGnD^O8u-zuJ6^1{lpHMu96jxdnw!)ciIfMn25 zM{grb?|afe+jQ#wJ4zBwjrID|KLSu*YaTC}I%D@URU6~Kw$;;}Xde_0H5feZ9q6P# z)kE2WmHuz%PFBra%+ba=*F0YQF_)lXYwX@wEdJ^GRh!~1J*VmH|7*-(e_r~9*51=R zy0j)=Jr0*`W#)AQlx|~+y5Q*ZtKP^Dq>l?-zh84-2m9=5zo|NYZvGmZ3za1+3w^am zN_P;SG{D-mn3%I)R#&bsDw;Z7PPd;xRU=VR!~9w>awe)wSVvg#EjHL;Ve-;fNW;7$UN5H%srbEu?9xNZ_*4|opG z6T}0j0WDo;sa#lXTicsw-L~k8-&p64jifbcU=}KOpH@J-WVDMm2Q1Fbfd*3^VlENb-g3A-+i;)r@22i&v z5C{g(OJBy171$)6f^l5zKSx44u{i>gj+Yj9P7wp5gkfm!v3{ZpKn#QfBt}|-VF20o z!yZ!Qn*o$d1LsL-7seMPz1~rVf;vT<;CTWbVag^hfA=0;)P!Vs`hQBd@zMvD&fM+Cvu!5JafOCRK^gfWu=}#OW>H6?(47}7;2otGE zs8J(29b?DeAb_F>f(ns{FbLo>!ZK<72?5wNL3)2jnQAD6xad}xzNS}S%pE@x2L_0? zR4`KDu>cI<4{@yIP&NBCJdbDx$hA$F0do#ebE=iVgM8EL08?wK{`+&Ooz^__2hYpt{4OJ3qi|F~{lt=W-btr3Xr0*O z(i{&jKb%uP=|_|=Tc;sOwk#52I+v0;`2c*}+0WxozZE{+)>}_F`pwRU+SnHYSiHT~ z6Aq`nzioY0#ZT_v;7Rvbw0;`oxi=bVJll;lB!-j-A&^oa5GgNOYqZuZuP9{4Emu=I zC!bh6!Bfw^9e?G}>2p3`?7HTCwehL(jOpRE$Sgkg>b4uJR_=UgQ<`NOyxwq@C!Two zO9LTH)4-ZyreR>328Jmy42fwNNJDZd7~-wt?PU4Vs4SkrjVnrxzM*j5$(Dg@hFcEq zg(p5AK=BsuqpPkiy7xDa+>&k>lHcz=%AWlnVHgIcX<}J!aLf5^n#QC_1H)yEXd%`@$Nb3@tt<3lY6-}_7o3h&tI&(v1So4@^b{=AvFyi|XZ=ic}b z(=w;Ltz>E043?A>P*D`1AkRl`RyyPH1bu^Hnp*m(Ki)wo8pl=&+g2oO#oe2ia_9OA zE?ypG>%+STM~RnrzxKo6GzR>oH|@IT_T|^#yn3NLbD@u)?>UTV7+5X<%X032{lHgP zG~dsRTpvEK2g8u0c}()MyeyiZ&#J1~oNDhU7PlRp0H@mfs4kmHNnsunw(^`f-CZ!$ za_~(639xuwZKh?)yY9Jdg`v?rz3(_u$Y~TiKum-X2;mSHPblIEg_IKM3Nt^;%l7pP zu`CmhWnx(-hBVl{|06VT_m*o6(=_f{yskDAzyyf+yj#{@T`cpn(>c}FOUoxgJRWn3 z=-f1z1_@hn{Cq#}HTTjx6u}UJ4a?_qdrfHyT;+T}9?K*lZCtE$bPsc`bAZaC0Bf%; zkq3{qZUJ7Fj`sDAo32~nL%@-bx*RbXPTmbS_en6nc<^YkCJ;1e^ z#aFSaa%L*HtrYK`?!z(-&`xtwN@Ez3k~cE zZ9K`+T)T7@YZgxlZrdDa?51ZhifI^5U?nkZ$4?~Y49J|!v{e1eWH%TZjk*uLNFk=1 zlo(P>W23q_pVf;3D5X$JVcRx!A70|)?lHGJPH#+73bHf30E~pkQ!PjW2u-kmC=5U# z&xa5=ik6N^DG)9zNr%@j^rwO=r8w3yL|1>*Wy%4ZWKy^N^U(~T7MN-5gZq z0j>3(L&w|J-LbyXSF?032adK)_Gpp3Oc|U)@Q3;i(mWO(kA=r$qBN-n<>H^RoZZV8 z%>v-9W33Tot34?IzDTU@NYe#1JQky}q<{tU{B-q>kQ8Y0P0`7+((G6}CpD4*UOv{3 zQp#Z@xd)AQofOT=VZoeyMnmJg^M0%HMPhZS6f`%~h7t+2_b+u#wgB$Ebs0hk*O^nt z$$O4YuK)pm`^QP!w$|+sw@f+j!n?sJ>)1_NT(u%lhJER zbFsB1VLPBcXd5PBD+hqf#6-g8h9!k;U0q7TR{UUBeWb0c|EaD6j~@CDi6xg7rMLd- z_3fLgH~sXx8`6Xj9BS-f@1b)@Dc$Lo{1|bYlUrt5gVGND2{#3|tuEn)C532U=kpEY zFV;2Hx4rr3HW2zV3^?lvW>??v>dEs1TL(s>fmKWA84Kq6sV*xZI2xsIDB?hNw-*;nd*iz9^~C(}!gFO9OoT&jxw%nmqnrQ^~tKic*8 zXjAircYBY$a9?z=EeJ%v5CGrN;E_8wEc1TnYb(t8SLI&OQR>snqdfmc zW8&olAC5?{P!wUjNL*opLL})tSqw5Yg$Ii6&=-60Keel$)e;yz1>2(8#fI%R9B@BR5q8UIo zkYQQAtnBiQD}4nEHd^V~)nMdkA$^V$6-C>l@$k@@NZY{(@Z$ zyb)Jq7v88>V~`7PRFrKO1KpR=DTPV(YPT}9LY!7?Aq>GUUy)kMOk3MDznZ-7^E|tl z3ANU0*|)pd4jkTx=hyjg&Uw#s;Q#W!F4|5HT)TFyQ`0oB>$+SFT)X1OBX(dSw{K@6Me&_qw@u>C&Yh z(=?AMr6N+wf4HvuqS0uqWV2cK9k>aY*=%e0OqkQhW-wDM~3#(=_!td-d%W zrIf!^O8sdk#sNOp_$L80P0Lu8^|zfE->G~QAe+tVz&DG<;+MM#@IeloIdkTu5aN$Q z2=CWyOL;t=hs(>$KbxGKtTiXi%|J@2-(J3a*&7Olw!THFZO0qG8^^BeYIpA38JU`z z`W0|>OMp|SP7Q>^VNWm^WNB%sb%B&}NBY%Q*9nDs(Dh+TrN7YLp24<{F)}jZef;?G zPd5T=&VkY4;bF5_EK;x6dHM1suV25$aU5Q~dW8@I*L9hnpU30zu(-I$^71l)K!8G_ zfDi&91pWQDskk<0&Q(yvbMHHC=@~|mELIZJr8)j-XHDXzu&jGxX8VG_wf0A zxUP%iI3$xvrl+S7LXb+On4O))Fbpiq;@Pujbai#n(b0jFlJ)gpQ>{w8Ud7zpZx8~c ztT*@DCr_SiyLIbU>DJ6kGfYsGiOw**Nr-xdthGkjUwvAE> zkHeXuX5b)%^5R8qD`K6Tcwzf7L#{s~$ZRY0Y zh(@D$JRX*omgw#6rC2PYl%lV%k3yk9Utb?RJw24mWu%mpN+nXMRLesH0|Qj6Rm$Zu zy}iArl=AQgArL|wJ9Ow!!*yLxtyW`tdYZMhHI5!V%I({?u`G*ZGRefmM9ULXQ&Su~ zc#yky?*cF~GSUJVA0HAs9`k)84tcIojLX z866#^SS*rAB+zx8U@%BH9LD4EkWQytNqXSG0XjQ7u`G*tJWf8J$F^-cJ3Ct;Nu^Rq zDXCVgO{njD-~pe{_mg-$Zq@5`CMG5@O_M|-!J|iy2#3S0tgKM4*Xi%?=jP3u03;F# zW@cvCvu6(g4<0-q9*^Vm`KZ-u^!N8uE|)133N3){?rww-16zgQXjfMk^Yim$G8z1S zKc!NMSS;2mDoqWC!ziV29EVse)=D;A*Ku7J*L4v>@bKY748y>-Z4ASp(P-c}4#8lM zv9Ynf8#ivunED078iG4Gav(dc96Am*ef* zw+s&tGd@1PWr^MJ+mc8mxPJXQ@pzn6D#gOW0=Zm{Xf(>xr%w?=5Q#*{<#O1zO*);X zySv-};>C+2z+X)O(=>mWOeX#7>+57PnN~?{y7yBWkH?WxB7`6oixG`R-I1A@uqyxsxIhtD1)QzAV*MS^Zb%d2vzyjkmwy53Aag1t=GyfD0000#ZF}IE5MrPO`^Uz{;5g2Re;!T04}(f#E`$IfgAqSBK$vkH)IS9{ zkFlqL98eTxP6(knj*|_Wu(GleyPzaVn4O(Pxm+FyMIrzp#Ea$S<*Y2ru|`p{EDPJ) z+bEaIr_2)rIF6H(WjQp{1E8l2y!+A7QP{SfI25VM&~F|E5FC>_2hK813lQud3Lwrb z%7_rsuYIrnea|TXo(LfBZR4`MSS+I1Y@$#ofO8H2Xti2kjM?yggCYUan1%ry9v(W= z)6*FMSY2H`d2LENhGA3zxQPJH+U_`j{r&w9ob#!fnVBo&`r_i^6acH|*$+WtfT$LP@no82W^;4%`SJ1bL&GqB zN|N-hQmIVzcAa?;!4UL;ye#&IAWk8f&H!|GcXvMlxLv7KZWIcIy8yo8qyj`3fW#QH zbX}M8`Fww2!!VG~=R-k)eXUjtnM}s+nf&Tq-MziNF91G!#-4%zLf7@DTU%SI>$+J0 zP*oMVTn%K?Hy_KR^GtR4TpYoOevqe649(P1kidWV~M-fCJzU0$ZI1 z0M%->L@E772x$^R9&BuEd`z;~Fba(+rSu+SthBzq{{4R$U+Pkx{sQrgp3UlF#@O1mv}H40w~noj;5IVdrN#^h;vj$* z1TOpsyd&O`I1@k-9dU6NYGO3;%6Q>lAT|h#VF_$7Si!lCRb<`Tp7xy6bDrn%V(anr zWvmktFZ?CHob$Z>zMtpiJkN80|JcZODvyqihFnhDmzt&?;GA*Yz^b<+A+B<%{Wa=iWP5Z(K`V;+H>s z-4_V{c;@W8UP1^YNkXAeFkF%(NRkArRm9+{Lpzoh{y5UJx9i?7iR<^C8{o>73x|V& z(Dx@#o!+IYDr8v(r4)>@GN+UpWdjEWZHtTZhr0H5%q0@P&ireD@v9%d9SXO8Gji-y zW1&!hq9|3um98iXbX~{5fkE5S;?lv6&gjGI*KbU38(@6wqc>WD!S9Y9J<*uY=j#$L zxvHwrbsc^E1Gf3!AHCVp{?g=)$=@E;4RH19Coea9y+4hNywkK@@si8348|Dx`v+{Z z_h%2sx*|VJPTopy2{1NxG2FOw=g%ijo^DYT1%*PPDmdr7t~^3R~X1%g~U}9pzAvW+^Cr_R3q>Le(&6Wi&y>FFADMcoefvT$TcsyurZH1<3 zd}3n!w!`7>JAeMXUeXlI05*|~4Ig?dN(2F!Oa_$Fx?I4A`}WC z8jZr?aFo^8G!4DIy_lY!#?sOfB9Zn6M%h^a@7Dz2;DitY&UqDpuIosr(@<3vyLazK zBoe{?{rf=(DO>%V^YvJqgL4kI+YL?AKq-aAVgVuL(_RJu0E7_eOb6#2nM?+2Yinp~ zYCg#y$-~qf|FRWH;8Q`V>=AJOdAc`V-Vm-Ka;~HdHMzL6g zs;ba54VtDI5Vc_D=H}pbyWw`bjd- z#bSZa=i9XB&jhHPOJ9=@;ZPV;GgD}3Zb5QBS>AvE1Oyx$R*Mz>U4F#l@tW(RZh*>$ zk=6)OPf}P}TfxZT5xAT#V=By3v$(v7<-e9uPztb%_Nq>82~gTp%#9dhxHEeP;b0i? zt~heJ9G*UXT2_Y;0#OtZX^X(y?8VIe8FWTE;oRYT<|xzzFgH+(Dw6X_^!D_^F50oW zx>_@!InU*AAs&n4;le`%yaBkKZlfM$x@gv`-kLUoFvgIRa!6;=80;Ga7$8ZK0ciGG zr=mr$prfq=c{z`)lr?pbmuXgwKq)|8$;0V#!r$Vr+3U@ol@{;@AQdF!#<(B|0(@Q{7-O*8?XcNwRom@m2hdg~ z2m%NZ1OPz*5`b(8zyqL(Qr+|QS6@h!QNo$&inVcw{Btj0V2pz?3TFHnZIp8c&PwIH zBF&&EvIjr_KpFrqoy{VEW&n)<+yJZ_{vxf2^*g8vAP3+HfYr)>L#xSaej(3c3;+e7 gZFud&;eTg;176J8>xm!IbpQYW07*qoM6N<$f^9{s4FCWD literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/tango/internet-news-reader.png b/posterita/posterita/web/images/tango/internet-news-reader.png new file mode 100644 index 0000000000000000000000000000000000000000..ebc528fed8fa457a75b7bf853939009624432a70 GIT binary patch literal 1152 zcmV-`1b_R9P)NXQYhl8bgyoVXqOd>6rvyjQv?wWh!Z9gW|HyF+?;byH@QQiNhXMP z)BNCtbI-iI&vT!1m{uU%v03@;onCt>>C&Y* zfKm!6B|#9NltKuB@B75#ag1HD)I2)LyE;BH*el#Y;26<$B%Cq zv*S1vi^Z-dPoA9J)PU={$8xz`Tx*R|iu32sGchs2!Gi}mdGaKKgM&;?PExDYa2yBQ zwwaii;MT2M)a!LdMn;&Mn_DBkW5*8m@83@*lR<0!&D-Ye)eny2oJgnBmhbz_%*^08 z4!d{nre3czJw46!>(@DQ6XWHvlt3?=wYkGqqAP52+ z$6;t_$a($x^(o+=^^PFFckkXXa{fL@DH$3XTK6}tHGO@3u~;m24)`_NZy$ke+ob~s z4p>Sl!Z7^crIaF-N};tr=6POQx1E3x;;Vi8_QjP_+`D&=YPH(&jYmgEsZ=UxtvmMG zwoNXVqo=3G%+AgZ15;}ZIF557l}cGkDVCO&C=?0^AvPR1Jw1&vhD;{YQ9MFxO+KHO zv$M0`t}$@!+BH$FRtFM^1aot97-ML)TC`fNO$UZy$jg^634&nLzKCo#OHWUaa9#Ht z@Jri3xm^CdzrQ~S!%$YMRfG^U8jX$vjWOhMxh;uD#N%-+%lhKVl`F9e7cR710L!vQ z`uqFE^71m3N`>ecIuRwXyu7?6am%tO6bkhA_6EkY8zuvQFPfRJr{QNx4 zX0zik+qT~;fiMgi7#Qe!{`~oOZ3DoU*=!cevIv3zDP{X(vYCNIBEgFnFSdLK05X{j zy}iAT5MmVg$puhKeJX@NYfUzrC7DcaIz%Z&v)N>EaglU7y=CzTDJ5F#K3KVg#+a~H zt5K`f2*Z$iz1}f_rKKfay?Vv`{QQ>h06=$lH@kN2!Wa`q24t(%`s4on`=f^s9~OrW z9b(1QntFRLBAHCS)3aW0v<`xR2M-?J;Le)Y!Rn^8k-|upT^;aRBw~iit#`vEB+;GDWD;!sOv?QW`Z|jXM+Vx*sA6l`z zhO&5sP)KJqYmgo<(06`>1MhX_PaOF~bENmXNJ#nFzI{(j{Z|0(?GN6iheNx*^}sh{ zx8B^Mk7sjexU5{ZWUkL|pZznZNWerQS0+i{@dsefE;h zZ`$L!u$MyQrt~2e4#2Ps`aIoXj zItxayY14zZ)iqrC(jRv|9NFJ>nrL++Ep-vn=?sQmPDx3OsmTdqiEOQ8d6FsE6ccH>*^$``|xEQXlr{Y8jb5?Z@ux0xTY1^eBbB!7ygb6 zm9gRa&BSBzdBBczF>Ht0sG#p`FE8&oMC(<{sZCX|to}-p73Jh|ISj+V_hHBVPa3YH zrDk22=Ya1!+i%?764v$4*5<$VeL%8)9b2~DLM$4eoBgaj-^cfTj`#HADLOmuy%ROD zn2ysE?0mDEmtNn8q9}NthpuZhHPuFZ-`PGpzCO?XXym?|wzq~{*X85m-6)De=ea4i zeZ3ve2UQ8G&H?*Kw|Jv63NtL5j9KSSh-Rm8(8Yp-p`awK_MAyJ~uEABWhLb{~Fg7VU`xo2gGQUF%e z*RuPKJyb4AQW_2Mx7Ux*ytEou%8j#q=SAR2nTkduq?R_*+|)>Q{VJrdV%iQfh9H|4 zSVCe6iD^qrA+d!dRbIkE&GS6Iwy~A2Plt(w!`!uXJ!1uls%jMr0ysiOGh>t7bK`od z^l9=16U&wumV;pmrt*TZX`89MP2Ln3wu9pPM8e?(0UXD{_dRsaq_;oKFQ5JsUMK;c zUpm`oUIeP9=En`S;@LM2v2u}5G%ncKu#(a72`pkvm?2a}DK0+G!*zWeDT&KbnwuIw zH+vxjLI~PhR&#zRgHo{^>8hYA`2_(`wXun8zM`^bDMPkPWNe7K>Q?Hi%P15KKKvxZ zgcA!2_(<17NSD2%InwD5`Lwr>cxfs3-F-V!N^IN4wrx~ZK}9k-og+V!$M+dqFaq$p z&YsJVh-g?sa_!Y?=AOjkF}AhTlkg`oEJ5D1$(uHYDX{zq@19e+5Wb3TqmG$;0n;?G zENc$p=|B9FB@IoCXC{4B@jDj;khb$&=fM-XRCxr$a;TcW=b&jCx3@R*jdckWYl?zd z1SyyTUn{{9E{5gMapV-HY0l}Bo?gb(rPL&2r27W*p6frqAb_HT-Z|ZM8pZR_6rTgf zdXZ9cX{%gRPWR#W$s5Ju1yfM4L~*g&4t<&8&Sw|~rfD)gJ;S18C1J&5B0Y|xgx;B( z)Wri24IPyA4I4vw+iP39u2DbSXHf2qQJE~q^E~`u*XurcnuCLY9>oe?MOzeKOG`K` zONFQ{)8-r)85u>5l+$;j&n!$%{d)iYr}kcE4S*EtW5+s<&bXFIO)|!=jtP4E&NDMJ zGpBSWgF`rQ;4>GDSr>BC6bc0l!=ShCJbR9uC!)ac*`d7Wg&&(2>!kogLkDH5a`ixe z&){vFw_X#PG<>QeCS|cOLI~b|w}V};9VMJvj_tVE!Nz1c63Z^CV3;)5=$NL-h4cvJ zS2Xd_JBN+z_~0X*ox9Ee)@1>J*zj=IcxhQfEZsl8e)E>~x*`oq!ytrU_ufO8sSOAx zus*n2LL!8N=UB|-ZJMhjs;1IEoaac#8GAH6@RyU_FTMh}fD>pzfH;sC89vq<2~}5| zJ2lX>xqY=>U0KH7_Ybn?WDcUKB7h?ijzkIvPgwYlg)dAJVTkw^J$+*w-rp}WLucPS z+5OUUfC%IO=H&n)Kop3MWV+9IGBovZ*H}w>WI`>es#TV+T8rwtIKsx4Hqtf;E0R*( zXK^yj>LnG_r{eS+A9PQ3_RE2Dhn_#%yXSSl2xI~|z=nm-gb|<;SQIE3izSydEZcHV zMMd3p)k|xrYg!gcrYa~Y389BIEW^Sq7)*>za-nxXW=FGRvjd&y`rdohvS!ji7MKh) z0Sp7)@sW`e z$ECC;ftf&4fhK@VunzblfZ2GGKsk^IR0_lbzzD_vlGzwNirI?5W&MBnHm%<3m{4Yg#v)ty~GPX Z_HPiFgl~QEMfU&z002ovPDHLkV1m9yOEUlf literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/tango/list-add.png b/posterita/posterita/web/images/tango/list-add.png new file mode 100644 index 0000000000000000000000000000000000000000..2acdd8f514c199a37b7b14f53081467f88ef7bff GIT binary patch literal 601 zcmV-f0;c_mP)i&hw@usRe0Hlp%^VXF!>2}-I+fVC+BCh2Xu(H}= zWwkR-i17&Q1@?r1slIQmGmt?bz+``iz=_N4nTEMJnWp6PdlDi4$xDysihSSRJ^#HD zfm0WkcL*Ezw|WjD;wX`Y@`OQ$i> zk~|wHA%P^W-+NY=qm+O%@!?CCIP&DpgbAGaz)s%w=F2r6?z` z-r3~+=g{XtaVheZEby-7%X^w2a;hK35HfD6NN^I8P7V;(0mQ@Z@*Wtm@8FfUzLwkFPvfh|u~3@f)V nN>6CzLo>o}j6Z`3{#X10^GpxssPJ~100000NkvXXu0mjfzW5Zm literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/tango/list-remove.png b/posterita/posterita/web/images/tango/list-remove.png new file mode 100644 index 0000000000000000000000000000000000000000..c5524f7284e4ecb40cbee1e3d3a449bd58a0e4a8 GIT binary patch literal 317 zcmV-D0mA-?P)oXoi$Ept^qyG_6h*pUY)JY1xUgL61ap*$YU>o#o9`0ukRmwYg7fy z#q{lyri8qE6g3Y4Q)K4C3`{ULEziwO932j7CF%n2voBs=XUn#u^MV%pm5i9iZx-vp zUj3U@1pr3JL$sKN`)b!NVJ6&T2P)=rX|6RvbG!LMdials1-v< z2&q7|7EPNd(mrhJIwU?638YC=5iII93B+s1HZ~YlwSE{X1*xSKV-=k$mrAgvFF?}Z zqzQ3iU*Bu{o^$x%*tLn%q^9I& z>OnXX_LIpZN-3n2_`YB9VzG$t`$#D(F)1ZVsmlFIsR~3{yeuq)Ael@OiA3fG07xVf zB$G)3fj~{N^8afY1Drj3mj3?!Syi0{V45aNmoDYZnKJ}~!Rrq>3+s3wSMn*;m27}inp3P>Nnwp}er3IxFR?wOsKx<7j8YPp-Fg-neO_cyB7K;oH z4${@tHRp<%1yG$V9*;9LG=$?gSeA8FGgnG+^5jW+dU|GoEvN$Jq^nk~Vt9C%TrP(d z043$T;s7U3oS?6-uM)3b6$=6=yYKt-_VywG=}uy12GPD(SKKfRgb*Cr|Hm5ftExbC z;_~{=WHQ*H07gSI+Gs$J9H!B3ARG=?8rHUL9LM3($;I=Z(zT+GaI};3{~OO!w$$htcpVnx*B z)StIf%xCM)e%@E$a}#4o>Ek*X5C*#FKh zkvRbjt+fb+LUhJD0SE?zHM`fv(`gLlB4iE-S5WWjCkCu6mE;u9LP1H<6bl-<=UCZmwJ%#eU z&1O|h0@J_*kOIC0E>`ZLRN>xT`}3z}z$=@=)c};upYgJwQRPs&s4+uK zj1H^!{`ty;irE}&nfJea literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/tango/mail-mark-junk.png b/posterita/posterita/web/images/tango/mail-mark-junk.png new file mode 100644 index 0000000000000000000000000000000000000000..0af300667326fe1d39f54cb83bb3119fbdd4e958 GIT binary patch literal 2248 zcmV;(2sihMP)FQcH zF`IZ-m4Tzj{V0FjG3n(mdiu66*ngmB#pUn&`w!n_b9;qt*`FFLNfP991;AkK z_U+r9*$}v-1U)@lJBVV(G)#W~!MB!K)OnaP-oY5tV5F_HJjWsA)7vIZ1%wbNmdZxR zK`YZxd(Rz9|`kd3ILRm&bimj7zR4SO5sKK%mO&w3_I-B)ij0R&IQVOJL0!k?;W#HTbU|?AmxWxe&L{SW- z1hh5)F7`>1#JF|kYIo1R9S?MlXa%LcqD*0trAV zg)s(k93xFrL~)2XNuad`KtKp!Sr+D9J0FAqe#1v)SwfB1Xn4ICbOHou%8+H{%k$?hxWDU*ceu6M zIKnUlW6hd3Yfq;@0fI)OfiP-7DGkOb7_-1Q1*06Cb1=q`^YU;U7nD+@X@VU+ujweP z-~8}{kDa(g1>N1<>36>I-R_~`!3}%g-5nJQMHC8c&{|*NQc4IRP^*ta2nk9F7~`Of zfKd*{n&6Bwq-lyU3J^shC}sG{m)253_@A%Hz;xTZ?Qf4}+{}i%RK?rGO zfIw*t)9Qn|UjyeB80TP=fpZSd88U7bN+~eTK?#LY5=j!HRO-O~ci)OmogH{s0Vi}S zR?ava{=W4ucRP0G)iqsT^BmhjtyTr4&AJOIAf-ai^N^+jiHN}&2j>_JTXTYf5CbU$QYj#% zgM2;@(jYJ}$mjFOc?I}>9lk#SN+}%2MK;5CVgPr{UNRzPkGE90lDY5^Z;PcdIEC zOqx`Bw7pO!LC`?8IyxS@X*nBl{N~w+(j8GrBL_l@EZ-JNdf~6*Kr|bv%ABn zIhHSis%hXCpT0kVQlXt0Z5GKyejNZVxmj%8vh(;|Ywx&l_WbF4mM&h#U<{-bkV?XD z)L~4MkYhWD;uv+mjz$n5jw8fLQw_~h>M7T{*$a;2f^m*rd*6r}LGaX*>!114GQvQ;U56D{pcq@Sk>84TJ^%OH*SvOm;ta_%-J+20LX9t@a%63`Qn-da~IOR2X@DO z?;Kvg`Q_IStpE8V_YIGpe_R_>gb=5aIQmFPc?y68kOI(`k7CjSngpBf(}C$EH~_Nr z#--j9PyYB#*Kyj%s-tf{{rGb~ZEZ?UdrAPJ1w3`Dz4CtDTp(I5XIMPx34j*d`a?)m4wZ=X8($$0C(2te5KXmZyxV9we|YxitgW~MUsi|3xWc3O63W&Z(W W&%hkgQ}Gx80000dEy0OYIj5`MNeIL*+ZVkt}*@^?mDB=($=Uwc=523%k^l+-2M!!Cd}SV6x@7tChWaFnM&e{q>ykzg zAQ5lCJqs5j+1Mn7kZ|1+IOj9S3k4gR#$ekvq>y-E_2(j{6@KIGo}+s{EekmM_MsOq z4F8*R&eiDXN9yLyQ56J%%G){R`@Zr#PjSvwphE>lI)3DNrPQovM*)Bm)il3(ftJf<004VH&1RwNI$YNU=NyC(7>0o$;BZ|R8`eD-N;W1ty8rRU z>-+on>$3`wP=ErY3^3W(;cx_+ro*zrm0+ccxd;M|APAuA8kkN2D3nSrY&(x^HivvZ zk7BV1+s+}AxrOy>Hd>Yy`c~78=;x;k&;URR2?bSFL>X*52jBO=7=vYnAcO>^1X4+b>Vs*N^S|B??OrmfPfG{*L5tMzYv5F*aaJ7sT&A~!U$O*7>0pZEP>Rmaa=ij z$r(@Gs8c@1XBQxN?t_m;#JbgOESpV3N(o9Slu{r>Ash-JQdb8`%X5nmQZ`Bv1ObXp z5uWD)3UECiLI{|q1)p<_e0Uk-6F0*kWLWBCJAjv_3Lrqa4OuAo(}I@PCpN6#WM#8y zI8G6iQc%h&zqbu2KXI{GfK(EcGH8r}X*x7UL75JX5kw<#n5G3vDSYnX&0~k9>*iPP z-2TjPO%d+cvBUr76W`u(ee6GbPyFjxDHcm07E3@W1*K%wq?F)10OvlkxeNlqE94Z6 zX%%t}IwN3Ahv$26oB~|e0iz6?H$6@XVZWV`fvGrn$$ z7WOtM1s2Um;fGI&S>FeQukt17v2#NM*x0riQc4h_08nrqz~>y686X;sffQ^g0K?Dz z2uah#%H6v`=!{FY21-hd4-Tpie*D7e8Ue2!*nf|%>3c(=@RuG~v(aj(Z$u_@3sMRY zQtk>})8M!zc)kxpifC@052Yk}2L^EO?%hbg@(R?nyJ9+suA_O^E^>8XU_*^mrNncK z7cKqzmWRJ;X-vcD=*MuJ0;H6XQb0-pr6hF5;CU`M_u+XiN+kzM2oOr4I0w-*L>_u* z266O}M?f^KyoORJfYk^Hgq&!IHVcR(n zqCf~mzF@=meGp2(7(>{y$|F|<5JJ`jE%x|v;TJool-$B-v#_;~tL&M~7y&?D==#|&TY+ldmCl~Ul}8_i{qDO}qH7%;$Q(Qf z=ggTqW+12t5dg%?FTHviz+h#~R8od=?T|@(dEXz~e@;oik`hGMp*XK0pG4uk_W+a! zk&+Swm@$eK0KZ~%3b|JKKb3s4fXT@4NJg2)#j(M``&)MHn%gKob4F62?`}U%$uz5C tFR(aC>ED!;_o=ebPYNOka83c=_%9<#|31p?VRQfh002ovPDHLkV1hzD-8TRL literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/tango/mail-message-new.png b/posterita/posterita/web/images/tango/mail-message-new.png new file mode 100644 index 0000000000000000000000000000000000000000..9f51246f1e4fda7c307be20aad49365b0ff76280 GIT binary patch literal 1605 zcmV-L2DGZH~+1fe34D)InGs0bt;cm@f0s4Pk(N)^%sCw4xZx?XH&?fsmY zotblaaJ=k#*G?jkc;HA!GjqTGzjN-rb7$axZ0boGpF4MMCY6l+)c3tl8)J-wLMR4f zgfJAerI#9w+Sks1YQf=_JSY}my3jc`#F1&f}Gb8ELZ(o1o>yxQe z3IJnFUmM41^Q(8x*GhAL`rZqly}AnIP*!rMaoEDJfp+iH3T~+)8;=ce;llS{$mff{ zdG*yd#)BZhaU4Vh5y2SKy{1!&cs#;i|NI?yZhGPOGsRj9rP6@Gm&+L7h2lGB&c2p$T^HAN2ZTigBQ8;Wm1I&elANcy`mJDW>|Qk%AL;C5 zpy6Zu74R1k_wOk8ebT{u)t3<8aXmbTiuaL@q zTZjH?0$tMDI;2qP2+A45bTr@~s!7mU-xuKRi$D1MEvP!YEtmX{B@=j1R0QK(@iJ60i{&CVuJCk4}tFWPknAOJ_69W^*9z z!=@lY8*p|OyNZJ>q4j+v@+D=|#|dMUQK}N6(oyizC@YDPQN36E;>Gi`W233xoj&u` z3CD489EUIr`&>kZmWfE;Sc;XMY@0m3F9~DN-70{H^7}Gy`SRt29Wj46bLO?8=Xo?5 zjRT|Zy$`ib7)A+#7$(}ru!-R=+WI4bc@8Kl$JrPii8ks=na0kx)YU$Kn5`~;;fr5B zqO_*Awe`rf@7{-DNZr-c!;q=T6p4{Z>_`QrZTw&zOZ|;k0}fdm+1sMTt0Z*P;$W|^Lzrd%!) ziA1`Ku+!;ajOjXLL5`z|fytnFfHEHOgio^>5+Tm*JCi;ccR?w_p#T7de1Q)aKjhfc z$4DlV-Hh~#0zJa?Tr(K+9Ev#=mxxU3j?kHlCtbCmFcg6Pw5E06sD0AcH4a!H# zXs!1VGyB{FOdvAO^71lsb0-Lm4Kk?J_a5jSOew|T*~2VcS-|tWfqfqY!9dwwzjf;t zxm=EDG};HaFF;;mQKf9(xwpS*UxX=`E{NDp;09KA+z=@&f_(&UHSUXLe?m53YZ} zd2E2a9ZQEwRMsmz*nYsN7f+E&rn*znJ2fAz zeZ<Q?f^++k?x<-!+Ika*{wHwo(0!+Mu91y3Ygvh0vnhBGC&%LKJ@>l zbpQ+SfCjJ*Z0-FqiT3!=9r7QT03qN%^x=oY|DF8{sI0})3|3t{00000NkvXXu0mjf D5aRw| literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/tango/mail-reply-all.png b/posterita/posterita/web/images/tango/mail-reply-all.png new file mode 100644 index 0000000000000000000000000000000000000000..0216e390b695e8b2be13c662ee9bfd8b035f56bc GIT binary patch literal 1946 zcmV;L2W9w)P)1gKa+&TZ>J@?+Z7yfUbbW@f#9)IF7(b(8ztBNYFv%jK6jixA0D!LR=(^6#%nVMa^J7)w!|%CV9w{Ld3L&M$<#c^CfNk3Z0s*qw zESXH^V^v~l*-g`Abo3O}ejk>tVhT`H_3{8qlQlIp5sgO4=kvH+t}7N-6a^_IgM)*t zUcDMyO0tsH2F$@Ej%XLNK0Iwf8N>^7`CGK{qj84pv zE!h05?K5|Qty~shsX$v>8)IW*7>0qz<5^K$RaF#4Vej7#ap**TSzJ{Va)lD9yh%$S zbjP|opX`PY{fLrNgX-fCJjQ%{ia=e2t#?1nnoXYrs6f=#*3#bIju7IaEtpEBc>2Xd z3{II8N>*hpEI#A&Su)u?z8c+E9q`=4?%j`60KR*>=jO9-|H;|Ash7}}UJ{8IFaP!- zT>8_rtl7*=VuqSv4dGyzfq?-G!@xAn%8yA%oBeMlh@~ap+S=ykZ>j(|P=9spHP;Xc>o~*=T0lp3by|8>hobI-MpG ziBwj(ZQJCG61$%LH*Vd_j_sSUq$FQ3iOt5S57i@Wn`izqgsQs86eZ^irI0ObpHs2I z6#!}5Ys2-;sOA*mP=M%6oKSrmM~}WqyZ1aJ&)-TpJ%zKXk=ot|@O9jYrfJNcH~9V& zhv?~S;pX1ej7-kcQt!V2C^hf!xpI8BEXFu&U*rZ zK-lfpNvCEht3KkhNvhlmdZLe(o^3R5{32EUAhQF11U*dD2=l<6K0d#7BiHq`^6vN? znS7a$U+3u18D1ZVF_RQDHPqACSjS{MODbPRNTq6Ga@wPs>Mjl7rrTWW3YxgTJeTxU z)zstgH8GpaFm!y7jjKwmz5Xlc{(9_k7KclxI@nBK-zz-&s)zgUx`~#?5XaBVViYYb zA*rj?*|@HiRgrp}9xv&<#bi9oe5Qy)Qz;k*sZ{3J`+Yxo%5lpr)T$2qjn?k=V9@X7 zy^($j=_2lGjhc3j*JXkiph z&P=B%nHHt8plnGjabc&poElZSlar^WvQmg$01idhetC6!OSQk&p-g8_Q@7bmAt~?# zyu@N>DS5pZvnO%;LKI{DOr(80`cjE|ziO_Q-4CE$)vo=ayL+`aI(-U75g54=LO?ECrnPMce?8v8n({&X;bvSlEqKK_8Vg5w z_DzpeREND`O_LH&<|$hjLujgkPj?aWd(hn)6YodM$>iLr#L$cPTKV}nfOd6<`eT1> zKvz|XWt9*@A}lDBb^bB*S*jzOscGxQ8T~uSQ+>=QQ;gMoiT6`}aboP8EL)c7?P}37 zMj4}Ip{WYjbv95}t5Z|u!WJfpM9Q3)h+6sF`F-;Pd+#gEj?M!XU@KdaDR)BlKQ^;Reb$2>Pq|-Gf`$`TRSajLxH$b4-p;6y~zUSY0UCc*CYn z&r~AI+1VV|uKg4T4uT-1GXbvZS9<%HG=*9$G@zg zR4bQ-~n?szLPJq)#d_K>y6H~nP-VBCOK(TVPMC$d#@M%4MZss=!-ze_5ep9FJ za@Jr8iL`Ad4?MhOVWi~+FDN0^ z?0s#7d@hG#3v`zY6&uazu9|rHk)Jl*^3c$cqvn%6UG2Kp?OeR}BmuDiQCtwWmadbf zhf#9D`vDZy(J?YI_PzBz-5#&*0R>W7lde@hq?F{10;8j6OxrBK2Bc>W?|HuEj@`q< zC(gXGs=2|hDvA?`EsS)<`@6DIfbD}deI&qi*TJg{@+{2vMMfd%+rYQkJ7b0cu%&C1tbk>qTJ>iuwW3^7 zsihTaFRB))y+A;VkPrwV1QH+w66LN1TK1-tt;7XgeoG50s?`=HHEEJ%*PGq^87FoU zkL?+cXXc#4MQqE7o!ubREBZ-CGe_Ud_de(SX3l~C$Co{{=E>8~JSheS5=z%}v6GjT zQkTuO%dV^}hkkR#JO|lFbt!uc>UVE^7=}*!f2XC zHk&09i4YEl(RA(d005Clgh(VpCX>N1jLSOFeDC`{QYt`i*j_G|F-?3YG&GmkMni z2(}a7x`6-&1xmRHL=2dIm?p37o(kaQzr6hh zgp^dOg8u$~IyyS&?(X5KXP*ho!sC&L#47|+nK2hkN)vr{OZTwW>0(n?fBS^$Au-6s^?R61+FjgYyW)62oQ}JEY2_U?7g=V zjYjKQy}&A37oE%i~)2YV0Qc6D^< z<`cUOIa8a55YY1z60L5mNEqsR^W#7E0!Q$9%J# zojzgC{Ov5@)P~h8T#t4RY!@9s7^30f@7?oIba&4$zJ53vv0cfo&Jch9V4S&=4;-q& zyR}hm5^wwAv^|Wri7HS8tFZ9y;|~?rmhbxD^rT&N93@0!VQauTVAihdKxsSi&kFz> z7FGc>^UtSV@TGGsHGN@ic0TLr8^>@KSYhJ>vuJJQ7Y5iA3nw4>NR#^5!ou>5+&DWV uZTkE_0|2;m^8Rd4MQ#R;f6-cB&iD-U+TB6hs=z=10000`yhL8Xv=YZ@wZ=5gMB_BA zQ5znOO*>Qjm`>9+&NTm!{?TO8=?FH_)L=Slr_*T%tJT=}hKLe@1?(b-EU@glz%K0T z?mee}z}|s^2C3i7oqO+@`+dLP`R?yK-#G+N&~kU4kPJz3y`r$aodf%4kMr}$CwmsMHG*{^&fUoTU@KIlVKVROJ4rZe!F zeF(d1pH>OPNQk0{(a}-xJP(aVGcyk1#06&ofJ^fT#FYNgWe?YWFGQ-IUkh1b=yUm1 zz}et>jeyay06=B9?svm=A2Fq4&+hNS>-ECt^TA@V%pym~L@4^tl#;5dc^Zh*8?nCP z8UFV_ex6is%fnkoFT*_^Kt{423=C0a=Asl)g&|HWz~1M^=JFLNEh$53Nf}B?N+F37 zoK7cPE*H#Zv#Nz@F#;PmZ_j(M2)D5a`x}J+0q&$ocNmstH5Tn!QpUV*c(Js%RSV- zSc2iP5Ip_}C}YrxJQT_x@Em-TAxs9suq`*uRk|c0J1ZN4Ai(KzsudB_#@N`zrz6dW z-dvD?D2m`j9lrn01#H`}3RKF0{_qkA zRgh$qaHrpcjYa7TDP0AWL}MO;riSOc16aTUuJO0g!nF zdfWoK$A|IqmO}K6PGKq(g+}0ES*F3?KC$D4^_keSIR_5sIQG?@M}FoqxZR^jOPjk0 zDGJ50#-o_E=BVcP`vs5369*t}4uRsDKb5x(irBp^2QFV2<5LlE9KrG=9WLDHMZ8vl z%`k>bmo9-)il1&VA;dUU>9bcq%7CL+CXkbnj2q22!_IrXr^oJ`s{)nttx^fa8MKllu{^)0zwD^p#YpNC#+_x zN`io(a(xB5?A;NMkG748!@B?|F@69TFw=~RYwGn7__LKID@;bC4g;PkL@7g(Ndx!T zByM!x$FE<`gUAz5NFlt2*N^$;L4}STrJR}&zIUR0x#{=do9RLy&Ojw<>GAIhtX-j!k z$~-Xu5K60$y`d4LZ$7gw69b+AWM#U!B*Y0geX$Ea+);$D6lE>s`%n`E0gN%UwRhv| z8`tT=!9YP@|KNx@cfZly`G?8b-;&bm#?P%O<#ny;Jb7T^VKcOp?kl$>o6me_&x?k?UU7iq z2-aqqk!>~M-1*DFw%a`;oGkAcYCUrEQJGT9u(hF92C%QV=GYa1aG!RbJm7tlBjKc% z@(OZv!`=XrZun%Wz%lzTr8B>n+FeG400000NkvXXu0mjf$L+ly literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/tango/media-eject.png b/posterita/posterita/web/images/tango/media-eject.png new file mode 100644 index 0000000000000000000000000000000000000000..b218e7ae98c95b9f25e52421154e803438405f62 GIT binary patch literal 987 zcmV<110?*3P)_AGarUp`cNzY|w_fP8;evZ5le| z)jXxsW1EpkWC(!&VF&j}k~DB`V*K{4g`2i%nWPr-q!qVEtyZNUZhh}eOpM?5`FsOt zwCS#BNdv)PFqBN5dOP*PnX@maC%lzv8H@>FOaK5-y$;hdaU^ntUGh!ou4&L z+qE@!U5HYt)WHJ>q}1V1@Qcqrz20Gz4Ajgj7{lLEqph>o+W~)j0dKe~3%-|dG{GQb1|1_s8q&4~yELRV)O48y>cEAQk% z&RNF1x!Kv-s#^@#63ooZ2t7SLA=9z0UpRkZAQ~MMN|h2sQ3U54oO>EqkwX+YL{Wq& z2(WD%-Tof*_4Rsxy>sWuaR1}q3=a?M^YimfTa&vH2!%p@zvOL(G#K>@p1Hfb5 zft?ceFCu1er|ci7&spvFP!5;5ZKI^?Hk;@Bh$O z&cAjvnM^LVMIe{U1poxtKMM^&lB5=iY|$YiNs`oXINVf>JBcu`H6CQk1{x_*x5j;N z)j%v33!HiJ^lzjqe3@o5|lS^OnWL118v10n}`2q1t!a2y+)bHwBE_6bCz zQ4&QFS3mjC)wmUiTtqY)b^SkZRX7nn)GlC*?YJlGV;_$${sfFEWW@^W3)uhw002ov JPDHLkV1keW$yWdX literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/tango/media-playback-pause.png b/posterita/posterita/web/images/tango/media-playback-pause.png new file mode 100644 index 0000000000000000000000000000000000000000..1e9f4d535795bb2d2afccec95b0e5ad1cafcab8b GIT binary patch literal 481 zcmV<70UrK|P)1uoCLv!^$R=$F_1r5`T=3!q@j(2$AuqraX_xA% zur~90u(eQZ+1WWY@6j;t!{lLx4+3-M%=zErBA6#YbD{eIe2HYv#zzR$&##|-K39Bv z_vz^)m^6X5Z3XcD?Fa6D-vLngg6o$rXxmo1-7bo`lq^<25}VCeZf-XJbTLe_z}3~& z@$hNdv!C`%({$3sFv$X|)hYl4h2x$M>%UzLlPs`YE_FB&mt{B{l1{o9CRt#ySO_3U zk!K%-@tmkmYD&L!k2h|?`&qr5sP7xZ=ftonHdi7-XGuA%#I@#!z2szeJ`sja1QT1 zAsh~`D*C=xER!tIbzQi>UdUVqSwILgqwBg5%Oneo<0vyj5@t1$4r^l^N5wM90!`D% ztm5^XS10>s6;0D9mbsJ%{|C0)ZJXzLey*FQY3loa7sDhA07yDJuFkpe7-r6#Ip^{R Xfk+A`Fy8dj00000NkvXXu0mjfy?@sl literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/tango/media-playback-start.png b/posterita/posterita/web/images/tango/media-playback-start.png new file mode 100644 index 0000000000000000000000000000000000000000..66f32d89b59aed6480c4b3682ad57055828498ac GIT binary patch literal 1028 zcmV+f1pE7mP)pW=oQ8_HEoW$@{l6 z<6$?75H{PG#)J97oaVjxecpF|^PLCmX;1&L_!jfc02%;z<+1Akk)wS*9~ru4E-jfB z00)5BO@L4`*?OV9z2l|k=wq$R`9EgY*VhFA8-UssfCG;wPftyK##>qvPb@CZpNKR! zVPSr8P6#1Ua^&Fy3=SScL#Unx1_pG)(7U7(#{&Mk^!)t73VBjWoV|MW3s|-VqKc1$GmiVKs~G>_yf>H5e1G3sdz(p?c3pRAW@ctnM_8o= zqtR%Ik{CGW;EaQF4#r9jD5W5!fLHWjJ2qBU3y`Xa(b0GG(Xp|^!MeKd0`+yTB@&7F z$jC^|0|SJ^VE}+q5|(Yjb}ZPo1;=&Zc@BgqLP!ZH1x5soYw-DMz!}HF{DQPB3!GRw z91de`ZEe#i*D3+TVlmwQR0%HuU+zXs@SnC$9UHj6ze*NogxG{X@)Tvj0 z5JKd-y1G^>tzEqXh7JWlDhZMV2?@p+q>#9E^QOG~$wj-qzTv~OXUX34k)D{M6vXOrXzdr9xh(`*i{OjzkKqQ@y^c9EPyN#J@DmJ5dZ)T!+=r}nx;bv zg)3Jsd+GG=w-2VCesgee=njA!5mjaPwg7Zp2j?1o`te5b+nI07c)aD@`{yTa04S7; zS8ez901O@PzBgw3AMsy!Lg+ifKY}4*-0kpQZjveZH{;O0fl>=ZBQDG+vZ>VCp yE2R#gl$M2Z@g4mi+)_#@T`A?;)uMa)-|0_!Dtwg}>0a3Y0000u4^P)G>juCK3$14!cX>NBo> z0Ot=LZsQLD#K#soJ3A9V@PNya_iSs>P5fU2%;$55ZU_EEzMj8{zfVU~Fq_RJ97)7c zjPD|AzjHU#wpM1d*+KH707X&g=Gzh^;y5PK{>jzGcE_d-Em{K5z8=MHiydh0f>bf2VkY$;h8Sdh?Z3&@8!3hdm5a@2SQ9L4! zJ4i{G8CjMMtAWL0p{p;KL~%q!R|g~!u}0nYt4o5k>38O$16V8;!*-ymDw$1*B1n=k zlCQrI*qG_gbkj#*Hl?bnVE|=Wx|tCXlO`$dzGLM306Pu9%$Q6j!vM@oW=0f29Cv3> z5{}bdBU-opRBvjas;Xf%&@_$A3`vY9lWop__k{Ja6u2BSqiLF9JCNtO%%;40^YYl# zUt~5V&+~%-NB;*T6~MT!>2kT;8?RQY+q$lA`o^Dh(nlb33ojc#??e+0(ZD2zoP)cDHi%=gvMB&;s?bZGJ(^tISFTU~lW_&*1uZ2Qk z`5yr^H#awa`SRt#gTQymGiL;$tBYuJb1+}Mf-TDcr64{ZJkcn8i3H@aF`B<{LAe2( z_$nUHavb+8pU=BG!LBFX-ripKL9y78DVIlf4G#yo`g$UdkHc781XWeQGy&6ut*S5= z7N9+S3O<=6v7R1p-SzA5ax6QV3x|z`g@xB{8q9hC(P%W*TPmGzK6NTYI1cjI7;HrW z(KJBUR}0Z~z%T$+g_O+#09sC*2=+AD=lFPjnYH8Uk?Ab$< z@o_-YfO6T%RRDAij50O`e)nz?OeFSxn$PbEhr@wQ19&{1z^+p1!-m6$1Lf&y*sAIX z8HOWPfzUJ%T?a7?z%W2%8RoNRP;TDDw$9E#YpL`R&+`IY_M0n!AP8Pw*WcljNtknU zj>uZ;H4RWz*e_ndeDny0D8dj$Sh*au2M-`LHG$Xlo_IV?hK7bbwRAW)0KebQGPWHh zmIZTu9)x89LIBHhoKO_lk_0FUD5U_U002UqiQ2LZHW&o4?Pwqnpi4_jH8;E~Kx1R0 z1pstu3Fg!kU|Ar9fG~`cR|;10Dg?s-w(Y>KL^vEqEEcPIGP*7S&+`Ul*`g&$V1vO` zAwmckhH)*Gci3PMmL!3)Y%v~>(}soyb5j5SR9g^ks53M0?AQSU{9)!5HyDQblPiP} zc(!kcn$N=&gqwmOX#M^D)}{bXpFUmI+S*16ckeFqsT2sut-63}m@4trc8-I;wH1Xs zca~{K$4D#|Q`~gcbAXz|!?((^JfS>!LIdga?@uagUlFWo0{~(Feki#d)n$2N`P{h) z!!RT_k#&#aWHPBIL!qCQ(b4{BSC`+{)C6OG9>lg+XG{TS^HBlI{nL$BS&2Cg1@|sCMPGo`pJ_Sdi(bGJ2DxeuCKL?d0$Aw@JY$5?~ zDh2uRWBPP-RH6I!9k081@kT0@T3B!V4PD2gD02Mp@Y~wetKa(L@tyTuU4Fi~+4(vE zSds*Fb{32G?v>TW#c9vcqo2{UXD2#3I!Y^J&<*I+gd=eF347?!Ax;#<`g`5o$Fq^h z4_S^YWC<~{gcwoiA%i}z}os& cY=vw52ERA~Y)(&y#{d8T07*qoM6N<$f=9wbpa1{> literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/tango/media-seek-backward.png b/posterita/posterita/web/images/tango/media-seek-backward.png new file mode 100644 index 0000000000000000000000000000000000000000..535c536157f692c05014b14240d09f92c76b346a GIT binary patch literal 1074 zcmV-21kL-2P)zSz7323WeSe9|p*R z1tyCx_Ltn3o8LL-ckagla^%SIe~13daV!8U01E&HK>7*$Sz!Q}^UQgbZ7;We^~%Nb z8i3N1_~bDb*8_OAzP|SLww9KgU0q$BJNL6a#eIJ3cir9HZyw=ig#xg-T&|ZcUb=AW zgAaTDl%$lVX`1%xYnQeGl%2$9k67Hq^Sr(BY{Of{mZEpBT=|H1*VNJU)+SU{eG-1w z00BU;+g;WAjKlFodwaX3tFv2BH3jQ`NB}hG1;a`FtN{c-k;CCAtEztf6PL?%?&{Ug z^hHG$Y;C2XC^85kV8HAj!#Erc_ha~312~Jt;;N~sdZWN>y4=&#%Qv5Wk!Iu!Hq)B` zG%(EWH>&{vC`*}h=i54q3eA__d%u@&Zfc>M=?$!WhU>`}(du z^jG7^$nxJldDJ%;4Ghoo*dMU>OH@`?D#_&9;?s6pYW&VvgUx0mWv((p2!*PuU|DwO z;=r;Tbes-1M~3BXMgDx^&Ul0M82<3^kRpmvk0eQ{0|BvEOpV9ml1?YgZf|XVD@MXj zpU>-bSJ!d{CNnf>poD;<4=1LC;``ep%EZ{+w`Fb1bFo-o%6u{5UqMis5K~BoYfq zsr3;`m>J(aZ=)<{_|yO7kB_R+$bF9}idh2y0D(Y25k>KV(^(Qqti-No%VPi3)KpRw#Rmq1F|?Ze{kp6w8Sm_Lozqc5%=`Sw$q98i zB=!e`LFv$dUHpFkc2!mF`cg1F!%}i18WT$+k+7}&^cjxhI80AZs!K~@&%(lj1OVZ1 zc)PZ?em%4lo}ol{BX)neG!l*2%1`b1Gk4Wr=NCN34gi3;xj8Km2y9eTys)wy5{C?W z-tQ00H>rxst|a4pEE@0g`FyE^e#J^CBo65XoqyrC`6fkH*hC`E$K%OI{G*QIJq88_ z(g0%l`T5^it=4gl_x2i%#&`63y>gUakdVe%mg_a<9rUvwQHL-%I7mlFM++525h$gS s$KzQ)%w%tcRo-I$y&nuvJSs+4#8yWLZ`-OVS-jKRwQGX>OM9<#O9%YBbAnfjg#Y+O}<*0O%y2 zNF-v()S`}KM^A8Dnzzci{=RLp9La`4;X4e&Smkorn$FKFkVqtA@wnEptF0ZB`grw~ z*Z8_;>z3d7{dVg!am^RQ(ts?>p04W_0HjhWHKr;v_|?mQyZvixRFQo(rrnce+0Ezk z_7e##Ted6~iHPs*YHP=MWgL!cBa>Omw7mINz%(Z|jOHKi3k=GmSt;XWW=i_KqiaE#>N%F5a0j(cR!#wRsaD32*9%(1R;cn z!$UZ5;3ISB;a}aR;~ZiFa#&ax(;0)da4h7lZpV@4-aPZ*4f8Ca;4m310C?K@6 zwY3d}k`B-F;Cen>*MVsnkfaE9Y=47WoX*t!@^fz+VM&n?Y;J9BgJoMF3;{zJ0D$W{ zkfaEcjVa1b6{KLBO@2ess@&an6X!(Zi1G9GRcL z>VAIyoDoxEpG2eDm*H@DqNYGR9;dcbT?+;TfDll>D#Y^v=z1QfP9Hb)yxy%Q;)mp* ztPkEFI5H=H>X@PHdUqm~`dE#q_c}W}ON0zFQ1Q_bup9^9_rdZ!s87+|{jGWZ z#T1bk5x(VzR{OjF~_XDgM8p3P=wZQmrH%iTS*v1!X$ zNs{zrGC60vYh~&s93CE)D5YW`5U>hb{i5%i$M^5MJ|;9g%)_gf|&49wPjUe1ID_Rw$MOqQz%`!yX@uo zu-om0vWO49*ne_zl9^v-e)G*Yz+C1sm;ZZ6`tM4AWXhZcU?lxziwwXGfCCr>aN|LE zc|zd%Rpo!oB){+IEC_`{_Yxog3|-gfFIiGt%{Y7O%<1nQ&LS`?FHf1o>Grc3desZ% zW1Mpq3Wa7{%m%-Z+`B!ii*|7kt2rzfZk*CDg6Acm6es|;lqajfXXw;;gKP@ zU7mZa0}8;sXwia49$mcH|9HU@Wp$hVn$zJ#+ws;IfaLx7`ptgL;c%k0?N|&z@-Bfa zaWckyWo1vl>Grta{pjOQSV>VSjYPvpCTH&Z&-uFq$jkwN0q~ZT6fT>WH?Q%f7b`rk zzxD=CS_#|=jRLS>A5kjoIyu6}~c3eLGD1Ax=% zw1h4I0C!?{006qK3qr^TyFULCx!zn1-xxwH76X+e5F&vP0zxJ)jjK$ydAWbrt}o#8 z=3;o{FT~>UNnV=HYeFN8F-QQw7=tcS0;-~>08P6sEApoe{<`t==Q|TFrwex70ZL^k ziUL(tp{g8=aS%da7)G2(#NW_RKYl*YnQ$37S$Uxe%P=y4d~uf&RX$%MUc~Yj4`V?S4Es z=cx+VY_^QRM1(G27zQj$?*1uoVMFib%T+r*YZ^FnwmrfW2327IA&^pag%AQlh-6Ps zPj{f}!iGPCy;VDRZXfve?CIHgUBEQWR1a{@A@tPKh(;q&WCeCz2j`O2*7i*lz@W$D zIW;(NJwPd0fALax^~;s7vi$soG#-zE0uVxnrfF6%7>ovk!9huqPWATo2Z$uCzw}#o z_3DaO*n+9NCZK6r>IyVX%Tyo|4QEcom_746Po6wErt5lNpzGHieFIllwjFOdcl6ky z@nj;IzEcj)d8UFL9UWsiIXQiSt_wS^^j}%odgAE0W35Lryr$VEpP^wGnI?3*yy+6z zV4CK%YiVg|NdOqC@>Pv>{rJnel9E{Y{;&5m6&IG8j5FqNILK_g&sQ~e{fD2|#h!|n zHy`|}si?5T$ y=I7^|;c(bSDIMLtd-tse;j^)Gnaf=Mll%?cSD>I{@M-Xi)=?z!ODL)@&_$;rhZG9p}H#bEF{vsMx#r z9dAj|g@S_oR{`Vzkd`n&0ATN)J)gdCb|3dH>Kw0uh)A^ zykC@;zudH8!-i)8JPv?c%*7kK-;!Edmd{(3g~`aoJ#&tQkkcvRv%|H{j}9Ez_T2ON z9mU?Q?~9_C3wzJ+lO#PFzfkuXFiaDPnK(A*7jUhuC+V)&c2$;bf2kuse^WW^n8n5U z&CB8+YJlT75IA6%I_8sesHk{bYHIv)4*4wa*}<+3xZNk}1A1gI|-g zW)mUg9zH`XeF~T$2mk<0pM`@s0OEj249sY=aJgJKcC1nA3|!iI^yuehlTSrH5d`~D zLWn&;z!-z3Yw)c0prN5j>J0q2v##z)Su_@}=Xst00MGF$BRt%0H+TSWxm-{b3L6ko zMFGYD#u%n&r(u`|O1!0fUS6KEZ{LRp8M9x?G|l_?8EpnxLKeI)mh!o|c}ivF2USj| z6NCV!X#fBym64sDZ71M%yBVdn0a27di2c1_%z|ZE$Pz?IqKGR$btPL`nsoy5u}tMd z%i)`wkLw)I9i>!$4VNRnhHAc`W=2Ba(zAOy^^004rJg-A4lBS#MFV`Jm~ zp}$5Bjt-B;N=l0kJ&3QZ{Zt%HQn987ERM8LZMIs z0K8uBBK%WilW#(2LO^J zL7_4LV9qqr{%xB!8oqsT_|}kbWF$OTTwEOS`FvLT?6}=-C@BMTrioLhPio=t=*2&V zhJ7O=;laYf!h3j8T*att*VhdlR8~N#3`(h;fGo?5Dipy`j}{DFjZ98Ps`^6Le~8E9 zQ+~hSICJJq=Gg_Mlu<>-wNQ^1yw($$nv7QU^)1b-stTFPAcVl9J_Z0#>>jWa@OV6o zQi@RT)%yP4UmGHk$i#^gClXlVZ%8R+lv4Ef2kUSCHr$}=`jWiQ=VR5?)w&??$~UdY z@77S1Rc^Q2;sJo;xLDv)&y&eyQj12T(YCg>`NbAai{rT1<<6_i<=OP~^h9rPU}NSa n&+`nx-w#@6MJrm-f1-Z?`FbtGeH3p!00000NkvXXu0mjfz2!gx literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/tango/office-calendar.png b/posterita/posterita/web/images/tango/office-calendar.png new file mode 100644 index 0000000000000000000000000000000000000000..7817c12b4fc33520ddd6159e18b9cc23d9392c25 GIT binary patch literal 1298 zcmV+t1?~EYP)Q6g>oN0e0U64`$_;xsfw|&F}l0EF${xHC^RpC zSS*HRS=H%sa%SMbfdkUAtPImM86O{?m$7XkCBWP1a%pEE5D44?>XcFo0w9Dy2yw2x zz5VlV3Y~HnXOnlTRjupzG#ME?vBslkWPo0J^SMl$Mq;#;A@=UuN6+);_*+|1O7Y9(%QWxU!Hw(J>AG=)r%#_w_8m}4A*7_d zyj(dPj;%BOX0<>{*-*Z08HQ| zFQ>1s4}m>=n5M~^x;oL_-Tf(W_N4%trZp^IzMRCgr%&p~^XGXM3UUALUGnns`2N%> z0J5^O?Ef5(hyK1k+gu2NWm!~JR^oEG>RzP<)n#R67>UFzfM=l)y*)kr@!|y!9z5Xw zy?ZHnAp|8QCG_|A&jRpxJSe3yT3T9`%n8uk+??ffI^W9A&nKRy0$(3K%ugL1+`4lI z-Ql49#EBGhAq2(6#Y{|05Dtg!IY{PfYipIR>tD}?nb1TtMNSJslk!n6Z8C&08mCtG2gO@m10hlhu`aN&ZbY1+@nj~@@(0H$fK)ODS= zr}p%Gq?AG_g=v~Zqfx@)Fi)O5As7r|7zQIFBW5CzXaSUC+D&UlM@MBK5SW*_5CW&m zh3;_RbUMk*%p@~2lib`~s;jGc{P;0NMMbgR-rkMCuQq_DX={BxAGdGcX7lFFxZSh9 z8}n8q5+N82Qc+Qn(bLnjB?Uk!wc6wHP*_;Vl`B`UEbApp{WD1^S-Ny71qB7t;czqp z&Ln_TN-YvXP+wpFM$D7aG>t?efl?|D5J>i6_vcS zRiy$_g#ZcKN<_RActD7Eo+|z*60{N$P*71-Ky9E8r6p2ZL=zf0E;X_-sbhO-BnfXYS=;W_D-Se?TQ~9Q%4^c4zMQ-S2$&%rX4Ghr};F`L!21t5kj{;vR7#+1rZb z+!l^YCSlIM{nN*8Y$MQr{)M)dYGv%qiSC{!A3mM<*pV($NpoAUJ>N3xl0Z~b;F;Zl8n{n;0mYYI4#Z2z$yM&Dn+XdM8@ zNJvORNdVZWLO6$ujxhq(VO2n2X>F5o#p7^KTQ$E}ItVN`BsrPT_!hKQXr<~TVyn+) zl05dnDegR&CSocy5wH%cEY=Fv+PZRKsAd92E3{S^t%Gx;F-Bpu!WdNpjbh+< z4+*0&I}NSTCYVcyBh26K1at@#Ct-Ab!pXVShWjVy)-Xl~B%=Fbgd^}^9`&CU(6I-a zNob?_`77`7_xBe87@NMut5&Secf4dZ7H(pB-u;? z=inPZdL7@lh=isSiywkY__I3!y%T}pymx;qxwaOr&#tnxR^sH5{S-DUtZtN*S z^me4_XiGDBv%sfCIDRO{=;W=?8wzFJHU``3fQYKU`9cy4t0nrnT1jXfGpD9l_G|mS zBiq7P&z)p{dkb^Rn|QwEuD%>S9humREi|L-K|rZ64YgiCF*>zO(rC`~_tsQsDA7i9 zw!fFnvd7fI2F^i#smM_OL7w{Dy`)m6v5(j*1wvEfA+S-Z^7?R|2ktwJi16;@a?Kw} zqZz!ri+euO$sexFK(&j7Hb`z@8kJCz74LebJ$vU z9D4>wM>a)5Yo=~)B<6=-E(4}Uz*+CbXD_~6{nEL9299-OjKtdOdXpJ+xEAZXT8=$0 zB;niI_s-UzQvyeO+j;WA)BNhye>mrr#y=SOy#?z3{B+&>@S(vco}2&fGjCM?m0xj{ zs_$-Bc)oS{g@XI>i&yR7`A{La ziY*teO<(@a(~IM8{1aFKW}D5~0_1=UkYtBK^*@9qu!av5fLnmK+wRZ=J7l--KWzBn ch~Cfq8$nF?fikgHpa1{>07*qoM6N<$f@_f+=Kufz literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/tango/preferences-desktop-assistive-technology.png b/posterita/posterita/web/images/tango/preferences-desktop-assistive-technology.png new file mode 100644 index 0000000000000000000000000000000000000000..70adb92b52046d77c762d785d9eed2e9d8f48a04 GIT binary patch literal 1835 zcmV+`2h{k9P)|e=~D-ZLhudg74m75{CfBH<@79hN^1QCY20CQQB0BDz#EWK}C7# zMG;c++DjVsPSt{_l&Xm$MQSP<;fLIK2rb4ja=gI-)SJ=e=UUhgegSuo?0@^BqkR%pLVkEk5Av) z0MK;u^^(F&`bO8@%Btg!xBB+fS5V;B?uqTJZZJBv$ZKy8>u+9}STTjsa`o)D#sORl zMd{QpTJ8^3zVPjXzF)oi4+d^blg{c$A(2ubgg^-FQCQ@{y9d+xV49}gt+|wf#+?=X z;G2h(ZkoZ~D-*8)hjJ9?IQEzLnIC;Q_~#3QT)i=kloBZfQVOIH2p1w3z@A}x0I&fJ zXEdx{wXK*xoI1)^fB4s=&nyUE{?j)WTm?)af=vxo41YR{rj%va10ie(DJ+AzDmZR- zMh}2tVn_>Merc6dI?Il#lFa1XS}m}U<7B^2p&Ou-L`k_0;n{sK;OFT_o7q_#;=_>{ z&cA;X!^qz~>j1WKLl_uBkW6O@6#6j4ip+@tr@6+JWn2k?aA1VskE!XV>!={MwieuWkER4d4L_`);jV(E1*0tk=w$UCQNThSP5hlF1s3-%enFYuxYC z*j^UM1M;k;q@}(`f{j5at(~ufOYvE>wFGjZapX%ed` z{F)>qup(c#jf>4rpG^Q9WBE$d*Oc-7ryl0w-~?l{3FeoQn3$YCKV%gkbG-lwDbWxZ z&d&8b-S6%Kf%K}NBtA{?-6JjBoLJ<&!AUetv5-iiDM@*0fY@@10-qvWQOtdnCG4mS za%*OZcdm}xDQCFng~*d&qXJ4=5FRD=@2;UVP{8T;hunBrTuuS-y`wE8Gdh)JMF?S4 zLjjbP6mapwN%x$xB$A)O1;R0Ik4jQsUCP8gFVnF0Zy_6LB6;z}eogp0?ry&sKm6tyN+PAI)Ldf-#&xV+dtr4y$#;24gI29`? z-OcxH!9ry0I>(QlpsTZ+ciwx8y4o;Pwa($(3`@na|0=Nk-e2_U8I2KO!? z86I1}uPM5kYFrg^O0=dp)KmjNBod*#dK-t2_RxNy4S@CoZ5%$@LwWT!B9X}5T_DK2 zcnDZt%kb{tB#%D410e*F(FHd?{FUsEAZXXJ|CWNHpOF+|=y}079k3%qPkzDQ{pYY7#14a@}#H`Uq#wo!O{BCTrl+ zq?5SbyQbR`YZ*QmnYaCK#evh#o;yQbZJ720ZLF-Os3}@zYW80Q^jQ{{tZW$^7~(>- zcViYvLE@9?MRtWl_RThr!&7Qa!^AKR48tU=>tuDEK;x6F6gM&*og!SlgXX5ah;*Di zp+!Ok8NT$z&jTwLD+^^=BlEhY$V0!98&du0z zlV|=uxkOiIH(An@mX)$=R|EAs>)E|$7ybf20Og?yiqf~#-(LCsZvowP!RXaD zUO+t6^Gn}A`F9StXwUSt*zWl3?ZubQ)7sifBod*o|FY|j!GR&Bqf>NscGKG0N?-qF z$Nj=v8H=hLAA2y|@x)KHg5V`kQH0Js~m~$@t5?GP)mI`};=R4Szk0o1x0G@{<5MgaNhA`+)2B~A777L5nKNfr0Nj>CsZ^Tu z`~AOoyk5Bj&r3HQcApDuUjeg^Rs8qCV^o9&2lzP^SICF z+h7G3LLh|T-Me=@dGdr}vB>l1&&lWWXqsl*%SXL+Aq2XvlgVW0?(W`Tn&xpUuDgst zo0Jm6FziiJQ&V_69tH*m7#kbo!Gj09eEHJx_T|b{D`Bk}hJlolQmOQVWz(Dv5JE6H zIf<_83=a>pZQC|fWSWYF*cnQX-|Kqoc#NIl+-YG#cf?g$oEFFin&3@o{$U+{va*n^w(# zb)e0gH?y#?fKsZaE-W~vAe+sSN~OqVvrJDqqVh_g9i`N+uQ5d5!ao-;^HFv_U$7ckK1b(FJ2@V407qxCCA27 zjk+FdNx{{tS6NzG;{5sZgu`KW@7@i-ty{O4otmHf-d>@`cXz@@!2y<*mIwxeBoYZysT8B5qs-6G128l+gv;e>c+RRR zs0X*(jbRuB0s$hC2>0&YtFUj~x|MV1&NVvbCt%rDK-09(hGF1xx$1u1S~zm#2wh!W zghC-AkqCW#eRw<`Iy*Z#dGaI=A3kK`#*H=mG)=SKpaq~EXtNa1ipAm|i9{mU-QB(6 z%a<>hrdc6b`C+$j->xXgLx&Dk^n9n@uW1_1&CM(h&|75W0OMj$%?0000`O#hTZg(^?UiJlV;Z{ociy@D9|6fVC~e=8yB?Lr0ZHoth&AiywO%!CH@P|JueaH??7mAqWa(0G0GlJoXfSxVa5uEM2Qs^T7QNmg!3X zK@ebzACR$F>#?e9C6BIq40XzbYaSwZ-@RCCDFo#+P)UFL(p$+)o=n@#ZRGP`(caNs zrXK=Oz*;XFg)vxbXliQW^47~(yl4p*{pv!p+38s8Rh)rJdTTA?QYnreJxWb78TWgY zXFwIKjn~cyMxq2aEWCl9T|L~s^ftr@)>@n^-zqBUS9jgd(PPJWbJH7q^UZO(I#-wJ zy`f1&qW>2JM0j}ZI=26NJJ0{^Ia1@sp)UHmM~c(+9d~tLtigqjM;>2SQ9lfz??5k; z(^D`edMWqk+_0COb9~4*TQ>ranL`VxTWdF1m0?A^C#!~y_kPx&D=$(pkMvFbel zV{Ctae{W-BIzuWou4)3`_v!8Z3}bA6+?5B$@7nWU&Yv@FRQjDCd|YhiqZx2+{?@Hq zH-urBuBwj1THA+n3jk0yAha!8_b%}6Xym6t*&tJ{{cFnmdN2pN5EvD}8HiJM>>V3i zh3L}nt(3~zPqwr#12|`1XAf|mDwpiv-0>cOhqxO-c;t?Y_<76h>ULVRR2QCVm#&a7 zz7NBYZ96{X?q_?5^0O?42@u7Ku|+-)WCFm?E||%Q6UXuW>UKIbj0nbBuog%}HB>ox z_#i)>n+19(=5K24yi`T!f()d7aQr_*0OFZaMsIX%Hj|bPX`P73FKp`lQ^nHx6 zthhJFl~-NCl0W_e5yQYhp5=e)Al=x=q9u#ivwJruPn=|0b~+-0H5OHeLqMf$CsgD& zgyBE;zkOF9n}#oA2_Ul5$j$cc+s7|2Tpe4hp}xMJ=H?$UbJk2U=?uTV`Wl{o_DM3C zG*C1s0URh;J8Xw%|K|2?Mu;H*g_4^klSvL8Iz(e*BgPm!&yY%`sH?4|rY6bMsb|yD z(h{F=7(QaBSZgcQstz#JPFJkFkK8?fVZy|TBs`C{#cebT2tvQL9p0 zTZa*Y3W!8*Hzoj}beNbmdlpYT{dnAt_JwRVOY6MLF~+j-^^G_eqR!F%>dQFih<+3) zE!&s?di#2rnrZr02~H2^9G_LO>=6Mx&m;fU0DC{GZl|M(kt}-z0R0kV!uDMs@sqhT z{;!>mCVby#+m5|)OTVlRpyowHm$pB-6WIBkik!3isIn0000A996~})wb3fmE*UyeW5<9lz*deqHZ3C!)8Uj>Zuwa1* zSdoAQl_~+MiqxtV+X!|@NbFez355owE(?%~3N1k@f~HXtHwhteoNw13&(H7K@9Tcf zuyA6V#EG4#JO0v0_uiR%&QIr@Id?Anze}vW866!hD#bz9_eZlV+nXeDht^sNDKjZ# zqNHj_OI{b4i6lwJvm`s0S)3pH-Pl#YJTkzcLx<$WiGRNa@=)*2r>u@0U$njAHayS8 zmJr1;Ssc-7H3^#)h!*MeLmf9t^{ZE}nQFD-*p~gVlybb;YM#)B>q3iZprmab3N5w? z^vJQJZ~b;%fYH&>B2rf$+y4SVXFu1g4l~u5g=&LFvw_etI*o8dO3pD99QekF#r|i8 zaJ#yYQnIwP#KJTGO{TKHA7T11Q&U8zPb1EsC$ViJ$HB90T*tw4 z99-MReeuQnnppub;-2U{P-g#r+-JXwuQg(3201;AoSH(+&cf_0q$wDK@jSAgo{a&7 zln+|Ni>C=OQFNXvp{53qREdi6KCla z34N`Ufe?D1`x*cTzIUKs#Y$>R2hy0`$Bw@Bht(7)X}MYe`EX&5SEo{rivTR=}iETTK z4E5bk^&J4M#p0W9l6>$1$mPer?>)400AmbVYtl3&NfP2XCW<1$FeHj1eBWPLE7!j0 z?Ak@~@L@Q9901RKG=Podd#iR=`+$_Dc<><2#YN(iCzlucJ~^GSuerpRw4mR(beJ41 zZBvO8W?C^5QNr~k;YOBm1Bf;QuqFblyTBOg@4Q3h)mI7P7@qkoKPoOTFnNKTlgBR< z@Ph!qU}027J&qZSW1fg(8c{?&j;W;y^G?Q%yk@dxxEiI*NOcdC@B5gnbr*ovvibh| zn0g(aej0$`%L!?u!P#7Bg*Nz$3H@=*4y|#t#%?rlJdgzemcS9PJ=x07WjnC8281yA z=bxwN#0i`?-dLW@=QrnhBQ-T@Cc(cF;a^TrHG5@hH3Cu^ci%oHCogmAy}u@a{fPmr zl@Q2W?p}a6j-8iY{&Co9wJuEEoI2jKt>=}Mg-W0XTx5R$xd71+h`Aap#E;-#AblUw za23FD922ME*!byFzc_hvyau?V2fzJ_Js8mOvvvw!@5d@`Lt5QPyBleBQZyk!vq9@( ziQ0uZD(C0XXG+vBZM+XuJ`am)0FE3vvIKkw$N>T10d)MZK+%5VY%GZt2UI= zVblLyC)>Z8$LLOs2{Ae(tv5;QA$9=n)&O1xAh;U-%04yhdxP7Hs<-bmba#D)e2_ybhcpejdF#?07vX&YgfJh@mZP7% z{l~X&0c|W7rUIaJf9S1Sx3&%L9Q^b@Pv(caJN+kI*WP7}=+3n8j6rH6lx<~;Qs}cl zbu&ld!tL?!TjE|BmWwPMub?Ryr2P@#2q8 z6|bon({ZDw(I9MDDunIT4I`rK=72(eE|Q5CE5rT&T-);6N(E~*O>?K*?tkwY3D@V> z)lDicE@JitU+3K&?_RX=u?-c#gWCBVH#V*;$;tJub6Cc$-@0P1e)0SUYx>kO^1Mzg z)1WUH<)lBx@e{pj-@iVMHvQ!>_cy&#RxVy-X*oFrcJEgG!GPAiWg}gFKc;Eo^HtN* z+%n{HdMD}Ua=u`}s+;oibK7pe``X)IeEFx&?_N9KswneNS(Z<3jtiI5;_bKJBB43( z)mCfQ7Yuo4MSF}XD{isazaLdpNI`wQR**1$WWw3NQu+!&Wk3av(LtW zwrI)fP1B}T-LrY~ZH{Ehrn~1PBPm5iO)XPP9PHV~v>|7aDRhYm4pnqXM~ z2q6IMEnBv@(U|3OIT?w^l_8D8#_7&4y>!*`>2(#GpLqNZ$HxbcQ(7~Nc{9qvPEhWv z$LaQvUtCV5uLgyNC$|W<+li5k@MUWo?Ok2uExQK!>@(z4RA43&^bZE;!`$7uXr5VE zkbj-a>B8?HIC%e>2Yx*U!2J1Za=p2ZT`xSp#_MocOsOozYa|$o4AFYx1l`>|Os=ZI z?e?GnN`X|0Kz|>Wh;YTiM&{3J#8p&4e^nKU?b}JjVnhs`pU?b$;j{~iYOAZODhB<2 z;_;DR{$uB^y<^(Ya@r5xdDnFXIUW~EDFAZ4IkdI4GZ)5tH zA&-pO$O3TYcvdX^_CJ$V@DQuz8fTo5zydD<-<%Mn> zm(bdge?a|t1`&xTZ&OSAy_!)YjpJtpcU0)o27*PohmgsrRC-2HErCue$H2O zK*7%DVGP4SDNv~NKGA2TFboaLw5YDB1eG4ahOU!L#0Z6l7>>jVb;tdMMg64}lP41n z4&6M4$3#k!w9m7~(TOE&28R;}p^z#?M|)ScDC6-sPd@(^RW-E?^bV@N-o&2a$S@v{ z2gA@7nvjklWlLk|~LwZIeiSC zMci%|vl=cyWm15W%&5%e@V>)QkiW1D>*lC#^tU=~J!z)_eE#R#vIc*< zdw^I%WXAJ(Z*bYdl$jLlY3XO`loEQ|Pe!i3y5b0^O=XkI7#JA9Q0fmE0E_`}s`w)b zY%#&`$qXW;kWwLpVCIb39Nx1(zGQL1F{gt!s(n5k3Bf?<%{6Nt{M-~mWLqgE1e(;@ zy5l7AlthfC=YNq*?TmJT?LR7)EGl)COe$VjTwF{fGE8f0dt1^FcLQVqq}wT)kO*my zoA14?5lrKpci6Q5>}*H_Xt>a)mz0zc7z}Xq=y9UM(RVDvdHX~6KGc&1ATu6qarTHm zI5IR*0x~H`18_PVv>a{`0|SFQjvqbt?5nT7{ys1~s-I>cL-hwAHBZRNxdEhu83l0g zz!%M*eEQk8ojZ2!0S1BCsrsf60wD$4R@NYe%nlyL*~!p5n&;6y`>P-v4x#HNMFqu3 zDcP|8(T9N!zz_5RV`w&&Qi)I~<4R7~XJG2Q~uG);tu!hZx#0@1UjOaoj%DNqP_0LM8} ztOG`7X_>Ri&?*6u*%O&}F(3eRXWoqqfQ&&ekONrf05DNW0XFH#W1M-P&B}iPMitMk TAr9LO00000NkvXXu0mjfwl7Ee literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/tango/preferences-desktop-screensaver.png b/posterita/posterita/web/images/tango/preferences-desktop-screensaver.png new file mode 100644 index 0000000000000000000000000000000000000000..dba245586f2ea2eae17139b94ac13debd785efa3 GIT binary patch literal 1878 zcmV-c2dVgpP)16 z;=RAwm<@v9*GG>YeY}UjlTSXmO(`||^+zAcYOOZ~^uA|gGsTTP-}*_Cn4cc|StE|) z9Zx**#1cRU$$P&wpU+z%1h2jRE7+s{&^eZ0eakWwO*z&jA4 zwU!J&`tcFAkME#A-*2uiTpa{95-`T}M^VN*@3>xSaObq5P|$eq$z%d*wPweiDFNRS zHjFu!bi&h~zdY->@ZJYpUs@%KBJaKLZ{v0dD5dg27~-9$wA{ejghnF;866#K(m>2#d)33x=!CWMsfSp9!5vTIdkR=&bfRK0q=c28%4r<$I@~Y=L}&Ov2SXS z&pbHA%=-y{dTEW7l?u*z_D_#8I#lAtSE?9eTUMvQ*-V{kJpw#yYjxsSb7^Ll;)e@_ zVJMO$*_6OQCX*4)IZCBE-aD3;SDC%Eh&!yAzw$2Et_^f7d;9b}jYfh`6QEWU=*4;Z99@@t8@{+LD4zzJ)=RwMR7zWCDN4eYtAW1AU9|k=8 z{4y`T+K({~YaP~l*4COB<1ogNB#wGL=JMqQPMx|yCRpKz-+6`GcC4axfVGbK`32rM z@g`9eDIniNzkwAR`f(;EV7Z9WLJ_TFQRB}vi*3d4X} zE$+B^ZLNgz6{=Oq>gpPcizSS)NU4z$gb)nmEtzO1leb=BVywyhRZnTT#M#s57#beZ z-AULTf`Sf$G^?G%7?4tNva zuYB%pw&ZDnh8=zP{zWEtmeH9Jyi2Gzb4cl^R1DTxf*?Rjxpk9Mz*Ze-oJ$i+v|N7v z!YbA(8jU8EN*(7M|GYH855D~h-}v$=UOTy$citN(PBaIm=QwiDMTWNBkM{{mR46Wt zA%vj17Gs^Gh0#mES~H-O#@UpB6zP#_HsjWDb4aOBN>Q#1a^mfM9J#m3=RY0ssYA1P zFNiW(qP_JIog0cgG(h2sBy?R>}>m_h_w&6SD~c zXZxj+_{5SVmLSjs0kkj7HgH?VCgl6azQrS7dX)zb{u%4D;K4h?ORwL}3ojqR`2ejU zlkt?xO`Np^TH~GTy$g&nIjK~dfYy`E1|2XEq>meQY(k!S;fwtK_!k%&Si!h}@@l>{ zFVH$A97T>&xry^09Y~VImgvR zee9X1pZ!f7$NB%V&ihzn?G^+n-Y+13Bxc{T1||Nk4vQ# zQb;Bz_jF)!_NJti>}Mz%>I#VsvERQGq|?Al-4Sj>l53C zw=q0iV0gH|(BKfcY#&MoR4S_!uN3`>*WZZeuFM~sE6$wFGP}+PQ1zH#1T8a4wha&-L}WOeP}$nvI69R;#jJuUD#TwYM(L%se;q!OVG}(E_al z6>f0<%?PwT)JK|-5v`oqzJ2>xKA#`UX0ru{^Nm`gw7R;ww6L(SNE+w1#f>iTWHW%9 z5$Gn;CK0rx9ozOEp7lhFTfmK0|0CPSC2-@Kc0vi(zq+3FjPLmq_dnbI4O1Ut7_+M@AG@_&HMcZ_&*Do?T=@le|8ne$bCFdH`tcFh!MsU zkf8}{;;~;o`Rk^+26$?Ji~G5U>a;ln?Afz>qaaCpB}po&sHl){%Dah|Wf=?%v1km( zj~`dlDRbG59XkfTF8D9@eY$|-v6v7#{QTDHFJ^j%<}SkFu)O!h-@onldEfo+ckZqD z@sGADD=Js;ZnuK;L>juL!tGX2TU+bmL~^8|p@Ew%@T0Gv34$>~L{4RdFSEfmZ9i~s z(X0UV_4QuG<2YGfzUlrZ}Y0a?zNx%nsiJ{4{NXlQ8Q1d0B=va+hOc1^9Eo=Abx z%;Gr8K@dcUq6kqC!3zSeT^q%Us+F?O=YO=me)p!Fqo2Qec6m4)rg78mAcU-Dpx@he zpf&WuL)HIbgpLt{5*J5GrUUTZ-R-wI71z4j+t*@fs2_fR5R`HdcmaYSKomu!Qb}}O zy@Z~=Zj48+fe^sw@jG~l`^%m^d&-A`n~Fj0A8I9=kG%F^P2=_hXWyfYJt5iLEdY99 z;ayPj5aCe*p!2#6?A*EQq-9whsZ-VA_u*SwDZv;Rk!I|H zbTa+)=`*Ji1%*Y3$2CM_QH+cX;?2MALvzaqXg%>6j=uK~M8;xpI2`Esyaz#V0p=Hl z$n9%xt8$H>-o+SsnK5=b=a@123A4;AxqFk@Z4CAeuOkHj!$=>#)PB)O8c7rt6{CN! z7jGTjk1KtbK|m15^COVwhtuVR%jtq7$++Bc6@~f5ShTo|U$CI`i9oFNd@>b3oO7IF z*4ap(elB-UfPslL8@-_i03aL=+k1ZZEN>)}5JV2g|J8&;1?JJmM&g~n-?z!PkH3eD}>ME zgUhABlAnI7o$k^RPuU;scE;XptPBLPiQ zp=m0dP8SOE=OY<6Kp26`p}?bfAqvuDP}{Z(Epc$y5@SWkT0AjE;?LEf+!*uji9V-spwLaE%o)!)Xo`T%a$z`W#)aSPoGLiq723uG)+ZJje-z@P^bi! zWkHW?&~-f%Sja(0lMs~Spz9jeuC0@)z`wa~-@Y4W|8$w$(T*MaD0cTjV8%>SPC+7qJ z0F8~!ZR!?a9LLct5dUxX$I`N! z1yzfI5CTdmyj~xYhJjQ%1&(syI1U`g1IYBk)P8U&Zoad-v#{}K)5~)zK~{JG@{T8; z-hZX{%Hg()Z7HwU4^7uH^Fi0(c6%|AP9vVskxUw(lzcfCvZdfS9v-(FwrMV$ZK2Zv zL;$X=DgfLs?R{m}g$w7~Muvw?x8jDLosa;e>%o?mmhssDgefXcQ3-%FHWndQdwM?(2K^i7&C7QN`~hMl4R9Pq zAP|JEYnd`|6rw1B&z>h$H3n6U!t3?gT3oAcJl6CE05%f<|8+V(K5q684zzeY$~ws* zJ3_@FYMLepA#f{hL?YKfKp@F791aI!u_)d?^wvaIR~J`PQ$yO@FU?<8zP!G*wbhyl zfXtwnVi^E7HZrEQU+VlIe_n9a`1rWDsHlin6a}*EfY<8-09dApk&$5>eCJK5s`gu# z%M~hJQ0l+jb9o}*7hgVl^poq(1vvmatGQtI6tw`DSxu{|s<*V9e6OG|KiW6YyQ;12 zi;29aBZ+t%A0GQK zo=zIu9)Eo28*>4eF1esw)=qzQ?de&ouYaaal%%H!!D>qBxRFZk-udLO4$b8JzsddP U+P+uMOaK4?07*qoM6N<$f@11#cK`qY literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/tango/preferences-desktop-theme.png b/posterita/posterita/web/images/tango/preferences-desktop-theme.png new file mode 100644 index 0000000000000000000000000000000000000000..7af777d6e727df53c6aec66e9a206e9b695415c1 GIT binary patch literal 1530 zcmV(xnu!bSr0DZ@Z3@bd%Ul zQvZAJ&3nVav02Ay^QQ>D(rEnN{QRBod}n?$Z{Yt7%E< z?i=5G`IS>mpXvH% zHL8i9zk1;Za{z&Z2*{U>>xWX$eD#HiQF9<}(Xa)hW22~%7^;y#HIiE;K{TE~_&#AR z#L0~bB*fexy52g@`ltv+J2DX0^{h#%&I`z!ou_BQhVN6cQ&v$$L#7z`kVi>ZgPZ3p4H zJ^w#&7I>bA>$>1el%T?;H{T;HTypcbh-v|h;yp^CNkS_XY7Iep@DPq|Bb@(|140O# zmV<3O3?wWPF_Yo?Dyk=NU4b5uJhQQks;b0e5ggmbv7Npt=yPCdYHCnXlzG>6lTymQ zjuk~gQbRO0v26z_B{54w`VxP!L^5WfhJpy;u~u9lntK*s%5JQ1cM+f{%H>QZlRR0pmSsXidj2ky@bP07!XQRA{Zs~gx(31s12vVsO)oK;b^JukN=(DI1`aHz)t-}iA{7bzv#Y!)dczx>s&Ih>54X(1ffW$x-#zVq#Gb=_*`f7^kR zV@J937Bn6;IP=ZZ)Yfa=_uH}cwQvYn=@HN&?UdEEH9j|*Ls1kWkq8fpcia2_C(v== z(p&-S(__5$hgn`Y{X93XzRzOzIr4LbJ^_hP{XwVOo;A>MphGI9B$-HHJ2qi0{6s%* zzVh8kfG-Sx>6rhfGqq5C@YC6MF221(s0Y}<65#bX;CWtObaEic`o=o(Sp10sfO`Oc zEB@tPrMCQfp;Bl*Ce8(#fCGCtj+4m*j%$-lCUy&5>-;EG`fYz4c0G;_!z2(0U>N3} zN%wCdKw>N(6D=+e!-@eNEZ+xBCUjH*^&zxp@db*Fq z^St}OBcQrp0iCOv0SwR{MGvyM+~*G^27X_!)qY&a-?_2_hX8zF1!(M7z;*<7D&ynh g*5lfE${Y5-0bQP}s^rFY82|tP07*qoM6N<$g8H%JMgRZ+ literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/tango/preferences-desktop-wallpaper.png b/posterita/posterita/web/images/tango/preferences-desktop-wallpaper.png new file mode 100644 index 0000000000000000000000000000000000000000..4eb744ca14466c1e1154a70c9ef4e69f6f82f527 GIT binary patch literal 1788 zcmV+3lVs8}>10mk%(;B$eBa*7 zhjZqZGo4iML2$wP_TC?hz5e^Z*IsME|GTJ-i|@Sj)nB(;$=5{0`ENP6zr4aywZ=-l ziPqXgVeS_vUVrm=AApy>{^b!b7tDR{sG0}rmG_vv)neC12eCuuF6 zI{nT&ivaGbQAg~+=up{ctvPr8EU*3fByk)AaOT|w5D)~d6`rH8Jw!?=q=&3KDyByw z#)bk!1hInSYM%f6b4*T5F)})q-EPhe0-FISheAG|7b})Vv%%iI`zXdmthM~`)vHX7 z6u9$2oisBKAsybnQsW!X?q#UpVXR@LUgKZyU1e#pMqDgPs->`My9U5P;;0ZKR%kSu zXsxj#Sg{0A%*Xdkk}IZMzEOE701KSCxXc%hme-hhbpIa4MkgqiVpL}1J^&Wte6FBG zEcJQ=?Rbb-L|}M$h{tvhGQZNm3rpDkVCa+Cdr(U(J{^oTT%Voe_RR`$p`=jK4*)3T z@&#qBrP*vzi~~eK#By+Yh@HbBs0LqrdXj5ZpL3TV&cw`>D!WQ`qA28JyQe7+jd1DW zS*1~>RU5rJQ4mMDoMXk(YBg~kw;Mzvon`&etabEm?a ze}9X(P;dm+7|`qH5{F^rT5HL&45a}jCuo6%-bY zK}(84(2~;1T!O#{V0>bX!$+PZ2t#+vD^L)JVdRPk)>@Emk`SQT?k)x*#p%DE;@Z_~ zgr!4-T2Q8qxDh&e58YY92BYZoKA0BLDsn4dW^8b)u#W-gJ7@-C=;0InAf`(cQ+ z7KK{(t`rBRVw6&NzQZ%mKEuq+Io_JNN_Fa+i0YE4lM1+bFl}^N#jX7laSL3zbAu?i zLaq>T^w<$DT{w>)_``hw99ItnUVs&gQmUI^v_e_fQFaj9Wue}zGqGcg_`-SGrh+jY zg4y37%0<}(L8Bz=vML#9pXw4MN%uAQL4fCY1APEM4|qXT+cEvIiPE`ZpKM!i9&onWlR4+2p11JFuJp66qYMJdo)VT{n} zBs5!1thF4O76PvuRK-$>%KRn7u?QbtyOeThciJRL8!-mo^U-?!8LlTHq2#(QnHaLP zn?AFwOQq{}&3u1-n)lA*H)gj7&`D5AlXeoUHMl{9FL$fkccuZ{8B-~EA7sX&i34(?nA1=lMvNvd%iO>Mcs<3~Ts z&OJ|}R5zZCv0)zo?YPZ_g*(OZu^nB9tUKJ;a7eGc865mHk01UNBJlq0%e?WYpCG0U zC?u^ix$84LaqPKu;JvzX^X43`>oofSD8-9Ef8__i%(84PO@35~0?Q*iHTifH5yR-P z6a9jgcVfo4w|z^0aJ(?%P_0em0;f&&Nl|LX9Or=|}+ zc0enon4P`8$+%-R14F~?e&Pih)ypLHyD0UpH!+ec&&_u-x=oS+vL29!0?@1K`@ZkE z&W`bk3GFxzT50y~-LrP5080xgjaGwBV;)Q$Lxct9=kF)I!{`m#chV0N7jTU+x;#9* zytKG@%yC^Om&>b>@(AVfFy-`yoY2cc>*KaKR z{>15-*MJtV($gxi{GgNV0IV{UryGzVy_lGsoE(qicsvZlk<_G4v)*hhFE7`s)oN`6 ztL>iS8nD!xC%yk48Nfy$t026duHLQNW6STY72RN4rM%VCgzi=RM+|HwiuHg}toKe2 eDi6&6H|5`3M+t?AzxPT200004586~}+~E%RpejF*Y+#5S?x5JDh8j7jALl0ZtJOGFD2 zEp0@X6bU4nwn%)b1d&*(mbM77NItJ+d(L_Hz6byBCcenv)vNCcnx=Y#Zg{>e1WO&;jXI7U zR8%#gDB6U?{ikE*UX;@FPG{$%ng1C;TiYEqflzR>M^`tly}n)f(u$?}g63K(f(E*# z5{su8J)Ne1U`%%H`B&;-&tXMM`J`>S5ANId_{@I=uyW<5+jNii^u{}H@?L-4`rW%eKAQJv+NBSGu=#?tSdd&zfI7AKW#ofAYwJ z*2Z6K+43`AQ)9JqYG{Z=DnrGbMk0Qd&VAjy`0Afou%r#$7bcZ+m`a%}o)_TSjtjM= zZLLPnzGL64nX^m|o!a-_7Xnzd=AMUEuDtY~2Oqdy-`jnFWX{ELVR(F!+S)nn+OZu| zi_m`c^(3Yy5SkZN)3~C^$ME0)r$#4P)KbSy>pQd$dX8Qb3N1+to%*2boK=<+@95Zc z^TLZ7{_xy0KQ;FB9wl7Y!sQKK22TxPd!y)v!F2o#zF-K`a>W@2QJ zo7dk+MZh4N&63Sp{9xmwxv4YB8@jrl*nM7r6)Wxy1%k@QufKkOrQc@&kVvN3eE;w0 z>FGyGP!y#!UKT#3lnC;DQc9LDzlet){t?M!64Nvp9y!h3o1UGRnv66YKD^m1{$Kkv zfNt17zw@qJA_2b_Df82Zf&qGZ`Z;-W2d--(rDW~eHTm(nj@RqO@Anf5g{Y{gAQ%j? zb?ZS?RYg@*Y}=;3u8I{a7FNHv=h%;dUl;Y1+2U<&cZ3a(=kBk6b-5^tyRPK<7hXh4 z5W+zS7e$d&RaGIS#C2UP%OaP{kxHdVBocT$22x7KV&f=^f}$v-(`kPAy>*JJh|O(n zcj#pSbX{M!?#8PORsH1hj-9)xzvwCyML|_nG)+TQRU(lHUauFQ&xhadFL@vkAQTGW zO39Wt53qgLUH}}&!RytT-&|v8n!dVh3XFh%!@4goQys^lcmF|L$Dw~xa`n>r`N5io zlpv)f91b%xGlQzC=(=742?m4s{XSGh;nua65cKIF9WvQ0w(YQdd8_u(z{IzJUFQHO zLbNqDM7i%*PZ4Rl46kBy@v;uGrd%Ez81n9i)|FaCn?wKKTNU9s)^4IRGgXk)BK| z{N|5coE#d%@5Je7@lx-ZE&&w1xMC?~DFU;jAf?1KO-$3|>MIvx+cu)=LM%rCLFs@x zs|JLkO~$9w{+hZb1}ztVY?!$OY zRwl+KB~o^m1+a737xwQvl!}H7(pi%^p-;MtD=tF3^wLYD(`lNUn+b=*XGNlDnM{Uk zHp~7GkC5=UQdj9Gc4BzOwVjvC0$7%{^TY1LuC9VW(z*XQwrv+n1b@KB=eO_&Y_hp= zcE0lpue|zua=8>uO-%#>0fZOxv#e z)Zce?=N8SYpzD;vzTN{QlSzbdiPX#xsYwv7&bO7(B&K_ux8C_JZ@l#wwmm~M8ZFe5 zLpq%%olb*vSu`(1Uw2;$+y{DlpRvl<03aOwq3*wSCRE3wI_zW1?ieQrhY-T0qH>y0 zWSWY~8NyWwBGpMMYf@B2(NGG@fGC>+FHkkx zeZK0(mIbSB4Tl?+*Uhh!^A%L!$AL*;6mUNapjZc0KqU|X!a&$C0@2#qrOP5!^RM)H0`-cj`&5L-kv2pc!PNB!hWOw{^Pi$$P>t*AgmQ5Q&94Mh!wE|@j6MLI>qdFjmD zdygNcGj!~9I@b6kH@WBBbIH zd$})PZ2*{3y#3^ZElte}X9}&|!aJc*h-5NJCX)fc=kpN?g(fw=DUnN1VTsw;b;VNO0Z&pQYkC| zC@D}fQ&g5hFui6P zQ>!Cm+DcI-1)~-CH2~jkf2gQDoUxg^;yFUm^TxC-uYf!UVB2=Z0Cj(Ss&Jq8hU=8} zMp+L?C6JR);8@q1qH|kQYB_9MFp!sAQ&Fbpi0n=4#&|*A;yI* zm4XR8AW%v&^P=;)@t$`lJQJi4+}7M!P@wxzH(l@jn}LA=7F9dYa}X&dmSthvHmOvK z{{Ky-W{S)AB>_ehm{C{DjJnz}1Mc0kpZ~sf*O+?SwmE+MI9ob5vwqz_357xkAy6u} zlfM7Kc6ROB#ng+caBLgxd`H8om3MY@YZl7zN6OZQES4 zunDi_rLFxf{0omg3Vht z@#&{~sHwS-#fz3;7zU&pX#kitQ07@_hv6|oTr5lrq}BQ!0-3d+k51vR65~c^-#R+p?FF*s&)kW_2Lz(gXym%Z*RJ>b{WocJ)#wJJePNpB{|EZ|pWeND&oV(00000NkvXXu0mjf8VcUs literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/tango/preferences-system-windows.png b/posterita/posterita/web/images/tango/preferences-system-windows.png new file mode 100644 index 0000000000000000000000000000000000000000..517e48ae085603f465f9687be6710b4de07107fa GIT binary patch literal 567 zcmV-70?7S|P)BKKqWPrX_Xavttv9Z?yft`~1JVpA82_0E|YX zvp9~QS2bv((RknOc2ArOeBU=(Yg+|cYwP>I@jUOyWo`u^r4&L49-q8p9mOTz8(K}p zr_&cmDMgYb%2^=g(ZdJm*pwD%C|S7XkASt7x7{bDCr?R|q`W}U;w-GS-~JRK z#9;-bEVd6SUxLydFve^Zm`otYbp(}D2h#g>1XUq{I)X|860T3dE`d6N zN&zinj0Hre)7e^BS5PS+iK6IZ7=}-|`a#)5DOFogDd2K27`y`B07qHpU?mP7UYo^ zRIUPPmW;>a`@p%AfJ;!hVvNBUW0%Y2F>u#OKx_RW48vz^395qF)oS&5u~@7D?K1nD>@m)N#BX}~nQe1y46*vW`Lad_VL}O~L?M$bw z+VP81m0&@1Ql}}fVs*6EWJrveWIAoav|0^Dh=!q^#+pvjDB^_$6}c_!!on^rd+w(n z!e&+lv6Bz|(r4zG_kGWKpXdL3p7)(I2l&7JkByjaLrqQ9a+;;z2S^+s>j-1CZ5AAhGv1NDoNlAXT)3gF0*BPNxQ0%@tUk(av={y+e&w_7;xpx4a>g@S_z z4-QNxe&ocv`xRBGp(v_b5TxaYN_Rerd`~_rxU8&flqRW_-93-S{eghuNN`~7n)TYO z%{JUo9>uKw?UYonfedSDtt~>$w2{ptQ97@0=*D`sB)G zQdL!6k|bm;$fgW>!-DFguNO{Q^^tc>4+qAZOlI@eoV-N_R--|J!$H{{j%ZRPZ`Rh< zGE)LnRaM12`K)4p#peM0qA2zP0MGMCO-(bfv}Vhs)H>>``1ttztlS&}MNl2!*#ojURT$mi9^s&fHYXqpbvG!2p@VKf>Enx<1G(zWg9!V6%#|k)HTdOBH zwt4=%G*Oi$#_#hX6dFfgpNAk6Wm8$%&e5m36}dQmqNXx^er8#2&O(YLAHN>5EF%~U zLQxbj3F$%f*=S;k_3vP;Pd&=+S&@6%?4YX4Gj(T952cn z6(;szUgo@ls3;?Q<5v6l@UZ{Qvc20&Clie{Dss`()D$dQx5n*qwXJg`IB2WY3Wj08 zFbrf_hCeU@MOGk+A_(GZ_VkPl+VybYM_K9Lam3l8+15K9A@AVG+vWSVmrN)AR0qO# z^r&+a&C+L#2BR*f;QQU) zGv)hs?0z2cDFJ}5zhn;{+)Gy}B92suF^19Kl;zMIieW!nTeRLF@FH>RUMDOT3lbgi zxYPC!?w&4zSB7REdi7BEw+5KZlGazH$C|MtBZ1nzV&ObC#$v#%BsR8&-WpC{+EpW?8kZm8a_Wto4yvTntmkS3M--T4j}Ez#(>-wh}-(&r{2 zAt8~>&dQC}88u%zoleX1^2JqJbqaocgst1=THCvilV@A9Fmh$NPoZ|C5rso{QQFVo12^Esq#Pb2xhIXUPY1A zmG!Ih^$J13>l=gneha$qeva{A5ThYJ=nabdE;oM6DXIcRQ9zO;0)YTtC|FL%+H5&7 z)*1D6b#+q~Iwe3_an&w{r9RqRyv(H4>4-j$AH#k35DJbU!I6lLPOrf8!j1E%51v*; z>E(vTOS~*g004p@5DW%UxMCG+Hd|H>c>DgOs_LW{{waXDFa6eU+iF0T581o5HWZdnEly}zu7f^DB%xy*AM2b!k8fmrq88VyA=KRx;TV+WoD_@*r>#m*J1hWRLS zewsNeBLy?`6lO+gaqi=0bawS1F4hWxvPf<1y)N)r8Yv!W$4?&JMySMlt5>gOS%yU* z5WwKzARG<{8n0aDL|(QZIB;P2sSc=6SH;<4Oskj9Lq?JrX){eY*LWSBk9uG>nn3ET zxYyA)DiBi9RN??ovSMMcRZsVth}2$W7OLxxN` z8eRPXoVoA?Iv;j`W;BRRNJVQ~cZeVJZtbZ*pGw0VXU7V@q1N{J_he8?f20ssU6;>5@k08C*3023&26~}*X8+XPw2Jb)+Nw5t@*v780!xRa{Rh18^8bL*A zD>WfX)v6L}5d;-g6|Gv~h=!098Y%gJl|%{o5>={HwK%A0R9c9kYL!rA>|qw$<4yK3 z+nYCU>xX%7#$%6bw^urP+nM|O-*e7gMqm}~m+*Z7-dc^X+a&nS%Wz~RKVc<@SKtR# zwY9H(_tYt`?DH*kux+p`ux)J91k1uUO@8<0o9b97bon%#`o9I7haau0tNZo0j~?}= z!(rkN9xR0ewr%I`9rHFcuy*@)et-3<8W|hAcm~cc$B>r$&<}@e>gz8YJa){Rjzox$ zj)EW*4D#2-qcD<53{|E5>8F*+K%l!Pk?;({pI0rQAC6Yn*Y_VhcFda!g-8SfAP5Me zh_DFmwo)R@Ooq0-dzEM)(9@et+Jo@viUMAN6Sa+vzxvkEqrPM?Nb=!B1PAVpUJ!(m zxy!$EQez~On3_i0o;}J~AmI0>Qkg;c+p+@s;bdK7<1Y>zIpRwM0;Gb$98?r@wlMr9 zM(u(Nk2ZQTiK**!`29*G5ZLpTbUJk%ZY>ee52qT|umAZsj~wwOMn_48Lb-4|0?K8X zjUEpP)5I>O6hUhgg*rvykzrulHa3t=Cb3MD_TFA490=_7tLoe!4CMu!hck^EHvDY= z;lsZ8@Gz-xI3H>RfpS@G1rD;<);I0JF2cN!l?wk_){PP^#4Y32Ssjp}5>{;|JTcEz4>U;M{YFcjk zIjy>^jEd%FVy91&ZEHg|P1c6PJkqqhPbQfJ+oo&xZspFMJKy*i&WU-LERzg{ibiDH zHVr`f*=MnRJ_JEP+qH|#i!ZXVvJ%mm_tjo6<*lv6&zwQ@co0Pq^_gd=1j-}{3$UDi z<5N?Jijrr@i|c4{ScAIGW7n=hMFrWeE(Ae9@9jm9Wi}2BkV>a1Z*3)c{CIAr*fwH1 zP1S`91hZMv3u?i328CrUBfxQ7IGs#EAQFqQ>D_k`Wtr^God|+}v1=EiBvEyi91kMX7DZpJyogZM^`9;SvO(M}Ko8EsPQBly_+jAniyD_@E z$>%YZqWtyOnHU`3E#Vn>R5#JBxg!$w{P4hUEM_*_j!P zcpNj8!cbLg%PK?wFzV`-PeHy0+(@_uDF{?=-b_VL51HqmM-)ZpwUef%Ce-Jiv|E?H4BPTkWZiO?CDrmPO%da_kHz~Pg3RglYQX@1X)HDMI>EEnwoO-+nAl5 z*oP0(e()fY$Fl@%xz8nQz_N1YhSiM#P~F^2)t)_Q2M!=e5~3&~X0u3dyn!?^fqv)^ zW_vr9Wnp!7A<8lxJ|F)W7(myw0+^}iD){X3WlT*g5>PS)mT6MHVZ)N}S3LeW=H|`do&{7D z@yZoOKlp&Tkr8xF0q#9 zM_-?8rqk&0c)lR#hli>3c#vfov$`73zyPD~yu;l6`}s~y!(i&}UFvIV5gQvplJI== z5ks%ON^)|t2>wJ<6LX1#JsOJ%AHz8bU=aS$J3n7PJwD#CqqkQ!W@k~y#?WVH(IOFM zKKX>TRaI1tjWK-nDsx|av81{U!(j6EZ8mJ$gf|po==^yS8i`B*y+48cp1#?&$35lJ!gmHIY~yysV6-ZQJbGZR?)?^y z&%!K_0OCN*(YdSuH!^F03ZUZ0aIzL&TE@3zOT(>8a4G@wK#JTojpy19{ zU5GARx)6%=UnpJcs)$u^qk;=TTxjdUg@u-yYOML_Waho=VkV|0oylY-(1jj&FvHyQ z?zwmFJ@6m@I%3@dE?vmqAf9}bjCT#~fN5zAQMVSCKFx+wcd{?0e>W0{rb=fX`mg|$_^@-w%+g>?5%bFItQ~k2ka{;NNr!dmTn7(tfzWQzR{?lj64+9H0e{M_`pS;9edrK`u z@+Jn3oFtY$&gH2op1=6mkuTv#Hj*jc&0h(f+`&AB$;X~weFbRS1mMG0o3*m;IrVVH zppZ)-su5CvvH(~wYfg_QyRXa+2=HdbqL9N^fZ=&p!q-B=O8~+{qwwBI`B7lM|^}WaERHA!RuWr zZcp0YmEnxx3hH zFtiW&5PLGBs6!alh$63HAB`vl)Po2ZgqHF?8qo+)21_Pwl002ovPDHLkV1ni` BH>3an literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/tango/system-installer.png b/posterita/posterita/web/images/tango/system-installer.png new file mode 100644 index 0000000000000000000000000000000000000000..c26576ee8fcaab7c49014d9fa4b4d4c8f6a84b34 GIT binary patch literal 1589 zcmV-52Fm$~P)x~n8y}@fBP91BF!4(u01yrdhMYU8R zB~%Dmph5yjmV)|%`nYc(`iuw{fsi0VK`1S%nhMd#D5WycR?dUDget9XYvbU>-iz0B zIp_2NueD$s>{d};`jFV+SV{IIOq%y4*w;e&;RW5<;&vv`^@Jr#A303Boc}C zWMdOIZ{Eap-DMXCC{p5YcmB?%O`8Im(teuBWWE8KUJBs*e(KPnL*#Nfwrtrlcm3G0 zV;nhhWZ58^reWJQ-QC@9ER>%IAf+@+(?m*%QVIa26y4q3%PwAiR@Zf;l*U5&MH{RP zQ2srB{P=$b@G{MF0G?8pqpX7m4}K>A3p!9a^YZbD6DPhCfCU{WLsU9&;J|@J2N@X| z;lYCk3=a=eC=>vQL?WzMv4WPC7Mh!zmj_Uub>;cVlP5WP^yoA9O-)U4?b0>; zl~gK4I2=aTbsWcGa&nSew{Fqf+lysc3j)mR%ysM5rMGR{Mn0dPD-N)B?OI~77~1TP zH#RoLl`B_BrBZZsbYPk$Gcz+xPfz1G4!W*WUtdpKTN{x`gz@olHgDeic~4KzNM*f6 zd!Vupq?DXKeVWf38~H;`4Zlw&`Q0a} z!?c*n6^KM%q4CW|5={w|4paGQ@`V!FCsP!sOE`{8dwY8@7z}<;uJgi;sC*1?{``5~ z0o>MB5{U#t2rSD+2*u1~j@r7{$Ub>OZ%+>Zsr4JEscoP%_AT+c*9ZnobloE!Z_uQa zKVOmqm3`3F)dheT3=$59F-`NS{dNE$Arg)9uG&Y8qm@Hx^brQ*1Ox?pR z6&d{ZzlgnBkA{PiI*zcJ7#~%dru}iTCD1AzsC*N4?%WAL`1WmXefcGpWf2O6sH&>M zwrwKS)gU##%}kIP$S^hWm{>G`p?N4VgOUzP3cmU0{TbJF&nyNIt8}0eZFeLPM)9;c?JhDgXpN*5_SOhaSh(Ex?~)SYxXeS4uL z(13uZX~Jhp36#<> z3=gH56!Uq$?(Zw~_V#`>&+-b@c6D_f4Fm$eGEH;APpC>YH8t`6j$hL7Micp>%fw_6 z*DWBtB2tu)!bJ$l&|rp#_rDfjeDUXB-?(w(GhhTz3jt`rt3WjnVDTo^foLj~dVBl! z?Y~JTo04lg)|;=?ypE5J=N6fnp5*bPQ64_H=TAI-JbLx&)!*K|d$$+J0Hc6h2%r+g zctL&+0;uim?EFbfOUo}}vDgNsR5gH7Dxb|}`}+I)|8)KO^}hn+vym&${zU-Gl@3@u nbfzHW1kg~@XH8$@AoVbdDxkYqUew3 z&!2z32f)RP7stXdT=>PaKhJBe`zjRaIqApPzmwL(n1tWH^t(7olEW7+Tv!3FW72-jumMmFbc=5YTO&(^j zIB1uuOC!Ku0M^>UTrMkKJZtMQXHJKd%R0S41n;He&XJKUBc&`_Yj$>aSXUg@E_gn?^D%2HTjX*%5s|^R-VT5;42w}FgLq+mHO4tZ982pG-?Cabd+sP_ z&YZw`%TjfTAe`Xnkt1BYcAas+p@}1wZ`h|CfnOJjIor;PjK|uG^NooR##V)b8e^yKoA7QOePAw zcs4eggbIvtUGaow+`t+`t=7bt4sb*Sr9y^=4lqBrNVVDkKq-aR5zcw;->>q~olnT+ zav{(^1W_iVz4z4XhC`5jdG0-$APj;a4hT_NHDDaPe z&$7HRj#2;$YdsT_k1#wl%#G{sX=`mS0OwpWinJCHtaTXUJ9Y29@T1e0nElBM6w5Q< z*Kn?ew_7;3g)^I2yNONKnE&uyYK_ahe&uH!0L}{QtLxml@jj!aQQbEQgCHpDC`#S! zJ=W5Sed>Wsu*yLB93+>J=09nlQ5sW)titfmtVXO{{Hj@6K&J11&`gr9f-N=0=PYL2FH7Y##vL4F+L= z7>6;ADAGhxY5~BdD^F98Uqso@X=%o(X2pE7YFxMs>Y6MyS^;-aB-tF~;-(U~LYiND|B6Uw;Y& zBz?4$$(}PoSiDyu%4o*N$Ggq}k`~bMBDR}S zyFneCJe0QUcFD@V|F&g2EnQe#TqF#GdJh2S+;e|<^{;kid}CI8Ss;7z)Xb~jI{VG(Q(rq7D5aR2o9`=h=If`UbKm)PbnE7=<3SMo zzEY_?1Nhc*q=t>61@PADRATHkW_0P{~sIa0JJ?cK$?&_S~)Q_H8oKz z7ANxgeA(kAuE*sB t_zD2_%d`_pvDU#g3hQCq7y;_DQaOr z2zG|dT~S#O3{@orL&d^?Iy9=p08$6q2n19qh$gjagQGO0vGdQqICuB%b%=eO?MrYA zOZ$_4^0VLB-_P&QyWbi919n^pu?(2^<&EDv4j|s9E`%sgOiT>s^Ldt+mvLPe*LCqc z56|=PeLr-qHNNi?1OZxW9z1vu{he^_c^>6*xnhj@zS0#hcN!dk_RI@81a^kw}nCCh{M zJ-{t65{`V)_+m8u?V?fFT4RjCvaELl0I&xKfB3LcX%Vw5t0n!>Jt-xg=OKi^b=?r4 z{o1I>?EsG4xRLpCc$oDkPdXxPo`6Im(c#gP(Y&_Zy8^IMDL%b?nZ-+&;Khp;@o0M6 z!J>O{;!yw#HtXFkE^V8@aR_E-`DA>YM^~=kj*THkMz$19Boge}wTs2YMXJ?m2V`6c z!XEhS=1mX+qy!-lKz(Y8dOnXeG{oqI3p}}got0CkLWp(&-}kB2YK)AGgk|U&KsydA z6B7u_LMXKf0$>aqtE*U*3LlS+@yqSoteiZF&gEh=QK?kevu6)$YinDcf+$1?5LBxK zwb~ni=0(O}f`E;c6;!#*N5_uw>zzAPPMkpJave1v9UWz1VS)Mi`Pd%W5HnX>8lx_8!o23;}|AogGJyVuAn~zELRPzIuf< zG(@m_H@{C$Q$2s4AeTcl#%(*qcI#&Ju_btT_ijtnLMaX&JV;Qlqj&CPI-h6h>{-~q zAK94u+ue-f*6pPT0nR{%H=YJEx3qq0Ha75f>>&U0C9hAPM(^84vN2|jF)addLR;-c zt(k!U(171?55RF8o)?QSK29(^jB3=cIq9U7AxQgeI10EOK(iY*8eRt+pb9WkDAd2w zn(U!Nq|@o}!6cbXl1imwBQ(ZPEEbuZoZNOGb@TwR4!A%PumS!Eg3n*TcfGy6IF5r5 zBAj;3xgU<{ghgq#z|_=Z*49>$Qj$zbga{fCK}$2n0njLe12|_kvm*co2KsRv2jBPK zG-*RPl}b@6&G6{)eJV=}NGVBYJL@0!Y!C+!wdQj?Qg%McWV2c3=4Y6E_&xKli%2QS z^u%|5H%-`;2_fj|>0x>G6?gA{&D@{AA%q~?v-MGoX6xSr2&x*Dvl00000NkvXXu0mjfKE72U literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/tango/system-password.png b/posterita/posterita/web/images/tango/system-password.png new file mode 100644 index 0000000000000000000000000000000000000000..b0109750ac7e3176ba94f0562ba3bcdd2f6201e8 GIT binary patch literal 2606 zcmV+}3eok6P)om8K|xbj`uO-HxVx)41BQXRwUHvr$u$#Z zrOs3YEsb;(`>O1jj#jc0uyyxX|eNY9602x>s3YEXdC@ z6ciR18XD?M5{Xn85iwi6bm{82#Khl!HfMI?rTAG>zjs)=?1I}1&m9jA*5t=dv`HtI zYBIr?5?Hx1nIn>n`!H(99Q1mn9e{?WT*!>ZD^Uwbuk<6G-brM>aSm+RKOc4Y0^ zlq2iby?S!j?myi*ed>^zF&QyC{uTdhQ__t5HaS6Rgs7(nb~e2DP%oP#a;?A<%EZ5a zVKf*bv@;hju~n#XW^Y=@@vn|v>*?t!r$@KResObi6RK1ye-{_Eua`#aInlx5`jp*0 zo?cyv|CTkw(_M(d5^}5iZ_xW~WCKr3z+y2?P-?@3oy~P9 zD#)oZn@!~*At87D{r!W~YW1rg9`5emK7J~NTn?AMA~=ig0aFqIp%MbwMdarF1cmc- zWL1{nckWFP+SnjIP(Jl97uv>?`>Mw!FkAwAdk0=k@fFmT=VN+gq-O8leJgkE+O>b{ z)~##Szxig!qGivkCVQ!%ZOwqQTn7X%qv{g6tv@1a8qnQc4VlaZmF-jneJ{8o5rTak zUE+KtQRLnM5Ap5(8t#ImXBMPtoTS0wejZr3aFH-FGE(I3?go>EL33Lt1owV`vLzEX zLGuC6*%Y`GDExww=zxxEiyJu{j2q{P?z*!Gu&ISaW)D80W$0>^p8cuk8ii&&+R{Tp4e!y&q6AvximoK;qYNJnQ^J20!Dg2Tx)M9 z7H|j-+!zY}h!zYZkeZq*kBW*ar1tYDEG$GvM+cG58(OUvN~IDl^}m2u@Mky#xd08+ zQ3VBn3tek{0L^$S>rq(=)YT#D$`#nz+QQq@6YCG$JbCbP?^X)Is;cR+U9f-u{w{;T zU`0SE6oT3kHl$_}iNyN6+sH?Q*$1Y&T9Oq)fY2fNWTCQ>($L%l3yYpWfTt+2`j!?_ zNEwo*IYtS1(2@(=hl4+m080#N!C&-xy)^-QdwV!JIT6w(YgZH(TFO&~WtV(S8;QgGGqqHZ}AWWq?EoNJY5w!)4POZ)FrEA8tBZQFvPi4^R45 zTWFn~sciMIQz|$KVTu@$fU>7IMnhrblDfLO#x7sJ{OsJhbFax{vM=f0hpSetDk&-| zVlqygWcKXY&7^Nz#pE7d!5n+jzc<8_pGA8o?EPo=mcz{xHW@6CJAlo0tpl;Hi@o61694uAYZ?ObkBxD5L82Bkd%o){fAP zS^`?cD)f+1zgbm_wPKnL<*lu)tXK__k~kov&a-z=vFAc|)KX2*w(t9%!lgTZUb*kY z-ThrMwZ+aS2qF#xeMdXupAPewH-*a{P?RH47;QwdU(NPw7Y1c>ASWm1&_Pm!tb(VXFK_x}*(`dlA+vc> z0*|b$tgL!M;2VubV__3ugR^K*m&i!4BqP3vO{Tx2pYz?R^z=`!UN~>CiCzOCRa!u# zPDl#Y`l&I4_Sj>n{9{UhB-#`n9{x&TV4$S0ua8(^+Qa&ZXa^``9=f|B-5-!8+X>EXNu(`=StkYi$Y?<0LV+PZl0B15XUFC!x(A}J|JWlL?w zO0~1Ivt$T?hy57i{OGhM6i7PCZ$jo304C=KY%FHPBnD4>??g8HU%^VWeoP2pNTf)d zOsqV!36N^CCE$p~V*7^?VD~ragymmaHO&!6Zq-Z)>|B@c)@AtpecYg34b4=!-YL+<$kOLJE7KZMY zX14ajsEw%v?9%CUmoqanV`5`tBk6b!I7y1Iz_HJ-HDIt?%wvsxe@RG|zp1LKVpvr?bLI>~=SC(pG?bn5@fclZISWF0lc#v# z?f5{>xj6yIqS5g&-G7Nph2QdDxnswUnA4|E8wq}|JW_w48Qt z%aMty&C8EGxNh*FdjtNqW>?7N5FENm&1|t+x|l4cu3XJeo*zqY{LatMB!2tC&edIA zT}Y);{zM}2Jb>4h0^k>nqeqWAWm!Jm-QA7Z*;%~)-o&M}N`+nFb>m;(5n6w5(9`0P zMOolDUf?-icJR`w2BqGkNSq}|SCZ*MTNUs;an_RjdDq7Vf%#Lul;rEi2dg6iMMZ!b<`#@H`sc()!yKD zIRuAI8KaDurcHImPz6xsL8=^qPB@|$G$YS(oYfTYUi(e|SWXm0tXQ!EjIk&07y!T) zNs?gOHqKA0?nb{W)9QD6Oxw0?N_Ep@Wz%MwO`$Q$%9NoDpiEt0i+c0d(t0A z^P+9r@cDcI(6tmm?ME0Qgn&|tvQFKy%c0eYyl7GAoCOL{%2C)HM=Z*i$-qp;U|mQS z#z2S;FzQsqj9M`j!!Y1a~8+J;utf*VAzyd zSJG;9a#l@(LE#7?1jGs8=79x(E(hQ<+qN47L4eE2Yh_heawQ`#3Y-MM1f>Qi@POehsA4v!+~j4`oNsQ^H7IRJm3pP%2@($azl+UqfqQ3IE+ z7RERNr_U`x7J0+c?R>FnPM?n#MpN^e${1vha2y5d2w=|UiYvn%4I%(!G8tHwHFU=S zjIsAFU%q^>t*s5ud||ck`Cp76lMjsKipC5D@&NK2P_ThK81e+n28c+(Yyi}>DPJh4 z_wC=c*f$DE88WB?)u!ZS+vi=)$D*|#m|YV=4*r_+eVVv~|2{pF4UB9VweDgE)_;2;3t zN8i}yYIKs|$hp{KR>gEt0*Qb)U=xKWoQDUzAVjGeRqx29*tb_TI@bU2sm zX0CYmR5H_@n9h86&z9DfSHHDgn4im`uC5MVuNT#7wK*D%?g|Ej@5f>>Z83m(% z`T~L=e6(T1hBaHaZiUb1!}wGd?+jkHhsUy3u2dBOMjAa1d&j00;i;YXl12r{<#KR1 z9Eiu`ICt(G{C+=FRmF)DCnf>(_V@Q+x+4GpICA7jBc=3sb93{~&dyFWH8nv|6o{e- zp66lPHZ03Rxm<>(X-KEjIDPswcJJPeL?VG|wTe_K1)t9c#u(mx_uWFJQhDZs4?Z~g zxg}VTlP6D>AAb1ZW4f+S#pCg=OeW(kl}b=m6~$r^`FtMfbQ|IeMd*fQ{iwJ7rY*vUyqkpa41-TKFs{vTBxnswUt=hC{Q=8Z8UF~!_n+PGYZQF*f>)E-vx#Z~R zX#Bu|191Qh01b!3+X8{W@AmKC?^P59lu~qbbU>0M%*@Q-l~-Q5+TY*b%H0xtL4_I> zySuyHEiEmrZnt}#%jLSy<#O$)udm{paN5 z3O85rw6%Q4sX5n7P8sw%O8IDVc%jUShN&3 z)-611{aKCH!ce!{&2QVb?fZftJj)of0Q@=}4!;qJMCf8&P#cWL;(>1kxE;tsHWrlC p_$<2(Z}nNQYhTK4Gxz^1{{l@K_Ij~~K-~ZU002ovPDHLkV1i1lMwtKr literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/tango/system-shutdown.png b/posterita/posterita/web/images/tango/system-shutdown.png new file mode 100644 index 0000000000000000000000000000000000000000..36acd46bd33d2e7a0db774c1b35863dd52db7949 GIT binary patch literal 1055 zcmV+)1mOFLP)t( zIkOA=-;E6ZIXF1T#^do{2qE7or521aWR&B?LWCGfY0Vh(>+9?5kNf-k&jEmwlam=C z#P3^MTlqqvV8>#y_tN%_bB_D_ds!}*>x{9Dy}iAb?cJ18e%#*P&abSj*o{U5oO6#n zaGlhQG5$3ci(z$j)h2}G%jNP%06+KuN~sTpLcxA~e1uX8gb>8zapZD2*tR`t{jq|^ z7)UAc{QL~gIfM{+dU`^kP_WO>&p!kJwAL7+^R8mSrK4 zNMLDcDYV$l%?&Ke3i%jgCIj%UQ2+qoI1XlKXG8OhF>ubu0u0}q3LqYjBa_KQ0w|?I zJ`*LOCr$`~QYw@K0FcRKu(q}qm@~#8nM_9Jjn*2J(k}z>#K%QoVPOHAo11|-&N=4i z=OcYQfT$=;1&~gsLpjiHxBc>q0(iG70N!#S>afl}f19YB0utF$PL0 zY}F2>jTQF!*p)DvGR literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/tango/system-software-update.png b/posterita/posterita/web/images/tango/system-software-update.png new file mode 100644 index 0000000000000000000000000000000000000000..470b5d46f41a2bc4510b47437055dd89d501e680 GIT binary patch literal 2216 zcmV;Z2v_%sP)0M@6sw zU8Cb~#*!sJy;~{uLR(w&g5}HSF?;rOs;a_dGFkfihBmS_M)+X;exnLAJzGiM1SmudrmvW6w7>);;sY6Zgrq`YKNKkJ8#)&(x|) zwrt;p3eCbwrU>Z{nUu-9@9rcPOT9E>#>msJeDX=am@-AX>C~x=fVvz&_cts)q=}jW z%u`Bn%-EUiq7eD&^?YDp9H!r{Zh@6j%FqAY2mY0*y8g%y#5Ui-fQ&NV< zC)8C43tF34yl4(5Po7`W->=FZKecOXYTC3Kv$C?{PqCQ!yUQTHT!N`>4?g9J_Ou8E zSKJ4ad*1wKTic^|O`BG=W7DRm<1Kvi(+?n;N+g86jt-@%eptyZ((pgruEg%#u;lu@# z?Yj>lBDk)@vSl}-X>$L{j*gJcLs2G5`e$ z4MO6&^MSrEBT)3ZSwxvY%F#mE3ApLHuF)`~76%^%S0iQRiJEz`b`i@iVC4z~WbE>t zMboSX4jesALv1;R;Uc2d0~AE^N~v%W=3KG_M#ozz0haJQWi|>7F z2_=3n*=&}wfR9wh#jwhdeq3cL*KHWj0rjubrw8#CvP|)f z;q!U{xNGTcEUd|4B?d{Ra~M{hzHB9fPAxsB`bnqLSeC^HJN6R}gcur1pcEYwIWPyM z!icCV01V&h9!K;crBlngb-Jdp`S9UB>Pm&rBWY~g{xZySn`UDhBP7inMmk3-V`Ex* zPMjOTG)>a!G|{BR^fI0E=SR>qHct$;R6$6IM6Up#qoXLAyHi9jR1Z|%uy5aMosmdv z-{??`Vm!%5??F<58G^D2~~rQYp?2T)?qi#w?pe!tCC+@6}yr z=gqrC!Oe(-5jl1x0Fd1C#sEc*6*R4WM%xo5B0RNo=V#7MQv-Z4Tx2vFB^HbE=eIr} znlB}h&W!_PY*LvVN6#4;hQYak2o05W96fqQiD(-XAg=qkh=c_~y5pcGt^u9PlpE}h zmCU-;b(B^8`3&P&T|AH(9E{$*thJHKDjydjL%e^;B#vuB4^he94L8n?-16m zzwd8pxd(VjK@g?N07pa)h*DcLkDiDEX!teG)W{9CmuI?wksH{!*xB3jg8^+3EAuj(P(b#UA-e;juVArl)==zoErD@tG5&6~Dty_mDZJx`W zo_+S&sgC0W%gf8-B67~MtZ+V`FWazTgMaDLrOcl{pPrr`nwpvj1Ok_|wQZY&2M@Ay z=T4q`?m09~!{_tmOG--8!C=tPb-i(Tc)0Q_0gfCwk}DRAJ-V(348t%IiA0lSSq*@H z`}XY|K75$b(NVT-+jjMsPH5AnP5AwO0)ap#7!01Tt*z~?sHo^sN+mA#y8>YS`t|1O z)vFscO}ihsWzsGpBoYZysnk~v>^Kf0LVth%q^Sz1QcAS|u|ObTUF?57N$3OW+S}Wo zDJdy=Kq+i`y%%^5gM8uYUuE1_~$q)<56?0000;LPjufD2=|8-OE7BK$+UZa)$s?zGqO6geu5xXE(epV?3 zPt2bp`mX_eaj1ipqrK3K`0! zB5BXV4+4y}^uiv!PM7hq;bL0(k3Rq1k;G+KTz{?LTZh`@R5-mDyrG z3(~`JG^tdIY&Js}MQE*1N+Tv_rjjr>S~{?2-=Y2a@?PbnT#~R;>DE{8t!-Ss>-6{3 zuh(Czf9b(fm>UAo?OUixx&=kr_qQK6Cp_tjiFE( zSGn?@{Kn_|Vo<2DmBhjWhWJ$U*%kaD7 zCarddf*UYCeF#j9PGxa&W4OgBQiUo`b_DH}L8Y)^gOTxlW#u^EzafAH-Fs@Qo5hIPb5h>5@^h#0Ji z@KPSuQhZMUCr@S$YF9t~k)wx8LYqr*gdaiU@+vB_AYfe0Y}vzvZM2QCVH2ZMND?5{ zV8bRh?jUi1LNG~)QncO+fD+IA?$+B56^yOX@i!=xg)lZ`4pdk?zlBMJVkN^Sn(6vF zg;E6*Y$G;CIcX4!jeTsdfeoAJbcvu-6R~>NdTwnf|pG=msqOnm$)1xUH- zTT@fxrCR+w)`HRkR-rX$oiH@40EGy=xc*6WE+U;?VCKLq64o*P4q{@IcF>s$Dl^2z z#W#6!>45i(jeBO`(U-3UxN0w$J)C`fYHE*HZ>|wX;Jnq^7qtS`D$cInkFQSP?!O1? zuaIs26*pbLEso>n$FXh!zw5KSw7{A6&78Im=vE;2mOpUka%167XRn&`ci!B6Uokm) z?2xnY_p@ZO3fBdtL8-o@;8No__2fPd&CRj09TJ9JJ~p<@EzuvC&0Ij40IM@B^(Ogq zaGWdpFxDwi@HDTSTWlv*PA>ia+b`}m1*s$sw?w>&ByoWRV?f!r#Uoo}xp^l?jvQin zE1;JMI+f>&dxV#+jPl6+`*Bqaz|VjAH;SVZbmBCfMi*7dFniNv@%8h|r+DC32RZei zfvXEqDhSMPE-bD@d#n3U%E1^&3?vDd1eSL0pgK88vl|hFF$jnVE88I|Q)SzZapcGm z#%Jc}rl;BRUHoqUz_d~CkjrE!7IVV~dP@)eQ}mqx$+~XoyC;hls@{Az~9uoM24EQ)f3(O7YUd4k$3jAY%KmR@iR&>>aBV zu=2ItrXXpx*j!!VA+0X_bZvdTIxXpSBn+?BTki^0OLOTv#RHNR=qZCX3 z3IITW_Q2I3E+xJ8!Wfb4oI{=fYL2^FR5qxf$z00000NkvXXu0mjf)s2>+ literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/tango/tab-new.png b/posterita/posterita/web/images/tango/tab-new.png new file mode 100644 index 0000000000000000000000000000000000000000..294d1506972cd013e5f2906ab54f85bbae8a9891 GIT binary patch literal 796 zcmV+%1LOROP)lnFh-3W zJnw}>jnPD-a`x((69=On;9x|>7;%&=iz|p(v$LU@>F%ofabO2W*(J;{BbWUoolZTv zzMrl~Qn1BCMkYD9uF%A$k6<;$OODU~lI^VhF9LcaIe;enz&wiBDbOzJt|IwGsh8jP z`$ZE8&*CG5$_r3Ah(vo4siArk%0<-d)Qnha%98_P#>}?>^7VQMW zr9B`CUT>(DZ4o+m2`nruRO-#@Db?_@_n|qgz-ON?Gq>k5bB|r4HNBfCIfAjfRJfW) zrYeLB`w+Lt-^nZ#cMH^;Qy)Bg==={di&unY{$#kP2N-|8;!9-WErc2%}r)-1+ zbp)SnEP$p-lF;k*Fvbim5VVE!ElRhIC|*Ltw}f&DYdg5|k|ipaz+Wd6e{3iKAR;4$ z12{iRQC_2)uVKt0X>t~&hNWb6wM)HPTmW}onyhRp0AQ^hNdW5P?kS=|ff_}*f-ya& z(-|)R{wuRPFMh$5?8|=d2?#*Y8M0mz=VyrQb&M%!ZGVyGWxNnlMoTRRtR4 zZa=wG06b5y+W8KVf5JBv2qD~4;C8@pgb+5Yzi)w2LLW$A)Kjn-oBhB@OE7kU_uhZ! zH|N}3KU`JEF3{)gcTXxn630KBc=N4;5rBxyz46+Kf7yzR_o|?(y!y)Pcgi1s`r!c> zSOV`oola-0p@a0t77=Q-+MRmSw|mfCJ`4j{HUg4N3fAO`B|PnFv<5>F`Ct-lN4Ca~7u>H?(e0x=W1tgZ_LAP2ewLR)O{ a@VEtiC^w|#i95ak0000uLgo_ezAb>2{ z@IWMjKoCTPka*-72_6s;L6(q!AVhfL0p7fV2s;lD=VpWxTXwR(VXt?0c6VmyT&tRg zb7s8uCQ(qbqNLWT?$dqhud2Vg`@sKM%uspYOZ9D?cI&A$S-QKBJX{T9z8}VcAN~A~ zPtN{uG&WQ^?bfe8b>Abq4}9)>UKEb4hJ6+muhoD2lP`Yzp+ifj{`80B*HA^^frD(Q z2ki?#`{}=<#~%AWYdTGgF<5Ib#+JGuk|si$3Rzl^ zrb3bm$v}wXvL6o$@=Q_ZPz64;fF$U{j?ip|C@Nb?-|KbCP+UYFGvBpPT@w&#H zb9fe_$l?cvTFpbmA?nI!Q5q6)C9tFf6URBppdiZ>=fL+v;tVIE(@>oSUZHbIT3BlX zR9+uI31XO1OBA({LYUZg9|n)^!gq(L&JTIbA8>iFWLZ`ijTCG)nNI?sAM~*NUr2xPf(=Q6z##o%wmBuTN;-rfR zjMcZ%>s_W6bpVTJLp*Cp(jMdOttA0P5m7`0btM7S6*$bo@Z0`%D`qh-r0x0M3IOfq zZL}H__l2?&nD6#$Gi zGg(?}Ylb1J`EZoLA0yBEMBzA5xE6JedTkv^dLC6rci}uLuJW|3f?C)nj{AsYh*V|h z9DyHE6e-RzvjTvsy_RJK)`l2k3H&BO&;ksGkTC4voFhpWsYh#>)7MZ{wDM3?iJ}h8 z#wLvM@x3_)Gp{1zM*K0>k|!}DdU*u^5t&Ytj9R!E-)mru!2zm5JsJlLNjlHe#i#MT zCMw0U94pRQ(riF$%%ZAB3hDK%CAkEG}jk8@dXBRvxN4X6Mh)h&GfAcV%hS!ZmDv*Dk=ZZv0l(bS7{L zuU&YaIPI7DXIToYM}KKitlDcU%Mg2Yp*ybzO9_Ax$yAj>GWt40iyFp;s0xK-6q4h4 zwv3htSFfGr;-!;_6sQ{>!zBP?JO)dBa#x-MHvq^}onKh&G2DopyUuV`#fc-$78xx4 zi=rZ4md$YH)xWXx)=zNi%u(hSt|Fq<`!a&dZ&;q^u@n!yng5uCau?PifZ+0ZwAt$U z7>hcoa<8apS?9|(6%`rj{oWN$pZhC$o+2XU8XX#6E(U9TlEI*M>ZQyA8-Up%fX3OE z^WH5JX_)0pSmRS@ysXZ3#08OM{R&uj{^Ip|cQ;&|M#k&47IEB1oy+FuiGU^$4*|Gd zk4)A6^Vw%l?B2C&mo?bRfJ0?i4UB*+zijAm&hQckBAiSzuAYkE5_PbGV{zc$KoILx=aJpz=FAHUJYnePygnRyiF;p emHPE@0000-U0|+Dp3WA0}6@ieFRyc7|mpHW@J5HSS{_yVJ zJ2Qued%e4^od}^Y(&(O4AIEWY$i^<`y(gKDE}g8M^PBd1 z*U9K*rQiPM*KYwQLucKyVLS5y-m+t7r**DU;pAUve_)o`z*kQfIH{eHM)(1dq)$dsb8~Mp?@G? zdD)>Pf=Pv|Ch_*^fmffz-z#1f^&amPF^1V0kBGtdcybfs9D;T0b^#&`^a;Z|GAu4R zTpFEq9-3P30X%plS$m%dwCRh(%rK3Qv2R13-RfwEoy%IY`LfAQ;XJ}iVd?CQP#M*3DiPwdvLaY~@ zcGt0kR^*vqu5)Ll(N&|x=zTFY}!JB^}L>6u2XM%3WY4Cz6_I3m*_8t1P01wgZHpw z7!K?W`RGPWwc%+;j&@{eMV4mU5=C(ue+Lp^0zrMk--vm%2bz)6uCy@Kn888Aj^RA3 z%~ez(S8Q?n{wmKrU*L&d1+t|YvonGK17%OPpk(rbY6kB->P=FHttX1%USjFiSs)0R zjGn8$o33%VW<*uAH~x4$(^K9d84zzE|z3jAa0KFzk}xr0M|ZZc$aD9_dD z2OQd8=IApqr;iso^3)J!Gp0M^UOh{p&paB0B0?b-(3cItBsu=^T!mZnZ5l0j;kkf) zPxR4hd9K`0_U-bVd8wb#p+5e0^*&QGEz~QDPm7X*_gL@n*3w$@X&OERgtNES_|e-H zkPwjoF#*N|m>^)^lTdG34nEn(?Zp;1Z{@f;)8h1zK|Z)r=v=BX{5=N1yR!;;bGbAv{bKxGWR3r9J6uCKPX*6^EbIPK+%AYT1S*~PJ zJc>g_5OIhoNC2WBn%*JiAs(Pxsgh|hVh|G`#?WdT7VcWcwtH?b3Z5MEiy3N-kdL5TB)%4!}l9-{(S zR1Kn<-lTpbKQAd{`k;uJH0mfEG=ElL-luo1B74cZ0WIwlei$8p5c z^3n#yItr*N%~q4x##kF;W80x)Yq2)QIoJ6xj$`6>M4{N1A{$!GCdLT4d_FNMwzQ*& zLLrYa-7=jCGab6K>%C7}XxrOPTdZ?Qi@ia(<v$v^N>)f3Fm?-LotrvvG7}Jhzj1hygiNHq*2WZsl3=Iu&^ysmU^$Hw5e3;3} zN$T|mjYfn1{y~l%JB|^_T4Y--n0ArB4)p}F8qJ} zoT{p|*3C{|pZ>vx3xE0}u()3T4A2jhfE-)2YL8*~B&Ni`Do_KQZ1G~Za6kUht;y;5 Y4{P?sxg-E8IRF3v07*qoM6N<$g5g<-#{d8T literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/tango/utilities-terminal.png b/posterita/posterita/web/images/tango/utilities-terminal.png new file mode 100644 index 0000000000000000000000000000000000000000..f86c7840026a28c021d0ea682263c0c45f7b4811 GIT binary patch literal 1488 zcmV;>1uy!EP) zU}Ah>hzW^*fFThT0wOLIOl6*g}_XEo_yt+bWdp?zX$VckjJ3 zXJ#H>oO91TckkWClp0_7+{`_5o-^lpzVrRgGjrho-4wtRPycp{M*k*CyhcRM`%hjJ z5kd&W7>m|@ABnN;6QQXTlWCgXao3&qybYk9eDd+ly5GEY?daIx+L4P@k|gJRmLh_P z;GE;1A03kyUid?;QEP0w_udEJOO(-%jb5{5aCm4~%^aP^dwbc6@W^ z;I2Q7KL*^Gc>LB&F8-{VIXcZ7Z~TS*?;Jp)biJ&ULTioI8e>e+FSj%KjnQ1OVLh@z zShw!;s?lg}1xScgk|e=e%f$WzOiaFsN%}zAAf)v#ZBH4Zl*S@L>sNZ27z01J^>!}5 zd_6{MoU@e-KyD!flu{_A`RUz1MgWnR1#dHh&t45e`*9Wfrh>vw2vu-4+e zFQo2TajEyr&n^{7L^_j52~2T~F@qvm;wTY>?3#n{K46T&IZJvb03amiwPvXhvS5-c zAjQn2;b4e)7T?)WLpV1=~W%vgx68Rv}Tw02UT zJ}U4 zLQHAYt5la4Y1(=o6#71sRgp0UXDz97c%OCyFvesIe6q+Fu7(|3Z(;rCHuKtBFETSV zMX)~G(U3MPG2(s7$)!1}wZ&3JD3odo+gbzGT3njqedrB9L{LfO(80aLnDXU~*K_N) zf5d@J``Gi>mpJ+HEaEe|L-d@ko}^Y^LX{DB z3$sha#d5lS0_!Y&6`hF;+1Os0Rq+@AYc1B=P5?3H z3>b}10}Hc@3}1R7V>fK)>to+y?M0XH`n#|2=pzp?{kOx!G;}5C%DckveQX18D*;Hv zxfG)fF$U6L+49xv`Qc5s^X}0J9(no!Cg0qPuX~IJQ!!o1SJQqa80##q%s`sv5?G5i z2HUh8oB0=?%pT|dCw|H9U4Nu8Un`vht=OwjzLJ!DZ1hyhfX6z53xq0+9ryb7{KXpA9-NWE&QS8Z36v0Jut)rO6$PW8hN zKVZ-Jt38>CK}!90<>U-RQs+=w7khpScZ))RjbGfvo!|d?kMNm2`1@b6XZ+PpwQ@A& zBipZJAQt<8CPtxI_n^9IJ$(2uzkc?HC_S^5KA99<@2Z52duLsNgrBk z7LK3pnc(?{#(AFcRRNsIv^ItIT>zrQyfiew_}SegNpi+dt+TNZJacm=x&ed`>~gJE z(b}-QT%%sEomGOeedi~mOfLMHnWrvgadENmuUWIEIFOW57C;B@_wAo}N4_$)je&uI zPn{fK--+k2p$h4A#1ILw(;xHko%gMNd%U%l`T03HGJT{ub!h6gg9qQ=tAPIPU%T!b zBO@dCYpt&W=|3kl^fZe7)4+vZU0000P)q4E;CDxynIMv-J9X*~q?P!FvTp_#Olm<3xPcqvL) zw4fd$>Y>XTx=;iXlsziuvb*M%TdNYUT3=LN&#axb($>1@XM z_@fW|fm;BkSu{Lu4;y!%Y$Rl zJ18LN_Y!Q^3ATGl<%(Rm{3m4zLWsJOz?HEu<&q@iHwgK?bovdv9!K3tSprn#v}>H` z-OfXs?j^89XKA~apid{{(@}(AGCTvaKKg8?fZJ)KGhoo!VG!!L3Gs0EeVjVH({f6* z+8>;DjrR`jpnL5y9$a@1pPao!$t>abc?tMD1bjM%?nKna1?V0JoqhvlHW5V#mUS3B z`RH1lc8$}Ack<$qv&{ic9(sb!YdQh&xa{;iwV9tTj$^lJ1ln~1KAlBgmsM~8EHYdu zia=2Wi@i>|RtB+YDgf(NE#>qZyP5-Z&ze^!@<{jnOh)4@^15jAIvbi-)TTSJsR|B< z4ON*R)%ume<^WdGG==3$7hA^ONN!j2)!z_6G;p~S^E=TzfXZrKXjOaEC-5HtRBJwf z5DS-etlCJ0nm0By7H$sE^VS(g#-ktv1+&ao=Z6{jJ;FpR$z&`+Je|KaRTedq z$}<^FG7(KMdOgM$-w%;1mOu!ujD^|r_L+Hpb&D{SDbUk5z^OyKIQQcye=cNB~Ned!tJoNbQL)58auZ(X*Il37e)^R<-69p{i<$Y&L6*eEmvO165Jb zw8q?<)-LDb=lh%fM>d;9Rkh?CfDl4Cbok)wr#|RES}vFLrbpieDT S71{y-0000P)3&2703Vg-nY!=84tGEaSdr|grO`3Ts7naC?zFPi$WDz z4_xq^mdg&AI3QJ9o}K?+x&OHZ~Kd)lWAr^ZC{9C>)PF4plg=Tf{kY z7+97I)^5AV9LFGb0B@UKShkwLDQn&w;rtP8XvFvna0iFc(3KaQ}=Z5 z3$U)f>AQYi`NQ_FRRxzWE@ec3Bmzl-O9Ux%eguFsK;aCjjE&YCefH_|owh@6lOwUW zW&e&L09gCI#)lL|oU~mxFfG8khNf)+T|M&rw`&5$VIO2(kU$`r192pQh#)0F5+ErD zqN^OPBz$z~wtc##({O+WCh58m{9ju)RfXO-c?DhoWxV+MU4Jg&j2~)vqB<}u;)6>B z!*UQyWMNni6d_O))DQ{jAOdVx!g3@?5^PB@Z5M(wJiNL>t*j_h|8nxmfp{_-cw*Bs zS~xd6A=wE46j1BeFQ2c^D=Wg)_5phT<6Cktk>QMi5mC;END9vE#q*=)s-^Qol@%r2 zr!u5X7a7w=GGif?Ng=2!*s*0*AZysrbd|Z1rU%dk-&0eyz<22Fi|(zv2{@93;M}w< zr<=IDqhDi~l~jJvLd*ta!F5>Ua6G zg0r7|W#uB@%F21lVA4c9V?#|9HZ%- zNG7>qInaE*;gH|=K|t3(a2)3*kvri`PiC!$YI^|sSW&p8C<@}E7Ki{MfH8oxiHB}X z4JbBTM*y>wH-10t*MD65*eb0*X&{ldAd%}8g&mj@ zAnV93Rd9@EvLE($JMFe2Mw8iu>ALplbmBD)Oq@kk=ru7s4iLh9&EV&94LDcf?Z zrxR~(?(l8gxY#Jn+l#GlGU9)QCviU6LP>e;Uh-Yx%&6c#| zI-4&Z-1+&G=@KzFs+Kpm4b1(Y7`Z^MiA@PG-e!d~sDj~-$IeN^cIyh=a4P%7FTt+g z%|0w3t4>|*f1tU!Sy5GOYwlZP8URnBG6s|sX~<-40K^4&ZS|g`rPBd)MlOZpY4@uD zU#4)XYKza=NF;YK23SIjObOt9W)J~4dq*HS#}9Wtgbi!Tw+W8+b@fM{uc>RC*xd7$ zmiD8n!m2o@DCB#N7#72N6 zi^|kl(IWNor@b$Ab`Sk(eZ$ccwj*ED44nU@>8Vupi|B5b%*N;8PQc)CI5Bq{r}gKiZ6}LCzg(nWON}EopA+}e|Ag9K_IBR(P&uF1Ag4;>KVzJ<_|8uvZHaz9Uua3-bu*A zZ?*6T%S*CbHazH81P5aT0+2Bsqzwl`FhrwaF}o}hCJBtB4Wtblj!WR2F|KHENh*#D zq>^b^hB0c!)ni_*@c;|}ZuKV6`1jV4;oIjQwNn+FI(lM1U$b;xA@0`|FoyhlAwV*Bl_c|d2W4q#)E^A^n5L-!V{jy3nl{pgg=8}ACS!@LZD#({eetcI_Fs9Y1AsMdn9P&C z20;IE?aO!g273O|R6vDuCnE)-KCMgh10JsC(r_+GD_?o~_V zg$oee1K<@e0C*w1!cP9)1e?*j-Xv?hqaf~unD`ImKK5UPJ;I1>GIMqS0000%-6o#L3=gzE*u)}6qBJ!a`AQ&5ovCzUFVPYdzR>Z=D zA46hCVPZ@yXzi@j*3yJXC`7WFk#(1KXLp%2D7{&Nk&>)AX#kpOaZc9{OZv$9aS$Uo$$znHwa?v*m`69XD65&7%5v9=xC|8Dv zck)`Q%)VG!diux$)a&)d<>h4&>5{*GhV&h{58x`GHP9wV1SX5hth{`+`4HF#P*o8T z?md2nQ|;LQ=FA4S=RdJ9x6ODV#Ix5BlOf$JlGNUF`I1jADvK(iJ^JGKXtrbXj9+JV zGG%(K!9<}+aN!2lzlF#UY4amSnxNZU3>9hvxi)~QvEhyZ!c2v+k$_xQur`b56|nw1 z#!iD)ux=PM#(F+9H24Fc(+LD#Ks1yk2tqs)BT`1)CazgRh%xdLBtz;9cuDm)fU5H3 z!JW?B50o0j?Lk@v*#M(J25gbQY=JCLt?t4g-`fDR3kPt&*;Rxuh?K#tBl;Ey03T%@ zWQMI`j0k&eBj_4{OaT>CKum;c45T1~AQNEjQu^@*fVKpjbKL;|;5smZFo{SEI8;Va znZuI;&~pHQe5(|Y{YAl;!=!t222Rvr@1s6FPT(&n=Kv=G9DmR+ot*^E1VFz=aCQ?o zb%65`{Ffgh(|5;XvH&8Y&N+#qs4u3@IYdN(yafi*G+kR=UA^D6o6$d{sw7GB8i)=Y z2Z0eF3xt4AZ^qMXtqHILd_BHp(<+bN+?-vjQd+-AzX0iyL}k`Ue{BE&002ovPDHLk FV1isSCa3@a literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/tango/x-office-calendar.png b/posterita/posterita/web/images/tango/x-office-calendar.png new file mode 100644 index 0000000000000000000000000000000000000000..0c224e9f014e0a206ad26a6a5ae5a23a65e5f7b8 GIT binary patch literal 1054 zcmV+(1mXLMP)p;BZ=Af%#yN`SkcF-<0xnX{L_j0FYctF*i52 z>fzZ;&ZTSh_jcR1NhOmHb#%5hpE!QDe4z(`->%=_=*P#fZJYl7er%_}%e(sM-uVjO z|8SL_?wvF>HDQdQDj1Z&gD!AgUEPLYpb7wE3{pxy|KdxA$0D5k>@<$!pta`2sZ;FO z{uEnUS{Og{F2)!D;_*23^!p>q9&v${Qup`*ev!}T|Fx{<=jS;yHO;oIPZE#E5JDiNKx+?vzpvf} zmQvjv3DQ0J9v26?6b~d=mEt}0Wc)ea>S=K*7 zjWN7Fu!n~?ZY1CjAViu(JW8UZShUt57dW5K*98OB*tYG0X{~v+uNR-shsWa~XIcDu z<2u=|vNVLl)KvRvd#;^KCe7u`mk>e(-4W-qcLjri6`)cIr4&+1Iy>5tQlgaN*yIN+ zEX=dC^e5R|o?m{xMlzXXW@d(TIz=j#DwIWRX}{kul+yToKBSaLDG@@f%t|T3>%xTB zg~{czD5coEsfF|B&ymigsjUqmg)V@#P9R%wNTd;Q9ltD?xW z0kI4&#A1mbMPx#32;bRa{vGf6951U69E94oEQKA00(qQO+^RT1qBQvEkEm-&;S4e4@pEpR5;7s zluKw6Q51&%duNiEWHLTlD-mq#16o|Ta1jO+Y$)PJ>ZVA+2NVUD-MDe(%AG4WDhO&; zA-jNrg@P_BHYK=FlyOi@i=?f_Rwtdj?%aD_M8{NdQgl|H)q#8X_|JdtIYdf{Ac7*G z2n?ip8EZ8ido2J(gpgob`$yMRA4QKp%syC{d9`ZB)!3n)gJ*`u4{RO$6Nq?1Iz4)} zT+Eoc{O3om4zWc*fHtVQN-pg`cQti+vx=6SmGS8dY>#9E!h7X$adg1AX=Pe-?3!_9 zQyyjBqg$lHk0D+Vs?JzdH1Pt!Ee00!*+b84_Z=IT-0MMqGRSSR!i+5j2-94)FCVosWp=$Y5ww;(&YqT)d z?tyXEeMOS7KEeQrIlE|9t%Rz1l(Jg^07iF4dwo5kln@#Z#YU1x6o;1G%4lKCtXdl= zfNJC9;BmiyB&BrhHJ7!f7oSW%ovQESP_SF=1>jK>hek@|{n=tz3HePe9ElP_PxOyW z4PA`BRYEo`yOr-0j?gC>DUsX9uK!Nipa=lxZms&2y9~hWQXymJ9xlwt7{H+m?fmfR z$>E7)d{>thX?It5>{g@RS@ELsIuX|P>izypOMY4UMs2-OTMytuQmO!dbC}5gd;Grv Xa&h(0$nd5O00000NkvXXu0mjfFjXFw literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/trash.png b/posterita/posterita/web/images/trash.png new file mode 100644 index 0000000000000000000000000000000000000000..17d5dbcdc91dca96e1a59f3c95880008d4463d1e GIT binary patch literal 2907 zcmV-h3#9akP) z04I^7i2|`F9@`_2?aqun-F`3HmmF}skbE^LT@B8Yj zud3l^@-zAWEo#2u;ZHV?EH8Eb#f!fqvuRr?Q7HYE1{d#i=4^a50JS!**;slhnGF8; z$;U_EnD1X8@Y&Drd-_*D{Kb3jyZ3Xt-Cn(#xhn~RkT`0;rEjy$^1_Qx^S6KZ$k>nV z&8JR{F3yZyuYCNo@y)>PA3OeK{nf8NMsIVSATTHeD1}mr{853TsOLJ!+je;eHS@lB zPhwNlE`77#=Jg{-uH*g(e}((*eMJA~Q(yZd;LqNWfC}O--1m!*7-IsSICY8x*X|*X z!s*~MWjZPB)<64By)3@J`+G_$j@@uQ&!0WRLm&D5_&>h$wcq>nr}?XsCmEEO^$dO; z{LcON|7QH`kI%5ZGr)U!OJ@Jy6a}Q|gai9;aN;w;2bVf~o5zmc z$&*h$34n-yd(rM9#ssvQP1asL&xzxI(h1|{pFjHO6nFIy$17j_r4N0f4RHGOX#nJ% zHvn4a5V!i9+pV!T ztSm7c?C`M@f4bamFaKrL4-mGa6F1&?cec8Ekgq@SMD?-!6qvvm1LT&tc<~k9_ugN} znDEvUp9+5t3Igr+>hFH&{?9K1eDC{DS0B5d0s?u|%B8*3L@CWfANf+F*;)MqD8i^s zlMmc=*M|WRFPK21fH;b2wOYG}IHvJ>8W!in;T6K@Zu>y(IS2w=mXT#CX=;g8%y2Z| zp7(xK|JyhI=HZG!=4_+YTn6A@AAkI9)9zc9z(DHk3KRsIjivL?zi|3pM~~dWg42lX z+6G+py9@1?X{)zy?`)t^Nkt&B!>|1FV_*JUV33 z5fM)R;Bgn2_?u8m=05qkmB04h{h{+$mp#565{Av^n54ga>eT4sOg8%4Uy6Ti@4kJH zJ^0`+tU|7MmwCJh&I#hdd%-!62xOVZIghm-n|RXHk=neTrmkquf4vt(iZO)ZSrEzR z5ifX|)_tw7l-Ba4zV|zi{L?=s-zwW?lDX9DZek}WWe{;F1wnZEvw-(flw#7kdP&$? zA(>>PsV7Ms$;2_4IFd<5lK5Of1u0(ebrN?n7BAOPJ8iM`Nj&l2=ru-21I97&QD1am7Qc~}j@nEuc!$$a+>2_%!SXLK4U zWl*G7gkJ|)fd;gRFhPV?G0nz4yz^wv(%V|YyGhPfr1;HCU=+F;5XYuwIdIP7y&?=6 z^afdICF()4JAte}?4@BNR!W1?AnpnT7J)=Tn`>5Y1)UHw8`Qgn+`B{1_TVEsPF|G1TPIN14em z7f>pthG~|el(~ZT7u{#6eLY$S1q{I>3`gtq`Y%=A9ol~5wBf(1}}N& zH6}(W&HCnxC~eRtBnX>CaSLM_piE(r;;--}=QBLIe`Nwnwybq;!UEJL$}wjyVZD2X zZvPz4Wo&J~N*Hvw?%?~-N~4rUYs1cP9YGP827!*z=wfs5MVTr^5R4A+-lLG-JdOo5 zi&tH1En0_{0WTQcWbf)NXdRwr${Ad{qzO~)7=p>)K? z=D8f42wps1z>CyMO-q2*0WM4N!sZnTc#(}{a(My(nHw`4zs{k3@5h)HA`pektaqQs zk>R~VywKnN$=t@~r@L$(bP;jWC{(Ts%6>4~khu)+@9ph1M~F zX_44IX)UfB9nxwYz!#HCO|v4tSO>vajy@g&Ub5B26vc`vn3E z7O-i0X*`~It)m%o3WYW?iejS?q0>A>BiaKZIBywEdaNuRqrbgY0QF@$n`={qC~UL3 za*Qx&BLYjEn9bfA&ZpH9sB0e}FcH=!R=ix|>v>{2xPP|@-LJI`MsorQfbV`{botRDpHT2#w7+wH`jqY=_8~f?B z4zt`jLL*!T?{h04#PKpmkGvn0Mg%suUd8zoFT!ZNO@HT7zE(BLAv;m)vD_fwE(My$!y<})~ak(Y4(S&I-=MmPs&(UaHLtxq{0y1aw9X6ft z^4j;f@#q7Hz-ZLNdBqaXr;f z1hWJJ5<5Xe?EnkuK}kRroqK@&UeshV8s;f=8Jo+nSb+4B=li}$$jTHTZ*xT|P^1W6 zICuW3VyE@>Lqu(T?JhwOlGp^7$^_UCw5VMNl>`jX1UkU7O<3=4^)RNHgDS5?YKNCX z{T0Z1y=*SEEO?T1SQ|s$EPleU$zZU>c)|#{4p;>mC5fPT(1is8KyO@1|Lg2?FWz>? zZTE!Dcpqt&6z)-gDsK~9;R4kmJi~b~rfi$Nc__b?%H5dr|EVaYiJ~U0#tP@ppR=!D zwEqpP06ky~WI$RjVj&Nh7D%7@fjxEL(Ax2*zVq$XyYISF#nGPW#F7J(>K71Q-Q~y} z$nu<0d-q8OyqLm&eRz36V5AEMyTyrl0+dvoCp|C>zYEhGuh{=5{F6t3E!FNg= z`9)9yOlr?5AoKsJFHK{}*MlkQWqG@$jN7hOGMHYi{112Wzb|N7NnHQ{002ovPDHLk FV1l#3srmo_ literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/images/wrong.png b/posterita/posterita/web/images/wrong.png new file mode 100644 index 0000000000000000000000000000000000000000..9fcdd470e2380d7b33065d9f37954cd3455b4cba GIT binary patch literal 605 zcmV-j0;2tiP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2iOG% z2n9Jy@2=he00G@eL_t(Y$L*C*OItw{#eXkpr8Pd$qKVlkRzU=b&`rB5EpJ)f1X35G zL<^-~K(Z7U#+|qe1xfP_N_83CXpO~%hzc#ioo(VDjBiSdiNsp8k>;_{ODU?DAeTz9?t4KO;3-qx zDex0G9uCqnF>b#HyU`eJfF}?DDIpXpErvokq@*(tAUhr9@A40OJ&^f4>B%Wx10<6m z1cbw-4dE~dftF0t4E&D9&|keQ6Uc(hUaDy6)fKs*>Q-hLQkrIIvuP?HNC9%O+jrso zIWDE>^yug!fAKg(BBgmGqI`e`$Xw2zlB=4$WC3a6oRJYll@MxN=t&NE>~`Br;H+^` z{q_w90ESWI9KT=Lc~1<39iYDVo&C4S9USBrZ~~A>sKD{KGQS@Z2?X#5Xy|)?Gofvd zPmr0Mq64s!a8eN37SKBVnP* r{;jRy)N6V2y!BeIsrK+E-+O{H_KyB>Muz0k00000NkvXXu0mjfj)4bS literal 0 HcmV?d00001 diff --git a/posterita/posterita/web/import/importGarmentTemplate.csv b/posterita/posterita/web/import/importGarmentTemplate.csv new file mode 100644 index 0000000000..8b085861e0 --- /dev/null +++ b/posterita/posterita/web/import/importGarmentTemplate.csv @@ -0,0 +1 @@ +"Barcode","Brand","Design","Model","Colour","Size","Revenue Recognition","Purchase Price","Marked Price","Discounted Price","Limit Price","VAT %","Stock in Hand" diff --git a/posterita/posterita/web/import/importTemplate.csv b/posterita/posterita/web/import/importTemplate.csv new file mode 100644 index 0000000000..2c8e62915b --- /dev/null +++ b/posterita/posterita/web/import/importTemplate.csv @@ -0,0 +1 @@ +"Revenue Recognition",Barcode,Name,Description,UOM,"Purchase Price","Marked Price","Discounted Price","Limit Price","VAT %","Stock in Hand" diff --git a/posterita/posterita/web/index.jsp b/posterita/posterita/web/index.jsp new file mode 100644 index 0000000000..fb62a96c53 --- /dev/null +++ b/posterita/posterita/web/index.jsp @@ -0,0 +1,21 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +--%> + + diff --git a/posterita/posterita/web/javascripts/actb.js b/posterita/posterita/web/javascripts/actb.js new file mode 100644 index 0000000000..c6800f2f14 --- /dev/null +++ b/posterita/posterita/web/javascripts/actb.js @@ -0,0 +1,645 @@ +function addEvent(obj,event_name,func_name){ + if (obj.attachEvent){ + obj.attachEvent("on"+event_name, func_name); + }else if(obj.addEventListener){ + obj.addEventListener(event_name,func_name,true); + }else{ + obj["on"+event_name] = func_name; + } +} +function removeEvent(obj,event_name,func_name){ + if (obj.detachEvent){ + obj.detachEvent("on"+event_name,func_name); + }else if(obj.removeEventListener){ + obj.removeEventListener(event_name,func_name,true); + }else{ + obj["on"+event_name] = null; + } +} +function stopEvent(evt){ + evt || window.event; + if (evt.stopPropagation){ + evt.stopPropagation(); + evt.preventDefault(); + }else if(typeof evt.cancelBubble != "undefined"){ + evt.cancelBubble = true; + evt.returnValue = false; + } + return false; +} +function getElement(evt){ + if (window.event){ + return window.event.srcElement; + }else{ + return evt.currentTarget; + } +} +function getTargetElement(evt){ + if (window.event){ + return window.event.srcElement; + }else{ + return evt.target; + } +} +function stopSelect(obj){ + if (typeof obj.onselectstart != 'undefined'){ + addEvent(obj,"selectstart",function(){ return false;}); + } +} +function getCaretEnd(obj){ + if(typeof obj.selectionEnd != "undefined"){ + return obj.selectionEnd; + }else if(document.selection&&document.selection.createRange){ + var M=document.selection.createRange(); + try{ + var Lp = M.duplicate(); + Lp.moveToElementText(obj); + }catch(e){ + var Lp=obj.createTextRange(); + } + Lp.setEndPoint("EndToEnd",M); + var rb=Lp.text.length; + if(rb>obj.value.length){ + return -1; + } + return rb; + } +} +function getCaretStart(obj){ + if(typeof obj.selectionStart != "undefined"){ + return obj.selectionStart; + }else if(document.selection&&document.selection.createRange){ + var M=document.selection.createRange(); + try{ + var Lp = M.duplicate(); + Lp.moveToElementText(obj); + }catch(e){ + var Lp=obj.createTextRange(); + } + Lp.setEndPoint("EndToStart",M); + var rb=Lp.text.length; + if(rb>obj.value.length){ + return -1; + } + return rb; + } +} +function setCaret(obj,l){ + obj.focus(); + if (obj.setSelectionRange){ + obj.setSelectionRange(l,l); + }else if(obj.createTextRange){ + m = obj.createTextRange(); + m.moveStart('character',l); + m.collapse(); + m.select(); + } +} +function setSelection(obj,s,e){ + obj.focus(); + if (obj.setSelectionRange){ + obj.setSelectionRange(s,e); + }else if(obj.createTextRange){ + m = obj.createTextRange(); + m.moveStart('character',s); + m.moveEnd('character',e); + m.select(); + } +} +String.prototype.addslashes = function(){ + return this.replace(/(["\\\.\|\[\]\^\*\+\?\$\(\)])/g, '\\$1'); +} +String.prototype.trim = function () { + return this.replace(/^\s*(\S*(\s+\S+)*)\s*$/, "$1"); +}; +function curTop(obj){ + toreturn = 0; + while(obj){ + toreturn += obj.offsetTop; + obj = obj.offsetParent; + } + return toreturn; +} +function curLeft(obj){ + toreturn = 0; + while(obj){ + toreturn += obj.offsetLeft; + obj = obj.offsetParent; + } + return toreturn; +} +function isNumber(a) { + return typeof a == 'number' && isFinite(a); +} +function replaceHTML(obj,text){ + while(el = obj.childNodes[0]){ + obj.removeChild(el); + }; + obj.appendChild(document.createTextNode(text)); +} + +function actb(obj,ca){ + /* ---- Public Variables ---- */ + this.actb_timeOut = -1; // Autocomplete Timeout in ms (-1: autocomplete never time out) + this.actb_lim = 4; // Number of elements autocomplete can show (-1: no limit) + this.actb_firstText = false; // should the auto complete be limited to the beginning of keyword? + this.actb_mouse = true; // Enable Mouse Support + this.actb_delimiter = new Array(';',','); // Delimiter for multiple autocomplete. Set it to empty array for single autocomplete + this.actb_startcheck = 1; // Show widget only after this number of characters is typed in. + /* ---- Public Variables ---- */ + + /* --- Styles --- */ + this.actb_bgColor = '#888888'; + this.actb_textColor = '#FFFFFF'; + this.actb_hColor = '#000000'; + this.actb_fFamily = 'Verdana'; + this.actb_fSize = '11px'; + this.actb_hStyle = 'text-decoration:underline;font-weight="bold"'; + /* --- Styles --- */ + + /* ---- Private Variables ---- */ + var actb_delimwords = new Array(); + var actb_cdelimword = 0; + var actb_delimchar = new Array(); + var actb_display = false; + var actb_pos = 0; + var actb_total = 0; + var actb_curr = null; + var actb_rangeu = 0; + var actb_ranged = 0; + var actb_bool = new Array(); + var actb_pre = 0; + var actb_toid; + var actb_tomake = false; + var actb_getpre = ""; + var actb_mouse_on_list = 1; + var actb_kwcount = 0; + var actb_caretmove = false; + this.actb_keywords = new Array(); + /* ---- Private Variables---- */ + + this.actb_keywords = ca; + var actb_self = this; + + actb_curr = obj; + + addEvent(actb_curr,"focus",actb_setup); + function actb_setup(){ + addEvent(document,"keydown",actb_checkkey); + addEvent(actb_curr,"blur",actb_clear); + addEvent(document,"keypress",actb_keypress); + } + + function actb_clear(evt){ + if (!evt) evt = event; + removeEvent(document,"keydown",actb_checkkey); + removeEvent(actb_curr,"blur",actb_clear); + removeEvent(document,"keypress",actb_keypress); + actb_removedisp(); + } + function actb_parse(n){ + if (actb_self.actb_delimiter.length > 0){ + var t = actb_delimwords[actb_cdelimword].trim().addslashes(); + var plen = actb_delimwords[actb_cdelimword].trim().length; + }else{ + var t = actb_curr.value.addslashes(); + var plen = actb_curr.value.length; + } + var tobuild = ''; + var i; + + if (actb_self.actb_firstText){ + var re = new RegExp("^" + t, "i"); + }else{ + var re = new RegExp(t, "i"); + } + var p = n.search(re); + + for (i=0;i" + for (i=p;i 1){ + r = a.insertRow(-1); + r.style.backgroundColor = actb_self.actb_bgColor; + c = r.insertCell(-1); + c.style.color = actb_self.actb_textColor; + c.style.fontFamily = 'arial narrow'; + c.style.fontSize = actb_self.actb_fSize; + c.align='center'; + replaceHTML(c,'/\\'); + if (actb_self.actb_mouse){ + c.style.cursor = 'pointer'; + c.onclick = actb_mouse_up; + } + } + for (i=0;i= actb_rangeu && j <= actb_ranged){ + r = a.insertRow(-1); + r.style.backgroundColor = actb_self.actb_bgColor; + r.id = 'tat_tr'+(j); + c = r.insertCell(-1); + c.style.color = actb_self.actb_textColor; + c.style.fontFamily = actb_self.actb_fFamily; + c.style.fontSize = actb_self.actb_fSize; + c.innerHTML = actb_parse(actb_self.actb_keywords[i]); + c.id = 'tat_td'+(j); + c.setAttribute('pos',j); + if (actb_self.actb_mouse){ + c.style.cursor = 'pointer'; + c.onclick=actb_mouseclick; + c.onmouseover = actb_table_highlight; + } + j++; + }else{ + j++; + } + } + if (j > actb_ranged) break; + } + if (j-1 < actb_total){ + r = a.insertRow(-1); + r.style.backgroundColor = actb_self.actb_bgColor; + c = r.insertCell(-1); + c.style.color = actb_self.actb_textColor; + c.style.fontFamily = 'arial narrow'; + c.style.fontSize = actb_self.actb_fSize; + c.align='center'; + replaceHTML(c,'\\/'); + if (actb_self.actb_mouse){ + c.style.cursor = 'pointer'; + c.onclick = actb_mouse_down; + } + } + } + function actb_goup(){ + if (!actb_display) return; + if (actb_pos == 1) return; + document.getElementById('tat_tr'+actb_pos).style.backgroundColor = actb_self.actb_bgColor; + actb_pos--; + if (actb_pos < actb_rangeu) actb_moveup(); + document.getElementById('tat_tr'+actb_pos).style.backgroundColor = actb_self.actb_hColor; + if (actb_toid) clearTimeout(actb_toid); + if (actb_self.actb_timeOut > 0) actb_toid = setTimeout(function(){actb_mouse_on_list=0;actb_removedisp();},actb_self.actb_timeOut); + } + function actb_godown(){ + if (!actb_display) return; + if (actb_pos == actb_total) return; + document.getElementById('tat_tr'+actb_pos).style.backgroundColor = actb_self.actb_bgColor; + actb_pos++; + if (actb_pos > actb_ranged) actb_movedown(); + document.getElementById('tat_tr'+actb_pos).style.backgroundColor = actb_self.actb_hColor; + if (actb_toid) clearTimeout(actb_toid); + if (actb_self.actb_timeOut > 0) actb_toid = setTimeout(function(){actb_mouse_on_list=0;actb_removedisp();},actb_self.actb_timeOut); + } + function actb_movedown(){ + actb_rangeu++; + actb_ranged++; + actb_remake(); + } + function actb_moveup(){ + actb_rangeu--; + actb_ranged--; + actb_remake(); + } + + /* Mouse */ + function actb_mouse_down(){ + document.getElementById('tat_tr'+actb_pos).style.backgroundColor = actb_self.actb_bgColor; + actb_pos++; + actb_movedown(); + document.getElementById('tat_tr'+actb_pos).style.backgroundColor = actb_self.actb_hColor; + actb_curr.focus(); + actb_mouse_on_list = 0; + if (actb_toid) clearTimeout(actb_toid); + if (actb_self.actb_timeOut > 0) actb_toid = setTimeout(function(){actb_mouse_on_list=0;actb_removedisp();},actb_self.actb_timeOut); + } + function actb_mouse_up(evt){ + if (!evt) evt = event; + if (evt.stopPropagation){ + evt.stopPropagation(); + }else{ + evt.cancelBubble = true; + } + document.getElementById('tat_tr'+actb_pos).style.backgroundColor = actb_self.actb_bgColor; + actb_pos--; + actb_moveup(); + document.getElementById('tat_tr'+actb_pos).style.backgroundColor = actb_self.actb_hColor; + actb_curr.focus(); + actb_mouse_on_list = 0; + if (actb_toid) clearTimeout(actb_toid); + if (actb_self.actb_timeOut > 0) actb_toid = setTimeout(function(){actb_mouse_on_list=0;actb_removedisp();},actb_self.actb_timeOut); + } + function actb_mouseclick(evt){ + if (!evt) evt = event; + if (!actb_display) return; + actb_mouse_on_list = 0; + actb_pos = this.getAttribute('pos'); + actb_penter(); + } + function actb_table_focus(){ + actb_mouse_on_list = 1; + } + function actb_table_unfocus(){ + actb_mouse_on_list = 0; + if (actb_toid) clearTimeout(actb_toid); + if (actb_self.actb_timeOut > 0) actb_toid = setTimeout(function(){actb_mouse_on_list = 0;actb_removedisp();},actb_self.actb_timeOut); + } + function actb_table_highlight(){ + actb_mouse_on_list = 1; + document.getElementById('tat_tr'+actb_pos).style.backgroundColor = actb_self.actb_bgColor; + actb_pos = this.getAttribute('pos'); + while (actb_pos < actb_rangeu) actb_moveup(); + while (actb_pos > actb_ranged) actb_movedown(); + document.getElementById('tat_tr'+actb_pos).style.backgroundColor = actb_self.actb_hColor; + if (actb_toid) clearTimeout(actb_toid); + if (actb_self.actb_timeOut > 0) actb_toid = setTimeout(function(){actb_mouse_on_list = 0;actb_removedisp();},actb_self.actb_timeOut); + } + /* ---- */ + + function actb_insertword(a){ + if (actb_self.actb_delimiter.length > 0){ + str = ''; + l=0; + for (i=0;i=0;--j){ + if (actb_delimwords[i].charAt(j) != ' ') break; + postspace += ' '; + } + str += prespace; + str += a; + l = str.length; + if (gotbreak) str += postspace; + }else{ + str += actb_delimwords[i]; + } + if (i != actb_delimwords.length - 1){ + str += actb_delimchar[i]; + } + } + actb_curr.value = str; + setCaret(actb_curr,l); + }else{ + actb_curr.value = a; + } + actb_mouse_on_list = 0; + actb_removedisp(); + } + function actb_penter(){ + if (!actb_display) return; + actb_display = false; + var word = ''; + var c = 0; + for (var i=0;i<=actb_self.actb_keywords.length;i++){ + if (actb_bool[i]) c++; + if (c == actb_pos){ + word = actb_self.actb_keywords[i]; + break; + } + } + actb_insertword(word); + l = getCaretStart(actb_curr); + } + function actb_removedisp(){ + if (actb_mouse_on_list==0){ + actb_display = 0; + if (document.getElementById('tat_table')){ document.body.removeChild(document.getElementById('tat_table')); } + if (actb_toid) clearTimeout(actb_toid); + } + } + function actb_keypress(e){ + if (actb_caretmove) stopEvent(e); + return !actb_caretmove; + } + function actb_checkkey(evt){ + if (!evt) evt = event; + a = evt.keyCode; + caret_pos_start = getCaretStart(actb_curr); + actb_caretmove = 0; + switch (a){ + case 38: + actb_goup(); + actb_caretmove = 1; + return false; + break; + case 40: + actb_godown(); + actb_caretmove = 1; + return false; + break; + case 13: case 9: + if (actb_display){ + actb_caretmove = 1; + actb_penter(); + return false; + }else{ + return true; + } + break; + default: + setTimeout(function(){actb_tocomplete(a)},50); + break; + } + } + + function actb_tocomplete(kc){ + if (kc == 38 || kc == 40 || kc == 13) return; + var i; + if (actb_display){ + var word = 0; + var c = 0; + for (var i=0;i<=actb_self.actb_keywords.length;i++){ + if (actb_bool[i]) c++; + if (c == actb_pos){ + word = i; + break; + } + } + actb_pre = word; + }else{ actb_pre = -1}; + + if (actb_curr.value == ''){ + actb_mouse_on_list = 0; + actb_removedisp(); + return; + } + if (actb_self.actb_delimiter.length > 0){ + caret_pos_start = getCaretStart(actb_curr); + caret_pos_end = getCaretEnd(actb_curr); + + delim_split = ''; + for (i=0;i= l && caret_pos_end <= l + actb_delimwords[i].length){ + actb_cdelimword = i; + } + l+=actb_delimwords[i].length + 1; + } + var ot = actb_delimwords[actb_cdelimword].trim(); + var t = actb_delimwords[actb_cdelimword].addslashes().trim(); + }else{ + var ot = actb_curr.value; + var t = actb_curr.value.addslashes(); + } + if (ot.length == 0){ + actb_mouse_on_list = 0; + actb_removedisp(); + } + if (ot.length < actb_self.actb_startcheck) return this; + if (actb_self.actb_firstText){ + var re = new RegExp("^" + t, "i"); + }else{ + var re = new RegExp(t, "i"); + } + + actb_total = 0; + actb_tomake = false; + actb_kwcount = 0; + for (i=0;i 0) actb_toid = setTimeout(function(){actb_mouse_on_list = 0;actb_removedisp();},actb_self.actb_timeOut); + actb_generate(); + } + return this; +} \ No newline at end of file diff --git a/posterita/posterita/web/javascripts/builder.js b/posterita/posterita/web/javascripts/builder.js new file mode 100644 index 0000000000..8301999444 --- /dev/null +++ b/posterita/posterita/web/javascripts/builder.js @@ -0,0 +1,136 @@ +// script.aculo.us builder.js v1.8.1, Thu Jan 03 22:07:12 -0500 2008 + +// Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) +// +// script.aculo.us is freely distributable under the terms of an MIT-style license. +// For details, see the script.aculo.us web site: http://script.aculo.us/ + +var Builder = { + NODEMAP: { + AREA: 'map', + CAPTION: 'table', + COL: 'table', + COLGROUP: 'table', + LEGEND: 'fieldset', + OPTGROUP: 'select', + OPTION: 'select', + PARAM: 'object', + TBODY: 'table', + TD: 'table', + TFOOT: 'table', + TH: 'table', + THEAD: 'table', + TR: 'table' + }, + // note: For Firefox < 1.5, OPTION and OPTGROUP tags are currently broken, + // due to a Firefox bug + node: function(elementName) { + elementName = elementName.toUpperCase(); + + // try innerHTML approach + var parentTag = this.NODEMAP[elementName] || 'div'; + var parentElement = document.createElement(parentTag); + try { // prevent IE "feature": http://dev.rubyonrails.org/ticket/2707 + parentElement.innerHTML = "<" + elementName + ">"; + } catch(e) {} + var element = parentElement.firstChild || null; + + // see if browser added wrapping tags + if(element && (element.tagName.toUpperCase() != elementName)) + element = element.getElementsByTagName(elementName)[0]; + + // fallback to createElement approach + if(!element) element = document.createElement(elementName); + + // abort if nothing could be created + if(!element) return; + + // attributes (or text) + if(arguments[1]) + if(this._isStringOrNumber(arguments[1]) || + (arguments[1] instanceof Array) || + arguments[1].tagName) { + this._children(element, arguments[1]); + } else { + var attrs = this._attributes(arguments[1]); + if(attrs.length) { + try { // prevent IE "feature": http://dev.rubyonrails.org/ticket/2707 + parentElement.innerHTML = "<" +elementName + " " + + attrs + ">"; + } catch(e) {} + element = parentElement.firstChild || null; + // workaround firefox 1.0.X bug + if(!element) { + element = document.createElement(elementName); + for(attr in arguments[1]) + element[attr == 'class' ? 'className' : attr] = arguments[1][attr]; + } + if(element.tagName.toUpperCase() != elementName) + element = parentElement.getElementsByTagName(elementName)[0]; + } + } + + // text, or array of children + if(arguments[2]) + this._children(element, arguments[2]); + + return element; + }, + _text: function(text) { + return document.createTextNode(text); + }, + + ATTR_MAP: { + 'className': 'class', + 'htmlFor': 'for' + }, + + _attributes: function(attributes) { + var attrs = []; + for(attribute in attributes) + attrs.push((attribute in this.ATTR_MAP ? this.ATTR_MAP[attribute] : attribute) + + '="' + attributes[attribute].toString().escapeHTML().gsub(/"/,'"') + '"'); + return attrs.join(" "); + }, + _children: function(element, children) { + if(children.tagName) { + element.appendChild(children); + return; + } + if(typeof children=='object') { // array can hold nodes and text + children.flatten().each( function(e) { + if(typeof e=='object') + element.appendChild(e) + else + if(Builder._isStringOrNumber(e)) + element.appendChild(Builder._text(e)); + }); + } else + if(Builder._isStringOrNumber(children)) + element.appendChild(Builder._text(children)); + }, + _isStringOrNumber: function(param) { + return(typeof param=='string' || typeof param=='number'); + }, + build: function(html) { + var element = this.node('div'); + $(element).update(html.strip()); + return element.down(); + }, + dump: function(scope) { + if(typeof scope != 'object' && typeof scope != 'function') scope = window; //global scope + + var tags = ("A ABBR ACRONYM ADDRESS APPLET AREA B BASE BASEFONT BDO BIG BLOCKQUOTE BODY " + + "BR BUTTON CAPTION CENTER CITE CODE COL COLGROUP DD DEL DFN DIR DIV DL DT EM FIELDSET " + + "FONT FORM FRAME FRAMESET H1 H2 H3 H4 H5 H6 HEAD HR HTML I IFRAME IMG INPUT INS ISINDEX "+ + "KBD LABEL LEGEND LI LINK MAP MENU META NOFRAMES NOSCRIPT OBJECT OL OPTGROUP OPTION P "+ + "PARAM PRE Q S SAMP SCRIPT SELECT SMALL SPAN STRIKE STRONG STYLE SUB SUP TABLE TBODY TD "+ + "TEXTAREA TFOOT TH THEAD TITLE TR TT U UL VAR").split(/\s+/); + + tags.each( function(tag){ + scope[tag] = function() { + return Builder.node.apply(Builder, [tag].concat($A(arguments))); + } + }); + } +} diff --git a/posterita/posterita/web/javascripts/controls.js b/posterita/posterita/web/javascripts/controls.js new file mode 100644 index 0000000000..fc7968dfe1 --- /dev/null +++ b/posterita/posterita/web/javascripts/controls.js @@ -0,0 +1,965 @@ +// script.aculo.us controls.js v1.8.1, Thu Jan 03 22:07:12 -0500 2008 + +// Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) +// (c) 2005-2007 Ivan Krstic (http://blogs.law.harvard.edu/ivan) +// (c) 2005-2007 Jon Tirsen (http://www.tirsen.com) +// Contributors: +// Richard Livsey +// Rahul Bhargava +// Rob Wills +// +// script.aculo.us is freely distributable under the terms of an MIT-style license. +// For details, see the script.aculo.us web site: http://script.aculo.us/ + +// Autocompleter.Base handles all the autocompletion functionality +// that's independent of the data source for autocompletion. This +// includes drawing the autocompletion menu, observing keyboard +// and mouse events, and similar. +// +// Specific autocompleters need to provide, at the very least, +// a getUpdatedChoices function that will be invoked every time +// the text inside the monitored textbox changes. This method +// should get the text for which to provide autocompletion by +// invoking this.getToken(), NOT by directly accessing +// this.element.value. This is to allow incremental tokenized +// autocompletion. Specific auto-completion logic (AJAX, etc) +// belongs in getUpdatedChoices. +// +// Tokenized incremental autocompletion is enabled automatically +// when an autocompleter is instantiated with the 'tokens' option +// in the options parameter, e.g.: +// new Ajax.Autocompleter('id','upd', '/url/', { tokens: ',' }); +// will incrementally autocomplete with a comma as the token. +// Additionally, ',' in the above example can be replaced with +// a token array, e.g. { tokens: [',', '\n'] } which +// enables autocompletion on multiple tokens. This is most +// useful when one of the tokens is \n (a newline), as it +// allows smart autocompletion after linebreaks. + +if(typeof Effect == 'undefined') + throw("controls.js requires including script.aculo.us' effects.js library"); + +var Autocompleter = { } +Autocompleter.Base = Class.create({ + baseInitialize: function(element, update, options) { + element = $(element) + this.element = element; + this.update = $(update); + this.hasFocus = false; + this.changed = false; + this.active = false; + this.index = 0; + this.entryCount = 0; + this.oldElementValue = this.element.value; + + if(this.setOptions) + this.setOptions(options); + else + this.options = options || { }; + + this.options.paramName = this.options.paramName || this.element.name; + this.options.tokens = this.options.tokens || []; + this.options.frequency = this.options.frequency || 0.4; + this.options.minChars = this.options.minChars || 1; + this.options.onShow = this.options.onShow || + function(element, update){ + if(!update.style.position || update.style.position=='absolute') { + update.style.position = 'absolute'; + Position.clone(element, update, { + setHeight: false, + offsetTop: element.offsetHeight + }); + } + Effect.Appear(update,{duration:0.15}); + }; + this.options.onHide = this.options.onHide || + function(element, update){ new Effect.Fade(update,{duration:0.15}) }; + + if(typeof(this.options.tokens) == 'string') + this.options.tokens = new Array(this.options.tokens); + // Force carriage returns as token delimiters anyway + if (!this.options.tokens.include('\n')) + this.options.tokens.push('\n'); + + this.observer = null; + + this.element.setAttribute('autocomplete','off'); + + Element.hide(this.update); + + Event.observe(this.element, 'blur', this.onBlur.bindAsEventListener(this)); + Event.observe(this.element, 'keydown', this.onKeyPress.bindAsEventListener(this)); + }, + + show: function() { + if(Element.getStyle(this.update, 'display')=='none') this.options.onShow(this.element, this.update); + if(!this.iefix && + (Prototype.Browser.IE) && + (Element.getStyle(this.update, 'position')=='absolute')) { + new Insertion.After(this.update, + ''); + this.iefix = $(this.update.id+'_iefix'); + } + if(this.iefix) setTimeout(this.fixIEOverlapping.bind(this), 50); + }, + + fixIEOverlapping: function() { + Position.clone(this.update, this.iefix, {setTop:(!this.update.style.height)}); + this.iefix.style.zIndex = 1; + this.update.style.zIndex = 2; + Element.show(this.iefix); + }, + + hide: function() { + this.stopIndicator(); + if(Element.getStyle(this.update, 'display')!='none') this.options.onHide(this.element, this.update); + if(this.iefix) Element.hide(this.iefix); + }, + + startIndicator: function() { + if(this.options.indicator) Element.show(this.options.indicator); + }, + + stopIndicator: function() { + if(this.options.indicator) Element.hide(this.options.indicator); + }, + + onKeyPress: function(event) { + if(this.active) + switch(event.keyCode) { + case Event.KEY_TAB: + case Event.KEY_RETURN: + this.selectEntry(); + Event.stop(event); + case Event.KEY_ESC: + this.hide(); + this.active = false; + Event.stop(event); + return; + case Event.KEY_LEFT: + case Event.KEY_RIGHT: + return; + case Event.KEY_UP: + this.markPrevious(); + this.render(); + Event.stop(event); + return; + case Event.KEY_DOWN: + this.markNext(); + this.render(); + Event.stop(event); + return; + } + else + if(event.keyCode==Event.KEY_TAB || event.keyCode==Event.KEY_RETURN || + (Prototype.Browser.WebKit > 0 && event.keyCode == 0)) return; + + this.changed = true; + this.hasFocus = true; + + if(this.observer) clearTimeout(this.observer); + this.observer = + setTimeout(this.onObserverEvent.bind(this), this.options.frequency*1000); + }, + + activate: function() { + this.changed = false; + this.hasFocus = true; + this.getUpdatedChoices(); + }, + + onHover: function(event) { + var element = Event.findElement(event, 'LI'); + if(this.index != element.autocompleteIndex) + { + this.index = element.autocompleteIndex; + this.render(); + } + Event.stop(event); + }, + + onClick: function(event) { + var element = Event.findElement(event, 'LI'); + this.index = element.autocompleteIndex; + this.selectEntry(); + this.hide(); + }, + + onBlur: function(event) { + // needed to make click events working + setTimeout(this.hide.bind(this), 250); + this.hasFocus = false; + this.active = false; + }, + + render: function() { + if(this.entryCount > 0) { + for (var i = 0; i < this.entryCount; i++) + this.index==i ? + Element.addClassName(this.getEntry(i),"selected") : + Element.removeClassName(this.getEntry(i),"selected"); + if(this.hasFocus) { + this.show(); + this.active = true; + } + } else { + this.active = false; + this.hide(); + } + }, + + markPrevious: function() { + if(this.index > 0) this.index-- + else this.index = this.entryCount-1; + this.getEntry(this.index).scrollIntoView(true); + }, + + markNext: function() { + if(this.index < this.entryCount-1) this.index++ + else this.index = 0; + this.getEntry(this.index).scrollIntoView(false); + }, + + getEntry: function(index) { + return this.update.firstChild.childNodes[index]; + }, + + getCurrentEntry: function() { + return this.getEntry(this.index); + }, + + selectEntry: function() { + this.active = false; + this.updateElement(this.getCurrentEntry()); + }, + + updateElement: function(selectedElement) { + if (this.options.updateElement) { + this.options.updateElement(selectedElement); + return; + } + var value = ''; + if (this.options.select) { + var nodes = $(selectedElement).select('.' + this.options.select) || []; + if(nodes.length>0) value = Element.collectTextNodes(nodes[0], this.options.select); + } else + value = Element.collectTextNodesIgnoreClass(selectedElement, 'informal'); + + var bounds = this.getTokenBounds(); + if (bounds[0] != -1) { + var newValue = this.element.value.substr(0, bounds[0]); + var whitespace = this.element.value.substr(bounds[0]).match(/^\s+/); + if (whitespace) + newValue += whitespace[0]; + this.element.value = newValue + value + this.element.value.substr(bounds[1]); + } else { + this.element.value = value; + } + this.oldElementValue = this.element.value; + this.element.focus(); + + if (this.options.afterUpdateElement) + this.options.afterUpdateElement(this.element, selectedElement); + }, + + updateChoices: function(choices) { + if(!this.changed && this.hasFocus) { + this.update.innerHTML = choices; + Element.cleanWhitespace(this.update); + Element.cleanWhitespace(this.update.down()); + + if(this.update.firstChild && this.update.down().childNodes) { + this.entryCount = + this.update.down().childNodes.length; + for (var i = 0; i < this.entryCount; i++) { + var entry = this.getEntry(i); + entry.autocompleteIndex = i; + this.addObservers(entry); + } + } else { + this.entryCount = 0; + } + + this.stopIndicator(); + this.index = 0; + + if(this.entryCount==1 && this.options.autoSelect) { + this.selectEntry(); + this.hide(); + } else { + this.render(); + } + } + }, + + addObservers: function(element) { + Event.observe(element, "mouseover", this.onHover.bindAsEventListener(this)); + Event.observe(element, "click", this.onClick.bindAsEventListener(this)); + }, + + onObserverEvent: function() { + this.changed = false; + this.tokenBounds = null; + if(this.getToken().length>=this.options.minChars) { + this.getUpdatedChoices(); + } else { + this.active = false; + this.hide(); + } + this.oldElementValue = this.element.value; + }, + + getToken: function() { + var bounds = this.getTokenBounds(); + return this.element.value.substring(bounds[0], bounds[1]).strip(); + }, + + getTokenBounds: function() { + if (null != this.tokenBounds) return this.tokenBounds; + var value = this.element.value; + if (value.strip().empty()) return [-1, 0]; + var diff = arguments.callee.getFirstDifferencePos(value, this.oldElementValue); + var offset = (diff == this.oldElementValue.length ? 1 : 0); + var prevTokenPos = -1, nextTokenPos = value.length; + var tp; + for (var index = 0, l = this.options.tokens.length; index < l; ++index) { + tp = value.lastIndexOf(this.options.tokens[index], diff + offset - 1); + if (tp > prevTokenPos) prevTokenPos = tp; + tp = value.indexOf(this.options.tokens[index], diff + offset); + if (-1 != tp && tp < nextTokenPos) nextTokenPos = tp; + } + return (this.tokenBounds = [prevTokenPos + 1, nextTokenPos]); + } +}); + +Autocompleter.Base.prototype.getTokenBounds.getFirstDifferencePos = function(newS, oldS) { + var boundary = Math.min(newS.length, oldS.length); + for (var index = 0; index < boundary; ++index) + if (newS[index] != oldS[index]) + return index; + return boundary; +}; + +Ajax.Autocompleter = Class.create(Autocompleter.Base, { + initialize: function(element, update, url, options) { + this.baseInitialize(element, update, options); + this.options.asynchronous = true; + this.options.onComplete = this.onComplete.bind(this); + this.options.defaultParams = this.options.parameters || null; + this.url = url; + }, + + getUpdatedChoices: function() { + this.startIndicator(); + + var entry = encodeURIComponent(this.options.paramName) + '=' + + encodeURIComponent(this.getToken()); + + this.options.parameters = this.options.callback ? + this.options.callback(this.element, entry) : entry; + + if(this.options.defaultParams) + this.options.parameters += '&' + this.options.defaultParams; + + new Ajax.Request(this.url, this.options); + }, + + onComplete: function(request) { + this.updateChoices(request.responseText); + } +}); + +// The local array autocompleter. Used when you'd prefer to +// inject an array of autocompletion options into the page, rather +// than sending out Ajax queries, which can be quite slow sometimes. +// +// The constructor takes four parameters. The first two are, as usual, +// the id of the monitored textbox, and id of the autocompletion menu. +// The third is the array you want to autocomplete from, and the fourth +// is the options block. +// +// Extra local autocompletion options: +// - choices - How many autocompletion choices to offer +// +// - partialSearch - If false, the autocompleter will match entered +// text only at the beginning of strings in the +// autocomplete array. Defaults to true, which will +// match text at the beginning of any *word* in the +// strings in the autocomplete array. If you want to +// search anywhere in the string, additionally set +// the option fullSearch to true (default: off). +// +// - fullSsearch - Search anywhere in autocomplete array strings. +// +// - partialChars - How many characters to enter before triggering +// a partial match (unlike minChars, which defines +// how many characters are required to do any match +// at all). Defaults to 2. +// +// - ignoreCase - Whether to ignore case when autocompleting. +// Defaults to true. +// +// It's possible to pass in a custom function as the 'selector' +// option, if you prefer to write your own autocompletion logic. +// In that case, the other options above will not apply unless +// you support them. + +Autocompleter.Local = Class.create(Autocompleter.Base, { + initialize: function(element, update, array, options) { + this.baseInitialize(element, update, options); + this.options.array = array; + }, + + getUpdatedChoices: function() { + this.updateChoices(this.options.selector(this)); + }, + + setOptions: function(options) { + this.options = Object.extend({ + choices: 10, + partialSearch: true, + partialChars: 2, + ignoreCase: true, + fullSearch: false, + selector: function(instance) { + var ret = []; // Beginning matches + var partial = []; // Inside matches + var entry = instance.getToken(); + var count = 0; + + for (var i = 0; i < instance.options.array.length && + ret.length < instance.options.choices ; i++) { + + var elem = instance.options.array[i]; + var foundPos = instance.options.ignoreCase ? + elem.toLowerCase().indexOf(entry.toLowerCase()) : + elem.indexOf(entry); + + while (foundPos != -1) { + if (foundPos == 0 && elem.length != entry.length) { + ret.push("

  • " + elem.substr(0, entry.length) + "" + + elem.substr(entry.length) + "
  • "); + break; + } else if (entry.length >= instance.options.partialChars && + instance.options.partialSearch && foundPos != -1) { + if (instance.options.fullSearch || /\s/.test(elem.substr(foundPos-1,1))) { + partial.push("
  • " + elem.substr(0, foundPos) + "" + + elem.substr(foundPos, entry.length) + "" + elem.substr( + foundPos + entry.length) + "
  • "); + break; + } + } + + foundPos = instance.options.ignoreCase ? + elem.toLowerCase().indexOf(entry.toLowerCase(), foundPos + 1) : + elem.indexOf(entry, foundPos + 1); + + } + } + if (partial.length) + ret = ret.concat(partial.slice(0, instance.options.choices - ret.length)) + return "
      " + ret.join('') + "
    "; + } + }, options || { }); + } +}); + +// AJAX in-place editor and collection editor +// Full rewrite by Christophe Porteneuve (April 2007). + +// Use this if you notice weird scrolling problems on some browsers, +// the DOM might be a bit confused when this gets called so do this +// waits 1 ms (with setTimeout) until it does the activation +Field.scrollFreeActivate = function(field) { + setTimeout(function() { + Field.activate(field); + }, 1); +} + +Ajax.InPlaceEditor = Class.create({ + initialize: function(element, url, options) { + this.url = url; + this.element = element = $(element); + this.prepareOptions(); + this._controls = { }; + arguments.callee.dealWithDeprecatedOptions(options); // DEPRECATION LAYER!!! + Object.extend(this.options, options || { }); + if (!this.options.formId && this.element.id) { + this.options.formId = this.element.id + '-inplaceeditor'; + if ($(this.options.formId)) + this.options.formId = ''; + } + if (this.options.externalControl) + this.options.externalControl = $(this.options.externalControl); + if (!this.options.externalControl) + this.options.externalControlOnly = false; + this._originalBackground = this.element.getStyle('background-color') || 'transparent'; + this.element.title = this.options.clickToEditText; + this._boundCancelHandler = this.handleFormCancellation.bind(this); + this._boundComplete = (this.options.onComplete || Prototype.emptyFunction).bind(this); + this._boundFailureHandler = this.handleAJAXFailure.bind(this); + this._boundSubmitHandler = this.handleFormSubmission.bind(this); + this._boundWrapperHandler = this.wrapUp.bind(this); + this.registerListeners(); + }, + checkForEscapeOrReturn: function(e) { + if (!this._editing || e.ctrlKey || e.altKey || e.shiftKey) return; + if (Event.KEY_ESC == e.keyCode) + this.handleFormCancellation(e); + else if (Event.KEY_RETURN == e.keyCode) + this.handleFormSubmission(e); + }, + createControl: function(mode, handler, extraClasses) { + var control = this.options[mode + 'Control']; + var text = this.options[mode + 'Text']; + if ('button' == control) { + var btn = document.createElement('input'); + btn.type = 'submit'; + btn.value = text; + btn.className = 'editor_' + mode + '_button'; + if ('cancel' == mode) + btn.onclick = this._boundCancelHandler; + this._form.appendChild(btn); + this._controls[mode] = btn; + } else if ('link' == control) { + var link = document.createElement('a'); + link.href = '#'; + link.appendChild(document.createTextNode(text)); + link.onclick = 'cancel' == mode ? this._boundCancelHandler : this._boundSubmitHandler; + link.className = 'editor_' + mode + '_link'; + if (extraClasses) + link.className += ' ' + extraClasses; + this._form.appendChild(link); + this._controls[mode] = link; + } + }, + createEditField: function() { + var text = (this.options.loadTextURL ? this.options.loadingText : this.getText()); + var fld; + if (1 >= this.options.rows && !/\r|\n/.test(this.getText())) { + fld = document.createElement('input'); + fld.type = 'text'; + var size = this.options.size || this.options.cols || 0; + if (0 < size) fld.size = size; + } else { + fld = document.createElement('textarea'); + fld.rows = (1 >= this.options.rows ? this.options.autoRows : this.options.rows); + fld.cols = this.options.cols || 40; + } + fld.name = this.options.paramName; + fld.value = text; // No HTML breaks conversion anymore + fld.className = 'editor_field'; + if (this.options.submitOnBlur) + fld.onblur = this._boundSubmitHandler; + this._controls.editor = fld; + if (this.options.loadTextURL) + this.loadExternalText(); + this._form.appendChild(this._controls.editor); + }, + createForm: function() { + var ipe = this; + function addText(mode, condition) { + var text = ipe.options['text' + mode + 'Controls']; + if (!text || condition === false) return; + ipe._form.appendChild(document.createTextNode(text)); + }; + this._form = $(document.createElement('form')); + this._form.id = this.options.formId; + this._form.addClassName(this.options.formClassName); + this._form.onsubmit = this._boundSubmitHandler; + this.createEditField(); + if ('textarea' == this._controls.editor.tagName.toLowerCase()) + this._form.appendChild(document.createElement('br')); + if (this.options.onFormCustomization) + this.options.onFormCustomization(this, this._form); + addText('Before', this.options.okControl || this.options.cancelControl); + this.createControl('ok', this._boundSubmitHandler); + addText('Between', this.options.okControl && this.options.cancelControl); + this.createControl('cancel', this._boundCancelHandler, 'editor_cancel'); + addText('After', this.options.okControl || this.options.cancelControl); + }, + destroy: function() { + if (this._oldInnerHTML) + this.element.innerHTML = this._oldInnerHTML; + this.leaveEditMode(); + this.unregisterListeners(); + }, + enterEditMode: function(e) { + if (this._saving || this._editing) return; + this._editing = true; + this.triggerCallback('onEnterEditMode'); + if (this.options.externalControl) + this.options.externalControl.hide(); + this.element.hide(); + this.createForm(); + this.element.parentNode.insertBefore(this._form, this.element); + if (!this.options.loadTextURL) + this.postProcessEditField(); + if (e) Event.stop(e); + }, + enterHover: function(e) { + if (this.options.hoverClassName) + this.element.addClassName(this.options.hoverClassName); + if (this._saving) return; + this.triggerCallback('onEnterHover'); + }, + getText: function() { + return this.element.innerHTML; + }, + handleAJAXFailure: function(transport) { + this.triggerCallback('onFailure', transport); + if (this._oldInnerHTML) { + this.element.innerHTML = this._oldInnerHTML; + this._oldInnerHTML = null; + } + }, + handleFormCancellation: function(e) { + this.wrapUp(); + if (e) Event.stop(e); + }, + handleFormSubmission: function(e) { + var form = this._form; + var value = $F(this._controls.editor); + this.prepareSubmission(); + var params = this.options.callback(form, value) || ''; + if (Object.isString(params)) + params = params.toQueryParams(); + params.editorId = this.element.id; + if (this.options.htmlResponse) { + var options = Object.extend({ evalScripts: true }, this.options.ajaxOptions); + Object.extend(options, { + parameters: params, + onComplete: this._boundWrapperHandler, + onFailure: this._boundFailureHandler + }); + new Ajax.Updater({ success: this.element }, this.url, options); + } else { + var options = Object.extend({ method: 'get' }, this.options.ajaxOptions); + Object.extend(options, { + parameters: params, + onComplete: this._boundWrapperHandler, + onFailure: this._boundFailureHandler + }); + new Ajax.Request(this.url, options); + } + if (e) Event.stop(e); + }, + leaveEditMode: function() { + this.element.removeClassName(this.options.savingClassName); + this.removeForm(); + this.leaveHover(); + this.element.style.backgroundColor = this._originalBackground; + this.element.show(); + if (this.options.externalControl) + this.options.externalControl.show(); + this._saving = false; + this._editing = false; + this._oldInnerHTML = null; + this.triggerCallback('onLeaveEditMode'); + }, + leaveHover: function(e) { + if (this.options.hoverClassName) + this.element.removeClassName(this.options.hoverClassName); + if (this._saving) return; + this.triggerCallback('onLeaveHover'); + }, + loadExternalText: function() { + this._form.addClassName(this.options.loadingClassName); + this._controls.editor.disabled = true; + var options = Object.extend({ method: 'get' }, this.options.ajaxOptions); + Object.extend(options, { + parameters: 'editorId=' + encodeURIComponent(this.element.id), + onComplete: Prototype.emptyFunction, + onSuccess: function(transport) { + this._form.removeClassName(this.options.loadingClassName); + var text = transport.responseText; + if (this.options.stripLoadedTextTags) + text = text.stripTags(); + this._controls.editor.value = text; + this._controls.editor.disabled = false; + this.postProcessEditField(); + }.bind(this), + onFailure: this._boundFailureHandler + }); + new Ajax.Request(this.options.loadTextURL, options); + }, + postProcessEditField: function() { + var fpc = this.options.fieldPostCreation; + if (fpc) + $(this._controls.editor)['focus' == fpc ? 'focus' : 'activate'](); + }, + prepareOptions: function() { + this.options = Object.clone(Ajax.InPlaceEditor.DefaultOptions); + Object.extend(this.options, Ajax.InPlaceEditor.DefaultCallbacks); + [this._extraDefaultOptions].flatten().compact().each(function(defs) { + Object.extend(this.options, defs); + }.bind(this)); + }, + prepareSubmission: function() { + this._saving = true; + this.removeForm(); + this.leaveHover(); + this.showSaving(); + }, + registerListeners: function() { + this._listeners = { }; + var listener; + $H(Ajax.InPlaceEditor.Listeners).each(function(pair) { + listener = this[pair.value].bind(this); + this._listeners[pair.key] = listener; + if (!this.options.externalControlOnly) + this.element.observe(pair.key, listener); + if (this.options.externalControl) + this.options.externalControl.observe(pair.key, listener); + }.bind(this)); + }, + removeForm: function() { + if (!this._form) return; + this._form.remove(); + this._form = null; + this._controls = { }; + }, + showSaving: function() { + this._oldInnerHTML = this.element.innerHTML; + this.element.innerHTML = this.options.savingText; + this.element.addClassName(this.options.savingClassName); + this.element.style.backgroundColor = this._originalBackground; + this.element.show(); + }, + triggerCallback: function(cbName, arg) { + if ('function' == typeof this.options[cbName]) { + this.options[cbName](this, arg); + } + }, + unregisterListeners: function() { + $H(this._listeners).each(function(pair) { + if (!this.options.externalControlOnly) + this.element.stopObserving(pair.key, pair.value); + if (this.options.externalControl) + this.options.externalControl.stopObserving(pair.key, pair.value); + }.bind(this)); + }, + wrapUp: function(transport) { + this.leaveEditMode(); + // Can't use triggerCallback due to backward compatibility: requires + // binding + direct element + this._boundComplete(transport, this.element); + } +}); + +Object.extend(Ajax.InPlaceEditor.prototype, { + dispose: Ajax.InPlaceEditor.prototype.destroy +}); + +Ajax.InPlaceCollectionEditor = Class.create(Ajax.InPlaceEditor, { + initialize: function($super, element, url, options) { + this._extraDefaultOptions = Ajax.InPlaceCollectionEditor.DefaultOptions; + $super(element, url, options); + }, + + createEditField: function() { + var list = document.createElement('select'); + list.name = this.options.paramName; + list.size = 1; + this._controls.editor = list; + this._collection = this.options.collection || []; + if (this.options.loadCollectionURL) + this.loadCollection(); + else + this.checkForExternalText(); + this._form.appendChild(this._controls.editor); + }, + + loadCollection: function() { + this._form.addClassName(this.options.loadingClassName); + this.showLoadingText(this.options.loadingCollectionText); + var options = Object.extend({ method: 'get' }, this.options.ajaxOptions); + Object.extend(options, { + parameters: 'editorId=' + encodeURIComponent(this.element.id), + onComplete: Prototype.emptyFunction, + onSuccess: function(transport) { + var js = transport.responseText.strip(); + if (!/^\[.*\]$/.test(js)) // TODO: improve sanity check + throw 'Server returned an invalid collection representation.'; + this._collection = eval(js); + this.checkForExternalText(); + }.bind(this), + onFailure: this.onFailure + }); + new Ajax.Request(this.options.loadCollectionURL, options); + }, + + showLoadingText: function(text) { + this._controls.editor.disabled = true; + var tempOption = this._controls.editor.firstChild; + if (!tempOption) { + tempOption = document.createElement('option'); + tempOption.value = ''; + this._controls.editor.appendChild(tempOption); + tempOption.selected = true; + } + tempOption.update((text || '').stripScripts().stripTags()); + }, + + checkForExternalText: function() { + this._text = this.getText(); + if (this.options.loadTextURL) + this.loadExternalText(); + else + this.buildOptionList(); + }, + + loadExternalText: function() { + this.showLoadingText(this.options.loadingText); + var options = Object.extend({ method: 'get' }, this.options.ajaxOptions); + Object.extend(options, { + parameters: 'editorId=' + encodeURIComponent(this.element.id), + onComplete: Prototype.emptyFunction, + onSuccess: function(transport) { + this._text = transport.responseText.strip(); + this.buildOptionList(); + }.bind(this), + onFailure: this.onFailure + }); + new Ajax.Request(this.options.loadTextURL, options); + }, + + buildOptionList: function() { + this._form.removeClassName(this.options.loadingClassName); + this._collection = this._collection.map(function(entry) { + return 2 === entry.length ? entry : [entry, entry].flatten(); + }); + var marker = ('value' in this.options) ? this.options.value : this._text; + var textFound = this._collection.any(function(entry) { + return entry[0] == marker; + }.bind(this)); + this._controls.editor.update(''); + var option; + this._collection.each(function(entry, index) { + option = document.createElement('option'); + option.value = entry[0]; + option.selected = textFound ? entry[0] == marker : 0 == index; + option.appendChild(document.createTextNode(entry[1])); + this._controls.editor.appendChild(option); + }.bind(this)); + this._controls.editor.disabled = false; + Field.scrollFreeActivate(this._controls.editor); + } +}); + +//**** DEPRECATION LAYER FOR InPlace[Collection]Editor! **** +//**** This only exists for a while, in order to let **** +//**** users adapt to the new API. Read up on the new **** +//**** API and convert your code to it ASAP! **** + +Ajax.InPlaceEditor.prototype.initialize.dealWithDeprecatedOptions = function(options) { + if (!options) return; + function fallback(name, expr) { + if (name in options || expr === undefined) return; + options[name] = expr; + }; + fallback('cancelControl', (options.cancelLink ? 'link' : (options.cancelButton ? 'button' : + options.cancelLink == options.cancelButton == false ? false : undefined))); + fallback('okControl', (options.okLink ? 'link' : (options.okButton ? 'button' : + options.okLink == options.okButton == false ? false : undefined))); + fallback('highlightColor', options.highlightcolor); + fallback('highlightEndColor', options.highlightendcolor); +}; + +Object.extend(Ajax.InPlaceEditor, { + DefaultOptions: { + ajaxOptions: { }, + autoRows: 3, // Use when multi-line w/ rows == 1 + cancelControl: 'link', // 'link'|'button'|false + cancelText: 'cancel', + clickToEditText: 'Click to edit', + externalControl: null, // id|elt + externalControlOnly: false, + fieldPostCreation: 'activate', // 'activate'|'focus'|false + formClassName: 'inplaceeditor-form', + formId: null, // id|elt + highlightColor: '#ffff99', + highlightEndColor: '#ffffff', + hoverClassName: '', + htmlResponse: true, + loadingClassName: 'inplaceeditor-loading', + loadingText: 'Loading...', + okControl: 'button', // 'link'|'button'|false + okText: 'ok', + paramName: 'value', + rows: 1, // If 1 and multi-line, uses autoRows + savingClassName: 'inplaceeditor-saving', + savingText: 'Saving...', + size: 0, + stripLoadedTextTags: false, + submitOnBlur: false, + textAfterControls: '', + textBeforeControls: '', + textBetweenControls: '' + }, + DefaultCallbacks: { + callback: function(form) { + return Form.serialize(form); + }, + onComplete: function(transport, element) { + // For backward compatibility, this one is bound to the IPE, and passes + // the element directly. It was too often customized, so we don't break it. + new Effect.Highlight(element, { + startcolor: this.options.highlightColor, keepBackgroundImage: true }); + }, + onEnterEditMode: null, + onEnterHover: function(ipe) { + ipe.element.style.backgroundColor = ipe.options.highlightColor; + if (ipe._effect) + ipe._effect.cancel(); + }, + onFailure: function(transport, ipe) { + alert('Error communication with the server: ' + transport.responseText.stripTags()); + }, + onFormCustomization: null, // Takes the IPE and its generated form, after editor, before controls. + onLeaveEditMode: null, + onLeaveHover: function(ipe) { + ipe._effect = new Effect.Highlight(ipe.element, { + startcolor: ipe.options.highlightColor, endcolor: ipe.options.highlightEndColor, + restorecolor: ipe._originalBackground, keepBackgroundImage: true + }); + } + }, + Listeners: { + click: 'enterEditMode', + keydown: 'checkForEscapeOrReturn', + mouseover: 'enterHover', + mouseout: 'leaveHover' + } +}); + +Ajax.InPlaceCollectionEditor.DefaultOptions = { + loadingCollectionText: 'Loading options...' +}; + +// Delayed observer, like Form.Element.Observer, +// but waits for delay after last key input +// Ideal for live-search fields + +Form.Element.DelayedObserver = Class.create({ + initialize: function(element, delay, callback) { + this.delay = delay || 0.5; + this.element = $(element); + this.callback = callback; + this.timer = null; + this.lastValue = $F(this.element); + Event.observe(this.element,'keyup',this.delayedListener.bindAsEventListener(this)); + }, + delayedListener: function(event) { + if(this.lastValue == $F(this.element)) return; + if(this.timer) clearTimeout(this.timer); + this.timer = setTimeout(this.onTimerEvent.bind(this), this.delay * 1000); + this.lastValue = $F(this.element); + }, + onTimerEvent: function() { + this.timer = null; + this.callback(this.element, $F(this.element)); + } +}); diff --git a/posterita/posterita/web/javascripts/dialogbox.js b/posterita/posterita/web/javascripts/dialogbox.js new file mode 100644 index 0000000000..472a962e19 --- /dev/null +++ b/posterita/posterita/web/javascripts/dialogbox.js @@ -0,0 +1,81 @@ +/* +Copyright sprsquish +All rights reserved. + +http://snippets.dzone.com/user/sprsquish +*/ + +var Dialog = {}; +Dialog.Box = Class.create(); +Object.extend(Dialog.Box.prototype, { + initialize: function(id) { + this.createOverlay(); + + this.dialog_box = $(id); + this.dialog_box.show = this.show.bind(this); + this.dialog_box.hide = this.hide.bind(this); + + this.parent_element = this.dialog_box.parentNode; + + this.dialog_box.style.position = "absolute"; + var e_dims = Element.getDimensions(this.dialog_box); + var b_dims = Element.getDimensions(this.overlay); + this.dialog_box.style.left = ((b_dims.width/2) - (e_dims.width/2)) + 'px'; + this.dialog_box.style.top = '12px'; + this.dialog_box.style.zIndex = this.overlay.style.zIndex + 1; + + }, + + createOverlay: function() { + if($('dialog_overlay')) { + this.overlay = $('dialog_overlay'); + } else { + this.overlay = document.createElement('div'); + this.overlay.id = 'dialog_overlay'; + Object.extend(this.overlay.style, { + position: 'absolute', + top: 0, + left: 0, + zIndex: 90, + width: '100%', + backgroundColor: '#000', + display: 'none' + }); + document.body.insertBefore(this.overlay, document.body.childNodes[0]); + } + }, + + moveDialogBox: function(where) { + Element.remove(this.dialog_box); + if(where == 'back') + this.dialog_box = this.parent_element.appendChild(this.dialog_box); + else + this.dialog_box = this.overlay.parentNode.insertBefore(this.dialog_box, this.overlay); + }, + + show: function() { + this.overlay.style.height = document.body.getHeight()+'px'; + this.moveDialogBox('out'); + this.overlay.onclick = this.hide.bind(this); + this.selectBoxes('hide'); + new Effect.Appear(this.overlay, {duration: 0.1, from: 0.0, to: 0.3}); + this.dialog_box.style.display = ''; + }, + + hide: function() { + this.selectBoxes('show'); + new Effect.Fade(this.overlay, {duration: 0.1}); + this.dialog_box.style.display = 'none'; + this.moveDialogBox('back'); + $A(this.dialog_box.getElementsByTagName('input')).each(function(e){if(e.type!='submit')e.value=''}); + }, + + selectBoxes: function(what) { + $A(document.getElementsByTagName('select')).each(function(select) { + Element[what](select); + }); + + if(what == 'hide') + $A(this.dialog_box.getElementsByTagName('select')).each(function(select){Element.show(select)}) + } +}); \ No newline at end of file diff --git a/posterita/posterita/web/javascripts/dragdrop.js b/posterita/posterita/web/javascripts/dragdrop.js new file mode 100644 index 0000000000..bf429c2616 --- /dev/null +++ b/posterita/posterita/web/javascripts/dragdrop.js @@ -0,0 +1,974 @@ +// script.aculo.us dragdrop.js v1.8.1, Thu Jan 03 22:07:12 -0500 2008 + +// Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) +// (c) 2005-2007 Sammi Williams (http://www.oriontransfer.co.nz, sammi@oriontransfer.co.nz) +// +// script.aculo.us is freely distributable under the terms of an MIT-style license. +// For details, see the script.aculo.us web site: http://script.aculo.us/ + +if(Object.isUndefined(Effect)) + throw("dragdrop.js requires including script.aculo.us' effects.js library"); + +var Droppables = { + drops: [], + + remove: function(element) { + this.drops = this.drops.reject(function(d) { return d.element==$(element) }); + }, + + add: function(element) { + element = $(element); + var options = Object.extend({ + greedy: true, + hoverclass: null, + tree: false + }, arguments[1] || { }); + + // cache containers + if(options.containment) { + options._containers = []; + var containment = options.containment; + if(Object.isArray(containment)) { + containment.each( function(c) { options._containers.push($(c)) }); + } else { + options._containers.push($(containment)); + } + } + + if(options.accept) options.accept = [options.accept].flatten(); + + Element.makePositioned(element); // fix IE + options.element = element; + + this.drops.push(options); + }, + + findDeepestChild: function(drops) { + deepest = drops[0]; + + for (i = 1; i < drops.length; ++i) + if (Element.isParent(drops[i].element, deepest.element)) + deepest = drops[i]; + + return deepest; + }, + + isContained: function(element, drop) { + var containmentNode; + if(drop.tree) { + containmentNode = element.treeNode; + } else { + containmentNode = element.parentNode; + } + return drop._containers.detect(function(c) { return containmentNode == c }); + }, + + isAffected: function(point, element, drop) { + return ( + (drop.element!=element) && + ((!drop._containers) || + this.isContained(element, drop)) && + ((!drop.accept) || + (Element.classNames(element).detect( + function(v) { return drop.accept.include(v) } ) )) && + Position.within(drop.element, point[0], point[1]) ); + }, + + deactivate: function(drop) { + if(drop.hoverclass) + Element.removeClassName(drop.element, drop.hoverclass); + this.last_active = null; + }, + + activate: function(drop) { + if(drop.hoverclass) + Element.addClassName(drop.element, drop.hoverclass); + this.last_active = drop; + }, + + show: function(point, element) { + if(!this.drops.length) return; + var drop, affected = []; + + this.drops.each( function(drop) { + if(Droppables.isAffected(point, element, drop)) + affected.push(drop); + }); + + if(affected.length>0) + drop = Droppables.findDeepestChild(affected); + + if(this.last_active && this.last_active != drop) this.deactivate(this.last_active); + if (drop) { + Position.within(drop.element, point[0], point[1]); + if(drop.onHover) + drop.onHover(element, drop.element, Position.overlap(drop.overlap, drop.element)); + + if (drop != this.last_active) Droppables.activate(drop); + } + }, + + fire: function(event, element) { + if(!this.last_active) return; + Position.prepare(); + + if (this.isAffected([Event.pointerX(event), Event.pointerY(event)], element, this.last_active)) + if (this.last_active.onDrop) { + this.last_active.onDrop(element, this.last_active.element, event); + return true; + } + }, + + reset: function() { + if(this.last_active) + this.deactivate(this.last_active); + } +} + +var Draggables = { + drags: [], + observers: [], + + register: function(draggable) { + if(this.drags.length == 0) { + this.eventMouseUp = this.endDrag.bindAsEventListener(this); + this.eventMouseMove = this.updateDrag.bindAsEventListener(this); + this.eventKeypress = this.keyPress.bindAsEventListener(this); + + Event.observe(document, "mouseup", this.eventMouseUp); + Event.observe(document, "mousemove", this.eventMouseMove); + Event.observe(document, "keypress", this.eventKeypress); + } + this.drags.push(draggable); + }, + + unregister: function(draggable) { + this.drags = this.drags.reject(function(d) { return d==draggable }); + if(this.drags.length == 0) { + Event.stopObserving(document, "mouseup", this.eventMouseUp); + Event.stopObserving(document, "mousemove", this.eventMouseMove); + Event.stopObserving(document, "keypress", this.eventKeypress); + } + }, + + activate: function(draggable) { + if(draggable.options.delay) { + this._timeout = setTimeout(function() { + Draggables._timeout = null; + window.focus(); + Draggables.activeDraggable = draggable; + }.bind(this), draggable.options.delay); + } else { + window.focus(); // allows keypress events if window isn't currently focused, fails for Safari + this.activeDraggable = draggable; + } + }, + + deactivate: function() { + this.activeDraggable = null; + }, + + updateDrag: function(event) { + if(!this.activeDraggable) return; + var pointer = [Event.pointerX(event), Event.pointerY(event)]; + // Mozilla-based browsers fire successive mousemove events with + // the same coordinates, prevent needless redrawing (moz bug?) + if(this._lastPointer && (this._lastPointer.inspect() == pointer.inspect())) return; + this._lastPointer = pointer; + + this.activeDraggable.updateDrag(event, pointer); + }, + + endDrag: function(event) { + if(this._timeout) { + clearTimeout(this._timeout); + this._timeout = null; + } + if(!this.activeDraggable) return; + this._lastPointer = null; + this.activeDraggable.endDrag(event); + this.activeDraggable = null; + }, + + keyPress: function(event) { + if(this.activeDraggable) + this.activeDraggable.keyPress(event); + }, + + addObserver: function(observer) { + this.observers.push(observer); + this._cacheObserverCallbacks(); + }, + + removeObserver: function(element) { // element instead of observer fixes mem leaks + this.observers = this.observers.reject( function(o) { return o.element==element }); + this._cacheObserverCallbacks(); + }, + + notify: function(eventName, draggable, event) { // 'onStart', 'onEnd', 'onDrag' + if(this[eventName+'Count'] > 0) + this.observers.each( function(o) { + if(o[eventName]) o[eventName](eventName, draggable, event); + }); + if(draggable.options[eventName]) draggable.options[eventName](draggable, event); + }, + + _cacheObserverCallbacks: function() { + ['onStart','onEnd','onDrag'].each( function(eventName) { + Draggables[eventName+'Count'] = Draggables.observers.select( + function(o) { return o[eventName]; } + ).length; + }); + } +} + +/*--------------------------------------------------------------------------*/ + +var Draggable = Class.create({ + initialize: function(element) { + var defaults = { + handle: false, + reverteffect: function(element, top_offset, left_offset) { + var dur = Math.sqrt(Math.abs(top_offset^2)+Math.abs(left_offset^2))*0.02; + new Effect.Move(element, { x: -left_offset, y: -top_offset, duration: dur, + queue: {scope:'_draggable', position:'end'} + }); + }, + endeffect: function(element) { + var toOpacity = Object.isNumber(element._opacity) ? element._opacity : 1.0; + new Effect.Opacity(element, {duration:0.2, from:0.7, to:toOpacity, + queue: {scope:'_draggable', position:'end'}, + afterFinish: function(){ + Draggable._dragging[element] = false + } + }); + }, + zindex: 1000, + revert: false, + quiet: false, + scroll: false, + scrollSensitivity: 20, + scrollSpeed: 15, + snap: false, // false, or xy or [x,y] or function(x,y){ return [x,y] } + delay: 0 + }; + + if(!arguments[1] || Object.isUndefined(arguments[1].endeffect)) + Object.extend(defaults, { + starteffect: function(element) { + element._opacity = Element.getOpacity(element); + Draggable._dragging[element] = true; + new Effect.Opacity(element, {duration:0.2, from:element._opacity, to:0.7}); + } + }); + + var options = Object.extend(defaults, arguments[1] || { }); + + this.element = $(element); + + if(options.handle && Object.isString(options.handle)) + this.handle = this.element.down('.'+options.handle, 0); + + if(!this.handle) this.handle = $(options.handle); + if(!this.handle) this.handle = this.element; + + if(options.scroll && !options.scroll.scrollTo && !options.scroll.outerHTML) { + options.scroll = $(options.scroll); + this._isScrollChild = Element.childOf(this.element, options.scroll); + } + + Element.makePositioned(this.element); // fix IE + + this.options = options; + this.dragging = false; + + this.eventMouseDown = this.initDrag.bindAsEventListener(this); + Event.observe(this.handle, "mousedown", this.eventMouseDown); + + Draggables.register(this); + }, + + destroy: function() { + Event.stopObserving(this.handle, "mousedown", this.eventMouseDown); + Draggables.unregister(this); + }, + + currentDelta: function() { + return([ + parseInt(Element.getStyle(this.element,'left') || '0'), + parseInt(Element.getStyle(this.element,'top') || '0')]); + }, + + initDrag: function(event) { + if(!Object.isUndefined(Draggable._dragging[this.element]) && + Draggable._dragging[this.element]) return; + if(Event.isLeftClick(event)) { + // abort on form elements, fixes a Firefox issue + var src = Event.element(event); + if((tag_name = src.tagName.toUpperCase()) && ( + tag_name=='INPUT' || + tag_name=='SELECT' || + tag_name=='OPTION' || + tag_name=='BUTTON' || + tag_name=='TEXTAREA')) return; + + var pointer = [Event.pointerX(event), Event.pointerY(event)]; + var pos = Position.cumulativeOffset(this.element); + this.offset = [0,1].map( function(i) { return (pointer[i] - pos[i]) }); + + Draggables.activate(this); + Event.stop(event); + } + }, + + startDrag: function(event) { + this.dragging = true; + if(!this.delta) + this.delta = this.currentDelta(); + + if(this.options.zindex) { + this.originalZ = parseInt(Element.getStyle(this.element,'z-index') || 0); + this.element.style.zIndex = this.options.zindex; + } + + if(this.options.ghosting) { + this._clone = this.element.cloneNode(true); + this.element._originallyAbsolute = (this.element.getStyle('position') == 'absolute'); + if (!this.element._originallyAbsolute) + Position.absolutize(this.element); + this.element.parentNode.insertBefore(this._clone, this.element); + } + + if(this.options.scroll) { + if (this.options.scroll == window) { + var where = this._getWindowScroll(this.options.scroll); + this.originalScrollLeft = where.left; + this.originalScrollTop = where.top; + } else { + this.originalScrollLeft = this.options.scroll.scrollLeft; + this.originalScrollTop = this.options.scroll.scrollTop; + } + } + + Draggables.notify('onStart', this, event); + + if(this.options.starteffect) this.options.starteffect(this.element); + }, + + updateDrag: function(event, pointer) { + if(!this.dragging) this.startDrag(event); + + if(!this.options.quiet){ + Position.prepare(); + Droppables.show(pointer, this.element); + } + + Draggables.notify('onDrag', this, event); + + this.draw(pointer); + if(this.options.change) this.options.change(this); + + if(this.options.scroll) { + this.stopScrolling(); + + var p; + if (this.options.scroll == window) { + with(this._getWindowScroll(this.options.scroll)) { p = [ left, top, left+width, top+height ]; } + } else { + p = Position.page(this.options.scroll); + p[0] += this.options.scroll.scrollLeft + Position.deltaX; + p[1] += this.options.scroll.scrollTop + Position.deltaY; + p.push(p[0]+this.options.scroll.offsetWidth); + p.push(p[1]+this.options.scroll.offsetHeight); + } + var speed = [0,0]; + if(pointer[0] < (p[0]+this.options.scrollSensitivity)) speed[0] = pointer[0]-(p[0]+this.options.scrollSensitivity); + if(pointer[1] < (p[1]+this.options.scrollSensitivity)) speed[1] = pointer[1]-(p[1]+this.options.scrollSensitivity); + if(pointer[0] > (p[2]-this.options.scrollSensitivity)) speed[0] = pointer[0]-(p[2]-this.options.scrollSensitivity); + if(pointer[1] > (p[3]-this.options.scrollSensitivity)) speed[1] = pointer[1]-(p[3]-this.options.scrollSensitivity); + this.startScrolling(speed); + } + + // fix AppleWebKit rendering + if(Prototype.Browser.WebKit) window.scrollBy(0,0); + + Event.stop(event); + }, + + finishDrag: function(event, success) { + this.dragging = false; + + if(this.options.quiet){ + Position.prepare(); + var pointer = [Event.pointerX(event), Event.pointerY(event)]; + Droppables.show(pointer, this.element); + } + + if(this.options.ghosting) { + if (!this.element._originallyAbsolute) + Position.relativize(this.element); + delete this.element._originallyAbsolute; + Element.remove(this._clone); + this._clone = null; + } + + var dropped = false; + if(success) { + dropped = Droppables.fire(event, this.element); + if (!dropped) dropped = false; + } + if(dropped && this.options.onDropped) this.options.onDropped(this.element); + Draggables.notify('onEnd', this, event); + + var revert = this.options.revert; + if(revert && Object.isFunction(revert)) revert = revert(this.element); + + var d = this.currentDelta(); + if(revert && this.options.reverteffect) { + if (dropped == 0 || revert != 'failure') + this.options.reverteffect(this.element, + d[1]-this.delta[1], d[0]-this.delta[0]); + } else { + this.delta = d; + } + + if(this.options.zindex) + this.element.style.zIndex = this.originalZ; + + if(this.options.endeffect) + this.options.endeffect(this.element); + + Draggables.deactivate(this); + Droppables.reset(); + }, + + keyPress: function(event) { + if(event.keyCode!=Event.KEY_ESC) return; + this.finishDrag(event, false); + Event.stop(event); + }, + + endDrag: function(event) { + if(!this.dragging) return; + this.stopScrolling(); + this.finishDrag(event, true); + Event.stop(event); + }, + + draw: function(point) { + var pos = Position.cumulativeOffset(this.element); + if(this.options.ghosting) { + var r = Position.realOffset(this.element); + pos[0] += r[0] - Position.deltaX; pos[1] += r[1] - Position.deltaY; + } + + var d = this.currentDelta(); + pos[0] -= d[0]; pos[1] -= d[1]; + + if(this.options.scroll && (this.options.scroll != window && this._isScrollChild)) { + pos[0] -= this.options.scroll.scrollLeft-this.originalScrollLeft; + pos[1] -= this.options.scroll.scrollTop-this.originalScrollTop; + } + + var p = [0,1].map(function(i){ + return (point[i]-pos[i]-this.offset[i]) + }.bind(this)); + + if(this.options.snap) { + if(Object.isFunction(this.options.snap)) { + p = this.options.snap(p[0],p[1],this); + } else { + if(Object.isArray(this.options.snap)) { + p = p.map( function(v, i) { + return (v/this.options.snap[i]).round()*this.options.snap[i] }.bind(this)) + } else { + p = p.map( function(v) { + return (v/this.options.snap).round()*this.options.snap }.bind(this)) + } + }} + + var style = this.element.style; + if((!this.options.constraint) || (this.options.constraint=='horizontal')) + style.left = p[0] + "px"; + if((!this.options.constraint) || (this.options.constraint=='vertical')) + style.top = p[1] + "px"; + + if(style.visibility=="hidden") style.visibility = ""; // fix gecko rendering + }, + + stopScrolling: function() { + if(this.scrollInterval) { + clearInterval(this.scrollInterval); + this.scrollInterval = null; + Draggables._lastScrollPointer = null; + } + }, + + startScrolling: function(speed) { + if(!(speed[0] || speed[1])) return; + this.scrollSpeed = [speed[0]*this.options.scrollSpeed,speed[1]*this.options.scrollSpeed]; + this.lastScrolled = new Date(); + this.scrollInterval = setInterval(this.scroll.bind(this), 10); + }, + + scroll: function() { + var current = new Date(); + var delta = current - this.lastScrolled; + this.lastScrolled = current; + if(this.options.scroll == window) { + with (this._getWindowScroll(this.options.scroll)) { + if (this.scrollSpeed[0] || this.scrollSpeed[1]) { + var d = delta / 1000; + this.options.scroll.scrollTo( left + d*this.scrollSpeed[0], top + d*this.scrollSpeed[1] ); + } + } + } else { + this.options.scroll.scrollLeft += this.scrollSpeed[0] * delta / 1000; + this.options.scroll.scrollTop += this.scrollSpeed[1] * delta / 1000; + } + + Position.prepare(); + Droppables.show(Draggables._lastPointer, this.element); + Draggables.notify('onDrag', this); + if (this._isScrollChild) { + Draggables._lastScrollPointer = Draggables._lastScrollPointer || $A(Draggables._lastPointer); + Draggables._lastScrollPointer[0] += this.scrollSpeed[0] * delta / 1000; + Draggables._lastScrollPointer[1] += this.scrollSpeed[1] * delta / 1000; + if (Draggables._lastScrollPointer[0] < 0) + Draggables._lastScrollPointer[0] = 0; + if (Draggables._lastScrollPointer[1] < 0) + Draggables._lastScrollPointer[1] = 0; + this.draw(Draggables._lastScrollPointer); + } + + if(this.options.change) this.options.change(this); + }, + + _getWindowScroll: function(w) { + var T, L, W, H; + with (w.document) { + if (w.document.documentElement && documentElement.scrollTop) { + T = documentElement.scrollTop; + L = documentElement.scrollLeft; + } else if (w.document.body) { + T = body.scrollTop; + L = body.scrollLeft; + } + if (w.innerWidth) { + W = w.innerWidth; + H = w.innerHeight; + } else if (w.document.documentElement && documentElement.clientWidth) { + W = documentElement.clientWidth; + H = documentElement.clientHeight; + } else { + W = body.offsetWidth; + H = body.offsetHeight + } + } + return { top: T, left: L, width: W, height: H }; + } +}); + +Draggable._dragging = { }; + +/*--------------------------------------------------------------------------*/ + +var SortableObserver = Class.create({ + initialize: function(element, observer) { + this.element = $(element); + this.observer = observer; + this.lastValue = Sortable.serialize(this.element); + }, + + onStart: function() { + this.lastValue = Sortable.serialize(this.element); + }, + + onEnd: function() { + Sortable.unmark(); + if(this.lastValue != Sortable.serialize(this.element)) + this.observer(this.element) + } +}); + +var Sortable = { + SERIALIZE_RULE: /^[^_\-](?:[A-Za-z0-9\-\_]*)[_](.*)$/, + + sortables: { }, + + _findRootElement: function(element) { + while (element.tagName.toUpperCase() != "BODY") { + if(element.id && Sortable.sortables[element.id]) return element; + element = element.parentNode; + } + }, + + options: function(element) { + element = Sortable._findRootElement($(element)); + if(!element) return; + return Sortable.sortables[element.id]; + }, + + destroy: function(element){ + var s = Sortable.options(element); + + if(s) { + Draggables.removeObserver(s.element); + s.droppables.each(function(d){ Droppables.remove(d) }); + s.draggables.invoke('destroy'); + + delete Sortable.sortables[s.element.id]; + } + }, + + create: function(element) { + element = $(element); + var options = Object.extend({ + element: element, + tag: 'li', // assumes li children, override with tag: 'tagname' + dropOnEmpty: false, + tree: false, + treeTag: 'ul', + overlap: 'vertical', // one of 'vertical', 'horizontal' + constraint: 'vertical', // one of 'vertical', 'horizontal', false + containment: element, // also takes array of elements (or id's); or false + handle: false, // or a CSS class + only: false, + delay: 0, + hoverclass: null, + ghosting: false, + quiet: false, + scroll: false, + scrollSensitivity: 20, + scrollSpeed: 15, + format: this.SERIALIZE_RULE, + + // these take arrays of elements or ids and can be + // used for better initialization performance + elements: false, + handles: false, + + onChange: Prototype.emptyFunction, + onUpdate: Prototype.emptyFunction + }, arguments[1] || { }); + + // clear any old sortable with same element + this.destroy(element); + + // build options for the draggables + var options_for_draggable = { + revert: true, + quiet: options.quiet, + scroll: options.scroll, + scrollSpeed: options.scrollSpeed, + scrollSensitivity: options.scrollSensitivity, + delay: options.delay, + ghosting: options.ghosting, + constraint: options.constraint, + handle: options.handle }; + + if(options.starteffect) + options_for_draggable.starteffect = options.starteffect; + + if(options.reverteffect) + options_for_draggable.reverteffect = options.reverteffect; + else + if(options.ghosting) options_for_draggable.reverteffect = function(element) { + element.style.top = 0; + element.style.left = 0; + }; + + if(options.endeffect) + options_for_draggable.endeffect = options.endeffect; + + if(options.zindex) + options_for_draggable.zindex = options.zindex; + + // build options for the droppables + var options_for_droppable = { + overlap: options.overlap, + containment: options.containment, + tree: options.tree, + hoverclass: options.hoverclass, + onHover: Sortable.onHover + } + + var options_for_tree = { + onHover: Sortable.onEmptyHover, + overlap: options.overlap, + containment: options.containment, + hoverclass: options.hoverclass + } + + // fix for gecko engine + Element.cleanWhitespace(element); + + options.draggables = []; + options.droppables = []; + + // drop on empty handling + if(options.dropOnEmpty || options.tree) { + Droppables.add(element, options_for_tree); + options.droppables.push(element); + } + + (options.elements || this.findElements(element, options) || []).each( function(e,i) { + var handle = options.handles ? $(options.handles[i]) : + (options.handle ? $(e).select('.' + options.handle)[0] : e); + options.draggables.push( + new Draggable(e, Object.extend(options_for_draggable, { handle: handle }))); + Droppables.add(e, options_for_droppable); + if(options.tree) e.treeNode = element; + options.droppables.push(e); + }); + + if(options.tree) { + (Sortable.findTreeElements(element, options) || []).each( function(e) { + Droppables.add(e, options_for_tree); + e.treeNode = element; + options.droppables.push(e); + }); + } + + // keep reference + this.sortables[element.id] = options; + + // for onupdate + Draggables.addObserver(new SortableObserver(element, options.onUpdate)); + + }, + + // return all suitable-for-sortable elements in a guaranteed order + findElements: function(element, options) { + return Element.findChildren( + element, options.only, options.tree ? true : false, options.tag); + }, + + findTreeElements: function(element, options) { + return Element.findChildren( + element, options.only, options.tree ? true : false, options.treeTag); + }, + + onHover: function(element, dropon, overlap) { + if(Element.isParent(dropon, element)) return; + + if(overlap > .33 && overlap < .66 && Sortable.options(dropon).tree) { + return; + } else if(overlap>0.5) { + Sortable.mark(dropon, 'before'); + if(dropon.previousSibling != element) { + var oldParentNode = element.parentNode; + element.style.visibility = "hidden"; // fix gecko rendering + dropon.parentNode.insertBefore(element, dropon); + if(dropon.parentNode!=oldParentNode) + Sortable.options(oldParentNode).onChange(element); + Sortable.options(dropon.parentNode).onChange(element); + } + } else { + Sortable.mark(dropon, 'after'); + var nextElement = dropon.nextSibling || null; + if(nextElement != element) { + var oldParentNode = element.parentNode; + element.style.visibility = "hidden"; // fix gecko rendering + dropon.parentNode.insertBefore(element, nextElement); + if(dropon.parentNode!=oldParentNode) + Sortable.options(oldParentNode).onChange(element); + Sortable.options(dropon.parentNode).onChange(element); + } + } + }, + + onEmptyHover: function(element, dropon, overlap) { + var oldParentNode = element.parentNode; + var droponOptions = Sortable.options(dropon); + + if(!Element.isParent(dropon, element)) { + var index; + + var children = Sortable.findElements(dropon, {tag: droponOptions.tag, only: droponOptions.only}); + var child = null; + + if(children) { + var offset = Element.offsetSize(dropon, droponOptions.overlap) * (1.0 - overlap); + + for (index = 0; index < children.length; index += 1) { + if (offset - Element.offsetSize (children[index], droponOptions.overlap) >= 0) { + offset -= Element.offsetSize (children[index], droponOptions.overlap); + } else if (offset - (Element.offsetSize (children[index], droponOptions.overlap) / 2) >= 0) { + child = index + 1 < children.length ? children[index + 1] : null; + break; + } else { + child = children[index]; + break; + } + } + } + + dropon.insertBefore(element, child); + + Sortable.options(oldParentNode).onChange(element); + droponOptions.onChange(element); + } + }, + + unmark: function() { + if(Sortable._marker) Sortable._marker.hide(); + }, + + mark: function(dropon, position) { + // mark on ghosting only + var sortable = Sortable.options(dropon.parentNode); + if(sortable && !sortable.ghosting) return; + + if(!Sortable._marker) { + Sortable._marker = + ($('dropmarker') || Element.extend(document.createElement('DIV'))). + hide().addClassName('dropmarker').setStyle({position:'absolute'}); + document.getElementsByTagName("body").item(0).appendChild(Sortable._marker); + } + var offsets = Position.cumulativeOffset(dropon); + Sortable._marker.setStyle({left: offsets[0]+'px', top: offsets[1] + 'px'}); + + if(position=='after') + if(sortable.overlap == 'horizontal') + Sortable._marker.setStyle({left: (offsets[0]+dropon.clientWidth) + 'px'}); + else + Sortable._marker.setStyle({top: (offsets[1]+dropon.clientHeight) + 'px'}); + + Sortable._marker.show(); + }, + + _tree: function(element, options, parent) { + var children = Sortable.findElements(element, options) || []; + + for (var i = 0; i < children.length; ++i) { + var match = children[i].id.match(options.format); + + if (!match) continue; + + var child = { + id: encodeURIComponent(match ? match[1] : null), + element: element, + parent: parent, + children: [], + position: parent.children.length, + container: $(children[i]).down(options.treeTag) + } + + /* Get the element containing the children and recurse over it */ + if (child.container) + this._tree(child.container, options, child) + + parent.children.push (child); + } + + return parent; + }, + + tree: function(element) { + element = $(element); + var sortableOptions = this.options(element); + var options = Object.extend({ + tag: sortableOptions.tag, + treeTag: sortableOptions.treeTag, + only: sortableOptions.only, + name: element.id, + format: sortableOptions.format + }, arguments[1] || { }); + + var root = { + id: null, + parent: null, + children: [], + container: element, + position: 0 + } + + return Sortable._tree(element, options, root); + }, + + /* Construct a [i] index for a particular node */ + _constructIndex: function(node) { + var index = ''; + do { + if (node.id) index = '[' + node.position + ']' + index; + } while ((node = node.parent) != null); + return index; + }, + + sequence: function(element) { + element = $(element); + var options = Object.extend(this.options(element), arguments[1] || { }); + + return $(this.findElements(element, options) || []).map( function(item) { + return item.id.match(options.format) ? item.id.match(options.format)[1] : ''; + }); + }, + + setSequence: function(element, new_sequence) { + element = $(element); + var options = Object.extend(this.options(element), arguments[2] || { }); + + var nodeMap = { }; + this.findElements(element, options).each( function(n) { + if (n.id.match(options.format)) + nodeMap[n.id.match(options.format)[1]] = [n, n.parentNode]; + n.parentNode.removeChild(n); + }); + + new_sequence.each(function(ident) { + var n = nodeMap[ident]; + if (n) { + n[1].appendChild(n[0]); + delete nodeMap[ident]; + } + }); + }, + + serialize: function(element) { + element = $(element); + var options = Object.extend(Sortable.options(element), arguments[1] || { }); + var name = encodeURIComponent( + (arguments[1] && arguments[1].name) ? arguments[1].name : element.id); + + if (options.tree) { + return Sortable.tree(element, arguments[1]).children.map( function (item) { + return [name + Sortable._constructIndex(item) + "[id]=" + + encodeURIComponent(item.id)].concat(item.children.map(arguments.callee)); + }).flatten().join('&'); + } else { + return Sortable.sequence(element, arguments[1]).map( function(item) { + return name + "[]=" + encodeURIComponent(item); + }).join('&'); + } + } +} + +// Returns true if child is contained within element +Element.isParent = function(child, element) { + if (!child.parentNode || child == element) return false; + if (child.parentNode == element) return true; + return Element.isParent(child.parentNode, element); +} + +Element.findChildren = function(element, only, recursive, tagName) { + if(!element.hasChildNodes()) return null; + tagName = tagName.toUpperCase(); + if(only) only = [only].flatten(); + var elements = []; + $A(element.childNodes).each( function(e) { + if(e.tagName && e.tagName.toUpperCase()==tagName && + (!only || (Element.classNames(e).detect(function(v) { return only.include(v) })))) + elements.push(e); + if(recursive) { + var grandchildren = Element.findChildren(e, only, recursive, tagName); + if(grandchildren) elements.push(grandchildren); + } + }); + + return (elements.length>0 ? elements.flatten() : []); +} + +Element.offsetSize = function (element, type) { + return element['offset' + ((type=='vertical' || type=='height') ? 'Height' : 'Width')]; +} diff --git a/posterita/posterita/web/javascripts/effects.js b/posterita/posterita/web/javascripts/effects.js new file mode 100644 index 0000000000..b8c0259f55 --- /dev/null +++ b/posterita/posterita/web/javascripts/effects.js @@ -0,0 +1,1122 @@ +// script.aculo.us effects.js v1.8.1, Thu Jan 03 22:07:12 -0500 2008 + +// Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) +// Contributors: +// Justin Palmer (http://encytemedia.com/) +// Mark Pilgrim (http://diveintomark.org/) +// Martin Bialasinki +// +// script.aculo.us is freely distributable under the terms of an MIT-style license. +// For details, see the script.aculo.us web site: http://script.aculo.us/ + +// converts rgb() and #xxx to #xxxxxx format, +// returns self (or first argument) if not convertable +String.prototype.parseColor = function() { + var color = '#'; + if (this.slice(0,4) == 'rgb(') { + var cols = this.slice(4,this.length-1).split(','); + var i=0; do { color += parseInt(cols[i]).toColorPart() } while (++i<3); + } else { + if (this.slice(0,1) == '#') { + if (this.length==4) for(var i=1;i<4;i++) color += (this.charAt(i) + this.charAt(i)).toLowerCase(); + if (this.length==7) color = this.toLowerCase(); + } + } + return (color.length==7 ? color : (arguments[0] || this)); +}; + +/*--------------------------------------------------------------------------*/ + +Element.collectTextNodes = function(element) { + return $A($(element).childNodes).collect( function(node) { + return (node.nodeType==3 ? node.nodeValue : + (node.hasChildNodes() ? Element.collectTextNodes(node) : '')); + }).flatten().join(''); +}; + +Element.collectTextNodesIgnoreClass = function(element, className) { + return $A($(element).childNodes).collect( function(node) { + return (node.nodeType==3 ? node.nodeValue : + ((node.hasChildNodes() && !Element.hasClassName(node,className)) ? + Element.collectTextNodesIgnoreClass(node, className) : '')); + }).flatten().join(''); +}; + +Element.setContentZoom = function(element, percent) { + element = $(element); + element.setStyle({fontSize: (percent/100) + 'em'}); + if (Prototype.Browser.WebKit) window.scrollBy(0,0); + return element; +}; + +Element.getInlineOpacity = function(element){ + return $(element).style.opacity || ''; +}; + +Element.forceRerendering = function(element) { + try { + element = $(element); + var n = document.createTextNode(' '); + element.appendChild(n); + element.removeChild(n); + } catch(e) { } +}; + +/*--------------------------------------------------------------------------*/ + +var Effect = { + _elementDoesNotExistError: { + name: 'ElementDoesNotExistError', + message: 'The specified DOM element does not exist, but is required for this effect to operate' + }, + Transitions: { + linear: Prototype.K, + sinoidal: function(pos) { + return (-Math.cos(pos*Math.PI)/2) + 0.5; + }, + reverse: function(pos) { + return 1-pos; + }, + flicker: function(pos) { + var pos = ((-Math.cos(pos*Math.PI)/4) + 0.75) + Math.random()/4; + return pos > 1 ? 1 : pos; + }, + wobble: function(pos) { + return (-Math.cos(pos*Math.PI*(9*pos))/2) + 0.5; + }, + pulse: function(pos, pulses) { + pulses = pulses || 5; + return ( + ((pos % (1/pulses)) * pulses).round() == 0 ? + ((pos * pulses * 2) - (pos * pulses * 2).floor()) : + 1 - ((pos * pulses * 2) - (pos * pulses * 2).floor()) + ); + }, + spring: function(pos) { + return 1 - (Math.cos(pos * 4.5 * Math.PI) * Math.exp(-pos * 6)); + }, + none: function(pos) { + return 0; + }, + full: function(pos) { + return 1; + } + }, + DefaultOptions: { + duration: 1.0, // seconds + fps: 100, // 100= assume 66fps max. + sync: false, // true for combining + from: 0.0, + to: 1.0, + delay: 0.0, + queue: 'parallel' + }, + tagifyText: function(element) { + var tagifyStyle = 'position:relative'; + if (Prototype.Browser.IE) tagifyStyle += ';zoom:1'; + + element = $(element); + $A(element.childNodes).each( function(child) { + if (child.nodeType==3) { + child.nodeValue.toArray().each( function(character) { + element.insertBefore( + new Element('span', {style: tagifyStyle}).update( + character == ' ' ? String.fromCharCode(160) : character), + child); + }); + Element.remove(child); + } + }); + }, + multiple: function(element, effect) { + var elements; + if (((typeof element == 'object') || + Object.isFunction(element)) && + (element.length)) + elements = element; + else + elements = $(element).childNodes; + + var options = Object.extend({ + speed: 0.1, + delay: 0.0 + }, arguments[2] || { }); + var masterDelay = options.delay; + + $A(elements).each( function(element, index) { + new effect(element, Object.extend(options, { delay: index * options.speed + masterDelay })); + }); + }, + PAIRS: { + 'slide': ['SlideDown','SlideUp'], + 'blind': ['BlindDown','BlindUp'], + 'appear': ['Appear','Fade'] + }, + toggle: function(element, effect) { + element = $(element); + effect = (effect || 'appear').toLowerCase(); + var options = Object.extend({ + queue: { position:'end', scope:(element.id || 'global'), limit: 1 } + }, arguments[2] || { }); + Effect[element.visible() ? + Effect.PAIRS[effect][1] : Effect.PAIRS[effect][0]](element, options); + } +}; + +Effect.DefaultOptions.transition = Effect.Transitions.sinoidal; + +/* ------------- core effects ------------- */ + +Effect.ScopedQueue = Class.create(Enumerable, { + initialize: function() { + this.effects = []; + this.interval = null; + }, + _each: function(iterator) { + this.effects._each(iterator); + }, + add: function(effect) { + var timestamp = new Date().getTime(); + + var position = Object.isString(effect.options.queue) ? + effect.options.queue : effect.options.queue.position; + + switch(position) { + case 'front': + // move unstarted effects after this effect + this.effects.findAll(function(e){ return e.state=='idle' }).each( function(e) { + e.startOn += effect.finishOn; + e.finishOn += effect.finishOn; + }); + break; + case 'with-last': + timestamp = this.effects.pluck('startOn').max() || timestamp; + break; + case 'end': + // start effect after last queued effect has finished + timestamp = this.effects.pluck('finishOn').max() || timestamp; + break; + } + + effect.startOn += timestamp; + effect.finishOn += timestamp; + + if (!effect.options.queue.limit || (this.effects.length < effect.options.queue.limit)) + this.effects.push(effect); + + if (!this.interval) + this.interval = setInterval(this.loop.bind(this), 15); + }, + remove: function(effect) { + this.effects = this.effects.reject(function(e) { return e==effect }); + if (this.effects.length == 0) { + clearInterval(this.interval); + this.interval = null; + } + }, + loop: function() { + var timePos = new Date().getTime(); + for(var i=0, len=this.effects.length;i= this.startOn) { + if (timePos >= this.finishOn) { + this.render(1.0); + this.cancel(); + this.event('beforeFinish'); + if (this.finish) this.finish(); + this.event('afterFinish'); + return; + } + var pos = (timePos - this.startOn) / this.totalTime, + frame = (pos * this.totalFrames).round(); + if (frame > this.currentFrame) { + this.render(pos); + this.currentFrame = frame; + } + } + }, + cancel: function() { + if (!this.options.sync) + Effect.Queues.get(Object.isString(this.options.queue) ? + 'global' : this.options.queue.scope).remove(this); + this.state = 'finished'; + }, + event: function(eventName) { + if (this.options[eventName + 'Internal']) this.options[eventName + 'Internal'](this); + if (this.options[eventName]) this.options[eventName](this); + }, + inspect: function() { + var data = $H(); + for(property in this) + if (!Object.isFunction(this[property])) data.set(property, this[property]); + return '#'; + } +}); + +Effect.Parallel = Class.create(Effect.Base, { + initialize: function(effects) { + this.effects = effects || []; + this.start(arguments[1]); + }, + update: function(position) { + this.effects.invoke('render', position); + }, + finish: function(position) { + this.effects.each( function(effect) { + effect.render(1.0); + effect.cancel(); + effect.event('beforeFinish'); + if (effect.finish) effect.finish(position); + effect.event('afterFinish'); + }); + } +}); + +Effect.Tween = Class.create(Effect.Base, { + initialize: function(object, from, to) { + object = Object.isString(object) ? $(object) : object; + var args = $A(arguments), method = args.last(), + options = args.length == 5 ? args[3] : null; + this.method = Object.isFunction(method) ? method.bind(object) : + Object.isFunction(object[method]) ? object[method].bind(object) : + function(value) { object[method] = value }; + this.start(Object.extend({ from: from, to: to }, options || { })); + }, + update: function(position) { + this.method(position); + } +}); + +Effect.Event = Class.create(Effect.Base, { + initialize: function() { + this.start(Object.extend({ duration: 0 }, arguments[0] || { })); + }, + update: Prototype.emptyFunction +}); + +Effect.Opacity = Class.create(Effect.Base, { + initialize: function(element) { + this.element = $(element); + if (!this.element) throw(Effect._elementDoesNotExistError); + // make this work on IE on elements without 'layout' + if (Prototype.Browser.IE && (!this.element.currentStyle.hasLayout)) + this.element.setStyle({zoom: 1}); + var options = Object.extend({ + from: this.element.getOpacity() || 0.0, + to: 1.0 + }, arguments[1] || { }); + this.start(options); + }, + update: function(position) { + this.element.setOpacity(position); + } +}); + +Effect.Move = Class.create(Effect.Base, { + initialize: function(element) { + this.element = $(element); + if (!this.element) throw(Effect._elementDoesNotExistError); + var options = Object.extend({ + x: 0, + y: 0, + mode: 'relative' + }, arguments[1] || { }); + this.start(options); + }, + setup: function() { + this.element.makePositioned(); + this.originalLeft = parseFloat(this.element.getStyle('left') || '0'); + this.originalTop = parseFloat(this.element.getStyle('top') || '0'); + if (this.options.mode == 'absolute') { + this.options.x = this.options.x - this.originalLeft; + this.options.y = this.options.y - this.originalTop; + } + }, + update: function(position) { + this.element.setStyle({ + left: (this.options.x * position + this.originalLeft).round() + 'px', + top: (this.options.y * position + this.originalTop).round() + 'px' + }); + } +}); + +// for backwards compatibility +Effect.MoveBy = function(element, toTop, toLeft) { + return new Effect.Move(element, + Object.extend({ x: toLeft, y: toTop }, arguments[3] || { })); +}; + +Effect.Scale = Class.create(Effect.Base, { + initialize: function(element, percent) { + this.element = $(element); + if (!this.element) throw(Effect._elementDoesNotExistError); + var options = Object.extend({ + scaleX: true, + scaleY: true, + scaleContent: true, + scaleFromCenter: false, + scaleMode: 'box', // 'box' or 'contents' or { } with provided values + scaleFrom: 100.0, + scaleTo: percent + }, arguments[2] || { }); + this.start(options); + }, + setup: function() { + this.restoreAfterFinish = this.options.restoreAfterFinish || false; + this.elementPositioning = this.element.getStyle('position'); + + this.originalStyle = { }; + ['top','left','width','height','fontSize'].each( function(k) { + this.originalStyle[k] = this.element.style[k]; + }.bind(this)); + + this.originalTop = this.element.offsetTop; + this.originalLeft = this.element.offsetLeft; + + var fontSize = this.element.getStyle('font-size') || '100%'; + ['em','px','%','pt'].each( function(fontSizeType) { + if (fontSize.indexOf(fontSizeType)>0) { + this.fontSize = parseFloat(fontSize); + this.fontSizeType = fontSizeType; + } + }.bind(this)); + + this.factor = (this.options.scaleTo - this.options.scaleFrom)/100; + + this.dims = null; + if (this.options.scaleMode=='box') + this.dims = [this.element.offsetHeight, this.element.offsetWidth]; + if (/^content/.test(this.options.scaleMode)) + this.dims = [this.element.scrollHeight, this.element.scrollWidth]; + if (!this.dims) + this.dims = [this.options.scaleMode.originalHeight, + this.options.scaleMode.originalWidth]; + }, + update: function(position) { + var currentScale = (this.options.scaleFrom/100.0) + (this.factor * position); + if (this.options.scaleContent && this.fontSize) + this.element.setStyle({fontSize: this.fontSize * currentScale + this.fontSizeType }); + this.setDimensions(this.dims[0] * currentScale, this.dims[1] * currentScale); + }, + finish: function(position) { + if (this.restoreAfterFinish) this.element.setStyle(this.originalStyle); + }, + setDimensions: function(height, width) { + var d = { }; + if (this.options.scaleX) d.width = width.round() + 'px'; + if (this.options.scaleY) d.height = height.round() + 'px'; + if (this.options.scaleFromCenter) { + var topd = (height - this.dims[0])/2; + var leftd = (width - this.dims[1])/2; + if (this.elementPositioning == 'absolute') { + if (this.options.scaleY) d.top = this.originalTop-topd + 'px'; + if (this.options.scaleX) d.left = this.originalLeft-leftd + 'px'; + } else { + if (this.options.scaleY) d.top = -topd + 'px'; + if (this.options.scaleX) d.left = -leftd + 'px'; + } + } + this.element.setStyle(d); + } +}); + +Effect.Highlight = Class.create(Effect.Base, { + initialize: function(element) { + this.element = $(element); + if (!this.element) throw(Effect._elementDoesNotExistError); + var options = Object.extend({ startcolor: '#ffff99' }, arguments[1] || { }); + this.start(options); + }, + setup: function() { + // Prevent executing on elements not in the layout flow + if (this.element.getStyle('display')=='none') { this.cancel(); return; } + // Disable background image during the effect + this.oldStyle = { }; + if (!this.options.keepBackgroundImage) { + this.oldStyle.backgroundImage = this.element.getStyle('background-image'); + this.element.setStyle({backgroundImage: 'none'}); + } + if (!this.options.endcolor) + this.options.endcolor = this.element.getStyle('background-color').parseColor('#ffffff'); + if (!this.options.restorecolor) + this.options.restorecolor = this.element.getStyle('background-color'); + // init color calculations + this._base = $R(0,2).map(function(i){ return parseInt(this.options.startcolor.slice(i*2+1,i*2+3),16) }.bind(this)); + this._delta = $R(0,2).map(function(i){ return parseInt(this.options.endcolor.slice(i*2+1,i*2+3),16)-this._base[i] }.bind(this)); + }, + update: function(position) { + this.element.setStyle({backgroundColor: $R(0,2).inject('#',function(m,v,i){ + return m+((this._base[i]+(this._delta[i]*position)).round().toColorPart()); }.bind(this)) }); + }, + finish: function() { + this.element.setStyle(Object.extend(this.oldStyle, { + backgroundColor: this.options.restorecolor + })); + } +}); + +Effect.ScrollTo = function(element) { + var options = arguments[1] || { }, + scrollOffsets = document.viewport.getScrollOffsets(), + elementOffsets = $(element).cumulativeOffset(), + max = (window.height || document.body.scrollHeight) - document.viewport.getHeight(); + + if (options.offset) elementOffsets[1] += options.offset; + + return new Effect.Tween(null, + scrollOffsets.top, + elementOffsets[1] > max ? max : elementOffsets[1], + options, + function(p){ scrollTo(scrollOffsets.left, p.round()) } + ); +}; + +/* ------------- combination effects ------------- */ + +Effect.Fade = function(element) { + element = $(element); + var oldOpacity = element.getInlineOpacity(); + var options = Object.extend({ + from: element.getOpacity() || 1.0, + to: 0.0, + afterFinishInternal: function(effect) { + if (effect.options.to!=0) return; + effect.element.hide().setStyle({opacity: oldOpacity}); + } + }, arguments[1] || { }); + return new Effect.Opacity(element,options); +}; + +Effect.Appear = function(element) { + element = $(element); + var options = Object.extend({ + from: (element.getStyle('display') == 'none' ? 0.0 : element.getOpacity() || 0.0), + to: 1.0, + // force Safari to render floated elements properly + afterFinishInternal: function(effect) { + effect.element.forceRerendering(); + }, + beforeSetup: function(effect) { + effect.element.setOpacity(effect.options.from).show(); + }}, arguments[1] || { }); + return new Effect.Opacity(element,options); +}; + +Effect.Puff = function(element) { + element = $(element); + var oldStyle = { + opacity: element.getInlineOpacity(), + position: element.getStyle('position'), + top: element.style.top, + left: element.style.left, + width: element.style.width, + height: element.style.height + }; + return new Effect.Parallel( + [ new Effect.Scale(element, 200, + { sync: true, scaleFromCenter: true, scaleContent: true, restoreAfterFinish: true }), + new Effect.Opacity(element, { sync: true, to: 0.0 } ) ], + Object.extend({ duration: 1.0, + beforeSetupInternal: function(effect) { + Position.absolutize(effect.effects[0].element) + }, + afterFinishInternal: function(effect) { + effect.effects[0].element.hide().setStyle(oldStyle); } + }, arguments[1] || { }) + ); +}; + +Effect.BlindUp = function(element) { + element = $(element); + element.makeClipping(); + return new Effect.Scale(element, 0, + Object.extend({ scaleContent: false, + scaleX: false, + restoreAfterFinish: true, + afterFinishInternal: function(effect) { + effect.element.hide().undoClipping(); + } + }, arguments[1] || { }) + ); +}; + +Effect.BlindDown = function(element) { + element = $(element); + var elementDimensions = element.getDimensions(); + return new Effect.Scale(element, 100, Object.extend({ + scaleContent: false, + scaleX: false, + scaleFrom: 0, + scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width}, + restoreAfterFinish: true, + afterSetup: function(effect) { + effect.element.makeClipping().setStyle({height: '0px'}).show(); + }, + afterFinishInternal: function(effect) { + effect.element.undoClipping(); + } + }, arguments[1] || { })); +}; + +Effect.SwitchOff = function(element) { + element = $(element); + var oldOpacity = element.getInlineOpacity(); + return new Effect.Appear(element, Object.extend({ + duration: 0.4, + from: 0, + transition: Effect.Transitions.flicker, + afterFinishInternal: function(effect) { + new Effect.Scale(effect.element, 1, { + duration: 0.3, scaleFromCenter: true, + scaleX: false, scaleContent: false, restoreAfterFinish: true, + beforeSetup: function(effect) { + effect.element.makePositioned().makeClipping(); + }, + afterFinishInternal: function(effect) { + effect.element.hide().undoClipping().undoPositioned().setStyle({opacity: oldOpacity}); + } + }) + } + }, arguments[1] || { })); +}; + +Effect.DropOut = function(element) { + element = $(element); + var oldStyle = { + top: element.getStyle('top'), + left: element.getStyle('left'), + opacity: element.getInlineOpacity() }; + return new Effect.Parallel( + [ new Effect.Move(element, {x: 0, y: 100, sync: true }), + new Effect.Opacity(element, { sync: true, to: 0.0 }) ], + Object.extend( + { duration: 0.5, + beforeSetup: function(effect) { + effect.effects[0].element.makePositioned(); + }, + afterFinishInternal: function(effect) { + effect.effects[0].element.hide().undoPositioned().setStyle(oldStyle); + } + }, arguments[1] || { })); +}; + +Effect.Shake = function(element) { + element = $(element); + var options = Object.extend({ + distance: 20, + duration: 0.5 + }, arguments[1] || {}); + var distance = parseFloat(options.distance); + var split = parseFloat(options.duration) / 10.0; + var oldStyle = { + top: element.getStyle('top'), + left: element.getStyle('left') }; + return new Effect.Move(element, + { x: distance, y: 0, duration: split, afterFinishInternal: function(effect) { + new Effect.Move(effect.element, + { x: -distance*2, y: 0, duration: split*2, afterFinishInternal: function(effect) { + new Effect.Move(effect.element, + { x: distance*2, y: 0, duration: split*2, afterFinishInternal: function(effect) { + new Effect.Move(effect.element, + { x: -distance*2, y: 0, duration: split*2, afterFinishInternal: function(effect) { + new Effect.Move(effect.element, + { x: distance*2, y: 0, duration: split*2, afterFinishInternal: function(effect) { + new Effect.Move(effect.element, + { x: -distance, y: 0, duration: split, afterFinishInternal: function(effect) { + effect.element.undoPositioned().setStyle(oldStyle); + }}) }}) }}) }}) }}) }}); +}; + +Effect.SlideDown = function(element) { + element = $(element).cleanWhitespace(); + // SlideDown need to have the content of the element wrapped in a container element with fixed height! + var oldInnerBottom = element.down().getStyle('bottom'); + var elementDimensions = element.getDimensions(); + return new Effect.Scale(element, 100, Object.extend({ + scaleContent: false, + scaleX: false, + scaleFrom: window.opera ? 0 : 1, + scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width}, + restoreAfterFinish: true, + afterSetup: function(effect) { + effect.element.makePositioned(); + effect.element.down().makePositioned(); + if (window.opera) effect.element.setStyle({top: ''}); + effect.element.makeClipping().setStyle({height: '0px'}).show(); + }, + afterUpdateInternal: function(effect) { + effect.element.down().setStyle({bottom: + (effect.dims[0] - effect.element.clientHeight) + 'px' }); + }, + afterFinishInternal: function(effect) { + effect.element.undoClipping().undoPositioned(); + effect.element.down().undoPositioned().setStyle({bottom: oldInnerBottom}); } + }, arguments[1] || { }) + ); +}; + +Effect.SlideUp = function(element) { + element = $(element).cleanWhitespace(); + var oldInnerBottom = element.down().getStyle('bottom'); + var elementDimensions = element.getDimensions(); + return new Effect.Scale(element, window.opera ? 0 : 1, + Object.extend({ scaleContent: false, + scaleX: false, + scaleMode: 'box', + scaleFrom: 100, + scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width}, + restoreAfterFinish: true, + afterSetup: function(effect) { + effect.element.makePositioned(); + effect.element.down().makePositioned(); + if (window.opera) effect.element.setStyle({top: ''}); + effect.element.makeClipping().show(); + }, + afterUpdateInternal: function(effect) { + effect.element.down().setStyle({bottom: + (effect.dims[0] - effect.element.clientHeight) + 'px' }); + }, + afterFinishInternal: function(effect) { + effect.element.hide().undoClipping().undoPositioned(); + effect.element.down().undoPositioned().setStyle({bottom: oldInnerBottom}); + } + }, arguments[1] || { }) + ); +}; + +// Bug in opera makes the TD containing this element expand for a instance after finish +Effect.Squish = function(element) { + return new Effect.Scale(element, window.opera ? 1 : 0, { + restoreAfterFinish: true, + beforeSetup: function(effect) { + effect.element.makeClipping(); + }, + afterFinishInternal: function(effect) { + effect.element.hide().undoClipping(); + } + }); +}; + +Effect.Grow = function(element) { + element = $(element); + var options = Object.extend({ + direction: 'center', + moveTransition: Effect.Transitions.sinoidal, + scaleTransition: Effect.Transitions.sinoidal, + opacityTransition: Effect.Transitions.full + }, arguments[1] || { }); + var oldStyle = { + top: element.style.top, + left: element.style.left, + height: element.style.height, + width: element.style.width, + opacity: element.getInlineOpacity() }; + + var dims = element.getDimensions(); + var initialMoveX, initialMoveY; + var moveX, moveY; + + switch (options.direction) { + case 'top-left': + initialMoveX = initialMoveY = moveX = moveY = 0; + break; + case 'top-right': + initialMoveX = dims.width; + initialMoveY = moveY = 0; + moveX = -dims.width; + break; + case 'bottom-left': + initialMoveX = moveX = 0; + initialMoveY = dims.height; + moveY = -dims.height; + break; + case 'bottom-right': + initialMoveX = dims.width; + initialMoveY = dims.height; + moveX = -dims.width; + moveY = -dims.height; + break; + case 'center': + initialMoveX = dims.width / 2; + initialMoveY = dims.height / 2; + moveX = -dims.width / 2; + moveY = -dims.height / 2; + break; + } + + return new Effect.Move(element, { + x: initialMoveX, + y: initialMoveY, + duration: 0.01, + beforeSetup: function(effect) { + effect.element.hide().makeClipping().makePositioned(); + }, + afterFinishInternal: function(effect) { + new Effect.Parallel( + [ new Effect.Opacity(effect.element, { sync: true, to: 1.0, from: 0.0, transition: options.opacityTransition }), + new Effect.Move(effect.element, { x: moveX, y: moveY, sync: true, transition: options.moveTransition }), + new Effect.Scale(effect.element, 100, { + scaleMode: { originalHeight: dims.height, originalWidth: dims.width }, + sync: true, scaleFrom: window.opera ? 1 : 0, transition: options.scaleTransition, restoreAfterFinish: true}) + ], Object.extend({ + beforeSetup: function(effect) { + effect.effects[0].element.setStyle({height: '0px'}).show(); + }, + afterFinishInternal: function(effect) { + effect.effects[0].element.undoClipping().undoPositioned().setStyle(oldStyle); + } + }, options) + ) + } + }); +}; + +Effect.Shrink = function(element) { + element = $(element); + var options = Object.extend({ + direction: 'center', + moveTransition: Effect.Transitions.sinoidal, + scaleTransition: Effect.Transitions.sinoidal, + opacityTransition: Effect.Transitions.none + }, arguments[1] || { }); + var oldStyle = { + top: element.style.top, + left: element.style.left, + height: element.style.height, + width: element.style.width, + opacity: element.getInlineOpacity() }; + + var dims = element.getDimensions(); + var moveX, moveY; + + switch (options.direction) { + case 'top-left': + moveX = moveY = 0; + break; + case 'top-right': + moveX = dims.width; + moveY = 0; + break; + case 'bottom-left': + moveX = 0; + moveY = dims.height; + break; + case 'bottom-right': + moveX = dims.width; + moveY = dims.height; + break; + case 'center': + moveX = dims.width / 2; + moveY = dims.height / 2; + break; + } + + return new Effect.Parallel( + [ new Effect.Opacity(element, { sync: true, to: 0.0, from: 1.0, transition: options.opacityTransition }), + new Effect.Scale(element, window.opera ? 1 : 0, { sync: true, transition: options.scaleTransition, restoreAfterFinish: true}), + new Effect.Move(element, { x: moveX, y: moveY, sync: true, transition: options.moveTransition }) + ], Object.extend({ + beforeStartInternal: function(effect) { + effect.effects[0].element.makePositioned().makeClipping(); + }, + afterFinishInternal: function(effect) { + effect.effects[0].element.hide().undoClipping().undoPositioned().setStyle(oldStyle); } + }, options) + ); +}; + +Effect.Pulsate = function(element) { + element = $(element); + var options = arguments[1] || { }; + var oldOpacity = element.getInlineOpacity(); + var transition = options.transition || Effect.Transitions.sinoidal; + var reverser = function(pos){ return transition(1-Effect.Transitions.pulse(pos, options.pulses)) }; + reverser.bind(transition); + return new Effect.Opacity(element, + Object.extend(Object.extend({ duration: 2.0, from: 0, + afterFinishInternal: function(effect) { effect.element.setStyle({opacity: oldOpacity}); } + }, options), {transition: reverser})); +}; + +Effect.Fold = function(element) { + element = $(element); + var oldStyle = { + top: element.style.top, + left: element.style.left, + width: element.style.width, + height: element.style.height }; + element.makeClipping(); + return new Effect.Scale(element, 5, Object.extend({ + scaleContent: false, + scaleX: false, + afterFinishInternal: function(effect) { + new Effect.Scale(element, 1, { + scaleContent: false, + scaleY: false, + afterFinishInternal: function(effect) { + effect.element.hide().undoClipping().setStyle(oldStyle); + } }); + }}, arguments[1] || { })); +}; + +Effect.Morph = Class.create(Effect.Base, { + initialize: function(element) { + this.element = $(element); + if (!this.element) throw(Effect._elementDoesNotExistError); + var options = Object.extend({ + style: { } + }, arguments[1] || { }); + + if (!Object.isString(options.style)) this.style = $H(options.style); + else { + if (options.style.include(':')) + this.style = options.style.parseStyle(); + else { + this.element.addClassName(options.style); + this.style = $H(this.element.getStyles()); + this.element.removeClassName(options.style); + var css = this.element.getStyles(); + this.style = this.style.reject(function(style) { + return style.value == css[style.key]; + }); + options.afterFinishInternal = function(effect) { + effect.element.addClassName(effect.options.style); + effect.transforms.each(function(transform) { + effect.element.style[transform.style] = ''; + }); + } + } + } + this.start(options); + }, + + setup: function(){ + function parseColor(color){ + if (!color || ['rgba(0, 0, 0, 0)','transparent'].include(color)) color = '#ffffff'; + color = color.parseColor(); + return $R(0,2).map(function(i){ + return parseInt( color.slice(i*2+1,i*2+3), 16 ) + }); + } + this.transforms = this.style.map(function(pair){ + var property = pair[0], value = pair[1], unit = null; + + if (value.parseColor('#zzzzzz') != '#zzzzzz') { + value = value.parseColor(); + unit = 'color'; + } else if (property == 'opacity') { + value = parseFloat(value); + if (Prototype.Browser.IE && (!this.element.currentStyle.hasLayout)) + this.element.setStyle({zoom: 1}); + } else if (Element.CSS_LENGTH.test(value)) { + var components = value.match(/^([\+\-]?[0-9\.]+)(.*)$/); + value = parseFloat(components[1]); + unit = (components.length == 3) ? components[2] : null; + } + + var originalValue = this.element.getStyle(property); + return { + style: property.camelize(), + originalValue: unit=='color' ? parseColor(originalValue) : parseFloat(originalValue || 0), + targetValue: unit=='color' ? parseColor(value) : value, + unit: unit + }; + }.bind(this)).reject(function(transform){ + return ( + (transform.originalValue == transform.targetValue) || + ( + transform.unit != 'color' && + (isNaN(transform.originalValue) || isNaN(transform.targetValue)) + ) + ) + }); + }, + update: function(position) { + var style = { }, transform, i = this.transforms.length; + while(i--) + style[(transform = this.transforms[i]).style] = + transform.unit=='color' ? '#'+ + (Math.round(transform.originalValue[0]+ + (transform.targetValue[0]-transform.originalValue[0])*position)).toColorPart() + + (Math.round(transform.originalValue[1]+ + (transform.targetValue[1]-transform.originalValue[1])*position)).toColorPart() + + (Math.round(transform.originalValue[2]+ + (transform.targetValue[2]-transform.originalValue[2])*position)).toColorPart() : + (transform.originalValue + + (transform.targetValue - transform.originalValue) * position).toFixed(3) + + (transform.unit === null ? '' : transform.unit); + this.element.setStyle(style, true); + } +}); + +Effect.Transform = Class.create({ + initialize: function(tracks){ + this.tracks = []; + this.options = arguments[1] || { }; + this.addTracks(tracks); + }, + addTracks: function(tracks){ + tracks.each(function(track){ + track = $H(track); + var data = track.values().first(); + this.tracks.push($H({ + ids: track.keys().first(), + effect: Effect.Morph, + options: { style: data } + })); + }.bind(this)); + return this; + }, + play: function(){ + return new Effect.Parallel( + this.tracks.map(function(track){ + var ids = track.get('ids'), effect = track.get('effect'), options = track.get('options'); + var elements = [$(ids) || $$(ids)].flatten(); + return elements.map(function(e){ return new effect(e, Object.extend({ sync:true }, options)) }); + }).flatten(), + this.options + ); + } +}); + +Element.CSS_PROPERTIES = $w( + 'backgroundColor backgroundPosition borderBottomColor borderBottomStyle ' + + 'borderBottomWidth borderLeftColor borderLeftStyle borderLeftWidth ' + + 'borderRightColor borderRightStyle borderRightWidth borderSpacing ' + + 'borderTopColor borderTopStyle borderTopWidth bottom clip color ' + + 'fontSize fontWeight height left letterSpacing lineHeight ' + + 'marginBottom marginLeft marginRight marginTop markerOffset maxHeight '+ + 'maxWidth minHeight minWidth opacity outlineColor outlineOffset ' + + 'outlineWidth paddingBottom paddingLeft paddingRight paddingTop ' + + 'right textIndent top width wordSpacing zIndex'); + +Element.CSS_LENGTH = /^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/; + +String.__parseStyleElement = document.createElement('div'); +String.prototype.parseStyle = function(){ + var style, styleRules = $H(); + if (Prototype.Browser.WebKit) + style = new Element('div',{style:this}).style; + else { + String.__parseStyleElement.innerHTML = '
    '; + style = String.__parseStyleElement.childNodes[0].style; + } + + Element.CSS_PROPERTIES.each(function(property){ + if (style[property]) styleRules.set(property, style[property]); + }); + + if (Prototype.Browser.IE && this.include('opacity')) + styleRules.set('opacity', this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1]); + + return styleRules; +}; + +if (document.defaultView && document.defaultView.getComputedStyle) { + Element.getStyles = function(element) { + var css = document.defaultView.getComputedStyle($(element), null); + return Element.CSS_PROPERTIES.inject({ }, function(styles, property) { + styles[property] = css[property]; + return styles; + }); + }; +} else { + Element.getStyles = function(element) { + element = $(element); + var css = element.currentStyle, styles; + styles = Element.CSS_PROPERTIES.inject({ }, function(results, property) { + results[property] = css[property]; + return results; + }); + if (!styles.opacity) styles.opacity = element.getOpacity(); + return styles; + }; +}; + +Effect.Methods = { + morph: function(element, style) { + element = $(element); + new Effect.Morph(element, Object.extend({ style: style }, arguments[2] || { })); + return element; + }, + visualEffect: function(element, effect, options) { + element = $(element) + var s = effect.dasherize().camelize(), klass = s.charAt(0).toUpperCase() + s.substring(1); + new Effect[klass](element, options); + return element; + }, + highlight: function(element, options) { + element = $(element); + new Effect.Highlight(element, options); + return element; + } +}; + +$w('fade appear grow shrink fold blindUp blindDown slideUp slideDown '+ + 'pulsate shake puff squish switchOff dropOut').each( + function(effect) { + Effect.Methods[effect] = function(element, options){ + element = $(element); + Effect[effect.charAt(0).toUpperCase() + effect.substring(1)](element, options); + return element; + } + } +); + +$w('getInlineOpacity forceRerendering setContentZoom collectTextNodes collectTextNodesIgnoreClass getStyles').each( + function(f) { Effect.Methods[f] = Element[f]; } +); + +Element.addMethods(Effect.Methods); diff --git a/posterita/posterita/web/javascripts/js-calendar/calendar-en.js b/posterita/posterita/web/javascripts/js-calendar/calendar-en.js new file mode 100644 index 0000000000..0dbde793d8 --- /dev/null +++ b/posterita/posterita/web/javascripts/js-calendar/calendar-en.js @@ -0,0 +1,127 @@ +// ** I18N + +// Calendar EN language +// Author: Mihai Bazon, +// Encoding: any +// Distributed under the same terms as the calendar itself. + +// For translators: please use UTF-8 if possible. We strongly believe that +// Unicode is the answer to a real internationalized world. Also please +// include your contact information in the header, as can be seen above. + +// full day names +Calendar._DN = new Array +("Sunday", + "Monday", + "Tuesday", + "Wednesday", + "Thursday", + "Friday", + "Saturday", + "Sunday"); + +// Please note that the following array of short day names (and the same goes +// for short month names, _SMN) isn't absolutely necessary. We give it here +// for exemplification on how one can customize the short day names, but if +// they are simply the first N letters of the full name you can simply say: +// +// Calendar._SDN_len = N; // short day name length +// Calendar._SMN_len = N; // short month name length +// +// If N = 3 then this is not needed either since we assume a value of 3 if not +// present, to be compatible with translation files that were written before +// this feature. + +// short day names +Calendar._SDN = new Array +("Sun", + "Mon", + "Tue", + "Wed", + "Thu", + "Fri", + "Sat", + "Sun"); + +// First day of the week. "0" means display Sunday first, "1" means display +// Monday first, etc. +Calendar._FD = 0; + +// full month names +Calendar._MN = new Array +("January", + "February", + "March", + "April", + "May", + "June", + "July", + "August", + "September", + "October", + "November", + "December"); + +// short month names +Calendar._SMN = new Array +("Jan", + "Feb", + "Mar", + "Apr", + "May", + "Jun", + "Jul", + "Aug", + "Sep", + "Oct", + "Nov", + "Dec"); + +// tooltips +Calendar._TT = {}; +Calendar._TT["INFO"] = "About the calendar"; + +Calendar._TT["ABOUT"] = +"DHTML Date/Time Selector\n" + +"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-) +"For latest version visit: http://www.dynarch.com/projects/calendar/\n" + +"Distributed under GNU LGPL. See http://gnu.org/licenses/lgpl.html for details." + +"\n\n" + +"Date selection:\n" + +"- Use the \xab, \xbb buttons to select year\n" + +"- Use the " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " buttons to select month\n" + +"- Hold mouse button on any of the above buttons for faster selection."; +Calendar._TT["ABOUT_TIME"] = "\n\n" + +"Time selection:\n" + +"- Click on any of the time parts to increase it\n" + +"- or Shift-click to decrease it\n" + +"- or click and drag for faster selection."; + +Calendar._TT["PREV_YEAR"] = "Prev. year (hold for menu)"; +Calendar._TT["PREV_MONTH"] = "Prev. month (hold for menu)"; +Calendar._TT["GO_TODAY"] = "Go Today"; +Calendar._TT["NEXT_MONTH"] = "Next month (hold for menu)"; +Calendar._TT["NEXT_YEAR"] = "Next year (hold for menu)"; +Calendar._TT["SEL_DATE"] = "Select date"; +Calendar._TT["DRAG_TO_MOVE"] = "Drag to move"; +Calendar._TT["PART_TODAY"] = " (today)"; + +// the following is to inform that "%s" is to be the first day of week +// %s will be replaced with the day name. +Calendar._TT["DAY_FIRST"] = "Display %s first"; + +// This may be locale-dependent. It specifies the week-end days, as an array +// of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1 +// means Monday, etc. +Calendar._TT["WEEKEND"] = "0,6"; + +Calendar._TT["CLOSE"] = "Close"; +Calendar._TT["TODAY"] = "Today"; +Calendar._TT["TIME_PART"] = "(Shift-)Click or drag to change value"; + +// date formats +Calendar._TT["DEF_DATE_FORMAT"] = "%Y-%m-%d"; +Calendar._TT["TT_DATE_FORMAT"] = "%a, %b %e"; + +Calendar._TT["WK"] = "wk"; +Calendar._TT["TIME"] = "Time:"; diff --git a/posterita/posterita/web/javascripts/js-calendar/calendar-setup.js b/posterita/posterita/web/javascripts/js-calendar/calendar-setup.js new file mode 100644 index 0000000000..f2b4854308 --- /dev/null +++ b/posterita/posterita/web/javascripts/js-calendar/calendar-setup.js @@ -0,0 +1,200 @@ +/* Copyright Mihai Bazon, 2002, 2003 | http://dynarch.com/mishoo/ + * --------------------------------------------------------------------------- + * + * The DHTML Calendar + * + * Details and latest version at: + * http://dynarch.com/mishoo/calendar.epl + * + * This script is distributed under the GNU Lesser General Public License. + * Read the entire license text here: http://www.gnu.org/licenses/lgpl.html + * + * This file defines helper functions for setting up the calendar. They are + * intended to help non-programmers get a working calendar on their site + * quickly. This script should not be seen as part of the calendar. It just + * shows you what one can do with the calendar, while in the same time + * providing a quick and simple method for setting it up. If you need + * exhaustive customization of the calendar creation process feel free to + * modify this code to suit your needs (this is recommended and much better + * than modifying calendar.js itself). + */ + +// $Id: calendar-setup.js,v 1.25 2005/03/07 09:51:33 mishoo Exp $ + +/** + * This function "patches" an input field (or other element) to use a calendar + * widget for date selection. + * + * The "params" is a single object that can have the following properties: + * + * prop. name | description + * ------------------------------------------------------------------------------------------------- + * inputField | the ID of an input field to store the date + * displayArea | the ID of a DIV or other element to show the date + * button | ID of a button or other element that will trigger the calendar + * eventName | event that will trigger the calendar, without the "on" prefix (default: "click") + * ifFormat | date format that will be stored in the input field + * daFormat | the date format that will be used to display the date in displayArea + * singleClick | (true/false) wether the calendar is in single click mode or not (default: true) + * firstDay | numeric: 0 to 6. "0" means display Sunday first, "1" means display Monday first, etc. + * align | alignment (default: "Br"); if you don't know what's this see the calendar documentation + * range | array with 2 elements. Default: [1900, 2999] -- the range of years available + * weekNumbers | (true/false) if it's true (default) the calendar will display week numbers + * flat | null or element ID; if not null the calendar will be a flat calendar having the parent with the given ID + * flatCallback | function that receives a JS Date object and returns an URL to point the browser to (for flat calendar) + * disableFunc | function that receives a JS Date object and should return true if that date has to be disabled in the calendar + * onSelect | function that gets called when a date is selected. You don't _have_ to supply this (the default is generally okay) + * onClose | function that gets called when the calendar is closed. [default] + * onUpdate | function that gets called after the date is updated in the input field. Receives a reference to the calendar. + * date | the date that the calendar will be initially displayed to + * showsTime | default: false; if true the calendar will include a time selector + * timeFormat | the time format; can be "12" or "24", default is "12" + * electric | if true (default) then given fields/date areas are updated for each move; otherwise they're updated only on close + * step | configures the step of the years in drop-down boxes; default: 2 + * position | configures the calendar absolute position; default: null + * cache | if "true" (but default: "false") it will reuse the same calendar object, where possible + * showOthers | if "true" (but default: "false") it will show days from other months too + * + * None of them is required, they all have default values. However, if you + * pass none of "inputField", "displayArea" or "button" you'll get a warning + * saying "nothing to setup". + */ +Calendar.setup = function (params) { + function param_default(pname, def) { if (typeof params[pname] == "undefined") { params[pname] = def; } }; + + param_default("inputField", null); + param_default("displayArea", null); + param_default("button", null); + param_default("eventName", "click"); + param_default("ifFormat", "%Y/%m/%d"); + param_default("daFormat", "%Y/%m/%d"); + param_default("singleClick", true); + param_default("disableFunc", null); + param_default("dateStatusFunc", params["disableFunc"]); // takes precedence if both are defined + param_default("dateText", null); + param_default("firstDay", null); + param_default("align", "Br"); + param_default("range", [1900, 2999]); + param_default("weekNumbers", true); + param_default("flat", null); + param_default("flatCallback", null); + param_default("onSelect", null); + param_default("onClose", null); + param_default("onUpdate", null); + param_default("date", null); + param_default("showsTime", false); + param_default("timeFormat", "24"); + param_default("electric", true); + param_default("step", 2); + param_default("position", null); + param_default("cache", false); + param_default("showOthers", false); + param_default("multiple", null); + + var tmp = ["inputField", "displayArea", "button"]; + for (var i in tmp) { + if (typeof params[tmp[i]] == "string") { + params[tmp[i]] = document.getElementById(params[tmp[i]]); + } + } + if (!(params.flat || params.multiple || params.inputField || params.displayArea || params.button)) { + alert("Calendar.setup:\n Nothing to setup (no fields found). Please check your code"); + return false; + } + + function onSelect(cal) { + var p = cal.params; + var update = (cal.dateClicked || p.electric); + if (update && p.inputField) { + p.inputField.value = cal.date.print(p.ifFormat); + if (typeof p.inputField.onchange == "function") + p.inputField.onchange(); + } + if (update && p.displayArea) + p.displayArea.innerHTML = cal.date.print(p.daFormat); + if (update && typeof p.onUpdate == "function") + p.onUpdate(cal); + if (update && p.flat) { + if (typeof p.flatCallback == "function") + p.flatCallback(cal); + } + if (update && p.singleClick && cal.dateClicked) + cal.callCloseHandler(); + }; + + if (params.flat != null) { + if (typeof params.flat == "string") + params.flat = document.getElementById(params.flat); + if (!params.flat) { + alert("Calendar.setup:\n Flat specified but can't find parent."); + return false; + } + var cal = new Calendar(params.firstDay, params.date, params.onSelect || onSelect); + cal.showsOtherMonths = params.showOthers; + cal.showsTime = params.showsTime; + cal.time24 = (params.timeFormat == "24"); + cal.params = params; + cal.weekNumbers = params.weekNumbers; + cal.setRange(params.range[0], params.range[1]); + cal.setDateStatusHandler(params.dateStatusFunc); + cal.getDateText = params.dateText; + if (params.ifFormat) { + cal.setDateFormat(params.ifFormat); + } + if (params.inputField && typeof params.inputField.value == "string") { + cal.parseDate(params.inputField.value); + } + cal.create(params.flat); + cal.show(); + return false; + } + + var triggerEl = params.button || params.displayArea || params.inputField; + triggerEl["on" + params.eventName] = function() { + var dateEl = params.inputField || params.displayArea; + var dateFmt = params.inputField ? params.ifFormat : params.daFormat; + var mustCreate = false; + var cal = window.calendar; + if (dateEl) + params.date = Date.parseDate(dateEl.value || dateEl.innerHTML, dateFmt); + if (!(cal && params.cache)) { + window.calendar = cal = new Calendar(params.firstDay, + params.date, + params.onSelect || onSelect, + params.onClose || function(cal) { cal.hide(); }); + cal.showsTime = params.showsTime; + cal.time24 = (params.timeFormat == "24"); + cal.weekNumbers = params.weekNumbers; + mustCreate = true; + } else { + if (params.date) + cal.setDate(params.date); + cal.hide(); + } + if (params.multiple) { + cal.multiple = {}; + for (var i = params.multiple.length; --i >= 0;) { + var d = params.multiple[i]; + var ds = d.print("%Y%m%d"); + cal.multiple[ds] = d; + } + } + cal.showsOtherMonths = params.showOthers; + cal.yearStep = params.step; + cal.setRange(params.range[0], params.range[1]); + cal.params = params; + cal.setDateStatusHandler(params.dateStatusFunc); + cal.getDateText = params.dateText; + cal.setDateFormat(dateFmt); + if (mustCreate) + cal.create(); + cal.refresh(); + if (!params.position) + cal.showAtElement(params.button || params.displayArea || params.inputField, params.align); + else + cal.showAt(params.position[0], params.position[1]); + return false; + }; + + return cal; +}; diff --git a/posterita/posterita/web/javascripts/js-calendar/calendar.js b/posterita/posterita/web/javascripts/js-calendar/calendar.js new file mode 100644 index 0000000000..9088e0e897 --- /dev/null +++ b/posterita/posterita/web/javascripts/js-calendar/calendar.js @@ -0,0 +1,1806 @@ +/* Copyright Mihai Bazon, 2002-2005 | www.bazon.net/mishoo + * ----------------------------------------------------------- + * + * The DHTML Calendar, version 1.0 "It is happening again" + * + * Details and latest version at: + * www.dynarch.com/projects/calendar + * + * This script is developed by Dynarch.com. Visit us at www.dynarch.com. + * + * This script is distributed under the GNU Lesser General Public License. + * Read the entire license text here: http://www.gnu.org/licenses/lgpl.html + */ + +// $Id: calendar.js,v 1.51 2005/03/07 16:44:31 mishoo Exp $ + +/** The Calendar object constructor. */ +Calendar = function (firstDayOfWeek, dateStr, onSelected, onClose) { + // member variables + this.activeDiv = null; + this.currentDateEl = null; + this.getDateStatus = null; + this.getDateToolTip = null; + this.getDateText = null; + this.timeout = null; + this.onSelected = onSelected || null; + this.onClose = onClose || null; + this.dragging = false; + this.hidden = false; + this.minYear = 1970; + this.maxYear = 2050; + this.dateFormat = Calendar._TT["DEF_DATE_FORMAT"]; + this.ttDateFormat = Calendar._TT["TT_DATE_FORMAT"]; + this.isPopup = true; + this.weekNumbers = true; + this.firstDayOfWeek = typeof firstDayOfWeek == "number" ? firstDayOfWeek : Calendar._FD; // 0 for Sunday, 1 for Monday, etc. + this.showsOtherMonths = false; + this.dateStr = dateStr; + this.ar_days = null; + this.showsTime = false; + this.time24 = true; + this.yearStep = 2; + this.hiliteToday = true; + this.multiple = null; + // HTML elements + this.table = null; + this.element = null; + this.tbody = null; + this.firstdayname = null; + // Combo boxes + this.monthsCombo = null; + this.yearsCombo = null; + this.hilitedMonth = null; + this.activeMonth = null; + this.hilitedYear = null; + this.activeYear = null; + // Information + this.dateClicked = false; + + // one-time initializations + if (typeof Calendar._SDN == "undefined") { + // table of short day names + if (typeof Calendar._SDN_len == "undefined") + Calendar._SDN_len = 3; + var ar = new Array(); + for (var i = 8; i > 0;) { + ar[--i] = Calendar._DN[i].substr(0, Calendar._SDN_len); + } + Calendar._SDN = ar; + // table of short month names + if (typeof Calendar._SMN_len == "undefined") + Calendar._SMN_len = 3; + ar = new Array(); + for (var i = 12; i > 0;) { + ar[--i] = Calendar._MN[i].substr(0, Calendar._SMN_len); + } + Calendar._SMN = ar; + } +}; + +// ** constants + +/// "static", needed for event handlers. +Calendar._C = null; + +/// detect a special case of "web browser" +Calendar.is_ie = ( /msie/i.test(navigator.userAgent) && + !/opera/i.test(navigator.userAgent) ); + +Calendar.is_ie5 = ( Calendar.is_ie && /msie 5\.0/i.test(navigator.userAgent) ); + +/// detect Opera browser +Calendar.is_opera = /opera/i.test(navigator.userAgent); + +/// detect KHTML-based browsers +Calendar.is_khtml = /Konqueror|Safari|KHTML/i.test(navigator.userAgent); + +// BEGIN: UTILITY FUNCTIONS; beware that these might be moved into a separate +// library, at some point. + +Calendar.getAbsolutePos = function(el) { + var SL = 0, ST = 0; + var is_div = /^div$/i.test(el.tagName); + if (is_div && el.scrollLeft) + SL = el.scrollLeft; + if (is_div && el.scrollTop) + ST = el.scrollTop; + var r = { x: el.offsetLeft - SL, y: el.offsetTop - ST }; + if (el.offsetParent) { + var tmp = this.getAbsolutePos(el.offsetParent); + r.x += tmp.x; + r.y += tmp.y; + } + return r; +}; + +Calendar.isRelated = function (el, evt) { + var related = evt.relatedTarget; + if (!related) { + var type = evt.type; + if (type == "mouseover") { + related = evt.fromElement; + } else if (type == "mouseout") { + related = evt.toElement; + } + } + while (related) { + if (related == el) { + return true; + } + related = related.parentNode; + } + return false; +}; + +Calendar.removeClass = function(el, className) { + if (!(el && el.className)) { + return; + } + var cls = el.className.split(" "); + var ar = new Array(); + for (var i = cls.length; i > 0;) { + if (cls[--i] != className) { + ar[ar.length] = cls[i]; + } + } + el.className = ar.join(" "); +}; + +Calendar.addClass = function(el, className) { + Calendar.removeClass(el, className); + el.className += " " + className; +}; + +// FIXME: the following 2 functions totally suck, are useless and should be replaced immediately. +Calendar.getElement = function(ev) { + var f = Calendar.is_ie ? window.event.srcElement : ev.currentTarget; + while (f.nodeType != 1 || /^div$/i.test(f.tagName)) + f = f.parentNode; + return f; +}; + +Calendar.getTargetElement = function(ev) { + var f = Calendar.is_ie ? window.event.srcElement : ev.target; + while (f.nodeType != 1) + f = f.parentNode; + return f; +}; + +Calendar.stopEvent = function(ev) { + ev || (ev = window.event); + if (Calendar.is_ie) { + ev.cancelBubble = true; + ev.returnValue = false; + } else { + ev.preventDefault(); + ev.stopPropagation(); + } + return false; +}; + +Calendar.addEvent = function(el, evname, func) { + if (el.attachEvent) { // IE + el.attachEvent("on" + evname, func); + } else if (el.addEventListener) { // Gecko / W3C + el.addEventListener(evname, func, true); + } else { + el["on" + evname] = func; + } +}; + +Calendar.removeEvent = function(el, evname, func) { + if (el.detachEvent) { // IE + el.detachEvent("on" + evname, func); + } else if (el.removeEventListener) { // Gecko / W3C + el.removeEventListener(evname, func, true); + } else { + el["on" + evname] = null; + } +}; + +Calendar.createElement = function(type, parent) { + var el = null; + if (document.createElementNS) { + // use the XHTML namespace; IE won't normally get here unless + // _they_ "fix" the DOM2 implementation. + el = document.createElementNS("http://www.w3.org/1999/xhtml", type); + } else { + el = document.createElement(type); + } + if (typeof parent != "undefined") { + parent.appendChild(el); + } + return el; +}; + +// END: UTILITY FUNCTIONS + +// BEGIN: CALENDAR STATIC FUNCTIONS + +/** Internal -- adds a set of events to make some element behave like a button. */ +Calendar._add_evs = function(el) { + with (Calendar) { + addEvent(el, "mouseover", dayMouseOver); + addEvent(el, "mousedown", dayMouseDown); + addEvent(el, "mouseout", dayMouseOut); + if (is_ie) { + addEvent(el, "dblclick", dayMouseDblClick); + el.setAttribute("unselectable", true); + } + } +}; + +Calendar.findMonth = function(el) { + if (typeof el.month != "undefined") { + return el; + } else if (typeof el.parentNode.month != "undefined") { + return el.parentNode; + } + return null; +}; + +Calendar.findYear = function(el) { + if (typeof el.year != "undefined") { + return el; + } else if (typeof el.parentNode.year != "undefined") { + return el.parentNode; + } + return null; +}; + +Calendar.showMonthsCombo = function () { + var cal = Calendar._C; + if (!cal) { + return false; + } + var cal = cal; + var cd = cal.activeDiv; + var mc = cal.monthsCombo; + if (cal.hilitedMonth) { + Calendar.removeClass(cal.hilitedMonth, "hilite"); + } + if (cal.activeMonth) { + Calendar.removeClass(cal.activeMonth, "active"); + } + var mon = cal.monthsCombo.getElementsByTagName("div")[cal.date.getMonth()]; + Calendar.addClass(mon, "active"); + cal.activeMonth = mon; + var s = mc.style; + s.display = "block"; + if (cd.navtype < 0) + s.left = cd.offsetLeft + "px"; + else { + var mcw = mc.offsetWidth; + if (typeof mcw == "undefined") + // Konqueror brain-dead techniques + mcw = 50; + s.left = (cd.offsetLeft + cd.offsetWidth - mcw) + "px"; + } + s.top = (cd.offsetTop + cd.offsetHeight) + "px"; +}; + +Calendar.showYearsCombo = function (fwd) { + var cal = Calendar._C; + if (!cal) { + return false; + } + var cal = cal; + var cd = cal.activeDiv; + var yc = cal.yearsCombo; + if (cal.hilitedYear) { + Calendar.removeClass(cal.hilitedYear, "hilite"); + } + if (cal.activeYear) { + Calendar.removeClass(cal.activeYear, "active"); + } + cal.activeYear = null; + var Y = cal.date.getFullYear() + (fwd ? 1 : -1); + var yr = yc.firstChild; + var show = false; + for (var i = 12; i > 0; --i) { + if (Y >= cal.minYear && Y <= cal.maxYear) { + yr.innerHTML = Y; + yr.year = Y; + yr.style.display = "block"; + show = true; + } else { + yr.style.display = "none"; + } + yr = yr.nextSibling; + Y += fwd ? cal.yearStep : -cal.yearStep; + } + if (show) { + var s = yc.style; + s.display = "block"; + if (cd.navtype < 0) + s.left = cd.offsetLeft + "px"; + else { + var ycw = yc.offsetWidth; + if (typeof ycw == "undefined") + // Konqueror brain-dead techniques + ycw = 50; + s.left = (cd.offsetLeft + cd.offsetWidth - ycw) + "px"; + } + s.top = (cd.offsetTop + cd.offsetHeight) + "px"; + } +}; + +// event handlers + +Calendar.tableMouseUp = function(ev) { + var cal = Calendar._C; + if (!cal) { + return false; + } + if (cal.timeout) { + clearTimeout(cal.timeout); + } + var el = cal.activeDiv; + if (!el) { + return false; + } + var target = Calendar.getTargetElement(ev); + ev || (ev = window.event); + Calendar.removeClass(el, "active"); + if (target == el || target.parentNode == el) { + Calendar.cellClick(el, ev); + } + var mon = Calendar.findMonth(target); + var date = null; + if (mon) { + date = new Date(cal.date); + if (mon.month != date.getMonth()) { + date.setMonth(mon.month); + cal.setDate(date); + cal.dateClicked = false; + cal.callHandler(); + } + } else { + var year = Calendar.findYear(target); + if (year) { + date = new Date(cal.date); + if (year.year != date.getFullYear()) { + date.setFullYear(year.year); + cal.setDate(date); + cal.dateClicked = false; + cal.callHandler(); + } + } + } + with (Calendar) { + removeEvent(document, "mouseup", tableMouseUp); + removeEvent(document, "mouseover", tableMouseOver); + removeEvent(document, "mousemove", tableMouseOver); + cal._hideCombos(); + _C = null; + return stopEvent(ev); + } +}; + +Calendar.tableMouseOver = function (ev) { + var cal = Calendar._C; + if (!cal) { + return; + } + var el = cal.activeDiv; + var target = Calendar.getTargetElement(ev); + if (target == el || target.parentNode == el) { + Calendar.addClass(el, "hilite active"); + Calendar.addClass(el.parentNode, "rowhilite"); + } else { + if (typeof el.navtype == "undefined" || (el.navtype != 50 && (el.navtype == 0 || Math.abs(el.navtype) > 2))) + Calendar.removeClass(el, "active"); + Calendar.removeClass(el, "hilite"); + Calendar.removeClass(el.parentNode, "rowhilite"); + } + ev || (ev = window.event); + if (el.navtype == 50 && target != el) { + var pos = Calendar.getAbsolutePos(el); + var w = el.offsetWidth; + var x = ev.clientX; + var dx; + var decrease = true; + if (x > pos.x + w) { + dx = x - pos.x - w; + decrease = false; + } else + dx = pos.x - x; + + if (dx < 0) dx = 0; + var range = el._range; + var current = el._current; + var count = Math.floor(dx / 10) % range.length; + for (var i = range.length; --i >= 0;) + if (range[i] == current) + break; + while (count-- > 0) + if (decrease) { + if (--i < 0) + i = range.length - 1; + } else if ( ++i >= range.length ) + i = 0; + var newval = range[i]; + el.innerHTML = newval; + + cal.onUpdateTime(); + } + var mon = Calendar.findMonth(target); + if (mon) { + if (mon.month != cal.date.getMonth()) { + if (cal.hilitedMonth) { + Calendar.removeClass(cal.hilitedMonth, "hilite"); + } + Calendar.addClass(mon, "hilite"); + cal.hilitedMonth = mon; + } else if (cal.hilitedMonth) { + Calendar.removeClass(cal.hilitedMonth, "hilite"); + } + } else { + if (cal.hilitedMonth) { + Calendar.removeClass(cal.hilitedMonth, "hilite"); + } + var year = Calendar.findYear(target); + if (year) { + if (year.year != cal.date.getFullYear()) { + if (cal.hilitedYear) { + Calendar.removeClass(cal.hilitedYear, "hilite"); + } + Calendar.addClass(year, "hilite"); + cal.hilitedYear = year; + } else if (cal.hilitedYear) { + Calendar.removeClass(cal.hilitedYear, "hilite"); + } + } else if (cal.hilitedYear) { + Calendar.removeClass(cal.hilitedYear, "hilite"); + } + } + return Calendar.stopEvent(ev); +}; + +Calendar.tableMouseDown = function (ev) { + if (Calendar.getTargetElement(ev) == Calendar.getElement(ev)) { + return Calendar.stopEvent(ev); + } +}; + +Calendar.calDragIt = function (ev) { + var cal = Calendar._C; + if (!(cal && cal.dragging)) { + return false; + } + var posX; + var posY; + if (Calendar.is_ie) { + posY = window.event.clientY + document.body.scrollTop; + posX = window.event.clientX + document.body.scrollLeft; + } else { + posX = ev.pageX; + posY = ev.pageY; + } + cal.hideShowCovered(); + var st = cal.element.style; + st.left = (posX - cal.xOffs) + "px"; + st.top = (posY - cal.yOffs) + "px"; + return Calendar.stopEvent(ev); +}; + +Calendar.calDragEnd = function (ev) { + var cal = Calendar._C; + if (!cal) { + return false; + } + cal.dragging = false; + with (Calendar) { + removeEvent(document, "mousemove", calDragIt); + removeEvent(document, "mouseup", calDragEnd); + tableMouseUp(ev); + } + cal.hideShowCovered(); +}; + +Calendar.dayMouseDown = function(ev) { + var el = Calendar.getElement(ev); + if (el.disabled) { + return false; + } + var cal = el.calendar; + cal.activeDiv = el; + Calendar._C = cal; + if (el.navtype != 300) with (Calendar) { + if (el.navtype == 50) { + el._current = el.innerHTML; + addEvent(document, "mousemove", tableMouseOver); + } else + addEvent(document, Calendar.is_ie5 ? "mousemove" : "mouseover", tableMouseOver); + addClass(el, "hilite active"); + addEvent(document, "mouseup", tableMouseUp); + } else if (cal.isPopup) { + cal._dragStart(ev); + } + if (el.navtype == -1 || el.navtype == 1) { + if (cal.timeout) clearTimeout(cal.timeout); + cal.timeout = setTimeout("Calendar.showMonthsCombo()", 250); + } else if (el.navtype == -2 || el.navtype == 2) { + if (cal.timeout) clearTimeout(cal.timeout); + cal.timeout = setTimeout((el.navtype > 0) ? "Calendar.showYearsCombo(true)" : "Calendar.showYearsCombo(false)", 250); + } else { + cal.timeout = null; + } + return Calendar.stopEvent(ev); +}; + +Calendar.dayMouseDblClick = function(ev) { + Calendar.cellClick(Calendar.getElement(ev), ev || window.event); + if (Calendar.is_ie) { + document.selection.empty(); + } +}; + +Calendar.dayMouseOver = function(ev) { + var el = Calendar.getElement(ev); + if (Calendar.isRelated(el, ev) || Calendar._C || el.disabled) { + return false; + } + if (el.ttip) { + if (el.ttip.substr(0, 1) == "_") { + el.ttip = el.caldate.print(el.calendar.ttDateFormat) + el.ttip.substr(1); + } + el.calendar.tooltips.innerHTML = el.ttip; + } + if (el.navtype != 300) { + Calendar.addClass(el, "hilite"); + if (el.caldate) { + Calendar.addClass(el.parentNode, "rowhilite"); + } + } + return Calendar.stopEvent(ev); +}; + +Calendar.dayMouseOut = function(ev) { + with (Calendar) { + var el = getElement(ev); + if (isRelated(el, ev) || _C || el.disabled) + return false; + removeClass(el, "hilite"); + if (el.caldate) + removeClass(el.parentNode, "rowhilite"); + if (el.calendar) + el.calendar.tooltips.innerHTML = _TT["SEL_DATE"]; + return stopEvent(ev); + } +}; + +/** + * A generic "click" handler :) handles all types of buttons defined in this + * calendar. + */ +Calendar.cellClick = function(el, ev) { + var cal = el.calendar; + var closing = false; + var newdate = false; + var date = null; + if (typeof el.navtype == "undefined") { + if (cal.currentDateEl) { + Calendar.removeClass(cal.currentDateEl, "selected"); + Calendar.addClass(el, "selected"); + closing = (cal.currentDateEl == el); + if (!closing) { + cal.currentDateEl = el; + } + } + cal.date.setDateOnly(el.caldate); + date = cal.date; + var other_month = !(cal.dateClicked = !el.otherMonth); + if (!other_month && !cal.currentDateEl) + cal._toggleMultipleDate(new Date(date)); + else + newdate = !el.disabled; + // a date was clicked + if (other_month) + cal._init(cal.firstDayOfWeek, date); + } else { + if (el.navtype == 200) { + Calendar.removeClass(el, "hilite"); + cal.callCloseHandler(); + return; + } + date = new Date(cal.date); + if (el.navtype == 0) + date.setDateOnly(new Date()); // TODAY + // unless "today" was clicked, we assume no date was clicked so + // the selected handler will know not to close the calenar when + // in single-click mode. + // cal.dateClicked = (el.navtype == 0); + cal.dateClicked = false; + var year = date.getFullYear(); + var mon = date.getMonth(); + function setMonth(m) { + var day = date.getDate(); + var max = date.getMonthDays(m); + if (day > max) { + date.setDate(max); + } + date.setMonth(m); + }; + switch (el.navtype) { + case 400: + Calendar.removeClass(el, "hilite"); + var text = Calendar._TT["ABOUT"]; + if (typeof text != "undefined") { + text += cal.showsTime ? Calendar._TT["ABOUT_TIME"] : ""; + } else { + // FIXME: this should be removed as soon as lang files get updated! + text = "Help and about box text is not translated into this language.\n" + + "If you know this language and you feel generous please update\n" + + "the corresponding file in \"lang\" subdir to match calendar-en.js\n" + + "and send it back to to get it into the distribution ;-)\n\n" + + "Thank you!\n" + + "http://dynarch.com/mishoo/calendar.epl\n"; + } + alert(text); + return; + case -2: + if (year > cal.minYear) { + date.setFullYear(year - 1); + } + break; + case -1: + if (mon > 0) { + setMonth(mon - 1); + } else if (year-- > cal.minYear) { + date.setFullYear(year); + setMonth(11); + } + break; + case 1: + if (mon < 11) { + setMonth(mon + 1); + } else if (year < cal.maxYear) { + date.setFullYear(year + 1); + setMonth(0); + } + break; + case 2: + if (year < cal.maxYear) { + date.setFullYear(year + 1); + } + break; + case 100: + cal.setFirstDayOfWeek(el.fdow); + return; + case 50: + var range = el._range; + var current = el.innerHTML; + for (var i = range.length; --i >= 0;) + if (range[i] == current) + break; + if (ev && ev.shiftKey) { + if (--i < 0) + i = range.length - 1; + } else if ( ++i >= range.length ) + i = 0; + var newval = range[i]; + el.innerHTML = newval; + cal.onUpdateTime(); + return; + case 0: + // TODAY will bring us here + if ((typeof cal.getDateStatus == "function") && + cal.getDateStatus(date, date.getFullYear(), date.getMonth(), date.getDate())) { + return false; + } + break; + } + if (!date.equalsTo(cal.date)) { + cal.setDate(date); + newdate = true; + } else if (el.navtype == 0) + newdate = closing = true; + } + if (newdate) { + ev && cal.callHandler(); + } + if (closing) { + Calendar.removeClass(el, "hilite"); + ev && cal.callCloseHandler(); + } +}; + +// END: CALENDAR STATIC FUNCTIONS + +// BEGIN: CALENDAR OBJECT FUNCTIONS + +/** + * This function creates the calendar inside the given parent. If _par is + * null than it creates a popup calendar inside the BODY element. If _par is + * an element, be it BODY, then it creates a non-popup calendar (still + * hidden). Some properties need to be set before calling this function. + */ +Calendar.prototype.create = function (_par) { + var parent = null; + if (! _par) { + // default parent is the document body, in which case we create + // a popup calendar. + parent = document.getElementsByTagName("body")[0]; + this.isPopup = true; + } else { + parent = _par; + this.isPopup = false; + } + this.date = this.dateStr ? new Date(this.dateStr) : new Date(); + + var table = Calendar.createElement("table"); + this.table = table; + table.cellSpacing = 0; + table.cellPadding = 0; + table.calendar = this; + Calendar.addEvent(table, "mousedown", Calendar.tableMouseDown); + + var div = Calendar.createElement("div"); + this.element = div; + div.className = "calendar"; + if (this.isPopup) { + div.style.position = "absolute"; + div.style.display = "none"; + } + div.appendChild(table); + + var thead = Calendar.createElement("thead", table); + var cell = null; + var row = null; + + var cal = this; + var hh = function (text, cs, navtype) { + cell = Calendar.createElement("td", row); + cell.colSpan = cs; + cell.className = "button"; + if (navtype != 0 && Math.abs(navtype) <= 2) + cell.className += " nav"; + Calendar._add_evs(cell); + cell.calendar = cal; + cell.navtype = navtype; + cell.innerHTML = "
    " + text + "
    "; + return cell; + }; + + row = Calendar.createElement("tr", thead); + var title_length = 6; + (this.isPopup) && --title_length; + (this.weekNumbers) && ++title_length; + + hh("?", 1, 400).ttip = Calendar._TT["INFO"]; + this.title = hh("", title_length, 300); + this.title.className = "title"; + if (this.isPopup) { + this.title.ttip = Calendar._TT["DRAG_TO_MOVE"]; + this.title.style.cursor = "move"; + hh("×", 1, 200).ttip = Calendar._TT["CLOSE"]; + } + + row = Calendar.createElement("tr", thead); + row.className = "headrow"; + + this._nav_py = hh("«", 1, -2); + this._nav_py.ttip = Calendar._TT["PREV_YEAR"]; + + this._nav_pm = hh("‹", 1, -1); + this._nav_pm.ttip = Calendar._TT["PREV_MONTH"]; + + this._nav_now = hh(Calendar._TT["TODAY"], this.weekNumbers ? 4 : 3, 0); + this._nav_now.ttip = Calendar._TT["GO_TODAY"]; + + this._nav_nm = hh("›", 1, 1); + this._nav_nm.ttip = Calendar._TT["NEXT_MONTH"]; + + this._nav_ny = hh("»", 1, 2); + this._nav_ny.ttip = Calendar._TT["NEXT_YEAR"]; + + // day names + row = Calendar.createElement("tr", thead); + row.className = "daynames"; + if (this.weekNumbers) { + cell = Calendar.createElement("td", row); + cell.className = "name wn"; + cell.innerHTML = Calendar._TT["WK"]; + } + for (var i = 7; i > 0; --i) { + cell = Calendar.createElement("td", row); + if (!i) { + cell.navtype = 100; + cell.calendar = this; + Calendar._add_evs(cell); + } + } + this.firstdayname = (this.weekNumbers) ? row.firstChild.nextSibling : row.firstChild; + this._displayWeekdays(); + + var tbody = Calendar.createElement("tbody", table); + this.tbody = tbody; + + for (i = 6; i > 0; --i) { + row = Calendar.createElement("tr", tbody); + if (this.weekNumbers) { + cell = Calendar.createElement("td", row); + } + for (var j = 7; j > 0; --j) { + cell = Calendar.createElement("td", row); + cell.calendar = this; + Calendar._add_evs(cell); + } + } + + if (this.showsTime) { + row = Calendar.createElement("tr", tbody); + row.className = "time"; + + cell = Calendar.createElement("td", row); + cell.className = "time"; + cell.colSpan = 2; + cell.innerHTML = Calendar._TT["TIME"] || " "; + + cell = Calendar.createElement("td", row); + cell.className = "time"; + cell.colSpan = this.weekNumbers ? 4 : 3; + + (function(){ + function makeTimePart(className, init, range_start, range_end) { + var part = Calendar.createElement("span", cell); + part.className = className; + part.innerHTML = init; + part.calendar = cal; + part.ttip = Calendar._TT["TIME_PART"]; + part.navtype = 50; + part._range = []; + if (typeof range_start != "number") + part._range = range_start; + else { + for (var i = range_start; i <= range_end; ++i) { + var txt; + if (i < 10 && range_end >= 10) txt = '0' + i; + else txt = '' + i; + part._range[part._range.length] = txt; + } + } + Calendar._add_evs(part); + return part; + }; + var hrs = cal.date.getHours(); + var mins = cal.date.getMinutes(); + var t12 = !cal.time24; + var pm = (hrs > 12); + if (t12 && pm) hrs -= 12; + var H = makeTimePart("hour", hrs, t12 ? 1 : 0, t12 ? 12 : 23); + var span = Calendar.createElement("span", cell); + span.innerHTML = ":"; + span.className = "colon"; + var M = makeTimePart("minute", mins, 0, 59); + var AP = null; + cell = Calendar.createElement("td", row); + cell.className = "time"; + cell.colSpan = 2; + if (t12) + AP = makeTimePart("ampm", pm ? "pm" : "am", ["am", "pm"]); + else + cell.innerHTML = " "; + + cal.onSetTime = function() { + var pm, hrs = this.date.getHours(), + mins = this.date.getMinutes(); + if (t12) { + pm = (hrs >= 12); + if (pm) hrs -= 12; + if (hrs == 0) hrs = 12; + AP.innerHTML = pm ? "pm" : "am"; + } + H.innerHTML = (hrs < 10) ? ("0" + hrs) : hrs; + M.innerHTML = (mins < 10) ? ("0" + mins) : mins; + }; + + cal.onUpdateTime = function() { + var date = this.date; + var h = parseInt(H.innerHTML, 10); + if (t12) { + if (/pm/i.test(AP.innerHTML) && h < 12) + h += 12; + else if (/am/i.test(AP.innerHTML) && h == 12) + h = 0; + } + var d = date.getDate(); + var m = date.getMonth(); + var y = date.getFullYear(); + date.setHours(h); + date.setMinutes(parseInt(M.innerHTML, 10)); + date.setFullYear(y); + date.setMonth(m); + date.setDate(d); + this.dateClicked = false; + this.callHandler(); + }; + })(); + } else { + this.onSetTime = this.onUpdateTime = function() {}; + } + + var tfoot = Calendar.createElement("tfoot", table); + + row = Calendar.createElement("tr", tfoot); + row.className = "footrow"; + + cell = hh(Calendar._TT["SEL_DATE"], this.weekNumbers ? 8 : 7, 300); + cell.className = "ttip"; + if (this.isPopup) { + cell.ttip = Calendar._TT["DRAG_TO_MOVE"]; + cell.style.cursor = "move"; + } + this.tooltips = cell; + + div = Calendar.createElement("div", this.element); + this.monthsCombo = div; + div.className = "combo"; + for (i = 0; i < Calendar._MN.length; ++i) { + var mn = Calendar.createElement("div"); + mn.className = Calendar.is_ie ? "label-IEfix" : "label"; + mn.month = i; + mn.innerHTML = Calendar._SMN[i]; + div.appendChild(mn); + } + + div = Calendar.createElement("div", this.element); + this.yearsCombo = div; + div.className = "combo"; + for (i = 12; i > 0; --i) { + var yr = Calendar.createElement("div"); + yr.className = Calendar.is_ie ? "label-IEfix" : "label"; + div.appendChild(yr); + } + + this._init(this.firstDayOfWeek, this.date); + parent.appendChild(this.element); +}; + +/** keyboard navigation, only for popup calendars */ +Calendar._keyEvent = function(ev) { + var cal = window._dynarch_popupCalendar; + if (!cal || cal.multiple) + return false; + (Calendar.is_ie) && (ev = window.event); + var act = (Calendar.is_ie || ev.type == "keypress"), + K = ev.keyCode; + if (ev.ctrlKey) { + switch (K) { + case 37: // KEY left + act && Calendar.cellClick(cal._nav_pm); + break; + case 38: // KEY up + act && Calendar.cellClick(cal._nav_py); + break; + case 39: // KEY right + act && Calendar.cellClick(cal._nav_nm); + break; + case 40: // KEY down + act && Calendar.cellClick(cal._nav_ny); + break; + default: + return false; + } + } else switch (K) { + case 32: // KEY space (now) + Calendar.cellClick(cal._nav_now); + break; + case 27: // KEY esc + act && cal.callCloseHandler(); + break; + case 37: // KEY left + case 38: // KEY up + case 39: // KEY right + case 40: // KEY down + if (act) { + var prev, x, y, ne, el, step; + prev = K == 37 || K == 38; + step = (K == 37 || K == 39) ? 1 : 7; + function setVars() { + el = cal.currentDateEl; + var p = el.pos; + x = p & 15; + y = p >> 4; + ne = cal.ar_days[y][x]; + };setVars(); + function prevMonth() { + var date = new Date(cal.date); + date.setDate(date.getDate() - step); + cal.setDate(date); + }; + function nextMonth() { + var date = new Date(cal.date); + date.setDate(date.getDate() + step); + cal.setDate(date); + }; + while (1) { + switch (K) { + case 37: // KEY left + if (--x >= 0) + ne = cal.ar_days[y][x]; + else { + x = 6; + K = 38; + continue; + } + break; + case 38: // KEY up + if (--y >= 0) + ne = cal.ar_days[y][x]; + else { + prevMonth(); + setVars(); + } + break; + case 39: // KEY right + if (++x < 7) + ne = cal.ar_days[y][x]; + else { + x = 0; + K = 40; + continue; + } + break; + case 40: // KEY down + if (++y < cal.ar_days.length) + ne = cal.ar_days[y][x]; + else { + nextMonth(); + setVars(); + } + break; + } + break; + } + if (ne) { + if (!ne.disabled) + Calendar.cellClick(ne); + else if (prev) + prevMonth(); + else + nextMonth(); + } + } + break; + case 13: // KEY enter + if (act) + Calendar.cellClick(cal.currentDateEl, ev); + break; + default: + return false; + } + return Calendar.stopEvent(ev); +}; + +/** + * (RE)Initializes the calendar to the given date and firstDayOfWeek + */ +Calendar.prototype._init = function (firstDayOfWeek, date) { + var today = new Date(), + TY = today.getFullYear(), + TM = today.getMonth(), + TD = today.getDate(); + this.table.style.visibility = "hidden"; + var year = date.getFullYear(); + if (year < this.minYear) { + year = this.minYear; + date.setFullYear(year); + } else if (year > this.maxYear) { + year = this.maxYear; + date.setFullYear(year); + } + this.firstDayOfWeek = firstDayOfWeek; + this.date = new Date(date); + var month = date.getMonth(); + var mday = date.getDate(); + var no_days = date.getMonthDays(); + + // calendar voodoo for computing the first day that would actually be + // displayed in the calendar, even if it's from the previous month. + // WARNING: this is magic. ;-) + date.setDate(1); + var day1 = (date.getDay() - this.firstDayOfWeek) % 7; + if (day1 < 0) + day1 += 7; + date.setDate(-day1); + date.setDate(date.getDate() + 1); + + var row = this.tbody.firstChild; + var MN = Calendar._SMN[month]; + var ar_days = this.ar_days = new Array(); + var weekend = Calendar._TT["WEEKEND"]; + var dates = this.multiple ? (this.datesCells = {}) : null; + for (var i = 0; i < 6; ++i, row = row.nextSibling) { + var cell = row.firstChild; + if (this.weekNumbers) { + cell.className = "day wn"; + cell.innerHTML = date.getWeekNumber(); + cell = cell.nextSibling; + } + row.className = "daysrow"; + var hasdays = false, iday, dpos = ar_days[i] = []; + for (var j = 0; j < 7; ++j, cell = cell.nextSibling, date.setDate(iday + 1)) { + iday = date.getDate(); + var wday = date.getDay(); + cell.className = "day"; + cell.pos = i << 4 | j; + dpos[j] = cell; + var current_month = (date.getMonth() == month); + if (!current_month) { + if (this.showsOtherMonths) { + cell.className += " othermonth"; + cell.otherMonth = true; + } else { + cell.className = "emptycell"; + cell.innerHTML = " "; + cell.disabled = true; + continue; + } + } else { + cell.otherMonth = false; + hasdays = true; + } + cell.disabled = false; + cell.innerHTML = this.getDateText ? this.getDateText(date, iday) : iday; + if (dates) + dates[date.print("%Y%m%d")] = cell; + if (this.getDateStatus) { + var status = this.getDateStatus(date, year, month, iday); + if (this.getDateToolTip) { + var toolTip = this.getDateToolTip(date, year, month, iday); + if (toolTip) + cell.title = toolTip; + } + if (status === true) { + cell.className += " disabled"; + cell.disabled = true; + } else { + if (/disabled/i.test(status)) + cell.disabled = true; + cell.className += " " + status; + } + } + if (!cell.disabled) { + cell.caldate = new Date(date); + cell.ttip = "_"; + if (!this.multiple && current_month + && iday == mday && this.hiliteToday) { + cell.className += " selected"; + this.currentDateEl = cell; + } + if (date.getFullYear() == TY && + date.getMonth() == TM && + iday == TD) { + cell.className += " today"; + cell.ttip += Calendar._TT["PART_TODAY"]; + } + if (weekend.indexOf(wday.toString()) != -1) + cell.className += cell.otherMonth ? " oweekend" : " weekend"; + } + } + if (!(hasdays || this.showsOtherMonths)) + row.className = "emptyrow"; + } + this.title.innerHTML = Calendar._MN[month] + ", " + year; + this.onSetTime(); + this.table.style.visibility = "visible"; + this._initMultipleDates(); + // PROFILE + // this.tooltips.innerHTML = "Generated in " + ((new Date()) - today) + " ms"; +}; + +Calendar.prototype._initMultipleDates = function() { + if (this.multiple) { + for (var i in this.multiple) { + var cell = this.datesCells[i]; + var d = this.multiple[i]; + if (!d) + continue; + if (cell) + cell.className += " selected"; + } + } +}; + +Calendar.prototype._toggleMultipleDate = function(date) { + if (this.multiple) { + var ds = date.print("%Y%m%d"); + var cell = this.datesCells[ds]; + if (cell) { + var d = this.multiple[ds]; + if (!d) { + Calendar.addClass(cell, "selected"); + this.multiple[ds] = date; + } else { + Calendar.removeClass(cell, "selected"); + delete this.multiple[ds]; + } + } + } +}; + +Calendar.prototype.setDateToolTipHandler = function (unaryFunction) { + this.getDateToolTip = unaryFunction; +}; + +/** + * Calls _init function above for going to a certain date (but only if the + * date is different than the currently selected one). + */ +Calendar.prototype.setDate = function (date) { + if (!date.equalsTo(this.date)) { + this._init(this.firstDayOfWeek, date); + } +}; + +/** + * Refreshes the calendar. Useful if the "disabledHandler" function is + * dynamic, meaning that the list of disabled date can change at runtime. + * Just * call this function if you think that the list of disabled dates + * should * change. + */ +Calendar.prototype.refresh = function () { + this._init(this.firstDayOfWeek, this.date); +}; + +/** Modifies the "firstDayOfWeek" parameter (pass 0 for Synday, 1 for Monday, etc.). */ +Calendar.prototype.setFirstDayOfWeek = function (firstDayOfWeek) { + this._init(firstDayOfWeek, this.date); + this._displayWeekdays(); +}; + +/** + * Allows customization of what dates are enabled. The "unaryFunction" + * parameter must be a function object that receives the date (as a JS Date + * object) and returns a boolean value. If the returned value is true then + * the passed date will be marked as disabled. + */ +Calendar.prototype.setDateStatusHandler = Calendar.prototype.setDisabledHandler = function (unaryFunction) { + this.getDateStatus = unaryFunction; +}; + +/** Customization of allowed year range for the calendar. */ +Calendar.prototype.setRange = function (a, z) { + this.minYear = a; + this.maxYear = z; +}; + +/** Calls the first user handler (selectedHandler). */ +Calendar.prototype.callHandler = function () { + if (this.onSelected) { + this.onSelected(this, this.date.print(this.dateFormat)); + } +}; + +/** Calls the second user handler (closeHandler). */ +Calendar.prototype.callCloseHandler = function () { + if (this.onClose) { + this.onClose(this); + } + this.hideShowCovered(); +}; + +/** Removes the calendar object from the DOM tree and destroys it. */ +Calendar.prototype.destroy = function () { + var el = this.element.parentNode; + el.removeChild(this.element); + Calendar._C = null; + window._dynarch_popupCalendar = null; +}; + +/** + * Moves the calendar element to a different section in the DOM tree (changes + * its parent). + */ +Calendar.prototype.reparent = function (new_parent) { + var el = this.element; + el.parentNode.removeChild(el); + new_parent.appendChild(el); +}; + +// This gets called when the user presses a mouse button anywhere in the +// document, if the calendar is shown. If the click was outside the open +// calendar this function closes it. +Calendar._checkCalendar = function(ev) { + var calendar = window._dynarch_popupCalendar; + if (!calendar) { + return false; + } + var el = Calendar.is_ie ? Calendar.getElement(ev) : Calendar.getTargetElement(ev); + for (; el != null && el != calendar.element; el = el.parentNode); + if (el == null) { + // calls closeHandler which should hide the calendar. + window._dynarch_popupCalendar.callCloseHandler(); + return Calendar.stopEvent(ev); + } +}; + +/** Shows the calendar. */ +Calendar.prototype.show = function () { + var rows = this.table.getElementsByTagName("tr"); + for (var i = rows.length; i > 0;) { + var row = rows[--i]; + Calendar.removeClass(row, "rowhilite"); + var cells = row.getElementsByTagName("td"); + for (var j = cells.length; j > 0;) { + var cell = cells[--j]; + Calendar.removeClass(cell, "hilite"); + Calendar.removeClass(cell, "active"); + } + } + this.element.style.display = "block"; + this.hidden = false; + if (this.isPopup) { + window._dynarch_popupCalendar = this; + Calendar.addEvent(document, "keydown", Calendar._keyEvent); + Calendar.addEvent(document, "keypress", Calendar._keyEvent); + Calendar.addEvent(document, "mousedown", Calendar._checkCalendar); + } + this.hideShowCovered(); +}; + +/** + * Hides the calendar. Also removes any "hilite" from the class of any TD + * element. + */ +Calendar.prototype.hide = function () { + if (this.isPopup) { + Calendar.removeEvent(document, "keydown", Calendar._keyEvent); + Calendar.removeEvent(document, "keypress", Calendar._keyEvent); + Calendar.removeEvent(document, "mousedown", Calendar._checkCalendar); + } + this.element.style.display = "none"; + this.hidden = true; + this.hideShowCovered(); +}; + +/** + * Shows the calendar at a given absolute position (beware that, depending on + * the calendar element style -- position property -- this might be relative + * to the parent's containing rectangle). + */ +Calendar.prototype.showAt = function (x, y) { + var s = this.element.style; + s.left = x + "px"; + s.top = y + "px"; + this.show(); +}; + +/** Shows the calendar near a given element. */ +Calendar.prototype.showAtElement = function (el, opts) { + var self = this; + var p = Calendar.getAbsolutePos(el); + if (!opts || typeof opts != "string") { + this.showAt(p.x, p.y + el.offsetHeight); + return true; + } + function fixPosition(box) { + if (box.x < 0) + box.x = 0; + if (box.y < 0) + box.y = 0; + var cp = document.createElement("div"); + var s = cp.style; + s.position = "absolute"; + s.right = s.bottom = s.width = s.height = "0px"; + document.body.appendChild(cp); + var br = Calendar.getAbsolutePos(cp); + document.body.removeChild(cp); + if (Calendar.is_ie) { + br.y += document.body.scrollTop; + br.x += document.body.scrollLeft; + } else { + br.y += window.scrollY; + br.x += window.scrollX; + } + var tmp = box.x + box.width - br.x; + if (tmp > 0) box.x -= tmp; + tmp = box.y + box.height - br.y; + if (tmp > 0) box.y -= tmp; + }; + this.element.style.display = "block"; + Calendar.continuation_for_the_fucking_khtml_browser = function() { + var w = self.element.offsetWidth; + var h = self.element.offsetHeight; + self.element.style.display = "none"; + var valign = opts.substr(0, 1); + var halign = "l"; + if (opts.length > 1) { + halign = opts.substr(1, 1); + } + // vertical alignment + switch (valign) { + case "T": p.y -= h; break; + case "B": p.y += el.offsetHeight; break; + case "C": p.y += (el.offsetHeight - h) / 2; break; + case "t": p.y += el.offsetHeight - h; break; + case "b": break; // already there + } + // horizontal alignment + switch (halign) { + case "L": p.x -= w; break; + case "R": p.x += el.offsetWidth; break; + case "C": p.x += (el.offsetWidth - w) / 2; break; + case "l": p.x += el.offsetWidth - w; break; + case "r": break; // already there + } + p.width = w; + p.height = h + 40; + self.monthsCombo.style.display = "none"; + fixPosition(p); + self.showAt(p.x, p.y); + }; + if (Calendar.is_khtml) + setTimeout("Calendar.continuation_for_the_fucking_khtml_browser()", 10); + else + Calendar.continuation_for_the_fucking_khtml_browser(); +}; + +/** Customizes the date format. */ +Calendar.prototype.setDateFormat = function (str) { + this.dateFormat = str; +}; + +/** Customizes the tooltip date format. */ +Calendar.prototype.setTtDateFormat = function (str) { + this.ttDateFormat = str; +}; + +/** + * Tries to identify the date represented in a string. If successful it also + * calls this.setDate which moves the calendar to the given date. + */ +Calendar.prototype.parseDate = function(str, fmt) { + if (!fmt) + fmt = this.dateFormat; + this.setDate(Date.parseDate(str, fmt)); +}; + +Calendar.prototype.hideShowCovered = function () { + if (!Calendar.is_ie && !Calendar.is_opera) + return; + function getVisib(obj){ + var value = obj.style.visibility; + if (!value) { + if (document.defaultView && typeof (document.defaultView.getComputedStyle) == "function") { // Gecko, W3C + if (!Calendar.is_khtml) + value = document.defaultView. + getComputedStyle(obj, "").getPropertyValue("visibility"); + else + value = ''; + } else if (obj.currentStyle) { // IE + value = obj.currentStyle.visibility; + } else + value = ''; + } + return value; + }; + + var tags = new Array("applet", "iframe", "select"); + var el = this.element; + + var p = Calendar.getAbsolutePos(el); + var EX1 = p.x; + var EX2 = el.offsetWidth + EX1; + var EY1 = p.y; + var EY2 = el.offsetHeight + EY1; + + for (var k = tags.length; k > 0; ) { + var ar = document.getElementsByTagName(tags[--k]); + var cc = null; + + for (var i = ar.length; i > 0;) { + cc = ar[--i]; + + p = Calendar.getAbsolutePos(cc); + var CX1 = p.x; + var CX2 = cc.offsetWidth + CX1; + var CY1 = p.y; + var CY2 = cc.offsetHeight + CY1; + + if (this.hidden || (CX1 > EX2) || (CX2 < EX1) || (CY1 > EY2) || (CY2 < EY1)) { + if (!cc.__msh_save_visibility) { + cc.__msh_save_visibility = getVisib(cc); + } + cc.style.visibility = cc.__msh_save_visibility; + } else { + if (!cc.__msh_save_visibility) { + cc.__msh_save_visibility = getVisib(cc); + } + cc.style.visibility = "hidden"; + } + } + } +}; + +/** Internal function; it displays the bar with the names of the weekday. */ +Calendar.prototype._displayWeekdays = function () { + var fdow = this.firstDayOfWeek; + var cell = this.firstdayname; + var weekend = Calendar._TT["WEEKEND"]; + for (var i = 0; i < 7; ++i) { + cell.className = "day name"; + var realday = (i + fdow) % 7; + if (i) { + cell.ttip = Calendar._TT["DAY_FIRST"].replace("%s", Calendar._DN[realday]); + cell.navtype = 100; + cell.calendar = this; + cell.fdow = realday; + Calendar._add_evs(cell); + } + if (weekend.indexOf(realday.toString()) != -1) { + Calendar.addClass(cell, "weekend"); + } + cell.innerHTML = Calendar._SDN[(i + fdow) % 7]; + cell = cell.nextSibling; + } +}; + +/** Internal function. Hides all combo boxes that might be displayed. */ +Calendar.prototype._hideCombos = function () { + this.monthsCombo.style.display = "none"; + this.yearsCombo.style.display = "none"; +}; + +/** Internal function. Starts dragging the element. */ +Calendar.prototype._dragStart = function (ev) { + if (this.dragging) { + return; + } + this.dragging = true; + var posX; + var posY; + if (Calendar.is_ie) { + posY = window.event.clientY + document.body.scrollTop; + posX = window.event.clientX + document.body.scrollLeft; + } else { + posY = ev.clientY + window.scrollY; + posX = ev.clientX + window.scrollX; + } + var st = this.element.style; + this.xOffs = posX - parseInt(st.left); + this.yOffs = posY - parseInt(st.top); + with (Calendar) { + addEvent(document, "mousemove", calDragIt); + addEvent(document, "mouseup", calDragEnd); + } +}; + +// BEGIN: DATE OBJECT PATCHES + +/** Adds the number of days array to the Date object. */ +Date._MD = new Array(31,28,31,30,31,30,31,31,30,31,30,31); + +/** Constants used for time computations */ +Date.SECOND = 1000 /* milliseconds */; +Date.MINUTE = 60 * Date.SECOND; +Date.HOUR = 60 * Date.MINUTE; +Date.DAY = 24 * Date.HOUR; +Date.WEEK = 7 * Date.DAY; + +Date.parseDate = function(str, fmt) { + var today = new Date(); + var y = 0; + var m = -1; + var d = 0; + var a = str.split(/\W+/); + var b = fmt.match(/%./g); + var i = 0, j = 0; + var hr = 0; + var min = 0; + for (i = 0; i < a.length; ++i) { + if (!a[i]) + continue; + switch (b[i]) { + case "%d": + case "%e": + d = parseInt(a[i], 10); + break; + + case "%m": + m = parseInt(a[i], 10) - 1; + break; + + case "%Y": + case "%y": + y = parseInt(a[i], 10); + (y < 100) && (y += (y > 29) ? 1900 : 2000); + break; + + case "%b": + case "%B": + for (j = 0; j < 12; ++j) { + if (Calendar._MN[j].substr(0, a[i].length).toLowerCase() == a[i].toLowerCase()) { m = j; break; } + } + break; + + case "%H": + case "%I": + case "%k": + case "%l": + hr = parseInt(a[i], 10); + break; + + case "%P": + case "%p": + if (/pm/i.test(a[i]) && hr < 12) + hr += 12; + else if (/am/i.test(a[i]) && hr >= 12) + hr -= 12; + break; + + case "%M": + min = parseInt(a[i], 10); + break; + } + } + if (isNaN(y)) y = today.getFullYear(); + if (isNaN(m)) m = today.getMonth(); + if (isNaN(d)) d = today.getDate(); + if (isNaN(hr)) hr = today.getHours(); + if (isNaN(min)) min = today.getMinutes(); + if (y != 0 && m != -1 && d != 0) + return new Date(y, m, d, hr, min, 0); + y = 0; m = -1; d = 0; + for (i = 0; i < a.length; ++i) { + if (a[i].search(/[a-zA-Z]+/) != -1) { + var t = -1; + for (j = 0; j < 12; ++j) { + if (Calendar._MN[j].substr(0, a[i].length).toLowerCase() == a[i].toLowerCase()) { t = j; break; } + } + if (t != -1) { + if (m != -1) { + d = m+1; + } + m = t; + } + } else if (parseInt(a[i], 10) <= 12 && m == -1) { + m = a[i]-1; + } else if (parseInt(a[i], 10) > 31 && y == 0) { + y = parseInt(a[i], 10); + (y < 100) && (y += (y > 29) ? 1900 : 2000); + } else if (d == 0) { + d = a[i]; + } + } + if (y == 0) + y = today.getFullYear(); + if (m != -1 && d != 0) + return new Date(y, m, d, hr, min, 0); + return today; +}; + +/** Returns the number of days in the current month */ +Date.prototype.getMonthDays = function(month) { + var year = this.getFullYear(); + if (typeof month == "undefined") { + month = this.getMonth(); + } + if (((0 == (year%4)) && ( (0 != (year%100)) || (0 == (year%400)))) && month == 1) { + return 29; + } else { + return Date._MD[month]; + } +}; + +/** Returns the number of day in the year. */ +Date.prototype.getDayOfYear = function() { + var now = new Date(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0, 0); + var then = new Date(this.getFullYear(), 0, 0, 0, 0, 0); + var time = now - then; + return Math.floor(time / Date.DAY); +}; + +/** Returns the number of the week in year, as defined in ISO 8601. */ +Date.prototype.getWeekNumber = function() { + var d = new Date(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0, 0); + var DoW = d.getDay(); + d.setDate(d.getDate() - (DoW + 6) % 7 + 3); // Nearest Thu + var ms = d.valueOf(); // GMT + d.setMonth(0); + d.setDate(4); // Thu in Week 1 + return Math.round((ms - d.valueOf()) / (7 * 864e5)) + 1; +}; + +/** Checks date and time equality */ +Date.prototype.equalsTo = function(date) { + return ((this.getFullYear() == date.getFullYear()) && + (this.getMonth() == date.getMonth()) && + (this.getDate() == date.getDate()) && + (this.getHours() == date.getHours()) && + (this.getMinutes() == date.getMinutes())); +}; + +/** Set only the year, month, date parts (keep existing time) */ +Date.prototype.setDateOnly = function(date) { + var tmp = new Date(date); + this.setDate(1); + this.setFullYear(tmp.getFullYear()); + this.setMonth(tmp.getMonth()); + this.setDate(tmp.getDate()); +}; + +/** Prints the date in a string according to the given format. */ +Date.prototype.print = function (str) { + var m = this.getMonth(); + var d = this.getDate(); + var y = this.getFullYear(); + var wn = this.getWeekNumber(); + var w = this.getDay(); + var s = {}; + var hr = this.getHours(); + var pm = (hr >= 12); + var ir = (pm) ? (hr - 12) : hr; + var dy = this.getDayOfYear(); + if (ir == 0) + ir = 12; + var min = this.getMinutes(); + var sec = this.getSeconds(); + s["%a"] = Calendar._SDN[w]; // abbreviated weekday name [FIXME: I18N] + s["%A"] = Calendar._DN[w]; // full weekday name + s["%b"] = Calendar._SMN[m]; // abbreviated month name [FIXME: I18N] + s["%B"] = Calendar._MN[m]; // full month name + // FIXME: %c : preferred date and time representation for the current locale + s["%C"] = 1 + Math.floor(y / 100); // the century number + s["%d"] = (d < 10) ? ("0" + d) : d; // the day of the month (range 01 to 31) + s["%e"] = d; // the day of the month (range 1 to 31) + // FIXME: %D : american date style: %m/%d/%y + // FIXME: %E, %F, %G, %g, %h (man strftime) + s["%H"] = (hr < 10) ? ("0" + hr) : hr; // hour, range 00 to 23 (24h format) + s["%I"] = (ir < 10) ? ("0" + ir) : ir; // hour, range 01 to 12 (12h format) + s["%j"] = (dy < 100) ? ((dy < 10) ? ("00" + dy) : ("0" + dy)) : dy; // day of the year (range 001 to 366) + s["%k"] = hr; // hour, range 0 to 23 (24h format) + s["%l"] = ir; // hour, range 1 to 12 (12h format) + s["%m"] = (m < 9) ? ("0" + (1+m)) : (1+m); // month, range 01 to 12 + s["%M"] = (min < 10) ? ("0" + min) : min; // minute, range 00 to 59 + s["%n"] = "\n"; // a newline character + s["%p"] = pm ? "PM" : "AM"; + s["%P"] = pm ? "pm" : "am"; + // FIXME: %r : the time in am/pm notation %I:%M:%S %p + // FIXME: %R : the time in 24-hour notation %H:%M + s["%s"] = Math.floor(this.getTime() / 1000); + s["%S"] = (sec < 10) ? ("0" + sec) : sec; // seconds, range 00 to 59 + s["%t"] = "\t"; // a tab character + // FIXME: %T : the time in 24-hour notation (%H:%M:%S) + s["%U"] = s["%W"] = s["%V"] = (wn < 10) ? ("0" + wn) : wn; + s["%u"] = w + 1; // the day of the week (range 1 to 7, 1 = MON) + s["%w"] = w; // the day of the week (range 0 to 6, 0 = SUN) + // FIXME: %x : preferred date representation for the current locale without the time + // FIXME: %X : preferred time representation for the current locale without the date + s["%y"] = ('' + y).substr(2, 2); // year without the century (range 00 to 99) + s["%Y"] = y; // year with the century + s["%%"] = "%"; // a literal '%' character + + var re = /%./g; + if (!Calendar.is_ie5 && !Calendar.is_khtml) + return str.replace(re, function (par) { return s[par] || par; }); + + var a = str.match(re); + for (var i = 0; i < a.length; i++) { + var tmp = s[a[i]]; + if (tmp) { + re = new RegExp(a[i], 'g'); + str = str.replace(re, tmp); + } + } + + return str; +}; + +Date.prototype.__msh_oldSetFullYear = Date.prototype.setFullYear; +Date.prototype.setFullYear = function(y) { + var d = new Date(this); + d.__msh_oldSetFullYear(y); + if (d.getMonth() != this.getMonth()) + this.setDate(28); + this.__msh_oldSetFullYear(y); +}; + +// END: DATE OBJECT PATCHES + + +// global object that remembers the calendar +window._dynarch_popupCalendar = null; diff --git a/posterita/posterita/web/javascripts/modalbox.js b/posterita/posterita/web/javascripts/modalbox.js new file mode 100644 index 0000000000..af29091ba4 --- /dev/null +++ b/posterita/posterita/web/javascripts/modalbox.js @@ -0,0 +1,573 @@ +/* +ModalBox - The pop-up window thingie with AJAX, based on prototype and script.aculo.us. + +Copyright Andrey Okonetchnikov (andrej.okonetschnikow@gmail.com), 2006-2007 +All rights reserved. + +VERSION 1.6.0 +Last Modified: 12/13/2007 +*/ + +if (!window.Modalbox) + var Modalbox = new Object(); + +Modalbox.Methods = { + overrideAlert: false, // Override standard browser alert message with ModalBox + focusableElements: new Array, + currFocused: 0, + initialized: false, + active: true, + options: { + title: "ModalBox Window", // Title of the ModalBox window + overlayClose: true, // Close modal box by clicking on overlay + width: 500, // Default width in px + height: 90, // Default height in px + overlayOpacity: .65, // Default overlay opacity + overlayDuration: .25, // Default overlay fade in/out duration in seconds + slideDownDuration: .5, // Default Modalbox appear slide down effect in seconds + slideUpDuration: .5, // Default Modalbox hiding slide up effect in seconds + resizeDuration: .25, // Default resize duration seconds + inactiveFade: true, // Fades MB window on inactive state + transitions: true, // Toggles transition effects. Transitions are enabled by default + loadingString: "Please wait. Loading...", // Default loading string message + closeString: "Close window", // Default title attribute for close window link + closeValue: "×", // Default string for close link in the header + params: {}, + method: 'get', // Default Ajax request method + autoFocusing: true, // Toggles auto-focusing for form elements. Disable for long text pages. + aspnet: false // Should be use then using with ASP.NET costrols. Then true Modalbox window will be injected into the first form element. + }, + _options: new Object, + + setOptions: function(options) { + Object.extend(this.options, options || {}); + }, + + _init: function(options) { + // Setting up original options with default options + Object.extend(this._options, this.options); + this.setOptions(options); + + //Create the overlay + this.MBoverlay = new Element("div", { id: "MB_overlay", opacity: "0" }); + + //Create DOm for the window + this.MBwindow = new Element("div", {id: "MB_window", style: "display: none"}).update( + this.MBframe = new Element("div", {id: "MB_frame"}).update( + this.MBheader = new Element("div", {id: "MB_header"}).update( + this.MBcaption = new Element("div", {id: "MB_caption"}) + ) + ) + ); + this.MBclose = new Element("a", {id: "MB_close", title: this.options.closeString, href: "#"}).update("" + this.options.closeValue + ""); + this.MBheader.insert({'bottom':this.MBclose}); + + this.MBcontent = new Element("div", {id: "MB_content"}).update( + this.MBloading = new Element("div", {id: "MB_loading"}).update(this.options.loadingString) + ); + this.MBframe.insert({'bottom':this.MBcontent}); + + // Inserting into DOM. If parameter set and form element have been found will inject into it. Otherwise will inject into body as topmost element. + // Be sure to set padding and marging to null via CSS for both body and (in case of asp.net) form elements. + var injectToEl = this.options.aspnet ? $(document.body).down('form') : $(document.body); + injectToEl.insert({'top':this.MBwindow}); + injectToEl.insert({'top':this.MBoverlay}); + + // Initial scrolling position of the window. To be used for remove scrolling effect during ModalBox appearing + this.initScrollX = window.pageXOffset || document.body.scrollLeft || document.documentElement.scrollLeft; + this.initScrollY = window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop; + + //Adding event observers + this.hideObserver = this._hide.bindAsEventListener(this); + this.kbdObserver = this._kbdHandler.bindAsEventListener(this); + this._initObservers(); + + this.initialized = true; // Mark as initialized + }, + + show: function(content, options) { + if(!this.initialized) this._init(options); // Check for is already initialized + + this.content = content; + this.setOptions(options); + + if(this.options.title) // Updating title of the MB + $(this.MBcaption).update(this.options.title); + else { // If title isn't given, the header will not displayed + $(this.MBheader).hide(); + $(this.MBcaption).hide(); + } + + if(this.MBwindow.style.display == "none") { // First modal box appearing + this._appear(); + this.event("onShow"); // Passing onShow callback + } + else { // If MB already on the screen, update it + this._update(); + this.event("onUpdate"); // Passing onUpdate callback + } + }, + + hide: function(options) { // External hide method to use from external HTML and JS + if(this.initialized) { + // Reading for options/callbacks except if event given as a pararmeter + if(options && typeof options.element != 'function') Object.extend(this.options, options); + // Passing beforeHide callback + this.event("beforeHide"); + if(this.options.transitions) + Effect.SlideUp(this.MBwindow, { duration: this.options.slideUpDuration, transition: Effect.Transitions.sinoidal, afterFinish: this._deinit.bind(this) } ); + else { + $(this.MBwindow).hide(); + this._deinit(); + } + } else throw("Modalbox is not initialized."); + }, + + _hide: function(event) { // Internal hide method to use with overlay and close link + event.stop(); // Stop event propaganation for link elements + /* Then clicked on overlay we'll check the option and in case of overlayClose == false we'll break hiding execution [Fix for #139] */ + if(event.element().id == 'MB_overlay' && !this.options.overlayClose) return false; + this.hide(); + }, + + alert: function(message){ + var html = '

    ' + message + '

    '; + Modalbox.show(html, {title: 'Alert: ' + document.title, width: 300}); + }, + + _appear: function() { // First appearing of MB + if(Prototype.Browser.IE && !navigator.appVersion.match(/\b7.0\b/)) { // Preparing IE 6 for showing modalbox + window.scrollTo(0,0); + this._prepareIE("100%", "hidden"); + } + this._setWidth(); + this._setPosition(); + if(this.options.transitions) { + $(this.MBoverlay).setStyle({opacity: 0}); + new Effect.Fade(this.MBoverlay, { + from: 0, + to: this.options.overlayOpacity, + duration: this.options.overlayDuration, + afterFinish: function() { + new Effect.SlideDown(this.MBwindow, { + duration: this.options.slideDownDuration, + transition: Effect.Transitions.sinoidal, + afterFinish: function(){ + this._setPosition(); + this.loadContent(); + }.bind(this) + }); + }.bind(this) + }); + } else { + $(this.MBoverlay).setStyle({opacity: this.options.overlayOpacity}); + $(this.MBwindow).show(); + this._setPosition(); + this.loadContent(); + } + this._setWidthAndPosition = this._setWidthAndPosition.bindAsEventListener(this); + Event.observe(window, "resize", this._setWidthAndPosition); + }, + + resize: function(byWidth, byHeight, options) { // Change size of MB without loading content + var wHeight = $(this.MBwindow).getHeight(); + var wWidth = $(this.MBwindow).getWidth(); + var hHeight = $(this.MBheader).getHeight(); + var cHeight = $(this.MBcontent).getHeight(); + var newHeight = ((wHeight - hHeight + byHeight) < cHeight) ? (cHeight + hHeight - wHeight) : byHeight; + if(options) this.setOptions(options); // Passing callbacks + if(this.options.transitions) { + new Effect.ScaleBy(this.MBwindow, byWidth, newHeight, { + duration: this.options.resizeDuration, + afterFinish: function() { + this.event("_afterResize"); // Passing internal callback + this.event("afterResize"); // Passing callback + }.bind(this) + }); + } else { + this.MBwindow.setStyle({width: wWidth + byWidth + "px", height: wHeight + newHeight + "px"}); + setTimeout(function() { + this.event("_afterResize"); // Passing internal callback + this.event("afterResize"); // Passing callback + }.bind(this), 1); + + } + + }, + + resizeToContent: function(options){ + + // Resizes the modalbox window to the actual content height. + // This might be useful to resize modalbox after some content modifications which were changed ccontent height. + + var byHeight = this.options.height - this.MBwindow.offsetHeight; + if(byHeight != 0) { + if(options) this.setOptions(options); // Passing callbacks + Modalbox.resize(0, byHeight); + } + }, + + resizeToInclude: function(element, options){ + + // Resizes the modalbox window to the camulative height of element. Calculations are using CSS properties for margins and border. + // This method might be useful to resize modalbox before including or updating content. + + var el = $(element); + var elHeight = el.getHeight() + parseInt(el.getStyle('margin-top')) + parseInt(el.getStyle('margin-bottom')) + parseInt(el.getStyle('border-top-width')) + parseInt(el.getStyle('border-bottom-width')); + if(elHeight > 0) { + if(options) this.setOptions(options); // Passing callbacks + Modalbox.resize(0, elHeight); + } + }, + + _update: function() { // Updating MB in case of wizards + $(this.MBcontent).update(""); + this.MBcontent.appendChild(this.MBloading); + $(this.MBloading).update(this.options.loadingString); + this.currentDims = [this.MBwindow.offsetWidth, this.MBwindow.offsetHeight]; + Modalbox.resize((this.options.width - this.currentDims[0]), (this.options.height - this.currentDims[1]), {_afterResize: this._loadAfterResize.bind(this) }); + }, + + loadContent: function () { + if(this.event("beforeLoad") != false) { // If callback passed false, skip loading of the content + if(typeof this.content == 'string') { + var htmlRegExp = new RegExp(/<\/?[^>]+>/gi); + if(htmlRegExp.test(this.content)) { // Plain HTML given as a parameter + this._insertContent(this.content.stripScripts()); + this._putContent(function(){ + this.content.extractScripts().map(function(script) { + return eval(script.replace("", "")); + }.bind(window)); + }.bind(this)); + } else // URL given as a parameter. We'll request it via Ajax + new Ajax.Request( this.content, { method: this.options.method.toLowerCase(), parameters: this.options.params, + onSuccess: function(transport) { + var response = new String(transport.responseText); + this._insertContent(transport.responseText.stripScripts()); + this._putContent(function(){ + response.extractScripts().map(function(script) { + return eval(script.replace("", "")); + }.bind(window)); + }); + }.bind(this), + onException: function(instance, exception){ + Modalbox.hide(); + throw('Modalbox Loading Error: ' + exception); + } + }); + + } else if (typeof this.content == 'object') {// HTML Object is given + this._insertContent(this.content); + this._putContent(); + } else { + Modalbox.hide(); + throw('Modalbox Parameters Error: Please specify correct URL or HTML element (plain HTML or object)'); + } + } + }, + + _insertContent: function(content){ + $(this.MBcontent).hide().update(""); + if(typeof content == 'string') { + setTimeout(function() { // Hack to disable content flickering in Firefox + this.MBcontent.update(content); + }.bind(this), 1); + } else if (typeof content == 'object') { // HTML Object is given + var _htmlObj = content.cloneNode(true); // If node already a part of DOM we'll clone it + // If clonable element has ID attribute defined, modifying it to prevent duplicates + if(content.id) content.id = "MB_" + content.id; + /* Add prefix for IDs on all elements inside the DOM node */ + $(content).select('*[id]').each(function(el){ el.id = "MB_" + el.id; }); + this.MBcontent.appendChild(_htmlObj); + this.MBcontent.down().show(); // Toggle visibility for hidden nodes + if(Prototype.Browser.IE) // Toggling back visibility for hidden selects in IE + $$("#MB_content select").invoke('setStyle', {'visibility': ''}); + } + }, + + _putContent: function(callback){ + // Prepare and resize modal box for content + if(this.options.height == this._options.height) { + setTimeout(function() { // MSIE sometimes doesn't display content correctly + Modalbox.resize(0, $(this.MBcontent).getHeight() - $(this.MBwindow).getHeight() + $(this.MBheader).getHeight(), { + afterResize: function(){ + this.MBcontent.show().makePositioned(); + this.focusableElements = this._findFocusableElements(); + this._setFocus(); // Setting focus on first 'focusable' element in content (input, select, textarea, link or button) + setTimeout(function(){ // MSIE fix + if(callback != undefined) + callback(); // Executing internal JS from loaded content + this.event("afterLoad"); // Passing callback + }.bind(this),1); + }.bind(this) + }); + }.bind(this), 1); + } else { // Height is defined. Creating a scrollable window + this._setWidth(); + this.MBcontent.setStyle({overflow: 'auto', height: $(this.MBwindow).getHeight() - $(this.MBheader).getHeight() - 13 + 'px'}); + this.MBcontent.show(); + this.focusableElements = this._findFocusableElements(); + this._setFocus(); // Setting focus on first 'focusable' element in content (input, select, textarea, link or button) + setTimeout(function(){ // MSIE fix + if(callback != undefined) + callback(); // Executing internal JS from loaded content + this.event("afterLoad"); // Passing callback + }.bind(this),1); + } + }, + + activate: function(options){ + this.setOptions(options); + this.active = true; + $(this.MBclose).observe("click", this.hideObserver); + if(this.options.overlayClose) + $(this.MBoverlay).observe("click", this.hideObserver); + $(this.MBclose).show(); + if(this.options.transitions && this.options.inactiveFade) + new Effect.Appear(this.MBwindow, {duration: this.options.slideUpDuration}); + }, + + deactivate: function(options) { + this.setOptions(options); + this.active = false; + $(this.MBclose).stopObserving("click", this.hideObserver); + if(this.options.overlayClose) + $(this.MBoverlay).stopObserving("click", this.hideObserver); + $(this.MBclose).hide(); + if(this.options.transitions && this.options.inactiveFade) + new Effect.Fade(this.MBwindow, {duration: this.options.slideUpDuration, to: .75}); + }, + + _initObservers: function(){ + $(this.MBclose).observe("click", this.hideObserver); + if(this.options.overlayClose) + $(this.MBoverlay).observe("click", this.hideObserver); + if(Prototype.Browser.IE) + Event.observe(document, "keydown", this.kbdObserver); + else + Event.observe(document, "keypress", this.kbdObserver); + }, + + _removeObservers: function(){ + $(this.MBclose).stopObserving("click", this.hideObserver); + if(this.options.overlayClose) + $(this.MBoverlay).stopObserving("click", this.hideObserver); + if(Prototype.Browser.IE) + Event.stopObserving(document, "keydown", this.kbdObserver); + else + Event.stopObserving(document, "keypress", this.kbdObserver); + }, + + _loadAfterResize: function() { + this._setWidth(); + this._setPosition(); + this.loadContent(); + }, + + _setFocus: function() { + /* Setting focus to the first 'focusable' element which is one with tabindex = 1 or the first in the form loaded. */ + if(this.focusableElements.length > 0 && this.options.autoFocusing == true) { + var firstEl = this.focusableElements.find(function (el){ + return el.tabIndex == 1; + }) || this.focusableElements.first(); + this.currFocused = this.focusableElements.toArray().indexOf(firstEl); + firstEl.focus(); // Focus on first focusable element except close button + } else if($(this.MBclose).visible()) + $(this.MBclose).focus(); // If no focusable elements exist focus on close button + }, + + _findFocusableElements: function(){ // Collect form elements or links from MB content + this.MBcontent.select('input:not([type~=hidden]), select, textarea, button, a[href]').invoke('addClassName', 'MB_focusable'); + return this.MBcontent.select('.MB_focusable'); + }, + + _kbdHandler: function(event) { + var node = event.element(); + switch(event.keyCode) { + case Event.KEY_TAB: + event.stop(); + + /* Switching currFocused to the element which was focused by mouse instead of TAB-key. Fix for #134 */ + if(node != this.focusableElements[this.currFocused]) + this.currFocused = this.focusableElements.toArray().indexOf(node); + + if(!event.shiftKey) { //Focusing in direct order + if(this.currFocused == this.focusableElements.length - 1) { + this.focusableElements.first().focus(); + this.currFocused = 0; + } else { + this.currFocused++; + this.focusableElements[this.currFocused].focus(); + } + } else { // Shift key is pressed. Focusing in reverse order + if(this.currFocused == 0) { + this.focusableElements.last().focus(); + this.currFocused = this.focusableElements.length - 1; + } else { + this.currFocused--; + this.focusableElements[this.currFocused].focus(); + } + } + break; + case Event.KEY_ESC: + if(this.active) this._hide(event); + break; + case 32: + this._preventScroll(event); + break; + case 0: // For Gecko browsers compatibility + if(event.which == 32) this._preventScroll(event); + break; + case Event.KEY_UP: + case Event.KEY_DOWN: + case Event.KEY_PAGEDOWN: + case Event.KEY_PAGEUP: + case Event.KEY_HOME: + case Event.KEY_END: + // Safari operates in slightly different way. This realization is still buggy in Safari. + if(Prototype.Browser.WebKit && !["textarea", "select"].include(node.tagName.toLowerCase())) + event.stop(); + else if( (node.tagName.toLowerCase() == "input" && ["submit", "button"].include(node.type)) || (node.tagName.toLowerCase() == "a") ) + event.stop(); + break; + } + }, + + _preventScroll: function(event) { // Disabling scrolling by "space" key + if(!["input", "textarea", "select", "button"].include(event.element().tagName.toLowerCase())) + event.stop(); + }, + + _deinit: function() + { + this._removeObservers(); + Event.stopObserving(window, "resize", this._setWidthAndPosition ); + if(this.options.transitions) { + Effect.toggle(this.MBoverlay, 'appear', {duration: this.options.overlayDuration, afterFinish: this._removeElements.bind(this) }); + } else { + this.MBoverlay.hide(); + this._removeElements(); + } + $(this.MBcontent).setStyle({overflow: '', height: ''}); + }, + + _removeElements: function () { + $(this.MBoverlay).remove(); + $(this.MBwindow).remove(); + if(Prototype.Browser.IE && !navigator.appVersion.match(/\b7.0\b/)) { + this._prepareIE("", ""); // If set to auto MSIE will show horizontal scrolling + window.scrollTo(this.initScrollX, this.initScrollY); + } + + /* Replacing prefixes 'MB_' in IDs for the original content */ + if(typeof this.content == 'object') { + if(this.content.id && this.content.id.match(/MB_/)) { + this.content.id = this.content.id.replace(/MB_/, ""); + } + this.content.select('*[id]').each(function(el){ el.id = el.id.replace(/MB_/, ""); }); + } + /* Initialized will be set to false */ + this.initialized = false; + this.event("afterHide"); // Passing afterHide callback + this.setOptions(this._options); //Settings options object into intial state + }, + + _setWidth: function () { //Set size + $(this.MBwindow).setStyle({width: this.options.width + "px", height: this.options.height + "px"}); + }, + + _setPosition: function () { + $(this.MBwindow).setStyle({left: Math.round((Element.getWidth(document.body) - Element.getWidth(this.MBwindow)) / 2 ) + "px"}); + }, + + _setWidthAndPosition: function () { + $(this.MBwindow).setStyle({width: this.options.width + "px"}); + this._setPosition(); + }, + + _getScrollTop: function () { //From: http://www.quirksmode.org/js/doctypes.html + var theTop; + if (document.documentElement && document.documentElement.scrollTop) + theTop = document.documentElement.scrollTop; + else if (document.body) + theTop = document.body.scrollTop; + return theTop; + }, + _prepareIE: function(height, overflow){ + $$('html, body').invoke('setStyle', {width: height, height: height, overflow: overflow}); // IE requires width and height set to 100% and overflow hidden + $$("select").invoke('setStyle', {'visibility': overflow}); // Toggle visibility for all selects in the common document + }, + event: function(eventName) { + if(this.options[eventName]) { + var returnValue = this.options[eventName](); // Executing callback + this.options[eventName] = null; // Removing callback after execution + if(returnValue != undefined) + return returnValue; + else + return true; + } + return true; + } +}; + +Object.extend(Modalbox, Modalbox.Methods); + +if(Modalbox.overrideAlert) window.alert = Modalbox.alert; + +Effect.ScaleBy = Class.create(); +Object.extend(Object.extend(Effect.ScaleBy.prototype, Effect.Base.prototype), { + initialize: function(element, byWidth, byHeight, options) { + this.element = $(element) + var options = Object.extend({ + scaleFromTop: true, + scaleMode: 'box', // 'box' or 'contents' or {} with provided values + scaleByWidth: byWidth, + scaleByHeight: byHeight + }, arguments[3] || {}); + this.start(options); + }, + setup: function() { + this.elementPositioning = this.element.getStyle('position'); + + this.originalTop = this.element.offsetTop; + this.originalLeft = this.element.offsetLeft; + + this.dims = null; + if(this.options.scaleMode=='box') + this.dims = [this.element.offsetHeight, this.element.offsetWidth]; + if(/^content/.test(this.options.scaleMode)) + this.dims = [this.element.scrollHeight, this.element.scrollWidth]; + if(!this.dims) + this.dims = [this.options.scaleMode.originalHeight, + this.options.scaleMode.originalWidth]; + + this.deltaY = this.options.scaleByHeight; + this.deltaX = this.options.scaleByWidth; + }, + update: function(position) { + var currentHeight = this.dims[0] + (this.deltaY * position); + var currentWidth = this.dims[1] + (this.deltaX * position); + + currentHeight = (currentHeight > 0) ? currentHeight : 0; + currentWidth = (currentWidth > 0) ? currentWidth : 0; + + this.setDimensions(currentHeight, currentWidth); + }, + + setDimensions: function(height, width) { + var d = {}; + d.width = width + 'px'; + d.height = height + 'px'; + + var topd = Math.round((height - this.dims[0])/2); + var leftd = Math.round((width - this.dims[1])/2); + if(this.elementPositioning == 'absolute' || this.elementPositioning == 'fixed') { + if(!this.options.scaleFromTop) d.top = this.originalTop-topd + 'px'; + d.left = this.originalLeft-leftd + 'px'; + } else { + if(!this.options.scaleFromTop) d.top = -topd + 'px'; + d.left = -leftd + 'px'; + } + this.element.setStyle(d); + } +}); \ No newline at end of file diff --git a/posterita/posterita/web/javascripts/popup.js b/posterita/posterita/web/javascripts/popup.js new file mode 100644 index 0000000000..8a50083090 --- /dev/null +++ b/posterita/posterita/web/javascripts/popup.js @@ -0,0 +1,470 @@ +/* + popup.js + + A lightweight general purpose JavaScript DOM element popup class. + + Webpage: + http;//www.methods.co.nz/popup/popup.html + + Inspired by: + Lightbox2: http://www.huddletogether.com/projects/lightbox2/ + Lightbox Gone Wild: http://particletree.com/features/lightbox-gone-wild/ + Tooltip: http://blog.innerewut.de/pages/tooltip + Prototype library: http://www.prototypejs.org/ + Scriptaculous library: http://script.aculo.us/ + + Attributions: + - Uses the getPageSize() function from Lightbox v2.02 by Lokesh Dhakar + (http://www.huddletogether.com/projects/lightbox2/). + - Adapted the the modal overlay technique used in Lightbox v2.02 by Lokesh + Dhakar (http://www.huddletogether.com/projects/lightbox2/). + + Version: 1.0.1 + + Author: Stuart Rackham + License: This source code is released under the MIT license. + + Copyright (c) Stuart Rackham 2007 + +*/ + +var Popup = Class.create(); +Popup.zIndex = 1000; // z-index of first popup. + +Popup.prototype = { + + /* + Popup creation + */ + initialize: function(popup, link) { + var options = Object.extend({ + modal: false, + effect: 'fade', + hidden: true, + closebox: 'popup_closebox', // CSS class name of click-to-close elements. + draghandle: 'popup_draghandle' // CSS class name of drag handle elements. + }, arguments[2] || {}); + options.position = options.position || (options.modal ? 'center' : 'auto'); + options.trigger = options.trigger || (options.modal ? 'click' : 'mouseover'); + options.duration = this.first_value(options.duration, Popup.duration, 0.5); + options.show_duration = this.first_value(options.show_duration, options.duration); + options.hide_duration = this.first_value(options.hide_duration, options.duration); + options.opacity = this.first_value(options.opacity, Popup.opacity, 0.5); + options.show_delay = this.first_value(options.show_delay, Popup.show_delay, 500); + options.hide_delay = this.first_value(options.hide_delay, Popup.hide_delay, 200); + options.cursor_margin = this.first_value(options.cursor_margin, Popup.cursor_margin, 5); + this.options = options; + if (link) { + this.link = $(link); + } + this.popup = $(popup); + this.popup.popup = this; // Make the popup object a property of the DOM popup element. + if (options.hidden) { + this.popup.hide(); + } + if (options.closebox) { + this.closeboxes = document.getElementsByClassName(options.closebox, this.popup); + if (this.popup.hasClassName(options.closebox)) { + this.closeboxes[this.closeboxes.length] = this.popup; + } + } + else { + this.closeboxes = []; + } + if (options.draghandle) { + var draghandles = document.getElementsByClassName(options.draghandle, this.popup); + for (i = 0; i < draghandles.length; i++) { + new Draggable(this.popup, { handle: draghandles[i] }); + } + if (this.popup.hasClassName(options.draghandle)) { + new Draggable(this.popup, { handle: this.popup }); + } + } + this.register_events(); + }, + + + /* + Event functions + */ + + register_events: function() { + var trigger_function; + if (this.is_auto_open()) { + trigger_function = this.start_show_timer; + if (this.link) { + Event.observe(this.link, 'mouseout', this.stop_show_timer.bindAsEventListener(this)); + } + } + else { + trigger_function = this.show; + } + if (this.link) { + Event.observe(this.link, this.options.trigger, trigger_function.bindAsEventListener(this)); + } + if (!this.options.modal) { + Event.observe(this.popup, 'click', this.bring_to_front.bindAsEventListener(this)); + } + if (this.closeboxes.length > 0) { + for (var i = 0; i < this.closeboxes.length; i++) { + Event.observe(this.closeboxes[i], 'click', this.hide.bindAsEventListener(this)); + } + } + else { + if (this.link) { + Event.observe(this.link, 'mouseout', this.start_hide_timer.bindAsEventListener(this)); + } + Event.observe(this.popup, 'mouseover', this.stop_hide_timer.bindAsEventListener(this)); + Event.observe(this.popup, 'mouseout', this.start_hide_timer.bindAsEventListener(this)); + } + }, + + bring_to_front: function(event) { + // Bring to front if not already there. + if (Number(this.popup.style.zIndex) < Popup.zIndex - 1) { + this.popup.style.zIndex = Popup.zIndex++; + } + }, + + start_show_timer: function(event) { + // NOTE: event is bound to this.show but it's state changes between being + // bound here and arriving at this.show -- specifically, the mouse + // coordinates are reset to zero). I've no idea why. Anyway, this is the + // reason for passing the event mouse coordinates as properties of this. + this.stop_show_timer(event); + this.mouse_x = Event.pointerX(event); + this.mouse_y = Event.pointerY(event); + this.show_timer = setTimeout(this.show.bind(this, event), this.options.show_delay); + }, + + stop_show_timer: function(event) { + if (this.show_timer) { + clearTimeout(this.show_timer); + this.show_timer = null; + } + }, + + start_hide_timer: function(event) { + this.stop_hide_timer(event); + this.hide_timer = setTimeout(this.hide.bind(this, event), this.options.hide_delay); + }, + + stop_hide_timer: function(event) { + if (this.hide_timer) { + clearTimeout(this.hide_timer); + this.hide_timer = null; + } + }, + + show: function(event) { + this.stop_show_timer(event); + this.stop_hide_timer(event); + if (this.is_open) { + return; + } + if (this.options.modal) { + this.show_overlay(); + } + var pos; + if (!event) { + // We only arrive here if this.show has been called externally. + pos = this.get_popup_position(); + } + else if (this.is_auto_open()) { + // Because auto-open popups calls this.show indirectly via start_show_timer. + pos = this.get_popup_position(this.mouse_x, this.mouse_y); + } + else { + pos = this.get_popup_position(Event.pointerX(event), Event.pointerY(event)); + } + Element.setStyle(this.popup, { top: pos.y, left: pos.x, zIndex: Popup.zIndex++ }); + this.is_open = true; + switch (this.options.effect) { + case 'slide': + Effect.SlideDown(this.popup, {duration: this.options.show_duration}); + break; + case 'grow': + Effect.Grow(this.popup, {duration: this.options.show_duration}); + break; + case 'blind': + Effect.BlindDown(this.popup, {duration: this.options.show_duration}); + break; + case 'fade': + default: + Effect.Appear(this.popup, {duration: this.options.show_duration}); + break; + } + }, + + hide: function(event){ + this.is_open = false; + switch (this.options.effect) { + case 'slide': + Effect.SlideUp(this.popup, {duration: this.options.hide_duration}); + break; + case 'grow': + Effect.Shrink(this.popup, {duration: this.options.hide_duration}); + break; + case 'blind': + Effect.BlindUp(this.popup, {duration: this.options.hide_duration}); + break; + case 'fade': + default: + Effect.Fade(this.popup, {duration: this.options.hide_duration}); + break; + } + if (this.options.modal) { + this.hide_overlay(); + } + }, + + + /* + Helper functions + */ + + // Return the first function argument that is not undefined. + // Because when zero numerical value are possible you can't use || chains. + first_value: function() { + for (var i = 0; i < arguments.length; i++) { + if (arguments[i] !== undefined) { + return arguments[i]; + } + } + return undefined; + }, + + is_auto_open: function() { + return this.options.trigger == 'mouseover'; + }, + + show_overlay: function() { + if (!Popup.overlay) { + var overlay = document.createElement('div'); + overlay.setAttribute('id','popup_overlay'); + overlay.style.display = 'none'; + document.body.appendChild(overlay); + Popup.overlay = overlay; + Popup.overlay_levels = []; + } + Popup.overlay.style.height = this.get_page_dimensions().height + 'px'; + var z = Popup.zIndex++; + Popup.overlay.style.zIndex = z; + Popup.overlay_levels.push(z); + if ( Popup.overlay_levels.length == 1) { // Opening the first modal popup. + // Queue the global overlay effect to ensure correct execution order. + new Effect.Appear(Popup.overlay, + { duration: this.options.show_duration, + to: this.options.opacity, + queue: {position: 'end', scope: 'popup_overlay'} + }); + } + else { // There is another modal popup at a lower level so move the overlay forward. + Popup.overlay.style.zIndex = z; + } + }, + + hide_overlay: function() { + Popup.overlay_levels.pop(); + var z = Popup.overlay_levels.pop(); + if (z) { // There is another modal popup at a lower level so move the overlay back. + Popup.overlay_levels.push(z); + Popup.overlay.style.zIndex = z; + } + else { // The last modal popup is being closed so hide the overlay + // Queue the global overlay effect to ensure correct execution order. + new Effect.Fade(Popup.overlay, + { duration: this.options.hide_duration, + queue: {position: 'end', scope: 'popup_overlay'} + }); + } + }, + + + /* + Positioning functions + */ + + // Return the top and left CSS position strings as an {x,y} object that the + // popup should be shown at. mouse_x and mouse_y are the mouse x,y coordinates + // numbers when the popup was triggered. + get_popup_position: function(mouse_x, mouse_y) { + var pos; + switch (this.options.position) { + case 'auto': + pos = this.get_auto_position(mouse_x, mouse_y); + break; + case 'center': + pos = this.get_center_position(); + break; + case 'below': + pos = this.get_below_position(); + break; + default: + // Check for x,y postion format (x and y can be any valid CSS left or + // top property value). + if (mo = this.options.position.match(/^\s*([^\s,]+)\s*,\s*([^\s,]+)\s*$/)) { + pos = {x: mo[1], y: mo[2]}; + // If possible convert to numbers. + pos.x = Number(pos.x) || pos.x; + pos.y = Number(pos.y) || pos.y; + } + else { + pos = {x: 0, y: 0}; + } + break; + } + if (typeof pos.x == 'number') { + pos.x += 'px'; + } + if (typeof pos.y == 'number') { + pos.y += 'px'; + } + return pos; + }, + + get_below_position: function() { + var pos = Position.cumulativeOffset(this.link); + return {x: pos[0], y: pos[1] + Element.getHeight(this.link)}; + }, + + get_center_position: function() { + dim = Element.getDimensions(this.popup); + var popup_width = dim.width; + var popup_height = dim.height; + dim = this.get_viewport_dimensions(); + var viewport_width = dim.width; + var viewport_height = dim.height; + + var x; + if (popup_width >= viewport_width) { + x = 0; + } + else { + x = (viewport_width - popup_width)/2; + } + + var y; + if (popup_height >= viewport_height) { + y = 0; + } + else { + y = (viewport_height - popup_height)/2; + } + + return {x: x, y: y}; + }, + + get_auto_position: function(mouse_x, mouse_y) { + dim = Element.getDimensions(this.popup); + var popup_width = dim.width; + var popup_height = dim.height; + dim = this.get_viewport_dimensions(); + var viewport_width = dim.width; + var viewport_height = dim.height; + + var available_right = viewport_width - (mouse_x + this.options.cursor_margin); + var available_left = mouse_x - this.options.cursor_margin; + var available_top = mouse_y - this.options.cursor_margin; + var available_bottom = viewport_height - (mouse_x + this.options.cursor_margin); + var offset = this.options.cursor_margin; + var x = mouse_x; + var y = mouse_y; + + if (popup_width >= viewport_width) { + x = 0; + } + else if (popup_width <= available_right) { + x += offset; + } + else if (popup_width <= available_left) { + x -= popup_width + offset; + } + else if (available_right >= available_left) { + x = viewport_width - popup_width; + } + else { + x = 0; + } + + if (popup_height >= viewport_height) { + y = 0; + } + else if (popup_height <= available_bottom) { + y += offset; + } + else if (popup_height <= available_top) { + y -= popup_height + offset; + } + else if (available_bottom >= available_top) { + y = viewport_height - popup_height; + } + else { + y = 0; + } + + return {x: x, y: y}; + }, + + get_viewport_dimensions: function() { + var dim = this.getPageSize(); + return {width: dim[2], height: dim[3]}; + }, + + get_page_dimensions: function() { + var dim = this.getPageSize(); + return {width: dim[0], height: dim[1]}; + }, + + // This function from Lightbox v2.02 by Lokesh Dhakar + // (http://www.huddletogether.com/projects/lightbox2/). + // + // Returns array with page width, height and window width, height + // Core code from - quirksmode.org + // Edit for Firefox by pHaez + // + getPageSize: function() { + var xScroll, yScroll; + + if (window.innerHeight && window.scrollMaxY) { + xScroll = document.body.scrollWidth; + yScroll = window.innerHeight + window.scrollMaxY; + } else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac + xScroll = document.body.scrollWidth; + yScroll = document.body.scrollHeight; + } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari + xScroll = document.body.offsetWidth; + yScroll = document.body.offsetHeight; + } + + var windowWidth, windowHeight; + if (self.innerHeight) { // all except Explorer + windowWidth = self.innerWidth; + windowHeight = self.innerHeight; + } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode + windowWidth = document.documentElement.clientWidth; + windowHeight = document.documentElement.clientHeight; + } else if (document.body) { // other Explorers + windowWidth = document.body.clientWidth; + windowHeight = document.body.clientHeight; + } + + // for small pages with total height less then height of the viewport + if(yScroll < windowHeight){ + pageHeight = windowHeight; + } else { + pageHeight = yScroll; + } + + // for small pages with total width less then width of the viewport + if(xScroll < windowWidth){ + pageWidth = windowWidth; + } else { + pageWidth = xScroll; + } + + arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight); + return arrayPageSize; + } + +} diff --git a/posterita/posterita/web/javascripts/prototype.js b/posterita/posterita/web/javascripts/prototype.js new file mode 100644 index 0000000000..8613914b1a --- /dev/null +++ b/posterita/posterita/web/javascripts/prototype.js @@ -0,0 +1,4170 @@ +/* Prototype JavaScript framework, version 1.6.0.1 + * (c) 2005-2007 Sam Stephenson + * + * Prototype is freely distributable under the terms of an MIT-style license. + * For details, see the Prototype web site: http://www.prototypejs.org/ + * + *--------------------------------------------------------------------------*/ + +var Prototype = { + Version: '1.6.0.1', + + Browser: { + IE: !!(window.attachEvent && !window.opera), + Opera: !!window.opera, + WebKit: navigator.userAgent.indexOf('AppleWebKit/') > -1, + Gecko: navigator.userAgent.indexOf('Gecko') > -1 && navigator.userAgent.indexOf('KHTML') == -1, + MobileSafari: !!navigator.userAgent.match(/Apple.*Mobile.*Safari/) + }, + + BrowserFeatures: { + XPath: !!document.evaluate, + ElementExtensions: !!window.HTMLElement, + SpecificElementExtensions: + document.createElement('div').__proto__ && + document.createElement('div').__proto__ !== + document.createElement('form').__proto__ + }, + + ScriptFragment: ']*>([\\S\\s]*?)<\/script>', + JSONFilter: /^\/\*-secure-([\s\S]*)\*\/\s*$/, + + emptyFunction: function() { }, + K: function(x) { return x } +}; + +if (Prototype.Browser.MobileSafari) + Prototype.BrowserFeatures.SpecificElementExtensions = false; + + +/* Based on Alex Arnell's inheritance implementation. */ +var Class = { + create: function() { + var parent = null, properties = $A(arguments); + if (Object.isFunction(properties[0])) + parent = properties.shift(); + + function klass() { + this.initialize.apply(this, arguments); + } + + Object.extend(klass, Class.Methods); + klass.superclass = parent; + klass.subclasses = []; + + if (parent) { + var subclass = function() { }; + subclass.prototype = parent.prototype; + klass.prototype = new subclass; + parent.subclasses.push(klass); + } + + for (var i = 0; i < properties.length; i++) + klass.addMethods(properties[i]); + + if (!klass.prototype.initialize) + klass.prototype.initialize = Prototype.emptyFunction; + + klass.prototype.constructor = klass; + + return klass; + } +}; + +Class.Methods = { + addMethods: function(source) { + var ancestor = this.superclass && this.superclass.prototype; + var properties = Object.keys(source); + + if (!Object.keys({ toString: true }).length) + properties.push("toString", "valueOf"); + + for (var i = 0, length = properties.length; i < length; i++) { + var property = properties[i], value = source[property]; + if (ancestor && Object.isFunction(value) && + value.argumentNames().first() == "$super") { + var method = value, value = Object.extend((function(m) { + return function() { return ancestor[m].apply(this, arguments) }; + })(property).wrap(method), { + valueOf: function() { return method }, + toString: function() { return method.toString() } + }); + } + this.prototype[property] = value; + } + + return this; + } +}; + +var Abstract = { }; + +Object.extend = function(destination, source) { + for (var property in source) + destination[property] = source[property]; + return destination; +}; + +Object.extend(Object, { + inspect: function(object) { + try { + if (Object.isUndefined(object)) return 'undefined'; + if (object === null) return 'null'; + return object.inspect ? object.inspect() : object.toString(); + } catch (e) { + if (e instanceof RangeError) return '...'; + throw e; + } + }, + + toJSON: function(object) { + var type = typeof object; + switch (type) { + case 'undefined': + case 'function': + case 'unknown': return; + case 'boolean': return object.toString(); + } + + if (object === null) return 'null'; + if (object.toJSON) return object.toJSON(); + if (Object.isElement(object)) return; + + var results = []; + for (var property in object) { + var value = Object.toJSON(object[property]); + if (!Object.isUndefined(value)) + results.push(property.toJSON() + ': ' + value); + } + + return '{' + results.join(', ') + '}'; + }, + + toQueryString: function(object) { + return $H(object).toQueryString(); + }, + + toHTML: function(object) { + return object && object.toHTML ? object.toHTML() : String.interpret(object); + }, + + keys: function(object) { + var keys = []; + for (var property in object) + keys.push(property); + return keys; + }, + + values: function(object) { + var values = []; + for (var property in object) + values.push(object[property]); + return values; + }, + + clone: function(object) { + return Object.extend({ }, object); + }, + + isElement: function(object) { + return object && object.nodeType == 1; + }, + + isArray: function(object) { + return object && object.constructor === Array; + }, + + isHash: function(object) { + return object instanceof Hash; + }, + + isFunction: function(object) { + return typeof object == "function"; + }, + + isString: function(object) { + return typeof object == "string"; + }, + + isNumber: function(object) { + return typeof object == "number"; + }, + + isUndefined: function(object) { + return typeof object == "undefined"; + } +}); + +Object.extend(Function.prototype, { + argumentNames: function() { + var names = this.toString().match(/^[\s\(]*function[^(]*\((.*?)\)/)[1].split(",").invoke("strip"); + return names.length == 1 && !names[0] ? [] : names; + }, + + bind: function() { + if (arguments.length < 2 && Object.isUndefined(arguments[0])) return this; + var __method = this, args = $A(arguments), object = args.shift(); + return function() { + return __method.apply(object, args.concat($A(arguments))); + } + }, + + bindAsEventListener: function() { + var __method = this, args = $A(arguments), object = args.shift(); + return function(event) { + return __method.apply(object, [event || window.event].concat(args)); + } + }, + + curry: function() { + if (!arguments.length) return this; + var __method = this, args = $A(arguments); + return function() { + return __method.apply(this, args.concat($A(arguments))); + } + }, + + delay: function() { + var __method = this, args = $A(arguments), timeout = args.shift() * 1000; + return window.setTimeout(function() { + return __method.apply(__method, args); + }, timeout); + }, + + wrap: function(wrapper) { + var __method = this; + return function() { + return wrapper.apply(this, [__method.bind(this)].concat($A(arguments))); + } + }, + + methodize: function() { + if (this._methodized) return this._methodized; + var __method = this; + return this._methodized = function() { + return __method.apply(null, [this].concat($A(arguments))); + }; + } +}); + +Function.prototype.defer = Function.prototype.delay.curry(0.01); + +Date.prototype.toJSON = function() { + return '"' + this.getUTCFullYear() + '-' + + (this.getUTCMonth() + 1).toPaddedString(2) + '-' + + this.getUTCDate().toPaddedString(2) + 'T' + + this.getUTCHours().toPaddedString(2) + ':' + + this.getUTCMinutes().toPaddedString(2) + ':' + + this.getUTCSeconds().toPaddedString(2) + 'Z"'; +}; + +var Try = { + these: function() { + var returnValue; + + for (var i = 0, length = arguments.length; i < length; i++) { + var lambda = arguments[i]; + try { + returnValue = lambda(); + break; + } catch (e) { } + } + + return returnValue; + } +}; + +RegExp.prototype.match = RegExp.prototype.test; + +RegExp.escape = function(str) { + return String(str).replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1'); +}; + +/*--------------------------------------------------------------------------*/ + +var PeriodicalExecuter = Class.create({ + initialize: function(callback, frequency) { + this.callback = callback; + this.frequency = frequency; + this.currentlyExecuting = false; + + this.registerCallback(); + }, + + registerCallback: function() { + this.timer = setInterval(this.onTimerEvent.bind(this), this.frequency * 1000); + }, + + execute: function() { + this.callback(this); + }, + + stop: function() { + if (!this.timer) return; + clearInterval(this.timer); + this.timer = null; + }, + + onTimerEvent: function() { + if (!this.currentlyExecuting) { + try { + this.currentlyExecuting = true; + this.execute(); + } finally { + this.currentlyExecuting = false; + } + } + } +}); +Object.extend(String, { + interpret: function(value) { + return value == null ? '' : String(value); + }, + specialChar: { + '\b': '\\b', + '\t': '\\t', + '\n': '\\n', + '\f': '\\f', + '\r': '\\r', + '\\': '\\\\' + } +}); + +Object.extend(String.prototype, { + gsub: function(pattern, replacement) { + var result = '', source = this, match; + replacement = arguments.callee.prepareReplacement(replacement); + + while (source.length > 0) { + if (match = source.match(pattern)) { + result += source.slice(0, match.index); + result += String.interpret(replacement(match)); + source = source.slice(match.index + match[0].length); + } else { + result += source, source = ''; + } + } + return result; + }, + + sub: function(pattern, replacement, count) { + replacement = this.gsub.prepareReplacement(replacement); + count = Object.isUndefined(count) ? 1 : count; + + return this.gsub(pattern, function(match) { + if (--count < 0) return match[0]; + return replacement(match); + }); + }, + + scan: function(pattern, iterator) { + this.gsub(pattern, iterator); + return String(this); + }, + + truncate: function(length, truncation) { + length = length || 30; + truncation = Object.isUndefined(truncation) ? '...' : truncation; + return this.length > length ? + this.slice(0, length - truncation.length) + truncation : String(this); + }, + + strip: function() { + return this.replace(/^\s+/, '').replace(/\s+$/, ''); + }, + + stripTags: function() { + return this.replace(/<\/?[^>]+>/gi, ''); + }, + + stripScripts: function() { + return this.replace(new RegExp(Prototype.ScriptFragment, 'img'), ''); + }, + + extractScripts: function() { + var matchAll = new RegExp(Prototype.ScriptFragment, 'img'); + var matchOne = new RegExp(Prototype.ScriptFragment, 'im'); + return (this.match(matchAll) || []).map(function(scriptTag) { + return (scriptTag.match(matchOne) || ['', ''])[1]; + }); + }, + + evalScripts: function() { + return this.extractScripts().map(function(script) { return eval(script) }); + }, + + escapeHTML: function() { + var self = arguments.callee; + self.text.data = this; + return self.div.innerHTML; + }, + + unescapeHTML: function() { + var div = new Element('div'); + div.innerHTML = this.stripTags(); + return div.childNodes[0] ? (div.childNodes.length > 1 ? + $A(div.childNodes).inject('', function(memo, node) { return memo+node.nodeValue }) : + div.childNodes[0].nodeValue) : ''; + }, + + toQueryParams: function(separator) { + var match = this.strip().match(/([^?#]*)(#.*)?$/); + if (!match) return { }; + + return match[1].split(separator || '&').inject({ }, function(hash, pair) { + if ((pair = pair.split('='))[0]) { + var key = decodeURIComponent(pair.shift()); + var value = pair.length > 1 ? pair.join('=') : pair[0]; + if (value != undefined) value = decodeURIComponent(value); + + if (key in hash) { + if (!Object.isArray(hash[key])) hash[key] = [hash[key]]; + hash[key].push(value); + } + else hash[key] = value; + } + return hash; + }); + }, + + toArray: function() { + return this.split(''); + }, + + succ: function() { + return this.slice(0, this.length - 1) + + String.fromCharCode(this.charCodeAt(this.length - 1) + 1); + }, + + times: function(count) { + return count < 1 ? '' : new Array(count + 1).join(this); + }, + + camelize: function() { + var parts = this.split('-'), len = parts.length; + if (len == 1) return parts[0]; + + var camelized = this.charAt(0) == '-' + ? parts[0].charAt(0).toUpperCase() + parts[0].substring(1) + : parts[0]; + + for (var i = 1; i < len; i++) + camelized += parts[i].charAt(0).toUpperCase() + parts[i].substring(1); + + return camelized; + }, + + capitalize: function() { + return this.charAt(0).toUpperCase() + this.substring(1).toLowerCase(); + }, + + underscore: function() { + return this.gsub(/::/, '/').gsub(/([A-Z]+)([A-Z][a-z])/,'#{1}_#{2}').gsub(/([a-z\d])([A-Z])/,'#{1}_#{2}').gsub(/-/,'_').toLowerCase(); + }, + + dasherize: function() { + return this.gsub(/_/,'-'); + }, + + inspect: function(useDoubleQuotes) { + var escapedString = this.gsub(/[\x00-\x1f\\]/, function(match) { + var character = String.specialChar[match[0]]; + return character ? character : '\\u00' + match[0].charCodeAt().toPaddedString(2, 16); + }); + if (useDoubleQuotes) return '"' + escapedString.replace(/"/g, '\\"') + '"'; + return "'" + escapedString.replace(/'/g, '\\\'') + "'"; + }, + + toJSON: function() { + return this.inspect(true); + }, + + unfilterJSON: function(filter) { + return this.sub(filter || Prototype.JSONFilter, '#{1}'); + }, + + isJSON: function() { + var str = this; + if (str.blank()) return false; + str = this.replace(/\\./g, '@').replace(/"[^"\\\n\r]*"/g, ''); + return (/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(str); + }, + + evalJSON: function(sanitize) { + var json = this.unfilterJSON(); + try { + if (!sanitize || json.isJSON()) return eval('(' + json + ')'); + } catch (e) { } + throw new SyntaxError('Badly formed JSON string: ' + this.inspect()); + }, + + include: function(pattern) { + return this.indexOf(pattern) > -1; + }, + + startsWith: function(pattern) { + return this.indexOf(pattern) === 0; + }, + + endsWith: function(pattern) { + var d = this.length - pattern.length; + return d >= 0 && this.lastIndexOf(pattern) === d; + }, + + empty: function() { + return this == ''; + }, + + blank: function() { + return /^\s*$/.test(this); + }, + + interpolate: function(object, pattern) { + return new Template(this, pattern).evaluate(object); + } +}); + +if (Prototype.Browser.WebKit || Prototype.Browser.IE) Object.extend(String.prototype, { + escapeHTML: function() { + return this.replace(/&/g,'&').replace(//g,'>'); + }, + unescapeHTML: function() { + return this.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>'); + } +}); + +String.prototype.gsub.prepareReplacement = function(replacement) { + if (Object.isFunction(replacement)) return replacement; + var template = new Template(replacement); + return function(match) { return template.evaluate(match) }; +}; + +String.prototype.parseQuery = String.prototype.toQueryParams; + +Object.extend(String.prototype.escapeHTML, { + div: document.createElement('div'), + text: document.createTextNode('') +}); + +with (String.prototype.escapeHTML) div.appendChild(text); + +var Template = Class.create({ + initialize: function(template, pattern) { + this.template = template.toString(); + this.pattern = pattern || Template.Pattern; + }, + + evaluate: function(object) { + if (Object.isFunction(object.toTemplateReplacements)) + object = object.toTemplateReplacements(); + + return this.template.gsub(this.pattern, function(match) { + if (object == null) return ''; + + var before = match[1] || ''; + if (before == '\\') return match[2]; + + var ctx = object, expr = match[3]; + var pattern = /^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/; + match = pattern.exec(expr); + if (match == null) return before; + + while (match != null) { + var comp = match[1].startsWith('[') ? match[2].gsub('\\\\]', ']') : match[1]; + ctx = ctx[comp]; + if (null == ctx || '' == match[3]) break; + expr = expr.substring('[' == match[3] ? match[1].length : match[0].length); + match = pattern.exec(expr); + } + + return before + String.interpret(ctx); + }.bind(this)); + } +}); +Template.Pattern = /(^|.|\r|\n)(#\{(.*?)\})/; + +var $break = { }; + +var Enumerable = { + each: function(iterator, context) { + var index = 0; + iterator = iterator.bind(context); + try { + this._each(function(value) { + iterator(value, index++); + }); + } catch (e) { + if (e != $break) throw e; + } + return this; + }, + + eachSlice: function(number, iterator, context) { + iterator = iterator ? iterator.bind(context) : Prototype.K; + var index = -number, slices = [], array = this.toArray(); + while ((index += number) < array.length) + slices.push(array.slice(index, index+number)); + return slices.collect(iterator, context); + }, + + all: function(iterator, context) { + iterator = iterator ? iterator.bind(context) : Prototype.K; + var result = true; + this.each(function(value, index) { + result = result && !!iterator(value, index); + if (!result) throw $break; + }); + return result; + }, + + any: function(iterator, context) { + iterator = iterator ? iterator.bind(context) : Prototype.K; + var result = false; + this.each(function(value, index) { + if (result = !!iterator(value, index)) + throw $break; + }); + return result; + }, + + collect: function(iterator, context) { + iterator = iterator ? iterator.bind(context) : Prototype.K; + var results = []; + this.each(function(value, index) { + results.push(iterator(value, index)); + }); + return results; + }, + + detect: function(iterator, context) { + iterator = iterator.bind(context); + var result; + this.each(function(value, index) { + if (iterator(value, index)) { + result = value; + throw $break; + } + }); + return result; + }, + + findAll: function(iterator, context) { + iterator = iterator.bind(context); + var results = []; + this.each(function(value, index) { + if (iterator(value, index)) + results.push(value); + }); + return results; + }, + + grep: function(filter, iterator, context) { + iterator = iterator ? iterator.bind(context) : Prototype.K; + var results = []; + + if (Object.isString(filter)) + filter = new RegExp(filter); + + this.each(function(value, index) { + if (filter.match(value)) + results.push(iterator(value, index)); + }); + return results; + }, + + include: function(object) { + if (Object.isFunction(this.indexOf)) + if (this.indexOf(object) != -1) return true; + + var found = false; + this.each(function(value) { + if (value == object) { + found = true; + throw $break; + } + }); + return found; + }, + + inGroupsOf: function(number, fillWith) { + fillWith = Object.isUndefined(fillWith) ? null : fillWith; + return this.eachSlice(number, function(slice) { + while(slice.length < number) slice.push(fillWith); + return slice; + }); + }, + + inject: function(memo, iterator, context) { + iterator = iterator.bind(context); + this.each(function(value, index) { + memo = iterator(memo, value, index); + }); + return memo; + }, + + invoke: function(method) { + var args = $A(arguments).slice(1); + return this.map(function(value) { + return value[method].apply(value, args); + }); + }, + + max: function(iterator, context) { + iterator = iterator ? iterator.bind(context) : Prototype.K; + var result; + this.each(function(value, index) { + value = iterator(value, index); + if (result == null || value >= result) + result = value; + }); + return result; + }, + + min: function(iterator, context) { + iterator = iterator ? iterator.bind(context) : Prototype.K; + var result; + this.each(function(value, index) { + value = iterator(value, index); + if (result == null || value < result) + result = value; + }); + return result; + }, + + partition: function(iterator, context) { + iterator = iterator ? iterator.bind(context) : Prototype.K; + var trues = [], falses = []; + this.each(function(value, index) { + (iterator(value, index) ? + trues : falses).push(value); + }); + return [trues, falses]; + }, + + pluck: function(property) { + var results = []; + this.each(function(value) { + results.push(value[property]); + }); + return results; + }, + + reject: function(iterator, context) { + iterator = iterator.bind(context); + var results = []; + this.each(function(value, index) { + if (!iterator(value, index)) + results.push(value); + }); + return results; + }, + + sortBy: function(iterator, context) { + iterator = iterator.bind(context); + return this.map(function(value, index) { + return {value: value, criteria: iterator(value, index)}; + }).sort(function(left, right) { + var a = left.criteria, b = right.criteria; + return a < b ? -1 : a > b ? 1 : 0; + }).pluck('value'); + }, + + toArray: function() { + return this.map(); + }, + + zip: function() { + var iterator = Prototype.K, args = $A(arguments); + if (Object.isFunction(args.last())) + iterator = args.pop(); + + var collections = [this].concat(args).map($A); + return this.map(function(value, index) { + return iterator(collections.pluck(index)); + }); + }, + + size: function() { + return this.toArray().length; + }, + + inspect: function() { + return '#'; + } +}; + +Object.extend(Enumerable, { + map: Enumerable.collect, + find: Enumerable.detect, + select: Enumerable.findAll, + filter: Enumerable.findAll, + member: Enumerable.include, + entries: Enumerable.toArray, + every: Enumerable.all, + some: Enumerable.any +}); +function $A(iterable) { + if (!iterable) return []; + if (iterable.toArray) return iterable.toArray(); + var length = iterable.length || 0, results = new Array(length); + while (length--) results[length] = iterable[length]; + return results; +} + +if (Prototype.Browser.WebKit) { + function $A(iterable) { + if (!iterable) return []; + if (!(Object.isFunction(iterable) && iterable == '[object NodeList]') && + iterable.toArray) return iterable.toArray(); + var length = iterable.length || 0, results = new Array(length); + while (length--) results[length] = iterable[length]; + return results; + } +} + +Array.from = $A; + +Object.extend(Array.prototype, Enumerable); + +if (!Array.prototype._reverse) Array.prototype._reverse = Array.prototype.reverse; + +Object.extend(Array.prototype, { + _each: function(iterator) { + for (var i = 0, length = this.length; i < length; i++) + iterator(this[i]); + }, + + clear: function() { + this.length = 0; + return this; + }, + + first: function() { + return this[0]; + }, + + last: function() { + return this[this.length - 1]; + }, + + compact: function() { + return this.select(function(value) { + return value != null; + }); + }, + + flatten: function() { + return this.inject([], function(array, value) { + return array.concat(Object.isArray(value) ? + value.flatten() : [value]); + }); + }, + + without: function() { + var values = $A(arguments); + return this.select(function(value) { + return !values.include(value); + }); + }, + + reverse: function(inline) { + return (inline !== false ? this : this.toArray())._reverse(); + }, + + reduce: function() { + return this.length > 1 ? this : this[0]; + }, + + uniq: function(sorted) { + return this.inject([], function(array, value, index) { + if (0 == index || (sorted ? array.last() != value : !array.include(value))) + array.push(value); + return array; + }); + }, + + intersect: function(array) { + return this.uniq().findAll(function(item) { + return array.detect(function(value) { return item === value }); + }); + }, + + clone: function() { + return [].concat(this); + }, + + size: function() { + return this.length; + }, + + inspect: function() { + return '[' + this.map(Object.inspect).join(', ') + ']'; + }, + + toJSON: function() { + var results = []; + this.each(function(object) { + var value = Object.toJSON(object); + if (!Object.isUndefined(value)) results.push(value); + }); + return '[' + results.join(', ') + ']'; + } +}); + +// use native browser JS 1.6 implementation if available +if (Object.isFunction(Array.prototype.forEach)) + Array.prototype._each = Array.prototype.forEach; + +if (!Array.prototype.indexOf) Array.prototype.indexOf = function(item, i) { + i || (i = 0); + var length = this.length; + if (i < 0) i = length + i; + for (; i < length; i++) + if (this[i] === item) return i; + return -1; +}; + +if (!Array.prototype.lastIndexOf) Array.prototype.lastIndexOf = function(item, i) { + i = isNaN(i) ? this.length : (i < 0 ? this.length + i : i) + 1; + var n = this.slice(0, i).reverse().indexOf(item); + return (n < 0) ? n : i - n - 1; +}; + +Array.prototype.toArray = Array.prototype.clone; + +function $w(string) { + if (!Object.isString(string)) return []; + string = string.strip(); + return string ? string.split(/\s+/) : []; +} + +if (Prototype.Browser.Opera){ + Array.prototype.concat = function() { + var array = []; + for (var i = 0, length = this.length; i < length; i++) array.push(this[i]); + for (var i = 0, length = arguments.length; i < length; i++) { + if (Object.isArray(arguments[i])) { + for (var j = 0, arrayLength = arguments[i].length; j < arrayLength; j++) + array.push(arguments[i][j]); + } else { + array.push(arguments[i]); + } + } + return array; + }; +} +Object.extend(Number.prototype, { + toColorPart: function() { + return this.toPaddedString(2, 16); + }, + + succ: function() { + return this + 1; + }, + + times: function(iterator) { + $R(0, this, true).each(iterator); + return this; + }, + + toPaddedString: function(length, radix) { + var string = this.toString(radix || 10); + return '0'.times(length - string.length) + string; + }, + + toJSON: function() { + return isFinite(this) ? this.toString() : 'null'; + } +}); + +$w('abs round ceil floor').each(function(method){ + Number.prototype[method] = Math[method].methodize(); +}); +function $H(object) { + return new Hash(object); +}; + +var Hash = Class.create(Enumerable, (function() { + + function toQueryPair(key, value) { + if (Object.isUndefined(value)) return key; + return key + '=' + encodeURIComponent(String.interpret(value)); + } + + return { + initialize: function(object) { + this._object = Object.isHash(object) ? object.toObject() : Object.clone(object); + }, + + _each: function(iterator) { + for (var key in this._object) { + var value = this._object[key], pair = [key, value]; + pair.key = key; + pair.value = value; + iterator(pair); + } + }, + + set: function(key, value) { + return this._object[key] = value; + }, + + get: function(key) { + return this._object[key]; + }, + + unset: function(key) { + var value = this._object[key]; + delete this._object[key]; + return value; + }, + + toObject: function() { + return Object.clone(this._object); + }, + + keys: function() { + return this.pluck('key'); + }, + + values: function() { + return this.pluck('value'); + }, + + index: function(value) { + var match = this.detect(function(pair) { + return pair.value === value; + }); + return match && match.key; + }, + + merge: function(object) { + return this.clone().update(object); + }, + + update: function(object) { + return new Hash(object).inject(this, function(result, pair) { + result.set(pair.key, pair.value); + return result; + }); + }, + + toQueryString: function() { + return this.map(function(pair) { + var key = encodeURIComponent(pair.key), values = pair.value; + + if (values && typeof values == 'object') { + if (Object.isArray(values)) + return values.map(toQueryPair.curry(key)).join('&'); + } + return toQueryPair(key, values); + }).join('&'); + }, + + inspect: function() { + return '#'; + }, + + toJSON: function() { + return Object.toJSON(this.toObject()); + }, + + clone: function() { + return new Hash(this); + } + } +})()); + +Hash.prototype.toTemplateReplacements = Hash.prototype.toObject; +Hash.from = $H; +var ObjectRange = Class.create(Enumerable, { + initialize: function(start, end, exclusive) { + this.start = start; + this.end = end; + this.exclusive = exclusive; + }, + + _each: function(iterator) { + var value = this.start; + while (this.include(value)) { + iterator(value); + value = value.succ(); + } + }, + + include: function(value) { + if (value < this.start) + return false; + if (this.exclusive) + return value < this.end; + return value <= this.end; + } +}); + +var $R = function(start, end, exclusive) { + return new ObjectRange(start, end, exclusive); +}; + +var Ajax = { + getTransport: function() { + return Try.these( + function() {return new XMLHttpRequest()}, + function() {return new ActiveXObject('Msxml2.XMLHTTP')}, + function() {return new ActiveXObject('Microsoft.XMLHTTP')} + ) || false; + }, + + activeRequestCount: 0 +}; + +Ajax.Responders = { + responders: [], + + _each: function(iterator) { + this.responders._each(iterator); + }, + + register: function(responder) { + if (!this.include(responder)) + this.responders.push(responder); + }, + + unregister: function(responder) { + this.responders = this.responders.without(responder); + }, + + dispatch: function(callback, request, transport, json) { + this.each(function(responder) { + if (Object.isFunction(responder[callback])) { + try { + responder[callback].apply(responder, [request, transport, json]); + } catch (e) { } + } + }); + } +}; + +Object.extend(Ajax.Responders, Enumerable); + +Ajax.Responders.register({ + onCreate: function() { Ajax.activeRequestCount++ }, + onComplete: function() { Ajax.activeRequestCount-- } +}); + +Ajax.Base = Class.create({ + initialize: function(options) { + this.options = { + method: 'post', + asynchronous: true, + contentType: 'application/x-www-form-urlencoded', + encoding: 'UTF-8', + parameters: '', + evalJSON: true, + evalJS: true + }; + Object.extend(this.options, options || { }); + + this.options.method = this.options.method.toLowerCase(); + + if (Object.isString(this.options.parameters)) + this.options.parameters = this.options.parameters.toQueryParams(); + else if (Object.isHash(this.options.parameters)) + this.options.parameters = this.options.parameters.toObject(); + } +}); + +Ajax.Request = Class.create(Ajax.Base, { + _complete: false, + + initialize: function($super, url, options) { + $super(options); + this.transport = Ajax.getTransport(); + this.request(url); + }, + + request: function(url) { + this.url = url; + this.method = this.options.method; + var params = Object.clone(this.options.parameters); + + if (!['get', 'post'].include(this.method)) { + // simulate other verbs over post + params['_method'] = this.method; + this.method = 'post'; + } + + this.parameters = params; + + if (params = Object.toQueryString(params)) { + // when GET, append parameters to URL + if (this.method == 'get') + this.url += (this.url.include('?') ? '&' : '?') + params; + else if (/Konqueror|Safari|KHTML/.test(navigator.userAgent)) + params += '&_='; + } + + try { + var response = new Ajax.Response(this); + if (this.options.onCreate) this.options.onCreate(response); + Ajax.Responders.dispatch('onCreate', this, response); + + this.transport.open(this.method.toUpperCase(), this.url, + this.options.asynchronous); + + if (this.options.asynchronous) this.respondToReadyState.bind(this).defer(1); + + this.transport.onreadystatechange = this.onStateChange.bind(this); + this.setRequestHeaders(); + + this.body = this.method == 'post' ? (this.options.postBody || params) : null; + this.transport.send(this.body); + + /* Force Firefox to handle ready state 4 for synchronous requests */ + if (!this.options.asynchronous && this.transport.overrideMimeType) + this.onStateChange(); + + } + catch (e) { + this.dispatchException(e); + } + }, + + onStateChange: function() { + var readyState = this.transport.readyState; + if (readyState > 1 && !((readyState == 4) && this._complete)) + this.respondToReadyState(this.transport.readyState); + }, + + setRequestHeaders: function() { + var headers = { + 'X-Requested-With': 'XMLHttpRequest', + 'X-Prototype-Version': Prototype.Version, + 'Accept': 'text/javascript, text/html, application/xml, text/xml, */*' + }; + + if (this.method == 'post') { + headers['Content-type'] = this.options.contentType + + (this.options.encoding ? '; charset=' + this.options.encoding : ''); + + /* Force "Connection: close" for older Mozilla browsers to work + * around a bug where XMLHttpRequest sends an incorrect + * Content-length header. See Mozilla Bugzilla #246651. + */ + if (this.transport.overrideMimeType && + (navigator.userAgent.match(/Gecko\/(\d{4})/) || [0,2005])[1] < 2005) + headers['Connection'] = 'close'; + } + + // user-defined headers + if (typeof this.options.requestHeaders == 'object') { + var extras = this.options.requestHeaders; + + if (Object.isFunction(extras.push)) + for (var i = 0, length = extras.length; i < length; i += 2) + headers[extras[i]] = extras[i+1]; + else + $H(extras).each(function(pair) { headers[pair.key] = pair.value }); + } + + for (var name in headers) + this.transport.setRequestHeader(name, headers[name]); + }, + + success: function() { + var status = this.getStatus(); + return !status || (status >= 200 && status < 300); + }, + + getStatus: function() { + try { + return this.transport.status || 0; + } catch (e) { return 0 } + }, + + respondToReadyState: function(readyState) { + var state = Ajax.Request.Events[readyState], response = new Ajax.Response(this); + + if (state == 'Complete') { + try { + this._complete = true; + (this.options['on' + response.status] + || this.options['on' + (this.success() ? 'Success' : 'Failure')] + || Prototype.emptyFunction)(response, response.headerJSON); + } catch (e) { + this.dispatchException(e); + } + + var contentType = response.getHeader('Content-type'); + if (this.options.evalJS == 'force' + || (this.options.evalJS && contentType + && contentType.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i))) + this.evalResponse(); + } + + try { + (this.options['on' + state] || Prototype.emptyFunction)(response, response.headerJSON); + Ajax.Responders.dispatch('on' + state, this, response, response.headerJSON); + } catch (e) { + this.dispatchException(e); + } + + if (state == 'Complete') { + // avoid memory leak in MSIE: clean up + this.transport.onreadystatechange = Prototype.emptyFunction; + } + }, + + getHeader: function(name) { + try { + return this.transport.getResponseHeader(name) || null; + } catch (e) { return null } + }, + + evalResponse: function() { + try { + return eval((this.transport.responseText || '').unfilterJSON()); + } catch (e) { + this.dispatchException(e); + } + }, + + dispatchException: function(exception) { + (this.options.onException || Prototype.emptyFunction)(this, exception); + Ajax.Responders.dispatch('onException', this, exception); + } +}); + +Ajax.Request.Events = + ['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete']; + +Ajax.Response = Class.create({ + initialize: function(request){ + this.request = request; + var transport = this.transport = request.transport, + readyState = this.readyState = transport.readyState; + + if((readyState > 2 && !Prototype.Browser.IE) || readyState == 4) { + this.status = this.getStatus(); + this.statusText = this.getStatusText(); + this.responseText = String.interpret(transport.responseText); + this.headerJSON = this._getHeaderJSON(); + } + + if(readyState == 4) { + var xml = transport.responseXML; + this.responseXML = Object.isUndefined(xml) ? null : xml; + this.responseJSON = this._getResponseJSON(); + } + }, + + status: 0, + statusText: '', + + getStatus: Ajax.Request.prototype.getStatus, + + getStatusText: function() { + try { + return this.transport.statusText || ''; + } catch (e) { return '' } + }, + + getHeader: Ajax.Request.prototype.getHeader, + + getAllHeaders: function() { + try { + return this.getAllResponseHeaders(); + } catch (e) { return null } + }, + + getResponseHeader: function(name) { + return this.transport.getResponseHeader(name); + }, + + getAllResponseHeaders: function() { + return this.transport.getAllResponseHeaders(); + }, + + _getHeaderJSON: function() { + var json = this.getHeader('X-JSON'); + if (!json) return null; + json = decodeURIComponent(escape(json)); + try { + return json.evalJSON(this.request.options.sanitizeJSON); + } catch (e) { + this.request.dispatchException(e); + } + }, + + _getResponseJSON: function() { + var options = this.request.options; + if (!options.evalJSON || (options.evalJSON != 'force' && + !(this.getHeader('Content-type') || '').include('application/json')) || + this.responseText.blank()) + return null; + try { + return this.responseText.evalJSON(options.sanitizeJSON); + } catch (e) { + this.request.dispatchException(e); + } + } +}); + +Ajax.Updater = Class.create(Ajax.Request, { + initialize: function($super, container, url, options) { + this.container = { + success: (container.success || container), + failure: (container.failure || (container.success ? null : container)) + }; + + options = Object.clone(options); + var onComplete = options.onComplete; + options.onComplete = (function(response, json) { + this.updateContent(response.responseText); + if (Object.isFunction(onComplete)) onComplete(response, json); + }).bind(this); + + $super(url, options); + }, + + updateContent: function(responseText) { + var receiver = this.container[this.success() ? 'success' : 'failure'], + options = this.options; + + if (!options.evalScripts) responseText = responseText.stripScripts(); + + if (receiver = $(receiver)) { + if (options.insertion) { + if (Object.isString(options.insertion)) { + var insertion = { }; insertion[options.insertion] = responseText; + receiver.insert(insertion); + } + else options.insertion(receiver, responseText); + } + else receiver.update(responseText); + } + } +}); + +Ajax.PeriodicalUpdater = Class.create(Ajax.Base, { + initialize: function($super, container, url, options) { + $super(options); + this.onComplete = this.options.onComplete; + + this.frequency = (this.options.frequency || 2); + this.decay = (this.options.decay || 1); + + this.updater = { }; + this.container = container; + this.url = url; + + this.start(); + }, + + start: function() { + this.options.onComplete = this.updateComplete.bind(this); + this.onTimerEvent(); + }, + + stop: function() { + this.updater.options.onComplete = undefined; + clearTimeout(this.timer); + (this.onComplete || Prototype.emptyFunction).apply(this, arguments); + }, + + updateComplete: function(response) { + if (this.options.decay) { + this.decay = (response.responseText == this.lastText ? + this.decay * this.options.decay : 1); + + this.lastText = response.responseText; + } + this.timer = this.onTimerEvent.bind(this).delay(this.decay * this.frequency); + }, + + onTimerEvent: function() { + this.updater = new Ajax.Updater(this.container, this.url, this.options); + } +}); +function $(element) { + if (arguments.length > 1) { + for (var i = 0, elements = [], length = arguments.length; i < length; i++) + elements.push($(arguments[i])); + return elements; + } + if (Object.isString(element)) + element = document.getElementById(element); + return Element.extend(element); +} + +if (Prototype.BrowserFeatures.XPath) { + document._getElementsByXPath = function(expression, parentElement) { + var results = []; + var query = document.evaluate(expression, $(parentElement) || document, + null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); + for (var i = 0, length = query.snapshotLength; i < length; i++) + results.push(Element.extend(query.snapshotItem(i))); + return results; + }; +} + +/*--------------------------------------------------------------------------*/ + +if (!window.Node) var Node = { }; + +if (!Node.ELEMENT_NODE) { + // DOM level 2 ECMAScript Language Binding + Object.extend(Node, { + ELEMENT_NODE: 1, + ATTRIBUTE_NODE: 2, + TEXT_NODE: 3, + CDATA_SECTION_NODE: 4, + ENTITY_REFERENCE_NODE: 5, + ENTITY_NODE: 6, + PROCESSING_INSTRUCTION_NODE: 7, + COMMENT_NODE: 8, + DOCUMENT_NODE: 9, + DOCUMENT_TYPE_NODE: 10, + DOCUMENT_FRAGMENT_NODE: 11, + NOTATION_NODE: 12 + }); +} + +(function() { + var element = this.Element; + this.Element = function(tagName, attributes) { + attributes = attributes || { }; + tagName = tagName.toLowerCase(); + var cache = Element.cache; + if (Prototype.Browser.IE && attributes.name) { + tagName = '<' + tagName + ' name="' + attributes.name + '">'; + delete attributes.name; + return Element.writeAttribute(document.createElement(tagName), attributes); + } + if (!cache[tagName]) cache[tagName] = Element.extend(document.createElement(tagName)); + return Element.writeAttribute(cache[tagName].cloneNode(false), attributes); + }; + Object.extend(this.Element, element || { }); +}).call(window); + +Element.cache = { }; + +Element.Methods = { + visible: function(element) { + return $(element).style.display != 'none'; + }, + + toggle: function(element) { + element = $(element); + Element[Element.visible(element) ? 'hide' : 'show'](element); + return element; + }, + + hide: function(element) { + $(element).style.display = 'none'; + return element; + }, + + show: function(element) { + $(element).style.display = ''; + return element; + }, + + remove: function(element) { + element = $(element); + element.parentNode.removeChild(element); + return element; + }, + + update: function(element, content) { + element = $(element); + if (content && content.toElement) content = content.toElement(); + if (Object.isElement(content)) return element.update().insert(content); + content = Object.toHTML(content); + element.innerHTML = content.stripScripts(); + content.evalScripts.bind(content).defer(); + return element; + }, + + replace: function(element, content) { + element = $(element); + if (content && content.toElement) content = content.toElement(); + else if (!Object.isElement(content)) { + content = Object.toHTML(content); + var range = element.ownerDocument.createRange(); + range.selectNode(element); + content.evalScripts.bind(content).defer(); + content = range.createContextualFragment(content.stripScripts()); + } + element.parentNode.replaceChild(content, element); + return element; + }, + + insert: function(element, insertions) { + element = $(element); + + if (Object.isString(insertions) || Object.isNumber(insertions) || + Object.isElement(insertions) || (insertions && (insertions.toElement || insertions.toHTML))) + insertions = {bottom:insertions}; + + var content, insert, tagName, childNodes; + + for (position in insertions) { + content = insertions[position]; + position = position.toLowerCase(); + insert = Element._insertionTranslations[position]; + + if (content && content.toElement) content = content.toElement(); + if (Object.isElement(content)) { + insert(element, content); + continue; + } + + content = Object.toHTML(content); + + tagName = ((position == 'before' || position == 'after') + ? element.parentNode : element).tagName.toUpperCase(); + + childNodes = Element._getContentFromAnonymousElement(tagName, content.stripScripts()); + + if (position == 'top' || position == 'after') childNodes.reverse(); + childNodes.each(insert.curry(element)); + + content.evalScripts.bind(content).defer(); + } + + return element; + }, + + wrap: function(element, wrapper, attributes) { + element = $(element); + if (Object.isElement(wrapper)) + $(wrapper).writeAttribute(attributes || { }); + else if (Object.isString(wrapper)) wrapper = new Element(wrapper, attributes); + else wrapper = new Element('div', wrapper); + if (element.parentNode) + element.parentNode.replaceChild(wrapper, element); + wrapper.appendChild(element); + return wrapper; + }, + + inspect: function(element) { + element = $(element); + var result = '<' + element.tagName.toLowerCase(); + $H({'id': 'id', 'className': 'class'}).each(function(pair) { + var property = pair.first(), attribute = pair.last(); + var value = (element[property] || '').toString(); + if (value) result += ' ' + attribute + '=' + value.inspect(true); + }); + return result + '>'; + }, + + recursivelyCollect: function(element, property) { + element = $(element); + var elements = []; + while (element = element[property]) + if (element.nodeType == 1) + elements.push(Element.extend(element)); + return elements; + }, + + ancestors: function(element) { + return $(element).recursivelyCollect('parentNode'); + }, + + descendants: function(element) { + return $(element).getElementsBySelector("*"); + }, + + firstDescendant: function(element) { + element = $(element).firstChild; + while (element && element.nodeType != 1) element = element.nextSibling; + return $(element); + }, + + immediateDescendants: function(element) { + if (!(element = $(element).firstChild)) return []; + while (element && element.nodeType != 1) element = element.nextSibling; + if (element) return [element].concat($(element).nextSiblings()); + return []; + }, + + previousSiblings: function(element) { + return $(element).recursivelyCollect('previousSibling'); + }, + + nextSiblings: function(element) { + return $(element).recursivelyCollect('nextSibling'); + }, + + siblings: function(element) { + element = $(element); + return element.previousSiblings().reverse().concat(element.nextSiblings()); + }, + + match: function(element, selector) { + if (Object.isString(selector)) + selector = new Selector(selector); + return selector.match($(element)); + }, + + up: function(element, expression, index) { + element = $(element); + if (arguments.length == 1) return $(element.parentNode); + var ancestors = element.ancestors(); + return Object.isNumber(expression) ? ancestors[expression] : + Selector.findElement(ancestors, expression, index); + }, + + down: function(element, expression, index) { + element = $(element); + if (arguments.length == 1) return element.firstDescendant(); + return Object.isNumber(expression) ? element.descendants()[expression] : + element.select(expression)[index || 0]; + }, + + previous: function(element, expression, index) { + element = $(element); + if (arguments.length == 1) return $(Selector.handlers.previousElementSibling(element)); + var previousSiblings = element.previousSiblings(); + return Object.isNumber(expression) ? previousSiblings[expression] : + Selector.findElement(previousSiblings, expression, index); + }, + + next: function(element, expression, index) { + element = $(element); + if (arguments.length == 1) return $(Selector.handlers.nextElementSibling(element)); + var nextSiblings = element.nextSiblings(); + return Object.isNumber(expression) ? nextSiblings[expression] : + Selector.findElement(nextSiblings, expression, index); + }, + + select: function() { + var args = $A(arguments), element = $(args.shift()); + return Selector.findChildElements(element, args); + }, + + adjacent: function() { + var args = $A(arguments), element = $(args.shift()); + return Selector.findChildElements(element.parentNode, args).without(element); + }, + + identify: function(element) { + element = $(element); + var id = element.readAttribute('id'), self = arguments.callee; + if (id) return id; + do { id = 'anonymous_element_' + self.counter++ } while ($(id)); + element.writeAttribute('id', id); + return id; + }, + + readAttribute: function(element, name) { + element = $(element); + if (Prototype.Browser.IE) { + var t = Element._attributeTranslations.read; + if (t.values[name]) return t.values[name](element, name); + if (t.names[name]) name = t.names[name]; + if (name.include(':')) { + return (!element.attributes || !element.attributes[name]) ? null : + element.attributes[name].value; + } + } + return element.getAttribute(name); + }, + + writeAttribute: function(element, name, value) { + element = $(element); + var attributes = { }, t = Element._attributeTranslations.write; + + if (typeof name == 'object') attributes = name; + else attributes[name] = Object.isUndefined(value) ? true : value; + + for (var attr in attributes) { + name = t.names[attr] || attr; + value = attributes[attr]; + if (t.values[attr]) name = t.values[attr](element, value); + if (value === false || value === null) + element.removeAttribute(name); + else if (value === true) + element.setAttribute(name, name); + else element.setAttribute(name, value); + } + return element; + }, + + getHeight: function(element) { + return $(element).getDimensions().height; + }, + + getWidth: function(element) { + return $(element).getDimensions().width; + }, + + classNames: function(element) { + return new Element.ClassNames(element); + }, + + hasClassName: function(element, className) { + if (!(element = $(element))) return; + var elementClassName = element.className; + return (elementClassName.length > 0 && (elementClassName == className || + new RegExp("(^|\\s)" + className + "(\\s|$)").test(elementClassName))); + }, + + addClassName: function(element, className) { + if (!(element = $(element))) return; + if (!element.hasClassName(className)) + element.className += (element.className ? ' ' : '') + className; + return element; + }, + + removeClassName: function(element, className) { + if (!(element = $(element))) return; + element.className = element.className.replace( + new RegExp("(^|\\s+)" + className + "(\\s+|$)"), ' ').strip(); + return element; + }, + + toggleClassName: function(element, className) { + if (!(element = $(element))) return; + return element[element.hasClassName(className) ? + 'removeClassName' : 'addClassName'](className); + }, + + // removes whitespace-only text node children + cleanWhitespace: function(element) { + element = $(element); + var node = element.firstChild; + while (node) { + var nextNode = node.nextSibling; + if (node.nodeType == 3 && !/\S/.test(node.nodeValue)) + element.removeChild(node); + node = nextNode; + } + return element; + }, + + empty: function(element) { + return $(element).innerHTML.blank(); + }, + + descendantOf: function(element, ancestor) { + element = $(element), ancestor = $(ancestor); + var originalAncestor = ancestor; + + if (element.compareDocumentPosition) + return (element.compareDocumentPosition(ancestor) & 8) === 8; + + if (element.sourceIndex && !Prototype.Browser.Opera) { + var e = element.sourceIndex, a = ancestor.sourceIndex, + nextAncestor = ancestor.nextSibling; + if (!nextAncestor) { + do { ancestor = ancestor.parentNode; } + while (!(nextAncestor = ancestor.nextSibling) && ancestor.parentNode); + } + if (nextAncestor) return (e > a && e < nextAncestor.sourceIndex); + } + + while (element = element.parentNode) + if (element == originalAncestor) return true; + return false; + }, + + scrollTo: function(element) { + element = $(element); + var pos = element.cumulativeOffset(); + window.scrollTo(pos[0], pos[1]); + return element; + }, + + getStyle: function(element, style) { + element = $(element); + style = style == 'float' ? 'cssFloat' : style.camelize(); + var value = element.style[style]; + if (!value) { + var css = document.defaultView.getComputedStyle(element, null); + value = css ? css[style] : null; + } + if (style == 'opacity') return value ? parseFloat(value) : 1.0; + return value == 'auto' ? null : value; + }, + + getOpacity: function(element) { + return $(element).getStyle('opacity'); + }, + + setStyle: function(element, styles) { + element = $(element); + var elementStyle = element.style, match; + if (Object.isString(styles)) { + element.style.cssText += ';' + styles; + return styles.include('opacity') ? + element.setOpacity(styles.match(/opacity:\s*(\d?\.?\d*)/)[1]) : element; + } + for (var property in styles) + if (property == 'opacity') element.setOpacity(styles[property]); + else + elementStyle[(property == 'float' || property == 'cssFloat') ? + (Object.isUndefined(elementStyle.styleFloat) ? 'cssFloat' : 'styleFloat') : + property] = styles[property]; + + return element; + }, + + setOpacity: function(element, value) { + element = $(element); + element.style.opacity = (value == 1 || value === '') ? '' : + (value < 0.00001) ? 0 : value; + return element; + }, + + getDimensions: function(element) { + element = $(element); + var display = $(element).getStyle('display'); + if (display != 'none' && display != null) // Safari bug + return {width: element.offsetWidth, height: element.offsetHeight}; + + // All *Width and *Height properties give 0 on elements with display none, + // so enable the element temporarily + var els = element.style; + var originalVisibility = els.visibility; + var originalPosition = els.position; + var originalDisplay = els.display; + els.visibility = 'hidden'; + els.position = 'absolute'; + els.display = 'block'; + var originalWidth = element.clientWidth; + var originalHeight = element.clientHeight; + els.display = originalDisplay; + els.position = originalPosition; + els.visibility = originalVisibility; + return {width: originalWidth, height: originalHeight}; + }, + + makePositioned: function(element) { + element = $(element); + var pos = Element.getStyle(element, 'position'); + if (pos == 'static' || !pos) { + element._madePositioned = true; + element.style.position = 'relative'; + // Opera returns the offset relative to the positioning context, when an + // element is position relative but top and left have not been defined + if (window.opera) { + element.style.top = 0; + element.style.left = 0; + } + } + return element; + }, + + undoPositioned: function(element) { + element = $(element); + if (element._madePositioned) { + element._madePositioned = undefined; + element.style.position = + element.style.top = + element.style.left = + element.style.bottom = + element.style.right = ''; + } + return element; + }, + + makeClipping: function(element) { + element = $(element); + if (element._overflow) return element; + element._overflow = Element.getStyle(element, 'overflow') || 'auto'; + if (element._overflow !== 'hidden') + element.style.overflow = 'hidden'; + return element; + }, + + undoClipping: function(element) { + element = $(element); + if (!element._overflow) return element; + element.style.overflow = element._overflow == 'auto' ? '' : element._overflow; + element._overflow = null; + return element; + }, + + cumulativeOffset: function(element) { + var valueT = 0, valueL = 0; + do { + valueT += element.offsetTop || 0; + valueL += element.offsetLeft || 0; + element = element.offsetParent; + } while (element); + return Element._returnOffset(valueL, valueT); + }, + + positionedOffset: function(element) { + var valueT = 0, valueL = 0; + do { + valueT += element.offsetTop || 0; + valueL += element.offsetLeft || 0; + element = element.offsetParent; + if (element) { + if (element.tagName == 'BODY') break; + var p = Element.getStyle(element, 'position'); + if (p == 'relative' || p == 'absolute') break; + } + } while (element); + return Element._returnOffset(valueL, valueT); + }, + + absolutize: function(element) { + element = $(element); + if (element.getStyle('position') == 'absolute') return; + // Position.prepare(); // To be done manually by Scripty when it needs it. + + var offsets = element.positionedOffset(); + var top = offsets[1]; + var left = offsets[0]; + var width = element.clientWidth; + var height = element.clientHeight; + + element._originalLeft = left - parseFloat(element.style.left || 0); + element._originalTop = top - parseFloat(element.style.top || 0); + element._originalWidth = element.style.width; + element._originalHeight = element.style.height; + + element.style.position = 'absolute'; + element.style.top = top + 'px'; + element.style.left = left + 'px'; + element.style.width = width + 'px'; + element.style.height = height + 'px'; + return element; + }, + + relativize: function(element) { + element = $(element); + if (element.getStyle('position') == 'relative') return; + // Position.prepare(); // To be done manually by Scripty when it needs it. + + element.style.position = 'relative'; + var top = parseFloat(element.style.top || 0) - (element._originalTop || 0); + var left = parseFloat(element.style.left || 0) - (element._originalLeft || 0); + + element.style.top = top + 'px'; + element.style.left = left + 'px'; + element.style.height = element._originalHeight; + element.style.width = element._originalWidth; + return element; + }, + + cumulativeScrollOffset: function(element) { + var valueT = 0, valueL = 0; + do { + valueT += element.scrollTop || 0; + valueL += element.scrollLeft || 0; + element = element.parentNode; + } while (element); + return Element._returnOffset(valueL, valueT); + }, + + getOffsetParent: function(element) { + if (element.offsetParent) return $(element.offsetParent); + if (element == document.body) return $(element); + + while ((element = element.parentNode) && element != document.body) + if (Element.getStyle(element, 'position') != 'static') + return $(element); + + return $(document.body); + }, + + viewportOffset: function(forElement) { + var valueT = 0, valueL = 0; + + var element = forElement; + do { + valueT += element.offsetTop || 0; + valueL += element.offsetLeft || 0; + + // Safari fix + if (element.offsetParent == document.body && + Element.getStyle(element, 'position') == 'absolute') break; + + } while (element = element.offsetParent); + + element = forElement; + do { + if (!Prototype.Browser.Opera || element.tagName == 'BODY') { + valueT -= element.scrollTop || 0; + valueL -= element.scrollLeft || 0; + } + } while (element = element.parentNode); + + return Element._returnOffset(valueL, valueT); + }, + + clonePosition: function(element, source) { + var options = Object.extend({ + setLeft: true, + setTop: true, + setWidth: true, + setHeight: true, + offsetTop: 0, + offsetLeft: 0 + }, arguments[2] || { }); + + // find page position of source + source = $(source); + var p = source.viewportOffset(); + + // find coordinate system to use + element = $(element); + var delta = [0, 0]; + var parent = null; + // delta [0,0] will do fine with position: fixed elements, + // position:absolute needs offsetParent deltas + if (Element.getStyle(element, 'position') == 'absolute') { + parent = element.getOffsetParent(); + delta = parent.viewportOffset(); + } + + // correct by body offsets (fixes Safari) + if (parent == document.body) { + delta[0] -= document.body.offsetLeft; + delta[1] -= document.body.offsetTop; + } + + // set position + if (options.setLeft) element.style.left = (p[0] - delta[0] + options.offsetLeft) + 'px'; + if (options.setTop) element.style.top = (p[1] - delta[1] + options.offsetTop) + 'px'; + if (options.setWidth) element.style.width = source.offsetWidth + 'px'; + if (options.setHeight) element.style.height = source.offsetHeight + 'px'; + return element; + } +}; + +Element.Methods.identify.counter = 1; + +Object.extend(Element.Methods, { + getElementsBySelector: Element.Methods.select, + childElements: Element.Methods.immediateDescendants +}); + +Element._attributeTranslations = { + write: { + names: { + className: 'class', + htmlFor: 'for' + }, + values: { } + } +}; + +if (Prototype.Browser.Opera) { + Element.Methods.getStyle = Element.Methods.getStyle.wrap( + function(proceed, element, style) { + switch (style) { + case 'left': case 'top': case 'right': case 'bottom': + if (proceed(element, 'position') === 'static') return null; + case 'height': case 'width': + // returns '0px' for hidden elements; we want it to return null + if (!Element.visible(element)) return null; + + // returns the border-box dimensions rather than the content-box + // dimensions, so we subtract padding and borders from the value + var dim = parseInt(proceed(element, style), 10); + + if (dim !== element['offset' + style.capitalize()]) + return dim + 'px'; + + var properties; + if (style === 'height') { + properties = ['border-top-width', 'padding-top', + 'padding-bottom', 'border-bottom-width']; + } + else { + properties = ['border-left-width', 'padding-left', + 'padding-right', 'border-right-width']; + } + return properties.inject(dim, function(memo, property) { + var val = proceed(element, property); + return val === null ? memo : memo - parseInt(val, 10); + }) + 'px'; + default: return proceed(element, style); + } + } + ); + + Element.Methods.readAttribute = Element.Methods.readAttribute.wrap( + function(proceed, element, attribute) { + if (attribute === 'title') return element.title; + return proceed(element, attribute); + } + ); +} + +else if (Prototype.Browser.IE) { + $w('positionedOffset getOffsetParent viewportOffset').each(function(method) { + Element.Methods[method] = Element.Methods[method].wrap( + function(proceed, element) { + element = $(element); + var position = element.getStyle('position'); + if (position != 'static') return proceed(element); + element.setStyle({ position: 'relative' }); + var value = proceed(element); + element.setStyle({ position: position }); + return value; + } + ); + }); + + Element.Methods.getStyle = function(element, style) { + element = $(element); + style = (style == 'float' || style == 'cssFloat') ? 'styleFloat' : style.camelize(); + var value = element.style[style]; + if (!value && element.currentStyle) value = element.currentStyle[style]; + + if (style == 'opacity') { + if (value = (element.getStyle('filter') || '').match(/alpha\(opacity=(.*)\)/)) + if (value[1]) return parseFloat(value[1]) / 100; + return 1.0; + } + + if (value == 'auto') { + if ((style == 'width' || style == 'height') && (element.getStyle('display') != 'none')) + return element['offset' + style.capitalize()] + 'px'; + return null; + } + return value; + }; + + Element.Methods.setOpacity = function(element, value) { + function stripAlpha(filter){ + return filter.replace(/alpha\([^\)]*\)/gi,''); + } + element = $(element); + var currentStyle = element.currentStyle; + if ((currentStyle && !currentStyle.hasLayout) || + (!currentStyle && element.style.zoom == 'normal')) + element.style.zoom = 1; + + var filter = element.getStyle('filter'), style = element.style; + if (value == 1 || value === '') { + (filter = stripAlpha(filter)) ? + style.filter = filter : style.removeAttribute('filter'); + return element; + } else if (value < 0.00001) value = 0; + style.filter = stripAlpha(filter) + + 'alpha(opacity=' + (value * 100) + ')'; + return element; + }; + + Element._attributeTranslations = { + read: { + names: { + 'class': 'className', + 'for': 'htmlFor' + }, + values: { + _getAttr: function(element, attribute) { + return element.getAttribute(attribute, 2); + }, + _getAttrNode: function(element, attribute) { + var node = element.getAttributeNode(attribute); + return node ? node.value : ""; + }, + _getEv: function(element, attribute) { + attribute = element.getAttribute(attribute); + return attribute ? attribute.toString().slice(23, -2) : null; + }, + _flag: function(element, attribute) { + return $(element).hasAttribute(attribute) ? attribute : null; + }, + style: function(element) { + return element.style.cssText.toLowerCase(); + }, + title: function(element) { + return element.title; + } + } + } + }; + + Element._attributeTranslations.write = { + names: Object.clone(Element._attributeTranslations.read.names), + values: { + checked: function(element, value) { + element.checked = !!value; + }, + + style: function(element, value) { + element.style.cssText = value ? value : ''; + } + } + }; + + Element._attributeTranslations.has = {}; + + $w('colSpan rowSpan vAlign dateTime accessKey tabIndex ' + + 'encType maxLength readOnly longDesc').each(function(attr) { + Element._attributeTranslations.write.names[attr.toLowerCase()] = attr; + Element._attributeTranslations.has[attr.toLowerCase()] = attr; + }); + + (function(v) { + Object.extend(v, { + href: v._getAttr, + src: v._getAttr, + type: v._getAttr, + action: v._getAttrNode, + disabled: v._flag, + checked: v._flag, + readonly: v._flag, + multiple: v._flag, + onload: v._getEv, + onunload: v._getEv, + onclick: v._getEv, + ondblclick: v._getEv, + onmousedown: v._getEv, + onmouseup: v._getEv, + onmouseover: v._getEv, + onmousemove: v._getEv, + onmouseout: v._getEv, + onfocus: v._getEv, + onblur: v._getEv, + onkeypress: v._getEv, + onkeydown: v._getEv, + onkeyup: v._getEv, + onsubmit: v._getEv, + onreset: v._getEv, + onselect: v._getEv, + onchange: v._getEv + }); + })(Element._attributeTranslations.read.values); +} + +else if (Prototype.Browser.Gecko && /rv:1\.8\.0/.test(navigator.userAgent)) { + Element.Methods.setOpacity = function(element, value) { + element = $(element); + element.style.opacity = (value == 1) ? 0.999999 : + (value === '') ? '' : (value < 0.00001) ? 0 : value; + return element; + }; +} + +else if (Prototype.Browser.WebKit) { + Element.Methods.setOpacity = function(element, value) { + element = $(element); + element.style.opacity = (value == 1 || value === '') ? '' : + (value < 0.00001) ? 0 : value; + + if (value == 1) + if(element.tagName == 'IMG' && element.width) { + element.width++; element.width--; + } else try { + var n = document.createTextNode(' '); + element.appendChild(n); + element.removeChild(n); + } catch (e) { } + + return element; + }; + + // Safari returns margins on body which is incorrect if the child is absolutely + // positioned. For performance reasons, redefine Element#cumulativeOffset for + // KHTML/WebKit only. + Element.Methods.cumulativeOffset = function(element) { + var valueT = 0, valueL = 0; + do { + valueT += element.offsetTop || 0; + valueL += element.offsetLeft || 0; + if (element.offsetParent == document.body) + if (Element.getStyle(element, 'position') == 'absolute') break; + + element = element.offsetParent; + } while (element); + + return Element._returnOffset(valueL, valueT); + }; +} + +if (Prototype.Browser.IE || Prototype.Browser.Opera) { + // IE and Opera are missing .innerHTML support for TABLE-related and SELECT elements + Element.Methods.update = function(element, content) { + element = $(element); + + if (content && content.toElement) content = content.toElement(); + if (Object.isElement(content)) return element.update().insert(content); + + content = Object.toHTML(content); + var tagName = element.tagName.toUpperCase(); + + if (tagName in Element._insertionTranslations.tags) { + $A(element.childNodes).each(function(node) { element.removeChild(node) }); + Element._getContentFromAnonymousElement(tagName, content.stripScripts()) + .each(function(node) { element.appendChild(node) }); + } + else element.innerHTML = content.stripScripts(); + + content.evalScripts.bind(content).defer(); + return element; + }; +} + +if (document.createElement('div').outerHTML) { + Element.Methods.replace = function(element, content) { + element = $(element); + + if (content && content.toElement) content = content.toElement(); + if (Object.isElement(content)) { + element.parentNode.replaceChild(content, element); + return element; + } + + content = Object.toHTML(content); + var parent = element.parentNode, tagName = parent.tagName.toUpperCase(); + + if (Element._insertionTranslations.tags[tagName]) { + var nextSibling = element.next(); + var fragments = Element._getContentFromAnonymousElement(tagName, content.stripScripts()); + parent.removeChild(element); + if (nextSibling) + fragments.each(function(node) { parent.insertBefore(node, nextSibling) }); + else + fragments.each(function(node) { parent.appendChild(node) }); + } + else element.outerHTML = content.stripScripts(); + + content.evalScripts.bind(content).defer(); + return element; + }; +} + +Element._returnOffset = function(l, t) { + var result = [l, t]; + result.left = l; + result.top = t; + return result; +}; + +Element._getContentFromAnonymousElement = function(tagName, html) { + var div = new Element('div'), t = Element._insertionTranslations.tags[tagName]; + if (t) { + div.innerHTML = t[0] + html + t[1]; + t[2].times(function() { div = div.firstChild }); + } else div.innerHTML = html; + return $A(div.childNodes); +}; + +Element._insertionTranslations = { + before: function(element, node) { + element.parentNode.insertBefore(node, element); + }, + top: function(element, node) { + element.insertBefore(node, element.firstChild); + }, + bottom: function(element, node) { + element.appendChild(node); + }, + after: function(element, node) { + element.parentNode.insertBefore(node, element.nextSibling); + }, + tags: { + TABLE: ['', '
    ', 1], + TBODY: ['', '
    ', 2], + TR: ['', '
    ', 3], + TD: ['
    ', '
    ', 4], + SELECT: ['', 1] + } +}; + +(function() { + Object.extend(this.tags, { + THEAD: this.tags.TBODY, + TFOOT: this.tags.TBODY, + TH: this.tags.TD + }); +}).call(Element._insertionTranslations); + +Element.Methods.Simulated = { + hasAttribute: function(element, attribute) { + attribute = Element._attributeTranslations.has[attribute] || attribute; + var node = $(element).getAttributeNode(attribute); + return node && node.specified; + } +}; + +Element.Methods.ByTag = { }; + +Object.extend(Element, Element.Methods); + +if (!Prototype.BrowserFeatures.ElementExtensions && + document.createElement('div').__proto__) { + window.HTMLElement = { }; + window.HTMLElement.prototype = document.createElement('div').__proto__; + Prototype.BrowserFeatures.ElementExtensions = true; +} + +Element.extend = (function() { + if (Prototype.BrowserFeatures.SpecificElementExtensions) + return Prototype.K; + + var Methods = { }, ByTag = Element.Methods.ByTag; + + var extend = Object.extend(function(element) { + if (!element || element._extendedByPrototype || + element.nodeType != 1 || element == window) return element; + + var methods = Object.clone(Methods), + tagName = element.tagName, property, value; + + // extend methods for specific tags + if (ByTag[tagName]) Object.extend(methods, ByTag[tagName]); + + for (property in methods) { + value = methods[property]; + if (Object.isFunction(value) && !(property in element)) + element[property] = value.methodize(); + } + + element._extendedByPrototype = Prototype.emptyFunction; + return element; + + }, { + refresh: function() { + // extend methods for all tags (Safari doesn't need this) + if (!Prototype.BrowserFeatures.ElementExtensions) { + Object.extend(Methods, Element.Methods); + Object.extend(Methods, Element.Methods.Simulated); + } + } + }); + + extend.refresh(); + return extend; +})(); + +Element.hasAttribute = function(element, attribute) { + if (element.hasAttribute) return element.hasAttribute(attribute); + return Element.Methods.Simulated.hasAttribute(element, attribute); +}; + +Element.addMethods = function(methods) { + var F = Prototype.BrowserFeatures, T = Element.Methods.ByTag; + + if (!methods) { + Object.extend(Form, Form.Methods); + Object.extend(Form.Element, Form.Element.Methods); + Object.extend(Element.Methods.ByTag, { + "FORM": Object.clone(Form.Methods), + "INPUT": Object.clone(Form.Element.Methods), + "SELECT": Object.clone(Form.Element.Methods), + "TEXTAREA": Object.clone(Form.Element.Methods) + }); + } + + if (arguments.length == 2) { + var tagName = methods; + methods = arguments[1]; + } + + if (!tagName) Object.extend(Element.Methods, methods || { }); + else { + if (Object.isArray(tagName)) tagName.each(extend); + else extend(tagName); + } + + function extend(tagName) { + tagName = tagName.toUpperCase(); + if (!Element.Methods.ByTag[tagName]) + Element.Methods.ByTag[tagName] = { }; + Object.extend(Element.Methods.ByTag[tagName], methods); + } + + function copy(methods, destination, onlyIfAbsent) { + onlyIfAbsent = onlyIfAbsent || false; + for (var property in methods) { + var value = methods[property]; + if (!Object.isFunction(value)) continue; + if (!onlyIfAbsent || !(property in destination)) + destination[property] = value.methodize(); + } + } + + function findDOMClass(tagName) { + var klass; + var trans = { + "OPTGROUP": "OptGroup", "TEXTAREA": "TextArea", "P": "Paragraph", + "FIELDSET": "FieldSet", "UL": "UList", "OL": "OList", "DL": "DList", + "DIR": "Directory", "H1": "Heading", "H2": "Heading", "H3": "Heading", + "H4": "Heading", "H5": "Heading", "H6": "Heading", "Q": "Quote", + "INS": "Mod", "DEL": "Mod", "A": "Anchor", "IMG": "Image", "CAPTION": + "TableCaption", "COL": "TableCol", "COLGROUP": "TableCol", "THEAD": + "TableSection", "TFOOT": "TableSection", "TBODY": "TableSection", "TR": + "TableRow", "TH": "TableCell", "TD": "TableCell", "FRAMESET": + "FrameSet", "IFRAME": "IFrame" + }; + if (trans[tagName]) klass = 'HTML' + trans[tagName] + 'Element'; + if (window[klass]) return window[klass]; + klass = 'HTML' + tagName + 'Element'; + if (window[klass]) return window[klass]; + klass = 'HTML' + tagName.capitalize() + 'Element'; + if (window[klass]) return window[klass]; + + window[klass] = { }; + window[klass].prototype = document.createElement(tagName).__proto__; + return window[klass]; + } + + if (F.ElementExtensions) { + copy(Element.Methods, HTMLElement.prototype); + copy(Element.Methods.Simulated, HTMLElement.prototype, true); + } + + if (F.SpecificElementExtensions) { + for (var tag in Element.Methods.ByTag) { + var klass = findDOMClass(tag); + if (Object.isUndefined(klass)) continue; + copy(T[tag], klass.prototype); + } + } + + Object.extend(Element, Element.Methods); + delete Element.ByTag; + + if (Element.extend.refresh) Element.extend.refresh(); + Element.cache = { }; +}; + +document.viewport = { + getDimensions: function() { + var dimensions = { }; + var B = Prototype.Browser; + $w('width height').each(function(d) { + var D = d.capitalize(); + dimensions[d] = (B.WebKit && !document.evaluate) ? self['inner' + D] : + (B.Opera) ? document.body['client' + D] : document.documentElement['client' + D]; + }); + return dimensions; + }, + + getWidth: function() { + return this.getDimensions().width; + }, + + getHeight: function() { + return this.getDimensions().height; + }, + + getScrollOffsets: function() { + return Element._returnOffset( + window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft, + window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop); + } +}; +/* Portions of the Selector class are derived from Jack Slocum’s DomQuery, + * part of YUI-Ext version 0.40, distributed under the terms of an MIT-style + * license. Please see http://www.yui-ext.com/ for more information. */ + +var Selector = Class.create({ + initialize: function(expression) { + this.expression = expression.strip(); + this.compileMatcher(); + }, + + shouldUseXPath: function() { + if (!Prototype.BrowserFeatures.XPath) return false; + + var e = this.expression; + + // Safari 3 chokes on :*-of-type and :empty + if (Prototype.Browser.WebKit && + (e.include("-of-type") || e.include(":empty"))) + return false; + + // XPath can't do namespaced attributes, nor can it read + // the "checked" property from DOM nodes + if ((/(\[[\w-]*?:|:checked)/).test(this.expression)) + return false; + + return true; + }, + + compileMatcher: function() { + if (this.shouldUseXPath()) + return this.compileXPathMatcher(); + + var e = this.expression, ps = Selector.patterns, h = Selector.handlers, + c = Selector.criteria, le, p, m; + + if (Selector._cache[e]) { + this.matcher = Selector._cache[e]; + return; + } + + this.matcher = ["this.matcher = function(root) {", + "var r = root, h = Selector.handlers, c = false, n;"]; + + while (e && le != e && (/\S/).test(e)) { + le = e; + for (var i in ps) { + p = ps[i]; + if (m = e.match(p)) { + this.matcher.push(Object.isFunction(c[i]) ? c[i](m) : + new Template(c[i]).evaluate(m)); + e = e.replace(m[0], ''); + break; + } + } + } + + this.matcher.push("return h.unique(n);\n}"); + eval(this.matcher.join('\n')); + Selector._cache[this.expression] = this.matcher; + }, + + compileXPathMatcher: function() { + var e = this.expression, ps = Selector.patterns, + x = Selector.xpath, le, m; + + if (Selector._cache[e]) { + this.xpath = Selector._cache[e]; return; + } + + this.matcher = ['.//*']; + while (e && le != e && (/\S/).test(e)) { + le = e; + for (var i in ps) { + if (m = e.match(ps[i])) { + this.matcher.push(Object.isFunction(x[i]) ? x[i](m) : + new Template(x[i]).evaluate(m)); + e = e.replace(m[0], ''); + break; + } + } + } + + this.xpath = this.matcher.join(''); + Selector._cache[this.expression] = this.xpath; + }, + + findElements: function(root) { + root = root || document; + if (this.xpath) return document._getElementsByXPath(this.xpath, root); + return this.matcher(root); + }, + + match: function(element) { + this.tokens = []; + + var e = this.expression, ps = Selector.patterns, as = Selector.assertions; + var le, p, m; + + while (e && le !== e && (/\S/).test(e)) { + le = e; + for (var i in ps) { + p = ps[i]; + if (m = e.match(p)) { + // use the Selector.assertions methods unless the selector + // is too complex. + if (as[i]) { + this.tokens.push([i, Object.clone(m)]); + e = e.replace(m[0], ''); + } else { + // reluctantly do a document-wide search + // and look for a match in the array + return this.findElements(document).include(element); + } + } + } + } + + var match = true, name, matches; + for (var i = 0, token; token = this.tokens[i]; i++) { + name = token[0], matches = token[1]; + if (!Selector.assertions[name](element, matches)) { + match = false; break; + } + } + + return match; + }, + + toString: function() { + return this.expression; + }, + + inspect: function() { + return "#"; + } +}); + +Object.extend(Selector, { + _cache: { }, + + xpath: { + descendant: "//*", + child: "/*", + adjacent: "/following-sibling::*[1]", + laterSibling: '/following-sibling::*', + tagName: function(m) { + if (m[1] == '*') return ''; + return "[local-name()='" + m[1].toLowerCase() + + "' or local-name()='" + m[1].toUpperCase() + "']"; + }, + className: "[contains(concat(' ', @class, ' '), ' #{1} ')]", + id: "[@id='#{1}']", + attrPresence: function(m) { + m[1] = m[1].toLowerCase(); + return new Template("[@#{1}]").evaluate(m); + }, + attr: function(m) { + m[1] = m[1].toLowerCase(); + m[3] = m[5] || m[6]; + return new Template(Selector.xpath.operators[m[2]]).evaluate(m); + }, + pseudo: function(m) { + var h = Selector.xpath.pseudos[m[1]]; + if (!h) return ''; + if (Object.isFunction(h)) return h(m); + return new Template(Selector.xpath.pseudos[m[1]]).evaluate(m); + }, + operators: { + '=': "[@#{1}='#{3}']", + '!=': "[@#{1}!='#{3}']", + '^=': "[starts-with(@#{1}, '#{3}')]", + '$=': "[substring(@#{1}, (string-length(@#{1}) - string-length('#{3}') + 1))='#{3}']", + '*=': "[contains(@#{1}, '#{3}')]", + '~=': "[contains(concat(' ', @#{1}, ' '), ' #{3} ')]", + '|=': "[contains(concat('-', @#{1}, '-'), '-#{3}-')]" + }, + pseudos: { + 'first-child': '[not(preceding-sibling::*)]', + 'last-child': '[not(following-sibling::*)]', + 'only-child': '[not(preceding-sibling::* or following-sibling::*)]', + 'empty': "[count(*) = 0 and (count(text()) = 0 or translate(text(), ' \t\r\n', '') = '')]", + 'checked': "[@checked]", + 'disabled': "[@disabled]", + 'enabled': "[not(@disabled)]", + 'not': function(m) { + var e = m[6], p = Selector.patterns, + x = Selector.xpath, le, v; + + var exclusion = []; + while (e && le != e && (/\S/).test(e)) { + le = e; + for (var i in p) { + if (m = e.match(p[i])) { + v = Object.isFunction(x[i]) ? x[i](m) : new Template(x[i]).evaluate(m); + exclusion.push("(" + v.substring(1, v.length - 1) + ")"); + e = e.replace(m[0], ''); + break; + } + } + } + return "[not(" + exclusion.join(" and ") + ")]"; + }, + 'nth-child': function(m) { + return Selector.xpath.pseudos.nth("(count(./preceding-sibling::*) + 1) ", m); + }, + 'nth-last-child': function(m) { + return Selector.xpath.pseudos.nth("(count(./following-sibling::*) + 1) ", m); + }, + 'nth-of-type': function(m) { + return Selector.xpath.pseudos.nth("position() ", m); + }, + 'nth-last-of-type': function(m) { + return Selector.xpath.pseudos.nth("(last() + 1 - position()) ", m); + }, + 'first-of-type': function(m) { + m[6] = "1"; return Selector.xpath.pseudos['nth-of-type'](m); + }, + 'last-of-type': function(m) { + m[6] = "1"; return Selector.xpath.pseudos['nth-last-of-type'](m); + }, + 'only-of-type': function(m) { + var p = Selector.xpath.pseudos; return p['first-of-type'](m) + p['last-of-type'](m); + }, + nth: function(fragment, m) { + var mm, formula = m[6], predicate; + if (formula == 'even') formula = '2n+0'; + if (formula == 'odd') formula = '2n+1'; + if (mm = formula.match(/^(\d+)$/)) // digit only + return '[' + fragment + "= " + mm[1] + ']'; + if (mm = formula.match(/^(-?\d*)?n(([+-])(\d+))?/)) { // an+b + if (mm[1] == "-") mm[1] = -1; + var a = mm[1] ? Number(mm[1]) : 1; + var b = mm[2] ? Number(mm[2]) : 0; + predicate = "[((#{fragment} - #{b}) mod #{a} = 0) and " + + "((#{fragment} - #{b}) div #{a} >= 0)]"; + return new Template(predicate).evaluate({ + fragment: fragment, a: a, b: b }); + } + } + } + }, + + criteria: { + tagName: 'n = h.tagName(n, r, "#{1}", c); c = false;', + className: 'n = h.className(n, r, "#{1}", c); c = false;', + id: 'n = h.id(n, r, "#{1}", c); c = false;', + attrPresence: 'n = h.attrPresence(n, r, "#{1}"); c = false;', + attr: function(m) { + m[3] = (m[5] || m[6]); + return new Template('n = h.attr(n, r, "#{1}", "#{3}", "#{2}"); c = false;').evaluate(m); + }, + pseudo: function(m) { + if (m[6]) m[6] = m[6].replace(/"/g, '\\"'); + return new Template('n = h.pseudo(n, "#{1}", "#{6}", r, c); c = false;').evaluate(m); + }, + descendant: 'c = "descendant";', + child: 'c = "child";', + adjacent: 'c = "adjacent";', + laterSibling: 'c = "laterSibling";' + }, + + patterns: { + // combinators must be listed first + // (and descendant needs to be last combinator) + laterSibling: /^\s*~\s*/, + child: /^\s*>\s*/, + adjacent: /^\s*\+\s*/, + descendant: /^\s/, + + // selectors follow + tagName: /^\s*(\*|[\w\-]+)(\b|$)?/, + id: /^#([\w\-\*]+)(\b|$)/, + className: /^\.([\w\-\*]+)(\b|$)/, + pseudo: +/^:((first|last|nth|nth-last|only)(-child|-of-type)|empty|checked|(en|dis)abled|not)(\((.*?)\))?(\b|$|(?=\s|[:+~>]))/, + attrPresence: /^\[([\w]+)\]/, + attr: /\[((?:[\w-]*:)?[\w-]+)\s*(?:([!^$*~|]?=)\s*((['"])([^\4]*?)\4|([^'"][^\]]*?)))?\]/ + }, + + // for Selector.match and Element#match + assertions: { + tagName: function(element, matches) { + return matches[1].toUpperCase() == element.tagName.toUpperCase(); + }, + + className: function(element, matches) { + return Element.hasClassName(element, matches[1]); + }, + + id: function(element, matches) { + return element.id === matches[1]; + }, + + attrPresence: function(element, matches) { + return Element.hasAttribute(element, matches[1]); + }, + + attr: function(element, matches) { + var nodeValue = Element.readAttribute(element, matches[1]); + return Selector.operators[matches[2]](nodeValue, matches[3]); + } + }, + + handlers: { + // UTILITY FUNCTIONS + // joins two collections + concat: function(a, b) { + for (var i = 0, node; node = b[i]; i++) + a.push(node); + return a; + }, + + // marks an array of nodes for counting + mark: function(nodes) { + for (var i = 0, node; node = nodes[i]; i++) + node._counted = true; + return nodes; + }, + + unmark: function(nodes) { + for (var i = 0, node; node = nodes[i]; i++) + node._counted = undefined; + return nodes; + }, + + // mark each child node with its position (for nth calls) + // "ofType" flag indicates whether we're indexing for nth-of-type + // rather than nth-child + index: function(parentNode, reverse, ofType) { + parentNode._counted = true; + if (reverse) { + for (var nodes = parentNode.childNodes, i = nodes.length - 1, j = 1; i >= 0; i--) { + var node = nodes[i]; + if (node.nodeType == 1 && (!ofType || node._counted)) node.nodeIndex = j++; + } + } else { + for (var i = 0, j = 1, nodes = parentNode.childNodes; node = nodes[i]; i++) + if (node.nodeType == 1 && (!ofType || node._counted)) node.nodeIndex = j++; + } + }, + + // filters out duplicates and extends all nodes + unique: function(nodes) { + if (nodes.length == 0) return nodes; + var results = [], n; + for (var i = 0, l = nodes.length; i < l; i++) + if (!(n = nodes[i])._counted) { + n._counted = true; + results.push(Element.extend(n)); + } + return Selector.handlers.unmark(results); + }, + + // COMBINATOR FUNCTIONS + descendant: function(nodes) { + var h = Selector.handlers; + for (var i = 0, results = [], node; node = nodes[i]; i++) + h.concat(results, node.getElementsByTagName('*')); + return results; + }, + + child: function(nodes) { + var h = Selector.handlers; + for (var i = 0, results = [], node; node = nodes[i]; i++) { + for (var j = 0, child; child = node.childNodes[j]; j++) + if (child.nodeType == 1 && child.tagName != '!') results.push(child); + } + return results; + }, + + adjacent: function(nodes) { + for (var i = 0, results = [], node; node = nodes[i]; i++) { + var next = this.nextElementSibling(node); + if (next) results.push(next); + } + return results; + }, + + laterSibling: function(nodes) { + var h = Selector.handlers; + for (var i = 0, results = [], node; node = nodes[i]; i++) + h.concat(results, Element.nextSiblings(node)); + return results; + }, + + nextElementSibling: function(node) { + while (node = node.nextSibling) + if (node.nodeType == 1) return node; + return null; + }, + + previousElementSibling: function(node) { + while (node = node.previousSibling) + if (node.nodeType == 1) return node; + return null; + }, + + // TOKEN FUNCTIONS + tagName: function(nodes, root, tagName, combinator) { + var uTagName = tagName.toUpperCase(); + var results = [], h = Selector.handlers; + if (nodes) { + if (combinator) { + // fastlane for ordinary descendant combinators + if (combinator == "descendant") { + for (var i = 0, node; node = nodes[i]; i++) + h.concat(results, node.getElementsByTagName(tagName)); + return results; + } else nodes = this[combinator](nodes); + if (tagName == "*") return nodes; + } + for (var i = 0, node; node = nodes[i]; i++) + if (node.tagName.toUpperCase() === uTagName) results.push(node); + return results; + } else return root.getElementsByTagName(tagName); + }, + + id: function(nodes, root, id, combinator) { + var targetNode = $(id), h = Selector.handlers; + if (!targetNode) return []; + if (!nodes && root == document) return [targetNode]; + if (nodes) { + if (combinator) { + if (combinator == 'child') { + for (var i = 0, node; node = nodes[i]; i++) + if (targetNode.parentNode == node) return [targetNode]; + } else if (combinator == 'descendant') { + for (var i = 0, node; node = nodes[i]; i++) + if (Element.descendantOf(targetNode, node)) return [targetNode]; + } else if (combinator == 'adjacent') { + for (var i = 0, node; node = nodes[i]; i++) + if (Selector.handlers.previousElementSibling(targetNode) == node) + return [targetNode]; + } else nodes = h[combinator](nodes); + } + for (var i = 0, node; node = nodes[i]; i++) + if (node == targetNode) return [targetNode]; + return []; + } + return (targetNode && Element.descendantOf(targetNode, root)) ? [targetNode] : []; + }, + + className: function(nodes, root, className, combinator) { + if (nodes && combinator) nodes = this[combinator](nodes); + return Selector.handlers.byClassName(nodes, root, className); + }, + + byClassName: function(nodes, root, className) { + if (!nodes) nodes = Selector.handlers.descendant([root]); + var needle = ' ' + className + ' '; + for (var i = 0, results = [], node, nodeClassName; node = nodes[i]; i++) { + nodeClassName = node.className; + if (nodeClassName.length == 0) continue; + if (nodeClassName == className || (' ' + nodeClassName + ' ').include(needle)) + results.push(node); + } + return results; + }, + + attrPresence: function(nodes, root, attr) { + if (!nodes) nodes = root.getElementsByTagName("*"); + var results = []; + for (var i = 0, node; node = nodes[i]; i++) + if (Element.hasAttribute(node, attr)) results.push(node); + return results; + }, + + attr: function(nodes, root, attr, value, operator) { + if (!nodes) nodes = root.getElementsByTagName("*"); + var handler = Selector.operators[operator], results = []; + for (var i = 0, node; node = nodes[i]; i++) { + var nodeValue = Element.readAttribute(node, attr); + if (nodeValue === null) continue; + if (handler(nodeValue, value)) results.push(node); + } + return results; + }, + + pseudo: function(nodes, name, value, root, combinator) { + if (nodes && combinator) nodes = this[combinator](nodes); + if (!nodes) nodes = root.getElementsByTagName("*"); + return Selector.pseudos[name](nodes, value, root); + } + }, + + pseudos: { + 'first-child': function(nodes, value, root) { + for (var i = 0, results = [], node; node = nodes[i]; i++) { + if (Selector.handlers.previousElementSibling(node)) continue; + results.push(node); + } + return results; + }, + 'last-child': function(nodes, value, root) { + for (var i = 0, results = [], node; node = nodes[i]; i++) { + if (Selector.handlers.nextElementSibling(node)) continue; + results.push(node); + } + return results; + }, + 'only-child': function(nodes, value, root) { + var h = Selector.handlers; + for (var i = 0, results = [], node; node = nodes[i]; i++) + if (!h.previousElementSibling(node) && !h.nextElementSibling(node)) + results.push(node); + return results; + }, + 'nth-child': function(nodes, formula, root) { + return Selector.pseudos.nth(nodes, formula, root); + }, + 'nth-last-child': function(nodes, formula, root) { + return Selector.pseudos.nth(nodes, formula, root, true); + }, + 'nth-of-type': function(nodes, formula, root) { + return Selector.pseudos.nth(nodes, formula, root, false, true); + }, + 'nth-last-of-type': function(nodes, formula, root) { + return Selector.pseudos.nth(nodes, formula, root, true, true); + }, + 'first-of-type': function(nodes, formula, root) { + return Selector.pseudos.nth(nodes, "1", root, false, true); + }, + 'last-of-type': function(nodes, formula, root) { + return Selector.pseudos.nth(nodes, "1", root, true, true); + }, + 'only-of-type': function(nodes, formula, root) { + var p = Selector.pseudos; + return p['last-of-type'](p['first-of-type'](nodes, formula, root), formula, root); + }, + + // handles the an+b logic + getIndices: function(a, b, total) { + if (a == 0) return b > 0 ? [b] : []; + return $R(1, total).inject([], function(memo, i) { + if (0 == (i - b) % a && (i - b) / a >= 0) memo.push(i); + return memo; + }); + }, + + // handles nth(-last)-child, nth(-last)-of-type, and (first|last)-of-type + nth: function(nodes, formula, root, reverse, ofType) { + if (nodes.length == 0) return []; + if (formula == 'even') formula = '2n+0'; + if (formula == 'odd') formula = '2n+1'; + var h = Selector.handlers, results = [], indexed = [], m; + h.mark(nodes); + for (var i = 0, node; node = nodes[i]; i++) { + if (!node.parentNode._counted) { + h.index(node.parentNode, reverse, ofType); + indexed.push(node.parentNode); + } + } + if (formula.match(/^\d+$/)) { // just a number + formula = Number(formula); + for (var i = 0, node; node = nodes[i]; i++) + if (node.nodeIndex == formula) results.push(node); + } else if (m = formula.match(/^(-?\d*)?n(([+-])(\d+))?/)) { // an+b + if (m[1] == "-") m[1] = -1; + var a = m[1] ? Number(m[1]) : 1; + var b = m[2] ? Number(m[2]) : 0; + var indices = Selector.pseudos.getIndices(a, b, nodes.length); + for (var i = 0, node, l = indices.length; node = nodes[i]; i++) { + for (var j = 0; j < l; j++) + if (node.nodeIndex == indices[j]) results.push(node); + } + } + h.unmark(nodes); + h.unmark(indexed); + return results; + }, + + 'empty': function(nodes, value, root) { + for (var i = 0, results = [], node; node = nodes[i]; i++) { + // IE treats comments as element nodes + if (node.tagName == '!' || (node.firstChild && !node.innerHTML.match(/^\s*$/))) continue; + results.push(node); + } + return results; + }, + + 'not': function(nodes, selector, root) { + var h = Selector.handlers, selectorType, m; + var exclusions = new Selector(selector).findElements(root); + h.mark(exclusions); + for (var i = 0, results = [], node; node = nodes[i]; i++) + if (!node._counted) results.push(node); + h.unmark(exclusions); + return results; + }, + + 'enabled': function(nodes, value, root) { + for (var i = 0, results = [], node; node = nodes[i]; i++) + if (!node.disabled) results.push(node); + return results; + }, + + 'disabled': function(nodes, value, root) { + for (var i = 0, results = [], node; node = nodes[i]; i++) + if (node.disabled) results.push(node); + return results; + }, + + 'checked': function(nodes, value, root) { + for (var i = 0, results = [], node; node = nodes[i]; i++) + if (node.checked) results.push(node); + return results; + } + }, + + operators: { + '=': function(nv, v) { return nv == v; }, + '!=': function(nv, v) { return nv != v; }, + '^=': function(nv, v) { return nv.startsWith(v); }, + '$=': function(nv, v) { return nv.endsWith(v); }, + '*=': function(nv, v) { return nv.include(v); }, + '~=': function(nv, v) { return (' ' + nv + ' ').include(' ' + v + ' '); }, + '|=': function(nv, v) { return ('-' + nv.toUpperCase() + '-').include('-' + v.toUpperCase() + '-'); } + }, + + matchElements: function(elements, expression) { + var matches = new Selector(expression).findElements(), h = Selector.handlers; + h.mark(matches); + for (var i = 0, results = [], element; element = elements[i]; i++) + if (element._counted) results.push(element); + h.unmark(matches); + return results; + }, + + findElement: function(elements, expression, index) { + if (Object.isNumber(expression)) { + index = expression; expression = false; + } + return Selector.matchElements(elements, expression || '*')[index || 0]; + }, + + findChildElements: function(element, expressions) { + var exprs = expressions.join(','); + expressions = []; + exprs.scan(/(([\w#:.~>+()\s-]+|\*|\[.*?\])+)\s*(,|$)/, function(m) { + expressions.push(m[1].strip()); + }); + var results = [], h = Selector.handlers; + for (var i = 0, l = expressions.length, selector; i < l; i++) { + selector = new Selector(expressions[i].strip()); + h.concat(results, selector.findElements(element)); + } + return (l > 1) ? h.unique(results) : results; + } +}); + +if (Prototype.Browser.IE) { + // IE returns comment nodes on getElementsByTagName("*"). + // Filter them out. + Selector.handlers.concat = function(a, b) { + for (var i = 0, node; node = b[i]; i++) + if (node.tagName !== "!") a.push(node); + return a; + }; +} + +function $$() { + return Selector.findChildElements(document, $A(arguments)); +} +var Form = { + reset: function(form) { + $(form).reset(); + return form; + }, + + serializeElements: function(elements, options) { + if (typeof options != 'object') options = { hash: !!options }; + else if (Object.isUndefined(options.hash)) options.hash = true; + var key, value, submitted = false, submit = options.submit; + + var data = elements.inject({ }, function(result, element) { + if (!element.disabled && element.name) { + key = element.name; value = $(element).getValue(); + if (value != null && (element.type != 'submit' || (!submitted && + submit !== false && (!submit || key == submit) && (submitted = true)))) { + if (key in result) { + // a key is already present; construct an array of values + if (!Object.isArray(result[key])) result[key] = [result[key]]; + result[key].push(value); + } + else result[key] = value; + } + } + return result; + }); + + return options.hash ? data : Object.toQueryString(data); + } +}; + +Form.Methods = { + serialize: function(form, options) { + return Form.serializeElements(Form.getElements(form), options); + }, + + getElements: function(form) { + return $A($(form).getElementsByTagName('*')).inject([], + function(elements, child) { + if (Form.Element.Serializers[child.tagName.toLowerCase()]) + elements.push(Element.extend(child)); + return elements; + } + ); + }, + + getInputs: function(form, typeName, name) { + form = $(form); + var inputs = form.getElementsByTagName('input'); + + if (!typeName && !name) return $A(inputs).map(Element.extend); + + for (var i = 0, matchingInputs = [], length = inputs.length; i < length; i++) { + var input = inputs[i]; + if ((typeName && input.type != typeName) || (name && input.name != name)) + continue; + matchingInputs.push(Element.extend(input)); + } + + return matchingInputs; + }, + + disable: function(form) { + form = $(form); + Form.getElements(form).invoke('disable'); + return form; + }, + + enable: function(form) { + form = $(form); + Form.getElements(form).invoke('enable'); + return form; + }, + + findFirstElement: function(form) { + var elements = $(form).getElements().findAll(function(element) { + return 'hidden' != element.type && !element.disabled; + }); + var firstByIndex = elements.findAll(function(element) { + return element.hasAttribute('tabIndex') && element.tabIndex >= 0; + }).sortBy(function(element) { return element.tabIndex }).first(); + + return firstByIndex ? firstByIndex : elements.find(function(element) { + return ['input', 'select', 'textarea'].include(element.tagName.toLowerCase()); + }); + }, + + focusFirstElement: function(form) { + form = $(form); + form.findFirstElement().activate(); + return form; + }, + + request: function(form, options) { + form = $(form), options = Object.clone(options || { }); + + var params = options.parameters, action = form.readAttribute('action') || ''; + if (action.blank()) action = window.location.href; + options.parameters = form.serialize(true); + + if (params) { + if (Object.isString(params)) params = params.toQueryParams(); + Object.extend(options.parameters, params); + } + + if (form.hasAttribute('method') && !options.method) + options.method = form.method; + + return new Ajax.Request(action, options); + } +}; + +/*--------------------------------------------------------------------------*/ + +Form.Element = { + focus: function(element) { + $(element).focus(); + return element; + }, + + select: function(element) { + $(element).select(); + return element; + } +}; + +Form.Element.Methods = { + serialize: function(element) { + element = $(element); + if (!element.disabled && element.name) { + var value = element.getValue(); + if (value != undefined) { + var pair = { }; + pair[element.name] = value; + return Object.toQueryString(pair); + } + } + return ''; + }, + + getValue: function(element) { + element = $(element); + var method = element.tagName.toLowerCase(); + return Form.Element.Serializers[method](element); + }, + + setValue: function(element, value) { + element = $(element); + var method = element.tagName.toLowerCase(); + Form.Element.Serializers[method](element, value); + return element; + }, + + clear: function(element) { + $(element).value = ''; + return element; + }, + + present: function(element) { + return $(element).value != ''; + }, + + activate: function(element) { + element = $(element); + try { + element.focus(); + if (element.select && (element.tagName.toLowerCase() != 'input' || + !['button', 'reset', 'submit'].include(element.type))) + element.select(); + } catch (e) { } + return element; + }, + + disable: function(element) { + element = $(element); + element.blur(); + element.disabled = true; + return element; + }, + + enable: function(element) { + element = $(element); + element.disabled = false; + return element; + } +}; + +/*--------------------------------------------------------------------------*/ + +var Field = Form.Element; +var $F = Form.Element.Methods.getValue; + +/*--------------------------------------------------------------------------*/ + +Form.Element.Serializers = { + input: function(element, value) { + switch (element.type.toLowerCase()) { + case 'checkbox': + case 'radio': + return Form.Element.Serializers.inputSelector(element, value); + default: + return Form.Element.Serializers.textarea(element, value); + } + }, + + inputSelector: function(element, value) { + if (Object.isUndefined(value)) return element.checked ? element.value : null; + else element.checked = !!value; + }, + + textarea: function(element, value) { + if (Object.isUndefined(value)) return element.value; + else element.value = value; + }, + + select: function(element, index) { + if (Object.isUndefined(index)) + return this[element.type == 'select-one' ? + 'selectOne' : 'selectMany'](element); + else { + var opt, value, single = !Object.isArray(index); + for (var i = 0, length = element.length; i < length; i++) { + opt = element.options[i]; + value = this.optionValue(opt); + if (single) { + if (value == index) { + opt.selected = true; + return; + } + } + else opt.selected = index.include(value); + } + } + }, + + selectOne: function(element) { + var index = element.selectedIndex; + return index >= 0 ? this.optionValue(element.options[index]) : null; + }, + + selectMany: function(element) { + var values, length = element.length; + if (!length) return null; + + for (var i = 0, values = []; i < length; i++) { + var opt = element.options[i]; + if (opt.selected) values.push(this.optionValue(opt)); + } + return values; + }, + + optionValue: function(opt) { + // extend element because hasAttribute may not be native + return Element.extend(opt).hasAttribute('value') ? opt.value : opt.text; + } +}; + +/*--------------------------------------------------------------------------*/ + +Abstract.TimedObserver = Class.create(PeriodicalExecuter, { + initialize: function($super, element, frequency, callback) { + $super(callback, frequency); + this.element = $(element); + this.lastValue = this.getValue(); + }, + + execute: function() { + var value = this.getValue(); + if (Object.isString(this.lastValue) && Object.isString(value) ? + this.lastValue != value : String(this.lastValue) != String(value)) { + this.callback(this.element, value); + this.lastValue = value; + } + } +}); + +Form.Element.Observer = Class.create(Abstract.TimedObserver, { + getValue: function() { + return Form.Element.getValue(this.element); + } +}); + +Form.Observer = Class.create(Abstract.TimedObserver, { + getValue: function() { + return Form.serialize(this.element); + } +}); + +/*--------------------------------------------------------------------------*/ + +Abstract.EventObserver = Class.create({ + initialize: function(element, callback) { + this.element = $(element); + this.callback = callback; + + this.lastValue = this.getValue(); + if (this.element.tagName.toLowerCase() == 'form') + this.registerFormCallbacks(); + else + this.registerCallback(this.element); + }, + + onElementEvent: function() { + var value = this.getValue(); + if (this.lastValue != value) { + this.callback(this.element, value); + this.lastValue = value; + } + }, + + registerFormCallbacks: function() { + Form.getElements(this.element).each(this.registerCallback, this); + }, + + registerCallback: function(element) { + if (element.type) { + switch (element.type.toLowerCase()) { + case 'checkbox': + case 'radio': + Event.observe(element, 'click', this.onElementEvent.bind(this)); + break; + default: + Event.observe(element, 'change', this.onElementEvent.bind(this)); + break; + } + } + } +}); + +Form.Element.EventObserver = Class.create(Abstract.EventObserver, { + getValue: function() { + return Form.Element.getValue(this.element); + } +}); + +Form.EventObserver = Class.create(Abstract.EventObserver, { + getValue: function() { + return Form.serialize(this.element); + } +}); +if (!window.Event) var Event = { }; + +Object.extend(Event, { + KEY_BACKSPACE: 8, + KEY_TAB: 9, + KEY_RETURN: 13, + KEY_ESC: 27, + KEY_LEFT: 37, + KEY_UP: 38, + KEY_RIGHT: 39, + KEY_DOWN: 40, + KEY_DELETE: 46, + KEY_HOME: 36, + KEY_END: 35, + KEY_PAGEUP: 33, + KEY_PAGEDOWN: 34, + KEY_INSERT: 45, + + cache: { }, + + relatedTarget: function(event) { + var element; + switch(event.type) { + case 'mouseover': element = event.fromElement; break; + case 'mouseout': element = event.toElement; break; + default: return null; + } + return Element.extend(element); + } +}); + +Event.Methods = (function() { + var isButton; + + if (Prototype.Browser.IE) { + var buttonMap = { 0: 1, 1: 4, 2: 2 }; + isButton = function(event, code) { + return event.button == buttonMap[code]; + }; + + } else if (Prototype.Browser.WebKit) { + isButton = function(event, code) { + switch (code) { + case 0: return event.which == 1 && !event.metaKey; + case 1: return event.which == 1 && event.metaKey; + default: return false; + } + }; + + } else { + isButton = function(event, code) { + return event.which ? (event.which === code + 1) : (event.button === code); + }; + } + + return { + isLeftClick: function(event) { return isButton(event, 0) }, + isMiddleClick: function(event) { return isButton(event, 1) }, + isRightClick: function(event) { return isButton(event, 2) }, + + element: function(event) { + var node = Event.extend(event).target; + return Element.extend(node.nodeType == Node.TEXT_NODE ? node.parentNode : node); + }, + + findElement: function(event, expression) { + var element = Event.element(event); + if (!expression) return element; + var elements = [element].concat(element.ancestors()); + return Selector.findElement(elements, expression, 0); + }, + + pointer: function(event) { + return { + x: event.pageX || (event.clientX + + (document.documentElement.scrollLeft || document.body.scrollLeft)), + y: event.pageY || (event.clientY + + (document.documentElement.scrollTop || document.body.scrollTop)) + }; + }, + + pointerX: function(event) { return Event.pointer(event).x }, + pointerY: function(event) { return Event.pointer(event).y }, + + stop: function(event) { + Event.extend(event); + event.preventDefault(); + event.stopPropagation(); + event.stopped = true; + } + }; +})(); + +Event.extend = (function() { + var methods = Object.keys(Event.Methods).inject({ }, function(m, name) { + m[name] = Event.Methods[name].methodize(); + return m; + }); + + if (Prototype.Browser.IE) { + Object.extend(methods, { + stopPropagation: function() { this.cancelBubble = true }, + preventDefault: function() { this.returnValue = false }, + inspect: function() { return "[object Event]" } + }); + + return function(event) { + if (!event) return false; + if (event._extendedByPrototype) return event; + + event._extendedByPrototype = Prototype.emptyFunction; + var pointer = Event.pointer(event); + Object.extend(event, { + target: event.srcElement, + relatedTarget: Event.relatedTarget(event), + pageX: pointer.x, + pageY: pointer.y + }); + return Object.extend(event, methods); + }; + + } else { + Event.prototype = Event.prototype || document.createEvent("HTMLEvents").__proto__; + Object.extend(Event.prototype, methods); + return Prototype.K; + } +})(); + +Object.extend(Event, (function() { + var cache = Event.cache; + + function getEventID(element) { + if (element._eventID) return element._eventID; + arguments.callee.id = arguments.callee.id || 1; + return element._eventID = ++arguments.callee.id; + } + + function getDOMEventName(eventName) { + if (eventName && eventName.include(':')) return "dataavailable"; + return eventName; + } + + function getCacheForID(id) { + return cache[id] = cache[id] || { }; + } + + function getWrappersForEventName(id, eventName) { + var c = getCacheForID(id); + return c[eventName] = c[eventName] || []; + } + + function createWrapper(element, eventName, handler) { + var id = getEventID(element); + var c = getWrappersForEventName(id, eventName); + if (c.pluck("handler").include(handler)) return false; + + var wrapper = function(event) { + if (!Event || !Event.extend || + (event.eventName && event.eventName != eventName)) + return false; + + Event.extend(event); + handler.call(element, event); + }; + + wrapper.handler = handler; + c.push(wrapper); + return wrapper; + } + + function findWrapper(id, eventName, handler) { + var c = getWrappersForEventName(id, eventName); + return c.find(function(wrapper) { return wrapper.handler == handler }); + } + + function destroyWrapper(id, eventName, handler) { + var c = getCacheForID(id); + if (!c[eventName]) return false; + c[eventName] = c[eventName].without(findWrapper(id, eventName, handler)); + } + + function destroyCache() { + for (var id in cache) + for (var eventName in cache[id]) + cache[id][eventName] = null; + } + + if (window.attachEvent) { + window.attachEvent("onunload", destroyCache); + } + + return { + observe: function(element, eventName, handler) { + element = $(element); + var name = getDOMEventName(eventName); + + var wrapper = createWrapper(element, eventName, handler); + if (!wrapper) return element; + + if (element.addEventListener) { + element.addEventListener(name, wrapper, false); + } else { + element.attachEvent("on" + name, wrapper); + } + + return element; + }, + + stopObserving: function(element, eventName, handler) { + element = $(element); + var id = getEventID(element), name = getDOMEventName(eventName); + + if (!handler && eventName) { + getWrappersForEventName(id, eventName).each(function(wrapper) { + element.stopObserving(eventName, wrapper.handler); + }); + return element; + + } else if (!eventName) { + Object.keys(getCacheForID(id)).each(function(eventName) { + element.stopObserving(eventName); + }); + return element; + } + + var wrapper = findWrapper(id, eventName, handler); + if (!wrapper) return element; + + if (element.removeEventListener) { + element.removeEventListener(name, wrapper, false); + } else { + element.detachEvent("on" + name, wrapper); + } + + destroyWrapper(id, eventName, handler); + + return element; + }, + + fire: function(element, eventName, memo) { + element = $(element); + if (element == document && document.createEvent && !element.dispatchEvent) + element = document.documentElement; + + var event; + if (document.createEvent) { + event = document.createEvent("HTMLEvents"); + event.initEvent("dataavailable", true, true); + } else { + event = document.createEventObject(); + event.eventType = "ondataavailable"; + } + + event.eventName = eventName; + event.memo = memo || { }; + + if (document.createEvent) { + element.dispatchEvent(event); + } else { + element.fireEvent(event.eventType, event); + } + + return Event.extend(event); + } + }; +})()); + +Object.extend(Event, Event.Methods); + +Element.addMethods({ + fire: Event.fire, + observe: Event.observe, + stopObserving: Event.stopObserving +}); + +Object.extend(document, { + fire: Element.Methods.fire.methodize(), + observe: Element.Methods.observe.methodize(), + stopObserving: Element.Methods.stopObserving.methodize(), + loaded: false +}); + +(function() { + /* Support for the DOMContentLoaded event is based on work by Dan Webb, + Matthias Miller, Dean Edwards and John Resig. */ + + var timer; + + function fireContentLoadedEvent() { + if (document.loaded) return; + if (timer) window.clearInterval(timer); + document.fire("dom:loaded"); + document.loaded = true; + } + + if (document.addEventListener) { + if (Prototype.Browser.WebKit) { + timer = window.setInterval(function() { + if (/loaded|complete/.test(document.readyState)) + fireContentLoadedEvent(); + }, 0); + + Event.observe(window, "load", fireContentLoadedEvent); + + } else { + document.addEventListener("DOMContentLoaded", + fireContentLoadedEvent, false); + } + + } else { + document.write(" to your HTML + Add class="sortable" to any table you'd like to make sortable + Click on the headers to sort + + Thanks to many, many people for contributions and suggestions. + Licenced as X11: http://www.kryogenix.org/code/browser/licence.html + This basically means: do what you want with it. +*/ + + +var stIsIE = /*@cc_on!@*/false; + +sorttable = { + init: function() { + // quit if this function has already been called + if (arguments.callee.done) return; + // flag this function so we don't do the same thing twice + arguments.callee.done = true; + // kill the timer + if (_timer) clearInterval(_timer); + + if (!document.createElement || !document.getElementsByTagName) return; + + sorttable.DATE_RE = /^(\d\d?)[\/\.-](\d\d?)[\/\.-]((\d\d)?\d\d)$/; + + forEach(document.getElementsByTagName('table'), function(table) { + if (table.className.search(/\bsortable\b/) != -1) { + sorttable.makeSortable(table); + } + }); + + }, + + makeSortable: function(table) { + if (table.getElementsByTagName('thead').length == 0) { + // table doesn't have a tHead. Since it should have, create one and + // put the first table row in it. + the = document.createElement('thead'); + the.appendChild(table.rows[0]); + table.insertBefore(the,table.firstChild); + } + // Safari doesn't support table.tHead, sigh + if (table.tHead == null) table.tHead = table.getElementsByTagName('thead')[0]; + + if (table.tHead.rows.length != 1) return; // can't cope with two header rows + + // Sorttable v1 put rows with a class of "sortbottom" at the bottom (as + // "total" rows, for example). This is B&R, since what you're supposed + // to do is put them in a tfoot. So, if there are sortbottom rows, + // for backwards compatibility, move them to tfoot (creating it if needed). + sortbottomrows = []; + for (var i=0; i5' : ' ▴'; + this.appendChild(sortrevind); + return; + } + if (this.className.search(/\bsorttable_sorted_reverse\b/) != -1) { + // if we're already sorted by this column in reverse, just + // re-reverse the table, which is quicker + sorttable.reverse(this.sorttable_tbody); + this.className = this.className.replace('sorttable_sorted_reverse', + 'sorttable_sorted'); + this.removeChild(document.getElementById('sorttable_sortrevind')); + sortfwdind = document.createElement('span'); + sortfwdind.id = "sorttable_sortfwdind"; + sortfwdind.innerHTML = stIsIE ? ' 6' : ' ▾'; + this.appendChild(sortfwdind); + return; + } + + // remove sorttable_sorted classes + theadrow = this.parentNode; + forEach(theadrow.childNodes, function(cell) { + if (cell.nodeType == 1) { // an element + cell.className = cell.className.replace('sorttable_sorted_reverse',''); + cell.className = cell.className.replace('sorttable_sorted',''); + } + }); + sortfwdind = document.getElementById('sorttable_sortfwdind'); + if (sortfwdind) { sortfwdind.parentNode.removeChild(sortfwdind); } + sortrevind = document.getElementById('sorttable_sortrevind'); + if (sortrevind) { sortrevind.parentNode.removeChild(sortrevind); } + + this.className += ' sorttable_sorted'; + sortfwdind = document.createElement('span'); + sortfwdind.id = "sorttable_sortfwdind"; + sortfwdind.innerHTML = stIsIE ? ' 6' : ' ▾'; + this.appendChild(sortfwdind); + + // build an array to sort. This is a Schwartzian transform thing, + // i.e., we "decorate" each row with the actual sort key, + // sort based on the sort keys, and then put the rows back in order + // which is a lot faster because you only do getInnerText once per row + row_array = []; + col = this.sorttable_columnindex; + rows = this.sorttable_tbody.rows; + for (var j=0; j 12) { + // definitely dd/mm + return sorttable.sort_ddmm; + } else if (second > 12) { + return sorttable.sort_mmdd; + } else { + // looks like a date, but we can't tell which, so assume + // that it's dd/mm (English imperialism!) and keep looking + sortfn = sorttable.sort_ddmm; + } + } + } + } + return sortfn; + }, + + getInnerText: function(node) { + // gets the text we want to use for sorting for a cell. + // strips leading and trailing whitespace. + // this is *not* a generic getInnerText function; it's special to sorttable. + // for example, you can override the cell text with a customkey attribute. + // it also gets .value for fields. + + hasInputs = (typeof node.getElementsByTagName == 'function') && + node.getElementsByTagName('input').length; + + if (node.getAttribute("sorttable_customkey") != null) { + return node.getAttribute("sorttable_customkey"); + } + else if (typeof node.textContent != 'undefined' && !hasInputs) { + return node.textContent.replace(/^\s+|\s+$/g, ''); + } + else if (typeof node.innerText != 'undefined' && !hasInputs) { + return node.innerText.replace(/^\s+|\s+$/g, ''); + } + else if (typeof node.text != 'undefined' && !hasInputs) { + return node.text.replace(/^\s+|\s+$/g, ''); + } + else { + switch (node.nodeType) { + case 3: + if (node.nodeName.toLowerCase() == 'input') { + return node.value.replace(/^\s+|\s+$/g, ''); + } + case 4: + return node.nodeValue.replace(/^\s+|\s+$/g, ''); + break; + case 1: + case 11: + var innerText = ''; + for (var i = 0; i < node.childNodes.length; i++) { + innerText += sorttable.getInnerText(node.childNodes[i]); + } + return innerText.replace(/^\s+|\s+$/g, ''); + break; + default: + return ''; + } + } + }, + + reverse: function(tbody) { + // reverse the rows in a tbody + newrows = []; + for (var i=0; i=0; i--) { + tbody.appendChild(newrows[i]); + } + delete newrows; + }, + + /* sort functions + each sort function takes two parameters, a and b + you are comparing a[0] and b[0] */ + sort_numeric: function(a,b) { + aa = parseFloat(a[0].replace(/[^0-9.-]/g,'')); + if (isNaN(aa)) aa = 0; + bb = parseFloat(b[0].replace(/[^0-9.-]/g,'')); + if (isNaN(bb)) bb = 0; + return aa-bb; + }, + sort_alpha: function(a,b) { + if (a[0]==b[0]) return 0; + if (a[0] 0 ) { + var q = list[i]; list[i] = list[i+1]; list[i+1] = q; + swap = true; + } + } // for + t--; + + if (!swap) break; + + for(var i = t; i > b; --i) { + if ( comp_func(list[i], list[i-1]) < 0 ) { + var q = list[i]; list[i] = list[i-1]; list[i-1] = q; + swap = true; + } + } // for + b++; + + } // while(swap) + } +} + +/* ****************************************************************** + Supporting functions: bundled here to avoid depending on a library + ****************************************************************** */ + +// Dean Edwards/Matthias Miller/John Resig + +/* for Mozilla/Opera9 */ +if (document.addEventListener) { + document.addEventListener("DOMContentLoaded", sorttable.init, false); +} + +/* for Internet Explorer */ +/*@cc_on @*/ +/*@if (@_win32) + document.write(" diff --git a/posterita/posterita/web/js/creditScreen.js b/posterita/posterita/web/js/creditScreen.js new file mode 100644 index 0000000000..9d28c8b5cd --- /dev/null +++ b/posterita/posterita/web/js/creditScreen.js @@ -0,0 +1,537 @@ +//scripts for Posterita Ordering Screen +var product_id = null; +var qty = null; +var discountLimit = null; +var paymentPanels = null; +var activePanel = null; +var cartLines = null; +var cartIndex = null; +var orderType = null; +var tenderType = null; +var priceList = null; +var oldPriceList = -1; +var searchElement = null; +var isCustomerCompulsory = false; +var defaultPriceList = null; +var defaultPriceListName = null; + +var ORDER_TYPES = { + POS_ORDER : 'POS Order', + POS_GOOD_RECEIVE_NOTE : 'POS Goods Received Note', + CREDIT_ORDER : 'Credit Order' + }; + +var initScreen = function(){ + //set order type + orderType = $('orderType').value; + //set tender type + tenderType = $('tenderType').value; + //set priceList + priceList = $('priceListId').value; + + //set default data for price list + defaultPriceList = priceList; + defaultPriceListName = $('terminal').innerHTML; + + //set search element + var searchProductBy = $('searchProductBy').value; + if(searchProductBy == 'name') + { + searchElement = $('productQuery'); + } + else + { + searchElement = $(searchProductBy); + } + + //set is customer compulsory + if($('isCustomerCompulsory').value == 'true') + { + isCustomerCompulsory = true; + } + + initProductSearch(); + initSearchCustomer(); + initCartBtn(); + initAjaxResponder(); + initShortcuts(); + //initPaymentBtns(); + + //set payment rule + //simulateOnClick($(tenderType + 'Btn')); + + $('total').innerHTML = $('cartTotal').innerHTML; + + + searchElement.focus(); + + var barcode = $('barcode'); + barcode.onkeyup = function(e){ + if(e.keyCode == Event.KEY_RETURN) + { + if(this.value != null && this.value != "") + { + if(!validateBp()) + { + return; + } + + addToCart(this.value); + this.value = ""; + } + + } + }; + + $('qty').onkeyup = function(e){ + if(e.keyCode == Event.KEY_RETURN) + { + //update qty + updateQty(product_id, this.value); + } + }; + + $('checkoutBtn').onclick = function(e){ + if(cartLines == null || cartLines.length == 0) + { + showErrorMessage('Shopping cart is empty!'); + } + else + { + checkout();//shoppingcart.js + } + }; + + + /* + $('openDrawerBtn').onclick = function(e){ + openCashDrawer(); + }; + */ + + $('clearCartBtn').onclick = function(e){ + clearCart(); + }; + + $('discountBtn').showDiscount = $('discountBtn').onclick + $('discountBtn').onclick = function(){ + + if(cartLines == null || cartLines.length == 0) + { + showErrorMessage('Shopping cart is empty!'); + } + else + { + this.showDiscount(); + } + + }; + + + //add behaviour to exixting cart + addBehaviourToCart(); + try + { + showErrors(); + } + catch(e){}; +}; + +var initShortcuts = function(){ + shortcut.add("Ctrl+Space", function(e){simulateOnClick($('checkoutBtn'))}); + + shortcut.add("F1", function(e){$('barcode').select();}); + shortcut.add("F2", function(e){$('productQuery').select();}); + shortcut.add("F3", function(e){$('description').select();}); + shortcut.add("F4", function(e){$('qty').select();}); + + shortcut.add("F5", function(e){$('customerQuery').select();}); + shortcut.add("F6", function(e){simulateOnClick($('discountBtn'))}); + + // Barcode Btn + shortcut.add("Ctrl+B", function(e){simulateOnClick($('barcodeBtn'))}); + + //payment btns + //shortcut.add("F9", function(e){simulateOnClick($('cashBtn'))}); + //shortcut.add("F10", function(e){simulateOnClick($('cardBtn'))}); + //shortcut.add("F11", function(e){simulateOnClick($('chequeBtn'))}); + //shortcut.add("F12", function(e){simulateOnClick($('mixBtn'))}); + + shortcut.add("Ctrl+M", function(){simulateOnClick($('menuBtn'))}); + + shortcut.add("Ctrl+Delete", function(){ + simulateOnClick($('clearCartBtn')); + }); + shortcut.add("Ctrl+S", function(){simulateOnClick($('shortcutBtn'))}); + + //move between cart lines + shortcut.add("Ctrl+Up", function(){ + if(cartIndex > 0) + { + cartIndex = cartIndex -1; + var line = cartLines[cartIndex]; + simulateOnClick(line); + } + }); + + shortcut.add("Ctrl+Down", function(){ + if(cartIndex < cartLines.length - 1) + { + cartIndex = cartIndex + 1; + var line = cartLines[cartIndex]; + simulateOnClick(line); + } + }); + + //incrementing and decrementing qty + shortcut.add("Ctrl+Right", function(){ + simulateOnClick($('plusBtn')); + }); + + shortcut.add("Ctrl+Left", function(){ + simulateOnClick($('minusBtn')); + }); + + shortcut.add("Ctrl+Backspace", function(){ + simulateOnClick($('deleteBtn')); + }); + +}; + +var showResult = function(element, update){ + if(!update.style.position || update.style.position=='absolute') { + update.style.position = 'absolute'; + Position.clone(element, update, {setHeight: false, offsetTop: element.offsetHeight}); + Position.clone($('maintop'), update, {setHeight: false, setTop: false, offsetTop: element.offsetHeight}); + } + + update.style.display = 'block'; + update.style.opacity = '1.0'; + + }; + + +var initProductSearch = function(){ + + // autocomplete for search by product name + var productAutocompleter = new Ajax.Autocompleter('productQuery','productSearchResult','SearchProductsAction.do',{ + paramName:'productName', + parameters : 'priceListId=' + priceList, + minChars:1, + frequency:1.0, + afterUpdateElement: afterAutocomplete, + onShow : showResult + }); + + productAutocompleter.xyz = true; + $('productQuery').Autocompleter = productAutocompleter; + + + // autocomplete for search by product description + var productAutocompleter2 = new Ajax.Autocompleter('description','productSearchByDescriptionResult','SearchProductsAction.do',{ + paramName:'description', + parameters : 'priceListId=' + priceList, + minChars:1, + frequency:1.0, + afterUpdateElement: afterAutocomplete, + onShow : showResult + }); + + $('description').Autocompleter = productAutocompleter2; +}; + + +var afterAutocomplete = function(e1,e2){ + + if(!validateBp()) + { + return; + } + + var barcode = e2.getAttribute('barcode'); + if(barcode=='null') + { + barcode = ""; + } + var productId = e2.getAttribute('productId'); + //$('barcode').value = barcode; + $('productId').value= productId; + + var description = e2.getAttribute('description'); + //$('description').value = description; + + incrementCart(productId); + + //reset focus to search input + searchElement.focus(); + + //show product details + getProductInfo(productId); + + //set global product + product_id = productId; + + $('description').value = ""; + $('productQuery').value = ""; + +}; + +function getProductInfo(productId) +{ + var url = 'POSProductAction2.do'; + var pars = 'action=getProductDetails&productId='+productId+'&priceListId='+priceList; + + var myAjax = new Ajax.Request( url, + { + method: 'get', + parameters: pars, + onSuccess: showProductInfo, + onFailure: reportError + }); +} + +function showProductInfo(request) +{ + // + try + { + var response = request.responseText; + var product = eval('(' + response + ')'); + + //display product info in right column + $('product.name').innerHTML = product.name; + $('product.barcode').innerHTML = product.barcode; + $('product.taxCategory').innerHTML = product.taxCategory; + $('product.description').innerHTML = product.description; + $('product.stock.qty').innerHTML = product.stockQty; + $('product.price.std').innerHTML = new Number(product.priceStd).toFixed(2); + $('product.price.limit').innerHTML = new Number(product.priceLimit).toFixed(2); + $('product.price.list').innerHTML = new Number(product.priceList).toFixed(2); + + $('product.image').src = 'images/pos/blankimage.png'; + } + catch(e) + { + showErrorMessage(e); + } +} + +function reportError(request) +{ + alert("Ooops some error has occured while communicating with the server"); +} + +function convertString2Unicode(s) +{ + var uniString = "", hexVal, uniChar; + + for(var i = 0; i < s.length; ++i) + { + //Convert char to hex + //hexVal = Number(s.charCodeAt(i)).toString(16); + hexVal = Number(s.charCodeAt(i)).toString(10); + + //Convert to unicode by making sure hex is 4 chars long, padding with 0's if less + //uniChar = "\\u" + ("000" + hexVal).match(/.{4}$/)[0]; + uniChar = "&#" + ("000" + hexVal).match(/.{4}$/)[0] +";"; + + uniString += uniChar; + } + if(hexVal < 255) + return s; + + return uniString; +} + +// returns true if bp is valid +var validateBp = function(){ + if(orderType == ORDER_TYPES.POS_GOOD_RECEIVE_NOTE) + { + var bpartner = $('bpartnerId').value; + if(bpartner == null || bpartner == "") + { + showErrorMessage("Please choose a vendor",'customerQuery'); + return false; + } + } + + if(orderType == ORDER_TYPES.CREDIT_ORDER) + { + var bpartner = $('bpartnerId').value; + if(bpartner == null || bpartner == "") + { + showErrorMessage("Please choose a customer",'customerQuery'); + return false; + } + } + + if(isCustomerCompulsory) + { + var bpartner = $('bpartnerId').value; + if(bpartner == null || bpartner == "") + { + showErrorMessage("Please choose a customer"); + $('bpartnerId').focus(); + + return false; + } + } + + return true; +}; + +var initSearchCustomer = function(){ + + //validateBp(); // validates bp on load + + // auto complete for customer + $('customerQuery').Autocompleter = new Ajax.Autocompleter('customerQuery','customerSearchResult','SearchCustomerAction.do',{ + paramName:'customerQuery', + frequency:TROTTLE_TIME, + parameters : 'orderType=' + orderType, + onShow:function(element, update){ + if(!update.style.position || update.style.position=='absolute') { + update.style.position = 'absolute'; + Position.clone(element, update, {setHeight: false, offsetTop: element.offsetHeight}); + } + update.style.display = 'block'; + }, + afterUpdateElement:function(e1,e2){ + var bpartner = $('bpartnerId'); + var bpartnerName = $('customer.name'); + + + if(e2.value != '-1') + { + toConsole('1'); + if(e2.value) + { + toConsole('1.1.1'); + bpartner.value = e2.value; + } + else + { + toConsole('1.1.2'); + bpartner.value = ''; + } + + $('customer.code').innerHTML = bpartner.value; + var creditLimit = e2.getAttribute('creditLimit'); + var name = e2.getAttribute('name'); + setBPartner(bpartner.value, name, creditLimit); + if(bpartnerName) + { + toConsole('1.2'); + $('customer.name').innerHTML = name; + $('credit.available').innerHTML = creditLimit; + + x = e2.getAttribute('priceList'); + if (parseInt(x) > 0) + { + $('terminal').innerHTML = e2.getAttribute('pricelistName'); + $('priceListId').value = x; + priceList = x; + } + else + { + priceList = defaultPriceList; + $('terminal').innerHTML = defaultPriceListName; + } + + //reload shopping cart for partner + if(oldPriceList != priceList) + { + setShoppingCartPriceList(); + oldPriceList = priceList; + } + + $('productQuery').Autocompleter.options.defaultParams='priceListId=' + priceList; + }//if + } + else + { + toConsole('2'); + + bpartner.value = ""; + if(bpartnerName) + { + toConsole('2.1'); + bpartnerName.value = ""; + }//if + }//if + + + $('customerQuery').value = ""; + + searchElement.focus(); + + } + + }); + +} + +function setBPartner(bPartnerValue, name, creditLimit) +{ + try + { + var url = 'CheckoutAction.do'; + var pars = 'action=setBPartner&bPartnerId='+bPartnerValue +'&name='+name+'&creditLimit='+creditLimit; + + var myAjax = new Ajax.Request( url, + { + method: 'get', + parameters: pars, + }); + + } + catch(e) + { + toConsole(e); + } + return; +} + +var initCartBtn = function(){ + var plus = $('plusBtn'); + var minus = $('minusBtn'); + var del = $('deleteBtn'); + + plus.style.cursor = 'pointer'; + minus.style.cursor = 'pointer'; + del.style.cursor = 'pointer'; + + plus.onclick = function(e){ + if(product_id != null) + incrementCart(product_id); + searchElement.focus(); + }; + + minus.onclick = function(e){ + if(product_id != null) + decrementCart(product_id); + searchElement.focus(); + }; + + del.onclick = function(e){ + if(product_id != null) + deleteItemFromCart(product_id); + searchElement.focus(); + }; +}; + + + +var initAjaxResponder = function(){ + + Ajax.Responders.register({ + onCreate: function() { + $('indicator').style.display = 'block'; + }, + onComplete: function() { + $('indicator').style.display = 'none'; + } + }); +}; + +Event.observe(window,'load',initScreen,false); \ No newline at end of file diff --git a/posterita/posterita/web/js/customer.js b/posterita/posterita/web/js/customer.js new file mode 100644 index 0000000000..3e81a9cfb7 --- /dev/null +++ b/posterita/posterita/web/js/customer.js @@ -0,0 +1,160 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +/** + @author praveen + */ + + +//----------------------------------FUNCTION DECLARATIONS--------------------------------------------- +//create new customer +function createCustomer() +{ + window.location = "InitCreatePOSCustomer.do?action=initCreatePOSCustomer&creatingFromOrder=true"; +} + +//sets the current customer to default +function defaultCustomer() +{ + try + { + var bpartner = document.getElementsByName('bpartnerId')[0]; + var bpartnerName = document.getElementsByName('partnerName')[0]; + + bpartner.value = ""; + bpartnerName.value = ""; + } + catch(e) + { + toConsole('Unable to set default customer'); + toConsole(e); + } + +} + +//gets the custom name. +function getCustomerName() +{ + var customerID = $FElement('bpartnerId').value; + var url = 'POSCustomerAction.do'; + var pars = 'action=getNameByID&bpartnerId=' + customerID; + + toConsole('Requesting: ' + url + '?' + pars); + + var myAjax = new Ajax.Request( url, + { + method: 'get', + parameters: pars, + onSuccess: evaluateResponse, + onFailure: reportError + }); + +} + +//set customer name +function setCustomerName(name) +{ + $FElement('partnerName').value = name; +} + +function evaluateResponse(request) +{ + var script = request.responseText; + eval(script); +} + +function reportError(request) +{ + alert('Some error occured while communicating with the server. Please try again.'); +} +//------------------------------REGISTERING SOME EVENTS OR INITIALISATION----------------------------- + +$FElement('bpartnerId').onkeyup = function(e) +{ + try + { + var event = e||window.event; + + if(event.keyCode == 13) + { + //request client name + getCustomerName(); + this.blur(); + } + } + catch (e) + { + toConsole(e); + } +}; + +$('customerQuery').Autocompleter = new Ajax.Autocompleter('customerQuery','customerSearchResult','SearchCustomerAction.do',{ +paramName:'customerQuery', +frequency:TROTTLE_TIME, +afterUpdateElement:function(e1,e2){ + var bpartner = $FElement('bpartnerId'); + var bpartnerName = $FElement('partnerName'); + + + if(e2.value != '-1') + { + toConsole('1'); + if(e2.value) + { + toConsole('1.1.1'); + bpartner.value = e2.value; + } + else + { + toConsole('1.1.2'); + bpartner.value = ''; + } + + if(bpartnerName) + { + toConsole('1.2'); + bpartnerName.value = e2.getAttribute('name'); + }//if + } + else + { + toConsole('2'); + + bpartner.value = ""; + if(bpartnerName) + { + toConsole('2.1'); + bpartnerName.value = ""; + }//if + }//if + + toConsole('Setting customer-->' + bpartnerName.value); + + $('customerQuery').value = ""; + + //focusBarcode(); + + + } + +}); + +var bpartner = $FElement('bpartnerId'); +bpartner.initialValue = bpartner.value; \ No newline at end of file diff --git a/posterita/posterita/web/js/customer2.js b/posterita/posterita/web/js/customer2.js new file mode 100644 index 0000000000..6216276a8b --- /dev/null +++ b/posterita/posterita/web/js/customer2.js @@ -0,0 +1,161 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +/** + @author praveen + */ + + +//----------------------------------FUNCTION DECLARATIONS--------------------------------------------- +//create new customer +function createCustomer() +{ + window.location = "InitCreatePOSCustomer.do?action=initCreatePOSCustomer&creatingFromOrder=true"; +} + +//sets the current customer to default +function defaultCustomer() +{ + try + { + var bpartner = document.getElementsByName('bpartnerId')[0]; + var bpartnerName = document.getElementsByName('partnerName')[0]; + + bpartner.value = ""; + bpartnerName.value = ""; + } + catch(e) + { + toConsole('Unable to set default customer'); + toConsole(e); + } + +} + +//gets the custom name. +function getCustomerName() +{ + var customerID = $FElement('bpartnerId').value; + var url = 'POSCustomerAction.do'; + var pars = 'action=getNameByID&bpartnerId=' + customerID; + + toConsole('Requesting: ' + url + '?' + pars); + + var myAjax = new Ajax.Request( url, + { + method: 'get', + parameters: pars, + onSuccess: evaluateResponse, + onFailure: reportError + }); + +} + +//set customer name +function setCustomerName(name) +{ + $FElement('partnerName').value = name; + document.forms[0].submit(); +} + +function evaluateResponse(request) +{ + var script = request.responseText; + eval(script); +} + +function reportError(request) +{ + alert('Some error occured while communicating with the server. Please try again.'); +} +//------------------------------REGISTERING SOME EVENTS OR INITIALISATION----------------------------- + +$FElement('bpartnerId').onkeyup = function(e) +{ + try + { + var event = e||window.event; + + if(event.keyCode == 13) + { + //request client name + getCustomerName(); + } + } + catch (e) + { + toConsole(e); + } +}; + +$('customerQuery').Autocompleter = new Ajax.Autocompleter('customerQuery','customerSearchResult','SearchCustomerAction.do',{ +paramName:'customerQuery', +frequency:TROTTLE_TIME, +afterUpdateElement:function(e1,e2){ + var bpartner = $FElement('bpartnerId'); + var bpartnerName = $FElement('partnerName'); + + + if(e2.value != '-1') + { + toConsole('1'); + if(e2.value) + { + toConsole('1.1.1'); + bpartner.value = e2.value; + } + else + { + toConsole('1.1.2'); + bpartner.value = ''; + } + + if(bpartnerName) + { + toConsole('1.2'); + bpartnerName.value = e2.getAttribute('name'); + }//if + } + else + { + toConsole('2'); + + bpartner.value = ""; + if(bpartnerName) + { + toConsole('2.1'); + bpartnerName.value = ""; + }//if + }//if + + toConsole('Setting customer-->' + bpartnerName.value); + document.forms[0].submit(); + + $('customerQuery').value = ""; + + //focusBarcode(); + + + } + +}); + +var bpartner = $FElement('bpartnerId'); +bpartner.initialValue = bpartner.value; \ No newline at end of file diff --git a/posterita/posterita/web/js/dom-drag.js b/posterita/posterita/web/js/dom-drag.js new file mode 100644 index 0000000000..0cd39c3e76 --- /dev/null +++ b/posterita/posterita/web/js/dom-drag.js @@ -0,0 +1,121 @@ +/************************************************** + * dom-drag.js + * 09.25.2001 + * www.youngpup.net + ************************************************** + * 10.28.2001 - fixed minor bug where events + * sometimes fired off the handle, not the root. + **************************************************/ + +var Drag = { + + obj : null, + + init : function(o, oRoot, minX, maxX, minY, maxY, bSwapHorzRef, bSwapVertRef, fXMapper, fYMapper) + { + o.onmousedown = Drag.start; + + o.hmode = bSwapHorzRef ? false : true ; + o.vmode = bSwapVertRef ? false : true ; + + o.root = oRoot && oRoot != null ? oRoot : o ; + + if (o.hmode && isNaN(parseInt(o.root.style.left ))) o.root.style.left = "0px"; + if (o.vmode && isNaN(parseInt(o.root.style.top ))) o.root.style.top = "0px"; + if (!o.hmode && isNaN(parseInt(o.root.style.right ))) o.root.style.right = "0px"; + if (!o.vmode && isNaN(parseInt(o.root.style.bottom))) o.root.style.bottom = "0px"; + + o.minX = typeof minX != 'undefined' ? minX : null; + o.minY = typeof minY != 'undefined' ? minY : null; + o.maxX = typeof maxX != 'undefined' ? maxX : null; + o.maxY = typeof maxY != 'undefined' ? maxY : null; + + o.xMapper = fXMapper ? fXMapper : null; + o.yMapper = fYMapper ? fYMapper : null; + + o.root.onDragStart = new Function(); + o.root.onDragEnd = new Function(); + o.root.onDrag = new Function(); + }, + + start : function(e) + { + var o = Drag.obj = this; + e = Drag.fixE(e); + var y = parseInt(o.vmode ? o.root.style.top : o.root.style.bottom); + var x = parseInt(o.hmode ? o.root.style.left : o.root.style.right ); + o.root.onDragStart(x, y); + + o.lastMouseX = e.clientX; + o.lastMouseY = e.clientY; + + if (o.hmode) { + if (o.minX != null) o.minMouseX = e.clientX - x + o.minX; + if (o.maxX != null) o.maxMouseX = o.minMouseX + o.maxX - o.minX; + } else { + if (o.minX != null) o.maxMouseX = -o.minX + e.clientX + x; + if (o.maxX != null) o.minMouseX = -o.maxX + e.clientX + x; + } + + if (o.vmode) { + if (o.minY != null) o.minMouseY = e.clientY - y + o.minY; + if (o.maxY != null) o.maxMouseY = o.minMouseY + o.maxY - o.minY; + } else { + if (o.minY != null) o.maxMouseY = -o.minY + e.clientY + y; + if (o.maxY != null) o.minMouseY = -o.maxY + e.clientY + y; + } + + document.onmousemove = Drag.drag; + document.onmouseup = Drag.end; + + return false; + }, + + drag : function(e) + { + e = Drag.fixE(e); + var o = Drag.obj; + + var ey = e.clientY; + var ex = e.clientX; + var y = parseInt(o.vmode ? o.root.style.top : o.root.style.bottom); + var x = parseInt(o.hmode ? o.root.style.left : o.root.style.right ); + var nx, ny; + + if (o.minX != null) ex = o.hmode ? Math.max(ex, o.minMouseX) : Math.min(ex, o.maxMouseX); + if (o.maxX != null) ex = o.hmode ? Math.min(ex, o.maxMouseX) : Math.max(ex, o.minMouseX); + if (o.minY != null) ey = o.vmode ? Math.max(ey, o.minMouseY) : Math.min(ey, o.maxMouseY); + if (o.maxY != null) ey = o.vmode ? Math.min(ey, o.maxMouseY) : Math.max(ey, o.minMouseY); + + nx = x + ((ex - o.lastMouseX) * (o.hmode ? 1 : -1)); + ny = y + ((ey - o.lastMouseY) * (o.vmode ? 1 : -1)); + + if (o.xMapper) nx = o.xMapper(y) + else if (o.yMapper) ny = o.yMapper(x) + + Drag.obj.root.style[o.hmode ? "left" : "right"] = nx + "px"; + Drag.obj.root.style[o.vmode ? "top" : "bottom"] = ny + "px"; + Drag.obj.lastMouseX = ex; + Drag.obj.lastMouseY = ey; + + Drag.obj.root.onDrag(nx, ny); + return false; + }, + + end : function() + { + document.onmousemove = null; + document.onmouseup = null; + Drag.obj.root.onDragEnd( parseInt(Drag.obj.root.style[Drag.obj.hmode ? "left" : "right"]), + parseInt(Drag.obj.root.style[Drag.obj.vmode ? "top" : "bottom"])); + Drag.obj = null; + }, + + fixE : function(e) + { + if (typeof e == 'undefined') e = window.event; + if (typeof e.layerX == 'undefined') e.layerX = e.offsetX; + if (typeof e.layerY == 'undefined') e.layerY = e.offsetY; + return e; + } +}; \ No newline at end of file diff --git a/posterita/posterita/web/js/draftedPOSOrder.js b/posterita/posterita/web/js/draftedPOSOrder.js new file mode 100644 index 0000000000..d9ceb801ef --- /dev/null +++ b/posterita/posterita/web/js/draftedPOSOrder.js @@ -0,0 +1,174 @@ + diff --git a/posterita/posterita/web/js/enableButton.js b/posterita/posterita/web/js/enableButton.js new file mode 100644 index 0000000000..42ab5ee023 --- /dev/null +++ b/posterita/posterita/web/js/enableButton.js @@ -0,0 +1,405 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +/** + @author tamak + */ + + +window.status=""; +function refreshList(varDoc) +{ + window.location="NatisReleaseAction.do?action=prepareRelease&tradeInDetailMake=" + varDoc.tradeInDetailMake.value + "&assetID=" + varDoc.assetID.value + "&financeOptionId=" + varDoc.financeOptionId.value + "&licensingOptionId=" + varDoc.licensingOptionId.value + "&userSalesRepId=" + varDoc.userSalesRepId.value; +} + +function cancelRelease() +{ + window.location="NatisReleaseAction.do?action=home"; +} + +function updateAttributeList(form,id) +{ + form.updateAttrValueId.value = id; + form.action.value = "updateProductAttributeValue"; + form.submit(); +} + +function setActionMethod(form,action) +{ + toConsole("setting action dynamically"); + toConsole("Form :" + form); + toConsole("action :" + action); + + try + { + document.getElementsByName('action')[0].value = action; + form.submit(); + } + catch(e) + { + toConsole("Unable to set Action " + e); + } + +} + + +/*function setAction(form,action,method) +{ + form.action = action; + form.action.value = method; + //form.bpartnerId.value=100; + //alert("Calling action: " + action + "/n Method="+method); + form.submit(); + +} +*/ +function setAction(form,action,method) +{ + var elements = form.elements; + + var getStr = action + "?action=" + method; + + for(i=0;i 0) + { + cartIndex = cartIndex -1; + var line = cartLines[cartIndex]; + scrollCart(); + simulateOnClick(line); + } + }); + + shortcut.add("Ctrl+Down", function(){ + if(cartIndex < cartLines.length - 1) + { + cartIndex = cartIndex + 1; + var line = cartLines[cartIndex]; + scrollCart(); + simulateOnClick(line); + } + }); + + //incrementing and decrementing qty + shortcut.add("Ctrl+Right", function(){ + simulateOnClick($('plusBtn')); + }); + + shortcut.add("Ctrl+Left", function(){ + simulateOnClick($('minusBtn')); + }); + + shortcut.add("Ctrl+Backspace", function(){ + simulateOnClick($('deleteBtn')); + }); + +}; + +var showResult = function(element, update){ + if(!update.style.position || update.style.position=='absolute') { + update.style.position = 'absolute'; + Position.clone(element, update, {setHeight: false, offsetTop: element.offsetHeight}); + Position.clone($('maintop'), update, {setHeight: false, setTop: false, offsetTop: element.offsetHeight}); + } + + update.style.display = 'block'; + update.style.opacity = '1.0'; + + }; + + +var initProductSearch = function(){ + + // autocomplete for search by product name + var productAutocompleter = new Ajax.Autocompleter('productQuery','productSearchResult','SearchProductsAction.do',{ + paramName:'productName', + parameters : 'priceListId=' + priceList, + minChars:1, + frequency:1.0, + afterUpdateElement: afterAutocomplete, + onShow : showResult + }); + + productAutocompleter.xyz = true; + $('productQuery').Autocompleter = productAutocompleter; + + + // autocomplete for search by product description + var productAutocompleter2 = new Ajax.Autocompleter('description','productSearchByDescriptionResult','SearchProductsAction.do',{ + paramName:'description', + parameters : 'priceListId=' + priceList, + minChars:1, + frequency:1.0, + afterUpdateElement: afterAutocomplete, + onShow : showResult + }); + + $('description').Autocompleter = productAutocompleter2; +}; + +var afterAutocomplete = function(e1,e2){ + + var barcode = e2.getAttribute('barcode'); + if(barcode=='null') + { + barcode = ""; + } + var productId = e2.getAttribute('productId'); + + if(productId == null) + { + $('description').value = ""; + $('productQuery').value = ""; + + return; + } + + //$('barcode').value = barcode; + $('productId').value= productId; + + var description = e2.getAttribute('description'); + //$('description').value = description; + + incrementCart(productId); + + //reset focus to search input + searchElement.focus(); + + //show product details + getProductInfo(productId); + + //set global product + product_id = productId; + + $('description').value = ""; + $('productQuery').value = ""; + +}; + +function autoSave() +{ + if(cartLines == null || cartLines.length == 0) + { + //Do nothing + return; + } + else + { + Modalbox.show('
    Please Wait...

    ', {title: 'Saving Inventory', width: 800}); + Modalbox.deactivate(); + + var url = 'InventoryCartAction.do'; + var pars = 'action=autoSaveInventoryLines&inventoryId='+inventoryId+'&priceListId='+priceList+'&description='+description; + + var myAjax = new Ajax.Request( url, + { + method: 'get', + parameters: pars, + onSuccess: showInventoryInfo, + onFailure: reportError + }); + } +} + + + +function showInventoryInfo(request) +{ + // + try + { + if (window.Modalbox) + Modalbox.hide(); + + var response = request.responseText; + var invInfo = eval('(' + response + ')'); + + //display info in right column + $('inventory.docno').innerHTML = invInfo.docNo; + $('inventory.description').innerHTML = invInfo.description; + $('inventory.status').innerHTML = invInfo.docStatus; + $('inventoryId').value = inventoryId = invInfo.inventoryID; + + } + catch(e) + { + showErrorMessage(e); + } +} + + +function getProductInfo(productId) +{ + var url = 'POSProductAction2.do'; + var pars = 'action=getProductDetails&productId='+productId+'&priceListId='+priceList; + + var myAjax = new Ajax.Request( url, + { + method: 'get', + parameters: pars, + onSuccess: showProductInfo, + onFailure: reportError + }); +} + +function showProductInfo(request) +{ + // + try + { + var response = request.responseText; + var product = eval('(' + response + ')'); + + //display product info in right column + $('product.name').innerHTML = product.name; + $('product.barcode').innerHTML = product.barcode; + $('product.taxCategory').innerHTML = product.taxCategory; + $('product.description').innerHTML = product.description; + $('product.stock.qtyBook').innerHTML = product.stockQty; + $('product.price.list').innerHTML = new Number(product.priceList).toFixed(2); + + $('product.total.lines').innerHTML = cartLines.length; + $('product.total.count').innerHTML = $('cartTotalCount').innerHTML; + $('product.total.book').innerHTML = $('cartTotalBook').innerHTML; + $('product.total.csv').innerHTML = $('cartTotalCsv').innerHTML; + $('product.discrepancy').innerHTML = $('cartTotalCount').innerHTML - $('cartTotalBook').innerHTML; + + $('product.image').src = 'images/pos/blankimage.png'; + } + catch(e) + { + showErrorMessage(e); + } +} + +function reportError(request) +{ + alert("Ooops some error has occured while communicating with the server"); +} + +function convertString2Unicode(s) +{ + var uniString = "", hexVal, uniChar; + + for(var i = 0; i < s.length; ++i) + { + //Convert char to hex + //hexVal = Number(s.charCodeAt(i)).toString(16); + hexVal = Number(s.charCodeAt(i)).toString(10); + + //Convert to unicode by making sure hex is 4 chars long, padding with 0's if less + //uniChar = "\\u" + ("000" + hexVal).match(/.{4}$/)[0]; + uniChar = "&#" + ("000" + hexVal).match(/.{4}$/)[0] +";"; + + uniString += uniChar; + } + if(hexVal < 255) + return s; + + return uniString; +} + +var initSearchCustomer = function(){ + + //validateBp(); // validates bp on load + + // auto complete for customer + $('customerQuery').Autocompleter = new Ajax.Autocompleter('customerQuery','customerSearchResult','SearchCustomerAction.do',{ + paramName:'customerQuery', + frequency:TROTTLE_TIME, + parameters : 'orderType=' + orderType, // if credit order, do not validate for standard customer + onShow:function(element, update){ + if(!update.style.position || update.style.position=='absolute') { + update.style.position = 'absolute'; + Position.clone(element, update, {setHeight: false, offsetTop: element.offsetHeight}); + } + update.style.display = 'block'; + }, + afterUpdateElement:function(e1,e2){ + var bpartner = $('bpartnerId'); + var bpartnerName = $('customer.name'); + + + if(e2.value != '-1') + { + if(e2.value) + { + bpartner.value = e2.value; + } + else + { + bpartner.value = ''; + } + + $('customer.code').innerHTML = bpartner.value; + var creditLimit = e2.getAttribute('creditLimit'); + var name = e2.getAttribute('name'); + + if(bpartnerName) + { + $('customer.name').innerHTML = name; + $('credit.available').innerHTML = creditLimit==null?0:creditLimit; + + if (e2.getAttribute('priceList') && parseInt(e2.getAttribute('priceList')) > 0) + { + priceList = e2.getAttribute('priceList'); + $('priceListId').value = priceList; + $('terminal').innerHTML = e2.getAttribute('pricelistName'); + } + else + { + priceList = defaultPriceList; + $('terminal').innerHTML = defaultPriceListName; + } + if(cartLines != null && cartLines.length != 0) + { + //reload shopping cart for partner + if(oldPriceList != priceList) + { + setShoppingCartPriceList(); + oldPriceList = priceList; + } + } + $('productQuery').Autocompleter.options.defaultParams='priceListId=' + priceList; + saveBPartnerInfo(bpartner.value, name, creditLimit, priceList); + }//if + } + else + { + bpartner.value = ""; + if(bpartnerName) + { + bpartnerName.value = ""; + }//if + }//if + + + $('customerQuery').value = ""; + + searchElement.focus(); + } + + }); + +} + + +var initCartBtn = function(){ + var plus = $('plusBtn'); + var minus = $('minusBtn'); + var del = $('deleteBtn'); + + plus.style.cursor = 'pointer'; + minus.style.cursor = 'pointer'; + del.style.cursor = 'pointer'; + + plus.onclick = function(e){ + if(product_id != null) + incrementCart(product_id); + searchElement.focus(); + }; + + minus.onclick = function(e){ + if(product_id != null) + decrementCart(product_id); + + if(cartLines == null || cartLines.length == 0) + { + resetInfo(); + } + + searchElement.focus(); + }; + + del.onclick = function(e){ + if(product_id != null) + deleteItemFromCart(product_id); + + if(cartLines == null || cartLines.length == 0) + { + resetInfo(); + } + + searchElement.focus(); + + }; +}; + + + +var initAjaxResponder = function(){ + + Ajax.Responders.register({ + onCreate: function() { + $('indicator').style.display = 'block'; + }, + onComplete: function() { + $('indicator').style.display = 'none'; + } + }); +}; + + + +//---------------------------------------------------------------------------- + + +function getCartTotal() +{ + var amtStr = $('total').innerHTML; + amtStr = amtStr.strip(); + amtStr = amtStr.replace(',', "") + + var amount = parseFloat(amtStr); + while(isNaN(amount)) + { + if(amtStr.length == 0) return 0.0; + + amtStr = amtStr.slice(1); + amount = parseFloat(amtStr); + } + + //amtStr = parseFloat(amtStr); + //var amount = new Number(amtStr); + + return amount; +} + +function displaySortPanel() +{ + $('csvBtn').style.display = 'none'; + $('saveCsvBtn').style.display = 'block'; + $('saveBtn').style.display = 'none'; + $('clearCartBtn').style.display = 'none'; + $('reloatCartBtn').style.display = 'none'; + $('completeBtn').style.display = 'none'; + $('newBtn').style.display = 'none'; + $('cartSearch').style.display = 'none'; + $('editProductContainer').style.display = 'none'; + $('sortPanel').style.display = 'block'; + $('searchBtn').innerHTML = 'SWITCH BACK'; + $('filter').value = ''; + $('filter').focus(); + $('searchBtn').onclick = function() { switchBack(); }; +} + +function switchBack() +{ + $('csvBtn').style.display = 'block'; + $('saveCsvBtn').style.display = 'none'; + $('saveBtn').style.display = 'block'; + $('clearCartBtn').style.display = 'block'; + $('completeBtn').style.display = 'block'; + $('cartSearch').style.display = 'none'; + $('sortPanel').style.display = 'none'; + $('editProductContainer').style.display = 'block'; + $('cartSearch').style.display = 'block'; + $('newBtn').style.display = 'block'; + $('reloatCartBtn').style.display = 'none'; + $('searchBtn').innerHTML = 'SEARCH'; + $('filter').value = ''; + $('barcode').value = ''; + $('barcode').focus(); + $('searchBtn').onclick = function() { displaySortPanel(); }; + reloadCart(); + +} + +function showCsvImport() +{ + $('importBtn').style.display = 'block'; + $('saveCsvBtn').style.display = 'block'; + $('menuBtn').style.display = 'none'; + $('clearCartBtn').style.display = 'none'; + $('printBtn').style.display = 'none'; + $('completeBtn').style.display = 'none'; + $('searchBtn').style.display = 'none'; + $('reloatCartBtn').style.display = 'block'; + $('newBtn').style.display = 'none'; + $('csvBtn').innerHTML = 'BACK'; + $('csvBtn').onclick = function() { goBack(); }; +} + +function diplayCsvOptions() +{ + $('importBtn').style.display = 'block'; + $('saveCsvBtn').style.display = 'block'; + $('menuBtn').style.display = 'none'; + $('clearCartBtn').style.display = 'none'; + $('printBtn').style.display = 'none'; + $('completeBtn').style.display = 'none'; + $('searchBtn').style.display = 'none'; + $('newBtn').style.display = 'none'; + $('reloatCartBtn').style.display = 'block'; + $('csvBtn').innerHTML = 'BACK'; + $('csvBtn').onclick = function() { goBack(); }; + + +} + +function goBack() +{ + $('importBtn').style.display = 'none'; + $('saveCsvBtn').style.display = 'none'; + $('menuBtn').style.display = 'block'; + $('clearCartBtn').style.display = 'block'; + $('printBtn').style.display = 'block'; + $('completeBtn').style.display = 'block'; + $('searchBtn').style.display = 'block'; + $('newBtn').style.display = 'block'; + $('reloatCartBtn').style.display = 'none'; + $('csvBtn').innerHTML = 'CSV'; + $('csvBtn').onclick = function() { diplayCsvOptions(); }; +} +function addPaging() +{ + // +} + +function trim(sString) +{ + while (sString.substring(0,1) == ' ') + { + sString = sString.substring(1, sString.length); + } + while (sString.substring(sString.length-1, sString.length) == ' ') + { + sString = sString.substring(0,sString.length-1); + } + return sString; +} + +function editDescription() +{ + description = $('inventory.description').innerHTML; + var userInput = prompt("Change inventory description", description) + + if(userInput == 'null' || userInput == '' || userInput == null) + { + userInput = description; + $('inventory.description').innerHTML = userInput; + } + else + { + description = userInput; + $('inventory.description').innerHTML = userInput; + } + + return false; + +} + +function addUploadField() +{ + + var tbl = $('upload'); + var lastRow = tbl.rows.length; + // if there's no header row in the table, then iteration = lastRow + 1 + var iteration = lastRow; + var row = tbl.insertRow(1); + row.className = 'upload'; + + // right cell + var cellRight = row.insertCell(0); + cellRight.className = "tdUpload" + var el = document.createElement('input'); + el.type = 'file'; + el.name = 'file' + iteration; + el.id = 'file' + iteration; + el.size = 40; + + cellRight.appendChild(el); + + var div = document.createElement('div') + div.id = 'attachment'+iteration; + + var i = iteration - 1; + + if($('attachment'+i).innerHTML != '') + { + $('attachment'+i).innerHTML = ''; + $('attachment'+i).className = ''; + + } + + + div.className = 'button floatLeft'; + div.innerHTML = 'Add another file' + div.onclick = function() + { + validateRow(); + } + cellRight.appendChild(div); + + var span=document.createElement('span'); + span.id = 'progressfile'+iteration; + + cellRight.appendChild(span); + + cellRight.focus(); + +} + +function validate(obj) +{ + var sfile = obj.value; + + if(sfile == "" || sfile == null || sfile == 'null') + return false; + + var fileType = sfile.substring(sfile.length -3, sfile.length); + if(fileType.toLowerCase() != 'csv') + { + alert('Only csv file is allowed!!!'); + obj.value=''; + obj.focus(); + return false; + } + else + { + obj.disabled = true; + uploadStockSheets(sfile); + } + +} + +function addFileInput() +{ + var d = document.createElement("div"); + var file = document.createElement("input"); + file.setAttribute("type", "file"); + file.setAttribute("name", "attachment"+upload_number); + d.appendChild(file); + document.getElementById("moreUploads").appendChild(d); + upload_number++; +} + + +function uploadStockSheets(form) +{ + $('importStock').request({ + contentType: 'multipart/form-data', + method: 'get', + onSuccess: refreshShoppingCart, + onFailure: reportShoppingCartError + }); + + return false; +} + +function generateCsv() +{ + var url = 'InventoryCartAction.do?action=generateInventoryCSV'; + window.location = url; +} + + +function addCSV(file) +{ + $('uploadHeader').style.display="block"; + $('uploadCsv').style.display="block"; + var tbl = $('csv'); + var lastRow = tbl.rows.length; + // if there's no header row in the table, then iteration = lastRow + 1 + var iteration = lastRow; + var row = tbl.insertRow(1); + row.className = 'upload'; + // right cell + var cellRight = row.insertCell(0); + cellRight.className = "tdUpload" + cellRight.innerHTML = "Adempiere.properties"; + +} + +function validateRow() +{ + var tbl = document.getElementById('upload'); + var lastRow = tbl.rows.length - 1; + + if(lastRow == 10) + { + alert('Maximum file to upload reached.'); + return false; + } + + var i; + for (i=1; i<=lastRow; i++) + { + var aRow = document.getElementById('file' + i); + if (aRow.value.length <= 0) + { + alert('Row ' + i + ' is empty'); + return false; + } + else + { + addUploadField(); + addTable(); + } + } +} + +function redirect(url) +{ + window.location = url; +} + +function resetInfo() +{ + $('product.name').innerHTML = ""; + $('product.barcode').innerHTML = ""; + $('product.taxCategory').innerHTML = ""; + $('product.description').innerHTML = ""; + $('product.stock.qtyBook').innerHTML = ""; + $('product.price.list').innerHTML = ""; + + $('product.total.lines').innerHTML = ""; + $('product.total.count').innerHTML = ""; + $('product.total.book').innerHTML = ""; + $('product.total.csv').innerHTML = ""; + $('product.discrepancy').innerHTML = ""; + +} + +function newCart() +{ + var answer = confirm("Click OK if you want to save the inventory cart and start a new one.\nClick CANCEL to only clear the cart.\nNote: Clearing the cart will erase all the data. ") + if (answer) + { + if(cartLines == null || cartLines.length == 0) + { + redirect('InventoryCartAction.do?action=newInventoryCart'); + } + else + { + Modalbox.show('
    Please Wait...

    ', {title: 'Saving Inventory', width: 800}); + Modalbox.deactivate(); + + var url = 'InventoryCartAction.do'; + var pars = 'action=autoSaveInventoryLines&inventoryId='+inventoryId+'&priceListId='+priceList+'&description='+description; + + var myAjax = new Ajax.Request( url, + { + method: 'get', + parameters: pars, + onSuccess: function(){redirect('InventoryCartAction.do?action=newInventoryCart');}, + onFailure: reportError + }); + + } + + } + else + { + clearCart(); + } +} + +Event.observe(window,'load',initScreen,false); \ No newline at end of file diff --git a/posterita/posterita/web/js/inventoryCart.js b/posterita/posterita/web/js/inventoryCart.js new file mode 100644 index 0000000000..603146c345 --- /dev/null +++ b/posterita/posterita/web/js/inventoryCart.js @@ -0,0 +1,432 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +/** + @author praveen + */ + + +//----------------------------------FUNCTION DECLARATIONS--------------------------------------------- +//scrolls to the bottom of the cart +function scrollDownCart() +{ + if($('shoppingCart')) + { + $('shoppingCart').scrollTop = $('shoppingCart').scrollHeight; + } +} + + +//adding product to cart +function addToCart(barcode) +{ + cartIndex = null; + if(barcode == null) return; + if(barcode == '') return; + + try + { + + var url = 'InventoryCartAction.do'; + var pars = 'action=addProduct&barCode='+barcode+'&priceListId='+priceList; + + var myAjax = new Ajax.Request( url, + { + method: 'get', + parameters: pars, + onSuccess: refreshShoppingCart, + onFailure: reportShoppingCartError + }); + + + } + catch(e) + { + toConsole(e); + } +} + +//incrementing, decrementing and deleting the shopping cart items using ajax +// 1.Increment the qty for the product +function incrementCart(productId) +{ + if(productId == null) return; + + try + { + + var url = 'InventoryCartAction.do'; + var pars = 'action=incrementQty&productId='+productId+ '&ifAdd=true&priceListId='+priceList; + + var myAjax = new Ajax.Request( url, + { + method: 'get', + parameters: pars, + onSuccess: refreshShoppingCart, + onFailure: reportShoppingCartError + }); + + + } + catch(e) + { + toConsole(e); + } +} + +//2.Decrement the qty for the product +function decrementCart(productId) +{ + if(productId == null) return; + + try + { + + + var url = 'InventoryCartAction.do'; + var pars = 'action=decrementQty&productId='+productId+ '&ifAdd=false&priceListId='+priceList; + + var myAjax = new Ajax.Request( url, + { + method: 'get', + parameters: pars, + onSuccess: refreshShoppingCart, + onFailure: reportShoppingCartError + }); + + } + catch(e) + { + toConsole(e); + } +} + +//3.Delete all the products with the ID from the cart +function deleteItemFromCart(productId) +{ + if(productId == null) return; + + cartIndex = null; + updateQty(productId, '0'); +} + +//Refreshs the content of the shopping cart +function refreshShoppingCart(request) +{ + try + { + var response = request.responseText; + $('shoppingCart').innerHTML = response; + $('total').innerHTML = $('cartTotalCount').innerHTML; + $('product.total.lines').innerHTML = cartLines.length; + $('product.total.count').innerHTML = $('cartTotalCount').innerHTML; + $('product.total.book').innerHTML = $('cartTotalBook').innerHTML; + $('product.total.csv').innerHTML = $('cartTotalCsv').innerHTML; + $('product.discrepancy').innerHTML = $('cartTotalCount').innerHTML - $('cartTotalBook').innerHTML; + scrollDownCart(); + response.evalScripts(); //display error messages + } + catch(e) + { + showErrorMessage('Failed to resfresh cart! Cause:' + e); + } + + addBehaviourToCart(); +} + +//Reports an error +function reportShoppingCartError(request) +{ + alert('Some error occured while communicating with the server. Please try again.'); + alert(request.responseText); + var win = window.open(); + win.document.write(request.responseText); + win.document.close(); +} + +//addRequiredLibrary('js/test.js'); +var requestIndicator; + +/* +var ShoppingCart = { + + init : function(){ + //this.indicator = new AJAXIndicator('Please wait...'); + alert('Shopping Cart'); + }, + + indicator : null +}; +*/ + +function completeInventory() +{ + $('inventoryForm').submit(); +} + +//Update the qty for the product +function updateQty(productId, quantity) +{ + if(productId == null) return; + + if (quantity == "") + { + return; + } + + var amount = parseFloat(quantity); + + if (isNaN(amount) || amount < 0) + { + showErrorMessage('Invalid quantity! ' + quantity, 'qty'); + $('qty').value = ""; + return; + } + + try + { + var url = 'InventoryCartAction.do'; + var pars = 'action=updateQty&productId=' + productId + '&ifAdd=false' + '&priceListId='+priceList +'&qtyCount=' + amount; + + var myAjax = new Ajax.Request( url, + { + method: 'get', + parameters: pars, + onSuccess: refreshShoppingCart, + onFailure: reportShoppingCartError + }); + + return false; + } + catch(e) + { + toConsole(e); + } + + return false; + +} + +//Reload shopping cart +function reloadCart() +{ + try + { + var url = 'InventoryCartAction.do'; + var pars = 'action=reloadCart'; + + var myAjax = new Ajax.Request( url, + { + method: 'get', + parameters: pars, + onSuccess: refreshShoppingCart, + onFailure: reportShoppingCartError + }); + + } + catch(e) + { + toConsole(e); + } + +} + + +function clearCart() +{ + maxRows = 0; + excessRows = 0; + + try + { + var url = 'InventoryCartAction.do'; + var pars = 'action=clearCart'; + + $('inventory.docno').innerHTML = 'N/A'; + $('inventory.description').innerHTML = description; + $('inventory.status').innerHTML = 'N/A'; + $('inventoryId').value = inventoryId = 0; + + var myAjax = new Ajax.Request( url, + { + method: 'get', + parameters: pars, + onSuccess: refreshShoppingCart, + onComplete: resetInfo, + onFailure: reportShoppingCartError + }); + + } + catch(e) + { + toConsole(e); + } + +} + +function handleCheckout(request) +{ + var response = request.responseText; + var result = eval('(' + response + ')'); + + if(result.error) + { + showErrorMessage(result.error); + } + else + { + printOrder(result.orderID); + reloadCart(); + } +} + + +function addBehaviourToCart() +{ + var rows = new Array(); + var count = 1; + + while(true) + { + var row = $('row' + count); + if(row == null) break; + + rows.push(row); + count ++; + } + + for(var i=0; i 0) + { + var line = cartLines[cartIndex]; + simulateOnClick(line); + + } + + if(cartLines.length > maxRows) + { + var shoppingCart = $('shoppingCart'); + shoppingCart.scrollTop = shoppingCart.scrollHeight; + } + +} + +//Reload the shopping cart. Prices are calculated for the pricelist +function setShoppingCartPriceList() +{ + try + { + var url = 'AddToPOSShoppingCartAction.do'; + var pars = 'action=updatePriceList&priceListId='+priceList; + + var myAjax = new Ajax.Request( url, + { + method: 'get', + parameters: pars, + onSuccess: refreshShoppingCart, + onFailure: reportShoppingCartError + }); + + } + catch(e) + { + toConsole(e); + } +} + +function scrollCart() +{ + var shoppingCart = $('shoppingCart'); + + if(cartIndex > maxRows) + { + shoppingCart.scrollTop = shoppingCart.scrollHeight; + } + else + { + shoppingCart.scrollTop = 0; + } +} + + +//Event.observe(window,'load',init,false); +//--------------------------------------------------------------------------------------- +//calling methods \ No newline at end of file diff --git a/posterita/posterita/web/js/inventoryHistory.js b/posterita/posterita/web/js/inventoryHistory.js new file mode 100644 index 0000000000..db744899e5 --- /dev/null +++ b/posterita/posterita/web/js/inventoryHistory.js @@ -0,0 +1,152 @@ +//scripts for Posterita Inventory History +var product_id = null; +var priceList = null; +var searchElement = null; +var defaultPriceList = null; + +var initHistory = function(){ + priceList = $('priceListId').value; + + defaultPriceList = priceList; + + var searchProductBy = $('searchProductBy').value; + if(searchProductBy == 'name') + { + searchElement = $('productQuery'); + } + else + { + searchElement = $(searchProductBy); + } + + + initProductSearch(); + + searchElement.focus(); + + var barcode = $('barcode'); + barcode.onkeyup = function(e){ + if(e.keyCode == Event.KEY_RETURN) + { + if(this.value != null && this.value != "") + { + redirect('ViewInventoryHistoryAction.do?action=searchProductInInventory&barCode=' + this.value); + } + + } + }; +}; + +var showProduct = function(element, update) +{ + update.style.display = 'block'; + update.style.opacity = '1.0'; + + if(!update.style.position || update.style.position=='absolute') { + update.style.position = 'absolute'; + Position.clone(element, update, {setHeight: false, offsetTop: element.offsetHeight}); + Position.clone($('maintop'), update, {setHeight: false, setTop: false, offsetTop: element.offsetHeight}); + } + + }; + + +var initProductSearch = function(){ + + // autocomplete for search by product name + var productAutocompleter = new Ajax.Autocompleter('productQuery','productSearchResult','SearchProductsAction.do',{ + paramName:'productName', + parameters : 'priceListId=' + priceList, + minChars:1, + frequency:1.0, + afterUpdateElement: afterAutocomplete2, + onShow : showProduct + }); + + productAutocompleter.xyz = true; + $('productQuery').Autocompleter = productAutocompleter; + + + // autocomplete for search by product description + var productAutocompleter2 = new Ajax.Autocompleter('description','productSearchByDescriptionResult','SearchProductsAction.do',{ + paramName:'description', + parameters : 'priceListId=' + priceList, + minChars:1, + frequency:1.0, + afterUpdateElement: afterAutocomplete2, + onShow : showProduct + }); + + $('description').Autocompleter = productAutocompleter2; +}; + +var afterAutocomplete2 = function(e1,e2){ + + + var barcode = e2.getAttribute('barcode'); + if(barcode=='null') + { + barcode = ""; + } + var productId = e2.getAttribute('productId'); + + if(productId == null) + { + $('description').value = ""; + $('productQuery').value = ""; + + return; + } + + //$('barcode').value = barcode; + $('productId').value= productId; + + var description = e2.getAttribute('description'); + //$('description').value = description; + + redirect('ViewInventoryHistoryAction.do?action=searchProductInInventory&productId=' + productId); + + //reset focus to search input + searchElement.focus(); + + //set global product + product_id = productId; + + $('description').value = ""; + $('productQuery').value = ""; + +}; + +function reportError(request) +{ + alert("Some error has occured while communicating with the server"); +}; + +function convertString2Unicode(s) +{ + var uniString = "", hexVal, uniChar; + + for(var i = 0; i < s.length; ++i) + { + //Convert char to hex + //hexVal = Number(s.charCodeAt(i)).toString(16); + hexVal = Number(s.charCodeAt(i)).toString(10); + + //Convert to unicode by making sure hex is 4 chars long, padding with 0's if less + //uniChar = "\\u" + ("000" + hexVal).match(/.{4}$/)[0]; + uniChar = "&#" + ("000" + hexVal).match(/.{4}$/)[0] +";"; + + uniString += uniChar; + } + if(hexVal < 255) + return s; + + return uniString; +} + +function redirect(url) +{ + window.location = url; +} + +Event.observe(window,'load',initHistory,false); \ No newline at end of file diff --git a/posterita/posterita/web/js/js-calendar.js b/posterita/posterita/web/js/js-calendar.js new file mode 100644 index 0000000000..c2524839db --- /dev/null +++ b/posterita/posterita/web/js/js-calendar.js @@ -0,0 +1,35 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +/** + @author praveen + */ + + +try +{ + addRequiredLibrary('javascripts/js-calendar/calendar.js'); + addRequiredLibrary('javascripts/js-calendar/calendar-en.js'); + addRequiredLibrary('javascripts/js-calendar/calendar-setup.js'); + addRequiredStyleSheet('css/js-calendar/calendar-win2k-1.css'); + + toConsole('js-calendar initialised'); +} +catch(e){toConsole(e);} \ No newline at end of file diff --git a/posterita/posterita/web/js/js-date.js b/posterita/posterita/web/js/js-date.js new file mode 100644 index 0000000000..cf2687144c --- /dev/null +++ b/posterita/posterita/web/js/js-date.js @@ -0,0 +1,55 @@ +function setStartDate(calendar) + { + var y = calendar.date.getFullYear(); + var m = calendar.date.getMonth(); + var d = calendar.date.getDate(); + + $FElement('startDay').options[d-1].selected = true; + $FElement('startMonth').options[m].selected = true; + + var options = $FElement('startYear').options; + + for(var i = 0; i < options.length; i++) + { + if(options[i].value == y) + { + $FElement('startYear').options[i].selected = true; + break; + } + } + + updateStartDate(); + + } + + function updateStartDate() + { + var d = $FElement('startDay').selectedIndex + 1; + var m = $FElement('startMonth').selectedIndex + 1; + var y = $FElement('startYear').selectedIndex; + y = $FElement('startYear').options[y].value; + + d = (d > 9) ? d : ('0' + d); + m = (m > 9) ? m : ('0' + m); + + $('startDate').value = d + '/' + m + '/' + y; + $FElement('fromDate').value = $('startDate').value; + } + + function initStartCalendar() + { + $FElement('startDay').onchange = updateStartDate; + $FElement('startMonth').onchange = updateStartDate; + $FElement('startYear').onchange = updateStartDate; + + Calendar.setup( + { inputField : "startDate", + ifFormat : "%d/%m/%Y", + showTime : true, + button : "startDateBtn", + onUpdate : setStartDate + } + ); + + $('startDate').value = $FElement('fromDate').value; + } \ No newline at end of file diff --git a/posterita/posterita/web/js/keyboard.js b/posterita/posterita/web/js/keyboard.js new file mode 100644 index 0000000000..9c1ca9910f --- /dev/null +++ b/posterita/posterita/web/js/keyboard.js @@ -0,0 +1,422 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +/** + @author praveen + */ + + +function insertAtCursor(myField, myValue) +{ + //IE support + if (document.selection) + { + myField.focus(); + sel = document.selection.createRange(); + sel.text = myValue; + } + //MOZILLA/NETSCAPE support + else if (myField.selectionStart || myField.selectionStart == 0) + { + var startPos = myField.selectionStart; + var endPos = myField.selectionEnd; + myField.value = myField.value.substring(0, startPos) + myValue + myField.value.substring(endPos, myField.value.length); + } + else + { + myField.value += myValue; + } +} + +function init() +{ + var textfield = this.output; + var keyboard = document.getElementById('keyboard'); + var keys = keyboard.getElementsByTagName('td'); + + for(var i=0; i' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + ' ' + + '' + + '' + + '' + + '' + + '' + + '
    1234567890HIDE
    QWERTYUIOPBACK
    ASDFGHJKLENTER
    CAPSZXCVBNM,.
    SPACE
    ' + + '' + + '
    ' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + ' ' + + '' + + '' + + '' + + '' + + '' + + '
    1234567890HIDE
    qwertyuiopBACK
    asdfghjklENTER
    CAPSzxcvbnm,.
    SPACE
    ' + + '
    ' + + '
    '; + +} + +Keyboard.prototype.show = function(e){ + + if(this.hidden) + { + this.keypadpanel.style.visibility = 'hidden'; + this.keypadpanel.style.display = 'block'; + //this.keypadpanel.style.top = '10px'; + //this.keypadpanel.style.left = '10px'; + this.hidden = false; + + try + { + //setting keyboard state in cookie + createCookie('pos_keyboard_on',"true",7); + } + catch(e) + { + toConsole(e); + } + + } +}; + +Keyboard.prototype.hide = function(e){ + this.keypadpanel.style.display = 'none'; + this.hidden = true; + + try + {toConsole + //setting keyboard state in cookie + createCookie('pos_keyboard_on',"false",7); + } + catch(e) + { + toConsole(e); + } +}; + +Keyboard.prototype.setCaps = function(e){ + + var uppercasekeyboard = document.getElementById('uppercase'); + var lowercasekeyboard = document.getElementById('lowercase'); + + //toConsole(uppercasekeyboard.style.display); + //toConsole(lowercasekeyboard.style.display); + + if(this.caps) + { + uppercasekeyboard.style.display = 'block'; + lowercasekeyboard.style.display = 'none'; + } + else + { + uppercasekeyboard.style.display = 'none'; + lowercasekeyboard.style.display = 'block'; + } + + +}; + +Keyboard.prototype.init = init; + +function showKeyboard() +{ + keyboard.show(); + keyboard.init(); + keyboard.setCaps(); + + kH = parseInt(keyboard.keypadpanel.scrollHeight); + kW = parseInt(keyboard.keypadpanel.scrollWidth); + + sH = parseInt(getViewportHeight()); + sW = parseInt(getViewportWidth()); + + cH = (sH - kH)/2; + cW = (sW - kW)/2; + + //centering the keyboard + keyboard.keypadpanel.style.top = cH + "px"; + keyboard.keypadpanel.style.left = cW + "px"; + keyboard.keypadpanel.style.visibility = 'visible'; + +} + +function bindKeyboard(output) +{ + keyboard.output = output; + keyboard.init(); + keyboard.setCaps(); +} + +function enableVirtualKeyboard() +{ + keyboard = new Keyboard(); + + var keyboardicon = document.getElementById('keyboardicon'); + + keyboardicon.style.display = 'inline'; + keyboardicon.onclick = function(e){ + showKeyboard(); + }; + + var textfields = document.getElementsByTagName('input'); + + for(var i=0; i 0) return true; + + return false; + } +}; + +var BP_CREDIT_STATUS = SO_CREDIT_STATUS.CreditOK; + +var initScreen = function(){ + DISCOUNT_LIMIT = getDiscountAllowed(); + OVERRIDE_PRICE_LIMIT = overrideLimit; + ISDISCOUNTUPTOLIMITPRICE = isDiscountUptoLimitPrice; + ISDISCOUNTONTOTAL = isDiscountAllowedOnTotal; + + + if(!ISDISCOUNTUPTOLIMITPRICE) + { + $('discountUptoLimitPrice').hide(); + } + + if(!OVERRIDE_PRICE_LIMIT) + { + $('overridePriceLimit').hide(); + } + + if(!ISDISCOUNTONTOTAL) + { + $('discountAllowedOnTotal').hide(); + $('linesTotal').hide(); + } + + if(DISCOUNT_LIMIT == 0) + { + $('userDiscLimit').hide(); + } + + //reset user pin + $('resetPinBtn').hide(); + + //set order type + orderType = $('orderType').value; + //set tender type + tenderType = $('tenderType').value; + //set priceList + priceList = $('priceListId').value; + + //set default data for price list + defaultPriceList = priceList; + defaultPriceListName = $('terminal').innerHTML; + + //set search element + var searchProductBy = $('searchProductBy').value; + if(searchProductBy == 'name') + { + searchElement = $('productQuery'); + } + else + { + searchElement = $(searchProductBy); + } + + //set is customer compulsory + if($('isCustomerCompulsory').value == 'true') + { + isCustomerCompulsory = true; + } + + initProductSearch(); + initSearchCustomer(); + initCartBtn(); + initAjaxResponder(); + initPIN(); + initShortcuts(); + initPaymentBtns(); + initSystemBtns(); + + //set payment rule + if(tenderType == null) + { + tenderType = PAYMENT_RULES.PAYMENT_RULE_CASH; + simulateOnClick($('cashBtn')); + } + else + { + simulateOnClick($(tenderType + 'Btn')); + } + + $('total').innerHTML = $('cartTotal').innerHTML; + + + searchElement.focus(); + + var barcode = $('barcode'); + barcode.focus(); + barcode.onkeyup = function(e){ + if(e.keyCode == Event.KEY_RETURN) + { + if(this.value != null && this.value != "") + { + if(!validateBp()) + { + return; + } + + addToCart(this.value); + this.value = ""; + } + + } + }; + + var incPrice = $('incPrice'); + incPrice.onkeyup = function(e){ + + ERROR_MSG = null; + var DISC_PERC = null; + + var discount = LIST_PRICE - this.value; + DISC_PERC = new Number((discount / LIST_PRICE)*100).toFixed(2); + $('disc').value = DISC_PERC; + + if (isNaN(this.value)) + { + showErrorMessage('Invalid Price Entered: ' + newPrice, this); + this.value = LIST_PRICE; + return; + } + + var newPrice = parseFloat(this.value); + + if(this.value == "") + { + newPrice = 0; + } + + + var totalAmt = $('qty').value * newPrice; + $('totalAmount').value = new Number(totalAmt).toFixed(2); + + $('discountOnTotal').value = $('isDiscOnTotal').value = 'false'; + $('isDiscOnInclUnitPrice').value = 'true'; + $('isDiscOnPerc').value = 'false'; + + validateDiscount(parseFloat(newPrice), parseFloat(DISC_PERC)); + + }; + + var disc = $('disc'); + disc.onkeyup = function(e){ + + ERROR_MSG = null; + var DISC_PERC = null; + + DISC_PERC = this.value; + $('disc').value = DISC_PERC; + + var discAmt = new Number((DISC_PERC / 100) * LIST_PRICE); + var newPrice = new Number(LIST_PRICE - discAmt).toFixed(2); + $('incPrice').value = newPrice; + var newTotal = new Number(((100 - DISC_PERC) / 100) * (LIST_PRICE * $('qty').value)).toFixed(2); + $('totalAmount').value = newTotal; + + $('discountOnTotal').value = $('isDiscOnTotal').value = 'false'; + $('isDiscOnInclUnitPrice').value = 'true'; + $('isDiscOnPerc').value = 'false'; + + validateDiscount(newPrice, DISC_PERC); + }; + + + var totalAmount = $('totalAmount'); + totalAmount.onkeyup = function(e){ + + ERROR_MSG = null; + var DISC_PERC = null; + var qty = $('qty').value; + var total = this.value; + var totalPriceLimit = LIMIT_PRICE * qty; + var newPrice = new Number(total/qty).toFixed(2); + $('incPrice').value = newPrice; + + var disount = LIST_PRICE - newPrice; + DISC_PERC = new Number((discount/LIST_PRICE) * 100).toFixed(2); + $('disc').value = DISC_PERC; + + $('discountOnTotal').value = $('isDiscOnTotal').value = 'false'; + $('isDiscOnInclUnitPrice').value = 'true'; + $('isDiscOnPerc').value = 'false'; + + validateDiscount(newPrice, DISC_PERC); + }; + + var GrandTotal = $('grandTotal'); + GrandTotal.onkeyup = function(e) + { + var totalLines = this.value; + var ERROR_MSG = null; + + if((ISDISCOUNTUPTOLIMITPRICE == true) && (OVERRIDE_PRICE_LIMIT == false)) + { + if((totalLines > TOTAL_LIST_PRICE) && (ORIG_TOTAL_LINES != totalLines)) + { + ERROR_MSG = "DISCOUNTED TOTAL EXCEEDS TOTAL LINES!!!"; + } + if((totalLines < TOTAL_LIMIT_PRICE) && (ORIG_TOTAL_LINES != totalLines)) + { + ERROR_MSG = "TOTAL DISCOUNT EXCEEDED!!!"; + } + + if((totalLines > TOTAL_LIST_PRICE) && (totalLines < TOTAL_LIMIT_PRICE)) + ERROR_MSG = null; + } + + if((ISDISCOUNTUPTOLIMITPRICE == false) && (OVERRIDE_PRICE_LIMIT == true)) + { + if(DISCOUNT_LIMIT > 0) + { + var discount = TOTAL_LIST_PRICE - totalLines; + DISC_PERC = new Number((discount/TOTAL_LIST_PRICE)*100).toFixed(2); + + if(DISC_PERC > DISCOUNT_LIMIT) + { + ERROR_MSG = "DISCOUNT LIMIT EXCEEDED!!!"; + } + + discAmt = totalLines - GRAND_TOTAL; + if(discAmt > 0) + { + ERROR_MSG = "DISCOUNT CANNOT BE NAGATIVE"; + } + + } + + if(DISCOUNT_LIMIT == 0) + { + ERROR_MSG = "CANNOT APPLY DISCOUNT!!!
    NO DISCOUNT PERCENTAGE SET"; + } + } + + if((ISDISCOUNTUPTOLIMITPRICE == false) && (OVERRIDE_PRICE_LIMIT == false)) + { + if(DISCOUNT_LIMIT > 0) + { + if((totalLines < TOTAL_LIMIT_PRICE) && (ORIG_TOTAL_LINES != totalLines)) + { + ERROR_MSG = "CANNOT OVERRIDE LIMIT PRICE!!!"; + } + + if((totalLines > TOTAL_LIST_PRICE) && (ORIG_TOTAL_LINES != totalLines)) + { + ERROR_MSG = "DISCOUNTED TOTAL EXCEEDS TOTAL LINES!!!"; + } + } + + if(DISCOUNT_LIMIT == 0) + { + ERROR_MSG = "CANNOT APPLY DISCOUNT!!!
    NO DISCOUNT PERCENTAGE SET"; + } + } + + if((ISDISCOUNTUPTOLIMITPRICE == true) && (OVERRIDE_PRICE_LIMIT == true)) + { + $('discountUptoLimitPrice').className = "error"; + $('overridePriceLimit').className = "error"; + ERROR_MSG = "DISCOUNT ERROR!! CANNOT PROCESS YOUR REQUEST!!!"; + } + + if(ERROR_MSG == null) + { + if(ORIG_TOTAL_LINES == totalLines) + { + $('applyDiscBtn').disabled = true; + } + else + { + $('applyDiscBtn').disabled = false; + } + } + else + { + $('applyDiscBtn').disabled = true; + } + + $('errorMsg').innerHTML = ERROR_MSG; + + $('discountOnTotal').value = $('isDiscOnTotal').value = 'true'; + $('isDiscOnInclUnitPrice').value = 'false'; + $('isDiscOnPerc').value = 'false'; + + }; + + + $('qty').onkeyup = function(e){ + if(e.keyCode == Event.KEY_RETURN) + { + //update qty + done = true; + updateQty(product_id, this.value); + } + }; + + $('checkoutBtn').onclick = function(e){ + initSystemBtns(); + this.className = 'selected'; + if(cartLines == null || cartLines.length == 0) + { + showErrorMessage('Shopping cart is empty!', 'productQuery'); + } + else + { + if(orderType == ORDER_TYPES.CUSTOMER_RETURNED_ORDER) + { + $('creditPanel').show(); + } + else if(orderType == ORDER_TYPES.POS_GOODS_RETURNED_NOTE) + { + $('creditPanel').show(); + } + else + { + activePanel.show(); + } + + } + }; + + $('openDrawerBtn').onclick = function(e){ + initSystemBtns(); + this.className = 'selected'; + openCashDrawer(); + }; + + $('discountBtn').showDiscount = $('discountBtn').onclick + $('discountBtn').onclick = function(){ + initSystemBtns(); + this.className = 'selected'; + if(cartLines == null || cartLines.length == 0) + { + showErrorMessage('Shopping cart is empty!', 'productQuery'); + } + else + { + this.showDiscount(); + } + + }; + + $('clearCartBtn').onclick = function(e){ + initSystemBtns(); + this.className = 'selected'; + cartIndex = null; + cartLines = null; + clearCart(); + }; + + $('quickDiscountBtn').onclick = function(e){ + initSystemBtns(); + this.className = 'selected'; + var QuickDiscountForm = $('QuickDiscountForm'); + + if(cartLines == null || cartLines.length == 0) + { + isQuickDiscount = false; + QuickDiscountForm.disable(); + showErrorMessage('Shopping cart is empty!', 'barcode'); + } + else + { + if(!OVERRIDE_PRICE_LIMIT && !ISDISCOUNTUPTOLIMITPRICE && !ISDISCOUNTONTOTAL && DISCOUNT_LIMIT == 0) + { + isQuickDiscount = false; + QuickDiscountForm.disable(); + $('errorMsg').innerHTML = "DISCOUNT NOT ALLOWED!!!"; + showErrorMessage('You are not allowed to give discount!', 'barcode'); + } + else + { + isQuickDiscount = true; + QuickDiscountForm.enable(); + + } + + } + + if(isQuickDiscount) + { + if(isDiscountFormOpen) + { + closeDiscount(); + } + else + { + quickDiscount(); + } + } + else + { + closeDiscount(); + } + + }; + + $('applyDiscBtn').onclick = function(e){ + if(cartLines == null || cartLines.length == 0) + { + showErrorMessage('Shopping cart is empty!', 'productQuery'); + } + else + { + applyDiscount(); + } + }; + + $('changePinBtn').onclick = function(e){ + + var isOverlay = $('PINPanel').style.display; + + if(isOverlay == 'none' || isOverlay == '') + { + popUp(); + } + showDisableMask(); + popPanel($('PINPanel')); + $('PIN').focus(); + }; + + //add behaviour to existing cart + addBehaviourToCart(); + + $('barcode').focus(); + showErrors(); +}; + +var initPIN = function(){ + var pinPanel = $('PINPanel'); + var inputs = pinPanel.getElementsByTagName('input'); + + pinPanel.pin = inputs[0]; + pinPanel.ok = inputs[1]; + pinPanel.cancel = inputs[2]; + + var validatePIN = function() + { + if($('PINPanel').pin.value == null || $('PINPanel').pin.value == '') + { + return; + } + + var url = 'AddToPOSShoppingCartAction.do'; + var pars = 'action=validatePIN&pin=' + $('PINPanel').pin.value; + + var refreshDiscountLimit = function(request){ + var response = request.responseText; + var result = eval('(' + response + ')'); + + if(result.error) + { + $('PINPanel').pin.value = ''; + showErrorMessage(result.error, 'PIN'); + } + else + { + roleId = result.roleId; + discountLimit = result.discountLimit; + overrideLimit = result.overrideLimit; + discountOnTotal = result.discountOnTotal; + discountUptoPriceLimit = result.discountUptoPriceLimit; + + DISCOUNT_LIMIT = discountLimit; + OVERRIDE_PRICE_LIMIT = overrideLimit; + ISDISCOUNTONTOTAL = discountOnTotal; + ISDISCOUNTUPTOLIMITPRICE = discountUptoPriceLimit; + + if(!ISDISCOUNTUPTOLIMITPRICE) + { + $('discountUptoLimitPrice').hide(); + } + else + { + $('discountUptoLimitPrice').show(); + } + + if(!OVERRIDE_PRICE_LIMIT) + { + $('overridePriceLimit').hide(); + } + else + { + $('overridePriceLimit').show(); + } + + if(!ISDISCOUNTONTOTAL) + { + $('discountAllowedOnTotal').hide(); + } + else + { + $('discountAllowedOnTotal').show(); + } + + if(DISCOUNT_LIMIT == 0) + { + $('userDiscLimit').hide(); + } + else + { + $('userDiscLimit').show(); + } + + $('isDiscountUptoLimitPrice').innerHTML = discountUptoPriceLimit + ''; + $('overrideLimit').innerHTML = overrideLimit + ''; + $('isDiscountOnTotal').innerHTML = discountOnTotal + ''; + $('discountLimit').innerHTML = discountLimit + '%'; + $('roleId').value = roleId; + $('PINPanel').pin.value = ''; + + $('resetPinBtn').show(); + $('changePinBtn').hide(); + popUp(); + hidePanel($('PINPanel')); + hideDisableMask(); + refreshCart(); + } + }; + + var myAjax = new Ajax.Request( url, + { + method: 'get', + parameters: pars, + onSuccess: refreshDiscountLimit, + onFailure: reportShoppingCartError + }); + } + + pinPanel.ok.onclick = validatePIN; + + pinPanel.pin.onkeyup = function(e){ + if(e.keyCode == Event.KEY_RETURN) + { + validatePIN(); + } + }; + + pinPanel.cancel.onclick = function(e){ + $('PINPanel').pin.value = ''; + popUp(); + hidePanel($('PINPanel')); + hideDisableMask(); + }; +}; + +function resetUser(roleId) +{ + var url = 'AddToPOSShoppingCartAction.do'; + var pars = 'action=resetUser&roleId=' + roleId; + var myAjax = new Ajax.Request( url, + { + method: 'get', + parameters: pars, + onSuccess: refreshUser, + onFailure: reportShoppingCartError + }); + +} + +function refreshUser(request) +{ + var response = request.responseText; + var result = eval('(' + response + ')'); + + if(result.error) + { + showErrorMessage(result.error, 'barcode'); + } + else + { + roleId = result.roleId; + discountLimit = result.discountLimit; + overrideLimit = result.overrideLimit; + discountOnTotal = result.discountOnTotal; + discountUptoPriceLimit = result.discountUptoPriceLimit; + + DISCOUNT_LIMIT = discountLimit; + OVERRIDE_PRICE_LIMIT = overrideLimit; + ISDISCOUNTONTOTAL = discountOnTotal; + ISDISCOUNTUPTOLIMITPRICE = discountUptoPriceLimit; + + $('isDiscountUptoLimitPrice').innerHTML = discountUptoPriceLimit + ''; + $('overrideLimit').innerHTML = overrideLimit + ''; + $('isDiscountOnTotal').innerHTML = discountOnTotal + ''; + $('discountLimit').innerHTML = discountLimit + '%'; + $('roleId').value = roleId; + $('PINPanel').pin.value = ''; + + $('changePinBtn').show(); + $('resetPinBtn').hide(); + + refreshCart(); + } +} + +var initShortcuts = function() +{ + shortcut.add("Ctrl+Space", function(e){simulateOnClick($('checkoutBtn'))}); + + shortcut.add("F1", function(e){$('barcode').select();}); + shortcut.add("F2", function(e){$('productQuery').select();}); + shortcut.add("F3", function(e){$('description').select();}); + shortcut.add("F4", function(e){$('qty').select();}); + + shortcut.add("F5", function(e){$('customerQuery').select();}); + shortcut.add("F6", function(e){simulateOnClick($('discountBtn'))}); + + // Barcode Btn + shortcut.add("Ctrl+B", function(e){simulateOnClick($('barcodeBtn'))}); + + // Quick Discount + shortcut.add("F8", function(e){simulateOnClick($('quickDiscountBtn'))}); + //payment btns + shortcut.add("F9", function(e){simulateOnClick($('cashBtn'))}); + shortcut.add("F10", function(e){simulateOnClick($('cardBtn'))}); + shortcut.add("F11", function(e){simulateOnClick($('chequeBtn'))}); + shortcut.add("F12", function(e){simulateOnClick($('mixBtn'))}); + + shortcut.add("Ctrl+M", function(){simulateOnClick($('menuBtn'))}); + shortcut.add("Ctrl+D", function(){ + //simulateOnClick($('openDrawerBtn')); + showErrorMessage('Opening Cash Drawer'); + + }); + shortcut.add("Ctrl+Delete", function(){ + simulateOnClick($('clearCartBtn')); + }); + shortcut.add("Ctrl+P", function(){simulateOnClick($('changePinBtn'))}); + shortcut.add("Ctrl+R", function(){simulateOnClick($('resetPinBtn'))}); + shortcut.add("Ctrl+S", function(){simulateOnClick($('shortcutBtn'))}); + + shortcut.add("Ctrl+C", function(){simulateOnClick($('creditBtn'))}); + + //move between cart lines + shortcut.add("Ctrl+Up", function(){ + closeDiscount(); + if(cartIndex > 0) + { + cartIndex = cartIndex -1; + var line = cartLines[cartIndex]; + scrollCart(); + simulateOnClick(line); + } + }); + + shortcut.add("Ctrl+Down", function(){ + closeDiscount(); + if(cartIndex < cartLines.length - 1) + { + cartIndex = cartIndex + 1; + var line = cartLines[cartIndex]; + scrollCart(); + simulateOnClick(line); + } + }); + + //incrementing and decrementing qty + shortcut.add("Ctrl+Right", function(){ + closeDiscount(); + simulateOnClick($('plusBtn')); + }); + + shortcut.add("Ctrl+Left", function(){ + closeDiscount(); + simulateOnClick($('minusBtn')); + }); + + shortcut.add("Ctrl+Backspace", function(){ + closeDiscount(); + simulateOnClick($('deleteBtn')); + }); + + //Enable create product for GRN + if(orderType == ORDER_TYPES.POS_GOODS_RECEIVE_NOTE) + { + shortcut.add("Alt+P", function(){CreateProduct.showPopup(0);}); + shortcut.add("Alt+U", function(){ + if(product_id != null) + CreateProduct.showPopup(product_id); + }); + + shortcut.add("Esc", function(){ + CreateProduct.hidePopup(); + }); + } + +}; + +var showResult = function(element, update){ + if(!update.style.position || update.style.position=='absolute') { + update.style.position = 'absolute'; + Position.clone(element, update, {setHeight: false, offsetTop: element.offsetHeight}); + Position.clone($('maintop'), update, {setHeight: false, setTop: false, offsetTop: element.offsetHeight}); + } + + update.style.display = 'block'; + update.style.opacity = '1.0'; + + }; + + +var initProductSearch = function(){ + + // autocomplete for search by product name + var productAutocompleter = new Ajax.Autocompleter('productQuery','productSearchResult','SearchProductsAction.do',{ + paramName:'productName', + parameters : 'priceListId=' + priceList, + minChars:1, + frequency:1.0, + afterUpdateElement: afterAutocomplete, + onShow : showResult + }); + + productAutocompleter.xyz = true; + $('productQuery').Autocompleter = productAutocompleter; + + + // autocomplete for search by product description + var productAutocompleter2 = new Ajax.Autocompleter('description','productSearchByDescriptionResult','SearchProductsAction.do',{ + paramName:'description', + parameters : 'priceListId=' + priceList, + minChars:1, + frequency:1.0, + afterUpdateElement: afterAutocomplete, + onShow : showResult + }); + + $('description').Autocompleter = productAutocompleter2; +}; + +var afterAutocomplete = function(e1,e2){ + + if(!validateBp()) + { + return; + } + + var barcode = e2.getAttribute('barcode'); + if(barcode=='null') + { + barcode = ""; + } + var productId = e2.getAttribute('productId'); + + if(productId == null) + { + $('description').value = ""; + $('productQuery').value = ""; + + return; + } + + //$('barcode').value = barcode; + $('productId').value= productId; + + var description = e2.getAttribute('description'); + //$('description').value = description; + + incrementCart(productId); + + //reset focus to search input + searchElement.focus(); + + //show product details + getProductInfo(productId); + + //set global product + product_id = productId; + + $('description').value = ""; + $('productQuery').value = ""; + +}; + +function getProductInfo(productId) +{ + var url = 'POSProductAction2.do'; + var pars = 'action=getProductDetails&productId='+productId+'&priceListId='+priceList; + + var myAjax = new Ajax.Request( url, + { + method: 'get', + parameters: pars, + onSuccess: showProductInfo, + onFailure: reportError + }); +} + +function showProductInfo(request) +{ + // + try + { + var response = request.responseText; + var product = eval('(' + response + ')'); + + //display product info in right column + $('m_productId').value = product.id; + $('product.name').innerHTML = product.name; + $('product.barcode').innerHTML = product.barcode; + $('product.taxCategory').innerHTML = product.taxCategory; + $('product.description').innerHTML = product.description; + $('product.stock.qty').innerHTML = product.stockQty; + TAX_RATE = $('taxRate').value = new Number(product.taxRate).toFixed(2); + var taxPercentage = new Number(1 + (TAX_RATE / 100)); + + ISTAXINCLUDED = product.isTaxIncluded; + + if(ISTAXINCLUDED == "false") + { + LIMIT_PRICE = $('priceLimit').innerHTML = new Number(product.priceLimit * taxPercentage).toFixed(2); + LIST_PRICE = new Number(product.priceList * taxPercentage).toFixed(2); + ORIG_TOTAL = new Number($('qty').value * product.priceList * taxPercentage).toFixed(2); + } + else + { + LIMIT_PRICE = $('priceLimit').innerHTML = new Number(product.priceLimit).toFixed(2); + LIST_PRICE = new Number(product.priceList).toFixed(2); + ORIG_TOTAL = new Number($('qty').value * product.priceList).toFixed(2); + } + + $('product.price.list').innerHTML = LIST_PRICE; + + if(ISDISCOUNTUPTOLIMITPRICE) + { + $('product.price.limit').innerHTML = LIMIT_PRICE; + } + + $('product.image').src = 'images/newUI/productpreview.gif'; + + } + catch(e) + { + showErrorMessage(e); + } +} + +function reportError(request) +{ + alert("Some error has occured while communicating with the server"); + var w = window.open("","Error"); + var d = w.document; + d.write(request.responseText); +} + +function convertString2Unicode(s) +{ + var uniString = "", hexVal, uniChar; + + for(var i = 0; i < s.length; ++i) + { + //Convert char to hex + //hexVal = Number(s.charCodeAt(i)).toString(16); + hexVal = Number(s.charCodeAt(i)).toString(10); + + //Convert to unicode by making sure hex is 4 chars long, padding with 0's if less + //uniChar = "\\u" + ("000" + hexVal).match(/.{4}$/)[0]; + uniChar = "&#" + ("000" + hexVal).match(/.{4}$/)[0] +";"; + + uniString += uniChar; + } + if(hexVal < 255) + return s; + + return uniString; +} + +// returns true if bp is valid +var validateBp = function(){ + if(orderType == ORDER_TYPES.POS_GOODS_RECEIVE_NOTE || + orderType == ORDER_TYPES.POS_GOODS_RETURNED_NOTE) + { + var bpartner = $('bpartnerId').value; + if(bpartner == null || bpartner == "") + { + showErrorMessage("Please choose a vendor", 'customerQuery'); + //$('bpartnerId').focus(); + + return false; + } + } + + if(isCustomerCompulsory) + { + var bpartner = $('bpartnerId').value; + if(bpartner == null || bpartner == "") + { + showErrorMessage("Please choose a customer", 'customerQuery'); + //$('bpartnerId').focus(); + + return false; + } + } + + if(orderType == ORDER_TYPES.CREDIT_ORDER || orderType == ORDER_TYPES.POS_ORDER) + if($('tenderType').value == PAYMENT_RULES.PAYMENT_RULE_CREDIT) + { + var bpartner = $('bpartnerId').value; + if(bpartner == null || bpartner == "") + { + showErrorMessage("Please choose a customer", 'customerQuery'); + //$('bpartnerId').focus(); + + return false; + } + + if(BP.creditStatus == SO_CREDIT_STATUS.NoCreditCheck) + { + showErrorMessage("Please set credit status for customer", 'customerQuery'); + return false; + } + + if(BP.creditLimit == 0) + { + showErrorMessage("Please set credit limit for customer", 'customerQuery'); + return false; + } + + if(BP.openBalance > BP.creditLimit) + { + showErrorMessage("Credit Limit has been exceed!", 'customerQuery'); + return false; + } + + if(BP.creditStatus != SO_CREDIT_STATUS.CreditOK) + { + var errmsg = 'Invalid credit status! '; + + if(BP.creditStatus == SO_CREDIT_STATUS.CreditHold) + { + errmsg += 'Credit Hold'; + } + + if(BP.creditStatus == SO_CREDIT_STATUS.CreditStop) + { + errmsg += 'Credit Stop'; + } + + if(BP.creditStatus == SO_CREDIT_STATUS.CreditWatch) + { + errmsg += 'Credit Watch'; + } + + showErrorMessage(errmsg, 'customerQuery'); + return false; + } + + } + + return true; +}; + +var initSearchCustomer = function(){ + + //validateBp(); // validates bp on load + + // auto complete for customer + $('customerQuery').Autocompleter = new Ajax.Autocompleter('customerQuery','customerSearchResult','SearchCustomerAction.do',{ + paramName:'customerQuery', + frequency:TROTTLE_TIME, + parameters : 'orderType=' + orderType, // if credit order, do not validate for standard customer + onShow:function(element, update){ + if(!update.style.position || update.style.position=='absolute') { + update.style.position = 'absolute'; + Position.clone(element, update, {setHeight: false, offsetTop: element.offsetHeight}); + } + update.style.display = 'block'; + }, + afterUpdateElement:function(e1,e2){ + var bpartner = $('bpartnerId'); + var bpartnerName = $('customer.name'); + + + if(e2.value != '-1') + { + if(e2.value) + { + bpartner.value = e2.value; + } + else + { + bpartner.value = ''; + } + + $('customer.code').innerHTML = bpartner.value; + var creditLimit = e2.getAttribute('creditLimit'); + var creditAvailable = e2.getAttribute('creditAvailable'); + var openBalance = e2.getAttribute('openBalance'); + var creditStatus = e2.getAttribute('creditStatus'); + var name = e2.getAttribute('name'); + + if(bpartnerName) + { + BP.id = bpartner.value; + BP.name = name; + BP.priceList = e2.getAttribute('priceList'); + BP.priceListName = e2.getAttribute('pricelistName'); + BP.creditStatus = creditStatus; + BP.creditAvailable = parseFloat(creditAvailable); + BP.creditLimit = parseFloat(creditLimit); + BP.openBalance = parseFloat(openBalance); + + $('customerCode').style.display = 'table-row'; + $('customerName').style.display = 'table-row'; + $('creditAvailable').style.display = 'table-row'; + $('creditLimit').style.display = 'table-row'; + $('openBalance').style.display = 'table-row'; + + $('customer.name').innerHTML = name; + $('credit.available').innerHTML = creditAvailable; + $('credit.limit').innerHTML = creditLimit; + $('open.balance').innerHTML = openBalance; + + BP_CREDIT_STATUS = creditStatus; + + if (e2.getAttribute('priceList') && parseInt(e2.getAttribute('priceList')) > 0) + { + priceList = e2.getAttribute('priceList'); + $('priceListId').value = priceList; + $('terminal').innerHTML = e2.getAttribute('pricelistName'); + } + else + { + priceList = defaultPriceList; + $('terminal').innerHTML = defaultPriceListName; + } + if(cartLines != null && cartLines.length != 0) + { + //reload shopping cart for partner + if(oldPriceList != priceList) + { + setShoppingCartPriceList(); + oldPriceList = priceList; + } + } + $('productQuery').Autocompleter.options.defaultParams='priceListId=' + priceList; + saveBPartnerInfo(bpartner.value, name, creditLimit, priceList); + }//if + } + else + { + bpartner.value = ""; + if(bpartnerName) + { + bpartnerName.value = ""; + }//if + }//if + + + $('customerQuery').value = ""; + + searchElement.focus(); + } + + }); + +} + +function saveBPartnerInfo(bPartnerValue, name, creditLimit, priceListId) +{ + try + { + var url = 'CheckoutAction.do'; + var pars = 'action=saveBPartnerInfo&bPartnerId='+bPartnerValue +'&name='+name+'&creditLimit='+creditLimit+'&priceListId='+priceListId; + + var myAjax = new Ajax.Request( url, + { + method: 'get', + parameters: pars + }); + + } + catch(e) + { + toConsole(e); + } + return; +} + +var initCartBtn = function(){ + var plus = $('plusBtn'); + var minus = $('minusBtn'); + var del = $('deleteBtn'); + + plus.style.cursor = 'pointer'; + minus.style.cursor = 'pointer'; + del.style.cursor = 'pointer'; + + plus.onclick = function(e){ + if(product_id != null) + incrementCart(product_id); + searchElement.focus(); + }; + + minus.onclick = function(e){ + if(product_id != null) + decrementCart(product_id); + searchElement.focus(); + }; + + del.onclick = function(e){ + if(product_id != null) + deleteItemFromCart(product_id); + + if(cartLines == null || cartLines.length == 0) + { + resetDetails(); + } + + searchElement.focus(); + }; +}; + + + +var initAjaxResponder = function(){ + + Ajax.Responders.register({ + onCreate: function() { + $('indicator').style.display = 'block'; + }, + onComplete: function() { + $('indicator').style.display = 'none'; + } + }); +}; + + + +//---------------------------------------------------------------------------- + + +var hidePaymentPanels = function(){ + paymentPanels.each(hidePanel); +}; + +var initOkCancel = function(panel){ + var inputs = panel.getElementsByTagName('input'); + + if(inputs.length > 2) + { + var length = inputs.length; + var ok = inputs[length-2]; + var cancel = inputs[length-1]; + + ok.panel = panel; + cancel.panel = panel; + + ok.onclick = function(){this.panel.validate();}; + cancel.onclick = function() + { + hidePanel(this.panel); + }; + + shortcut.add("Esc", function() + { + simulateOnClick(cancel); + }); + + } + +}; + +// add behaviour to different payment panels +var initCashPanel = function(){ + var cashPanel = $('cashPanel'); + + if(orderType == ORDER_TYPES.POS_GOODS_RECEIVE_NOTE) + { + $('writeOffAmt').style.display = 'none'; + $('actualPaymentAmt').style.display = 'none'; + } + + $('amountTendered').focus(); + + $('amountTendered').onkeypress = function(e){ + + if(e.keyCode == Event.KEY_RETURN) + { + if(this.value == null || this.value == '') + { + showErrorMessage('Enter an amount!', 'amountTendered'); + return; + } + + $('cashPanel').validate(); + } + } + $('amountTendered').onkeyup = function(e){ + + var amount = getCartTotal(); + var amountRefunded = null; + var writeOffAmt = 0; + + var paymentAmt = new Number(amount).toFixed(2); + if(orderType == ORDER_TYPES.POS_ORDER) + { + var roundOffFactor = $('roundOffFactor').value; + var writeOffAmt = 0; + + if (roundOffFactor != null && roundOffFactor != 0) + { + var multiple = amount/roundOffFactor; + var index1 = multiple.toString().indexOf('.'); + if(index1 == -1) + { + writeOffAmt = 0; + } + else + { + multiple = parseInt(multiple); + writeOffAmt = amount - (multiple * roundOffFactor); + writeOffAmt = writeOffAmt.toFixed(2); + } + } + paymentAmt = new Number(amount - writeOffAmt).toFixed(2); + $('writeOffCash').innerHTML = new Number(writeOffAmt).toFixed(2); + $('paymentCash').innerHTML = paymentAmt; + } + + amountRefunded = this.value - paymentAmt; + //Round amountRefunded to two decimal places if its greater than 2 decimal places + var amtstr = new Number(amountRefunded).toString(); + var index = amtstr.indexOf('.'); + + var noOfDecimalPlaces = amountRefunded.toString().length - index; + if(index != -1 && noOfDecimalPlaces > 2) + { + $('amountRefunded').innerHTML = Math.round(amountRefunded * 100) / 100; + } + else + { + $('amountRefunded').innerHTML = amountRefunded; + } + + }; + + cashPanel.validate =function(){ + var amount = getCartTotal(); + var amountTendered = new Number($('amountTendered').value); + var writeOff = $('writeOffCash').innerHTML; + var writeOffAmt = new Number(writeOff); + + if (isNaN(amountTendered)) + { + showErrorMessage('Please enter a numeric value', 'amountTendered'); + return; + } + if (isNaN(writeOffAmt)) + { + writeOffAmt = 0; + } + var total = amountTendered + writeOffAmt; + + if(amount > total) + { + showErrorMessage('Amount tendered is less that total amount', 'amountTendered'); + } + else + { + $FElement('tenderType').value = 'cash'; + $FElement('amountTendered').value = $('amountTendered').value; + $FElement('amountRefunded').value = new Number(amountTendered - amount).toFixed(2); + + hidePanel(this); + + checkout(); + + } + };//cashPanel.validate + + cashPanel.show = function(){ + hidePaymentPanels(); + popPanel(this); + $('cashTotal').innerHTML = $('total').innerHTML; + $('amountTendered').focus(); + }; + + cashPanel.reset = function(){ + $('amountTendered').value = ''; + $('amountRefunded').innerHTML = ''; + }; +}; + +var initCardPanel = function(){ + var cardPanel = $('cardPanel'); + + $('cardNo').onkeypress = function(e){ + + if(e.keyCode == Event.KEY_RETURN) + { + if(this.value == null || this.value == '') + { + showErrorMessage('Enter Credit Card Number!','cardNo'); + return; + } + + $('cardPanel').validate(); + } + }; + + cardPanel.validate = function(){ + //validate credit card no + var cardNo = $('cardNo').value; + + if(cardNo == null || cardNo == '') + { + showErrorMessage('Enter Credit Card Number!','cardNo'); + } + else + { + $FElement('tenderType').value = 'card'; + $FElement('cardNo').value = cardNo; + + hidePanel(this); + + checkout(); + } + }; + + cardPanel.show = function(){ + hidePaymentPanels(); + popPanel(this); + $('cardTotal').innerHTML = $('total').innerHTML; + $('cardList').focus(); + }; + + cardPanel.reset = function(){ + $('cardNo').value = ''; + $('cardList').selectedIndex = 0; + }; +}; + +var initChequePanel = function(){ + var chequePanel = $('chequePanel'); + + $('chequeNo').onkeypress = function(e){ + + if(e.keyCode == Event.KEY_RETURN) + { + if(this.value == null || this.value == '') + { + showErrorMessage('Enter Cheque Number!','chequeNo'); + return; + } + + $('chequePanel').validate(); + } + }; + + chequePanel.validate = function(){ + //validate cheque no + var chequeNo = $('chequeNo').value; + + if(chequeNo == null || chequeNo == '') + { + showErrorMessage('Enter Cheque Number!'); + } + else + { + $FElement('tenderType').value = 'cheque'; + $FElement('chequeNo').value = chequeNo; + + hidePanel(this); + + checkout(); + } + }; + + chequePanel.show = function(){ + hidePaymentPanels(); + popPanel(this); + $('chequeTotal').innerHTML = $('total').innerHTML; + $('chequeNo').focus(); + }; + + chequePanel.reset = function(){ + $('chequeNo').value = ''; + }; +}; + +var initMixPanel = function(){ + var mixPanel = $('mixPanel'); + + var bgColorError = '#FF0000'; + var bgColorNormal = '#FFFFFF'; + var cardAmount; + var cashAmount; + var chequeAmount; + + var inputs = mixPanel.getElementsByTagName('input'); + + $('mix_cashAmt').onkeyup = function(e){ + var total = getCartTotal(); + + if (this.value <= total && this.value >= 0) + { + cashAmount = new Number(this.value); + cardAmount = new Number($('mix_cardAmt').value); + chequeAmount = new Number($('mix_chequeAmt').value); + + var diff = (cashAmount + cardAmount + chequeAmount) - total; + + if (diff < 0) + { + cardAmount = total - (cashAmount + chequeAmount); + } + if (diff > 0) + { + var cardAmountDiff = cardAmount - diff; + + if (cardAmountDiff > 0) + { + cardAmount = cardAmountDiff; + } + else + { + chequeAmount = chequeAmount + cardAmountDiff; + cardAmount = 0; + } + } + $('mix_cardAmt').value = new Number(cardAmount).toFixed(2); + $('mix_chequeAmt').value = new Number(chequeAmount).toFixed(2); + this.style.backgroundColor = bgColorNormal; + inputs[5].disabled = false; + } + else + { + this.style.backgroundColor = bgColorError; + inputs[5].disabled = true; + } + }; + + $('mix_chequeAmt').onkeyup = function(e){ + var total = getCartTotal(); + + if (this.value <= total && this.value >= 0) + { + chequeAmount = new Number(this.value); + cashAmount = new Number($('mix_cashAmt').value); + cardAmount = new Number($('mix_cardAmt').value); + var diff = (chequeAmount + cashAmount + cardAmount) - total; + + if (diff < 0) + { + cardAmount = total - (chequeAmount + cashAmount); + } + if (diff > 0) + { + var cardAmountDiff = cardAmount - diff; + if (cardAmountDiff > 0) + { + cardAmount = cardAmountDiff; + } + else + { + cashAmount = cashAmount + cardAmountDiff; + cardAmount = 0; + } + } + $('mix_cardAmt').value = new Number(cardAmount).toFixed(2); + $('mix_cashAmt').value = new Number(cashAmount).toFixed(2); + this.style.backgroundColor = bgColorNormal; + inputs[5].disabled = false; + } + else + { + this.style.backgroundColor = bgColorError; + inputs[5].disabled = true; + } + }; + + $('mix_cardAmt').onkeyup = function(e){ + var total = getCartTotal(); + + if(this.value <= total && this.value >= 0) + { + chequeAmount = new Number($('mix_chequeAmt').value); + cashAmount = new Number($('mix_cashAmt').value); + cardAmount = new Number(this.value); + + var diff = (cardAmount + cashAmount + chequeAmount) - total; + + if (diff < 0) + { + chequeAmount = total - (cardAmount + cashAmount); + } + if (diff > 0) + { + var chequeAmountDiff = chequeAmount - diff; + + if (chequeAmountDiff > 0) + { + chequeAmount = chequeAmountDiff; + } + else + { + cashAmount = cashAmount + chequeAmountDiff; + chequeAmount = 0; + } + } + $('mix_chequeAmt').value = new Number(chequeAmount).toFixed(2); + $('mix_cashAmt').value = new Number(cashAmount).toFixed(2); + this.style.backgroundColor = bgColorNormal; + inputs[5].disabled = false; + } + else + { + this.style.backgroundColor = bgColorError; + inputs[5].disabled = true; + } + }; + + $('mix_cashAmt').onkeypress = function(e){ + + if(e.keyCode == Event.KEY_RETURN) + { + mixPanel.validate(); + } + }; + + $('mix_chequeAmt').onkeypress = function(e){ + + if(e.keyCode == Event.KEY_RETURN) + { + mixPanel.validate(); + } + }; + + $('mix_cardAmt').onkeypress = function(e){ + + if(e.keyCode == Event.KEY_RETURN) + { + mixPanel.validate(); + } + }; + + $('mix_chequeNo').onkeypress = function(e){ + + if(e.keyCode == Event.KEY_RETURN) + { + mixPanel.validate(); + } + }; + + $('mix_cardNo').onkeypress = function(e){ + + if(e.keyCode == Event.KEY_RETURN) + { + mixPanel.validate(); + } + }; + + mixPanel.validate = function(){ + //validate net amt + if (inputs[5].disabled == true) + { + return; + } + + var total = getCartTotal(); + + var cashAmt = $('mix_cashAmt').value; + var chequeAmt = $('mix_chequeAmt').value; + var chequeNo = $('mix_chequeNo').value; + var cardAmt = $('mix_cardAmt').value; + var cardNo = $('mix_cardNo').value; + + if((cashAmt == null || cashAmt == '') && (chequeAmt == null || chequeAmt == '') && (cardAmt == null || cardAmt == '')) + { + showErrorMessage('Please enter an amount', 'mix_cashAmt'); + } + else if((chequeNo == null || chequeNo == '') && (chequeAmt.length > 0)) + { + showErrorMessage('Enter Cheque Number!', 'mix_chequeNo'); + } + else if(chequeNo.length > 0 && (chequeAmt == null || chequeAmt == '') && (chequeAmt != 0)) + { + showErrorMessage('Enter Cheque Amount!', 'mix_chequeAmt'); + } + else if(cardNo.length > 0 && (cardAmt == null || cardAmt == '')) + { + showErrorMessage('Enter Card Amount!', 'mix_cardAmt'); + } + else if((cardNo == null || cardNo == '') && (cardAmt.length > 0) && (cardAmt != 0)) + { + showErrorMessage('Enter Card Number!', 'mix_cardNo'); + } + else + { + var total1 = new Number(0); + var cashAmt = new Number($('mix_cashAmt').value); + var chequeAmt = new Number($('mix_chequeAmt').value); + var cardAmt = new Number($('mix_cardAmt').value); + + if (!isNaN(cashAmt)) + { + total1 = total1 + cashAmt; + } + if (!isNaN(cardAmt)) + { + total1 = total1 + cardAmt; + } + if (!isNaN(chequeAmt)) + { + total1 = total1 + chequeAmt; + } + + if(total1 < total) + { + showErrorMessage('Amount tendered is less than total amount!', 'mix_cashAmt'); + } + else + { + $FElement('tenderType').value = 'mixed'; + $FElement('chequeNo').value = chequeNo; + $FElement('chequeAmt').value = chequeAmt; + $FElement('cardNo').value = cardNo; + $FElement('cardAmt').value = cardAmt; + $FElement('cashAmt').value = cashAmt; + + hidePanel(this); + + checkout(); + } + + } + }; + + mixPanel.show = function(){ + hidePaymentPanels(); + popPanel(this); + $('mixTotal').innerHTML = $('total').innerHTML; + + $('mix_cashAmt').value = getCartTotal(); + $('mix_cashAmt').select(); + + }; + + mixPanel.reset = function(){ + $('mix_cashAmt').value = ''; + $('mix_chequeAmt').value = ''; + $('mix_chequeNo').value = ''; + $('mix_cardAmt').value = ''; + $('mix_cardNo').value = ''; + }; +}; + +var initCreditPanel = function(){ + var creditPanel = $('creditPanel'); + + creditPanel.show = function(){ + $('isCustomerCompulsory').value = 'true'; + isCustomerCompulsory = 'true'; + + if (!creditPanel.validate()) + { + creditPanel.reset(); + return; + } + checkout(); + }; + + creditPanel.reset = function(){ + if ($('orderType').value == ORDER_TYPES.POS_ORDER) + { + $('isCustomerCompulsory').value = 'false'; + } + }; + + creditPanel.validate = function(){ + return validateBp(); + }; + +}; + + +var initPaymentPanels = function(){ + paymentPanels = [$('cashPanel'), $('cardPanel'), $('chequePanel'), $('mixPanel'), $('creditPanel')]; + paymentPanels = $A(paymentPanels); + paymentPanels.each(initOkCancel); + + initCashPanel(); + initCardPanel(); + initChequePanel(); + initMixPanel(); + initCreditPanel(); +}; + +var initPaymentBtns = function(){ + + initPaymentPanels(); + + paymentbtns = new Array(); + paymentbtns.push($('cashBtn')); + paymentbtns.push($('cardBtn')); + paymentbtns.push($('chequeBtn')); + paymentbtns.push($('mixBtn')); + paymentbtns.push($('creditBtn')); + paymentbtns = $A(paymentbtns); + + for(var i=0; iPlease wait ....."; + div.style.border = 'solid 2px #333'; + div.style.width = '800px'; + div.style.height = '700px'; + div.style.position = 'absolute'; + div.style.zIndex = '1000'; + div.style.backgroundColor = '#FFF'; + div.style.visibility = 'hidden'; + document.body.appendChild(div); + this.popup = div; + popPanel(this.popup); + }, + + showPopup : function(productId){ + if(this.visible) return; + this.updateCart = (productId != 0); + this.createPopup(productId); + this.visible = true; + }, + + hidePopup : function(){ + hidePanel(this.popup); + if(this.updateCart) + { + updateQty(product_id, $('qty').value); + this.updateCart = false; + } + this.visible = false; + } +}; + + +function resetDetails() +{ + $('product.name').innerHTML = ""; + $('product.barcode').innerHTML = ""; + $('product.taxCategory').innerHTML = ""; + $('product.description').innerHTML = ""; + $('product.stock.qty').innerHTML = ""; + $('product.price.list').innerHTML = ""; + $('product.price.limit').innerHTML = ""; + $('product.price.std').innerHTML = ""; + $('priceLimit').innerHTML = ""; + $('qty').value = ""; + $('incPrice').value = ""; + $('disc').value = ""; + $('totalAmount').value = ""; + $('grandTotal').value = ""; + $('customer.code').innerHTML = ""; + $('customer.name').innerHTML = ""; + $('credit.available').innerHTML = ""; + $('credit.limit').innerHTML = ""; + $('open.balance').innerHTML = ""; + $('barcode').value = ""; + $('productQuery').value = ""; + $('description').value = ""; + + $('customerCode').hide(); + $('customerName').hide(); + $('creditAvailable').hide(); + $('creditLimit').hide(); + $('openBalance').hide(); + $('barcode').focus(); + closeDiscount(); + +} + +function quickDiscount() +{ + isQuickDiscount = true; + isDiscountFormOpen = true; + $('customerContainer').hide(); + $('paymentContainer').hide(); + $('editProductContainer').hide(); + $('quickDiscountDetails').show(); + $('quickDiscountDetails').show(); + $('checkoutContainer').hide(); + $('incPrice').activate(); +} + +function closeDiscount() +{ + isQuickDiscount = false; + isDiscountFormOpen = false; + $('customerContainer').show(); + $('paymentContainer').show(); + $('editProductContainer').show(); + $('quickDiscountDetails').hide(); + $('quickDiscountDetails').hide(); + $('checkoutContainer').show(); + $('barcode').focus(); +} + +function validateDiscount(newPrice, DISC_PERC) +{ + ERROR_MSG = null; + + if((ISDISCOUNTUPTOLIMITPRICE == true) && (OVERRIDE_PRICE_LIMIT == false)) + { + if(newPrice < LIMIT_PRICE) + { + ERROR_MSG = "DISCOUNT AMOUNT EXCEEDED!!!"; + } + if(newPrice > LIST_PRICE) + { + ERROR_MSG = "YOU CANNOT EXCEED THE LIST PRICE!!!" + } + } + + if((ISDISCOUNTUPTOLIMITPRICE == false) && (OVERRIDE_PRICE_LIMIT == true)) + { + if(DISCOUNT_LIMIT > 0) + { + if(DISC_PERC > DISCOUNT_LIMIT) + { + ERROR_MSG = "DISCOUNT LIMIT EXCEEDED!!!"; + } + } + + if(DISC_PERC < 0) + { + ERROR_MSG = "DISCOUNT CANNOT BE NEGATIVE!!!"; + } + + if(DISCOUNT_LIMIT == 0) + { + ERROR_MSG = "CANNOT APPLY DISCOUNT!!!
    NO DISCOUNT PERCENTAGE SET"; + } + } + + if((ISDISCOUNTUPTOLIMITPRICE == false) && (OVERRIDE_PRICE_LIMIT == false)) + { + if(DISCOUNT_LIMIT > 0) + { + if(DISC_PERC > DISCOUNT_LIMIT) + { + ERROR_MSG = "DISCOUNT LIMIT EXCEEDED!!!"; + } + + if(DISC_PERC < 0) + { + ERROR_MSG = "DISCOUNT CANNOT BE NEGATIVE!!!"; + } + + if(newPrice < LIMIT_PRICE) + { + ERROR_MSG = "CANNOT OVER RIDE LIMIT PRICE!!!"; + } + } + + if(DISCOUNT_LIMIT == 0) + { + ERROR_MSG = "CANNOT APPLY DISCOUNT!!!
    NO DISCOUNT PERCENTAGE SET"; + } + } + + if((ISDISCOUNTUPTOLIMITPRICE == true) && (OVERRIDE_PRICE_LIMIT == true)) + { + $('discountUptoLimitPrice').className = "error"; + $('overridePriceLimit').className = "error"; + ERROR_MSG = "DISCOUNT ERROR!! CANNOT PROCESS YOUR REQUEST!!!" + } + + if(ERROR_MSG == null) + { + $('applyDiscBtn').disabled = false; + } + else + { + $('applyDiscBtn').disabled = true; + } + + $('errorMsg').innerHTML = ERROR_MSG; +} + +function applyDiscount() +{ + var incPrice = $('incPrice').value; + var discPerc = $('disc').value; + var totalAmount = $('totalAmount').value; + + if(incPrice == null || incPrice == "") + { + showErrorMessage('Inc Price cannot be null!', 'incPrice'); + return ; + } + + if(discPerc == null || discPerc == "") + { + showErrorMessage('Discount % cannot be null!', 'disc'); + return ; + } + + if(totalAmount == null || totalAmount == "") + { + showErrorMessage('Total amount cannot be null!', 'totalAmount'); + return ; + } + + var form = $('QuickDiscountForm'); + form.request({ + onComplete: refreshQuickDiscount + }); + +} + +function refreshQuickDiscount(request) +{ + var response = request.responseText; + var result = eval('(' + response + ')'); + + if(result.error) + { + showErrorMessage(result.error, 'barcode'); + closeDiscount(); + } + + if(result.status == "OK") + { + reloadCart(); + closeDiscount(); + } +} + +function trim(stringToTrim) +{ + return stringToTrim.replace(/^\s+|\s+$/g,""); +} + + +function redirect(url) +{ + window.location = url; +} + +function popUp() +{ + var check = $('pop_overlay').style.display; + if(check == 'none' || check == '') + { + $('pop_overlay').style.display = 'block'; + $('pop_container').style.display = 'block'; + } + else + { + $('pop_overlay').style.display = 'none'; + $('pop_container').style.display = 'none'; + } + +} + +Event.observe(window,'load',initScreen,false); \ No newline at end of file diff --git a/posterita/posterita/web/js/paymentTerm.js b/posterita/posterita/web/js/paymentTerm.js new file mode 100644 index 0000000000..a2bb1426a7 --- /dev/null +++ b/posterita/posterita/web/js/paymentTerm.js @@ -0,0 +1,62 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +/** + @author praveen + */ + + +//scripts for payment term +var netDays = null; +var fixDate = null; +var fixDay = null; +var fixCutOff = null; +var fixOffset = null; + +function initPaymentScreen(){ + fixDate = $FElement('fixedDueDate'); + + netDays = $FElement('netDays'); + fixDay = $FElement('fixedMonthDay'); + fixCutOff = $FElement('fiedMonthCutoff'); + fixOffset = $FElement('fixedMonthOffset'); + + showHideDates(); + fixDate.onclick = showHideDates; + +} + +function showHideDates(){ + if(fixDate.checked){ + netDays.disabled = true; + fixDay.disabled = false; + fixCutOff.disabled = false; + fixOffset.disabled = false; + } + else{ + netDays.disabled = false; + fixDay.disabled = true; + fixCutOff.disabled = true; + fixOffset.disabled = true; + } +} + +//registering event +Event.observe(window,'load',initPaymentScreen,false); diff --git a/posterita/posterita/web/js/pin.js b/posterita/posterita/web/js/pin.js new file mode 100644 index 0000000000..659c28d8e6 --- /dev/null +++ b/posterita/posterita/web/js/pin.js @@ -0,0 +1,175 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +/** + @author praveen + */ + + +var PINPanel = $('PINPanel'); +var divBack = $('divBack'); +var PIN = $('PIN'); +var closeBtn = $('closeBtn'); + +function checkout() +{ + showPINPanel(); +} + +function focusBarcode() +{ + document.getElementsByName('barCode')[0].focus(); + //toConsole("Setting focus to barcode"); +} + +function initializeComponents() +{ + PINPanel.style.top = '' + (getViewportHeight()- 60)/2 ; + PINPanel.style.left = '' + (getViewportWidth() - 100)/2; + PINPanel.style.display = 'none'; + PINPanel.style.position = 'absolute'; + divBack.style.zIndex = '1000'; + + + //PIN.focus(); + + closeBtn.onblur = function(){ + try + { + PIN.focus(); + } + catch(e) + { + toConsole(e); + } + }; + + divBack.style.position = 'absolute'; + divBack.style.zIndex = '900'; + divBack.style.display = 'none'; + divBack.style.top = '0'; + divBack.style.left = '0'; + divBack.style.width = getViewportWidth(); + divBack.style.height = getViewportHeight(); + + PINPanel.onblur = function(){ + //PIN.focus(); + }; + + PIN.onkeyup = function(e) + { + try + { + var event = e||window.event; + + if(event.keyCode == 13) + { + validatePIN(); + } + } + catch (e) + { + toConsole(e); + } + }; + + toConsole('PIN Panel initialised'); +} + +function enablePIN() +{ + PIN.disabled = false; + closeBtn.style.visibility = 'visible'; +} + +function disablePIN() +{ + PIN.disabled = true; + closeBtn.style.visibility = 'hidden'; +} + +function reportError(request) +{ + alert('Some error occured while communicating with the server. Please try again.') +} + +function PINError(msg) +{ + alert(msg); + hidePINPanel(); + enablePIN(); + PIN.value=''; +} + +function showPINPanel() +{ + PINPanel.style.display = 'block'; + divBack.style.display = 'block'; + PIN.focus(); +} + +function hidePINPanel() +{ + PINPanel.style.display = 'none'; + divBack.style.display = 'none'; +} + +/* +function validatePIN() +{ + var pin = PIN.value; + var url = 'GetPOSPaymentDetailsAction.do'; + var pars = 'action=validateAdvanceOrderPIN&userPIN=' + pin; + + var myAjax = new Ajax.Request( url, + { + method: 'get', + parameters: pars, + onSuccess: evaluateResponse, + onFailure: reportError + }); + + disablePIN(); +} +*/ + +function evaluateResponse(request) +{ + var scripts = request.responseText; + eval(scripts); +} + + +function getViewportHeight() { + if (window.innerHeight!=window.undefined) return window.innerHeight; + if (document.compatMode=='CSS1Compat') return document.documentElement.clientHeight; + if (document.body) return document.body.clientHeight; + return window.undefined; +} + +function getViewportWidth() { + if (window.innerWidth!=window.undefined) return window.innerWidth; + if (document.compatMode=='CSS1Compat') return document.documentElement.clientWidth; + if (document.body) return document.body.clientWidth; + return window.undefined; +} + +//initialising +Event.observe(window,'load',initializeComponents,false); \ No newline at end of file diff --git a/posterita/posterita/web/js/pos.js b/posterita/posterita/web/js/pos.js new file mode 100644 index 0000000000..e4b645f5a3 --- /dev/null +++ b/posterita/posterita/web/js/pos.js @@ -0,0 +1,644 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +/** + @author praveen + */ + + +var MAXIMUM_WAITING_TIME = 10000; +//var TROTTLE_PERIOD = 1000; +var TROTTLE_TIME = 0.5; +var ENABLE_LOGGING = true; +var ENABLE_VIRTUAL_KEYBOARD = true; + + +//The maps stores key-action mappings +var keyMap = new Array(); + +function addKey(key,action) +{ + keyMap[key] = action; +} + +function getAction(key) +{ + if(keyMap[key]) + { + eval(keyMap[key]); + + return false; + } + + return true; +} + +//capture shortcut keys +function captureKey(e) +{ + var evtobj=window.event? event : e; //distinguish between IE's explicit event object (window.event) and Firefox's implicit. + var unicode=evtobj.charCode? evtobj.charCode : evtobj.keyCode; + + var msg = ""; + + if(evtobj['ctrlKey']) + msg = msg + "CTRL-"; + + if(evtobj['altKey']) + msg = msg + "ALT-"; + + if(evtobj['shiftKey']) + msg = msg + "SHIFT "; + + + var key = unicode; + + key = String.fromCharCode(unicode); + msg = msg + key; + msg = msg.toUpperCase(); + + //perform the action associated with that key + return getAction(msg); + +} + +function hideResult() +{ + displayResult(""); +} + +function printDocument() +{ + var w = window.open("","POS Order","width=800"); + var d = w.document; + + var printDiv = document.getElementById("printDiv"); + + d.write(""); + d.write(" "); + d.write(""); + d.write(printDiv.innerHTML); + d.write(""); + d.close(); +} + +function enableDelete() +{ + var btn = document.getElementsByName("deleteBtn"); + + btn[0].disabled = enableButton(); +} + +function enableButton() +{ + /* + var chk = document.getElementsByName("posOrderLineIds"); + for(i=0;i "+msg); + + //console.appendChild(text); + //document.body.appendChild(console); + } + catch(e) + { + alert(e); + } + +} + +function $focus(element) +{ + var el = document.getElementsByName(element); + + if(el) + { + el[0].focus(); + toConsole('Setting focus to :' + element); + } + else + { + toConsole('Unable to set focus to :' + element); + } + +} + +function $FElement(element) +{ + var el = document.getElementsByName(element)[0]; + return el; + +} + +function focusBarcode() +{ + $FElement('barCode').focus(); + toConsole("Setting focus to barcode"); +} + +function openCashDrawer() +{ + var url = 'CompletePOSOrderAction.do'; + var param = 'action=openCashDrawer'; + + var success = function(request){alert('Opening drawer!');}; + var failure = function(request){alert('Oop some problem occured while communicating with server!');}; + + var myAjax = new Ajax.Request( url, + { + method: 'get', + parameters: param, + onSuccess: success, + onFailure: failure + }); +} + +function fullScreen(theURL) +{ + window.open(theURL, '', 'fullscreen=yes, scrollbars=auto'); +} + +function disableButtons() +{ + try + { + var elements = document.getElementsByTagName('input'); + + for(var i = 0; i < elements.length; i++) + { + if(elements[i].name != 'action') + { + elements[i].disabled = true; + elements[i].style.cursor = 'wait'; + } + } + + toConsole('Disable ' + elements.length + ' buttons'); + + return true; + + } + catch(e) + { + toConsole(e); + } +} + + +function initDisableButtons() +{ + toConsole('initDisableButtons'); + + var elements = document.getElementsByTagName('input'); + + for(var i = 0; i < elements.length; i++) + { + var type = elements[i].type; + + if(type == 'button') + { + var button = elements[i]; + var accessKey = button.accessKey; + + if(accessKey == 'c') + { + //button.onclick = disableButtons; + var action = button.onclick; + button.onclick = function(e){ + + }; + + toConsole('Found 1 button with accesskey: C'); + } + } + } +} + +function setNumericInputMask(e) +{ + var evtobj = window.event? event : e; //distinguish between IE's explicit event object (window.event) and Firefox's implicit. + var unicode = evtobj.charCode? evtobj.charCode : evtobj.keyCode; + + var validKeys = [8,9,13,20,27,37,38,39,40,45,46,48,49,50,51,52,53,54,55,56,57]; + + for(var i = 0; i < validKeys.length; i++) + { + if(validKeys[i] == unicode) + { + return true; + } + } + + alert('Accepts numeric values only'); + return false; + +} + +function showDocumentPDF(id) +{ + window.open('ViewDocumentPDFAction.do?action=viewOrderDocumentPDF&documentId=' + id, '_blank', 'width=800, height=600, status=no, toolbar=no, location=no, resizable=yes'); +} + +function showInventoryPDF(id) +{ + window.open('ViewInventoryPDFAction.do?action=viewInventoryDocumentPDF&inventoryId=' + id, '_blank', 'width=800, height=600, status=no, toolbar=no, location=no, resizable=yes'); +} + +function showInvoiceDocumentPDF(id) +{ + window.open('ViewDocumentPDFAction.do?action=viewInvoiceDocumentPDF&documentId=' + id, '_blank', 'width=800, height=600, status=no, toolbar=no, location=no, resizable=yes'); +} + +function showShipmentDocumentPDF(id) +{ + window.open('ViewDocumentPDFAction.do?action=viewShipmentDocumentPDF&documentId=' + id, '_blank', 'width=800, height=600, status=no, toolbar=no, location=no, resizable=yes'); +} + +function showPaymentDocumentPDF(id) +{ + window.open('ViewDocumentPDFAction.do?action=viewPaymentDocumentPDF&documentId=' + id, '_blank', 'width=800, height=600, status=no, toolbar=no, location=no, resizable=yes'); +} + + + +function enableVirtualKeyboard() +{ + if(!ENABLE_VIRTUAL_KEYBOARD) + { + return; + } + + var textfields = document.getElementsByTagName('input'); + + for(var i=0; i= 0) + { + cashInput.value = newValue; + cardInput.previousAmount = newValue; + + } + else + { + var max = cashInput.initialAmount - chequeInput.value; + alert('Card Amount should not exceed ' + max); + + cardInput.value = 0.0; + + newValue = new Number(cashInput.initialAmount - cardInput.value - chequeInput.value).toFixed(2); + cashInput.value = newValue; + } + } + catch(e) + { + toConsole(e); + } + + } + + chequeInput.onkeyup = function() + { + try + { + var newValue = new Number(cashInput.initialAmount - cardInput.value - chequeInput.value).toFixed(2); + + if(newValue >= 0) + { + cashInput.value = newValue; + chequeInput.previousAmount = newValue; + + } + else + { + var max = cashInput.initialAmount - cardInput.value; + alert('Cheque Amount should not exceed ' + max); + + chequeInput.value = 0.0; + + newValue = new Number(cashInput.initialAmount - cardInput.value - chequeInput.value).toFixed(2); + cashInput.value = newValue; + } + } + catch(e) + { + toConsole(e); + } + } + + return false; +} + +function showCheque() +{ + show("chequeNoLabel");show("chequeNoTxt"); + + hide("cashLabel");hide("cashTxt"); + hide("cardLabel");hide("cardTxt"); + hide("cardNoLabel");hide("cardNoTxt"); + hide("chequeLabel");hide("chequeTxt"); + + setTrxType("Cheque"); + + var chequeTf = document.getElementsByName('chequeNo')[0]; + + chequeTf.focus(); + + return false; +} + +function showCard() +{ + show("cardNoLabel");show("cardNoTxt"); + + hide("cashLabel");hide("cashTxt"); + hide("cardLabel");hide("cardTxt"); + hide("chequeLabel");hide("chequeTxt"); + hide("chequeNoLabel");hide("chequeNoTxt"); + + setTrxType("Card"); + + var cardTf = document.getElementsByName('creditCardNumber')[0]; + + cardTf.focus(); + + return false; +} + +function showCash() +{ + hide('cashLabel');hide('cashTxt'); + hide('cardLabel');hide('cardTxt'); + hide('cardNoLabel');hide('cardNoTxt'); + hide('chequeLabel');hide('chequeTxt'); + hide('chequeNoLabel');hide('chequeNoTxt'); + + setTrxType("Cash"); + + return false; +} + +function setTrxType(type) +{ + document.forms[0].trxType.value = type; +} + + + +//adding behaviour to discount&actual price textfields +var price = document.getElementsByName('price'); +var discount = document.getElementsByName('discountPercent'); +var actualPrice = document.getElementsByName('actualPrice'); + +/* +var totalDiscount = $('totalDiscount'); +var totalPrice = $('totalPrice'); + +totalPrice.initialAmount = 0; +for(var i=0;i discountAllowed) + { + var errormsg = 'You are authorised to give ' + discountAllowed + '% discount only!'; + + this.className = 'text medium error'; + this.title = errormsg; + + totalDiscount.className = 'text medium error'; + totalDiscount.title = errormsg; + + //alert(errormsg); + } + else + { + var className = 'text medium'; + + + this.className = className; + this.title = ''; + + totalDiscount.className = className; + totalDiscount.title = ''; + } +}; + +totalDiscount.onkeyup = function() +{ + var newprice = ((100-this.value)*totalPrice.initialAmount)/100; + newprice = new Number(newprice).toFixed(2); //rounding calculate price + totalPrice.value = newprice; + + if(this.value > discountAllowed) + { + var errormsg = 'You are authorised to give ' + discountAllowed + '% discount only!'; + + this.className = 'text medium error'; + this.title = errormsg; + + totalPrice.className = 'text medium error'; + totalPrice.title = errormsg; + + //alert(errormsg); + } + else + { + var className = 'text medium'; + + this.className = className; + this.title = ''; + + totalPrice.className = className; + totalPrice.title = ''; + } +}; +*/ + +for(var i=0;i discountAllowed) + { + var errormsg = 'You are authorised to give ' + discountAllowed + '% discount only!'; + + this.className = 'text medium error'; + this.title = errormsg; + + actualPrice[index].className = 'text medium error'; + actualPrice[index].title = errormsg; + + //alert(errormsg); + } + else if(this.value < 0) + { + var errormsg = 'Discount cannot be negative!'; + + this.className = 'text medium error'; + this.title = errormsg; + + actualPrice[index].className = 'text medium error'; + actualPrice[index].title = errormsg; + + //alert(errormsg); + } + else + { + var className = 'text medium'; + + this.className = className; + this.title = ''; + + actualPrice[index].className = className; + actualPrice[index].title = ''; + } + + } + + element = actualPrice[i]; + element.position = i; //adding attribute position + + element.onkeypress = setNumericInputMask; + element.onkeyup = function(e) + { + var index = this.position; + + var calculateDiscount = 100-((this.value*100)/price[index].value); + calculateDiscount = new Number(calculateDiscount).toFixed(2); //rounding calculate discount + + discount[index].value = calculateDiscount; + updateTotal(); + + if(calculateDiscount > discountAllowed) + { + var errormsg = 'You are authorised to give ' + discountAllowed + '% discount only!'; + + this.className = 'text medium error'; + this.title = errormsg; + + discount[index].className = 'text medium error'; + discount[index].title = errormsg; + + //alert(errormsg); + } + else if(calculateDiscount < 0) + { + var errormsg = 'Discount cannot be negative!'; + + this.className = 'text medium error'; + this.title = errormsg; + + discount[index].className = 'text medium error'; + discount[index].title = errormsg; + + //alert(errormsg); + } + else + { + var className = 'text medium'; + + + this.className = className; + this.title = ''; + + discount[index].className = className; + discount[index].title = ''; + } + } + +} + +function updateTotal() +{ + init(); + + var cardInput = document.getElementsByName('paymentByCard')[0].value=""; + var chequeInput = document.getElementsByName('paymentByChq')[0].value=""; +} + +function init() +{ + var total = 0; + + for(var i=0;i discountAllowed) + { + actualPrice[i].className = 'error medium'; + actualPrice[i].title = errormsg; + + discount[i].className = 'error medium'; + discount[i].title = errormsg; + } + else if(discount[i].value < 0) + { + actualPrice[i].className = 'error medium'; + actualPrice[i].title = errormsg2; + + discount[i].className = 'error medium'; + discount[i].title = errormsg2; + } + else + { + actualPrice[i].className = 'text medium'; + actualPrice[i].title = ""; + + discount[i].className = 'text medium'; + discount[i].title = ""; + } + } + + if(discountTotal.value > discountAllowed) + { + grandTotal.className = 'error medium'; + grandTotal.title = errormsg; + + discountTotal.className = 'error medium'; + discountTotal.title = errormsg; + } + else if(discountTotal.value < 0) + { + grandTotal.className = 'error medium'; + grandTotal.title = errormsg2; + + discountTotal.className = 'error medium'; + discountTotal.title = errormsg2; + } + else + { + grandTotal.className = 'text medium'; + grandTotal.title = ""; + + discountTotal.className = 'text medium'; + discountTotal.title = ""; + } + + +} + + +var discountTotal = null; +var grandTotal = null; +var priceTotal = null; + +var discountAllowed = ; +var errorCount = 0; + + + + + diff --git a/posterita/posterita/web/js/product.js b/posterita/posterita/web/js/product.js new file mode 100644 index 0000000000..f12752d2de --- /dev/null +++ b/posterita/posterita/web/js/product.js @@ -0,0 +1,316 @@ +//autocomplete for revenue recognition +copyValueInto('revenueRecognition','revenue_recognition'); +new Ajax.Autocompleter('revenue_recognition','revenue_recognitionDiv','SearchPOSGarmentAttributes.do',{ + paramName:'revenue_recognition', + frequency:TROTTLE_TIME, + afterUpdateElement:function(e1,e2){ + $('revenue_recognition').value = e1.value; + } + }); + + +function $FF(elementName) +{ + return document.getElementsByName(elementName)[0]; +} + +function copyValueInto(e1,e2) +{ + toConsole("Copying " + e1 + " into " + e2); + + try + { + $FF(e2).value = $FF(e1).value; + } + catch(e) + { + toConsole("Copying failed!"); + toConsole(e); + } + + +} + +function setValues(form) +{ + try + { + toConsole('Going to submit form'); + copyValueInto('revenue_recognition','revenueRecognition'); + + form.submit(); + } + catch(e) + { + toConsole("Submit failed!"); + toConsole(e); + + toConsole(form); + } +} + +//------------------------------------------------------ +// Validation of barcode & product name using AJAX +//------------------------------------------------------ +function validateBarcode() +{ + if($FF('barCode').initialValue == $FF('barCode').value) return; + + var barcode = $FF('barCode').value; + + var url = 'ValidatePOSProductAction.do'; + var pars = 'action=validateProductBarcode&barCode=' + barcode; + + var myAjax = new Ajax.Request( url, + { + method: 'get', + parameters: pars, + onSuccess: doesBarcodeExists, + onFailure: reportError + }); +} + +function validateProductName() +{ + if($FF('productName').initialValue == $FF('productName').value) return; + + var productName = $FF('productName').value; + var url = 'ValidatePOSProductAction.do'; + var pars = 'action=validateProductName&productName=' + productName; + + var myAjax = new Ajax.Request( url, + { + method: 'get', + parameters: pars, + onSuccess: doesProductExists, + onFailure: reportError + }); +} + +function doesBarcodeExists(request) +{ + try + { + var response = request.responseText; + + if(response == 'true') + { + Element.show('barcodeError'); + $FF('barCode').className = 'error'; + } + else + { + Element.hide('barcodeError'); + $FF('barCode').className = 'text'; + } + + } + catch(e) + { + toConsole(e); + } +} + +function doesProductExists(request) +{ + try + { + var response = request.responseText; + + if(response == 'true') + { + Element.show('productError'); + $FF('productName').className = 'error'; + } + else + { + Element.hide('productError'); + $FF('productName').className = 'text'; + } + + } + catch(e) + { + toConsole(e); + } +} + +function reportError(request) +{ + alert('Some error occured while communicating with the server. Please try again.'); +} + +//------------------------------------------------------ +var barcode = $FF('barCode'); +var productName = $FF('productName'); +var taxCategory = $FF('taxCategoryId'); + +var purchasePriceStandard = $FF('purchasePriceStandard'); +var salesPriceStandard = $FF('salesPriceStandard'); +var salesPriceList = $FF('salesPriceList'); +var salesPriceLimit = $FF('salesPriceLimit'); + +var purchasePriceStandardTax = $FF('purchasePriceStandardTax'); +var salesPriceStandardTax = $FF('salesPriceStandardTax'); +var salesPriceListTax = $FF('salesPriceListTax'); +var salesPriceLimitTax = $FF('salesPriceLimitTax'); + +/** + * Calculates price including tax + * @param price without tax + * @return price with tax + */ +function getPriceIncludingTax(price) +{ + var tax = getTax(); + var priceWithoutTax = price || 0; + var priceWithTax = ((100+tax)/100)*priceWithoutTax; + + priceWithTax = new Number(priceWithTax).toFixed(2); + + return priceWithTax; + +}//getPriceIncludingTax(price) + +/** + * Calculates price excluding tax + * @param price with tax + * @return price without tax + */ +function getPriceExcludingTax(price) +{ + var tax = getTax(); + var priceWithTax = price || 0; + var priceWithoutTax = (100*priceWithTax)/(100+tax); + + priceWithoutTax = new Number(priceWithoutTax).toFixed(2); + + return priceWithoutTax; + +}//getPriceExcludingTax(price) + +/** + * Gets the current tax + */ +function getTax() +{ + var select = taxCategory; + var index = select.selectedIndex; + + if(index == -1) index = 0; + + var option = select.options[select.selectedIndex]; + var v = option.label || option.text; + + var s = v.split('%'); + + if(s.length < 2) return 0; + + var tax = parseFloat(s[1]); + + return tax; + +}//getTax() + +/* +function setPriceIncludingTax() +{ + purchasePriceStandardTax.value = getPriceIncludingTax(purchasePriceStandard.value); + salesPriceLimitTax.value = getPriceIncludingTax(salesPriceLimit.value); + salesPriceListTax.value = getPriceIncludingTax(salesPriceList.value); + salesPriceStandardTax.value = getPriceIncludingTax(salesPriceStandard.value); + +}//setPriceIncludingTax() + +//-------------------------------------------------------------------------- +// Initialising components & adding behaviour +//-------------------------------------------------------------------------- + +//update all prices +taxCategory.onchange = setPriceIncludingTax; + + +purchasePriceStandard.onkeyup = function(e){ + purchasePriceStandardTax.value = getPriceIncludingTax(this.value); +}; +purchasePriceStandardTax.onkeyup = function(e){ + purchasePriceStandard.value = getPriceExcludingTax(this.value); +}; + +salesPriceLimit.onkeyup = function(e){ + salesPriceLimitTax.value = getPriceIncludingTax(this.value); +}; +salesPriceLimitTax.onkeyup = function(e){ + salesPriceLimit.value = getPriceExcludingTax(this.value); +}; + +salesPriceStandard.onkeyup = function(e){ + salesPriceStandardTax.value = getPriceIncludingTax(this.value); +}; +salesPriceStandardTax.onkeyup = function(e){ + salesPriceStandard.value = getPriceExcludingTax(this.value); +}; + +salesPriceList.onkeyup = function(e){ + salesPriceListTax.value = getPriceIncludingTax(this.value); + + //overwrite the other prices + salesPriceLimit.value = this.value; + salesPriceStandard.value = this.value; + salesPriceLimitTax.value = getPriceIncludingTax(this.value); + salesPriceStandardTax.value = getPriceIncludingTax(this.value); +}; + +salesPriceListTax.onkeyup = function(e){ + salesPriceList.value = getPriceExcludingTax(this.value) ; +}; + +barcode.onblur = validateBarcode; +barcode.initialValue = barcode.value; +barcode.onkeyup = function(e) +{ + try + { + if(this.initialValue == this.value) return; + + var event = e || window.event; + + if(event.keyCode == 13) + { + toConsole('validating barcode'); + validateBarcode(); + } + } + catch (e) + { + toConsole(e); + } +}; + +productName.onblur = validateProductName; +productName.initialValue = productName.value; +productName.onkeyup = function(e) +{ + try + { + if(this.initialValue == this.value) return; + + var event = e || window.event; + + if(event.keyCode == 13) + { + toConsole('validating product name'); + validateProductName(); + } + } + catch (e) + { + toConsole(e); + } +}; + +$('barcodeError').style.display = 'none'; +$('productError').style.display = 'none'; + +setPriceIncludingTax(); +*/ \ No newline at end of file diff --git a/posterita/posterita/web/js/product2.js b/posterita/posterita/web/js/product2.js new file mode 100644 index 0000000000..5eeff0b148 --- /dev/null +++ b/posterita/posterita/web/js/product2.js @@ -0,0 +1,147 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +/** + @author praveen + */ + + +//------------------------------------------------------ +var taxCategory = $FF('taxCategoryId'); + +var purchasePriceStandard = $FF('purchasePriceStandard'); +var salesPriceStandard = $FF('salesPriceStandard'); +var salesPriceList = $FF('salesPriceList'); +var salesPriceLimit = $FF('salesPriceLimit'); + +var purchasePriceStandardTax = $FF('purchasePriceStandardTax'); +var salesPriceStandardTax = $FF('salesPriceStandardTax'); +var salesPriceListTax = $FF('salesPriceListTax'); +var salesPriceLimitTax = $FF('salesPriceLimitTax'); + +/** + * Calculates price including tax + * @param price without tax + * @return price with tax + */ +function getPriceIncludingTax(price) +{ + var tax = getTax(); + var priceWithoutTax = price || 0; + var priceWithTax = ((100+tax)/100)*priceWithoutTax; + + priceWithTax = new Number(priceWithTax).toFixed(2); + + return priceWithTax; + +}//getPriceIncludingTax(price) + +/** + * Calculates price excluding tax + * @param price with tax + * @return price without tax + */ +function getPriceExcludingTax(price) +{ + var tax = getTax(); + var priceWithTax = price || 0; + var priceWithoutTax = (100*priceWithTax)/(100+tax); + + priceWithoutTax = new Number(priceWithoutTax).toFixed(2); + + return priceWithoutTax; + +}//getPriceExcludingTax(price) + +/** + * Gets the current tax + */ +function getTax() +{ + var select = taxCategory; + var index = select.selectedIndex; + + if(index == -1) index = 0; + + var option = select.options[select.selectedIndex]; + var v = option.label || option.text; + + var s = v.split('%'); + + if(s.length < 2) return 0; + + var tax = parseFloat(s[1]); + + return tax; + +}//getTax() + +function setPriceIncludingTax() +{ + purchasePriceStandardTax.value = getPriceIncludingTax(purchasePriceStandard.value); + salesPriceLimitTax.value = getPriceIncludingTax(salesPriceLimit.value); + salesPriceListTax.value = getPriceIncludingTax(salesPriceList.value); + salesPriceStandardTax.value = getPriceIncludingTax(salesPriceStandard.value); + +}//setPriceIncludingTax() + +//-------------------------------------------------------------------------- +// Initialising components & adding behaviour +//-------------------------------------------------------------------------- + +//update all prices +taxCategory.onchange = setPriceIncludingTax; + +purchasePriceStandard.onkeyup = function(e){ + purchasePriceStandardTax.value = getPriceIncludingTax(this.value); +}; +purchasePriceStandardTax.onkeyup = function(e){ + purchasePriceStandard.value = getPriceExcludingTax(this.value); +}; + +salesPriceLimit.onkeyup = function(e){ + salesPriceLimitTax.value = getPriceIncludingTax(this.value); +}; +salesPriceLimitTax.onkeyup = function(e){ + salesPriceLimit.value = getPriceExcludingTax(this.value); +}; + +salesPriceStandard.onkeyup = function(e){ + salesPriceStandardTax.value = getPriceIncludingTax(this.value); +}; +salesPriceStandardTax.onkeyup = function(e){ + salesPriceStandard.value = getPriceExcludingTax(this.value); +}; + +salesPriceList.onkeyup = function(e){ + salesPriceListTax.value = getPriceIncludingTax(this.value); + + //overwrite the other prices + salesPriceLimit.value = this.value; + salesPriceStandard.value = this.value; + salesPriceLimitTax.value = getPriceIncludingTax(this.value); + salesPriceStandardTax.value = getPriceIncludingTax(this.value); +}; + +salesPriceListTax.onkeyup = function(e){ + salesPriceList.value = getPriceExcludingTax(this.value) ; +}; + +setPriceIncludingTax(); \ No newline at end of file diff --git a/posterita/posterita/web/js/productTax.js b/posterita/posterita/web/js/productTax.js new file mode 100644 index 0000000000..7f1c4a90a3 --- /dev/null +++ b/posterita/posterita/web/js/productTax.js @@ -0,0 +1,131 @@ +// script for calculating excl and incl prices for Posterita products + +var taxRateFactor = 1.0; + +var updateTax = function(e) +{ + var taxCategoryId = document.forms[0].taxCategoryId.value; + var url = "TaxAction.do"; + var pars = "action=getTaxRate&taxCategoryId="+ taxCategoryId; + + var myAjax = new Ajax.Request( url, + { + method: 'get', + parameters: pars, + onSuccess: setTaxRate, + onFailure: reportError + }); +}; + +var setTaxRate = function(request) +{ + try + { + var response = request.responseText; + var taxRate = parseFloat(response); + taxRateFactor = new Number((taxRate/100)+1).toFixed(2); + loadPriceListBehaviour(); + } + catch(e) + {} +}; + +function reportError(request) +{ + alert("Some error has occured while communicating with the server"); +} + +var loadPriceListBehaviour = function(){ + + var rows = new Array(); + var count = 1; + + while(true) + { + var row = $('row' + count); + if(row == null) break; + + rows.push(row); + count ++; + } + + for(var i=0; i 2 && inputs.length <= 6) + { + listPrice = inputs[2]; + listPriceIncl = inputs[3]; + limitPrice = inputs[4]; + limitPriceIncl = inputs[5]; + + listPrice.tr = tr; + listPriceIncl.tr = tr; + limitPrice.tr = tr; + limitPriceIncl.tr = tr; + + tr.listPrice = listPrice; + tr.listPriceIncl = listPriceIncl; + tr.limitPrice = limitPrice; + tr.limitPriceIncl = limitPriceIncl; + + tr.listPriceIncl.value = calculatePrice(listPrice.value, false); + tr.limitPriceIncl.value = calculatePrice(limitPrice.value, false); + + listPrice.onkeyup = function(){ + this.tr.listPriceIncl.value = calculatePrice(this.value, false); + }; + + listPriceIncl.onkeyup = function(){ + this.tr.listPrice.value = calculatePrice(this.value, true); + }; + + limitPrice.onkeyup = function(){ + this.tr.limitPriceIncl.value = calculatePrice(this.value, false); + }; + + limitPriceIncl.onkeyup = function(){ + this.tr.limitPrice.value = calculatePrice(this.value, true); + }; + } + } +}; + +var calculatePrice = function(value, isTaxIncluded) +{ + if (isTaxIncluded) + { + return new Number(value / taxRateFactor).toFixed(2); + } + else + { + return new Number(value * taxRateFactor).toFixed(2); + } +}; + +Event.observe(window, 'load', updateTax, false); \ No newline at end of file diff --git a/posterita/posterita/web/js/shoppingCart.js b/posterita/posterita/web/js/shoppingCart.js new file mode 100644 index 0000000000..c0bdac0b9f --- /dev/null +++ b/posterita/posterita/web/js/shoppingCart.js @@ -0,0 +1,505 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +/** + @author praveen + */ + +//----------------------------------FUNCTION DECLARATIONS--------------------------------------------- +//scrolls to the bottom of the cart +function scrollDownCart() +{ + if($('shoppingCart')) + { + $('shoppingCart').scrollTop = $('shoppingCart').scrollHeight; + } +} + + +//adding product to cart +function addToCart(barcode) +{ + cartIndex = null; + done = false; + if(barcode == null) return; + if(barcode == '') return; + + try + { + + var url = 'AddToPOSShoppingCartAction.do'; + var pars = 'action=addProduct&barCode='+barcode+ '&orderType=' + orderType + '&priceListId='+priceList; + + var myAjax = new Ajax.Request( url, + { + method: 'get', + parameters: pars, + onSuccess: refreshShoppingCart, + onFailure: reportShoppingCartError + }); + + + } + catch(e) + { + toConsole(e); + } +} + +//incrementing, decrementing and deleting the shopping cart items using ajax +// 1.Increment the qty for the product +function incrementCart(productId) +{ + if(productId == null) return; + + try + { + + var url = 'AddToPOSShoppingCartAction.do'; + var pars = 'action=incrementQty&productId='+productId+ '&ifAdd=true'+ '&orderType=' + orderType + '&priceListId='+priceList; + + var myAjax = new Ajax.Request( url, + { + method: 'get', + parameters: pars, + onSuccess: refreshShoppingCart, + onFailure: reportShoppingCartError + }); + + } + catch(e) + { + toConsole(e); + } + +} + +//2.Decrement the qty for the product +function decrementCart(productId) +{ + if(productId == null) return; + + try + { + + + var url = 'AddToPOSShoppingCartAction.do'; + var pars = 'action=decrementQty&productId='+productId+ '&ifAdd=false'+ '&orderType=' + orderType + '&priceListId='+priceList; + + var myAjax = new Ajax.Request( url, + { + method: 'get', + parameters: pars, + onSuccess: refreshShoppingCart, + onFailure: reportShoppingCartError + }); + + } + catch(e) + { + toConsole(e); + } +} + +//3.Delete all the products with the ID from the cart +function deleteItemFromCart(productId) +{ + if(productId == null) return; + + cartIndex = null; + updateQty(productId, '0'); +} + +//Refreshs the content of the shopping cart +function refreshShoppingCart(request) +{ + try + { + //var top = $('items').scrollTop; + var response = request.responseText; + $('shoppingCart').innerHTML = response; + $('total').innerHTML = $('cartTotal').innerHTML; + closeDiscount(); + scrollDownCart(); + response.evalScripts(); //display error messages + } + catch(e) + { + showErrorMessage('Failed to resfresh cart! Cause:' + e); + } + + addBehaviourToCart(); +} + +//Reports an error +function reportShoppingCartError(request) +{ + alert('Some error occured while communicating with the server. Please try again.'); + alert(request.responseText); + var win = window.open(); + win.document.write(request.responseText); + win.document.close(); +} + +//addRequiredLibrary('js/test.js'); +var requestIndicator; + +/* +var ShoppingCart = { + + init : function(){ + //this.indicator = new AJAXIndicator('Please wait...'); + alert('Shopping Cart'); + }, + + indicator : null +}; +*/ + +function checkout() +{ + //do normal submit + $('checkoutForm').submit(); +/* + var pars = Form.serialize('checkoutForm'); + var url = 'CheckoutAction.do'; + + try + { + var myAjax = new Ajax.Request( url, + { + method: 'get', + parameters: pars, + onSuccess: handleCheckout, + onFailure: reportShoppingCartError + }); + } + catch(e) + { + toConsole(e); + } +*/ +} + +//Update the qty for the product +function updateQty(productId, quantity) +{ + if(productId == null) return; + + if (quantity == "") + { + return; + } + + if(quantity < 0) + { + showErrorMessage('Quantity cannot be negative!', 'qty'); + $('qty').value = ""; + return; + } + + var amount = parseFloat(quantity); + + if (isNaN(amount)) + { + showErrorMessage('Invalid quantity! ' + quantity, 'qty'); + $('qty').value = ""; + return; + } + + try + { + var url = 'AddToPOSShoppingCartAction.do'; + var pars = 'action=updateQty&productId=' + productId + '&ifAdd=false'+ '&orderType=' + orderType + '&priceListId='+priceList +'&quantity=' + quantity; + + var myAjax = new Ajax.Request( url, + { + method: 'get', + parameters: pars, + onSuccess: refreshShoppingCart, + onFailure: reportShoppingCartError + }); + + } + catch(e) + { + toConsole(e); + } + +} + +//Reload shopping cart +function reloadCart() +{ + try + { + var url = 'AddToPOSShoppingCartAction.do'; + var pars = 'action=reloadCart&orderType=posOrder'; + + var myAjax = new Ajax.Request( url, + { + method: 'get', + parameters: pars, + onSuccess: refreshShoppingCart, + onFailure: reportShoppingCartError + }); + + } + catch(e) + { + toConsole(e); + } + +} + + +function clearCart() +{ + maxRows = 0; + excessRows = 0; + resetDetails(); + + try + { + var url = 'CheckoutAction.do'; + var pars = 'action=clearCart' + '&orderType=' + orderType; + + var myAjax = new Ajax.Request( url, + { + method: 'get', + parameters: pars, + onSuccess: refreshShoppingCart, + onFailure: reportShoppingCartError + }); + } + catch(e) + { + toConsole(e); + } + +} + +function handleCheckout(request) +{ + var response = request.responseText; + var result = eval('(' + response + ')'); + + if(result.error) + { + showErrorMessage(result.error); + } + else + { + printOrder(result.orderID); + reloadCart(); + } +} + + +function addBehaviourToCart() +{ + var rows = new Array(); + var count = 1; + var grandTotal = 0; + var totalPriceLimit = 0; + var totalPriceList = 0; + + while(true) + { + var row = $('row' + count); + if(row == null) break; + + rows.push(row); + count ++; + } + + for(var i=0; i 0) + { + var line = cartLines[cartIndex]; + simulateOnClick(line); + + } + + if(cartLines.length > maxRows) + { + var shoppingCart = $('shoppingCart'); + shoppingCart.scrollTop = shoppingCart.scrollHeight; + } + +} + +//Reload the shopping cart. Prices are calculated for the pricelist +function setShoppingCartPriceList() +{ + try + { + var url = 'AddToPOSShoppingCartAction.do'; + var pars = 'action=updatePriceList&priceListId='+priceList; + + var myAjax = new Ajax.Request( url, + { + method: 'get', + parameters: pars, + onSuccess: refreshShoppingCart, + onFailure: reportShoppingCartError + }); + + } + catch(e) + { + toConsole(e); + } +} + +function scrollCart() +{ + var shoppingCart = $('shoppingCart'); + + if(cartIndex > maxRows) + { + shoppingCart.scrollTop = shoppingCart.scrollHeight; + } + else + { + shoppingCart.scrollTop = 0; + } +} + + +//Event.observe(window,'load',init,false); +//--------------------------------------------------------------------------------------- +//calling methods \ No newline at end of file diff --git a/posterita/posterita/web/js/shortcut.js b/posterita/posterita/web/js/shortcut.js new file mode 100644 index 0000000000..460a17b96b --- /dev/null +++ b/posterita/posterita/web/js/shortcut.js @@ -0,0 +1,223 @@ +/** + * http://www.openjs.com/scripts/events/keyboard_shortcuts/ + * Version : 2.01.A + * By Binny V A + * License : BSD + */ +shortcut = { + 'all_shortcuts':{},//All the shortcuts are stored in this array + 'add': function(shortcut_combination,callback,opt) { + //Provide a set of default options + var default_options = { + 'type':'keydown', + 'propagate':false, + 'disable_in_input':false, + 'target':document, + 'keycode':false + } + if(!opt) opt = default_options; + else { + for(var dfo in default_options) { + if(typeof opt[dfo] == 'undefined') opt[dfo] = default_options[dfo]; + } + } + + var ele = opt.target + if(typeof opt.target == 'string') ele = document.getElementById(opt.target); + var ths = this; + shortcut_combination = shortcut_combination.toLowerCase(); + + //The function to be called at keypress + var func = function(e) { + e = e || window.event; + + if(opt['disable_in_input']) { //Don't enable shortcut keys in Input, Textarea fields + var element; + if(e.target) element=e.target; + else if(e.srcElement) element=e.srcElement; + if(element.nodeType==3) element=element.parentNode; + + if(element.tagName == 'INPUT' || element.tagName == 'TEXTAREA') return; + } + + //Find Which key is pressed + if (e.keyCode) code = e.keyCode; + else if (e.which) code = e.which; + var character = String.fromCharCode(code).toLowerCase(); + + if(code == 188) character=","; //If the user presses , when the type is onkeydown + if(code == 190) character="."; //If the user presses , when the type is onkeydown + + var keys = shortcut_combination.split("+"); + //Key Pressed - counts the number of valid keypresses - if it is same as the number of keys, the shortcut function is invoked + var kp = 0; + + //Work around for stupid Shift key bug created by using lowercase - as a result the shift+num combination was broken + var shift_nums = { + "`":"~", + "1":"!", + "2":"@", + "3":"#", + "4":"$", + "5":"%", + "6":"^", + "7":"&", + "8":"*", + "9":"(", + "0":")", + "-":"_", + "=":"+", + ";":":", + "'":"\"", + ",":"<", + ".":">", + "/":"?", + "\\":"|" + } + //Special Keys - and their codes + var special_keys = { + 'esc':27, + 'escape':27, + 'tab':9, + 'space':32, + 'return':13, + 'enter':13, + 'backspace':8, + + 'scrolllock':145, + 'scroll_lock':145, + 'scroll':145, + 'capslock':20, + 'caps_lock':20, + 'caps':20, + 'numlock':144, + 'num_lock':144, + 'num':144, + + 'pause':19, + 'break':19, + + 'insert':45, + 'home':36, + 'delete':46, + 'end':35, + + 'pageup':33, + 'page_up':33, + 'pu':33, + + 'pagedown':34, + 'page_down':34, + 'pd':34, + + 'left':37, + 'up':38, + 'right':39, + 'down':40, + + 'f1':112, + 'f2':113, + 'f3':114, + 'f4':115, + 'f5':116, + 'f6':117, + 'f7':118, + 'f8':119, + 'f9':120, + 'f10':121, + 'f11':122, + 'f12':123 + } + + var modifiers = { + shift: { wanted:false, pressed:false}, + ctrl : { wanted:false, pressed:false}, + alt : { wanted:false, pressed:false}, + meta : { wanted:false, pressed:false} //Meta is Mac specific + }; + + if(e.ctrlKey) modifiers.ctrl.pressed = true; + if(e.shiftKey) modifiers.shift.pressed = true; + if(e.altKey) modifiers.alt.pressed = true; + if(e.metaKey) modifiers.meta.pressed = true; + + for(var i=0; k=keys[i],i 1) { //If it is a special key + if(special_keys[k] == code) kp++; + + } else if(opt['keycode']) { + if(opt['keycode'] == code) kp++; + + } else { //The special keys did not match + if(character == k) kp++; + else { + if(shift_nums[character] && e.shiftKey) { //Stupid Shift key bug created by using lowercase + character = shift_nums[character]; + if(character == k) kp++; + } + } + } + } + + if(kp == keys.length && + modifiers.ctrl.pressed == modifiers.ctrl.wanted && + modifiers.shift.pressed == modifiers.shift.wanted && + modifiers.alt.pressed == modifiers.alt.wanted && + modifiers.meta.pressed == modifiers.meta.wanted) { + callback(e); + + if(!opt['propagate']) { //Stop the event + //e.cancelBubble is supported by IE - this will kill the bubbling process. + e.cancelBubble = true; + e.returnValue = false; + + //e.stopPropagation works in Firefox. + if (e.stopPropagation) { + e.stopPropagation(); + e.preventDefault(); + } + return false; + } + } + } + this.all_shortcuts[shortcut_combination] = { + 'callback':func, + 'target':ele, + 'event': opt['type'] + }; + //Attach the function with the event + if(ele.addEventListener) ele.addEventListener(opt['type'], func, false); + else if(ele.attachEvent) ele.attachEvent('on'+opt['type'], func); + else ele['on'+opt['type']] = func; + }, + + //Remove the shortcut - just specify the shortcut and I will remove the binding + 'remove':function(shortcut_combination) { + shortcut_combination = shortcut_combination.toLowerCase(); + var binding = this.all_shortcuts[shortcut_combination]; + delete(this.all_shortcuts[shortcut_combination]) + if(!binding) return; + var type = binding['event']; + var ele = binding['target']; + var callback = binding['callback']; + + if(ele.detachEvent) ele.detachEvent('on'+type, callback); + else if(ele.removeEventListener) ele.removeEventListener(type, callback, false); + else ele['on'+type] = false; + } +} \ No newline at end of file diff --git a/posterita/posterita/web/js/stockCart.js b/posterita/posterita/web/js/stockCart.js new file mode 100644 index 0000000000..8a5481fc49 --- /dev/null +++ b/posterita/posterita/web/js/stockCart.js @@ -0,0 +1,518 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +/** + @author shameem + */ + +//----------------------------------FUNCTION DECLARATIONS--------------------------------------------- +//scrolls to the bottom of the cart +function scrollDownCart() +{ + if($('shoppingCart')) + { + $('shoppingCart').scrollTop = $('shoppingCart').scrollHeight; + } +} + + +//adding product to cart +function addToCart(barcode) +{ + cartIndex = null; + done = false; + if(barcode == null) return; + if(barcode == '') return; + + try + { + var url = 'StockMovementAction.do'; + var pars = 'action=addProduct&barCode='+ barcode + '&priceListId='+priceList; + + var myAjax = new Ajax.Request( url, + { + method: 'get', + parameters: pars, + onSuccess: refreshShoppingCart, + onFailure: reportShoppingCartError + }); + + + } + catch(e) + { + toConsole(e); + } +} + +//incrementing, decrementing and deleting the shopping cart items using ajax +// 1.Increment the qty for the product +function incrementCart(productId) +{ + if(productId == null) return; + + try + { + + var url = 'StockMovementAction.do'; + var pars = 'action=incrementQty&productId='+productId+ '&ifAdd=true' + '&priceListId='+priceList; + + var myAjax = new Ajax.Request( url, + { + method: 'get', + parameters: pars, + onSuccess: refreshShoppingCart, + onFailure: reportShoppingCartError + }); + + } + catch(e) + { + toConsole(e); + } + +} + +//2.Decrement the qty for the product +function decrementCart(productId) +{ + if(productId == null) return; + + try + { + + + var url = 'StockMovementAction.do'; + var pars = 'action=decrementQty&productId='+productId+ '&ifAdd=false&priceListId='+priceList; + + var myAjax = new Ajax.Request( url, + { + method: 'get', + parameters: pars, + onSuccess: refreshShoppingCart, + onFailure: reportShoppingCartError + }); + + } + catch(e) + { + toConsole(e); + } +} + +//3.Delete all the products with the ID from the cart +function deleteItemFromCart(productId) +{ + if(productId == null) return; + + cartIndex = null; + updateQty(productId, '0'); +} + +//Refreshs the content of the shopping cart +function refreshShoppingCart(request) +{ + try + { + //var top = $('items').scrollTop; + var response = request.responseText; + $('shoppingCart').innerHTML = response; + //$('items').scrollTop = top; + scrollDownCart(); + response.evalScripts(); //display error messages + } + catch(e) + { + showErrorMessage('Failed to resfresh cart! Cause:' + e); + } + + addBehaviourToCart(); +} + +//Reports an error +function reportShoppingCartError(request) +{ + alert('Some error occured while communicating with the server. Please try again.'); + alert(request.responseText); + var win = window.open(); + win.document.write(request.responseText); + win.document.close(); +} + +//addRequiredLibrary('js/test.js'); +var requestIndicator; + +/* +var ShoppingCart = { + + init : function(){ + //this.indicator = new AJAXIndicator('Please wait...'); + alert('Shopping Cart'); + }, + + indicator : null +}; +*/ + +function checkout() +{ + //do normal submit + $('checkoutForm').submit(); +/* + var pars = Form.serialize('checkoutForm'); + var url = 'CheckoutAction.do'; + + try + { + var myAjax = new Ajax.Request( url, + { + method: 'get', + parameters: pars, + onSuccess: handleCheckout, + onFailure: reportShoppingCartError + }); + } + catch(e) + { + toConsole(e); + } +*/ +} + +//Update the qty for the product +function updateQty(productId, quantity) +{ + if(productId == null) return; + + if (quantity == "") + { + return; + } + + if(quantity < 0) + { + showErrorMessage('Quantity cannot be negative!', 'qty'); + $('qty').value = ""; + return; + } + + var amount = parseFloat(quantity); + + if (isNaN(amount)) + { + showErrorMessage('Invalid quantity! ' + quantity, 'qty'); + $('qty').value = ""; + return; + } + + try + { + var url = 'StockMovementAction.do'; + var pars = 'action=updateQty&productId=' + productId + '&ifAdd=false&qtyToMove=' + quantity + '&priceListId='+priceList; + + var myAjax = new Ajax.Request( url, + { + method: 'get', + parameters: pars, + onSuccess: refreshShoppingCart, + onFailure: reportShoppingCartError + }); + + } + catch(e) + { + toConsole(e); + } + +} + +function updateNoOfPack(productId, noOfPack) +{ + if(productId == null) return; + + if (noOfPack == "") + { + return; + } + + if(noOfPack < 0) + { + showErrorMessage('No of Pack cannot be negative!', 'qty'); + return; + } + + var amount = parseFloat(noOfPack); + + if (isNaN(amount)) + { + showErrorMessage('Invalid No of Pack! ' + quantity, 'qty'); + return; + } + + try + { + var url = 'StockMovementAction.do'; + var pars = 'action=updateNoOfPack&productId=' + productId + '&ifAdd=false&noOfPack=' + noOfPack; + + var myAjax = new Ajax.Request( url, + { + method: 'get', + parameters: pars, + onSuccess: refreshShoppingCart, + onFailure: reportShoppingCartError + }); + + } + catch(e) + { + toConsole(e); + } + +} + +//Reload shopping cart +function reloadCart() +{ + try + { + var url = 'StockMovementAction.do'; + var pars = 'action=reloadCart'; + + var myAjax = new Ajax.Request( url, + { + method: 'get', + parameters: pars, + onSuccess: refreshShoppingCart, + onFailure: reportShoppingCartError + }); + + } + catch(e) + { + toConsole(e); + } + +} + + +function clearCart() +{ + maxRows = 0; + excessRows = 0; + resetDetails(); + + try + { + var url = 'StockMovementAction.do'; + var pars = 'action=clearCart'; + + var myAjax = new Ajax.Request( url, + { + method: 'get', + parameters: pars, + onSuccess: refreshShoppingCart, + onFailure: reportShoppingCartError + }); + } + catch(e) + { + toConsole(e); + } + +} + +function handleCheckout(request) +{ + var response = request.responseText; + var result = eval('(' + response + ')'); + + if(result.error) + { + showErrorMessage(result.error); + } + else + { + printOrder(result.orderID); + reloadCart(); + } +} + + +function addBehaviourToCart() +{ + var rows = new Array(); + var count = 1; + + while(true) + { + var row = $('row' + count); + if(row == null) break; + + rows.push(row); + count ++; + } + + for(var i=0; i 0) + { + var line = cartLines[cartIndex]; + simulateOnClick(line); + + } + + if(cartLines.length > maxRows) + { + var shoppingCart = $('shoppingCart'); + shoppingCart.scrollTop = shoppingCart.scrollHeight; + } + +} + +//Reload the shopping cart. Prices are calculated for the pricelist +function setShoppingCartPriceList() +{ + try + { + var url = 'AddToPOSShoppingCartAction.do'; + var pars = 'action=updatePriceList&priceListId='+priceList; + + var myAjax = new Ajax.Request( url, + { + method: 'get', + parameters: pars, + onSuccess: refreshShoppingCart, + onFailure: reportShoppingCartError + }); + + } + catch(e) + { + toConsole(e); + } +} + +function scrollCart() +{ + var shoppingCart = $('shoppingCart'); + + if(cartIndex > maxRows) + { + shoppingCart.scrollTop = shoppingCart.scrollHeight; + } + else + { + shoppingCart.scrollTop = 0; + } +} + + +//Event.observe(window,'load',init,false); +//--------------------------------------------------------------------------------------- +//calling methods \ No newline at end of file diff --git a/posterita/posterita/web/js/stockTransfer.js b/posterita/posterita/web/js/stockTransfer.js new file mode 100644 index 0000000000..c9379a962e --- /dev/null +++ b/posterita/posterita/web/js/stockTransfer.js @@ -0,0 +1,537 @@ +//scripts for Posterita Ordering Screen +var product_id = null; +var cartLines = null; +var cartIndex = null; +var priceList = null; +var movementId = null; +var description = null; +var reference = null; +var oldPriceList = -1; +var searchElement = null; +var defaultPriceList = null; +var defaultPriceListName = null; +var ISTAXINCLUDED = null; +var TAX_RATE = null; +var ERROR_MSG = null; +var itemRowHeight = null; +var totalAmount = null; +var maxRows = 15; +var done = false; +var STOCKQTY = null; +var orgFromId = null; +var orgToId = null; + +var initScreen = function(){ + priceList = $('priceListId').value; + movementId = $('movementId').value; + + var orgFrom = $('orgFromId'); + orgFromId = orgFrom[orgFrom.selectedIndex].value; + + var orgTo = $('orgToId'); + orgToId = orgTo[orgTo.selectedIndex].value; + + //set default data for price list + defaultPriceList = priceList; + defaultPriceListName = $('terminal').innerHTML; + + //set search element + var searchProductBy = $('searchProductBy').value; + if(searchProductBy == 'name') + { + searchElement = $('productQuery'); + } + else + { + searchElement = $(searchProductBy); + } + + initProductSearch();; + initCartBtn(); + initAjaxResponder(); + initShortcuts(); + initSystemBtns(); + + searchElement.focus(); + + var barcode = $('barcode'); + barcode.focus(); + barcode.onkeyup = function(e){ + if(e.keyCode == Event.KEY_RETURN) + { + if(this.value != null && this.value != "") + { + done = true; + + addToCart(this.value); + this.value = ""; + } + + } + }; + + $('qty').onkeyup = function(e){ + if(e.keyCode == Event.KEY_RETURN) + { + //update qty + updateQty(product_id, this.value); + return false; + } + }; + + + $('clearCartBtn').onclick = function(e){ + initSystemBtns(); + this.className = 'selected'; + clearCart(); + }; + + $('saveBtn').onclick = function(e){ + initSystemBtns(); + this.className = 'selected'; + + if(cartLines == null || cartLines.length == 0) + { + showErrorMessage('Shopping cart is empty!', 'productQuery'); + return; + } + + if(orgFromId == orgToId) + { + showErrorMessage('You cannot transfer stocks to the same organisation', 'orgFromId'); + return; + } + else + { + saveMMovement(); + } + }; + + $('completeBtn').onclick = function(e){ + initSystemBtns(); + this.className = 'selected'; + + if(cartLines == null || cartLines.length == 0) + { + showErrorMessage('Shopping cart is empty!', 'productQuery'); + return; + } + + if(orgFromId == orgToId) + { + showErrorMessage('You cannot transfer stocks to the same organisation', 'orgFromId'); + return; + } + else + { + $('StockMovementForm').submit(); + } + }; + + $('newStockBtn').onclick = function(e){ + initSystemBtns(); + this.className = 'selected'; + + redirect("StockMovementAction.do?action=createNewStockTransfer"); + }; + + //add behaviour to existing cart + addBehaviourToCart(); +}; + +var initShortcuts = function() +{ + shortcut.add("Ctrl+Space", function(e){simulateOnClick($('checkoutBtn'))}); + + shortcut.add("F1", function(e){$('barcode').select();}); + shortcut.add("F2", function(e){$('productQuery').select();}); + shortcut.add("F3", function(e){$('description').select();}); + shortcut.add("F4", function(e){$('qty').select();}); + + shortcut.add("Ctrl+M", function(){simulateOnClick($('menuBtn'))}); + + shortcut.add("Ctrl+Delete", function(){ + simulateOnClick($('clearCartBtn')); + }); + + shortcut.add("Ctrl+R", function() + { + $('reference').focus(); + }); + + shortcut.add("Ctrl+S", function(){simulateOnClick($('saveBtn'))}); + shortcut.add("Ctrl+C", function(){simulateOnClick($('completeBtn'))}); + + //move between cart lines + shortcut.add("Ctrl+Up", function(){ + if(cartIndex > 0) + { + cartIndex = cartIndex -1; + var line = cartLines[cartIndex]; + scrollCart(); + simulateOnClick(line); + } + }); + + shortcut.add("Ctrl+Down", function(){ + if(cartIndex < cartLines.length - 1) + { + cartIndex = cartIndex + 1; + var line = cartLines[cartIndex]; + scrollCart(); + simulateOnClick(line); + } + }); + + //incrementing and decrementing qty + shortcut.add("Ctrl+Right", function(){ + simulateOnClick($('plusBtn')); + }); + + shortcut.add("Ctrl+Left", function(){ + simulateOnClick($('minusBtn')); + }); + + shortcut.add("Ctrl+Backspace", function(){ + simulateOnClick($('deleteBtn')); + }); + + +}; + +var showResult = function(element, update){ + if(!update.style.position || update.style.position=='absolute') { + update.style.position = 'absolute'; + Position.clone(element, update, {setHeight: false, offsetTop: element.offsetHeight}); + Position.clone($('maintop'), update, {setHeight: false, setTop: false, offsetTop: element.offsetHeight}); + } + + update.style.display = 'block'; + update.style.opacity = '1.0'; + + }; + + +var initProductSearch = function(){ + + // autocomplete for search by product name + var productAutocompleter = new Ajax.Autocompleter('productQuery','productSearchResult','SearchProductsAction.do',{ + paramName:'productName', + parameters : 'priceListId=' + priceList, + minChars:1, + frequency:1.0, + afterUpdateElement: afterAutocomplete, + onShow : showResult + }); + + productAutocompleter.xyz = true; + $('productQuery').Autocompleter = productAutocompleter; + + + // autocomplete for search by product description + var productAutocompleter2 = new Ajax.Autocompleter('description','productSearchByDescriptionResult','SearchProductsAction.do',{ + paramName:'description', + parameters : 'priceListId=' + priceList, + minChars:1, + frequency:1.0, + afterUpdateElement: afterAutocomplete, + onShow : showResult + }); + + $('description').Autocompleter = productAutocompleter2; +}; + +var afterAutocomplete = function(e1,e2){ + + var barcode = e2.getAttribute('barcode'); + if(barcode=='null') + { + barcode = ""; + } + var productId = e2.getAttribute('productId'); + + if(productId == null) + { + $('description').value = ""; + $('productQuery').value = ""; + + return; + } + + //$('barcode').value = barcode; + $('productId').value= productId; + + var description = e2.getAttribute('description'); + //$('description').value = description; + + incrementCart(productId); + + //reset focus to search input + searchElement.focus(); + + //show product details + getProductInfo(productId); + + //set global product + product_id = productId; + + $('description').value = ""; + $('productQuery').value = ""; + +}; + +function getProductInfo(productId) +{ + var url = 'POSProductAction2.do'; + var pars = 'action=getProductDetails&productId='+productId+'&priceListId='+priceList; + + var myAjax = new Ajax.Request( url, + { + method: 'get', + parameters: pars, + onSuccess: showProductInfo, + onFailure: reportError + }); +} + +function showProductInfo(request) +{ + // + try + { + var response = request.responseText; + var product = eval('(' + response + ')'); + + //display product info in right column + $('product.name').innerHTML = product.name; + $('product.barcode').innerHTML = product.barcode; + $('product.taxCategory').innerHTML = product.taxCategory; + $('product.description').innerHTML = product.description; + STOCKQTY = $('product.stock.qty').innerHTML = product.stockQty; + TAX_RATE = new Number(product.taxRate).toFixed(2); + var taxPercentage = new Number(1 + (TAX_RATE / 100)); + + ISTAXINCLUDED = product.isTaxIncluded; + + if(ISTAXINCLUDED == "false") + { + $('product.price.list').innerHTML = new Number(product.priceList * taxPercentage).toFixed(2); + } + else + { + $('product.price.list').innerHTML = new Number(product.priceList).toFixed(2); + } + + $('product.units.pack').innerHTML = product.unitsPerPack; + $('product.image').src = 'images/newUI/productpreview.gif'; + + } + catch(e) + { + showErrorMessage(e); + } +} + +function reportError(request) +{ + alert("Some error has occured while communicating with the server"); + var w = window.open("","Error"); + var d = w.document; + d.write(request.responseText); +} + +function convertString2Unicode(s) +{ + var uniString = "", hexVal, uniChar; + + for(var i = 0; i < s.length; ++i) + { + //Convert char to hex + //hexVal = Number(s.charCodeAt(i)).toString(16); + hexVal = Number(s.charCodeAt(i)).toString(10); + + //Convert to unicode by making sure hex is 4 chars long, padding with 0's if less + //uniChar = "\\u" + ("000" + hexVal).match(/.{4}$/)[0]; + uniChar = "&#" + ("000" + hexVal).match(/.{4}$/)[0] +";"; + + uniString += uniChar; + } + if(hexVal < 255) + return s; + + return uniString; +} + +var initCartBtn = function(){ + var plus = $('plusBtn'); + var minus = $('minusBtn'); + var del = $('deleteBtn'); + + plus.style.cursor = 'pointer'; + minus.style.cursor = 'pointer'; + del.style.cursor = 'pointer'; + + plus.onclick = function(e){ + if(product_id != null) + incrementCart(product_id); + searchElement.focus(); + }; + + minus.onclick = function(e){ + if(product_id != null) + decrementCart(product_id); + searchElement.focus(); + }; + + del.onclick = function(e){ + if(product_id != null) + deleteItemFromCart(product_id); + + if(cartLines == null || cartLines.length == 0) + { + resetDetails(); + } + + searchElement.focus(); + }; +}; + + + +var initAjaxResponder = function(){ + + Ajax.Responders.register({ + onCreate: function() { + $('indicator').style.display = 'block'; + }, + onComplete: function() { + $('indicator').style.display = 'none'; + } + }); +}; + + + +//---------------------------------------------------------------------------- + +function initSystemBtns() +{ + + systemBtns = new Array(); + + systemBtns.push($('completeBtn')); + systemBtns.push($('clearCartBtn')); + systemBtns.push($('saveBtn')); + systemBtns.push($('newStockBtn')); + + systemBtns = $A(systemBtns); + + for(var i=0; iPlease Wait...

    ', {title: 'Saving Inventory Move', width: 800}); + Modalbox.deactivate(); + + reference = $('reference').value; + var url = 'StockMovementAction.do'; + var pars = 'action=createMMovement&movementId='+movementId+'&priceListId='+priceList+'&description='+reference+'&orgFromId='+orgFromId+'&orgToId='+orgToId; + + var myAjax = new Ajax.Request( url, + { + method: 'get', + parameters: pars, + onSuccess: showMovementInfo, + onFailure: reportError + }); + } +} + +function showMovementInfo(request) +{ + // + try + { + if (window.Modalbox) + Modalbox.hide(); + + var response = request.responseText; + var movementInfo = eval('(' + response + ')'); + + //display info in right column + $('docNo').innerHTML = movementInfo.docNo; + + if(movementInfo.description == null || movementInfo.description == 'null' || movementInfo.description == "") + { + $('reference').value = ""; + } + else + { + $('reference').value = movementInfo.description; + } + + $('mainTitle').innerHTML = "STATUS: " + movementInfo.docStatus; + $('movementId').value = movementId = movementInfo.movementId; + + } + catch(e) + { + showErrorMessage(e); + } +} +function setOrgFromTo() +{ + var orgFrom = $('orgFromId'); + orgFromId = orgFrom[orgFrom.selectedIndex].value; + + var orgTo = $('orgToId'); + orgToId = orgTo[orgTo.selectedIndex].value; + + if(orgFromId == orgToId) + { + showErrorMessage('You cannot transfer stocks to the same organisation', 'orgFromId'); + } +} + +Event.observe(window,'load',initScreen,false); \ No newline at end of file diff --git a/posterita/posterita/web/js/timer.js b/posterita/posterita/web/js/timer.js new file mode 100644 index 0000000000..477b1a0696 --- /dev/null +++ b/posterita/posterita/web/js/timer.js @@ -0,0 +1,36 @@ +var rTimer; +var sds ; + +TimeTick(); + +function TimeTick() +{ + var d = new Date(); + + var sds = new Date(); + + var hours = d.getHours(); + var minutes = d.getMinutes(); + var seconds = d.getSeconds(); + var month = d.getMonth()+1; + var date= d.getDate(); + var year = d.getFullYear(); + + + hours = (hours < 10)? '0'+hours : hours; + minutes = (minutes < 10)? '0'+minutes : minutes; + seconds = (seconds < 10)? '0'+seconds : seconds; + date =(date <10) ? '0'+date : date; + month =(month<10) ? '0'+ month : month; + + + $('timer').innerHTML= date+"/"+ month +"/"+year+" "+hours+":"+minutes+":"+seconds; + if(rTimer) + { + clearTimeout(rTimer); + } + + rTimer = setTimeout('TimeTick()', 1000); +} + + diff --git a/posterita/posterita/web/js/tooltip.js b/posterita/posterita/web/js/tooltip.js new file mode 100644 index 0000000000..d707fcc866 --- /dev/null +++ b/posterita/posterita/web/js/tooltip.js @@ -0,0 +1,113 @@ +/** + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +/** + @author praveen + */ + + +//some methods for tooltip +function showTooltip(e) +{ + //Remove previous tooltips + if($('tooltipdiv')) + { + document.body.removeChild($('tooltipdiv')); + } + + var tip = this.getAttribute('tooltip'); + if(!tip) + { + return; + } + + var tooltip = document.createElement('div'); + var newAttr = document.createAttribute('id'); + newAttr.nodeValue = "tooltipdiv" + tooltip.setAttributeNode(newAttr); + + tooltip.onclick = function(){ + document.body.removeChild(this); + }; + + var event = window.event || e; + + var xcoor = Event.pointerX(event); + var ycoor = Event.pointerY(event); + + //tooltip.style.left = 10 + xcoor + "px"; + //tooltip.style.top = 10 + ycoor + "px"; + tooltip.style.visibility = 'hidden'; + tooltip.className = "tooltip"; + tooltip.innerHTML = tip; + document.body.appendChild(tooltip); + + var sWidth = getViewportWidth(); + var sHeigth = getViewportHeight(); + + var ttLeft = 10 + xcoor; + var ttTop = 10 + ycoor; + var ttWidth = tooltip.scrollWidth; + var ttHeight = tooltip.scrollHeight; + + if((ttLeft+ttWidth)>sWidth){ + ttLeft = sWidth - (10 + ttWidth); + } + + if((ttTop+ttHeight)>sHeigth){ + ttTop = sHeigth - (10 + ttHeight); + } + + tooltip.style.left = ttLeft + "px"; + tooltip.style.top = ttTop + "px"; + tooltip.style.visibility = 'visible'; + + //toConsole('Width:' + tooltip.scrollWidth); + //toConsole('Height:' + tooltip.scrollHeight); + +} + +var initTooltip = function() +{ + var help = document.getElementsByName('help'); + for(var i=0; i + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> + + + + + + + + + + <%@ include file="/jsp/include/tabTop.jsp" %><%@ include file="/jsp/include/tabBottom.jsp" %> + + + + + + + + +
    + +
    + + + + + + <%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + + + + + + + +
    + +
    + +
    + +
    + + <%@ include file="/jsp/include/footerTableBottom.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/admin/changePassword.jsp b/posterita/posterita/web/jsp/admin/changePassword.jsp new file mode 100644 index 0000000000..34360a7031 --- /dev/null +++ b/posterita/posterita/web/jsp/admin/changePassword.jsp @@ -0,0 +1,79 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author tamak +--%> + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> + + + + + + + + + +<%@ include file="/jsp/include/tabTop.jsp" %><%@ include file="/jsp/include/tabBottom.jsp" %> + + + + + + + + +
    + +
    + + + + + + <%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + + + + + + + +
    + +
    + +
    +
    + + <%@ include file="/jsp/include/footerTableBottom.jsp" %> + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/admin/checkDataIntegritySuccess.jsp b/posterita/posterita/web/jsp/admin/checkDataIntegritySuccess.jsp new file mode 100644 index 0000000000..4159b268d2 --- /dev/null +++ b/posterita/posterita/web/jsp/admin/checkDataIntegritySuccess.jsp @@ -0,0 +1,48 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + +<%@ page import="org.posterita.user.*" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> + + + + + + + + + + + + + + +
    +
    + +
    +
    +<%@ include file="/jsp/include/footerTableBottom.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/admin/checkSequenceSuccess.jsp b/posterita/posterita/web/jsp/admin/checkSequenceSuccess.jsp new file mode 100644 index 0000000000..ca460fc900 --- /dev/null +++ b/posterita/posterita/web/jsp/admin/checkSequenceSuccess.jsp @@ -0,0 +1,55 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.beans.*" %> +<%@ page import="org.posterita.struts.pos.CashBookAction" %> + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> + + + + + +Update Sequence +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + +
    + The sequences have been updated successfully +
    + + +<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/admin/createRole.jsp b/posterita/posterita/web/jsp/admin/createRole.jsp new file mode 100644 index 0000000000..92fa36db37 --- /dev/null +++ b/posterita/posterita/web/jsp/admin/createRole.jsp @@ -0,0 +1,179 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author praveen +--%> + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.beans.UDIBean" %> +<%@ page import="org.posterita.core.MenuItem" %> + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> + + + + + + + + + +<%@ include file="/jsp/include/tabTop.jsp" %><%@ include file="/jsp/include/tabBottom.jsp" %> + + + + + + + + + + +
    + +
    + <%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + Can Create Order + + +
    + Can Alter Order + + +
    + Can View Order + + +
    +

    + Available Menus +
    +
    + + + + + + + + + + + + + + + + + +
    + +
            + + + +
    +
    +
    + + Clear All + + + Select All + + + + +
    + +
    +
    + + + +<%@ include file="/jsp/include/footerTableBottom.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/admin/emailChanged.jsp b/posterita/posterita/web/jsp/admin/emailChanged.jsp new file mode 100644 index 0000000000..0a13ee080c --- /dev/null +++ b/posterita/posterita/web/jsp/admin/emailChanged.jsp @@ -0,0 +1,48 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author tamak +--%> + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/posterita.tld" prefix="posterita"%> + + + + + + <%@ include file="/jsp/include/tabTop.jsp" %><%@ include file="/jsp/include/tabBottom.jsp" %> + + + + + +
    + +
    + +<%@ include file="/jsp/include/footerTableBottom.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/admin/listOrganisations.jsp b/posterita/posterita/web/jsp/admin/listOrganisations.jsp new file mode 100644 index 0000000000..432a5d380c --- /dev/null +++ b/posterita/posterita/web/jsp/admin/listOrganisations.jsp @@ -0,0 +1,91 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author sendy +--%> + +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + +<%@page import="org.posterita.struts.admin.OrganisationAction"%> +<%@page import="org.posterita.Constants"%> +Organisations +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + +
    + + + + + + "> + Create Organisation + +
    + +

    + + + + + + + + + + + + + + + + + + + + +
    Organisation NameAddressActiveUpdate Details
    + + + + + + + + "> + update organisation + + "> + activate/deactivate organisation + +
    +
    + +<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/admin/listRoles.jsp b/posterita/posterita/web/jsp/admin/listRoles.jsp new file mode 100644 index 0000000000..9dbb4cf645 --- /dev/null +++ b/posterita/posterita/web/jsp/admin/listRoles.jsp @@ -0,0 +1,92 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.beans.*" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> + + + + + + + + + + + <%@ include file="/jsp/include/tabTop.jsp" %><%@ include file="/jsp/include/tabBottom.jsp" %> + + + + + + + + + + + +
    + +
    + <%@ include file="/jsp/include/errors.jsp" %> + +
    + Add Record +
    + + + + + + + + + + + + + + + + + + +
     
    + + <%-- + ">Edit + --%> + ">View + <%--">Delete--%> +
    +
    + + + +<%@ include file="/jsp/include/footerTableBottom.jsp" %> diff --git a/posterita/posterita/web/jsp/admin/passwordChanged.jsp b/posterita/posterita/web/jsp/admin/passwordChanged.jsp new file mode 100644 index 0000000000..aeffa1b345 --- /dev/null +++ b/posterita/posterita/web/jsp/admin/passwordChanged.jsp @@ -0,0 +1,52 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author tamak +--%> + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/posterita.tld" prefix="posterita"%> + + + Change password + + + + + + <%@ include file="/jsp/include/errors.jsp"%> + + + + + +
    + +
    + + +<%@ include file="/jsp/include/tshirtFooter.jsp"%> diff --git a/posterita/posterita/web/jsp/admin/updateOrCreateOrganisation.jsp b/posterita/posterita/web/jsp/admin/updateOrCreateOrganisation.jsp new file mode 100644 index 0000000000..be97acaa7d --- /dev/null +++ b/posterita/posterita/web/jsp/admin/updateOrCreateOrganisation.jsp @@ -0,0 +1,128 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * +--%> +<%@ page import="org.posterita.Constants" %> +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + +
    + + + + + + + + + + + + + + +
    +
    + + + + + + + + + + + + + + +
    *
    + + + +
    +
    +
    +
    + Receipt Footer Message + + + + + +
    + + + +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + +
    + +
    + + + + +
    + +
    +
    +
    +   +
    +
    +
    + +<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/admin/userDeleted.jsp b/posterita/posterita/web/jsp/admin/userDeleted.jsp new file mode 100644 index 0000000000..19ff9c5030 --- /dev/null +++ b/posterita/posterita/web/jsp/admin/userDeleted.jsp @@ -0,0 +1,49 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author tamak +--%> + +<%@ page import="org.posterita.user.*" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> + + + + + + + + + + + + + + +
    +
    + +
    +
    + + <%@ include file="/jsp/include/footerTableBottom.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/admin/viewMyDetails.jsp b/posterita/posterita/web/jsp/admin/viewMyDetails.jsp new file mode 100644 index 0000000000..cccf499f12 --- /dev/null +++ b/posterita/posterita/web/jsp/admin/viewMyDetails.jsp @@ -0,0 +1,138 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author tamak +--%> + +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.beans.UDIBean" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> + + + + + + + + + + + + + + + + + + +
    + <%@ include file="/jsp/include/tabTop.jsp" %><%@ include file="/jsp/include/tabBottom.jsp" %> +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + +
    + + + +
    + + + +
    + + + +
    + + + +
    + + + +
    + + + +
    + + + +

    + +

    +
    +
    + +
    +
    + + + <%@ include file="/jsp/include/footerTableBottom.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/admin/viewOrganisation.jsp b/posterita/posterita/web/jsp/admin/viewOrganisation.jsp new file mode 100644 index 0000000000..07773623fb --- /dev/null +++ b/posterita/posterita/web/jsp/admin/viewOrganisation.jsp @@ -0,0 +1,67 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author sendy +--%> + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + +
    + + + + + + + + + + + + + + + + + + +
    Organisation NameAddressActiveUpdate Details
    + + + + + + + + + + + + + + + + + + + +
    +
    +<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/admin/viewRole.jsp b/posterita/posterita/web/jsp/admin/viewRole.jsp new file mode 100644 index 0000000000..41d613f8a7 --- /dev/null +++ b/posterita/posterita/web/jsp/admin/viewRole.jsp @@ -0,0 +1,96 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.compiere.model.MOrg" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> + + + + + + <%@ include file="/jsp/include/tabTop.jsp" %>View Role<%@ include file="/jsp/include/tabBottom.jsp" %> + + + + + + + + +
    + +
    + <%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + + + + + + + +
    Role Name :

    Menus
    + + + + + + + + + + + + + + + + +
    + +
            + +
    +
    +
    +
    + + + + <%@ include file="/jsp/include/footerTableBottom.jsp" %> + + + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/admin/viewUserDetails.jsp b/posterita/posterita/web/jsp/admin/viewUserDetails.jsp new file mode 100644 index 0000000000..68d409baf7 --- /dev/null +++ b/posterita/posterita/web/jsp/admin/viewUserDetails.jsp @@ -0,0 +1,120 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author tamak +--%> + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.compiere.model.MOrg" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> + + + + + + <%@ include file="/jsp/include/tabTop.jsp" %><%@ include file="/jsp/include/tabBottom.jsp" %> + + + + + + + + +
    + +
    + + + + + + + + + + + + <%-- + + + + + --%> + + + + + + + + + + + + + +
    + + + +
    + + + +
    + + + +
    + + + +
    + + + +
    + + + + + + + + + + +
    + + + +
    +
    +
    + + <%@ include file="/jsp/include/footerTableBottom.jsp" %> + + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/admin/viewUsers.jsp b/posterita/posterita/web/jsp/admin/viewUsers.jsp new file mode 100644 index 0000000000..091f0e7fe4 --- /dev/null +++ b/posterita/posterita/web/jsp/admin/viewUsers.jsp @@ -0,0 +1,110 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.compiere.model.MOrg" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> + + + + + + <%@ include file="/jsp/include/tabTop.jsp" %><%@ include file="/jsp/include/tabBottom.jsp" %> + + + + + + + + +
    + +
    + + + + + + + + + + + + <% + String styleClass = "label"; + if ((count.intValue()%2) != 0) + styleClass = "contentname"; + %> + + + + + + + + + + + + + + +
    + + + + + Active +   + +
    + + + + + + Yes + + + No + + + "> + + +
    +
    + + + + <%@ include file="/jsp/include/footerTableBottom.jsp" %> + + + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/attachment/createAttachment.jsp b/posterita/posterita/web/jsp/attachment/createAttachment.jsp new file mode 100644 index 0000000000..9d84925850 --- /dev/null +++ b/posterita/posterita/web/jsp/attachment/createAttachment.jsp @@ -0,0 +1,87 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + +<%@ page import="org.posterita.struts.attachment.AttachmentAction" %> +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.beans.UDIBean" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> + + + +Attach Logo + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + <%@ include file="/jsp/include/tabTop.jsp" %>Attach Logo<%@ include file="/jsp/include/tabBottom.jsp" %> + <%@ include file="/jsp/include/errors.jsp" %> +
    + find logo + + +
    Name + +
    + + + +
    +
    +<%@ include file="/jsp/include/footerTableBottom.jsp" %> + + + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/bPartner/bPartnerCreated.jsp b/posterita/posterita/web/jsp/bPartner/bPartnerCreated.jsp new file mode 100644 index 0000000000..e927c3a166 --- /dev/null +++ b/posterita/posterita/web/jsp/bPartner/bPartnerCreated.jsp @@ -0,0 +1,180 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.beans.*" %> +<%@ page import ="org.posterita.Constants" %> + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/posterita.tld" prefix="posterita"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + + +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%-- + + + + + --%> +
    + + + +   +
    + + + +
    + + + +
    + + + +
    + + + +
    + + + +
    + + + +
    + + Yes + + + No + +
    + + Yes + + + No + +
    + + Yes + + + No + +
    + + Yes + + + No + +
    + + + +
    +
    + + +<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/bPartner/bPartnerDetails.jsp b/posterita/posterita/web/jsp/bPartner/bPartnerDetails.jsp new file mode 100644 index 0000000000..b9715c06b9 --- /dev/null +++ b/posterita/posterita/web/jsp/bPartner/bPartnerDetails.jsp @@ -0,0 +1,184 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + + +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.beans.*" %> +<%@ page import ="org.posterita.Constants" %> + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/posterita.tld" prefix="posterita"%> + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + + +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + +   +
    + + + +
    + + + +
    + + + +
    + + + +
    + : + + +
    + : + + +
    + + Yes + + + No + +
    + + Yes + + + No + +
    + + Yes + + + No + +
    + + Yes + + + No + +
    + + Yes + + + No + +
    + + +
    + +
    +
    + + +<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/bPartner/createBPartner.jsp b/posterita/posterita/web/jsp/bPartner/createBPartner.jsp new file mode 100644 index 0000000000..365d62c2a5 --- /dev/null +++ b/posterita/posterita/web/jsp/bPartner/createBPartner.jsp @@ -0,0 +1,218 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + + +<%@ page import="org.posterita.struts.bPartner.BPartnerAction" %> +<%@ page import ="org.posterita.Constants" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%-- + + + + + + + + + + + + + + + + + + --%> + + + + + + +
    + * + + +
    + * + + +
    + * + + +
    + + + +
    + + + +
    + + + +
    + + + +
    + + + +
    + + + + + + +
    + + + + + +
    + * + + + + +
    + + + + + +
    + + + + + +
    + + + + + +
    +   + + +   + +
    + +
    +<%@ include file="/jsp/include/posFooter.jsp" %> + + + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/bPartner/editBPartner.jsp b/posterita/posterita/web/jsp/bPartner/editBPartner.jsp new file mode 100644 index 0000000000..11e824f239 --- /dev/null +++ b/posterita/posterita/web/jsp/bPartner/editBPartner.jsp @@ -0,0 +1,220 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + + +<%@ page import="org.posterita.struts.bPartner.BPartnerAction" %> +<%@ page import ="org.posterita.Constants" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%-- + + + + + + + + + + + + + + + + + + --%> + + + + + + +
    + + + +
    + + + +
    + + + +
    + + + +
    + + + +
    + + + +
    + + + +
    + + + +
    + + + + + + +
    + + + + + +
    + * + + + + +
    + + + + + +
    + + + + + +
    + + + + + +
    +   + + +   + +
    + +
    + +<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/bPartner/viewBPartner.jsp b/posterita/posterita/web/jsp/bPartner/viewBPartner.jsp new file mode 100644 index 0000000000..759b1dfbd1 --- /dev/null +++ b/posterita/posterita/web/jsp/bPartner/viewBPartner.jsp @@ -0,0 +1,185 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + + +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.beans.*" %> +<%@ page import ="org.posterita.Constants" %> +<%@ page import="org.compiere.model.MOrg" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + +
    + + + + + + + +
    + + + + + +   + + + + + Add Business Partner + +
    +
    + + + + + + + + + + + + + + <% + String url = "BusinessPartners.do"; + String collection = Constants.ALLBUSINESSPARTNERS; + %> + + + + <% + String styleClass = "label"; + if ((count.intValue()%2) != 0) + styleClass = "contentname"; + %> + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + + +   +
    + +   + + + Yes + + + No + + + + Yes + + + No + + + + Yes + + + No + + + + Yes + + + No + + + + Yes + + + No + + + "> + View Business Partner + +   + "> + Edit Business Partner + +   + + + "> + Deactivate + + + + + "> + Activate + + +
    +<%@ include file="/jsp/include/pager.jsp" %> +
    + +<%@ include file="/jsp/include/posFooter.jsp" %> + + diff --git a/posterita/posterita/web/jsp/cashBook/cashBook.jsp b/posterita/posterita/web/jsp/cashBook/cashBook.jsp new file mode 100644 index 0000000000..1adc189922 --- /dev/null +++ b/posterita/posterita/web/jsp/cashBook/cashBook.jsp @@ -0,0 +1,181 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2008 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Ashley +--%> + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.beans.*" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + +<%@page import="org.posterita.struts.pos.CashBookAction"%> + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + <% + boolean readonly = new Boolean((String)strReadOnly).booleanValue(); + + boolean orgReadOnly = true; + + if (cashBookId != null) + { + try + { + orgReadOnly = (Integer.parseInt((String)cashBookId) > 0); + } + catch (Exception ex) + {} + } + %> + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + * + + +
    + * + + + + +
    + + + + +
    + + + + +
    + + + + + +
    + + + +
    +
    + + + Copy As + + + + + Edit + + + + + Save + + + + + Cancel + + +
    +
    + +<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/client/createClient.jsp b/posterita/posterita/web/jsp/client/createClient.jsp new file mode 100644 index 0000000000..3bcba630d5 --- /dev/null +++ b/posterita/posterita/web/jsp/client/createClient.jsp @@ -0,0 +1,206 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Ashley +--%> + + + +<%@ page import="org.posterita.Constants" %> + +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> + + + + POSterita:. Create Client + + + + + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/footer.jsp b/posterita/posterita/web/jsp/include/footer.jsp new file mode 100644 index 0000000000..3878b621ab --- /dev/null +++ b/posterita/posterita/web/jsp/include/footer.jsp @@ -0,0 +1,50 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author tamak +--%> + +<%@ page import="org.posterita.Constants" %> +<% +String appName = (String) request.getSession().getAttribute(Constants.APP_NAME); +%> + + + + + + + +
    +
    + +
    + + + + + + + +
    + +
    +
    + + + +
    + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/inOut/viewMinOut.jsp b/posterita/posterita/web/jsp/inOut/viewMinOut.jsp new file mode 100644 index 0000000000..ebffee5bf7 --- /dev/null +++ b/posterita/posterita/web/jsp/inOut/viewMinOut.jsp @@ -0,0 +1,103 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Vishee +--%> + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.compiere.process.DocumentEngine" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> + + + + + + + + + +<%@ include file="/jsp/include/tabTop.jsp" %><%@ include file="/jsp/include/tabBottom.jsp" %> + + +
    + + + + <%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + + + +
    +
    + Client + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Client Name
    Organisation Name
    Currency + + + +
    Address
    Postal Address
    City
    Country + + + +
    +
    +
    +
    + Administrator + + + + + + + + + + + + + + + + + + + + + + + + + + +
    User Name
    Role Name
    Password
    Confirm Password
    User PIN
    Email
    +
    +
    +
    + Accounting + + + + + +
    Load Accounting Values
    +
    +
    + +   + +
    +
    + + + + + + diff --git a/posterita/posterita/web/jsp/customer/createPOSCustomer.jsp b/posterita/posterita/web/jsp/customer/createPOSCustomer.jsp new file mode 100644 index 0000000000..dc00985ba7 --- /dev/null +++ b/posterita/posterita/web/jsp/customer/createPOSCustomer.jsp @@ -0,0 +1,51 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + +<%@ page import="org.posterita.struts.customer.CustomerAction" %> +<%@ page import="org.compiere.model.MBPartner" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + +<%@ include file="/jsp/pos/customerDetails.jsp" %> + + + + +<%@ include file="/jsp/include/posFooter.jsp" %> + + + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/customer/existingPOSCustomers.jsp b/posterita/posterita/web/jsp/customer/existingPOSCustomers.jsp new file mode 100644 index 0000000000..47a3d40c90 --- /dev/null +++ b/posterita/posterita/web/jsp/customer/existingPOSCustomers.jsp @@ -0,0 +1,138 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.beans.*" %> +<%@ page import ="org.posterita.Constants" %> +<%@ page import="org.compiere.model.MOrg" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> + + + + +<%@ include file="/jsp/include/tabTop.jsp" %>Customers<%@ include file="/jsp/include/tabBottom.jsp" %> + + + + + + + + +
    + + <%@ include file="/jsp/include/errors.jsp" %> +
    + + + + + + + + + + + + + + + + <% + String styleClass = "label"; + if ((count.intValue()%2) != 0) + styleClass = "contentname"; + %> + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + Surname + + Name + + Customer ID No. + + Phone No. + + Cell No. + + AA Card No. + + Address + + City +   + +
    + + + + + + + + + + + + + + + +
    +
    + + + + <%@ include file="/jsp/include/footerTableBottom.jsp" %> + + diff --git a/posterita/posterita/web/jsp/customer/savePOSCustomer.jsp b/posterita/posterita/web/jsp/customer/savePOSCustomer.jsp new file mode 100644 index 0000000000..cc5d5b1104 --- /dev/null +++ b/posterita/posterita/web/jsp/customer/savePOSCustomer.jsp @@ -0,0 +1,50 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + + +<%@ page import="org.posterita.struts.customer.CustomerAction" %> +<%@ page import="org.compiere.model.MBPartner" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + +<%@ include file="/jsp/pos/customerDetails.jsp" %> + + + +<%@ include file="/jsp/include/posFooter.jsp" %> + + + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/error/error.jsp b/posterita/posterita/web/jsp/error/error.jsp new file mode 100644 index 0000000000..c9d0bf1d63 --- /dev/null +++ b/posterita/posterita/web/jsp/error/error.jsp @@ -0,0 +1,78 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Tamak +--%> + + +<%@ page import="org.apache.struts.Globals" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> + + + + + + + + + + + + + + +
    + + + <%@ include file="/jsp/include/tabTop.jsp" %><%@ include file="/jsp/include/tabBottom.jsp" %> + + + + + + +
    + + + + <%-- + Exception xception = (Exception) request.getAttribute(Globals.EXCEPTION_KEY); + out.println(xception.getMessage()); + + --%> + + <%-- + Exception xception = (Exception) request.getAttribute(Globals.EXCEPTION_KEY); + StackTraceElement[] stackTraceElem = xception.getStackTrace(); + + for(int i = 0;i + + +
    + + +<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/help/contactUs.jsp b/posterita/posterita/web/jsp/help/contactUs.jsp new file mode 100644 index 0000000000..b7937c3b04 --- /dev/null +++ b/posterita/posterita/web/jsp/help/contactUs.jsp @@ -0,0 +1,87 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.lib.UdiConstants" %> +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    : + +
    : +
    +
    + +   + +
    +
    + +<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/help/emailSuccess.jsp b/posterita/posterita/web/jsp/help/emailSuccess.jsp new file mode 100644 index 0000000000..191df241ee --- /dev/null +++ b/posterita/posterita/web/jsp/help/emailSuccess.jsp @@ -0,0 +1,44 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.lib.UdiConstants" %> +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> +Your query has been successfully sent to support@posterita.org +
    We will get back to you as soon as possible +
    Thank you +

    Posterita Support Team + +<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/inOut/minOutDetails.jsp b/posterita/posterita/web/jsp/inOut/minOutDetails.jsp new file mode 100644 index 0000000000..e29a9cf2c7 --- /dev/null +++ b/posterita/posterita/web/jsp/inOut/minOutDetails.jsp @@ -0,0 +1,153 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Vishee +--%> + + +<%@ page import="org.posterita.Constants" %> + + +
    + + + + + + +
    + + + + + +
    +
    + + + + +
    + Document Type: +
    +
    + <%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + Invoice Ref No: + + + + + +
    + Shipment Ref No: + + Counter Shipment Ref No: +
    + Doc Status: +
    +   +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Quantity
    + + + + + + + + + + + 1 +
    +
    + <%@ include file="/jsp/include/errors.jsp" %> + + + + + <%@ include file="/jsp/inOut/webStoreMinOutDetails.jsp" %> + + + + + +
    + + + + + + +
    + + + + + +
    +
    + + + + +
    + + + + + + + + + + + + + + + + +
    + + + +
    +
    +
    + +<%@ include file="/jsp/include/footerTableBottom.jsp" %> diff --git a/posterita/posterita/web/jsp/inOut/viewReceiptHistory.jsp b/posterita/posterita/web/jsp/inOut/viewReceiptHistory.jsp new file mode 100644 index 0000000000..51e35d8842 --- /dev/null +++ b/posterita/posterita/web/jsp/inOut/viewReceiptHistory.jsp @@ -0,0 +1,118 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Vishee +--%> + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.compiere.model.MOrg" %> +<%@ page import="org.posterita.struts.InOut.InOutAction" %> + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> + + + + + + <%@ include file="/jsp/include/tabTop.jsp" %><%@ include file="/jsp/include/tabBottom.jsp" %> + + + + + + + + + + + + +
    + +
    + + + + + <%@ include file="/jsp/include/filter.jsp"%> + + +
    +
    + + + + + + + + + + + + + <% + String styleClass = "label"; + if ((count.intValue()%2) != 0) + styleClass = "contentname"; + %> + + + + + + + + + + + + + + + + + +
    + + + + + + + <%-- --%> + + + + +
    +
    + + <%@ include file="/jsp/include/footerTableBottom.jsp" %> + + + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/inOut/viewShipmentHistory.jsp b/posterita/posterita/web/jsp/inOut/viewShipmentHistory.jsp new file mode 100644 index 0000000000..ada7055e6b --- /dev/null +++ b/posterita/posterita/web/jsp/inOut/viewShipmentHistory.jsp @@ -0,0 +1,118 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Vishee +--%> + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.compiere.model.MOrg" %> +<%@ page import="org.posterita.struts.InOut.InOutAction" %> + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> + + + + + + <%@ include file="/jsp/include/tabTop.jsp" %><%@ include file="/jsp/include/tabBottom.jsp" %> + + + + + + + + + + + + +
    + +
    + + + + + <%@ include file="/jsp/include/filter.jsp"%> + + +
    +
    + + + + + + + + + + + + + <% + String styleClass = "label"; + if ((count.intValue()%2) != 0) + styleClass = "contentname"; + %> + + + + + + + + + + + + + + + + + +
    + + + + + + + <%-- --%> + + + + +
    +
    + + <%@ include file="/jsp/include/footerTableBottom.jsp" %> + + + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/backBt.jsp b/posterita/posterita/web/jsp/include/backBt.jsp new file mode 100644 index 0000000000..6e6cab57d2 --- /dev/null +++ b/posterita/posterita/web/jsp/include/backBt.jsp @@ -0,0 +1,28 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Tamak +--%> + + +
    + +<%-- Go Back--%> + +
    \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/completePOSOrder.jsp b/posterita/posterita/web/jsp/include/completePOSOrder.jsp new file mode 100644 index 0000000000..2575d14638 --- /dev/null +++ b/posterita/posterita/web/jsp/include/completePOSOrder.jsp @@ -0,0 +1,115 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.compiere.model.MOrder" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.struts.pos.POSOrderAction" %> +<%@ page import="java.util.ArrayList" %> + + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + +<%@ include file="/jsp/pos/orderHeader.jsp" %> +<% String orderlines = Constants.POS_ORDER_LINES; %> +<%@ include file="/jsp/pos/completePOSShoppingCart.jsp" %> + +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + + + + + + + +
     
    + +
    + + +
    +<%@ include file="/jsp/include/printOrderApplet.jsp" %> +<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/completePOSOrderIncl.jsp b/posterita/posterita/web/jsp/include/completePOSOrderIncl.jsp new file mode 100644 index 0000000000..5c6ff6253a --- /dev/null +++ b/posterita/posterita/web/jsp/include/completePOSOrderIncl.jsp @@ -0,0 +1,115 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.compiere.model.MOrder" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.struts.pos.POSOrderAction" %> +<%@ page import="java.util.ArrayList" %> + + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + +<%@ include file="/jsp/pos/orderHeader.jsp" %> +<% String orderlines = Constants.POS_ORDER_LINES; %> +<%@ include file="/jsp/pos/completePOSShoppingCart.jsp" %> + +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + + + + + + + +
     
    + +
    + + +
    +<%@ include file="/jsp/include/printOrderApplet.jsp" %> +<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/creditOrderPart1FocusBarCode.jsp b/posterita/posterita/web/jsp/include/creditOrderPart1FocusBarCode.jsp new file mode 100644 index 0000000000..a8a728f5d8 --- /dev/null +++ b/posterita/posterita/web/jsp/include/creditOrderPart1FocusBarCode.jsp @@ -0,0 +1,121 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + + + +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/posterita/posterita/web/jsp/include/endCalendar.jsp b/posterita/posterita/web/jsp/include/endCalendar.jsp new file mode 100644 index 0000000000..f97c9feb9f --- /dev/null +++ b/posterita/posterita/web/jsp/include/endCalendar.jsp @@ -0,0 +1,121 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + +
    + + <%@ include file="/jsp/include/posOrderBarCode.jsp" %> + + <%@ include file="/jsp/include/posOrderSearch.jsp" %> +
    +
    +
    + <%@ include file="/jsp/pos/creditOrderShoppingCart.jsp" %> +
    +
    + + + + + + + + + + + + + + +
    +
    + +
    + + + + + + + + + +
    +
    +
    +
    + <%@ include file="/jsp/include/customerInfoPanel.jsp" %> + + + + + + + + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/creditOrderWithAdvanced.jsp b/posterita/posterita/web/jsp/include/creditOrderWithAdvanced.jsp new file mode 100644 index 0000000000..5cc0e0c83e --- /dev/null +++ b/posterita/posterita/web/jsp/include/creditOrderWithAdvanced.jsp @@ -0,0 +1,33 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> +<%@ include file="/jsp/include/creditOrderPart1FocusBarCode.jsp" %> + + + + + +<%@ include file="/jsp/include/posOrderPart2.jsp" %> + + + diff --git a/posterita/posterita/web/jsp/include/customerInfoPanel.jsp b/posterita/posterita/web/jsp/include/customerInfoPanel.jsp new file mode 100644 index 0000000000..1c91d2e943 --- /dev/null +++ b/posterita/posterita/web/jsp/include/customerInfoPanel.jsp @@ -0,0 +1,42 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> +
    + +
    +
    + +
    + +
    + +
    + + <%@ include file="/jsp/include/searchCustomerPanel.jsp" %> +
    + +
    + + +
    +
    diff --git a/posterita/posterita/web/jsp/include/customerInfoPanel2.jsp b/posterita/posterita/web/jsp/include/customerInfoPanel2.jsp new file mode 100644 index 0000000000..887aec0174 --- /dev/null +++ b/posterita/posterita/web/jsp/include/customerInfoPanel2.jsp @@ -0,0 +1,40 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + +
    +Customer Info +
    +
    + +
    + +
    + +
    + + <%@ include file="/jsp/include/searchCustomerPanel.jsp" %> +
    + +
    + +
    +
    diff --git a/posterita/posterita/web/jsp/include/dateFilter.jsp b/posterita/posterita/web/jsp/include/dateFilter.jsp new file mode 100644 index 0000000000..04ee1f067f --- /dev/null +++ b/posterita/posterita/web/jsp/include/dateFilter.jsp @@ -0,0 +1,34 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author vishee +--%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> +
    +   +
    +   +
    + + + + + + +
    + <%@ include file="/jsp/include/startCalendar.jsp" %> +
    + <%@ include file="/jsp/include/endCalendar.jsp" %> +
    \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/dayList.jsp b/posterita/posterita/web/jsp/include/dayList.jsp new file mode 100644 index 0000000000..e904b5ed18 --- /dev/null +++ b/posterita/posterita/web/jsp/include/dayList.jsp @@ -0,0 +1,54 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 diff --git a/posterita/posterita/web/jsp/include/documentStatusFilter.jsp b/posterita/posterita/web/jsp/include/documentStatusFilter.jsp new file mode 100644 index 0000000000..75ddb27da9 --- /dev/null +++ b/posterita/posterita/web/jsp/include/documentStatusFilter.jsp @@ -0,0 +1,29 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> +<%@ page import="org.compiere.process.DocAction" %> + + + + + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/draftedCreditOrder.jsp b/posterita/posterita/web/jsp/include/draftedCreditOrder.jsp new file mode 100644 index 0000000000..4e59f97668 --- /dev/null +++ b/posterita/posterita/web/jsp/include/draftedCreditOrder.jsp @@ -0,0 +1,82 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + + + + + +<%@ include file="/jsp/pos/orderHeader.jsp" %> + +
     
    + <% String orderlines = Constants.POS_ORDER_LINES; %> + <%@ include file="/jsp/pos/draftedPOSShoppingCart.jsp" %> + + > +
    +
    +
    +   +
    +
    +
    + +   + +   +
    +
    + + + + + + + +
    + + + + + + + +
    +
    +
    \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/draftedPOSOrder.jsp b/posterita/posterita/web/jsp/include/draftedPOSOrder.jsp new file mode 100644 index 0000000000..3699ff99de --- /dev/null +++ b/posterita/posterita/web/jsp/include/draftedPOSOrder.jsp @@ -0,0 +1,115 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + + + + + +<%@ include file="/jsp/pos/orderHeader.jsp" %> + +
     
    +
    + + + + + + + +
    + + + + + + + + +
    +
    +
    + <% String orderlines = Constants.POS_ORDER_LINES; %> + <%@ include file="/jsp/pos/draftedPOSShoppingCart.jsp" %> + + > +
    +
    + +
    +   +
    +
    +
    +
    + + + + +   + + + + + + +   +
    +
    + + + + + + + +
    + + + + + + + +
    +
    +
    + + + + + + + + + +
    + + + + <%@ include file="/jsp/include/dayList.jsp" %> + + + + <%@ include file="/jsp/include/monthList.jsp" %> + + + + <%@ include file="/jsp/include/yearList.jsp" %> + + + + + + + + <%@ include file="/jsp/include/hourList.jsp" %> + + + + <%@ include file="/jsp/include/minuteList.jsp" %> + + +
    + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/errorMsg.jsp b/posterita/posterita/web/jsp/include/errorMsg.jsp new file mode 100644 index 0000000000..244a0bc597 --- /dev/null +++ b/posterita/posterita/web/jsp/include/errorMsg.jsp @@ -0,0 +1,65 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author tamak +--%> +
    + + + + + + +
    +
    + +
    + +
    +
    +
    +
    +
    + ERROR! +
    +
    +
    + + + + + + + +
    +
    + +
    + +
    +
    +
    +
    +
    + ERROR! +
    +
    +
    +
    + diff --git a/posterita/posterita/web/jsp/include/errors.jsp b/posterita/posterita/web/jsp/include/errors.jsp new file mode 100644 index 0000000000..f3abb3ae91 --- /dev/null +++ b/posterita/posterita/web/jsp/include/errors.jsp @@ -0,0 +1,45 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author tamak +--%> +
    + +
    +
    + +
    + +
    +
    +
    +
    +
    + + +
    +
    + +
    +
    +
    +
    +
    +
    + diff --git a/posterita/posterita/web/jsp/include/filter.jsp b/posterita/posterita/web/jsp/include/filter.jsp new file mode 100644 index 0000000000..1708fa5495 --- /dev/null +++ b/posterita/posterita/web/jsp/include/filter.jsp @@ -0,0 +1,91 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> +
    + :   + + + + + + + + +
    +   + + + + <%@include file="/jsp/include/month.jsp"%> + + + + + <% + int currentYear = java.util.Calendar.getInstance().get(java.util.Calendar.YEAR); + %> + <%= currentYear %> + <%= currentYear - 1 %> + + + + + + + + + + + + + + + +
    +   +
    + + + + + + + + + + + + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/footerTableBottom1.jsp b/posterita/posterita/web/jsp/include/footerTableBottom1.jsp new file mode 100644 index 0000000000..e502929fe0 --- /dev/null +++ b/posterita/posterita/web/jsp/include/footerTableBottom1.jsp @@ -0,0 +1,77 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author tamak +--%> + + + +<%-- start tablebottom.jsp --%> + +   + + + + + +<%-- end tablebottom.jsp --%> + + + + + + + + + + + + + + + +<%-- start footer.jsp --%> + + + + + + + + + + + + + + + +
    +   + +
    + + + + + +<%-- end footer.jsp --%> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/historyMonthYearFilter.jsp b/posterita/posterita/web/jsp/include/historyMonthYearFilter.jsp new file mode 100644 index 0000000000..1bb10bf671 --- /dev/null +++ b/posterita/posterita/web/jsp/include/historyMonthYearFilter.jsp @@ -0,0 +1,41 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + <%@include file="/jsp/include/month.jsp"%> + + + + + + + <% + int currentYear = java.util.Calendar.getInstance().get(java.util.Calendar.YEAR); + %> + <%= currentYear %> + <%= currentYear - 1 %> + + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/historyfilter.jsp b/posterita/posterita/web/jsp/include/historyfilter.jsp new file mode 100644 index 0000000000..2173b2a87e --- /dev/null +++ b/posterita/posterita/web/jsp/include/historyfilter.jsp @@ -0,0 +1,62 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + + + + + + + + + + + +
    + :   + + + + +
    +   + + + + <%@include file="/jsp/include/month.jsp"%> + + + + + <% + int currentYear = java.util.Calendar.getInstance().get(java.util.Calendar.YEAR); + %> + <%= currentYear %> + <%= currentYear - 1 %> + +
    \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/hourList.jsp b/posterita/posterita/web/jsp/include/hourList.jsp new file mode 100644 index 0000000000..bf722aef1d --- /dev/null +++ b/posterita/posterita/web/jsp/include/hourList.jsp @@ -0,0 +1,47 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + + 00 + 01 + 02 + 03 + 04 + 05 + 06 + 07 + 08 + 09 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/minuteList.jsp b/posterita/posterita/web/jsp/include/minuteList.jsp new file mode 100644 index 0000000000..b275b57463 --- /dev/null +++ b/posterita/posterita/web/jsp/include/minuteList.jsp @@ -0,0 +1,82 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + + 00 + 01 + 02 + 03 + 04 + 05 + 06 + 07 + 08 + 09 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + 33 + 34 + 35 + 36 + 37 + 38 + 39 + 40 + 41 + 42 + 43 + 44 + 45 + 46 + 47 + 48 + 49 + 50 + 51 + 52 + 53 + 54 + 55 + 56 + 57 + 58 + 59 \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/month.jsp b/posterita/posterita/web/jsp/include/month.jsp new file mode 100644 index 0000000000..ab3bb9c990 --- /dev/null +++ b/posterita/posterita/web/jsp/include/month.jsp @@ -0,0 +1,34 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + + + + + + + + + + + + + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/monthList.jsp b/posterita/posterita/web/jsp/include/monthList.jsp new file mode 100644 index 0000000000..f4f1b28c35 --- /dev/null +++ b/posterita/posterita/web/jsp/include/monthList.jsp @@ -0,0 +1,23 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + +<%@ include file="/jsp/include/month.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/pager.jsp b/posterita/posterita/web/jsp/include/pager.jsp new file mode 100644 index 0000000000..7e5cb59cd5 --- /dev/null +++ b/posterita/posterita/web/jsp/include/pager.jsp @@ -0,0 +1,142 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + +<%@ page import="org.posterita.core.businesslogic.ElementManager" %> +<%@ page import="org.posterita.core.bean.ElementBean" %> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + +<% +int firstOffset = 0; +int lastOffset = 0; +int currentOffset = Integer.parseInt(offset); +int previousOffset = currentOffset - Integer.parseInt(length); +int nextOffset = currentOffset + Integer.parseInt(length); + +boolean isFirst = (currentOffset == 0); +boolean isLast = ((currentOffset + Integer.parseInt(length)) >= recordSize.intValue()); + +ElementBean elementBean = null; + +if(url.indexOf("?") != -1) +{ + url = url + "&"; +} +else +{ + url = url + "?"; +} +%> +
    +
    + + + + + +
    +<% +if(!isFirst){ + out.print("
    "); + out.print(ElementManager.getMsg(ctx, "prev").getName()); + out.print(""); +} +int len = Integer.parseInt(length); + +lastOffset = recordSize.intValue() - (recordSize.intValue() % len); +int b = currentOffset/len + 1; +int d = lastOffset/len; + +if((recordSize.intValue() % len) != 0) +{ + d = d + 1; +} + +b = (b < 1) ? 1 : b; + +int a = b - 2; +int c = b + 2; + +a = (a < 1) ? 1 : a; +c = (c < d) ? c : d; + + + +if(Integer.parseInt(length) != recordSize.intValue()) +{ + if(recordSize.intValue() > len) + { + + for(int i= a ; i < b ; i++) + { + out.print("" + i + " "); + } + + out.print(b + " "); + + for(int j= b+1 ; j < c+1 ; j++) + { + out.print("" + j + " "); + } + } + + out.print("
    "); + + if(recordSize.intValue() > len){ + out.print(""); + } + + + if(!isLast){ + out.print(""); + } + + +} +else +{ + out.print(""); + out.print(ElementManager.getMsg(ctx, "switch.to.paging").getName()); + out.print(""); +} + +%> + +
    +
    + diff --git a/posterita/posterita/web/jsp/include/paymentRuleFilter.jsp b/posterita/posterita/web/jsp/include/paymentRuleFilter.jsp new file mode 100644 index 0000000000..d87b5efa0a --- /dev/null +++ b/posterita/posterita/web/jsp/include/paymentRuleFilter.jsp @@ -0,0 +1,29 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + +<%@ page import="org.compiere.model.MOrder" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/paymentTermsDetails.jsp b/posterita/posterita/web/jsp/include/paymentTermsDetails.jsp new file mode 100644 index 0000000000..73c7fb3038 --- /dev/null +++ b/posterita/posterita/web/jsp/include/paymentTermsDetails.jsp @@ -0,0 +1,135 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + + + * + + + + + + + + + + + + * + + + + + + + + + + + + + + + + + + * + + + + + + + + + * + + + + + + + + * + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/pinPanel.jsp b/posterita/posterita/web/jsp/include/pinPanel.jsp new file mode 100644 index 0000000000..82bac39197 --- /dev/null +++ b/posterita/posterita/web/jsp/include/pinPanel.jsp @@ -0,0 +1,49 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> +
    +
    + + + + + + + + + + +
    + +
    +
    + +
    +
    +
    + + +
    +
    +
    +
    diff --git a/posterita/posterita/web/jsp/include/posFooter.jsp b/posterita/posterita/web/jsp/include/posFooter.jsp new file mode 100644 index 0000000000..fd418278bb --- /dev/null +++ b/posterita/posterita/web/jsp/include/posFooter.jsp @@ -0,0 +1,66 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + +
    + + + +
    + + + +
    +
    + + + diff --git a/posterita/posterita/web/jsp/include/posHeader.jsp b/posterita/posterita/web/jsp/include/posHeader.jsp new file mode 100644 index 0000000000..91e96b77ff --- /dev/null +++ b/posterita/posterita/web/jsp/include/posHeader.jsp @@ -0,0 +1,255 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.compiere.model.MOrg" %> +<%@ page import="org.compiere.model.MRole" %> +<%@ page import="java.util.Properties" %> +<%@ page import="org.posterita.core.TmkJSPEnv" %> +<%@ page import="org.compiere.util.Env" %> +<%@ page import="org.posterita.lib.UdiConstants" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@page import="org.posterita.businesslogic.POSTerminalManager"%> +<%@ page import="org.posterita.lib.UdiConstants" %> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> + + + + + + + + + + + + + + + + + + + + +<% +response.setHeader("Cache-Control","no-cache"); //HTTP 1.1 +response.setHeader("Cache-Control","no-store"); //HTTP 1.1 +response.setHeader("Pragma","no-cache"); //HTTP 1.0 +response.setDateHeader ("Expires", 0); //prevents caching at the proxy server + +String path = request.getContextPath(); +String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; +Properties ctx = TmkJSPEnv.getCtx(request); +String posName = POSTerminalManager.getTerminalName(ctx); +String orgName = MOrg.get(ctx, Env.getContextAsInt(ctx, UdiConstants.ORG_ID_CTX_PARAM)).getName(); +String roleName = MRole.get(ctx, Env.getContextAsInt(ctx, UdiConstants.AD_ROLE_ID)).getName(); +Integer userId = new Integer(Env.getAD_User_ID(ctx)); +String version = UdiConstants.POS_VERSION; +String appName = (String) request.getSession().getAttribute(Constants.APP_NAME); +boolean isTerminalLocked = POSTerminalManager.isTerminalLocked(ctx); + +if (isTerminalLocked) +{ + posName += " (Locked)"; +} +%> + +<%-- + + + +--%> + + + + + <% + if (displayCookie != null && displayCookie.getValue() != null) + { + displayPageSize = displayCookie.getValue().toString(); + } + %> + +<% + Integer pageSize = new Integer(displayPageSize); +%> + + +<%@page import="org.posterita.struts.login.GoToHomePageAction"%> +<%@page import="org.compiere.model.MStore"%> +<%@page import="org.posterita.businesslogic.StoreManager"%> + + + + + <%=appName%> + + + + + + + + + + + + + + + + + + +
    + +
    + + + + + +
    +
    +
    + +
    + +
    +
    +
    + : + <%=orgName%> +
    +
    + : + <%=posName%> +
    +
    +
    +
    + : + +
    +
    + : + <%=roleName%> +
    +
    +
    +
    +
    +
    +
    +
    + + + + + "> + + +
    +
    +
    +
    + + + + +
    + + + +
    +
    + + + + + +
    \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/posHeader2.jsp b/posterita/posterita/web/jsp/include/posHeader2.jsp new file mode 100644 index 0000000000..57d1c059be --- /dev/null +++ b/posterita/posterita/web/jsp/include/posHeader2.jsp @@ -0,0 +1,255 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.compiere.model.MOrg" %> +<%@ page import="org.compiere.model.MRole" %> +<%@ page import="java.util.Properties" %> +<%@ page import="org.posterita.core.TmkJSPEnv" %> +<%@ page import="org.compiere.util.Env" %> +<%@ page import="org.posterita.lib.UdiConstants" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@page import="org.posterita.businesslogic.POSTerminalManager"%> +<%@ page import="org.posterita.lib.UdiConstants" %> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> + + + + + + + + + + + + + + + + + + + + +<% +response.setHeader("Cache-Control","no-cache"); //HTTP 1.1 +response.setHeader("Cache-Control","no-store"); //HTTP 1.1 +response.setHeader("Pragma","no-cache"); //HTTP 1.0 +response.setDateHeader ("Expires", 0); //prevents caching at the proxy server + +String path = request.getContextPath(); +String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; +Properties ctx = TmkJSPEnv.getCtx(request); +String posName = POSTerminalManager.getTerminalName(ctx); +String orgName = MOrg.get(ctx, Env.getContextAsInt(ctx, UdiConstants.ORG_ID_CTX_PARAM)).getName(); +String roleName = MRole.get(ctx, Env.getContextAsInt(ctx, UdiConstants.AD_ROLE_ID)).getName(); +Integer userId = new Integer(Env.getAD_User_ID(ctx)); +String version = UdiConstants.POS_VERSION; +String appName = (String) request.getSession().getAttribute(Constants.APP_NAME); +boolean isTerminalLocked = POSTerminalManager.isTerminalLocked(ctx); + +if (isTerminalLocked) +{ + posName += " (Locked)"; +} +%> + +<%-- + + + +--%> + + + + + <% + if (displayCookie != null && displayCookie.getValue() != null) + { + displayPageSize = displayCookie.getValue().toString(); + } + %> + +<% + Integer pageSize = new Integer(displayPageSize); +%> + + +<%@page import="org.posterita.struts.login.GoToHomePageAction"%> +<%@page import="org.compiere.model.MStore"%> +<%@page import="org.posterita.businesslogic.StoreManager"%> + + + + + <%=appName%> + + + + + + + + + + + + + + + + + + +
    + + + + + +
    +
    + + + + + +
    \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/posHeaderAdministration.jsp b/posterita/posterita/web/jsp/include/posHeaderAdministration.jsp new file mode 100644 index 0000000000..00861d8ef5 --- /dev/null +++ b/posterita/posterita/web/jsp/include/posHeaderAdministration.jsp @@ -0,0 +1,278 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.compiere.model.MOrg" %> +<%@ page import="org.compiere.model.MRole" %> +<%@ page import="java.util.Properties" %> +<%@ page import="org.posterita.core.TmkJSPEnv" %> +<%@ page import="org.compiere.util.Env" %> +<%@ page import="org.posterita.lib.UdiConstants" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@page import="org.posterita.businesslogic.POSTerminalManager"%> +<%@ page import="org.posterita.lib.UdiConstants" %> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> + + + + + + + + + + + + + + + + + + + + +<% +response.setHeader("Cache-Control","no-cache"); //HTTP 1.1 +response.setHeader("Cache-Control","no-store"); //HTTP 1.1 +response.setHeader("Pragma","no-cache"); //HTTP 1.0 +response.setDateHeader ("Expires", 0); //prevents caching at the proxy server + +String path = request.getContextPath(); +String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; +Properties ctx = TmkJSPEnv.getCtx(request); +String posName = POSTerminalManager.getTerminalName(ctx); +String orgName = MOrg.get(ctx, Env.getContextAsInt(ctx, UdiConstants.ORG_ID_CTX_PARAM)).getName(); +String roleName = MRole.get(ctx, Env.getContextAsInt(ctx, UdiConstants.AD_ROLE_ID)).getName(); +Integer userId = new Integer(Env.getAD_User_ID(ctx)); +String version = UdiConstants.POS_VERSION; +String appName = (String) request.getSession().getAttribute(Constants.APP_NAME); +boolean isTerminalLocked = POSTerminalManager.isTerminalLocked(ctx); + +if (isTerminalLocked) +{ + posName += " (Locked)"; +} +%> + +<%-- + + + +--%> + + + + + <% + if (displayCookie != null && displayCookie.getValue() != null) + { + displayPageSize = displayCookie.getValue().toString(); + } + %> + +<% + Integer pageSize = new Integer(displayPageSize); +%> + + +<%@page import="org.posterita.struts.login.GoToHomePageAction"%> +<%@page import="org.compiere.model.MStore"%> +<%@page import="org.posterita.businesslogic.StoreManager"%> + + + + + <%=appName%> + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + + + +
    +
    +
    + +
    + +
    +
    +
    + + + + + "> + + +
    +
    +
    +
    + : + <%=orgName%> +
    +
    + : + <%=posName%> +
    +
    +
    +
    + : + +
    +
    + : + <%=roleName%> +
    +
    +
    +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + + + +
    + + + +
    + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/posHistoryFilter.jsp b/posterita/posterita/web/jsp/include/posHistoryFilter.jsp new file mode 100644 index 0000000000..8b60e5c20d --- /dev/null +++ b/posterita/posterita/web/jsp/include/posHistoryFilter.jsp @@ -0,0 +1,92 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + +<%@ page import="org.posterita.Constants" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +   + + + + + + <%@include file="/jsp/include/documentStatusFilter.jsp"%> + + + + <%@ include file="/jsp/include/historyMonthYearFilter.jsp"%> + + + + + + + + + + + + + + + + + + <%@include file="/jsp/include/paymentRuleFilter.jsp"%> + + + + + + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/posHistoryFilter2.jsp b/posterita/posterita/web/jsp/include/posHistoryFilter2.jsp new file mode 100644 index 0000000000..af6feccf5e --- /dev/null +++ b/posterita/posterita/web/jsp/include/posHistoryFilter2.jsp @@ -0,0 +1,75 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + +<%@ page import="org.posterita.Constants" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + + + + + + + + + + + + + + + + + + + + + + +   + + + + + + <%@include file="/jsp/include/documentStatusFilter.jsp"%> + + + + <%@ include file="/jsp/include/historyMonthYearFilter.jsp"%> + + + + + + + <%@include file="/jsp/include/paymentRuleFilter.jsp"%> + + + + + + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/posOrder.jsp b/posterita/posterita/web/jsp/include/posOrder.jsp new file mode 100644 index 0000000000..f1f8103c13 --- /dev/null +++ b/posterita/posterita/web/jsp/include/posOrder.jsp @@ -0,0 +1,27 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Vishee +--%> +<%@ include file="/jsp/include/posOrderPart1FocusBarCode.jsp" %> + +<%@ include file="/jsp/include/posOrderPart2.jsp" %> + + + diff --git a/posterita/posterita/web/jsp/include/posOrderBarCode.jsp b/posterita/posterita/web/jsp/include/posOrderBarCode.jsp new file mode 100644 index 0000000000..49e69c8584 --- /dev/null +++ b/posterita/posterita/web/jsp/include/posOrderBarCode.jsp @@ -0,0 +1,43 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Vishee +--%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + + + + + + + + + + + + <%-- +   + + --%> + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/posOrderFocusBarCode.jsp b/posterita/posterita/web/jsp/include/posOrderFocusBarCode.jsp new file mode 100644 index 0000000000..6a61f1d2d4 --- /dev/null +++ b/posterita/posterita/web/jsp/include/posOrderFocusBarCode.jsp @@ -0,0 +1,29 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Vishee +--%> + + +<%@ include file="/jsp/include/posOrderPart1.jsp" %> + +<%@ include file="/jsp/include/posOrderPart2.jsp" %> + + + diff --git a/posterita/posterita/web/jsp/include/posOrderFocusSearch.jsp b/posterita/posterita/web/jsp/include/posOrderFocusSearch.jsp new file mode 100644 index 0000000000..6a61f1d2d4 --- /dev/null +++ b/posterita/posterita/web/jsp/include/posOrderFocusSearch.jsp @@ -0,0 +1,29 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Vishee +--%> + + +<%@ include file="/jsp/include/posOrderPart1.jsp" %> + +<%@ include file="/jsp/include/posOrderPart2.jsp" %> + + + diff --git a/posterita/posterita/web/jsp/include/posOrderPart1.jsp b/posterita/posterita/web/jsp/include/posOrderPart1.jsp new file mode 100644 index 0000000000..d4469468d9 --- /dev/null +++ b/posterita/posterita/web/jsp/include/posOrderPart1.jsp @@ -0,0 +1,101 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Vishee +--%> + +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + + + + + + + + + + + + + + + + + + + + <%@ include file="/jsp/include/tablebottom.jsp" %> + + + +
    + + + + + + + + + + + + + + + + + +
    + + + + + + + + + +   +
    + + +
    + <%@ include file="/jsp/include/searchProductPanel.jsp" %> +
    +
     
    +
    +
    + <%@ include file="/jsp/pos/posShoppingCartFirstPage.jsp" %> +
    +
    + + + + + + +<%@ include file="/jsp/include/footer.jsp" %> + + + + + + + + + + + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/login/forgot.jsp b/posterita/posterita/web/jsp/login/forgot.jsp new file mode 100644 index 0000000000..9f44eb94c5 --- /dev/null +++ b/posterita/posterita/web/jsp/login/forgot.jsp @@ -0,0 +1,103 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Vishee +--%> + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ page import="org.posterita.Constants" %> + + + + +Welcome to Posterita + + + + + + +
    + <%@ include file="/jsp/include/tenderPanel.jsp" %> + + <%@ include file="/jsp/include/customerInfoPanel.jsp" %> + + + + + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/posOrderPart1FocusBarCode.jsp b/posterita/posterita/web/jsp/include/posOrderPart1FocusBarCode.jsp new file mode 100644 index 0000000000..c0177aaceb --- /dev/null +++ b/posterita/posterita/web/jsp/include/posOrderPart1FocusBarCode.jsp @@ -0,0 +1,70 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Vishee +--%> + + + + + + + + + + + + + +
    +   +
    + + + + + + + + + + + +<%@ include file="/jsp/include/footer.jsp" %> + + + + + + + + + + + + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/login/chooseUser.jsp b/posterita/posterita/web/jsp/login/chooseUser.jsp new file mode 100644 index 0000000000..ecfaf15005 --- /dev/null +++ b/posterita/posterita/web/jsp/login/chooseUser.jsp @@ -0,0 +1,119 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.beans.OrgUsersBean"%> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> + + + + + + + + + +<%@ include file="/jsp/include/tablebottom.jsp" %> + + + +
    + + <%@ include file="/jsp/include/posOrderBarCode.jsp" %> + + <%@ include file="/jsp/include/posOrderSearch.jsp" %> +
    +
    +
    + <%@ include file="/jsp/pos/posShoppingCartFirstPage.jsp" %> +
    +
    + + + + + + + + + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/posOrderWithAdvanced.jsp b/posterita/posterita/web/jsp/include/posOrderWithAdvanced.jsp new file mode 100644 index 0000000000..43b61a5dc7 --- /dev/null +++ b/posterita/posterita/web/jsp/include/posOrderWithAdvanced.jsp @@ -0,0 +1,97 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Vishee +--%> + +<%--<%@ include file="/jsp/include/posOrderPart1FocusBarCode.jsp"%>--%> + + + + + + + + + + + + +
    + <%@ include file="/jsp/include/tenderPanel.jsp" %> + + <%@ include file="/jsp/include/customerInfoPanel.jsp" %> + + + + + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/posOrderPart1FocusSearch.jsp b/posterita/posterita/web/jsp/include/posOrderPart1FocusSearch.jsp new file mode 100644 index 0000000000..271910ce5e --- /dev/null +++ b/posterita/posterita/web/jsp/include/posOrderPart1FocusSearch.jsp @@ -0,0 +1,61 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Vishee +--%> + + + + +
    +   +
    + + + + + + + + + + + + + + + + + + +
    + + <%@ include file="/jsp/include/posOrderSearch.jsp" %> + + <%@ include file="/jsp/include/posOrderBarCode.jsp" %> +
    +
    +
    + <%@ include file="/jsp/pos/posShoppingCartFirstPage.jsp" %> +
    +
    + + + + + + +
    + <%@ include file="/jsp/include/tenderPanel.jsp" %> + + <%@ include file="/jsp/include/customerInfoPanel.jsp" %> + + + + + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/posOrderPart2.jsp b/posterita/posterita/web/jsp/include/posOrderPart2.jsp new file mode 100644 index 0000000000..8ea0225c14 --- /dev/null +++ b/posterita/posterita/web/jsp/include/posOrderPart2.jsp @@ -0,0 +1,85 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Vishee +--%> + +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + +
    +   +
    +
    +
     
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    diff --git a/posterita/posterita/web/jsp/include/posOrderSearch.jsp b/posterita/posterita/web/jsp/include/posOrderSearch.jsp new file mode 100644 index 0000000000..54e2ed7da8 --- /dev/null +++ b/posterita/posterita/web/jsp/include/posOrderSearch.jsp @@ -0,0 +1,35 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Preveen +--%> + +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + +
    + + +
    + <%@ include file="/jsp/include/searchProductPanel.jsp" %> +
    +
     
    + + + + + <%@ include file="/jsp/include/tablebottom.jsp" %> + + + +
    + + + + + + + + +
    + + <%@ include file="/jsp/include/posOrderBarCode.jsp" %> + + <%@ include file="/jsp/include/posOrderSearch.jsp" %> +
    +
    +
    + <%@ include file="/jsp/pos/posShoppingCartFirstPage.jsp" %> +
    +
    +
    + + + + + + + + + + + + + + + + + +
    + <%@ include file="/jsp/include/customerInfoPanel.jsp" %> +
    + <%@ include file="/jsp/include/tenderPanel.jsp" %> +
    + + + + + + + + +<%-- + + + +--%> +<%@ include file="/jsp/include/posOrderPart2.jsp"%> + + + diff --git a/posterita/posterita/web/jsp/include/posOrderWithAdvancedFocusSearch.jsp b/posterita/posterita/web/jsp/include/posOrderWithAdvancedFocusSearch.jsp new file mode 100644 index 0000000000..70ef35d89a --- /dev/null +++ b/posterita/posterita/web/jsp/include/posOrderWithAdvancedFocusSearch.jsp @@ -0,0 +1,39 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Vishee +--%> + +<%@ include file="/jsp/include/posOrderPart1FocusSearch.jsp" %> + + + + + + + + +<%@ include file="/jsp/include/posOrderPart2.jsp" %> + + + diff --git a/posterita/posterita/web/jsp/include/posPaymentDetails.jsp b/posterita/posterita/web/jsp/include/posPaymentDetails.jsp new file mode 100644 index 0000000000..25f8e8fa42 --- /dev/null +++ b/posterita/posterita/web/jsp/include/posPaymentDetails.jsp @@ -0,0 +1,307 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> +<%@ page import="org.posterita.form.OrderLineForm" %> +<%@ page import="org.posterita.form.OrderLineForm" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> +<%@ page import="java.text.DecimalFormat" %> + +
    +   +
    + <%@ include file="/jsp/include/pinPanel.jsp"%> +
    +   +
    + <%@ include file="/jsp/include/pinPanel.jsp" %> +
    +   +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + <% + String styleClass = "label"; + if ((count.intValue()%2) != 0) + styleClass = "contentname"; + %> + + + + + + + + + + + + <% + String defaultDiscount = "0"; + String defaultPrice = element.getPrice().toString(); + + OrderLineForm form = (OrderLineForm)request.getAttribute("OrderLineForm"); + + if(form!=null) + { + String[] discountPercentage = form.getDiscountPercent(); + String[] actualPrice = form.getActualPrice(); + + if(discountPercentage!= null) + if(discountPercentage.length!=0) + defaultDiscount = discountPercentage[count.intValue()].toString(); + + if(actualPrice!=null) + if(actualPrice.length!=0) + defaultPrice = actualPrice[count.intValue()]; + + } + %> + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + + + +
    + + + + + + + + + + + + + + + + "/> + + + + + +
    + + + + + + + +   + +
    + +
    +
     
    +
    +
    +
     
    + + + + + + + + + + +
    + +   + + + +   + + + +   + + + +   + +
    +
     
    + + + + + +
    + + + + +
    + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
     
    + "> + + +
    + +   + +
     
    + + + + + + + + +
    + + + + + + + + + +
    +
    \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/posPaymentDetails2.jsp b/posterita/posterita/web/jsp/include/posPaymentDetails2.jsp new file mode 100644 index 0000000000..bbb373f776 --- /dev/null +++ b/posterita/posterita/web/jsp/include/posPaymentDetails2.jsp @@ -0,0 +1,307 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> +<%@ page import="org.posterita.form.OrderLineForm" %> +<%@ page import="java.text.DecimalFormat" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + <% + String styleClass = "label"; + if ((count.intValue()%2) != 0) + styleClass = "contentname"; + %> + + + + + + + + + + + + <% + String defaultDiscount = "0"; + String defaultPrice = element.getPrice().toString(); + DecimalFormat df = new DecimalFormat("0.00"); + + OrderLineForm form = (OrderLineForm)request.getAttribute("OrderLineForm"); + + if(form!=null) + { + String[] discountPercentage = form.getDiscountPercent(); + String[] actualPrice = form.getActualPrice(); + + if(discountPercentage!= null) + if(discountPercentage.length!=0) + defaultDiscount = discountPercentage[count.intValue()].toString(); + + if(actualPrice!=null) + if(actualPrice.length!=0) + defaultPrice = actualPrice[count.intValue()]; + + } + %> + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + + + +
    + + + + + + + + + + + + + + + + "/> + + + + + +
    + + + + + + + +   + +
    + +
    +
     
    +
    +
    +
     
    + + + + + + + + + + +
    + +   + + + +   + + + +   + + + +   + +
    +
     
    + + + + + +
    + + + + +
    + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
     
    + "> + + +
    + +   + +
     
    + + + + + + + + +
    + + + + + + + + + +
    +
    \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/printOrderApplet.jsp b/posterita/posterita/web/jsp/include/printOrderApplet.jsp new file mode 100644 index 0000000000..58d15a10a6 --- /dev/null +++ b/posterita/posterita/web/jsp/include/printOrderApplet.jsp @@ -0,0 +1,45 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> + + +
    + " code="org.posterita.core.PrintOrderApplet.class" width="0" height="0"> +
    + +
    +
    diff --git a/posterita/posterita/web/jsp/include/printOrderApplet2.jsp b/posterita/posterita/web/jsp/include/printOrderApplet2.jsp new file mode 100644 index 0000000000..cbc67db52d --- /dev/null +++ b/posterita/posterita/web/jsp/include/printOrderApplet2.jsp @@ -0,0 +1,77 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> + + + +
    + " code="org.posterita.core.PrintOrderApplet.class" width="0" height="0"> +
    + +
    +
    + + + + + + + + + + diff --git a/posterita/posterita/web/jsp/include/searchCustomerPanel.jsp b/posterita/posterita/web/jsp/include/searchCustomerPanel.jsp new file mode 100644 index 0000000000..7bf12ce13c --- /dev/null +++ b/posterita/posterita/web/jsp/include/searchCustomerPanel.jsp @@ -0,0 +1,25 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + + +
    + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/searchCustomerPanel2.jsp b/posterita/posterita/web/jsp/include/searchCustomerPanel2.jsp new file mode 100644 index 0000000000..10118c73ca --- /dev/null +++ b/posterita/posterita/web/jsp/include/searchCustomerPanel2.jsp @@ -0,0 +1,26 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + + + +
    + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/searchProductPanel.jsp b/posterita/posterita/web/jsp/include/searchProductPanel.jsp new file mode 100644 index 0000000000..e93c7d5246 --- /dev/null +++ b/posterita/posterita/web/jsp/include/searchProductPanel.jsp @@ -0,0 +1,89 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + + +<% + String minChars = "1"; +%> + + + + + <% + if (minCharsCookie.getValue() != null || !minCharsCookie.getValue().equals("")) + minChars = minCharsCookie.getValue(); + %> + + + + + + + +
    + + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/searchProductPanel2.jsp b/posterita/posterita/web/jsp/include/searchProductPanel2.jsp new file mode 100644 index 0000000000..ed37034acc --- /dev/null +++ b/posterita/posterita/web/jsp/include/searchProductPanel2.jsp @@ -0,0 +1,65 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + + +<% + String minChars = "1"; +%> + + + + + <% + if (minCharsCookie.getValue() != null || !minCharsCookie.getValue().equals("")) + minChars = minCharsCookie.getValue(); + %> + + + + +
    + + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/searchProductPanel3.jsp b/posterita/posterita/web/jsp/include/searchProductPanel3.jsp new file mode 100644 index 0000000000..fadf0d66c5 --- /dev/null +++ b/posterita/posterita/web/jsp/include/searchProductPanel3.jsp @@ -0,0 +1,89 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Sendy +--%> + +<%@page import="org.posterita.Constants"%> +<% + String minChars = "1"; +%> + + + + + <% + if (minCharsCookie.getValue() != null || !minCharsCookie.getValue().equals("")) + minChars = minCharsCookie.getValue(); + %> + + + + + + + +
    + + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/searchVendorPanel.jsp b/posterita/posterita/web/jsp/include/searchVendorPanel.jsp new file mode 100644 index 0000000000..2ca0b561c7 --- /dev/null +++ b/posterita/posterita/web/jsp/include/searchVendorPanel.jsp @@ -0,0 +1,46 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + + + + +
    + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/searchVendorPanel2.jsp b/posterita/posterita/web/jsp/include/searchVendorPanel2.jsp new file mode 100644 index 0000000000..e90289b7e7 --- /dev/null +++ b/posterita/posterita/web/jsp/include/searchVendorPanel2.jsp @@ -0,0 +1,20 @@ + +
    + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/showErrors.jsp b/posterita/posterita/web/jsp/include/showErrors.jsp new file mode 100644 index 0000000000..fa72d6c051 --- /dev/null +++ b/posterita/posterita/web/jsp/include/showErrors.jsp @@ -0,0 +1,34 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author tamak +--%> + + + + + diff --git a/posterita/posterita/web/jsp/include/startCalendar.jsp b/posterita/posterita/web/jsp/include/startCalendar.jsp new file mode 100644 index 0000000000..1ba7baef55 --- /dev/null +++ b/posterita/posterita/web/jsp/include/startCalendar.jsp @@ -0,0 +1,66 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + + + + + + + + + + + + +
    + + + + <%@ include file="/jsp/include/dayList.jsp" %> + + + + <%@ include file="/jsp/include/monthList.jsp" %> + + + + <%@ include file="/jsp/include/yearList.jsp" %> + + + + + + + + <%@ include file="/jsp/include/hourList.jsp" %> + + + + <%@ include file="/jsp/include/minuteList.jsp" %> + + +
    + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/success.jsp b/posterita/posterita/web/jsp/include/success.jsp new file mode 100644 index 0000000000..8b4a4df7cf --- /dev/null +++ b/posterita/posterita/web/jsp/include/success.jsp @@ -0,0 +1,34 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Servansingh +--%> +
    + +
    + +
    + +
    +
    +
    +
    +
    +
    + diff --git a/posterita/posterita/web/jsp/include/tabBottom.jsp b/posterita/posterita/web/jsp/include/tabBottom.jsp new file mode 100644 index 0000000000..8842fd4508 --- /dev/null +++ b/posterita/posterita/web/jsp/include/tabBottom.jsp @@ -0,0 +1,24 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author tamak +--%> + + + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/tabTop.jsp b/posterita/posterita/web/jsp/include/tabTop.jsp new file mode 100644 index 0000000000..ba2f13906b --- /dev/null +++ b/posterita/posterita/web/jsp/include/tabTop.jsp @@ -0,0 +1,25 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author vishee +--%> + + +
    + diff --git a/posterita/posterita/web/jsp/include/tabTop_big.jsp b/posterita/posterita/web/jsp/include/tabTop_big.jsp new file mode 100644 index 0000000000..89f05a0c11 --- /dev/null +++ b/posterita/posterita/web/jsp/include/tabTop_big.jsp @@ -0,0 +1,27 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author vishee +--%> + + + + + + + + + + + + + + + + +
      \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/tablebottom.jsp b/posterita/posterita/web/jsp/include/tablebottom.jsp new file mode 100644 index 0000000000..6f5a7955c2 --- /dev/null +++ b/posterita/posterita/web/jsp/include/tablebottom.jsp @@ -0,0 +1,37 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author vishee +--%> + + + +  
         
    + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/taxDetails.jsp b/posterita/posterita/web/jsp/include/taxDetails.jsp new file mode 100644 index 0000000000..a1a1752c70 --- /dev/null +++ b/posterita/posterita/web/jsp/include/taxDetails.jsp @@ -0,0 +1,84 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + +<%@ page import="org.posterita.Constants" %> + +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + * + + +
    + * + + +
    + + + +
    + + + +
    + * + + + + +
      + +   + +  
    diff --git a/posterita/posterita/web/jsp/include/tenderPanel.jsp b/posterita/posterita/web/jsp/include/tenderPanel.jsp new file mode 100644 index 0000000000..4fd5f3472d --- /dev/null +++ b/posterita/posterita/web/jsp/include/tenderPanel.jsp @@ -0,0 +1,126 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + + +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> +
    + +
    + + + + + + + +
    + + + + + + + + +
    +   + +   + +   +
    +
    + + + + + + + + + + + + + + + + + + + + +
     
    +
    +
    +
    + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/tenderPanel2.jsp b/posterita/posterita/web/jsp/include/tenderPanel2.jsp new file mode 100644 index 0000000000..6aa589c32b --- /dev/null +++ b/posterita/posterita/web/jsp/include/tenderPanel2.jsp @@ -0,0 +1,116 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + + + +
    + Tender +
    + + + + + + + +
    + + + + + + +
    +   + +   +
    +
    + + + + + + + + + + + + + + +
    +
    +
    +
    + diff --git a/posterita/posterita/web/jsp/include/vendorInfoPanel.jsp b/posterita/posterita/web/jsp/include/vendorInfoPanel.jsp new file mode 100644 index 0000000000..cad6ceb7d1 --- /dev/null +++ b/posterita/posterita/web/jsp/include/vendorInfoPanel.jsp @@ -0,0 +1,47 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> +
    + +
    +
    + +
    + +
    + +
    + + <%@ include file="/jsp/include/searchVendorPanel2.jsp" %> +
    + +
    +
    + diff --git a/posterita/posterita/web/jsp/include/year.jsp b/posterita/posterita/web/jsp/include/year.jsp new file mode 100644 index 0000000000..388537a45f --- /dev/null +++ b/posterita/posterita/web/jsp/include/year.jsp @@ -0,0 +1,39 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + + +<% +java.util.Calendar c = java.util.Calendar.getInstance(); +int curYear = c.get(java.util.Calendar.YEAR); +curYear = curYear - 57; +%> +<% + for(int i=0;i<=57;i++) + { +%> + <%=curYear + i%> +<% + } +%> + + + diff --git a/posterita/posterita/web/jsp/include/yearList.jsp b/posterita/posterita/web/jsp/include/yearList.jsp new file mode 100644 index 0000000000..3c2dcf2ae5 --- /dev/null +++ b/posterita/posterita/web/jsp/include/yearList.jsp @@ -0,0 +1,36 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + + +<% +java.util.Calendar c = java.util.Calendar.getInstance(); +int curYear = c.get(java.util.Calendar.YEAR); +%> + + +<%=curYear-1%> +<%=curYear%> +<%=curYear+1%> +<%=curYear+2%> +<%=curYear+3%> +<%=curYear+4%> +<%=curYear+5%> diff --git a/posterita/posterita/web/jsp/invoice/webstoreInvoice.jsp b/posterita/posterita/web/jsp/invoice/webstoreInvoice.jsp new file mode 100644 index 0000000000..cb0363b33d --- /dev/null +++ b/posterita/posterita/web/jsp/invoice/webstoreInvoice.jsp @@ -0,0 +1,126 @@ + +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.struts.stock.StockAction" %> + +<%@ page import="org.posterita.beans.ProductBean" %> +<%@ page import="org.posterita.beans.OrderLineBean" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> + +Invoice + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + + + + + + + + +
    + Order Ref No: + "> + + + +
    + Invoice Ref No: +
    + Doc Status: + +
    +
    +
    + + + + + + + + + + + <% + String styleClass = "label"; + if ((count.intValue()%2) != 0) + styleClass = "contentname"; + %> + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameQtyPriceVATTotal
    + + + + + + + + + + + +
    + + + + + + + +
    +
    + +<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/login/chooseApplication.jsp b/posterita/posterita/web/jsp/login/chooseApplication.jsp new file mode 100644 index 0000000000..2e61c7f045 --- /dev/null +++ b/posterita/posterita/web/jsp/login/chooseApplication.jsp @@ -0,0 +1,246 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Ashley +--%> + + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> +<%@ page import="org.posterita.Constants" %> +<% +String path = request.getContextPath(); +String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; +%> + + + + + Welcome to Posterita + + + + + + + + + + + + + + + + + + + + + + +
    +
    + +
    Posterita POS
    +
    +
    +
    +
    +
    + Choose your +
    + POS APPLICATION +
    +
    +
    +
    +
    +
    +
    + +
    + +
    +
    +
    +

    Recent News

    +
    + + +
    +
    + +
    + +
    +
    + +
    +
    + +
    +
    +
    +
    +

    Help us better Posterita POS

    +
    +
    + We are constantly trying to improve the product, and we are interested to hear from you. There are several ways you can help us. + +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    +
    +
    +

    Donate

    +
    +
    + If you find this software helpful, kindly donate and help us support it.

    + +
    +
    +
    + +
    + +
    +
    +
    + +
    +
    + + +
    +
      + +
    • + + + +
    • +
      +
    +
    +
    +
    +
    + +
    +
    + + + +
    +
    +
    +
    + +
    +
    + + diff --git a/posterita/posterita/web/jsp/login/chooseRole.jsp b/posterita/posterita/web/jsp/login/chooseRole.jsp new file mode 100644 index 0000000000..5e079f61e7 --- /dev/null +++ b/posterita/posterita/web/jsp/login/chooseRole.jsp @@ -0,0 +1,136 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> + + + + +
    + + + + + + + + + +
    +

    + +

    +
    +

    + +

    +
    + + + + + +
    + + + + + + + + + + + +
    + + Please choose an Organisation and a Role + +
    + <%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + + + + + + + + + + + + + +
    +   +
    Organisation + + + +
    Role + + + +
    + + + +
    +
    +
    + + + +
    +
    +
    +
    +

    + +

    + + + + <% + if ((count.intValue()%4) == 0) + { + + %> + + + <% + } + %> + + + + <% + if ((count.intValue()%4-4) == 0) + { + + %> + + + <% + } + %> + + +
    + + + + + + + + + + + + +
    + +
    +
    + + + +     " styleClass="submenu"> + + +
    + +
    + +
     
    +
    +
    +
    +
    + + + + + + + + + + + + +
    + + + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/login/forgot1.jsp b/posterita/posterita/web/jsp/login/forgot1.jsp new file mode 100644 index 0000000000..3d04546b1c --- /dev/null +++ b/posterita/posterita/web/jsp/login/forgot1.jsp @@ -0,0 +1,87 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Vishee +--%> + +<%@ page import="org.posterita.Constants" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> + + + + + + +
    +

    + + + + + +
    + + + + + +
    + + + + +
    +
    + +
      + +
    • +
      +
    +
    +
    +
    + + + + + + + + + + + + + + + +



      + +

    +
    +
    +
    +
    + + <%@ include file="/jsp/include/footerTableBottom.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/login/home.jsp b/posterita/posterita/web/jsp/login/home.jsp new file mode 100644 index 0000000000..caa41ed53f --- /dev/null +++ b/posterita/posterita/web/jsp/login/home.jsp @@ -0,0 +1,100 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Vishee +--%> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> + + + + +
    + + + + + + + + + +
    +

    + +

    +
    +

    + +

    +
    + + + + + +
    + + + + + + + + +
    + + <%@ include file="/jsp/include/errors.jsp" %> + + + + <%@ include file="/jsp/login/loginForm.jsp" %> + + +
    + + + +
    +
    +
    + + +<%@ include file="/jsp/include/footer.jsp" %> + + + + + + + + + + + + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/login/index.jsp b/posterita/posterita/web/jsp/login/index.jsp new file mode 100644 index 0000000000..5f5c4a3a3d --- /dev/null +++ b/posterita/posterita/web/jsp/login/index.jsp @@ -0,0 +1,93 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Vishee +--%> + + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> + + + + + + + <bean:message key="login.home.title"/> + + + <%@ include file="/js/enableButton.js" %> + + + + + + + + + + + + + + + +
    + +
    + + + + + + + + + + + + + +
    + + + +
    + + + + +
    + All Content © 2007 Posterita Ltd +
    + + + + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/login/loginForm.jsp b/posterita/posterita/web/jsp/login/loginForm.jsp new file mode 100644 index 0000000000..3cf611275f --- /dev/null +++ b/posterita/posterita/web/jsp/login/loginForm.jsp @@ -0,0 +1,56 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Vishee +--%> + + + + + +
    +
    +
    + + + + + + + + + + + + + + + + +
    + +
    + + + + +
    + diff --git a/posterita/posterita/web/jsp/login/logout.jsp b/posterita/posterita/web/jsp/login/logout.jsp new file mode 100644 index 0000000000..54328db6dd --- /dev/null +++ b/posterita/posterita/web/jsp/login/logout.jsp @@ -0,0 +1,61 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Vishee +--%> + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> + + + + + + + + + + + +
    + +
    + + <%@ include file="/jsp/login/loginForm.jsp" %> +
    + + + + <%@ include file="/jsp/include/tshirtFooter.jsp"%> + + + + + + + + + + + + + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/login/maintenance.jsp b/posterita/posterita/web/jsp/login/maintenance.jsp new file mode 100644 index 0000000000..2acf6aaccb --- /dev/null +++ b/posterita/posterita/web/jsp/login/maintenance.jsp @@ -0,0 +1,89 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Vishee +--%> + + + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> + + + + + + + <bean:message key="login.home.title"/> + + + <%@ include file="/js/enableButton.js" %> + + + + + +
    + + + + +
    +
    + + + + +
    + + + + + + + + +
    +
    +
    +
    + + + + + +
    + This Server is Down for Maintenance
    + We will be back shortly
    + Thank You! +
    +
    +
    + +

    All Content © 2007 Posterita Ltd

    +
    +
    +
    + + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/login/password.jsp b/posterita/posterita/web/jsp/login/password.jsp new file mode 100644 index 0000000000..3f5d92f02b --- /dev/null +++ b/posterita/posterita/web/jsp/login/password.jsp @@ -0,0 +1,103 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Vishee +--%> + + +<%@ page import="org.posterita.Constants" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> + + + + + + + + + + +

    + + + + + +
    + + + + +
    + + + + +
    +
    + +
      + +
    • +
      +
    +
    +
    +
    + + + + + + + + +
    + + + +
    + +
    +
    + + + <%@ include file="/jsp/include/tablebottom.jsp" %> + + + + + + +<%@ include file="/jsp/include/footer.jsp" %> + + + + + + + + + + + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/login/posLogin.html b/posterita/posterita/web/jsp/login/posLogin.html new file mode 100644 index 0000000000..3348c9581e --- /dev/null +++ b/posterita/posterita/web/jsp/login/posLogin.html @@ -0,0 +1,81 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Vishee +--%> + + + + + +Welcome to Tamak POS + + + + + + + + + + + + + + + + diff --git a/posterita/posterita/web/jsp/login/success.jsp b/posterita/posterita/web/jsp/login/success.jsp new file mode 100644 index 0000000000..7780af7344 --- /dev/null +++ b/posterita/posterita/web/jsp/login/success.jsp @@ -0,0 +1,121 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Vishee +--%> + +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.lib.UdiConstants" %> + +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + + + + + + + +
    + + + +
    +


    +
    +
    + + + + + + + + + + + +
    + + + + + + + + + + + + + + +
    + " target="_blank"> + + +
    +
    +

    From To

    +
    +
    +
    +
    + +
    + +<%@ include file="/jsp/include/footerTableBottom.jsp" %> diff --git a/posterita/posterita/web/jsp/materialmovement/viewMMovement.jsp b/posterita/posterita/web/jsp/materialmovement/viewMMovement.jsp new file mode 100644 index 0000000000..5504b769ac --- /dev/null +++ b/posterita/posterita/web/jsp/materialmovement/viewMMovement.jsp @@ -0,0 +1,166 @@ +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> +<% + String path = request.getContextPath(); + String appName = (String) request.getSession().getAttribute(Constants.APP_NAME); + String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; + Properties ctx = TmkJSPEnv.getCtx(request); + String posName = POSTerminalManager.getTerminalName(ctx); + String orgName = MOrg.get(ctx, Env.getContextAsInt(ctx, UdiConstants.ORG_ID_CTX_PARAM)).getName(); + String roleName = MRole.get(ctx, Env.getContextAsInt(ctx, UdiConstants.AD_ROLE_ID)).getName(); + +%> + +<%@page import="org.posterita.Constants"%> +<%@page import="java.util.Properties"%> +<%@page import="org.posterita.core.TmkJSPEnv"%> +<%@page import="org.compiere.util.Env"%> +<%@page import="org.posterita.lib.UdiConstants"%> +<%@page import="org.compiere.model.MPriceList"%> +<%@page import="org.compiere.model.MOrg"%> +<%@page import="org.compiere.model.MRole"%> +<%@page import="org.posterita.businesslogic.ShoppingcartManager"%> +<%@page import="org.posterita.util.HtmlOrderPrintFormatter"%> +<%@page import="org.compiere.model.MOrder"%> +<%@page import="org.posterita.businesslogic.POSManager"%> +<%@page import="org.posterita.businesslogic.POSTerminalManager"%> +<%@page import="org.compiere.model.MPayment"%> +<%@page import="java.math.BigDecimal"%> +<%@page import="org.compiere.model.I_M_PriceList"%> +<%@page import="org.posterita.order.UDIOrderTypes"%> +<%@page import="org.posterita.TangoColors"%> +<%@page import="org.posterita.businesslogic.administration.PriceListManager"%> +<%@page import="org.posterita.businesslogic.stock.MMovementManager"%> + + + + + <%=appName%> + + + + + + + + + + + + + + + + +<% +int priceListId = PriceListManager.getDefaultPriceListId(ctx, false); +MPriceList priceList = new MPriceList(ctx, priceListId, null); +String priceListName = priceList.getName(); +%> + + + + + + + + + + + + + + + + + + + + +
    +
    + + +
    + Stock Transfer +
    +
    +
    +
    + : + <%=orgName%> +
    +
    + : + <%=posName%> +
    +
    +
    +
    + : + +
    +
    + : + <%=roleName%> +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +   + +
    +
    + <%=priceListName%> +
    +
    +
    +
    +
    +
    + <%= MMovementManager.getMMovementCartFromInventoryMove(ctx, Integer.parseInt(movementId), null) %> +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    + +
    +
    +
    + <%String newOrderAction = "/StockMovementAction.do?action=createNewStockTransfer"; %> +
    NEW ORDER
    +
    +
    +
    + Ctrl+Space New Order | Ctrl-M Menu
    +
    + <%@ include file="/jsp/include/printOrderApplet2.jsp" %> + + diff --git a/posterita/posterita/web/jsp/materialmovement/viewMMovementHistory.jsp b/posterita/posterita/web/jsp/materialmovement/viewMMovementHistory.jsp new file mode 100644 index 0000000000..ca8647b1ff --- /dev/null +++ b/posterita/posterita/web/jsp/materialmovement/viewMMovementHistory.jsp @@ -0,0 +1,127 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2008 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author sendy +--%> + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.compiere.model.MOrg" %> +<%@ page import="org.compiere.process.DocumentEngine" %> +<%@ page import="org.posterita.struts.stock.StockMovementAction" %> +<%@ page import="org.compiere.process.DocAction" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> +<%@ taglib uri="http://displaytag.sf.net" prefix="display" %> + +<%@page import="org.posterita.core.Configuration"%> +<%@page import="org.compiere.util.Env"%> +<%@page import="org.compiere.model.MPriceListVersion"%> +<%@page import="org.posterita.lib.UdiConstants"%> +<%@page import="org.posterita.core.TmkJSPEnv"%> +<%@page import="java.util.Properties"%> +<%@page import="org.posterita.businesslogic.administration.PriceListManager"%> + History +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> +<% + +%> + + + + + + + + + + + + + + + + + + + + + + + + + + <%@ include file="/jsp/include/historyMonthYearFilter.jsp"%> + + + + + + +
    + + + + + + + + + +
    +   + + + + + + + + + + + + + + + <%@include file="/jsp/include/paymentRuleFilter.jsp"%> + + +
    +
    + + + + + + + + + + + + + +<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/materialmovement/viewMMovementLines.jsp b/posterita/posterita/web/jsp/materialmovement/viewMMovementLines.jsp new file mode 100644 index 0000000000..401ddbe1f4 --- /dev/null +++ b/posterita/posterita/web/jsp/materialmovement/viewMMovementLines.jsp @@ -0,0 +1,132 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author sendy +--%> + +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + +<%@page import="org.posterita.Constants"%> +<%@page import="org.posterita.struts.stock.StockMovementAction"%> +<%@page import="org.posterita.beans.StockMovementBean"%> +Stock Movement +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + +
     
    + +
    + + +<% + StockMovementBean movementBean = (StockMovementBean)request.getSession().getAttribute(Constants.MMOVEMENT); + String orgFrom = movementBean.getOrgFromName(); + String orgTo = movementBean.getOrgToName(); + String addressFrom = movementBean.getAddress1(); + String addressTo = movementBean.getAddress2(); + String docStatus = movementBean.getDocStatus(); + String date = movementBean.getMovementDate(); + String movementId = movementBean.getDocumentNo().toString(); +%> + + + + + +
    +
    <%=orgFrom%>
    +
    <%=addressFrom %>
    +
    <%=docStatus %>
    +
    <%=movementId %>
    +
    +
    <%=orgTo %>
    +
    <%=addressTo %>
    +
    +
     
    +
    +
     
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Product NameDescriptionUom ActiveQuantity
    + + + + + + + + + + +
    + + + + + + +
    + " class="newbutton" onclick="get('ViewMMovement.do?action=viewMMovement')"> + +   +
    + + + + + +
    +
    + +<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/materialmovement/viewMoveConfirm.jsp b/posterita/posterita/web/jsp/materialmovement/viewMoveConfirm.jsp new file mode 100644 index 0000000000..5a97c30a95 --- /dev/null +++ b/posterita/posterita/web/jsp/materialmovement/viewMoveConfirm.jsp @@ -0,0 +1,95 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2008 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author sendy +--%> + +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> +<%@page import="org.posterita.Constants"%> +<%@page import="org.posterita.struts.stock.StockMovementAction"%> +Move Confirmation +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + +
    + <% + String collection = Constants.MOVE_CONFIRM; + %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    DocNoInventory Move From Organisation Active DocStatusDateAction
    + + + + + + + + + + + + + + <% if (!stock.getDocStatus().equals("CO")) + { + %> + ">Complete + <% + } + %> +
    + +
    +<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/materialmovement/viewMoveConfirmLines.jsp b/posterita/posterita/web/jsp/materialmovement/viewMoveConfirmLines.jsp new file mode 100644 index 0000000000..d25dc73e1e --- /dev/null +++ b/posterita/posterita/web/jsp/materialmovement/viewMoveConfirmLines.jsp @@ -0,0 +1,130 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author sendy +--%> + +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + +<%@page import="org.posterita.Constants"%> +<%@page import="org.posterita.struts.stock.StockMovementAction"%> +<%@page import="org.posterita.beans.StockMovementBean"%> +Move Confirmation +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + +
     
    + +
    + + +<% + StockMovementBean movementBean = (StockMovementBean)request.getSession().getAttribute(Constants.MMOVEMENT); + String orgFrom = movementBean.getOrgFromName(); + String orgTo = movementBean.getOrgToName(); + String addressFrom = movementBean.getAddress1(); + String addressTo = movementBean.getAddress2(); + String docStatus = movementBean.getDocStatus(); + String date = movementBean.getMovementDate(); + String movementId = movementBean.getDocumentNo().toString(); + String moveConfirmId = movementBean.getMoveConfirmId().toString(); +%> + + + + + +
    +
    <%=orgFrom%>
    +
    <%=addressFrom %>
    +
    <%=docStatus %>
    +
    <%=movementId %>
    +
    +
    <%=orgTo %>
    +
    <%=addressTo %>
    +
    +
     
    +
    +
     
    + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Product NameDescriptionUom ActiveQuantity
    + + + + + + + + + + +
    + + + + +
    + " class="newbutton" onclick="get('ViewMoveConfirm.do?action=viewMoveConfirm')"> + +   +
    + + + + + +
    +
    + +<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/materialmovement/viewMoveLinesHistory.jsp b/posterita/posterita/web/jsp/materialmovement/viewMoveLinesHistory.jsp new file mode 100644 index 0000000000..992cf3badd --- /dev/null +++ b/posterita/posterita/web/jsp/materialmovement/viewMoveLinesHistory.jsp @@ -0,0 +1,120 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author sendy +--%> + +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + +<%@page import="org.posterita.Constants"%> +<%@page import="org.posterita.struts.stock.StockMovementAction"%> +<%@page import="org.posterita.beans.StockMovementBean"%> + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + +
     
    + +
    + + +<% + StockMovementBean movementBean = (StockMovementBean)request.getSession().getAttribute(Constants.MMOVEMENT); + String orgFrom = movementBean.getOrgFromName(); + String orgTo = movementBean.getOrgToName(); + String addressFrom = movementBean.getAddress1(); + String addressTo = movementBean.getAddress2(); + String docStatus = movementBean.getDocStatus(); + String date = movementBean.getMovementDate(); + String movementId = movementBean.getDocumentNo().toString(); +%> +
     
    + + + + + +
    +
    <%=orgFrom%>
    +
    <%=addressFrom %>
    +
    <%=docStatus %>
    +
    <%=movementId %>
    +
    +
    <%=orgTo %>
    +
    <%=addressTo %>
    +
    +
     
    +
    +
     
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Product NameDescriptionUom ActiveQuantity
    + + + + + + + + + + +
    + + +
    +
    + +<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/materialmovement/viewStock.jsp b/posterita/posterita/web/jsp/materialmovement/viewStock.jsp new file mode 100644 index 0000000000..b6b87b2dab --- /dev/null +++ b/posterita/posterita/web/jsp/materialmovement/viewStock.jsp @@ -0,0 +1,394 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 - 2008 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author shameem +--%> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + +<% + String path = request.getContextPath(); + String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; + String appName = (String) request.getSession().getAttribute(Constants.APP_NAME); + Properties ctx = TmkJSPEnv.getCtx(request); + String posName = POSTerminalManager.getTerminalName(ctx); + String orgName = MOrg.get(ctx, Env.getContextAsInt(ctx, UdiConstants.ORG_ID_CTX_PARAM)).getName(); + String roleName = MRole.get(ctx, Env.getContextAsInt(ctx, UdiConstants.AD_ROLE_ID)).getName(); + + Object bPId = request.getSession().getAttribute(Constants.BPARTNER_ID); + Object bPName = request.getSession().getAttribute(Constants.BPARTNER_NAME); + Object bPCredit = request.getSession().getAttribute(Constants.BPARTNER_CREDIT); + String bPartnerId = bPId == null? "":bPId.toString(); + String bPartnerName = bPName == null? "": bPName.toString(); + String bPartnerCredit = bPCredit == null? "": bPCredit.toString(); + + //set configuration + Configuration configuration = Configuration.getConfiguration(request); + String paymentRule = configuration.getPaymentRule(); + String searchProductBy = configuration.getSearchProductBy(); + boolean isCustomerCompulsory = configuration.isCustomerCompulsory(); + boolean isTerminalLocked = POSTerminalManager.isTerminalLocked(ctx); + int movementId = Env.getContextAsInt(ctx, Constants.MMOVEMENT_ID); + + Integer priceListId = PriceListManager.getDefaultPriceListId(ctx, false); + Object plId = request.getSession().getAttribute(Constants.ORDER_PRICE_LIST); + if (plId != null) + { + try + { + priceListId = Integer.valueOf(String.valueOf(plId)); + } + catch (NumberFormatException e){} + } + MPriceList priceList = MPriceList.get(ctx, priceListId.intValue(), null); + String priceListName = priceList.getName(); + MCurrency currency = MCurrency.get(ctx, priceList.getC_Currency_ID()); + BigDecimal roundOffFactor = currency.getRoundOffFactor(); + + if (isTerminalLocked) + { + posName += " (Locked)"; + } + + int roleId = Env.getAD_Role_ID(ctx); + + Object orgFrom = request.getSession().getAttribute(Constants.ORG_FROM_ID); + Integer ctxOrg = Integer.valueOf(Env.getContextAsInt(ctx, UdiConstants.ORG_ID_CTX_PARAM)); + String org = orgFrom == null? ctxOrg.toString(): orgFrom.toString(); + + int menuId = MenuManager.getMenuId(ctx, "pmenu.stock"); +%> + +<%@page import="org.posterita.struts.stock.StockMovementAction"%> +<%@page import="org.posterita.Constants"%> +<%@page import="org.posterita.core.TmkJSPEnv"%> +<%@page import="org.posterita.lib.UdiConstants"%> +<%@page import="org.compiere.util.Env"%> +<%@page import="org.posterita.businesslogic.stock.StockList"%> +<%@page import="java.math.BigDecimal"%> +<%@page import="org.posterita.businesslogic.POSTerminalManager"%> +<%@page import="java.util.Properties"%> +<%@page import="org.compiere.model.MProductPrice"%> +<%@page import="org.posterita.businesslogic.administration.PriceListManager"%> +<%@page import="org.posterita.user.WebUserInfo"%> +<%@page import="org.compiere.model.MOrg"%> +<%@page import="org.compiere.model.MRole"%> +<%@page import="org.posterita.core.Configuration"%> +<%@page import="org.compiere.model.MPriceList"%> +<%@page import="org.compiere.model.MCurrency"%> +<%@page import="org.posterita.order.UDIOrderTypes"%> +<%@page import="org.posterita.businesslogic.administration.RoleManager"%> +<%@page import="org.posterita.businesslogic.MenuManager"%> +<%@page import="org.posterita.businesslogic.stock.MMovementManager"%> + + + + + <%=appName%> + + + + + + + + + + + + + + + + + +<%@ include file="/jsp/include/showErrors.jsp" %> +
    Please wait...
    + + + + + + + + + + + + + " styleId="movementId"/> + + + + + + + + + + + + +
    +
    + + +
    + STOCK TRANSFER +
    +
    +
    +
    + : + <%=orgName%> +
    +
    + : + <%=posName%> +
    +
    +
    +
    + : + +
    +
    + : + <%=roleName%> +
    +
    +
    +
    +
    +
    +
    +
    +
    STATUS: DRAFTED
    +
    +
    +
    +
    +
    +
    +
    + + + + + + + + +
    + BARCODE: + + + NAME: +
    +
    + DESC: +
    +
    +
    +
    +
    +
    +
    +
    + <%=priceListName%> +
    +
    +
    +
    +
    +
    + <%= MMovementManager.getMMovementCartAsHTML(request)%> +
    +
    +
    +
    +
    +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + Barcode + + +
    + Name + + +
    + Description + + +
    + Tax Cat + + +
    + Stock Qty + + +
    + Price List + + +
    + Units Per Pack + + +
    +
    +
    +
    + + Increase item quantity + Decrease item quantity + Remove item +
    +
    +
    +
    + + + + + + + + + +
    + + + +
    + + + +
    +
    +
    + + + + + + + + + +
    DOCUMENT NO:
    REFERENCE:
    + +
    +
    +
    +
    + New Stock Tansfer + Clear all items +
    +
    +
    +
    +
    + Save + Complete +
    +
    +
    +
    +
    + F1 Barcode | F2 Name | F3 Description | F4 Quantity | Ctrl+Up MoveUp | Ctrl+Down MoveDown | Ctrl+Left Decrement | Ctrl-Right Increment | Ctrl-Backspace Remove | Ctrl+M Menu | + Ctrl-S Save | Ctrl-Delete Clear | Ctrl+Space Checkout | Ctrl+C Complete +
    +
    +
    +
    + " code="org.posterita.core.PrintOrderApplet.class" width="0" height="0"> +
    + +
    +
    +
    +
    + + diff --git a/posterita/posterita/web/jsp/materialmovement/viewStockList.jsp b/posterita/posterita/web/jsp/materialmovement/viewStockList.jsp new file mode 100644 index 0000000000..d2b8f2f1ba --- /dev/null +++ b/posterita/posterita/web/jsp/materialmovement/viewStockList.jsp @@ -0,0 +1,173 @@ +<%-- + * Product: Posterita Web-Based POS (an Adempiere Plugin) + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author sendy +--%> + + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.beans.*" %> +<%@ page import="org.posterita.struts.pos.POSProductAction" %> +<%@ page import="org.compiere.process.DocumentEngine" %> +<%@ page import="org.compiere.model.MOrder" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.struts.pos.POSOrderAction" %> +<%@ page import="java.util.ArrayList" %> +<%@page import="org.posterita.struts.stock.StockMovementAction"%> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> + + + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + +
    +
    +
    + +
    +
    + + +
    + + + + + + + + + + + + + +
    +
    +
    + + + + + + + + + + + + <% + String url = "ViewStockList.do"; + String collection = Constants.MATERIAL_MOVEMENT_DETAILS; + %> + + + <% + String styleClass = "label"; + if ((index.intValue()%2) != 0) + styleClass = "contentname"; + %> + + + + + + + + + + + +
     
    + + + + + + + + + + + + + + + + + + ">Remove +
    + + + +
    +   +
    + + +
    +
    + +
    +
    + + +<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/payment/paymentDetails.jsp b/posterita/posterita/web/jsp/payment/paymentDetails.jsp new file mode 100644 index 0000000000..5ea34a198d --- /dev/null +++ b/posterita/posterita/web/jsp/payment/paymentDetails.jsp @@ -0,0 +1,127 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Vishee +--%> + + + + + + + + + +
    + + + + + +
    + + + + + + + + + +
    + Document Type: +
    + + + + + + <%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + + + + + + + + + + + + +
    + + + + + + + Invoice Ref No: + + + + + +
    + Payment Ref No: + + Counter Payment Ref No: +
    + Status: +
    +   +
    + + + + + + + + + + + + + + + + + + + + + + +
    Date PaidPay Amount
    + + + + + +
    + + diff --git a/posterita/posterita/web/jsp/payment/viewPayment.jsp b/posterita/posterita/web/jsp/payment/viewPayment.jsp new file mode 100644 index 0000000000..b32ba1f2b8 --- /dev/null +++ b/posterita/posterita/web/jsp/payment/viewPayment.jsp @@ -0,0 +1,96 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok Pathak +--%> + + +<%@ page import="com.posterita.Constants" %> +<%@ page import="com.posterita.user.WebUserInfo" %> +<%@ page import="com.posterita.order.UDIOrderTypes" %> +<%@ page import="org.compiere.model.MPayment" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> + + +Payment + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + +<%-- +@TODO by Alok + +--%> + + + <%@ include file="/jsp/webstore/webDocumentHeader.jsp" %> + + + + + + + + + + +
    + + Payment By: +
    +
    + Ref Payment No: +
    + Status: +
    +
    + + + + + + + + + + + +
    Payment DateAmount
    + + + + +
    +
    + + + + <%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/payment/viewPaymentHistory.jsp b/posterita/posterita/web/jsp/payment/viewPaymentHistory.jsp new file mode 100644 index 0000000000..eef993358b --- /dev/null +++ b/posterita/posterita/web/jsp/payment/viewPaymentHistory.jsp @@ -0,0 +1,124 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Vishee +--%> + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.compiere.model.MOrg" %> +<%@ page import="org.posterita.struts.payment.PaymentAction" %> + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> + + + + + + + + + + + + + + + + + + +
    + <%@ include file="/jsp/include/tabTop.jsp" %><%@ include file="/jsp/include/tabBottom.jsp" %> +
    + + + + + <%@ include file="/jsp/include/filter.jsp"%> + + +
    +
    + + + + + + + + + + + + + + + + <% + String styleClass = "label"; + if ((count.intValue()%2) != 0) + styleClass = "contentname"; + %> + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + + + + + + + +
    +
    + + <%@ include file="/jsp/include/footerTableBottom.jsp" %> + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/AllPOSCustomer.jsp b/posterita/posterita/web/jsp/pos/AllPOSCustomer.jsp new file mode 100644 index 0000000000..5849356121 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/AllPOSCustomer.jsp @@ -0,0 +1,442 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.compiere.model.MOrg" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + +<%@ include file="/jsp/include/posHeader.jsp" %> +
    + + + + + + + + + + + + +
    + + + + +   + + + + + <%@include file="/jsp/include/dayList.jsp"%> + + + + <%@include file="/jsp/include/month.jsp"%> + + + + + <% + int currentYear = java.util.Calendar.getInstance().get(java.util.Calendar.YEAR); + %> + <%= currentYear %> + <%= currentYear - 1 %> + + + + All + Active + Not Active + + + + + <pos:message textOnly="true" key="add"/> + + + "> + Import POS Customers + +
    +
    + + + <% + org.posterita.businesslogic.CustomerCart cart = (org.posterita.businesslogic.CustomerCart)request.getSession().getAttribute(Constants.CUSTOMER_CART); + %> + + +
    + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    :
    +
    +
    + + + + + + + + + + + + + + +<% + String url = "ViewAllCustomers.do"; + String collection = Constants.ALL_CUSTOMERS; +%> + + + <% + String styleClass = "label"; + + if ((count.intValue()%2) != 0) + styleClass = "contentname"; + %> + + + + + + + + + + + + + + + + + +
      
    + + + +
    + +
    + + + + + + + + + + Y + + + N + + + + + + "> + <pos:message textOnly="true" key="edit.customer"/> + + + +   + "> + <pos:message textOnly="true" key="view"/> + + + +   + + "> + <pos:message textOnly="true" key="deactivate"/> + + + + "> + <pos:message textOnly="true" key="activate"/> + + + + + + <% + if(((org.posterita.businesslogic.CustomerCart)request.getSession().getAttribute(Constants.CUSTOMER_CART)).hasCustomer(Integer.parseInt(bpartnerId+""))) + { + %> + + + <% + } + else + { + %> + + <% + } + %> + + + + +
    +<%@ include file="/jsp/include/pager.jsp" %> +
    +
    + + +<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/ViewAllPosVendors.jsp b/posterita/posterita/web/jsp/pos/ViewAllPosVendors.jsp new file mode 100644 index 0000000000..883245fa6b --- /dev/null +++ b/posterita/posterita/web/jsp/pos/ViewAllPosVendors.jsp @@ -0,0 +1,173 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Martine +--%> + + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.compiere.model.MOrg" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> + + +<%@ include file="/jsp/include/posHeader.jsp" %> + + + +
    + + + + + + + + + + +
    + + + + + +   + + + + + Add Vendor + +
    +
    + + + +
    :
    +
    +
    +
    + + + + +<% + String url = "ViewAllVendors.do"; + String collection = Constants.VENDOR_LIST; +%> + + + + + + + + + + + + + + + + + + + + + + + + + +<% + String styleClass = "label"; + + if ((count.intValue()%2) != 0) + styleClass = "contentname"; +%> + + + + + + + + + + + + + +
     
    + + + + + + + + + + + + Y + + + N + + + + "> + <%=editmsg%> + + + "> + <%=viewmsg%> + + + + "> + <%=deactivatemsg%> + + + + + "> + <%=activatemsg%> + + +
    + +<%@ include file="/jsp/include/pager.jsp" %> + +
    + +
    + +<%@ include file="/jsp/include/posFooter.jsp" %> + + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/adjustCashBook.jsp b/posterita/posterita/web/jsp/pos/adjustCashBook.jsp new file mode 100644 index 0000000000..bc76adafd7 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/adjustCashBook.jsp @@ -0,0 +1,93 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.beans.*" %> +<%@ page import="org.posterita.struts.pos.CashBookAction" %> +<%@ page import="org.compiere.model.MCashLine" %> + + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + +
    + + + + + + + + + + + + + + + + + +
    + * + + +
    + * + + + + + + +
    + * + + + +
    +   + + +   + +
    +
    +
    + +<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/adjustInventory.jsp b/posterita/posterita/web/jsp/pos/adjustInventory.jsp new file mode 100644 index 0000000000..0039eaf096 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/adjustInventory.jsp @@ -0,0 +1,102 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.compiere.model.MOrg" %> +<%@ page import="org.posterita.struts.pos.InventoryAction" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + + + + + + + <% + String styleClass = "label"; + + if ((count.intValue()%2) != 0) + styleClass = "contentname"; + %> + +
    +
    + + + + + + + + + + + +
     
    + + + + + + + + + + Save + +
    + + Complete + +
    + +
    +
    + +
    + +<%@ include file="/jsp/include/posFooter.jsp" %> + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/adjustStock.jsp b/posterita/posterita/web/jsp/pos/adjustStock.jsp new file mode 100644 index 0000000000..4288fdc0fd --- /dev/null +++ b/posterita/posterita/web/jsp/pos/adjustStock.jsp @@ -0,0 +1,498 @@ + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + +<% + String path = request.getContextPath(); + String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; + String appName = (String) request.getSession().getAttribute(Constants.APP_NAME); + Properties ctx = TmkJSPEnv.getCtx(request); + String posName = POSTerminalManager.getTerminalName(ctx); + String orgName = MOrg.get(ctx, Env.getContextAsInt(ctx, UdiConstants.ORG_ID_CTX_PARAM)).getName(); + String roleName = MRole.get(ctx, Env.getContextAsInt(ctx, UdiConstants.AD_ROLE_ID)).getName(); + + int menu_id = MenuManager.getMenuId(ctx, "pmenu.stock"); + + String orderType = "Stock Adjustment"; + int purchasePriceListVersionId=Env.getContextAsInt(ctx,UdiConstants.POS_PURCHASE_PL_VERSION); + MPriceListVersion priceListVersion = new MPriceListVersion(ctx,purchasePriceListVersionId,null); + int m_pricelist_id = priceListVersion.getM_PriceList_ID(); + MPriceList priceList = new MPriceList(ctx,m_pricelist_id,null); + + int inventoryId = Env.getContextAsInt(ctx, Constants.INVENTORY_ID); + String description = Env.getContext(ctx, Constants.DESCRIPTION); + long currentTimeInMillis = System.currentTimeMillis(); + Date today = new Date( currentTimeInMillis ); + if(description == "") + { + description = "Stock Adjustment - " + today; + } + + String docNo = (String)request.getSession().getAttribute(Constants.DOC_NO); + if(docNo == "" || docNo == null) + { + docNo = "N/A"; + } + + String docStatus = (String)request.getSession().getAttribute(Constants.DOC_STATUS); + if(docStatus == "" || docStatus == null) + { + docStatus = "N/A"; + } + else + { + + if (DocAction.STATUS_Drafted.equals(docStatus)) + docStatus = Constants.DOC_STATUS_DRAFTED; + else + if (DocAction.STATUS_InProgress.equals(docStatus)) + docStatus = Constants.DOC_STATUS_INPROGRESS; + else + if (DocAction.STATUS_Completed.equals(docStatus)) + docStatus = Constants.DOC_STATUS_COMPLETED; + else + if (DocAction.STATUS_Closed.equals(docStatus)) + docStatus = Constants.DOC_STATUS_CLOSED; + else + if (DocAction.STATUS_Invalid.equals(docStatus)) + docStatus = Constants.DOC_STATUS_INVALID; + else + if (DocAction.STATUS_Voided.equals(docStatus)) + docStatus = Constants.DOC_STATUS_VOID; + } + + String priceListName = priceList.getName(); + MCurrency currency = MCurrency.get(ctx, priceList.getC_Currency_ID()); + BigDecimal roundOffFactor = currency.getRoundOffFactor(); + + //set configuration + Configuration configuration = Configuration.getConfiguration(request); + String paymentRule = configuration.getPaymentRule(); + String searchProductBy = configuration.getSearchProductBy(); + boolean isCustomerCompulsory = configuration.isCustomerCompulsory(); + +%> + +<%@page import="org.posterita.Constants"%> +<%@page import="java.util.Properties"%> +<%@page import="java.util.Calendar"%> +<%@page import="java.util.Date"%> +<%@page import="org.posterita.core.TmkJSPEnv"%> +<%@page import="org.compiere.model.MPOS"%> +<%@page import="org.compiere.util.Env"%> +<%@page import="org.posterita.lib.UdiConstants"%> +<%@page import="org.compiere.model.MPriceList"%> +<%@page import="org.compiere.model.MOrg"%> +<%@page import="org.compiere.model.MRole"%> +<%@page import="org.posterita.businesslogic.stock.InventoryCartManager"%> +<%@page import="org.posterita.businesslogic.POSTerminalManager"%> +<%@page import="org.posterita.core.Configuration"%> +<%@page import="java.math.BigDecimal"%> +<%@page import="org.compiere.model.MCurrency"%> +<%@page import="org.compiere.model.MPriceListVersion"%> +<%@page import="org.compiere.util.WebSessionCtx"%> +<%@page import="org.posterita.user.WebUserInfo"%> + +<%@page import="org.posterita.businesslogic.MenuManager"%> +<%@page import="org.compiere.process.DocAction"%> + + + + + <%=appName%> + + + + + + + + + + + + + + + + + + + +
    Please wait...
    + + + + + + + + + + + + + " styleId="priceListId"/> + " styleId="invdescription"/> + " styleId="inventoryId"/> + " styleId = "roundOffFactor" /> + + " id="isCustomerCompulsory"/> + + + + + + + + + + + +
    +
    + + +
    + <%= orderType %> +
    +
    +
    +
    + : + <%=orgName%> +
    +
    + : + <%=posName%> +
    +
    +
    +
    + : + +
    +
    + : + <%=roleName%> +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + + + + + + +
    + BARCODE: + + + NAME: +
    +
    + DESC: +
    +
    +
    +
    + +
    +
    +
    +
    +
    + <%=priceListName%> +
    +
    +
    +
    +
    +
    + <%= InventoryCartManager.getInventoryCartAsHTML(request)%> +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + +
    + Barcode + + +
    + Name + + +
    + Description + + +
    + Tax Cat + + +
    + Qty Book + + +
    + Price List + + +
    + +
    +
    + + Increase item quantity + Decrease item quantity + Remove item +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + +
    + Total Products + + +
    + Total Qty CSV + + +
    + Total Qty Book + + +
    + Total Qty Count + + +
    + Discrepancy + + +
    +
    +
    + + + + + + + + + + + + + + +
    + Reference + + <%=description + ""%> +
    + Doc No + + <%=docNo%> +
    + Status + + <%=docStatus%> +
    + +
    +
    +
    +
    +
    +
    PRINT
    +
    CSV
    +
    SAVE AS CSV
    +
    ADD CSV
    +
    CLEAR
    +
    SAVE
    +
    NEW
    +
    SEARCH
    +
    REFRESH CART
    +
    +
    +
    +
    +
    COMPLETE
    +
    +
    +
    + F1 Barcode | F2 Name | F3 Description | F4 Qty | F5 Save | F6 Search | F7 Import CSV | F8 CSV | F9 Save CSV | F10 Refresh Cart | + Ctrl+Up MoveUp | Ctrl+Down MoveDown | Ctrl+Left Decrement | Ctrl-Right Increment | Ctrl-Backspace Remove | Ctrl+M Menu | Ctrl+N New Cart | Ctrl+R Reference | + Ctrl-P Print | Ctrl-C Complete | Ctrl-Delete Clear +
    +
    + +
    + " code="org.posterita.core.PrintOrderApplet.class" width="0" height="0"> +
    + + + + + + + + + + + + + + + + + + +
    + + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/adjustedStock.jsp b/posterita/posterita/web/jsp/pos/adjustedStock.jsp new file mode 100644 index 0000000000..c04ee37868 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/adjustedStock.jsp @@ -0,0 +1,97 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.compiere.model.MOrg" %> +<%@ page import="org.posterita.struts.pos.InventoryAction" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + + + + <% + String styleClass = "label"; + + if ((count.intValue()%2) != 0) + styleClass = "contentname"; + %> + + + + + + + + + + + + + + +
    + +
    + + + + + + + + + +
    +
    + + + +
    +
    +
    +
    + + + +<%@ include file="/jsp/include/posFooter.jsp" %> + + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/advancedOrderScreen.jsp b/posterita/posterita/web/jsp/pos/advancedOrderScreen.jsp new file mode 100644 index 0000000000..9ec42617e5 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/advancedOrderScreen.jsp @@ -0,0 +1,369 @@ +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> +<% + String path = request.getContextPath(); + String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; + //String appName = (String) request.getSession().getAttribute(Constants.APP_NAME); + Properties ctx = TmkJSPEnv.getCtx(request); + String posName = POSTerminalManager.getTerminalName(ctx); + String orgName = MOrg.get(ctx, Env.getContextAsInt(ctx, UdiConstants.ORG_ID_CTX_PARAM)).getName(); + String roleName = MRole.get(ctx, Env.getContextAsInt(ctx, UdiConstants.AD_ROLE_ID)).getName(); +%> + +<%@page import="org.posterita.Constants"%> +<%@page import="java.util.Properties"%> +<%@page import="org.posterita.core.TmkJSPEnv"%> +<%@page import="org.compiere.util.Env"%> +<%@page import="org.posterita.lib.UdiConstants"%> +<%@page import="org.compiere.model.MPriceList"%> +<%@page import="org.posterita.businesslogic.administration.RoleManager"%> +<%@page import="java.math.BigDecimal"%> +<%@page import="org.compiere.model.MOrg"%> +<%@page import="org.compiere.model.MRole"%> +<%@page import="org.posterita.businesslogic.POSTerminalManager"%> +<%@page import="org.posterita.TangoColors"%> +<%@page import="org.compiere.model.MCurrency"%> + + + + + + + + + + + + + + + + + + + + + +<% + MPriceList priceList = MPriceList.get(ctx, Integer.valueOf(priceListId).intValue(), null); + String priceListName = priceList.getName(); + int currencyId = priceList.getC_Currency_ID(); + MCurrency currency = MCurrency.get(ctx, currencyId); + String curSymbole = currency.getCurSymbol(); +%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + +
    + POS Order +
    +
    +
    +
    + + Organisation : + Posterita +
    +
    + Terminal : + Test teminal +
    +
    +
    + +
    + User : + admin +
    +
    + Role : + admin +
    +
    + +
    +
    +
    +
    +
    +
    +
    + <%=curSymbole%> + + + +
    +
    +
    +
    +
    +   + +
    +
    + <%=priceListName%> +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + <% + String styleClass = "label"; + String trStyleClass = ""; + + if ((count.intValue()%2) == 0) + { + //use same color for sales and purchase for time being + if(orderType.equals("POS Order")) + { + trStyleClass = "evenRow"; + } + else if(orderType.equals("POS Goods Receive Note")) + { + trStyleClass = "evenRow"; + } + } + else + { + trStyleClass = "oddRow"; + } + %> + " qty="<%=element.getQty()%>" id="<%= "row" + (count.intValue()+1)%>"> + + + + + + + + + + + + + + + "> + + + + + + + +
    + + + + + " name="qtyPerLine"/> + + + + " name="inclPrice" size="10"/> + + + " name="taxRate"/> + + + + + + + + + " name="discount"/> + + " name="discountedPrice"/> + " name="limitPrice"/> + " name="isDiscOnInclUnitPrice"/> + " name="discInclUnitPrice"/> + " name="isDiscOnPerc"/> + " name="isDiscOnTotal"/> + " name="listPrice"/> +
       +
    + +
    +
    + + " name="inclPrice"/> + + + " format="0.00"/>"id="totalDiscount" name="totalDiscount" class="numeric"/> + + + + + + + " format="0.00"/>" id="grandTotal" name="discountedTotal"/> + + + " id="grandTotal" name="discountedTotal"/> + + + + + + +
    +
    +
    +
    +
    +
    + + + + + + + + + + + + + +
    + Override Price Limit: + + <%=isAllowedOverridePriceLimit%> +
    + Discount Limit: + + <%=discountAllowed%> +
    + Price Limit: + + +
    + +
    +
    +
    +
    + <% String loadScreen = "CreatePOSOrderScreen.do?orderType="+orderType; + %> + "/>')" value="Cancel"/> + + +
    +
    +
    + +
    +
    +
    + Ctrl+Enter APPLY | Ctrl+Space OVERRIDE | Ctrl+Backspace CANCEL +
    +
    +
    +
    + + + + + + + + + + +
    + +
    +
    + +
    +
    +
    + + +
    +
    +
    +
    + + + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/allBlackListCheque.jsp b/posterita/posterita/web/jsp/pos/allBlackListCheque.jsp new file mode 100644 index 0000000000..67e9debf03 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/allBlackListCheque.jsp @@ -0,0 +1,114 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Martine +--%> + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.compiere.model.MOrg" %> +<%@ page import="org.posterita.model.MBlackListCheque" %> +<%@ page import="org.posterita.beans.BlackListedBean" %> +<%@ page import="org.posterita.struts.pos.BlackListedAction" %> + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + +<%@ include file="/jsp/include/posHeader.jsp" %> + + +
    + + + + + + + + + +
    + +
    +
    + +
    + + + + + +   + +
    + + + + +
    +
    +
    + +
    + + + + + + + + <% + String styleClass = "label"; + + if ((count.intValue()%2) != 0) + styleClass = "contentname"; + %> + + + + + + + + + + +
     
    + + + + + + ">Edit +   + ">Delete + +
    +
    + +<%@ include file="/jsp/include/posFooter.jsp" %> + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/cashBookAdjustmentCompleted.jsp b/posterita/posterita/web/jsp/pos/cashBookAdjustmentCompleted.jsp new file mode 100644 index 0000000000..d066f967b3 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/cashBookAdjustmentCompleted.jsp @@ -0,0 +1,55 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.beans.*" %> +<%@ page import="org.posterita.struts.pos.CashBookAction" %> + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + +
    + +
    + + +<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/cashDetails.jsp b/posterita/posterita/web/jsp/pos/cashDetails.jsp new file mode 100644 index 0000000000..0349158bc6 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/cashDetails.jsp @@ -0,0 +1,137 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Ashley +--%> + + +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.beans.ProductBean" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.lib.UdiConstants" %> +<%@ page import="org.posterita.struts.pos.CashAction" %> +<%@ page import="org.posterita.struts.pos.POSGoodsAction" %> +<%@ page import="org.compiere.process.DocAction" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + +
    + <%@ include file="/jsp/include/errors.jsp" %> + + + + + + + <%@ include file="/jsp/include/historyMonthYearFilter.jsp"%> + +
    + + + +
    +
    + + + <% + String url = "CashDetails.do"; + String collection = Constants.CASH_DETAILS; + %> + + + + + + + + + + + + + <% + String styleClass = "label"; + if ((count.intValue()%2) != 0) + styleClass = "contentname"; + %> + + + + + + + + + + + + +
    > + "> + + + > + + > + + + > + + + > + + > + +
    + <%@ include file="/jsp/include/pager.jsp" %> +
    +
    + + +
    + +<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/cashLineDetails.jsp b/posterita/posterita/web/jsp/pos/cashLineDetails.jsp new file mode 100644 index 0000000000..b6486028f5 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/cashLineDetails.jsp @@ -0,0 +1,80 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Ashley +--%> + +<%@ page import="org.posterita.Constants" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + + + + + + + + <% + String styleClass = "label"; + if ((count.intValue()%2) != 0) + styleClass = "contentname"; + %> + + + + + + + +
    + + <% + Integer invoiceId = element.getInvoiceId(); + String cashTypeLink = ""; + if(invoiceId.intValue() == 0) + cashTypeLink = element.getCashTypeName(); + else + { + cashTypeLink = ""; + cashTypeLink += element.getCashTypeName(); + cashTypeLink += ""; + } + %> + + <%= cashTypeLink%> + + + + + + + +
    +
    \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/cashSummary.jsp b/posterita/posterita/web/jsp/pos/cashSummary.jsp new file mode 100644 index 0000000000..97a3cdab72 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/cashSummary.jsp @@ -0,0 +1,53 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Ashley +--%> + +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.beans.ProductBean" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.lib.UdiConstants" %> +<%@ page import="org.posterita.struts.pos.POSReportAction" %> +<%@ page import="org.posterita.struts.pos.POSGoodsAction" %> +<%@ page import="org.compiere.process.DocAction" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + +<% + String requestURI = "CashLineReportAction.do"; +%> + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + +<%@ include file="/jsp/pos/cashSummaryInc.jsp"%> + +<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/cashSummaryDate.jsp b/posterita/posterita/web/jsp/pos/cashSummaryDate.jsp new file mode 100644 index 0000000000..1ad28edb2f --- /dev/null +++ b/posterita/posterita/web/jsp/pos/cashSummaryDate.jsp @@ -0,0 +1,91 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Ashley +--%> + + +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.beans.ProductBean" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.lib.UdiConstants" %> +<%@ page import="org.posterita.struts.pos.POSReportAction" %> +<%@ page import="org.posterita.struts.pos.POSGoodsAction" %> +<%@ page import="org.compiere.process.DocAction" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + +<% + String requestURI = "CashSummaryReportAction.do"; +%> + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + + + + + + + + + +
    + <%@ include file="/jsp/include/dateFilter.jsp" %> +
    +   +
    + <%@ include file="/jsp/pos/cashSummaryInc.jsp"%> +
    +<%@ include file="/jsp/include/posFooter.jsp" %> + + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/cashSummaryInc.jsp b/posterita/posterita/web/jsp/pos/cashSummaryInc.jsp new file mode 100644 index 0000000000..669ab4e9e4 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/cashSummaryInc.jsp @@ -0,0 +1,192 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Ashley +--%> +<%@ page import="org.posterita.Constants" %> + +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="http://displaytag.sf.net" prefix="display" %> +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + +
    + + + + +
    + + + + +
    + + + + +
    + + + + +
    + + + + +
    + + + + +
    + + + + +
    +
    +
    + +
    +			
    +			
    +
    +
    + + + + + +
    +   + + + + +   + +
    +
    + + + + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/chooseFastMovingItemReport.jsp b/posterita/posterita/web/jsp/pos/chooseFastMovingItemReport.jsp new file mode 100644 index 0000000000..e93ac6bffd --- /dev/null +++ b/posterita/posterita/web/jsp/pos/chooseFastMovingItemReport.jsp @@ -0,0 +1,48 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.beans.*" %> +<%@ page import="org.posterita.struts.pos.POSOrderAction" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> +
    + +
    +
    + + +<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/choosePOS.jsp b/posterita/posterita/web/jsp/pos/choosePOS.jsp new file mode 100644 index 0000000000..41dad2e728 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/choosePOS.jsp @@ -0,0 +1,103 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.Constants" %> + +<%@ page import="org.posterita.struts.login.POSLoginAction" %> +<%@ page import="org.posterita.beans.ProductBean" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.lib.UdiConstants" %> + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + +<% +String appName = (String) request.getSession().getAttribute(Constants.APP_NAME); +%> + + + + +<%=appName%> + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/choosePOSInfo.jsp b/posterita/posterita/web/jsp/pos/choosePOSInfo.jsp new file mode 100644 index 0000000000..a967dd2d42 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/choosePOSInfo.jsp @@ -0,0 +1,43 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.beans.*" %> +<%@ page import="org.posterita.struts.pos.POSOrderAction" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> +
    + +
    +
    + + +
    +<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/closeCashBook.jsp b/posterita/posterita/web/jsp/pos/closeCashBook.jsp new file mode 100644 index 0000000000..f30027f221 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/closeCashBook.jsp @@ -0,0 +1,145 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen,Alok +--%> + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.beans.*" %> +<%@ page import="org.posterita.struts.pos.CashBookAction" %> +<%@ page import="org.compiere.process.DocumentEngine" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + +<% int noOfOpenedCashbook = 0;%> + + + + + + + + + + + + + + + + + + + +<% + String styleClass = "label"; + + if ((count.intValue()%2) != 0) + styleClass = "contentname"; +%> + + + + + + + + + + + + + + + + + + + + + + +
    + Cash Book Name + + Beginining Balance + + Ending Balance + + Net Transection + + Status + + Amount transfer + + Transfer Full Amount +
    + + + + + "/> + + + + "/> + + + + + + + + + + + <% noOfOpenedCashbook++; %> + + +
    +
    +
    +<% + if (noOfOpenedCashbook > 0) + { +%> + +   + +<% + } +%> +
    + +
    +<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/closePOSTill.jsp b/posterita/posterita/web/jsp/pos/closePOSTill.jsp new file mode 100644 index 0000000000..2e01d796b2 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/closePOSTill.jsp @@ -0,0 +1,299 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen, Alok +--%> + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.beans.*" %> +<%@ page import="org.posterita.struts.pos.CashBookAction" %> +<%@ page import="org.posterita.businesslogic.POSTerminalManager" %> + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/posterita.tld" prefix="posterita"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + + + + + + +
    +
    + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + + + + + <% + String styleClass = "label"; + %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + +
    + + + + +
    + + + + +
    + + + + "> +
    +   +
    + +
    +
    + +   + +
    +
    + +<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/closedPOSTill.jsp b/posterita/posterita/web/jsp/pos/closedPOSTill.jsp new file mode 100644 index 0000000000..72fa54e41a --- /dev/null +++ b/posterita/posterita/web/jsp/pos/closedPOSTill.jsp @@ -0,0 +1,184 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + +<%@ page import="org.posterita.Constants"%> +<%@ page import="org.posterita.user.*"%> +<%@ page import="org.posterita.beans.*"%> +<%@ page import="org.posterita.struts.pos.CashBookAction"%> +<%@ page import="org.posterita.businesslogic.POSTerminalManager"%> + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt"%> +<%@ taglib uri="/WEB-INF/posterita.tld" prefix="posterita"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + + + + +<%@ include file="/jsp/include/posHeader.jsp"%> +<%@ include file="/jsp/include/errors.jsp"%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    :
    :
    : +
    :
    : +
    :
    :
    :
    :
    :
    :
    :
    :
    + + : +
    + +<%@ include file="/jsp/include/printOrderApplet2.jsp"%> + + + + + + +<%@ include file="/jsp/include/posFooter.jsp"%> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/completePOSOrder.jsp b/posterita/posterita/web/jsp/pos/completePOSOrder.jsp new file mode 100644 index 0000000000..e2b9eea2bc --- /dev/null +++ b/posterita/posterita/web/jsp/pos/completePOSOrder.jsp @@ -0,0 +1,36 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + +<%@ include file="/jsp/include/completePOSOrderIncl.jsp" %> + + diff --git a/posterita/posterita/web/jsp/pos/completePOSOrder2.jsp b/posterita/posterita/web/jsp/pos/completePOSOrder2.jsp new file mode 100644 index 0000000000..b9db816393 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/completePOSOrder2.jsp @@ -0,0 +1,41 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Vishee +--%> + + +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + +<%@ include file="/jsp/include/completePOSOrderIncl.jsp" %> + + + diff --git a/posterita/posterita/web/jsp/pos/completePOSOrder3.jsp b/posterita/posterita/web/jsp/pos/completePOSOrder3.jsp new file mode 100644 index 0000000000..83f171f36e --- /dev/null +++ b/posterita/posterita/web/jsp/pos/completePOSOrder3.jsp @@ -0,0 +1,41 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Vishee +--%> + + +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + +<%@ include file="/jsp/include/completePOSOrderIncl.jsp" %> + + + diff --git a/posterita/posterita/web/jsp/pos/completePOSOrderWA.jsp b/posterita/posterita/web/jsp/pos/completePOSOrderWA.jsp new file mode 100644 index 0000000000..5b999b7e0d --- /dev/null +++ b/posterita/posterita/web/jsp/pos/completePOSOrderWA.jsp @@ -0,0 +1,34 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Vishee +--%> + + +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + +<%@ include file="/jsp/include/completePOSOrderIncl.jsp" %> + diff --git a/posterita/posterita/web/jsp/pos/completePOSShoppingCart.jsp b/posterita/posterita/web/jsp/pos/completePOSShoppingCart.jsp new file mode 100644 index 0000000000..8e8b402414 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/completePOSShoppingCart.jsp @@ -0,0 +1,221 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> +<% + boolean isFullDetails = false; + + if(request.getParameter("isFullDetails") != null) + { + isFullDetails = Boolean.parseBoolean(request.getParameter("isFullDetails")); + } +%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + <%@page import="org.posterita.Constants"%> + + + + + + + + + + + + + <% + if(isFullDetails) + { + %> + + + + <% + } + %> + + + + <%String styleClass = "label"; %> + + + + <% + if ((count.intValue()%2) != 0) + styleClass = "contentname"; + %> + + + + + + + + + + + <% + if(isFullDetails) + { + %> + + + + <% + } + %> + + + + + + + + + + + + + + + <% + if(isFullDetails) + { + %> + + + + <% + } + %> + + + <% styleClass = styleClass.equals("label")? "contentName":"label"; %> + + + + + + + + + <% + if(isFullDetails) + { + %> + + + + <% + } + %> + + + <% styleClass = styleClass.equals("label")? "contentName":"label"; %> + + + + + + + + + <% + if(isFullDetails) + { + %> + + + + <% + } + %> + + + + + + + + + + <% + if(isFullDetails) + { + %> + + + + <% + } + %> + + + +
    > align="right"> align="right"> align="right"> align="right"> align="right"> align="right"> align="right"> align="right"> align="right"> align="right">
    + + + +   + +   + + + + +   + + + + + + +   + + + +
    > + + align="right"> + +
    > + + align="right"> + +
    + + + +   + +   + + + + +   + + + + + + +    
    \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/completedCreditOrder.jsp b/posterita/posterita/web/jsp/pos/completedCreditOrder.jsp new file mode 100644 index 0000000000..3dfe1e1e8c --- /dev/null +++ b/posterita/posterita/web/jsp/pos/completedCreditOrder.jsp @@ -0,0 +1,88 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.compiere.model.MOrder" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.struts.pos.POSOrderAction" %> +<%@ page import="java.util.ArrayList" %> + + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + +
    + + +
    + +<%@ include file="/jsp/pos/orderHeader.jsp" %> +<% String orderlines = Constants.POS_ORDER_LINES; %> +<%@ include file="/jsp/pos/completePOSShoppingCart.jsp" %> + +
    + + + + + + + + + + +
     
    + +
    + + +
    + +<%@ include file="/jsp/include/printOrderApplet.jsp" %> +<%@ include file="/jsp/include/posFooter.jsp" %> + + diff --git a/posterita/posterita/web/jsp/pos/completedCustomerReturnOrder.jsp b/posterita/posterita/web/jsp/pos/completedCustomerReturnOrder.jsp new file mode 100644 index 0000000000..2d6e9e476f --- /dev/null +++ b/posterita/posterita/web/jsp/pos/completedCustomerReturnOrder.jsp @@ -0,0 +1,102 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.compiere.model.MOrder" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="java.util.ArrayList" %> + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + +
    + + + + +
    + + + +
    + +
    + <%@ include file="/jsp/pos/orderHeader.jsp" %> + <% String orderlines = Constants.CUSTOMER_RETURN_ORDER_LINES; %> + <%@ include file="/jsp/pos/completePOSShoppingCart.jsp" %> +
    + + +
    + + +<%@ include file="/jsp/include/printOrderApplet.jsp" %> +<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/completedGoodsReceiveNote.jsp b/posterita/posterita/web/jsp/pos/completedGoodsReceiveNote.jsp new file mode 100644 index 0000000000..46d7dd7dd2 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/completedGoodsReceiveNote.jsp @@ -0,0 +1,88 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.compiere.model.MOrder" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="java.util.ArrayList" %> + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + +
    + <%@ include file="/jsp/pos/orderHeader.jsp" %> + <% String orderlines = Constants.GOODS_RECEIVE_NOTE_LINES; %> + <%@ include file="/jsp/pos/completePOSShoppingCart.jsp" %> +
    +
    + + + + + + + +
    +   +
    + + + + + + +
    + +<%@ include file="/jsp/include/printOrderApplet.jsp" %> +<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/completedGoodsReturnNote.jsp b/posterita/posterita/web/jsp/pos/completedGoodsReturnNote.jsp new file mode 100644 index 0000000000..dfc20a75a7 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/completedGoodsReturnNote.jsp @@ -0,0 +1,89 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.compiere.model.MOrder" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="java.util.ArrayList" %> + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + +<%@ include file="/jsp/pos/orderHeader.jsp" %> +<% String orderlines = Constants.GOODS_RETURN_NOTE_LINES; %> +<%@ include file="/jsp/pos/completePOSShoppingCart.jsp" %> + + + + + + + + +
    +

    +
    + +
    +
    + + + + + + +
    + + +<%@ include file="/jsp/include/printOrderApplet.jsp" %> +<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/createAPPayment.jsp b/posterita/posterita/web/jsp/pos/createAPPayment.jsp new file mode 100644 index 0000000000..c9c8f4b6e3 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/createAPPayment.jsp @@ -0,0 +1,82 @@ + +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.struts.pos.PaymentAction" %> +<%@ page import="org.compiere.model.MProduct" %> +<%@ page import="org.posterita.beans.ProductBean" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.lib.UdiConstants" %> +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + + + + + + + + + + +
    +
    + + +
    +
    + <%@ include file="/jsp/include/vendorInfoPanel.jsp" %> + + <%@ include file="/jsp/include/tenderPanel.jsp" %> +
    + +   + +
    +
    + +<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/createBlackListCheque.jsp b/posterita/posterita/web/jsp/pos/createBlackListCheque.jsp new file mode 100644 index 0000000000..010738d848 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/createBlackListCheque.jsp @@ -0,0 +1,81 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Martine +--%> + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + * + + +
    + * + + +
    + +   + +
    + +
    + + +<%@ include file="/jsp/include/posFooter.jsp" %> + + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/createCreditOrder.jsp b/posterita/posterita/web/jsp/pos/createCreditOrder.jsp new file mode 100644 index 0000000000..6b2f4ad22a --- /dev/null +++ b/posterita/posterita/web/jsp/pos/createCreditOrder.jsp @@ -0,0 +1,114 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + + +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.struts.pos.POSOrderAction" %> +<%@ page import="org.posterita.beans.ProductBean" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.lib.UdiConstants" %> +<%@ page import="org.compiere.model.MOrder" %> +<%@ page import="org.posterita.order.UDIOrderTypes" %> + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + +
    + "> + Create New + +
    +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + <%@ include file="/jsp/include/creditOrderWithAdvanced.jsp" %> + <%@ include file="/jsp/include/pinPanel.jsp" %> + + +<%@ include file="/js/createPOSOrder.js" %> + + + + +<%@ include file="/jsp/include/posFooter.jsp" %> + diff --git a/posterita/posterita/web/jsp/pos/createCreditOrder2.jsp b/posterita/posterita/web/jsp/pos/createCreditOrder2.jsp new file mode 100644 index 0000000000..5e22c8f362 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/createCreditOrder2.jsp @@ -0,0 +1,347 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.Constants" %> + + +<%@ page import="org.posterita.struts.pos.POSOrderAction" %> +<%@ page import="org.posterita.beans.ProductBean" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.lib.UdiConstants" %> +<%@ page import="org.posterita.struts.pos.POSGoodsAction" %> + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + + +
    + + + + + + + + + + +   + +
    + + + <%@ include file="/jsp/include/searchProductPanel.jsp" %> +  
    +
    +
    + <%@ include file="/jsp/pos/customerReturnShoppingCart.jsp" %> +
    +
    + + + + + +
    +
    + : +
    +
    + +
    + + +
    +
    +
    +   +
    +
    + + + + + + + + + + + + + + + + + + + - + + + + + + + +
    + +
    + + +<%@ include file="/jsp/include/posFooter.jsp" %> + diff --git a/posterita/posterita/web/jsp/pos/createMultipleAPInvoicePayment.jsp b/posterita/posterita/web/jsp/pos/createMultipleAPInvoicePayment.jsp new file mode 100644 index 0000000000..01b5d1849e --- /dev/null +++ b/posterita/posterita/web/jsp/pos/createMultipleAPInvoicePayment.jsp @@ -0,0 +1,218 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.struts.pos.PaymentAction" %> +<%@ page import="org.compiere.model.MProduct" %> +<%@ page import="org.posterita.beans.ProductBean" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.lib.UdiConstants" %> +<%@ page import="org.posterita.form.PaymentForm" %> +<%@ page import="java.math.BigDecimal" %> +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + + + + + + + + + + + + + + + + + + + <% + double openAmtTotal = 0.0d; + double paidAmtTotal = 0.0d; + double discountAmtTotal = 0.0d; + double invoiceGrandTotal = 0.0d; + %> + + + + <% + String styleClass = "label"; + if ((count.intValue()%2) != 0) + styleClass = "contentname"; + %> + + + + + + + + + + + + + <% + String defaultAllocateAmount = "0"; + + + PaymentForm form = (PaymentForm)request.getAttribute("PaymentForm"); + + if(form!=null) + { + String[] allocateAmount = form.getAllocateAmount(); + + + if(allocateAmount!= null) + if(allocateAmount.length!=0) + defaultAllocateAmount = allocateAmount[count.intValue()]; + } + %> + + + + + + <% + openAmtTotal += element.getOpenAmt().doubleValue(); + paidAmtTotal += element.getPaidAmt().doubleValue(); + discountAmtTotal += element.getDiscountAmt().doubleValue(); + invoiceGrandTotal += element.getInvoiceGrandTotal().doubleValue(); + %> + + + + + + + + + + + + + + +
    +
    + + +
    +
    + + + + + + + + + + + + + + + +
    > + + + + > + + > + + > + + > + + > + + > + + + > + +
    Total<%=invoiceGrandTotal%><%=discountAmtTotal%><%=paidAmtTotal%><%=openAmtTotal%> 
    + <%@ include file="/jsp/include/tenderPanel2.jsp" %> +
    + +   + +
    +
    +<%@ include file="/jsp/include/posFooter.jsp" %> + diff --git a/posterita/posterita/web/jsp/pos/createMultipleIAPnvoicePayment.jsp b/posterita/posterita/web/jsp/pos/createMultipleIAPnvoicePayment.jsp new file mode 100644 index 0000000000..91da6ca9c8 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/createMultipleIAPnvoicePayment.jsp @@ -0,0 +1,218 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.struts.pos.PaymentAction" %> +<%@ page import="org.compiere.model.MProduct" %> +<%@ page import="org.posterita.beans.ProductBean" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.lib.UdiConstants" %> +<%@ page import="org.posterita.form.PaymentForm" %> +<%@ page import="java.math.BigDecimal" %> +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + + + + + + + + + + + + + + + + + + + <% + double openAmtTotal = 0.0d; + double paidAmtTotal = 0.0d; + double discountAmtTotal = 0.0d; + double invoiceGrandTotal = 0.0d; + %> + + + + <% + String styleClass = "label"; + if ((count.intValue()%2) != 0) + styleClass = "contentname"; + %> + + + + + + + + + + + + + <% + String defaultAllocateAmount = "0"; + + + PaymentForm form = (PaymentForm)request.getAttribute("PaymentForm"); + + if(form!=null) + { + String[] allocateAmount = form.getAllocateAmount(); + + + if(allocateAmount!= null) + if(allocateAmount.length!=0) + defaultAllocateAmount = allocateAmount[count.intValue()]; + } + %> + + + + + + <% + openAmtTotal += element.getOpenAmt().doubleValue(); + paidAmtTotal += element.getPaidAmt().doubleValue(); + discountAmtTotal += element.getDiscountAmt().doubleValue(); + invoiceGrandTotal += element.getInvoiceGrandTotal().doubleValue(); + %> + + + + + + + + + + + + + + +
    +
    + + +
    +
    + + + + + + + + + + + + + + + +
    > + + + + > + + > + + > + + > + + > + + > + + + > + +
    Total<%=invoiceGrandTotal%><%=discountAmtTotal%><%=paidAmtTotal%><%=openAmtTotal%> 
    + <%@ include file="/jsp/include/tenderPanel.jsp" %> +
    + +   + +
    +
    +<%@ include file="/jsp/include/posFooter.jsp" %> + diff --git a/posterita/posterita/web/jsp/pos/createMultipleInvoicePayment.jsp b/posterita/posterita/web/jsp/pos/createMultipleInvoicePayment.jsp new file mode 100644 index 0000000000..0a172be1d4 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/createMultipleInvoicePayment.jsp @@ -0,0 +1,218 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.struts.pos.PaymentAction" %> +<%@ page import="org.compiere.model.MProduct" %> +<%@ page import="org.posterita.beans.ProductBean" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.lib.UdiConstants" %> +<%@ page import="org.posterita.form.PaymentForm" %> +<%@ page import="java.math.BigDecimal" %> +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + + + + + + + + + + + + + + + + + + + <% + double openAmtTotal = 0.0d; + double paidAmtTotal = 0.0d; + double discountAmtTotal = 0.0d; + double invoiceGrandTotal = 0.0d; + %> + + + + <% + String styleClass = "label"; + if ((count.intValue()%2) != 0) + styleClass = "contentname"; + %> + + + + + + + + + + + + + <% + String defaultAllocateAmount = "0"; + + + PaymentForm form = (PaymentForm)request.getAttribute("PaymentForm"); + + if(form!=null) + { + String[] allocateAmount = form.getAllocateAmount(); + + + if(allocateAmount!= null) + if(allocateAmount.length!=0) + defaultAllocateAmount = allocateAmount[count.intValue()]; + } + %> + + + + + + <% + openAmtTotal += element.getOpenAmt().doubleValue(); + paidAmtTotal += element.getPaidAmt().doubleValue(); + discountAmtTotal += element.getDiscountAmt().doubleValue(); + invoiceGrandTotal += element.getInvoiceGrandTotal().doubleValue(); + %> + + + + + + + + + + + + + + +
    +
    + + +
    +
    + + + + + + + + + + + + + + + +
    > + + + + > + + > + + > + + > + + > + + > + + + > + +
    Total<%=invoiceGrandTotal%><%=discountAmtTotal%><%=paidAmtTotal%><%=openAmtTotal%> 
    + <%@ include file="/jsp/include/tenderPanel.jsp" %> +
    + +   + +
    +
    +<%@ include file="/jsp/include/posFooter.jsp" %> + diff --git a/posterita/posterita/web/jsp/pos/createOrUpdatePriceList.jsp b/posterita/posterita/web/jsp/pos/createOrUpdatePriceList.jsp new file mode 100644 index 0000000000..fe6c49ca2b --- /dev/null +++ b/posterita/posterita/web/jsp/pos/createOrUpdatePriceList.jsp @@ -0,0 +1,169 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2008 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author sendy +--%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> +<%@page import="org.posterita.Constants"%> +<%@page import="org.posterita.struts.pos.PriceListAction"%> +Price List +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + Previous + + "> + Next + + "> + Create PriceList + +
    + + + +
    + + + + + + + +
    + + + + +
    + + + +
    + + + +
    + + + +
    + + + +
    + + + +
    + +
    + + + + + + + + + + + + + + +
    +   +
    +
    + +<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/createOrUpdateProduct.jsp b/posterita/posterita/web/jsp/pos/createOrUpdateProduct.jsp new file mode 100644 index 0000000000..9d820ad81f --- /dev/null +++ b/posterita/posterita/web/jsp/pos/createOrUpdateProduct.jsp @@ -0,0 +1,586 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2008 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author sendy +--%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> +<%@page import="org.posterita.struts.pos.POSProductAction"%> +<%@page import="org.posterita.Constants"%> +<%@page import="org.compiere.model.MProduct"%> +<%@page import="java.math.BigDecimal"%> +<%@page import="org.posterita.beans.ProductBean"%> +Product +<%@ include file="/jsp/include/posHeaderAdministration.jsp" %> +<%@ include file="/jsp/include/errorMsg.jsp" %> + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    + + Image Upload + + + + +
    +
    + + + + * + + + + + +
    + + + + * + + + + +
    + + + + * + + + + + + +
    + + + + * + + + + + + +
    + + + + * + + + + + + +
    + + + + + +
    + + + + * + + + + +
    + + + + + +
    + + + + + + + + +
    + + + + + +
    + + + + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + <% + String styleClass = "oddRow"; + + if(index.intValue()%2 == 0) + { + styleClass = "evenRow"; + } + + %> + + " class="<%=styleClass%>" onMouseOver="this.className='highlight'" onMouseOut="this.className='oddRow'""> + + + + + + + + + + + + + + + + + + +
    + + + + +
    + +
    +
    +
    + +
    +
    +
    + +
    +
    +
    + +
    +
    +
    + +
    +
    +
    + +
    +
    + +
    + +
    +
    +
    + +
    +
    + +
    + +
    +
    + + + + * + + + + + + + + + + + + + + + + + + + + + +     
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + Stock Qty: +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Sales Figures
    + Period + + Sales + + Total Amt +
    + Today + + + + +
    + Current Week + + + + +
    + Current Month + + + + +
    + 6 Months + + + + +
    + Current Year + + + + +
    +
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    + Save Changes +
    +
    +
    +
    + Ctrl-N New Product | Ctrl-I Import Products | Ctrl+M Menu | + Ctrl-D Open Drawer | Ctrl-Left Previous Product | Ctrl-Right Next Product | F4 Save +
    +
    +
    + + diff --git a/posterita/posterita/web/jsp/pos/createOrUpdateProduct2.jsp b/posterita/posterita/web/jsp/pos/createOrUpdateProduct2.jsp new file mode 100644 index 0000000000..7c67705395 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/createOrUpdateProduct2.jsp @@ -0,0 +1,270 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2008 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author sendy +--%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> +<%@page import="org.posterita.struts.pos.POSProductAction"%> +<%@page import="org.posterita.Constants"%> +<%@page import="org.compiere.model.MProduct"%> +<%@page import="java.math.BigDecimal"%> +<%@page import="org.posterita.beans.ProductBean"%> +Product + +<%@ include file="/jsp/include/posHeader2.jsp" %> + + +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + "> + Create Product + +
    + + + +
    + * + + + +
    + * + + +
    + * + + + + +
    + * + + + + + +
    + * + + + + +
    + * + + +
    +
    + + + +
    + + + + +
    + + +
    + + + +
    + + + +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + "> + + + + + + + + + + + + + + + + + + +
      
    + + * + + + + + + + + + + + + + + + + + + + + +     
    +
    +
    + + + + +
    + Save + Close +
    + +
    + +
    + + + +
    + + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/createPOSGarmentProducts.jsp b/posterita/posterita/web/jsp/pos/createPOSGarmentProducts.jsp new file mode 100644 index 0000000000..75f1f8b116 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/createPOSGarmentProducts.jsp @@ -0,0 +1,551 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.Constants" %> + + +<%@ page import="org.posterita.struts.pos.POSOrderAction" %> +<%@ page import="org.posterita.beans.ProductBean" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.lib.UdiConstants" %> + +<%@ page import="org.posterita.struts.pos.POSProductAction" %> + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + +
    +
    +Garment Details + + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    * + +
    * + + +
    +
    * + + +
    +
    * + + +
    +
    * + + +
    +
    * + + +
    +
    + + + + + +
    + + + +
    + + + +
    +
    + + + + + + + + + + + + +
    + * + + + + + + +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + * + + + + + + +
    + * + + + + + + +
    + * + + + + + + +
    +
    +
    +
    + + + + +
    +
    + * + + + + + + + + + +
    +
    + Select: + All + None + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + +
    + + + +
    + + + +
    + + + +
    + + + +
    + + + +
    +
    +
    +
    + Select: + All + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + +
    + + + + + + + +
    + + + + + + + +
    + + + + + + + +
    + + + +
    + + + +
    +
    +
    +
    + Select: + All + None + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + +
    + + + +
    + + + +
    + + + +
    + + + +
    + + + +
    + + + +
    +
    +
    + +
    +
    +
    +
    +   +
    +
    + +
    + + + + +<%@ include file="/jsp/include/posFooter.jsp" %> + diff --git a/posterita/posterita/web/jsp/pos/createPOSOrder.jsp b/posterita/posterita/web/jsp/pos/createPOSOrder.jsp new file mode 100644 index 0000000000..4fbb9fc75f --- /dev/null +++ b/posterita/posterita/web/jsp/pos/createPOSOrder.jsp @@ -0,0 +1,122 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + + +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.Constants" %> + + +<%@ page import="org.posterita.struts.pos.POSOrderAction" %> +<%@ page import="org.posterita.beans.ProductBean" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.lib.UdiConstants" %> +<%@ page import="org.compiere.model.MOrder" %> +<%@ page import="org.posterita.order.UDIOrderTypes" %> + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + <%@ include file="/jsp/include/posOrderWithAdvanced.jsp" %> + + +<%@ include file="/js/createPOSOrder.js" %> + + + +<%@ include file="/jsp/include/posFooter.jsp" %> + diff --git a/posterita/posterita/web/jsp/pos/createPOSOrder2.jsp b/posterita/posterita/web/jsp/pos/createPOSOrder2.jsp new file mode 100644 index 0000000000..096c503ff7 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/createPOSOrder2.jsp @@ -0,0 +1,100 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Vishee +--%> + + + +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.Constants" %> + + +<%@ page import="org.posterita.struts.pos.POSOrderAction" %> +<%@ page import="org.posterita.beans.ProductBean" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.lib.UdiConstants" %> +<%@ page import="org.compiere.model.MOrder" %> + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + <%@ include file="/jsp/include/posOrderWithAdvancedFocusSearch.jsp" %> + + +<%@ include file="/js/createPOSOrder.js" %> + + + + +<%@ include file="/jsp/include/posFooter.jsp" %> + diff --git a/posterita/posterita/web/jsp/pos/createPOSOrder3.jsp b/posterita/posterita/web/jsp/pos/createPOSOrder3.jsp new file mode 100644 index 0000000000..09f549b601 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/createPOSOrder3.jsp @@ -0,0 +1,89 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Vishee +--%> + + + + +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.Constants" %> + + +<%@ page import="org.posterita.struts.pos.POSOrderAction" %> +<%@ page import="org.posterita.beans.ProductBean" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.lib.UdiConstants" %> +<%@ page import="org.compiere.model.MOrder" %> +<%@ page import="org.posterita.Constants" %> + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + <%@ include file="/jsp/include/posOrder.jsp" %> + + +<%@ include file="/js/createPOSOrder.js" %> + + + + +<%@ include file="/jsp/include/posFooter.jsp" %> + diff --git a/posterita/posterita/web/jsp/pos/createPOSOrderWithoutAdvance.jsp b/posterita/posterita/web/jsp/pos/createPOSOrderWithoutAdvance.jsp new file mode 100644 index 0000000000..5d203824ef --- /dev/null +++ b/posterita/posterita/web/jsp/pos/createPOSOrderWithoutAdvance.jsp @@ -0,0 +1,86 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Vishee +--%> + + +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.Constants" %> + + +<%@ page import="org.posterita.struts.pos.POSOrderAction" %> +<%@ page import="org.posterita.beans.ProductBean" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.lib.UdiConstants" %> +<%@ page import="org.compiere.model.MOrder" %> + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + <%@ include file="/jsp/include/posOrder.jsp" %> + + +<%@ include file="/js/createPOSOrder.js" %> + + + + +<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/createPOSProduct.jsp b/posterita/posterita/web/jsp/pos/createPOSProduct.jsp new file mode 100644 index 0000000000..e3354590b0 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/createPOSProduct.jsp @@ -0,0 +1,310 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok, Preveen +--%> + + +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.Constants" %> + +<%@ page import="org.compiere.model.MProduct" %> + + +<%@ page import="org.posterita.struts.pos.POSOrderAction" %> +<%@ page import="org.posterita.beans.ProductBean" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.lib.UdiConstants" %> + +<%@ page import="org.posterita.struts.pos.POSProductAction" %> + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + +
    +
    Barcode already exists!
    +
    Product name already exists!
    +
    + + + + +
    +
    + + + + + + + + + + + + + + + + +
    + + + +
    + * + + + +
    + * + + +
    +
    +
    + + + + + + +
    +
    + + + + + + + + + + + + +
    + * + + + + + + +
    +
    +
    + + + + + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + * + + + + + + +
    + * + + + + + + +
    + * + + + + + + +
    +
    +
    + + + + + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + * + + + + +
    + * + + + + +
    + * + + + + +
    + * + + + +
    +
    + + + +
    + + + +
    + + + + +
    + + +
    + + + +
    + + + +
    +
    +
    + + + + + + + +   + + +   + + +
    + +<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/createPOSUser.jsp b/posterita/posterita/web/jsp/pos/createPOSUser.jsp new file mode 100644 index 0000000000..c8a0b6f683 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/createPOSUser.jsp @@ -0,0 +1,281 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.beans.UDIBean" %> +<%@ page import="org.compiere.model.MCommission" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + + + + + + + + + + +
    + + + + + + + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    * + + + +
    + * + + + + +
    *
    + +
    * + + +
    * + +
    +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + +
    + +
    + +
    + +
    +
    +
    +
    + + + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + +
    + + + +
    + + + + Invoice + Order + Payment Receipts + + +
    + + + +
    + + + +
    + + + + Weekly + Monthly + Quarterly + Yearly + + +
    +
    +
    +
    + +   + + +
    + + + + + + + +
    +
    +
    + + + +
    +
    +
    +
    + +
    + + + + + + + + +<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/createPartialPOSOrder.jsp b/posterita/posterita/web/jsp/pos/createPartialPOSOrder.jsp new file mode 100644 index 0000000000..13a8106f9d --- /dev/null +++ b/posterita/posterita/web/jsp/pos/createPartialPOSOrder.jsp @@ -0,0 +1,467 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + + +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.Constants" %> + + +<%@ page import="org.posterita.struts.pos.POSOrderAction" %> +<%@ page import="org.posterita.beans.ProductBean" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.lib.UdiConstants" %> +<%@ page import="org.compiere.model.MOrder" %> + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + + + + + + + +
    + + + + + + + + + +   +
    + + +
    + <%@ include file="/jsp/include/searchProductPanel.jsp" %> +
    +
     
    +
    +
    + <%@ include file="/jsp/pos/partialPOSOrderShoppingCart.jsp" %> +
    +
    + + + + + + +
    + <%@ include file="/jsp/include/tenderPanel.jsp" %> + + <%@ include file="/jsp/include/customerInfoPanel.jsp" %> + + + + + + + + +
    +   +
    +   +
    +
    +
     
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +<%@ include file="/jsp/include/posFooter.jsp" %> + diff --git a/posterita/posterita/web/jsp/pos/createPayment.jsp b/posterita/posterita/web/jsp/pos/createPayment.jsp new file mode 100644 index 0000000000..3c3d2da6a8 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/createPayment.jsp @@ -0,0 +1,81 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.struts.pos.PaymentAction" %> +<%@ page import="org.compiere.model.MProduct" %> +<%@ page import="org.posterita.beans.ProductBean" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.lib.UdiConstants" %> +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + + + + + + + + + + +
    +
    + + +
    +
    + <%@ include file="/jsp/include/customerInfoPanel2.jsp" %> + + <%@ include file="/jsp/include/tenderPanel.jsp" %> +
    + +   + +
    +
    + +<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/createPaymentTerm.jsp b/posterita/posterita/web/jsp/pos/createPaymentTerm.jsp new file mode 100644 index 0000000000..0d5e306386 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/createPaymentTerm.jsp @@ -0,0 +1,84 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.struts.pos.PaymentTermAction" %> +<%@ page import="org.compiere.model.MProduct" %> +<%@ page import="org.posterita.beans.ProductBean" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.lib.UdiConstants" %> +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + <%@ include file="/jsp/include/paymentTermsDetails.jsp" %> + + + + + +
      + +   + +  
    +
    + + +<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/createProductForm.jsp b/posterita/posterita/web/jsp/pos/createProductForm.jsp new file mode 100644 index 0000000000..05b02add9a --- /dev/null +++ b/posterita/posterita/web/jsp/pos/createProductForm.jsp @@ -0,0 +1,272 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2008 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author sendy +--%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> +<%@page import="org.posterita.struts.pos.POSProductAction"%> +<%@page import="org.posterita.Constants"%> +<%@page import="org.compiere.model.MProduct"%> +<%@page import="java.math.BigDecimal"%> +<%@page import="org.posterita.beans.ProductBean"%> + + + + + + + Ashish + + + + + + + + + + + + + + + + +
    + + + Create Product + + + Update Product + + +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + "> + Create Product + +
    + + + +
    + * + + + +
    + * + + +
    + * + + + + +
    + * + + + + + +
    + * + + + + +
    + * + + +
    + + + +
    + + + + +
    + + +
    + + + +
    + + + +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + "> + + + + + + + + + + + + + + + + + + +
      
    + + * + + + + + + + + + + + + + + + + + + + + +     
    +
    + + + + + +
    +   +  
    + +
    + +
    + + + +
    + + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/createRole.jsp b/posterita/posterita/web/jsp/pos/createRole.jsp new file mode 100644 index 0000000000..3da849aa03 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/createRole.jsp @@ -0,0 +1,228 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.beans.UDIBean" %> +<%@ page import="org.posterita.core.MenuItem" %> + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + +
    + * + + + + +
    + + + +
    + + + +
    + + + +
    + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + +
    + <%-- --%> + + + +
    + +
    + + + + +
    +
    + + Clear All + + + Select All + + + + +
    + +
    +<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/createTax.jsp b/posterita/posterita/web/jsp/pos/createTax.jsp new file mode 100644 index 0000000000..bedba677c8 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/createTax.jsp @@ -0,0 +1,50 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.struts.pos.TaxAction" %> +<%@ page import="org.compiere.model.MProduct" %> +<%@ page import="org.posterita.beans.ProductBean" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.lib.UdiConstants" %> +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + +<%@ include file="/jsp/include/taxDetails.jsp" %> + +<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/createVendor.jsp b/posterita/posterita/web/jsp/pos/createVendor.jsp new file mode 100644 index 0000000000..1c4664c5b9 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/createVendor.jsp @@ -0,0 +1,119 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Martine +--%> + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.beans.UDIBean" %> +<%@ page import="org.posterita.core.MenuItem" %> + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + + + + + + + +
    +
    + + + + + + + + + +
    + * + + +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + + + + + + + + + + + + + + +
     
    +
    +
    + + +   + + + + +
    +<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/createdCashPayment.jsp b/posterita/posterita/web/jsp/pos/createdCashPayment.jsp new file mode 100644 index 0000000000..08001d24dc --- /dev/null +++ b/posterita/posterita/web/jsp/pos/createdCashPayment.jsp @@ -0,0 +1,105 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.compiere.model.MOrder" %> +<%@ page import="org.compiere.model.MInOut" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.struts.pos.POSOrderAction" %> +<%@ page import="org.compiere.process.DocumentEngine" %> +<%@ page import="java.util.ArrayList" %> +<%@ page import="org.compiere.process.DocAction" %> +<%@ page import="org.posterita.struts.pos.CashBookAction" %> + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + <%@ include file="/jsp/pos/webDocumentHeader.jsp" %> + + + + + + + + + + +
    + + Payment By: +
    +
    + :
    + +
    + +
    +
    + + + + + + + + + + + +
    ::
    + + + + + +
    +
    + +
    +
    +
    + +
    +
    +<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/createdProducts.jsp b/posterita/posterita/web/jsp/pos/createdProducts.jsp new file mode 100644 index 0000000000..ef2d252e18 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/createdProducts.jsp @@ -0,0 +1,63 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.beans.*" %> +<%@ page import="org.posterita.struts.pos.POSStockAction" %> +<%@ page import="org.compiere.process.DocumentEngine" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + + +<% + String styleClass = "label"; + if ((count.intValue()%2) != 0) + styleClass = "contentname"; +%> + + + + +
     
    >
    + +<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/creditOrderPayment.jsp b/posterita/posterita/web/jsp/pos/creditOrderPayment.jsp new file mode 100644 index 0000000000..690879dedd --- /dev/null +++ b/posterita/posterita/web/jsp/pos/creditOrderPayment.jsp @@ -0,0 +1,277 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.beans.*" %> +<%@ page import="org.posterita.struts.pos.CreditOrderAction" %> +<%@ page import="org.compiere.process.DocumentEngine" %> +<%@ page import="java.util.Iterator" %> +<%@ page import="java.util.ArrayList" %> +<%@ page import="org.posterita.core.UDIPair" %> +<%@ page import="org.compiere.model.MInvoice" %> +<%@ page import="org.compiere.model.MPayment" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +  
    + + + +  
    + + + +  
    + + + +  
    + + + + + + + +
    + + + + + + + + +
    + +
    + +
    + + + + + + + + + + + + <%-- + + + + --%> +
    +   + +   + +   +
    + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + Cash + Card + Cheque + + + +
    + +
    +
    + + +
    +
    + + +
    +
    +
    +
    +
    +
    + +   + +
    +
    + +<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/creditOrderShoppingCart.jsp b/posterita/posterita/web/jsp/pos/creditOrderShoppingCart.jsp new file mode 100644 index 0000000000..7f21f6d2ed --- /dev/null +++ b/posterita/posterita/web/jsp/pos/creditOrderShoppingCart.jsp @@ -0,0 +1,24 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + +<% String items = Constants.CREDIT_ORDER_SHOPPING_CART_ITEMS; %> +<%@ include file="/jsp/pos/posShoppingCart.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/creditScreen.jsp b/posterita/posterita/web/jsp/pos/creditScreen.jsp new file mode 100644 index 0000000000..3508735893 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/creditScreen.jsp @@ -0,0 +1,246 @@ +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + +<% + String path = request.getContextPath(); + String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; + //String appName = (String) request.getSession().getAttribute(Constants.APP_NAME); + Properties ctx = TmkJSPEnv.getCtx(request); + String posName = POSTerminalManager.getTerminalName(ctx); + String orgName = MOrg.get(ctx, Env.getContextAsInt(ctx, UdiConstants.ORG_ID_CTX_PARAM)).getName(); + String roleName = MRole.get(ctx, Env.getContextAsInt(ctx, UdiConstants.AD_ROLE_ID)).getName(); + int m_pricelist_id = POSTerminalManager.getSOPriceListId(ctx); + MPriceList priceList = MPriceList.get(ctx, m_pricelist_id, null); + String priceListName = priceList.getName(); + String orderType = UDIOrderTypes.CREDIT_ORDER.getOrderType(); + request.getSession().setAttribute(Constants.ORDER_TYPE, orderType); + + Object bPId = request.getSession().getAttribute(Constants.BPARTNER_ID); + Object bPName = request.getSession().getAttribute(Constants.BPARTNER_NAME); + Object bPCredit = request.getSession().getAttribute(Constants.BPARTNER_CREDIT); + String bPartnerId = bPId == null? "":bPId.toString(); + String bPartnerName = bPName == null? "": bPName.toString(); + String bPartnerCredit = bPCredit == null? "": bPCredit.toString(); + //set configuration + Configuration configuration = Configuration.getConfiguration(request); + String paymentRule = configuration.getPaymentRule(); + String searchProductBy = configuration.getSearchProductBy(); + boolean isCustomerCompulsory = configuration.isCustomerCompulsory(); +%> + +<%@page import="java.util.Properties"%> +<%@page import="org.posterita.core.TmkJSPEnv"%> +<%@page import="org.compiere.util.Env"%> +<%@page import="org.posterita.lib.UdiConstants"%> +<%@page import="org.compiere.model.MPriceList"%> +<%@page import="org.compiere.model.MOrg"%> +<%@page import="org.compiere.model.MRole"%> +<%@page import="org.posterita.businesslogic.ShoppingcartManager"%> +<%@page import="org.posterita.core.Configuration"%> +<%@page import="org.posterita.user.WebUserInfo"%> +<%@page import="org.posterita.businesslogic.POSTerminalManager"%> +<%@page import="org.posterita.order.UDIOrderTypes.CreditOrder"%> +<%@page import="org.posterita.order.UDIOrderTypes"%> +<%@page import="org.posterita.Constants"%> + + + + + + + + + + + + + + + + + + + +<%@ include file="/jsp/include/showErrors.jsp" %> +
    Please wait...
    + + + + +
    + +
    + +
    + + + + + + +
    + + + + +
    +
    + +
    +
    +
    + + + + + " styleId="priceListId"/> + + + + + + + + + + + + +
    +
    + <%= ShoppingcartManager.getShoppingcartAsHTML(request)%> +
    + +
    + +
    + +
    CLEAR
    +
    SHORTCUTS
    + +
    CHECKOUT
    +
    DISCOUNT
    +
    +
    +
    +
    + F1 Barcode | F2 Name | F3 Description | F4 Qty | F5 Customer | + Ctrl+Up MoveUp | Ctrl+Down MoveDown | Ctrl+Left Increment | Ctrl-Right Decrement | Ctrl-Backspace Remove | Ctrl-Esc Menu | + Ctrl-Delete Clear | Ctrl-Space Checkout | Ctrl-Esc Menu
    + + + + + + +
    +
    $0.00
    +
    + +
    + <%=priceListName%> +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + +
    +
    +
    +
    +
    + +
    +
    +
    + + + + + + + + +
    + +    
    +
    + +
    + +
    +
    + <%=bPartnerId%>
    + <%=bPartnerName%>
    +
    + <%=bPartnerCredit%>
    +
    +
    + +

    + + + +
    + + diff --git a/posterita/posterita/web/jsp/pos/creditorHistory.jsp b/posterita/posterita/web/jsp/pos/creditorHistory.jsp new file mode 100644 index 0000000000..a6c386192f --- /dev/null +++ b/posterita/posterita/web/jsp/pos/creditorHistory.jsp @@ -0,0 +1,89 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2008 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * +--%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> +<%@page import="org.compiere.model.MBPartner"%> +<%@page import="org.posterita.core.TmkJSPEnv"%> +<%@page import="java.util.Properties"%> + +<%@ include file="/jsp/include/posHeader.jsp" %> + + +<%@page import="org.posterita.businesslogic.administration.BPartnerManager"%> +<%@page import="java.util.ArrayList"%> +<%@page import="java.util.Iterator"%> +<%@page import="org.posterita.Constants"%> +<% +BPartnerBean bean = (BPartnerBean)request.getSession().getAttribute(Constants.BPARTNER); +int c_bpartner_id = bean.getBpartnerId().intValue(); +MBPartner partner = MBPartner.get(ctx, c_bpartner_id); +String bpName = partner.getName(); + +if(partner.getName2() != null) +{ + bpName = bpName + " " + partner.getName2(); + bpName = bpName.trim(); +} +%> + +<%@page import="org.posterita.beans.BPartnerBean"%> +
    +

    + : <%=bpName.toUpperCase()%> +

    + + + + + + + + + + + + + + + + + + + + + +
    + + "> + + + + "> + + + + "> + +
    +
    +<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/custRetShoppingCart.jsp b/posterita/posterita/web/jsp/pos/custRetShoppingCart.jsp new file mode 100644 index 0000000000..ae97a73831 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/custRetShoppingCart.jsp @@ -0,0 +1,120 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + + + +<%@ page import="org.posterita.user.*"%> +<%@ page import="org.posterita.Constants"%> +<%@ page import="org.posterita.struts.stock.StockAction"%> + +<%@ page import="org.posterita.struts.pos.POSOrderAction"%> +<%@ page import="org.posterita.beans.ProductBean"%> +<%@ page import="org.posterita.user.WebUserInfo"%> +<%@ page import="org.posterita.lib.UdiConstants"%> +<%@ page import="org.posterita.struts.pos.POSGoodsAction"%> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> + + + + + + + + + + + + + + + + +<% + String styleClass = "label"; + if ((count.intValue()%2) != 0) + styleClass = "contentname"; +%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    DescriptionQuantityPriceVATTotal   +   +
    + + + + + + + + + + + + + + + "> + + "> + + ">X +
    Grand Total + + + + + +    
    diff --git a/posterita/posterita/web/jsp/pos/customFastMovingItemReport.jsp b/posterita/posterita/web/jsp/pos/customFastMovingItemReport.jsp new file mode 100644 index 0000000000..45b6f69232 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/customFastMovingItemReport.jsp @@ -0,0 +1,51 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.beans.*" %> +<%@ page import="org.posterita.struts.pos.POSOrderAction" %> +<%@ page import="org.posterita.businesslogic.performanceanalysis.ReportDateManager" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + +<%@ include file="/jsp/pos/customReportTable.jsp" %> + + +<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/customPOSInfoReport.jsp b/posterita/posterita/web/jsp/pos/customPOSInfoReport.jsp new file mode 100644 index 0000000000..780e7ea60a --- /dev/null +++ b/posterita/posterita/web/jsp/pos/customPOSInfoReport.jsp @@ -0,0 +1,79 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.beans.*" %> +<%@ page import="org.posterita.struts.pos.POSOrderAction" %> +<%@ page import="org.posterita.businesslogic.performanceanalysis.ReportDateManager" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + +<% String data = (String) request.getSession().getAttribute(Constants.TABULAR_REPORT_DATA) ;%> + +<%@ include file="/jsp/pos/customReportTable.jsp" %> + + + +<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/customReportTable.jsp b/posterita/posterita/web/jsp/pos/customReportTable.jsp new file mode 100644 index 0000000000..8d75d2e171 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/customReportTable.jsp @@ -0,0 +1,173 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.businesslogic.performanceanalysis.ReportDateManager" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + +
    +
    + + + +
    + +   +

    +
    + + + + + + <%=reportData%> +
    +

    + + + + + + +

    + <%-- +

    + + +   + +

    + --%> + <% request.getSession().removeAttribute(Constants.TABULAR_REPORT_DATA); %> +
    +
    +
    + + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/customSalesByPeriodReport.jsp b/posterita/posterita/web/jsp/pos/customSalesByPeriodReport.jsp new file mode 100644 index 0000000000..969e9fa5a4 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/customSalesByPeriodReport.jsp @@ -0,0 +1,55 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.beans.*" %> +<%@ page import="org.posterita.struts.pos.POSOrderAction" %> +<%@ page import="org.posterita.businesslogic.performanceanalysis.ReportDateManager" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> +
    + :
    + " styleClass="submenu">
    + " styleClass="submenu">
    + " styleClass="submenu">
    + " styleClass="submenu">
    + " styleClass="submenu">
    + " styleClass="submenu">
    + " styleClass="submenu">
    + " styleClass="submenu">
    +
    + +<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/customSalesReport.jsp b/posterita/posterita/web/jsp/pos/customSalesReport.jsp new file mode 100644 index 0000000000..a9c1a3098c --- /dev/null +++ b/posterita/posterita/web/jsp/pos/customSalesReport.jsp @@ -0,0 +1,29 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + +<% +String actionPath = "/POSSalesReportAction"; +String action = "initCustomReport"; +String title = "Sales Report"; +%> + +<%@ include file="/jsp/pos/reportCalendar.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/customSlowMovingItemReport.jsp b/posterita/posterita/web/jsp/pos/customSlowMovingItemReport.jsp new file mode 100644 index 0000000000..e3dd06d074 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/customSlowMovingItemReport.jsp @@ -0,0 +1,51 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.beans.*" %> +<%@ page import="org.posterita.struts.pos.POSOrderAction" %> +<%@ page import="org.posterita.businesslogic.performanceanalysis.ReportDateManager" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + +<%@ include file="/jsp/pos/customReportTable.jsp" %> + + +<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/customStockMovementReport.jsp b/posterita/posterita/web/jsp/pos/customStockMovementReport.jsp new file mode 100644 index 0000000000..d40e97c72c --- /dev/null +++ b/posterita/posterita/web/jsp/pos/customStockMovementReport.jsp @@ -0,0 +1,50 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.beans.*" %> +<%@ page import="org.posterita.struts.pos.POSOrderAction" %> +<%@ page import="org.posterita.businesslogic.performanceanalysis.ReportDateManager" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + +<%@ include file="/jsp/pos/customReportTable.jsp" %> + + +<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/customerDetails.jsp b/posterita/posterita/web/jsp/pos/customerDetails.jsp new file mode 100644 index 0000000000..f4c7a90f6d --- /dev/null +++ b/posterita/posterita/web/jsp/pos/customerDetails.jsp @@ -0,0 +1,245 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + + + + + + + + + + + + + + + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + +
    *
    *
    + + <%@ include file="/jsp/include/dayList.jsp" %> + + + <%@ include file="/jsp/include/monthList.jsp" %> + + + <%@ include file="/jsp/include/year.jsp" %> + + + + + +
    + * + + + + +
    + * + + + + + +
    +
    +
    + +
    + Credit Details + + + + + + + + + + + + + + +
    * + + <%=Constants.NO_CREDIT_CHECK%> + <%=Constants.CREDIT_OK%> + <%=Constants.CREDIT_STOP%> + + +
    + + + + +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + +
    *
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + +
    +
    +
    + + Save + +
    + + + + + + + diff --git a/posterita/posterita/web/jsp/pos/customerReturnOrder.jsp b/posterita/posterita/web/jsp/pos/customerReturnOrder.jsp new file mode 100644 index 0000000000..65656259a5 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/customerReturnOrder.jsp @@ -0,0 +1,376 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.Constants" %> + + +<%@ page import="org.posterita.struts.pos.POSOrderAction" %> +<%@ page import="org.posterita.beans.ProductBean" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.lib.UdiConstants" %> +<%@ page import="org.posterita.struts.pos.POSGoodsAction" %> +<%@ page import="org.posterita.order.UDIOrderTypes" %> + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + + + + + +
    + "> + Create New + +
    +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + + +
    + + + + + + + + + + +   + +
    + + + <%@ include file="/jsp/include/searchProductPanel.jsp" %> +  
    +
    +
    + <%@ include file="/jsp/pos/customerReturnShoppingCart.jsp" %> +
    +
    + + + + + + +
    +
    + +
    +
    + + + + + + + + + + + + +
    +
    +
    + <%@ include file="/jsp/include/customerInfoPanel.jsp" %> + +   +
    +
    + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + +
    + +
    + + +<%@ include file="/jsp/include/posFooter.jsp" %> + diff --git a/posterita/posterita/web/jsp/pos/customerReturnOrder3.jsp b/posterita/posterita/web/jsp/pos/customerReturnOrder3.jsp new file mode 100644 index 0000000000..0c6f73dbe3 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/customerReturnOrder3.jsp @@ -0,0 +1,367 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.Constants" %> + + +<%@ page import="org.posterita.struts.pos.POSOrderAction" %> +<%@ page import="org.posterita.beans.ProductBean" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.lib.UdiConstants" %> +<%@ page import="org.posterita.struts.pos.POSGoodsAction" %> + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + + +
    + + + + + + + + + + +   + +
    + + + <%@ include file="/jsp/include/searchProductPanel.jsp" %> +  
    +
    +
    + <%@ include file="/jsp/pos/customerReturnShoppingCart.jsp" %> +
    +
    + + + + + + +
    +
    + Reason +
    +
    + + + + + + + + + + + + +
    +
    +
    +
    + : +
    +
    + +
    + + +
    +
    +
    +   +
    +
    + + + + + + + + + + + + + + + + + + + - + + + + + + + +
    + +
    + + +<%@ include file="/jsp/include/posFooter.jsp" %> + diff --git a/posterita/posterita/web/jsp/pos/customerReturnShoppingCart.jsp b/posterita/posterita/web/jsp/pos/customerReturnShoppingCart.jsp new file mode 100644 index 0000000000..aa0ed8b8db --- /dev/null +++ b/posterita/posterita/web/jsp/pos/customerReturnShoppingCart.jsp @@ -0,0 +1,26 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + +<%@page import="org.posterita.businesslogic.ShoppingcartManager"%> +
    + <%= ShoppingcartManager.getShoppingcartAsHTML(request, null)%> +
    \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/debtor.jsp b/posterita/posterita/web/jsp/pos/debtor.jsp new file mode 100644 index 0000000000..7afe245e6f --- /dev/null +++ b/posterita/posterita/web/jsp/pos/debtor.jsp @@ -0,0 +1,78 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2008 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * +--%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> +<%@page import="org.compiere.model.MBPartner"%> +<%@page import="org.posterita.core.TmkJSPEnv"%> +<%@page import="java.util.Properties"%> + +<%@ include file="/jsp/include/posHeader.jsp" %> + + + + + + + +
    +
    +

    + +
    + +
    +
    +
    +   +
    +
    + + +<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/debtorHistory.jsp b/posterita/posterita/web/jsp/pos/debtorHistory.jsp new file mode 100644 index 0000000000..9527c28e69 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/debtorHistory.jsp @@ -0,0 +1,89 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2008 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * +--%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> +<%@page import="org.compiere.model.MBPartner"%> +<%@page import="org.posterita.core.TmkJSPEnv"%> +<%@page import="java.util.Properties"%> + +<%@ include file="/jsp/include/posHeader.jsp" %> + + +<%@page import="org.posterita.businesslogic.administration.BPartnerManager"%> +<%@page import="java.util.ArrayList"%> +<%@page import="java.util.Iterator"%> +<%@page import="org.posterita.Constants"%> +<% +BPartnerBean bean = (BPartnerBean)request.getSession().getAttribute(Constants.BPARTNER); +int c_bpartner_id = bean.getBpartnerId().intValue(); +MBPartner partner = MBPartner.get(ctx, c_bpartner_id); +String bpName = partner.getName(); + +if(partner.getName2() != null) +{ + bpName = bpName + " " + partner.getName2(); + bpName = bpName.trim(); +} +%> + +<%@page import="org.posterita.beans.BPartnerBean"%> +
    +

    + : <%=bpName.toUpperCase()%> +

    + + + + + + + + + + + + + + + + + + + + + +
    + + "> + + + + "> + + + + "> + +
    +
    +<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/detailedSalesReport.jsp b/posterita/posterita/web/jsp/pos/detailedSalesReport.jsp new file mode 100644 index 0000000000..fcda28c1f3 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/detailedSalesReport.jsp @@ -0,0 +1,237 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + + + +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.beans.ProductBean" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.lib.UdiConstants" %> +<%@ page import="org.posterita.struts.pos.POSReportAction" %> +<%@ page import="org.posterita.struts.pos.POSGoodsAction" %> +<%@ page import="org.compiere.process.DocAction" %> +<%@ page import="org.compiere.model.MOrder" %> +<%@ page import="org.posterita.order.UDIOrderTypes" %> + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + +<% + String url = "DetailedSalesReport.do"; + String collection = Constants.DETAILED_SALES_REPORT; + boolean isFullDetails = false; + + if(request.getParameter("isFullDetails") != null) + { + isFullDetails = Boolean.parseBoolean(request.getParameter("isFullDetails")); + } + +%> + + + + + + +
    + <%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + + + + + + + + + + <% + String styleClass = "label"; + if ((count.intValue()%2) != 0) + styleClass = "contentname"; + %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
     
    > + + + + + +
    + + +
    +
    + + +
    + +
    +
    + + +
    + +
    +
    + +
    + + +
    + + + +
    + +
    +
    +
    > + + + > + + <% + String partnerId= element.getBpartnerId() + ""; + %> + + + "> + + + + + + + "> + + + + + > + + + + + + + + + + + + + + + + + + Credit + + > + + + > + + > + + + > + + + + + + + + + "> + + + + + + + "> + + + + +
    +
    + + + +<%@ include file="/jsp/include/pager.jsp" %> +<%@ include file="/jsp/include/printOrderApplet2.jsp" %> +<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/downloadUploadCSVfile.jsp b/posterita/posterita/web/jsp/pos/downloadUploadCSVfile.jsp new file mode 100644 index 0000000000..eead27b195 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/downloadUploadCSVfile.jsp @@ -0,0 +1,90 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.beans.*" %> +<%@ page import="org.posterita.struts.pos.EditBulkProductFromFileAction" %> +<%@ page import="org.compiere.process.DocumentEngine" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> + +<%@ page import="org.compiere.model.MOrder" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.struts.pos.POSOrderAction" %> +<%@ page import="java.util.ArrayList" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + +All products +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + +
    + + + + + + +
    + +
    + + Import + +
    + + + + + + + +<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/draftedCreditOrder.jsp b/posterita/posterita/web/jsp/pos/draftedCreditOrder.jsp new file mode 100644 index 0000000000..b9ca6eb476 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/draftedCreditOrder.jsp @@ -0,0 +1,65 @@ + +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.Constants" %> + +<%@ page import="org.posterita.struts.pos.POSOrderAction" %> +<%@ page import="org.posterita.beans.ProductBean" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.lib.UdiConstants" %> + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + <%@ include file="/jsp/include/draftedCreditOrder.jsp" %> + + + +<%@ include file="/js/draftedPOSOrder.js" %> + + + +<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/draftedCustomerReturnOrder.jsp b/posterita/posterita/web/jsp/pos/draftedCustomerReturnOrder.jsp new file mode 100644 index 0000000000..b278e6d594 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/draftedCustomerReturnOrder.jsp @@ -0,0 +1,107 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + + +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.Constants" %> + +<%@ page import="org.posterita.struts.pos.POSOrderAction" %> +<%@ page import="org.posterita.struts.pos.POSGoodsAction" %> +<%@ page import="org.posterita.beans.ProductBean" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.lib.UdiConstants" %> + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + +<%@ include file="/jsp/pos/orderHeader.jsp" %> + +<% String orderlines = Constants.CUSTOMER_RETURN_ORDER_LINES; %> +<%@ include file="/jsp/pos/draftedPOSShoppingCart.jsp" %> + +
    +
      +
    +
    +
    +
    + + + +   + +   +   + +
    +
    +
    + + + + +
    + + + +
    +
    + + +<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/draftedCustomerReturnOrder2.jsp b/posterita/posterita/web/jsp/pos/draftedCustomerReturnOrder2.jsp new file mode 100644 index 0000000000..5d6f67d653 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/draftedCustomerReturnOrder2.jsp @@ -0,0 +1,114 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + + +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.Constants" %> + +<%@ page import="org.posterita.struts.pos.POSOrderAction" %> +<%@ page import="org.posterita.struts.pos.POSGoodsAction" %> +<%@ page import="org.posterita.beans.ProductBean" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.lib.UdiConstants" %> + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + +<%@ include file="/jsp/pos/orderHeader.jsp" %> + +<% String orderlines = Constants.CUSTOMER_RETURN_ORDER_LINES; %> +<%@ include file="/jsp/pos/draftedPOSShoppingCart.jsp" %> + +
    +
      +
    +
    +
    +
    + + + + + + + +   + + +   +   + +
    +
    + + + + + +
    + + + +
    +
    + + +<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/draftedCustomerReturnOrder3.jsp b/posterita/posterita/web/jsp/pos/draftedCustomerReturnOrder3.jsp new file mode 100644 index 0000000000..571d258124 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/draftedCustomerReturnOrder3.jsp @@ -0,0 +1,114 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + + +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.Constants" %> + +<%@ page import="org.posterita.struts.pos.POSOrderAction" %> +<%@ page import="org.posterita.struts.pos.POSGoodsAction" %> +<%@ page import="org.posterita.beans.ProductBean" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.lib.UdiConstants" %> + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + +<%@ include file="/jsp/pos/orderHeader.jsp" %> + +<% String orderlines = Constants.CUSTOMER_RETURN_ORDER_LINES; %> +<%@ include file="/jsp/pos/draftedPOSShoppingCart.jsp" %> + +
    +
      +
    +
    +
    +
    + + + + + + + +   + + +   +   + +
    +
    + + + + + +
    + + + +
    +
    + + +<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/draftedGoodsReceiveNote.jsp b/posterita/posterita/web/jsp/pos/draftedGoodsReceiveNote.jsp new file mode 100644 index 0000000000..21792226af --- /dev/null +++ b/posterita/posterita/web/jsp/pos/draftedGoodsReceiveNote.jsp @@ -0,0 +1,116 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + + +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.Constants" %> + +<%@ page import="org.posterita.struts.pos.POSOrderAction" %> +<%@ page import="org.posterita.struts.pos.POSGoodsAction" %> +<%@ page import="org.posterita.beans.ProductBean" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.lib.UdiConstants" %> + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + +<%@ include file="/jsp/pos/orderHeader.jsp" %> + +<% String orderlines = Constants.GOODS_RECEIVE_NOTE_LINES; %> +<%@ include file="/jsp/pos/draftedPOSShoppingCart.jsp" %> + +
    +
    +   +
    +
    +
    + + + +   +   + +   + +
    +
    +
    + + + + + + + + + + + + + + +
    +
    + +<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/draftedGoodsReturnNote.jsp b/posterita/posterita/web/jsp/pos/draftedGoodsReturnNote.jsp new file mode 100644 index 0000000000..5f4da1fa54 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/draftedGoodsReturnNote.jsp @@ -0,0 +1,141 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + + +<%@ page import="org.posterita.user.*"%> +<%@ page import="org.posterita.Constants"%> +<%@ page import="org.posterita.struts.stock.StockAction"%> +<%@ page import="org.posterita.struts.pos.POSOrderAction"%> +<%@ page import="org.posterita.struts.pos.POSGoodsAction"%> +<%@ page import="org.posterita.beans.ProductBean"%> +<%@ page import="org.posterita.user.WebUserInfo"%> +<%@ page import="org.posterita.lib.UdiConstants"%> + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt"%> +<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + +<%@ include file="/jsp/pos/orderHeader.jsp" %> +<% String orderlines = Constants.GOODS_RETURN_NOTE_LINES; %> +<%@ include file="/jsp/pos/draftedPOSShoppingCart.jsp" %> + + + + + + + + + + + + + + + + + + + + + + +
    + +   + +
    + +   +   + +   +
     
    + + + + + + + + + + + + + + +
    + +<%@ include file="/jsp/include/posFooter.jsp"%> diff --git a/posterita/posterita/web/jsp/pos/draftedPOSOrder.jsp b/posterita/posterita/web/jsp/pos/draftedPOSOrder.jsp new file mode 100644 index 0000000000..61ab5026b3 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/draftedPOSOrder.jsp @@ -0,0 +1,98 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + + +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.Constants" %> + +<%@ page import="org.posterita.struts.pos.POSOrderAction" %> +<%@ page import="org.posterita.beans.ProductBean" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.lib.UdiConstants" %> + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + <%@ include file="/jsp/include/draftedPOSOrder.jsp" %> + + + +<%@ include file="/js/draftedPOSOrder.js" %> + + + +<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/draftedPOSOrder2.jsp b/posterita/posterita/web/jsp/pos/draftedPOSOrder2.jsp new file mode 100644 index 0000000000..7b5f9fbefe --- /dev/null +++ b/posterita/posterita/web/jsp/pos/draftedPOSOrder2.jsp @@ -0,0 +1,96 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Vishee +--%> + + + +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.Constants" %> + +<%@ page import="org.posterita.struts.pos.POSOrderAction" %> +<%@ page import="org.posterita.beans.ProductBean" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.lib.UdiConstants" %> + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + +
    + + + + <%@ include file="/jsp/include/draftedPOSOrder.jsp" %> + + +<%@ include file="/js/draftedPOSOrder.js" %> + + + +<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/draftedPOSShoppingCart.jsp b/posterita/posterita/web/jsp/pos/draftedPOSShoppingCart.jsp new file mode 100644 index 0000000000..dd600b84bf --- /dev/null +++ b/posterita/posterita/web/jsp/pos/draftedPOSShoppingCart.jsp @@ -0,0 +1,95 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + + + <%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +
    + + + + + + + + + + + + + + + + + + <% + String styleClass = "label"; + if ((count.intValue()%2) != 0) + styleClass = "contentname"; + %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    > align="center"> align="center"> align="right"> align="right"> align="right"> align="right"> align="right">
    + + + +   + +   + + + + +   + + + + + + +
    \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/draftedPartialPOSOrder.jsp b/posterita/posterita/web/jsp/pos/draftedPartialPOSOrder.jsp new file mode 100644 index 0000000000..cd9f209308 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/draftedPartialPOSOrder.jsp @@ -0,0 +1,198 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + + + +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.Constants" %> + +<%@ page import="org.posterita.struts.pos.POSOrderAction" %> +<%@ page import="org.posterita.beans.ProductBean" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.lib.UdiConstants" %> + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + + + + + +<%@ include file="/jsp/pos/orderHeader.jsp" %> + <%-- + + + +--%> + + + + + + + + + + + + +<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/draftedposOrderWA.jsp b/posterita/posterita/web/jsp/pos/draftedposOrderWA.jsp new file mode 100644 index 0000000000..3e2b66cc3d --- /dev/null +++ b/posterita/posterita/web/jsp/pos/draftedposOrderWA.jsp @@ -0,0 +1,197 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Vishee +--%> + + + +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.Constants" %> + +<%@ page import="org.posterita.struts.pos.POSOrderAction" %> +<%@ page import="org.posterita.beans.ProductBean" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.lib.UdiConstants" %> + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + +
    + + + +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + + + + + +<%@ include file="/jsp/pos/orderHeader.jsp" %> + + + + + + + + + + + + + + + + + + +<%@ include file="/js/draftedPOSOrder.js" %> + + + +<%@ include file="/jsp/include/posFooter.jsp" %> + diff --git a/posterita/posterita/web/jsp/pos/dunningLettersPrinted.jsp b/posterita/posterita/web/jsp/pos/dunningLettersPrinted.jsp new file mode 100644 index 0000000000..8ba8111819 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/dunningLettersPrinted.jsp @@ -0,0 +1,56 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.beans.*" %> +<%@ page import="org.posterita.struts.pos.CashBookAction" %> + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + +
    +
    + +
    + + + + + + + +
    + + + + + + + + +
    +
    +
    +
    + + <% String orderlines = Constants.PARTIAL_POS_ORDER_LINES; %> + <%@ include file="/jsp/pos/draftedPOSShoppingCart.jsp" %> + + > +
    +
    +
    +   +
    +
    +
    +   +   +   +
    +
    +
    + + + + + + + +
    + + + + + + + +
    +
    + +
     
    +
    + + + + + + + +
    + + + + + + + + +
    +
    +
    + <% String orderlines = Constants.POS_ORDER_LINES; %> + <%@ include file="/jsp/pos/draftedPOSShoppingCart.jsp" %> + + > +
    +
    +
    +   +
    +
    +
    + + + + +   + + + + + + + + "> +   + + + + + +   +
    +
    + + + + + + + +
    + + + + + + + +
    +
    +
    + + + + + +
    + +
    + + +<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/editBlackListCheque.jsp b/posterita/posterita/web/jsp/pos/editBlackListCheque.jsp new file mode 100644 index 0000000000..26368aaf08 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/editBlackListCheque.jsp @@ -0,0 +1,79 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Martine +--%> + + +<%@ page import="org.posterita.struts.customer.CustomerAction" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + * + + +
    + + +
    + +   + +
    + +
    + + +<%@ include file="/jsp/include/posFooter.jsp" %> + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/editBulkProductPrice.jsp b/posterita/posterita/web/jsp/pos/editBulkProductPrice.jsp new file mode 100644 index 0000000000..365631086e --- /dev/null +++ b/posterita/posterita/web/jsp/pos/editBulkProductPrice.jsp @@ -0,0 +1,199 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.beans.*" %> +<%@ page import="org.compiere.model.MProduct" %> +<%@ page import="org.posterita.struts.pos.POSProductAction" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + + + + + + + + + +
    +
    + + + + + + + + + + + + + + + +
    + * + + +
    + * + + + + + + +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + +
    + * + + + + + + +
    + * + + + + + + +
    + * + + + + + + +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + +
    + * + + + Select a TAX category + + +
    + * + + + +
    +
    + + + +
    + + + +
    + + + +
    +
    +
    + +   + +
    +
    + +<%@include file="/jsp/include/posFooter.jsp"%> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/editPOSCustomer.jsp b/posterita/posterita/web/jsp/pos/editPOSCustomer.jsp new file mode 100644 index 0000000000..6e7ffa1053 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/editPOSCustomer.jsp @@ -0,0 +1,53 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + + +<%@ page import="org.posterita.struts.customer.CustomerAction" %> +<%@ page import="org.compiere.model.MBPartner" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + +<%@ include file="/jsp/pos/customerDetails.jsp" %> + + + + +<%@ include file="/jsp/include/posFooter.jsp" %> + + + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/editPOSUser.jsp b/posterita/posterita/web/jsp/pos/editPOSUser.jsp new file mode 100644 index 0000000000..f9583dab3e --- /dev/null +++ b/posterita/posterita/web/jsp/pos/editPOSUser.jsp @@ -0,0 +1,284 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.beans.UDIBean" %> +<%@ page import="org.compiere.model.MCommission" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> + +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    * + + + +
    + * + + + + +
    * +           + + +
    * + +
    * + + +
    * + +
    +
    +
    + +
    + Address + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + +
    + + +
    + +
    + +
    +
    +
    + + + + + + +
    +
    + User's Details + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + +
    + + + +
    + + + + Invoice + Order + Payment Receipts + + +
    + + + +
    + + + +
    + + + + Weekly + Monthly + Quarterly + Yearly + + +
    +   +
    +
    +
    + + + + + + + + + +   + + + + + + + + + + + + +
    +
    +
    + Information + + +
    +
    +
    + + + + + +
    + + +<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/editPaymentTerm.jsp b/posterita/posterita/web/jsp/pos/editPaymentTerm.jsp new file mode 100644 index 0000000000..08f4e95fc1 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/editPaymentTerm.jsp @@ -0,0 +1,68 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + + +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.struts.pos.PaymentTermAction" %> +<%@ page import="org.compiere.model.MProduct" %> +<%@ page import="org.posterita.beans.ProductBean" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.lib.UdiConstants" %> +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + <%@ include file="/jsp/include/paymentTermsDetails.jsp" %> + + + + + + +
      + +   + +  
    + +
    + +<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/editRole.jsp b/posterita/posterita/web/jsp/pos/editRole.jsp new file mode 100644 index 0000000000..52d852d55a --- /dev/null +++ b/posterita/posterita/web/jsp/pos/editRole.jsp @@ -0,0 +1,254 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Ashley +--%> + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.beans.UDIBean" %> +<%@ page import="org.posterita.core.MenuItem" %> +<%@ page import="org.posterita.beans.RoleBean" %> + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + +<% + RoleBean roleBean = (RoleBean)request.getSession().getAttribute(Constants.ROLE); + String role = roleBean.getName(); + String roleId = String.valueOf(roleBean.getRoleId().intValue()); + + boolean isAccAllOrgs = roleBean.getIsAccessAllOrgs().booleanValue(); + String accAllOrgs = ""; + if(isAccAllOrgs) + accAllOrgs = "checked=\"checked\""; + + boolean isDiscountUptoLimitPrice = roleBean.getIsDiscountUptoLimitPrice().booleanValue(); + String discountUptoLimitPrice = ""; + if(isDiscountUptoLimitPrice) + discountUptoLimitPrice = "checked=\"checked\""; + + boolean isDiscountOnTotal = roleBean.getIsDiscountAllowedOnTotal().booleanValue(); + String discountOnTotal = ""; + if(isDiscountOnTotal) + discountOnTotal = "checked=\"checked\"";; + + +%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + * + + + + +
    + + + +
    + + + +
    + + + +
    + + + + + + + + + +
    + + + + + + + + + + <% + String checked = ""; + if(((MenuItem)ele).isAvailable()) + checked = "checked=\"checked\""; + %> + + + + + + + + + + + + + + + + + +
    + +
    + + + /> +
    + +
    + + + + +
    +
    + + Clear All + + + Select All + + + + +
    + +
    + + +<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/editRoleOrgAccess.jsp b/posterita/posterita/web/jsp/pos/editRoleOrgAccess.jsp new file mode 100644 index 0000000000..f34bac4e6c --- /dev/null +++ b/posterita/posterita/web/jsp/pos/editRoleOrgAccess.jsp @@ -0,0 +1,110 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Ashley +--%> + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.beans.UDIBean" %> +<%@ page import="org.posterita.core.MenuItem" %> +<%@ page import="org.posterita.beans.RoleBean" %> + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + +<% + RoleBean roleBean = (RoleBean)request.getSession().getAttribute(Constants.ROLE); + String role = roleBean.getName(); +%> + + + + + + + +
    + +
    + + + + + + + + + + +
    + + + + + + + <% + String checked1 = ""; + if(((RoleBean)roleOrgAccessIndexed).getIsChecked().booleanValue()) + checked1 = "checked"; + %> + + + + + + + +
    + + + + + + + + +
    +
    + + Clear All + + + Select All + + + + +
    + +
    +<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/editTax.jsp b/posterita/posterita/web/jsp/pos/editTax.jsp new file mode 100644 index 0000000000..f361a10f40 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/editTax.jsp @@ -0,0 +1,52 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + + +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.struts.pos.TaxAction" %> +<%@ page import="org.compiere.model.MProduct" %> +<%@ page import="org.posterita.beans.ProductBean" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.lib.UdiConstants" %> +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + +<%@ include file="/jsp/include/taxDetails.jsp" %> + +<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/editVendor.jsp b/posterita/posterita/web/jsp/pos/editVendor.jsp new file mode 100644 index 0000000000..c4c9f9a7f8 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/editVendor.jsp @@ -0,0 +1,122 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Martine +--%> + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.beans.UDIBean" %> +<%@ page import="org.posterita.core.MenuItem" %> + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + + + + + + + + + + + +
    +
    + + Contact + + + + + + + + +
    + * + + + +
    +
    +
    +
    + Address + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + Phone + + + + + + + + + + + + + + +
     
    +
    +
    +   +
    +
    +<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/editattribute.jsp b/posterita/posterita/web/jsp/pos/editattribute.jsp new file mode 100644 index 0000000000..87995dd590 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/editattribute.jsp @@ -0,0 +1,71 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Ashley +--%> + + + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.beans.*" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + +
    + + + + + + + + + + + + + + +
    +
    +
    +   +
    +
    +
    +<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/editpriceList.jsp b/posterita/posterita/web/jsp/pos/editpriceList.jsp new file mode 100644 index 0000000000..ab05160e68 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/editpriceList.jsp @@ -0,0 +1,57 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.beans.*" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + + + + + +
    +   +
    +<%@include file="/jsp/include/posFooter.jsp"%> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/filter.jsp b/posterita/posterita/web/jsp/pos/filter.jsp new file mode 100644 index 0000000000..df59c401e7 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/filter.jsp @@ -0,0 +1,109 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Vishee +--%> + + +<%@ page import="org.posterita.Constants" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +   + + + + + + <%@include file="/jsp/include/month.jsp"%> + + + + + + + <% + int currentYear = java.util.Calendar.getInstance().get(java.util.Calendar.YEAR); + %> + <%= currentYear %> + <%= currentYear - 1 %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/posterita/posterita/web/jsp/pos/generateCommission.jsp b/posterita/posterita/web/jsp/pos/generateCommission.jsp new file mode 100644 index 0000000000..6e15561a3b --- /dev/null +++ b/posterita/posterita/web/jsp/pos/generateCommission.jsp @@ -0,0 +1,69 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + + +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.beans.ProductBean" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.lib.UdiConstants" %> +<%@ page import="org.posterita.struts.pos.POSReportAction" %> +<%@ page import="org.posterita.struts.pos.POSGoodsAction" %> +<%@ page import="org.compiere.process.DocAction" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + + + + + + + + <%@ include file="/jsp/include/posFooter.jsp" %> +
    + <%@ include file="/jsp/include/startCalendar.jsp" %> +
    +   +
    + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/genericReport.jsp b/posterita/posterita/web/jsp/pos/genericReport.jsp new file mode 100644 index 0000000000..9d663c3aee --- /dev/null +++ b/posterita/posterita/web/jsp/pos/genericReport.jsp @@ -0,0 +1,72 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2008 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author sendy +--%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> +<%@page import="org.posterita.Constants"%> +<%@page import="org.posterita.struts.pos.POSReportAction"%> +<%@page import="org.posterita.Constants"%> + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + +
     
    +
    <%=reportName%>
    +
     
    + + + +
    <%=reportComment%>
    +
     
    + + + +
    + + <%=componentList %> +
    + +
     
    + + + + +
    + Report As: + + Generate +
    + +
    + +<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/getCreditOrderDiscDetails.jsp b/posterita/posterita/web/jsp/pos/getCreditOrderDiscDetails.jsp new file mode 100644 index 0000000000..9f0e4e5a4e --- /dev/null +++ b/posterita/posterita/web/jsp/pos/getCreditOrderDiscDetails.jsp @@ -0,0 +1,210 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + + +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.Constants" %> + +<%@ page import="org.posterita.struts.pos.POSOrderAction" %> +<%@ page import="org.posterita.beans.ProductBean" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.lib.UdiConstants" %> +<%@ page import="org.posterita.form.OrderLineForm" %> +<%@ page import="org.compiere.model.MOrder" %> +<%@ page import="java.math.BigDecimal" %> + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + +
    + + + + + + + + + + + + + + + + + + <% + String styleClass = "label"; + if ((count.intValue()%2) != 0) + styleClass = "contentname"; + %> + + + + + + + + + + + + <% + String defaultDiscount = "0"; + String defaultPrice = element.getPrice().toString(); + + OrderLineForm form = (OrderLineForm)request.getAttribute("OrderLineForm"); + + if(form!=null) + { + String[] discountPercentage = form.getDiscountPercent(); + String[] actualPrice = form.getActualPrice(); + + if(discountPercentage!= null) + if(discountPercentage.length!=0) + defaultDiscount = discountPercentage[count.intValue()]; + + if(actualPrice!=null) + if(actualPrice.length!=0) + defaultPrice = actualPrice[count.intValue()]; + } + %> + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + + + +
    + + + + + + + + + + + + + + + + "/> + + + + + +
    + + + + + + + +   + +
    + +
    +
    + + +
    + +   + + + + +   + + +   + + + + + + + + +<%@ include file="/jsp/include/posFooter.jsp" %> + diff --git a/posterita/posterita/web/jsp/pos/getCurrentTillAmount.jsp b/posterita/posterita/web/jsp/pos/getCurrentTillAmount.jsp new file mode 100644 index 0000000000..cd52ed37ce --- /dev/null +++ b/posterita/posterita/web/jsp/pos/getCurrentTillAmount.jsp @@ -0,0 +1,117 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.beans.*" %> +<%@ page import="org.posterita.struts.pos.CashBookAction" %> + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/posterita.tld" prefix="posterita"%> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + +
    + + + +
    + + + +
    + + + +
    + + + +
    + + + +
    + + + +
    +
    +<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/getCustomerReturnFormPOSOrder.jsp b/posterita/posterita/web/jsp/pos/getCustomerReturnFormPOSOrder.jsp new file mode 100644 index 0000000000..3fef08bf95 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/getCustomerReturnFormPOSOrder.jsp @@ -0,0 +1,96 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + + +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.Constants" %> + + +<%@ page import="org.posterita.struts.pos.POSGoodsAction" %> +<%@ page import="org.posterita.beans.ProductBean" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.lib.UdiConstants" %> +<%@ page import="org.compiere.model.MOrder" %> + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + + +
    + + + + + + + + +
    + + + +
    + +
    +
    +
    + + + + +<%@ include file="/jsp/include/posFooter.jsp" %> + diff --git a/posterita/posterita/web/jsp/pos/getPOSCustomers.jsp b/posterita/posterita/web/jsp/pos/getPOSCustomers.jsp new file mode 100644 index 0000000000..79014d93c2 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/getPOSCustomers.jsp @@ -0,0 +1,139 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + + +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.Constants" %> + + +<%@ page import="org.posterita.struts.pos.POSOrderAction" %> +<%@ page import="org.posterita.beans.ProductBean" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.lib.UdiConstants" %> + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/tabTop.jsp" %><%@ include file="/jsp/include/tabBottom.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + + + + + + + + +
    + + + + <%@ include file="/jsp/include/searchCustomerPanel.jsp" %> +
    + + + +
    + + + + +   + + + + <%@ include file="/jsp/pos/shoppingCart.jsp" %> + + + + +   + + + + + + + + + + +   + + + + + + + + + + +
    + - Alt-N + + - Alt-S + + - Alt-C +
    + + +
    + + + + +<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/getPOSPaymentDetails.jsp b/posterita/posterita/web/jsp/pos/getPOSPaymentDetails.jsp new file mode 100644 index 0000000000..a9cdb97bd3 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/getPOSPaymentDetails.jsp @@ -0,0 +1,66 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + + + +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.Constants" %> + +<%@ page import="org.posterita.struts.pos.POSOrderAction" %> +<%@ page import="org.posterita.beans.ProductBean" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.lib.UdiConstants" %> +<%@ page import="org.posterita.form.OrderLineForm" %> +<%@ page import="org.compiere.model.MOrder" %> +<%@ page import="java.math.BigDecimal" %> + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> +
    + + + <%@ include file="/jsp/include/posPaymentDetails.jsp" %> + + + + +<%@ include file="/jsp/include/posFooter.jsp" %> + diff --git a/posterita/posterita/web/jsp/pos/getPOSPaymentDetails2.jsp b/posterita/posterita/web/jsp/pos/getPOSPaymentDetails2.jsp new file mode 100644 index 0000000000..bf75c5815f --- /dev/null +++ b/posterita/posterita/web/jsp/pos/getPOSPaymentDetails2.jsp @@ -0,0 +1,67 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + + + +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.Constants" %> + +<%@ page import="org.posterita.struts.pos.POSOrderAction" %> +<%@ page import="org.posterita.beans.ProductBean" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.lib.UdiConstants" %> +<%@ page import="org.posterita.form.OrderLineForm" %> +<%@ page import="org.compiere.model.MOrder" %> +<%@ page import="java.math.BigDecimal" %> + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + <%@ include file="/jsp/include/posPaymentDetails2.jsp" %> + + + + +<%@ include file="/jsp/include/posFooter.jsp" %> + + + diff --git a/posterita/posterita/web/jsp/pos/getPOSPaymentDetails_1.jsp b/posterita/posterita/web/jsp/pos/getPOSPaymentDetails_1.jsp new file mode 100644 index 0000000000..cc2908878d --- /dev/null +++ b/posterita/posterita/web/jsp/pos/getPOSPaymentDetails_1.jsp @@ -0,0 +1,218 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + + +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.Constants" %> + +<%@ page import="org.posterita.struts.pos.POSOrderAction" %> +<%@ page import="org.posterita.beans.ProductBean" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.lib.UdiConstants" %> + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/tabTop.jsp" %><%@ include file="/jsp/include/tabBottom.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + +
    + + + +   + + + + + + + + + + + + + + + + + + + + + + <% + String styleClass = "label"; + if ((count.intValue()%2) != 0) + styleClass = "contentname"; + %> + + + + + + + + + + + + + + + +
    + + + + + + + + + +
    + + + + + + " id="price<%= count%>"/> + + + + " id="actualPrice<%= count%>" onchange="setDiscountValue('discountPercent<%= count%>', 'price<%= count%>','actualPrice<%= count%>')"/> +
    + + + + +   + + + +   + + + + + + + + + + + +
    + + + + + + + +
    +
    + + +
    + +
    + + + + + +
    + + + +
    + + + +
    + +<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/getPOSStock.jsp b/posterita/posterita/web/jsp/pos/getPOSStock.jsp new file mode 100644 index 0000000000..1576e61b9b --- /dev/null +++ b/posterita/posterita/web/jsp/pos/getPOSStock.jsp @@ -0,0 +1,172 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.beans.*" %> +<%@ page import="org.posterita.struts.pos.POSStockAction" %> +<%@ page import="org.compiere.process.DocumentEngine" %> +<%@ page import="java.util.Iterator" %> +<%@ page import="java.util.ArrayList" %> +<%@ page import="org.posterita.core.UDIPair" %> +<%@ page import="java.math.RoundingMode" %> +<%@ page import= "java.math.BigDecimal"%> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> +<%@ taglib uri="http://displaytag.sf.net" prefix="display" %> + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + + + + + + + + <% + String url = "GetPOSStock.do"; + String collection = Constants.PRODUCTS; + %> + + + + +
    + + + + + + + + + +   + + +    + + + + + > 0 + < 0 + = 0 + > 25 + > 50 + > 100 + +
    + + + + + + + +
    + + + + + + + + + + +
    +
    + <% + org.displaytag.decorator.TotalTableDecorator totals = new org.displaytag.decorator.TotalTableDecorator(); + totals.setTotalLabel("Total"); + pageContext.setAttribute("totals", totals); + %> + + + + + + + + + + + + + + + + + +
    +
    + + +   + + +<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/getPartialPOSPaymentDetails.jsp b/posterita/posterita/web/jsp/pos/getPartialPOSPaymentDetails.jsp new file mode 100644 index 0000000000..bd6fc1d259 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/getPartialPOSPaymentDetails.jsp @@ -0,0 +1,816 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + + + +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.Constants" %> + +<%@ page import="org.posterita.struts.pos.POSOrderAction" %> +<%@ page import="org.posterita.beans.ProductBean" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.lib.UdiConstants" %> +<%@ page import="org.posterita.form.OrderLineForm" %> +<%@ page import="org.compiere.model.MOrder" %> +<%@ page import="java.math.BigDecimal" %> + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + +
    + + + + + + + + + + + + + + + + + + <% + String styleClass = "label"; + if ((count.intValue()%2) != 0) + styleClass = "contentname"; + %> + + + + + + + + + + + + <% + String defaultDiscount = "0"; + String defaultPrice = element.getPrice().toString(); + + OrderLineForm form = (OrderLineForm)request.getAttribute("OrderLineForm"); + + if(form!=null) + { + String[] discountPercentage = form.getDiscountPercent(); + String[] actualPrice = form.getActualPrice(); + + if(discountPercentage!= null) + if(discountPercentage.length!=0) + defaultDiscount = discountPercentage[count.intValue()]; + + if(actualPrice!=null) + if(actualPrice.length!=0) + defaultPrice = actualPrice[count.intValue()]; + } + %> + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + + + +
    + + + + + + + + + + + + + + + "/> + + + + + +
    + + + + + +   + +
    + +
    +
     
    + + + + + +   + + + + + + + + + + + + + + +
    + +   + + + +   + + + +   + + + +   + +
    + + + + +   + + + + + + + + + +
    + + + + +
    + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + +   + + + + +   + + + + +   + + + + + + + + + + + +
    + + + + + + + + + +
    + + +
    + + + + +<%@ include file="/jsp/include/posFooter.jsp" %> + diff --git a/posterita/posterita/web/jsp/pos/goodsReceiveNote.jsp b/posterita/posterita/web/jsp/pos/goodsReceiveNote.jsp new file mode 100644 index 0000000000..bbdaac5408 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/goodsReceiveNote.jsp @@ -0,0 +1,324 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + +<%@ page import="org.posterita.user.*"%> +<%@ page import="org.posterita.Constants"%> +<%@ page import="org.posterita.struts.stock.StockAction"%> + +<%@ page import="org.posterita.struts.pos.POSOrderAction"%> +<%@ page import="org.posterita.beans.ProductBean"%> +<%@ page import="org.posterita.user.WebUserInfo"%> +<%@ page import="org.posterita.lib.UdiConstants"%> +<%@ page import="org.posterita.struts.pos.POSGoodsAction"%> +<%@ page import="org.posterita.order.UDIOrderTypes" %> + + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt"%> +<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + +
    + + + + + + + + + +   +
    + + + <%@ include file="/jsp/include/searchProductPanel.jsp" %> +
    +
    +
    +
    + <%@ include file="/jsp/pos/goodsReceiveShoppingCart.jsp" %> +
    +
     
    +   +
    + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +<%@ include file="/jsp/include/posFooter.jsp"%> diff --git a/posterita/posterita/web/jsp/pos/goodsReceiveShoppingCart.jsp b/posterita/posterita/web/jsp/pos/goodsReceiveShoppingCart.jsp new file mode 100644 index 0000000000..d8e002aa1b --- /dev/null +++ b/posterita/posterita/web/jsp/pos/goodsReceiveShoppingCart.jsp @@ -0,0 +1,25 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Vishee +--%> + + +<% String items = Constants.GOODS_RECEIVE_NOTE_SHOPPING_CART_ITEMS; %> +<%@ include file="/jsp/pos/posShoppingCart.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/goodsReturnNote.jsp b/posterita/posterita/web/jsp/pos/goodsReturnNote.jsp new file mode 100644 index 0000000000..1a6bd4c787 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/goodsReturnNote.jsp @@ -0,0 +1,321 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + +<%@ page import="org.posterita.user.*"%> +<%@ page import="org.posterita.Constants"%> +<%@ page import="org.posterita.struts.stock.StockAction"%> + +<%@ page import="org.posterita.struts.pos.POSOrderAction"%> +<%@ page import="org.posterita.beans.ProductBean"%> +<%@ page import="org.posterita.user.WebUserInfo"%> +<%@ page import="org.posterita.lib.UdiConstants"%> +<%@ page import="org.posterita.struts.pos.POSGoodsAction"%> +<%@ page import="org.posterita.order.UDIOrderTypes" %> + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt"%> +<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + +
    + "> + Create New + +
    +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + +
    + + + + + + + + + +   +
    + + + <%@ include file="/jsp/include/searchProductPanel.jsp" %> +
    + +
    +
    + <%@ include file="/jsp/pos/posShoppingCart.jsp" %> +
    +
     
    +   +
    + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +<%@ include file="/jsp/include/posFooter.jsp"%> diff --git a/posterita/posterita/web/jsp/pos/goodsReturnShoppingCart.jsp b/posterita/posterita/web/jsp/pos/goodsReturnShoppingCart.jsp new file mode 100644 index 0000000000..f37f6e467b --- /dev/null +++ b/posterita/posterita/web/jsp/pos/goodsReturnShoppingCart.jsp @@ -0,0 +1,25 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + + +<% String items = Constants.GOODS_RETURN_NOTE_SHOPPING_CART_ITEMS; %> +<%@ include file="/jsp/pos/posShoppingCart.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/grnShoppingCart.jsp b/posterita/posterita/web/jsp/pos/grnShoppingCart.jsp new file mode 100644 index 0000000000..c5ba5272ad --- /dev/null +++ b/posterita/posterita/web/jsp/pos/grnShoppingCart.jsp @@ -0,0 +1,25 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + + +<% String items = Constants.SHOPPING_GRN_CART_ITEMS; %> +<%@ include file="/jsp/pos/posShoppingCart.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/importBlackList.jsp b/posterita/posterita/web/jsp/pos/importBlackList.jsp new file mode 100644 index 0000000000..d84cde9908 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/importBlackList.jsp @@ -0,0 +1,97 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Martine +--%> + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.beans.*" %> +<%@ page import="org.posterita.struts.pos.ImportPOSProductAction" %> +<%@ page import="org.compiere.process.DocumentEngine" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + + + +
    + +
    + + + +
    +
    + +
    +<% + String cvsURL = request.getContextPath() + "/jsp/pos/importTemplate.csv"; +%> + + + + +
    +
    + + + + + + + + + + + + + + + + + + +
    MCB6090018000250
    MCB7714739680121
    + +
    + + +<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/importCustomer.jsp b/posterita/posterita/web/jsp/pos/importCustomer.jsp new file mode 100644 index 0000000000..80f0cf118a --- /dev/null +++ b/posterita/posterita/web/jsp/pos/importCustomer.jsp @@ -0,0 +1,248 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Martine +--%> + + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.beans.*" %> +<%@ page import="org.posterita.struts.pos.ImportPOSProductAction" %> +<%@ page import="org.compiere.process.DocumentEngine" %> +<%@ page import="org.posterita.struts.pos.ImportCustomerAction" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> + + + + + +Import Customer +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + + + +
    + +
    + + Import + +
    +
    + +
    +<% + String cvsURL = request.getContextPath() + "/jsp/pos/importTemplate.csv"; + String csvURL1=request.getContextPath() + "/jsp/pos/importGarmentTemplate.csv"; +%> +
    + + This utility is to import a list of Customers from a csv file into the system, the csv file should look like the one shown below including the header: + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Account NoNameAddress1Address2Address3Postal CodeStr Address1Str Address2Str Address3ContactPhoneFax
    +   +
    Payment TermCredit LmtBF BalanceTotal OweSales RepPriceListTax NoBankBranchBank Acc NoEmailMobile
    +
    + + + + + +
    +
    View Remaining Details



    + + + + + + + + + + + + + + + + <% + String styleClass = "label"; + if ((count.intValue()%2) != 0) + styleClass = "contentname"; + + %> + + + + + + + + + + + + + + +
    Account NoNameAddress1Address2Postal CodeStr Address1Str Address2Address3ContactPhoneFax
    +
    View Remaining Details



    + +
    + + + + + +<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/importPOSProducts.jsp b/posterita/posterita/web/jsp/pos/importPOSProducts.jsp new file mode 100644 index 0000000000..afc574048f --- /dev/null +++ b/posterita/posterita/web/jsp/pos/importPOSProducts.jsp @@ -0,0 +1,155 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.beans.*" %> +<%@ page import="org.posterita.struts.pos.ImportPOSProductAction" %> +<%@ page import="org.compiere.process.DocumentEngine" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + +
    +

    + +   + +

    +
    + + + + + + + + + + + + + + + + +
    + +
    + + + + + + +
    + + + + + + +
    + + + +
    +
    + +
    +<% + String cvsURL = request.getContextPath() + "/import/importTemplate.csv"; + String csvURL1=request.getContextPath() + "/import/importGarmentTemplate.csv"; +%> + +: + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Tshirt6090018000250Tshirt Red XLTshirt Red XLOne300400380350025
    Trousers7714739680121black cotton Lblack cotton LEach3504504304101520
    + + + Garment Template +
    + +<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/importPOSStock.jsp b/posterita/posterita/web/jsp/pos/importPOSStock.jsp new file mode 100644 index 0000000000..c7969ebc0c --- /dev/null +++ b/posterita/posterita/web/jsp/pos/importPOSStock.jsp @@ -0,0 +1,62 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author shameem +--%> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + + + + + +
    + +
    + + IMPORT + +
    +
    + + + + + + + + + + + + + + +
    609001800025025
    771473968012120
    \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/index.jsp b/posterita/posterita/web/jsp/pos/index.jsp new file mode 100644 index 0000000000..3c9c1dc11d --- /dev/null +++ b/posterita/posterita/web/jsp/pos/index.jsp @@ -0,0 +1,45 @@ +<% +String path = request.getContextPath(); +String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; +%> + + + + + Tamak POS + + + + + + + + +
    + + + + +
    + + +
    +
    + + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/initMaxItem.jsp b/posterita/posterita/web/jsp/pos/initMaxItem.jsp new file mode 100644 index 0000000000..60eec97c2c --- /dev/null +++ b/posterita/posterita/web/jsp/pos/initMaxItem.jsp @@ -0,0 +1,37 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + + +<% +String actionPath = "/CustomFastMovingItemReportAction"; +String action = "getCustomReport"; +String title = "Most Sold Items"; +%> + +<%@ include file="/jsp/pos/reportCalendar.jsp" %> + + + +<%--<%@ include file="/jsp/pos/reportParameters.jsp" %>--%> + + + diff --git a/posterita/posterita/web/jsp/pos/initMinItem.jsp b/posterita/posterita/web/jsp/pos/initMinItem.jsp new file mode 100644 index 0000000000..7faf373c2e --- /dev/null +++ b/posterita/posterita/web/jsp/pos/initMinItem.jsp @@ -0,0 +1,38 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + + + +<% +String actionPath = "/CustomSlowMovingItemReportAction"; +String action = "getCustomReport"; +String title = "Least Sold Items"; +%> + +<%@ include file="/jsp/pos/reportCalendar.jsp" %> + + + +<%--<%@ include file="/jsp/pos/reportParameters.jsp" %>--%> + + + diff --git a/posterita/posterita/web/jsp/pos/initViewPOSInfo2.jsp b/posterita/posterita/web/jsp/pos/initViewPOSInfo2.jsp new file mode 100644 index 0000000000..63a0bd6743 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/initViewPOSInfo2.jsp @@ -0,0 +1,31 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + + + +<% +String actionPath = "/CustomPOSInfoAction"; +String action = "getCustomReport"; +String title = "POS INFO"; +%> + +<%@ include file="/jsp/pos/reportCalendar.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/initViewSalesAnalysisReport.jsp b/posterita/posterita/web/jsp/pos/initViewSalesAnalysisReport.jsp new file mode 100644 index 0000000000..7c4d430b62 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/initViewSalesAnalysisReport.jsp @@ -0,0 +1,35 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + + + +<% +String actionPath = "/CustomSalesAnalysisReportAction"; +String action = "getCustomReport"; +String title = "Sales Analysis Report"; +%> + +<%@ include file="/jsp/pos/reportCalendar.jsp" %> + + + +<%--<%@ include file="/jsp/pos/reportParameters.jsp" %>--%> diff --git a/posterita/posterita/web/jsp/pos/initViewStockMovement.jsp b/posterita/posterita/web/jsp/pos/initViewStockMovement.jsp new file mode 100644 index 0000000000..27253e0f8e --- /dev/null +++ b/posterita/posterita/web/jsp/pos/initViewStockMovement.jsp @@ -0,0 +1,38 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + + + +<% +String actionPath = "/CustomStockMovementReportAction"; +String action = "getCustomReport"; +String title = "Stock Movement Report"; +%> + +<%@ include file="/jsp/pos/reportCalendar.jsp" %> + + + +<%--<%@ include file="/jsp/pos/reportParameters.jsp" %>--%> + + + diff --git a/posterita/posterita/web/jsp/pos/inventoryImportErrors.jsp b/posterita/posterita/web/jsp/pos/inventoryImportErrors.jsp new file mode 100644 index 0000000000..eaf8644b19 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/inventoryImportErrors.jsp @@ -0,0 +1,56 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.beans.*" %> +<%@ page import="org.posterita.struts.pos.ImportPOSProductAction" %> +<%@ page import="org.compiere.process.DocumentEngine" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> +

    + + Back to Inventory Cart + + + + + Save as CSV + +

    + +<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/invokeCreditOrder.jsp b/posterita/posterita/web/jsp/pos/invokeCreditOrder.jsp new file mode 100644 index 0000000000..13ecee3991 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/invokeCreditOrder.jsp @@ -0,0 +1,97 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + + + +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.Constants" %> + + +<%@ page import="org.posterita.struts.pos.POSGoodsAction" %> +<%@ page import="org.posterita.beans.ProductBean" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.lib.UdiConstants" %> +<%@ page import="org.compiere.model.MOrder" %> + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + + +
    + + + + + + + + +
    + + + +
    + +
    +
    +
    + + + + +<%@ include file="/jsp/include/posFooter.jsp" %> + diff --git a/posterita/posterita/web/jsp/pos/invokePartialPOSOrder.jsp b/posterita/posterita/web/jsp/pos/invokePartialPOSOrder.jsp new file mode 100644 index 0000000000..75cfc29d1e --- /dev/null +++ b/posterita/posterita/web/jsp/pos/invokePartialPOSOrder.jsp @@ -0,0 +1,97 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + + + + +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.Constants" %> + + +<%@ page import="org.posterita.struts.pos.POSOrderAction" %> +<%@ page import="org.posterita.beans.ProductBean" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.lib.UdiConstants" %> +<%@ page import="org.compiere.model.MOrder" %> + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + + +
    + + + + + + + + +
    + + + +
    + +
    +
    +
    + + + + +<%@ include file="/jsp/include/posFooter.jsp" %> + diff --git a/posterita/posterita/web/jsp/pos/listCashBooks.jsp b/posterita/posterita/web/jsp/pos/listCashBooks.jsp new file mode 100644 index 0000000000..1e82c0a2ec --- /dev/null +++ b/posterita/posterita/web/jsp/pos/listCashBooks.jsp @@ -0,0 +1,98 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2008 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Ashley +--%> + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.beans.*" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> +<%@ taglib uri="http://displaytag.sf.net" prefix="display" %> + +<%@page import="org.posterita.struts.pos.CashBookAction"%> + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> +
    + + + + + + + +
    + + + + +   + + + + <pos:message textOnly="true" key="add"/> + +
    +
    + + + + + + + + + Journals + + + + + Edit + + + + View + + + + + Deactivate + + + + + + Activate + + + + + +<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/listCurrencies.jsp b/posterita/posterita/web/jsp/pos/listCurrencies.jsp new file mode 100644 index 0000000000..8ba6893712 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/listCurrencies.jsp @@ -0,0 +1,93 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2008 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Servansingh +--%> + + +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> +<%@page import="org.posterita.struts.pos.CurrencyAction"%> +<%@page import="org.posterita.Constants"%> +Currency +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + +
    + + + + + +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + + + "> + + +
    +
    + +<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/listPOSUsers.jsp b/posterita/posterita/web/jsp/pos/listPOSUsers.jsp new file mode 100644 index 0000000000..c172f9d48e --- /dev/null +++ b/posterita/posterita/web/jsp/pos/listPOSUsers.jsp @@ -0,0 +1,144 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + + + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.compiere.model.MOrg" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + +<%@ include file="/jsp/include/posHeader.jsp" %> + + +
    + + + + + + + + +
    + + + + + +   + + + + + Add Customer + +
    +
    + +. + + + + + + + + + + + + + + + + <% + String url = "ListPOSUsers.do"; + String collection = Constants.ALL_USERS; + %> + + + <% + String styleClass = "label"; + + if ((count.intValue()%2) != 0) + styleClass = "contentname"; + %> + + + + + + + + + + + + + +
     
    + + + + + + + + + "> + Edit Customer + + + + "> + View Customer + + + + "> + User Customer + + + + + "> + Activate User + + +
    +<%@ include file="/jsp/include/pager.jsp" %> + +
    +
    + + +<%@ include file="/jsp/include/posFooter.jsp" %> + + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/listPriceLists.jsp b/posterita/posterita/web/jsp/pos/listPriceLists.jsp new file mode 100644 index 0000000000..fb5ffafb1f --- /dev/null +++ b/posterita/posterita/web/jsp/pos/listPriceLists.jsp @@ -0,0 +1,140 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2008 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author sendy +--%> + + + +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> +<%@page import="org.posterita.struts.pos.PriceListAction"%> +<%@page import="org.posterita.Constants"%> +<%@page import="org.posterita.struts.pos.POSProductAction"%> +Price Lists +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + + +
    + + + + + + + + + + + + "> + + +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + + + + "> + + + + + + "> + + + + + + + + + "> + + + + + +
    +
    + +<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/listRoles.jsp b/posterita/posterita/web/jsp/pos/listRoles.jsp new file mode 100644 index 0000000000..d4330dc5f1 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/listRoles.jsp @@ -0,0 +1,124 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + + + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.beans.*" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + +
    + + + + + + + + +
    + + + + + +   + + + + + Add Customer + +
    +
    + + + + + + + + + + + + + + + +<% + String url = "ListPOSRoles.do"; + String collection = Constants.ALL_ROLES; +%> + + <% + String styleClass = "label"; + + if ((count.intValue()%2) != 0) + styleClass = "contentname"; + %> + + + + + + + +
     
    + + + + + "> + Edit Role + + + "> + View Role + + + + Edit Organisation Access + + + <%--">Delete--%> +
    + +<%@ include file="/jsp/include/pager.jsp" %> + +
    +
    + + +<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/listTerminals.jsp b/posterita/posterita/web/jsp/pos/listTerminals.jsp new file mode 100644 index 0000000000..c96de110f7 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/listTerminals.jsp @@ -0,0 +1,120 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2008 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Ashley +--%> + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.beans.*" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> +<%@ taglib uri="http://displaytag.sf.net" prefix="display" %> + +<%@page import="org.posterita.struts.pos.TerminalAction"%> + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> +
    + + + + + + + + +
    + + + + +   + + + + <pos:message textOnly="true" key="add"/> + + + + <pos:message textOnly="true" key="ResetCurrentPOSTerminal"/> + +
    +
    + + + + + + + + + + + + Edit + + + + View + + + <% + String activateDisplay = "none"; + String deactivateDispay = "none"; + if (((TerminalBean)row).getIsActive().booleanValue()) + { + deactivateDispay = "inline"; + } + else + { + activateDisplay = "inline"; + } + %> + + + + Deactivate + + + + + + Activate + + + + + <pos:message textOnly="true" key="UpdateCurrentPOSTerminal"/> + + + + + +<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/monthlySalesReport.jsp b/posterita/posterita/web/jsp/pos/monthlySalesReport.jsp new file mode 100644 index 0000000000..ae00109316 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/monthlySalesReport.jsp @@ -0,0 +1,36 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2008 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author sendy +--%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> +<%@page import="org.posterita.Constants"%> + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + <%=salesReportData%> + +<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/orderDetailsPerProduct.jsp b/posterita/posterita/web/jsp/pos/orderDetailsPerProduct.jsp new file mode 100644 index 0000000000..9eadde4ae4 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/orderDetailsPerProduct.jsp @@ -0,0 +1,113 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author sendy +--%> + + +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.beans.ProductBean" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.lib.UdiConstants" %> +<%@ page import="org.posterita.struts.pos.POSReportAction" %> +<%@ page import="org.posterita.struts.pos.POSGoodsAction" %> +<%@ page import="org.compiere.process.DocAction" %> +<%@ page import="org.compiere.model.MOrder" %> +<%@ page import="org.posterita.order.UDIOrderTypes" %> +<%@ taglib uri="http://displaytag.sf.net" prefix="display" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> + +<% + String url = "ViewPOSHistory.do?orderType=" + orderType; + String collection = Constants.POS_HISTORY; +%> + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    +<%@ include file="/jsp/include/printOrderApplet2.jsp" %> +<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/orderHeader.jsp b/posterita/posterita/web/jsp/pos/orderHeader.jsp new file mode 100644 index 0000000000..52389c3385 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/orderHeader.jsp @@ -0,0 +1,129 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + + + +<%@ page import="org.compiere.model.MBPartner" %> +<%@ page import="org.compiere.model.MOrder" %> +<%@ page import="org.posterita.beans.POSHistoryBean" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + + +
    +
    + + +
    + + +
    + +
    +
    + +
    + : + + + +
    + +
    + + : + + + ( + + : + + + + , : + + + + , : + + ) +
    + + +
    + +
    +
    + +
    +
    + + + <% + String url = ""; + String partnerId = partner.get_ID() + ""; + %> + + <%url = "POSCustomerAction.do?action=viewPOSCustomer&bpartnerId=" + partnerId; %> + + + <%url = "POSVendorAction.do?action=viewVendorDetails1&bpartnerId=" + partnerId; %> + + + + + +
    + +
    + + + +
    + +
    + + : + +
    + +
    + + +
    + + +
    + : +
    +
    + +
    + +
    + +
    +
    \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/orderScreen.jsp b/posterita/posterita/web/jsp/pos/orderScreen.jsp new file mode 100644 index 0000000000..2c4b194387 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/orderScreen.jsp @@ -0,0 +1,727 @@ + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + +<% + String path = request.getContextPath(); + String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; + String appName = (String) request.getSession().getAttribute(Constants.APP_NAME); + Properties ctx = TmkJSPEnv.getCtx(request); + String posName = POSTerminalManager.getTerminalName(ctx); + String orgName = MOrg.get(ctx, Env.getContextAsInt(ctx, UdiConstants.ORG_ID_CTX_PARAM)).getName(); + String roleName = MRole.get(ctx, Env.getContextAsInt(ctx, UdiConstants.AD_ROLE_ID)).getName(); + + Object bPId = request.getSession().getAttribute(Constants.BPARTNER_ID); + Object bPName = request.getSession().getAttribute(Constants.BPARTNER_NAME); + Object bPCredit = request.getSession().getAttribute(Constants.BPARTNER_CREDIT); + String bPartnerId = bPId == null? "":bPId.toString(); + String bPartnerName = bPName == null? "": bPName.toString(); + String bPartnerCredit = bPCredit == null? "": bPCredit.toString(); + + //set configuration + Configuration configuration = Configuration.getConfiguration(request); + String orderType = configuration.getOrderType(); + boolean isSOTrx = configuration.getIsSOTrx(); + String paymentRule = configuration.getPaymentRule(); + String searchProductBy = configuration.getSearchProductBy(); + boolean isCustomerCompulsory = configuration.isCustomerCompulsory(); + boolean isTerminalLocked = POSTerminalManager.isTerminalLocked(ctx); + + Integer priceListId = PriceListManager.getDefaultPriceListId(ctx, isSOTrx); + Object plId = request.getSession().getAttribute(Constants.ORDER_PRICE_LIST); + if (plId != null) + { + try + { + priceListId = Integer.valueOf(String.valueOf(plId)); + } + catch (NumberFormatException e){} + } + MPriceList priceList = MPriceList.get(ctx, priceListId.intValue(), null); + String priceListName = priceList.getName(); + MCurrency currency = MCurrency.get(ctx, priceList.getC_Currency_ID()); + BigDecimal roundOffFactor = currency.getRoundOffFactor(); + + if (isTerminalLocked) + { + posName += " (Locked)"; + } + + String bpartnerType = "Customer"; + if (!isSOTrx) + { + bpartnerType = "Vendor"; + } + + String showComponent = ""; + + if(orderType.equals(UDIOrderTypes.CUSTOMER_RETURN_ORDER.getOrderType()) || + orderType.equals(UDIOrderTypes.POS_GOODS_RETURN_NOTE.getOrderType()) + ) + { + showComponent = "style='display:none'"; + } + + String advancedAction = "/LoadAdvancedOrderScreen.do?action=loadAdvancedOrderScreen&isSOTrx="+isSOTrx; + + int roleId = Env.getAD_Role_ID(ctx); + float discountAllowed = RoleManager.getDiscountAllowed(ctx, roleId, null).floatValue(); + boolean isAllowedOverridePriceLimit = RoleManager.isOverridePriceLimitAllowed(ctx, roleId, null); + boolean isDiscountUptoLimitPrice = RoleManager.isDiscountUptoPriceLimit(ctx, roleId, null); + boolean isDiscountAllowedOnTotal = RoleManager.isDiscountAllowedOnTotal(ctx, roleId, null); + + int menuId = MenuManager.getMenuId(ctx, "pmenu.cash.sales"); +%> + +<%@page import="org.posterita.Constants"%> +<%@page import="java.util.Properties"%> +<%@page import="org.posterita.core.TmkJSPEnv"%> +<%@page import="org.compiere.util.Env"%> +<%@page import="org.posterita.lib.UdiConstants"%> +<%@page import="org.compiere.model.MPriceList"%> +<%@page import="org.compiere.model.MOrg"%> +<%@page import="org.compiere.model.MRole"%> +<%@page import="org.posterita.businesslogic.ShoppingcartManager"%> +<%@page import="org.posterita.core.Configuration"%> +<%@page import="java.math.BigDecimal"%> +<%@page import="org.compiere.model.MCurrency"%> +<%@page import="org.compiere.util.WebSessionCtx"%> +<%@page import="org.posterita.user.WebUserInfo"%> +<%@page import="org.posterita.order.UDIOrderTypes.POSOrder"%> +<%@page import="org.posterita.order.UDIOrderTypes"%> +<%@page import="org.posterita.businesslogic.administration.PriceListManager"%> +<%@page import="org.posterita.businesslogic.POSTerminalManager"%> + +<%@page import="org.posterita.businesslogic.administration.RoleManager"%> +<%@page import="org.posterita.businesslogic.MenuManager"%> + + + + + <%=appName%> + + + + + + + + + + + + + + + + + +<%@ include file="/jsp/include/showErrors.jsp" %> +
    Please wait...
    + + + + + + + + + + + + + + + + + + + + + + + + " styleId="roundOffFactor"/> + + + + + + + + + + + + + + + " id="isCustomerCompulsory"/> + + + + + + + + + + + +
    +
    + + +
    + <%= orderType %> +
    +
    +
    +
    + : + <%=orgName%> +
    +
    + : + <%=posName%> +
    +
    +
    +
    + : + +
    +
    + : + <%=roleName%> +
    +
    +
    +
    +
    +
    +
    +
    +
    0.00
    +
    +
    +
    +
    +
    +
    +
    + + + + + + + + +
    + BARCODE: + + + NAME: +
    +
    + DESC: +
    +
    +
    +
    +
    +
    +
    +
    + <%=priceListName%> +
    +
    +
    +
    +
    +
    + <%= ShoppingcartManager.getShoppingcartAsHTML(request, orderType)%> +
    +
    +
    +
    +
    +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + Barcode + + +
    + Name + + +
    + Description + + +
    + Tax Cat + + +
    + Stock Qty + + +
    + Price List + + +
    + Price Std + + +
    + Price Limit + + +
    +
    +
    + + Increase item quantity + Decrease item quantity + Remove item +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + +
    + <%=bpartnerType%> + + +
    +
    + Code + + <%=bPartnerId%> +
    + Name + + <%=bPartnerName%> +
    + Credit Available + + <%=bPartnerCredit%> +
    + Credit Limit + + +
    + Open Balance + + +
    +
    +
    +
    +
    +

    Payment Method

    + Cash Payment + Card Payment + Cheque Payment +
    Mix Payment + On Credit Payment +
    +
    +
    + + +
    +
    +
    +
    + "/>')" src="images/newUI/butn-discount.gif" alt="Discount" width="95px" height="23px" border="0px"/> + Quick Discount + Open Drawer + Clear all items +
    +
    +
    +
    +
    + Change PIN + Reset USER + Proceed to Checkout +
    +
    +
    +
    +
    + F1 Barcode | F2 Name | F3 Description | F4 Qty | F5 Customer | F6 Discount | F8 Toggle Quick Discount | F9 Cash | F10 Card | F11 Check | F12 Mix | + Ctrl+C Credit | Ctrl+Up MoveUp | Ctrl+Down MoveDown | Ctrl+Left Decrement | Ctrl-Right Increment | Ctrl-Backspace Remove | Ctrl+M Menu | + Ctrl-D Open Drawer | Ctrl-Delete Clear | Ctrl+Space Checkout | Ctrl+P Change PIN | Ctrl+R Reset User +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Total:

    Amount Tendered:
    Write Off Amount:
    Payment Amount:
    Amount Refunded:
     
    + + +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + +

    Total:

    Card + +
    Card No:
    + + +
    +
    +
    +
    +
    + + + + + + + + + + + + +

    Total:

    Cheque No:
    + + +
    +
    +
    +
    +
    + + + + + + + + + + + + +

    Total:

    Card No:
    + + +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Total:

    Cash Amt:
    Cheque Amt:
    Cheque No:
    Card Amt:
    Card No:
    + + +
    +
    +
    + +
    +
    +
    + + + + + + + + + + +
    + +
    +
    + +
    +
    +
    + + +
    +
    +
    +
    + +
    + " code="org.posterita.core.PrintOrderApplet.class" width="0" height="0"> +
    + +
    +
    +
    +
    + + diff --git a/posterita/posterita/web/jsp/pos/partialPOSOrderShoppingCart.jsp b/posterita/posterita/web/jsp/pos/partialPOSOrderShoppingCart.jsp new file mode 100644 index 0000000000..059dc27a9e --- /dev/null +++ b/posterita/posterita/web/jsp/pos/partialPOSOrderShoppingCart.jsp @@ -0,0 +1,27 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + + + +<% String items = Constants.PARTIAL_ORDER_SHOPPING_CART_ITEMS; %> +<%@ include file="/jsp/pos/posShoppingCart.jsp" %> + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/posLogin.jsp b/posterita/posterita/web/jsp/pos/posLogin.jsp new file mode 100644 index 0000000000..e35255195a --- /dev/null +++ b/posterita/posterita/web/jsp/pos/posLogin.jsp @@ -0,0 +1,308 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + + + + + +<% +String path = request.getContextPath(); +String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; +%> + + +<%@ page import="org.posterita.Constants" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + +<% +String appName = (String) request.getSession().getAttribute(Constants.APP_NAME); + +if(appName == null) +{ + appName = "POSterita"; +} + +%> + + + + + +Welcome to <%=appName%> + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + +
    POS Login
    +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + <%@ include file="/jsp/include/errors.jsp"%> +
    +
    +
    + +
    + + + +
    + + + +
    + +
    + + + +
    +
    +
    +
    +
    +
    +
    +
    + + + + + + + + + + + + + +
    + +
    + +
    + +
    +
    +
    +
    + 7 +
    +
    +
    +
    + 8 +
    +
    +
    +
    + 9 +
    +
    +
    +
    + 4 +
    +
    +
    +
    + 5 +
    +
    +
    +
    + 6 +
    +
    +
    +
    + 1 +
    +
    +
    +
    + 2 +
    +
    +
    +
    + 3 +
    +
    +
    +
    + C +
    +
    +
    +
    + 0 +
    +
    +
    +
    + OK +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    + + + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/posPINLogin.jsp b/posterita/posterita/web/jsp/pos/posPINLogin.jsp new file mode 100644 index 0000000000..cb158e42e1 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/posPINLogin.jsp @@ -0,0 +1,141 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + + + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + +<title><pos:message textOnly="true" key="posPassowrd.welcome"/> + + + + + + + + + + + + +
    + + + + + + + + + + + +
    +
    + + + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/posPassword.jsp b/posterita/posterita/web/jsp/pos/posPassword.jsp new file mode 100644 index 0000000000..22c85c444a --- /dev/null +++ b/posterita/posterita/web/jsp/pos/posPassword.jsp @@ -0,0 +1,79 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + + + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ page import="org.posterita.Constants" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + +<pos:message textOnly="true" key="posPassowrd.welcome"/> + + + + + + + + + + +
    + + + + + + + + + + + + + + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/posReport.jsp b/posterita/posterita/web/jsp/pos/posReport.jsp new file mode 100644 index 0000000000..567f283935 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/posReport.jsp @@ -0,0 +1,312 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + + + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.beans.*" %> +<%@ page import="org.posterita.struts.pos.POSOrderAction" %> +<%@ page import="org.posterita.businesslogic.performanceanalysis.ReportDateManager" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + +"/> +"/> + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + + + + + +
    +
    + + + + + +
    +
    + + + + +
    +
    +
    + + + + +
    +
    +
    +
    + + + + + +
    +
    + + + +
    +   +
    +   +   +   +   +
    +
    + + + + + <% request.getSession().removeAttribute(Constants.REPORT_URL); %> + + + + + + +
    + + <%=reportData%> +
    +

    + +   + +

    +
    + <% request.getSession().removeAttribute(Constants.TABULAR_REPORT_DATA); %> +
    + + + + + + + + + <% request.getSession().removeAttribute(Constants.TABULAR_REPORT_DATA2); %> + +
    +
    + + +
    + +<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/posReport1.jsp b/posterita/posterita/web/jsp/pos/posReport1.jsp new file mode 100644 index 0000000000..be4df44fe7 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/posReport1.jsp @@ -0,0 +1,292 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + + + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.beans.*" %> +<%@ page import="org.posterita.struts.pos.POSOrderAction" %> +<%@ page import="org.posterita.businesslogic.performanceanalysis.ReportDateManager" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + +"/> +"/> + + + + + + + + + + + + + + +
    + :
    + + + +
    +
    + + + + + +
    +
    +
    +
    + + + + + + + + + + + + +
    +
    + +
    +
    + + + + + + + + + + +
    + + + + + + + + + +
    + + + + <%@ include file="/jsp/include/dayList.jsp" %> + + + + <%@ include file="/jsp/include/monthList.jsp" %> + + + + <%@ include file="/jsp/include/yearList.jsp" %> + + + + + + <%@ include file="/jsp/include/hourList.jsp" %> + + h + + <%@ include file="/jsp/include/minuteList.jsp" %> + +
    +
    + + + + + + + + + + +
    + + + + <%@ include file="/jsp/include/dayList.jsp" %> + + + + <%@ include file="/jsp/include/monthList.jsp" %> + + + + <%@ include file="/jsp/include/yearList.jsp" %> + + + + + + <%@ include file="/jsp/include/hourList.jsp" %> + + h + + <%@ include file="/jsp/include/minuteList.jsp" %> + +
    +
    +
    +
    +
    + :
    + + + +
     
    +
    + + + + + + + + + + + + + +
    +   + +
    +   + +
    +   + +
    +   + +
    +
    + +
    + + + + <% request.getSession().removeAttribute(Constants.REPORT_URL); %> + + + + + + <%=reportData%> +
    +

    + + <% request.getSession().removeAttribute(Constants.TABULAR_REPORT_DATA); %> +

    +
    +
    +
    + +
    + +<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/posShoppingCart.jsp b/posterita/posterita/web/jsp/pos/posShoppingCart.jsp new file mode 100644 index 0000000000..bfc05c936c --- /dev/null +++ b/posterita/posterita/web/jsp/pos/posShoppingCart.jsp @@ -0,0 +1,101 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + + + +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.Constants" %> + + +<%@ page import="org.posterita.struts.pos.POSOrderAction" %> +<%@ page import="org.posterita.beans.ProductBean" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.lib.UdiConstants" %> +<%@ page import="org.posterita.struts.pos.POSGoodsAction" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + + + + + + + + + + +<% +String styleClass = "label"; +if ((count.intValue()%2) != 0) + styleClass = "contentname"; +%> + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + + + + + + +
       +
    + +
    +
    \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/posShoppingCartFirstPage.jsp b/posterita/posterita/web/jsp/pos/posShoppingCartFirstPage.jsp new file mode 100644 index 0000000000..a0900ab35b --- /dev/null +++ b/posterita/posterita/web/jsp/pos/posShoppingCartFirstPage.jsp @@ -0,0 +1,27 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> +<% String items = Constants.SHOPPING_ORDER_CART_ITEMS; %> +<%@ include file="/jsp/pos/posShoppingCart.jsp" %> + + + + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/posSubMenu.jsp b/posterita/posterita/web/jsp/pos/posSubMenu.jsp new file mode 100644 index 0000000000..76d680067e --- /dev/null +++ b/posterita/posterita/web/jsp/pos/posSubMenu.jsp @@ -0,0 +1,79 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.core.MenuItem" %> + +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.lib.UdiConstants" %> +<%@ page import="java.util.Properties"%> +<%@ page import="org.posterita.model.MWebMenu" %> +<%@ page import="java.util.HashMap" %> +<%@ page import="java.util.ArrayList" %> +<%@ page import="org.posterita.core.MenuItem" %> +<%@ page import="java.util.Map.Entry"%> +<%@ page import="java.util.Iterator"%> +<%@ page import="org.posterita.core.businesslogic.ElementManager" %> +<%@ page import="org.posterita.core.bean.ElementBean" %> +<%@ page import="org.posterita.core.TmkJSPEnv" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> + +<%@page import="org.posterita.businesslogic.MenuManager"%> + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> + +
    + + + + + + +
    + + + + +
    +
    +

    POS MAIN MENU

    +
    +
    + <%= MenuManager.getMainMenus(ctx, request) %> +
    +
    +
    + + + + + +<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/postingSuccess.jsp b/posterita/posterita/web/jsp/pos/postingSuccess.jsp new file mode 100644 index 0000000000..6416721bae --- /dev/null +++ b/posterita/posterita/web/jsp/pos/postingSuccess.jsp @@ -0,0 +1,55 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author shameem +--%> + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.beans.*" %> +<%@ page import="org.posterita.struts.pos.CashBookAction" %> + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> + + + + + +Resubmit Posting +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + +
    + All the documents/invoice have heen sucessfully resubmitted. +
    + + +<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/priceCheck.jsp b/posterita/posterita/web/jsp/pos/priceCheck.jsp new file mode 100644 index 0000000000..abdd447f7f --- /dev/null +++ b/posterita/posterita/web/jsp/pos/priceCheck.jsp @@ -0,0 +1,80 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + + + + +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.Constants" %> + + +<%@ page import="org.posterita.struts.pos.POSGoodsAction" %> +<%@ page import="org.posterita.beans.ProductBean" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.lib.UdiConstants" %> +<%@ page import="org.compiere.model.MOrder" %> + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + + + + + + + + + + +
    + + + +
    + +
    + + + +
    +
    + +<%@ include file="/jsp/include/posFooter.jsp" %> + diff --git a/posterita/posterita/web/jsp/pos/priceList.jsp b/posterita/posterita/web/jsp/pos/priceList.jsp new file mode 100644 index 0000000000..6eba32bc88 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/priceList.jsp @@ -0,0 +1,109 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + + + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.beans.*" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + + + + +
    + : + +   +
    + + +
    + + + + + + + + + + + + <% + String style = "label"; + if((count.intValue() % 2) == 0) + style = "contentname"; + %> + + + + + + + +
    + + + + +   +
    > + + > + + > + + + + +
    + + + + +
    + +
    +
    +<%@include file="/jsp/include/posFooter.jsp"%> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/printPOSOrder.jsp b/posterita/posterita/web/jsp/pos/printPOSOrder.jsp new file mode 100644 index 0000000000..855dca7593 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/printPOSOrder.jsp @@ -0,0 +1,157 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.compiere.model.MOrder" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.struts.pos.POSOrderAction" %> +<%@ page import="java.util.ArrayList" %> + + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + <pos:message textOnly="true" key="print.order"/> + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    +
    + <%-- Caters for previously sold vehicles where sales rep was not available --%> + + Sales Representative: + +
    + + + +
    + + + +
    + + +
    + : +
    + + + + + +
    + + + + + + + + + + + + + <% + String styleClass = "label"; + if ((count.intValue()%2) != 0) + styleClass = "contentname"; + %> + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    >>>>>>
    + + + + + + + +
    +
    + + + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/productBarcodeCart.jsp b/posterita/posterita/web/jsp/pos/productBarcodeCart.jsp new file mode 100644 index 0000000000..7609a04b0a --- /dev/null +++ b/posterita/posterita/web/jsp/pos/productBarcodeCart.jsp @@ -0,0 +1,387 @@ + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + +<% + String path = request.getContextPath(); + String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; + Properties ctx = TmkJSPEnv.getCtx(request); + String posName = POSTerminalManager.getTerminalName(ctx); + int menu_id = MenuManager.getMenuId(ctx, "pmenu.administration"); + String orderType = "Barcode Printing"; + String orgName = MOrg.get(ctx, Env.getContextAsInt(ctx, UdiConstants.ORG_ID_CTX_PARAM)).getName(); + String roleName = MRole.get(ctx, Env.getContextAsInt(ctx, UdiConstants.AD_ROLE_ID)).getName(); + int m_pricelist_id = Env.getContextAsInt(ctx, UdiConstants.PRICELIST_CTX_PARAM); + MPriceList priceList = MPriceList.get(ctx, m_pricelist_id, null); + String priceListName = priceList.getName(); + String appName = (String) request.getSession().getAttribute(Constants.APP_NAME); + + //set configuration + Configuration configuration = Configuration.getConfiguration(request); + String searchProductBy = configuration.getSearchProductBy(); +%> + + +<%@page import="org.posterita.Constants"%> +<%@page import="java.util.Properties"%> +<%@page import="org.posterita.core.TmkJSPEnv"%> +<%@page import="org.compiere.util.Env"%> +<%@page import="org.posterita.lib.UdiConstants"%> +<%@page import="org.compiere.model.MPriceList"%> +<%@page import="org.compiere.model.MOrg"%> +<%@page import="org.compiere.model.MRole"%> +<%@page import="org.posterita.businesslogic.ShoppingcartManager"%> +<%@page import="org.posterita.businesslogic.POSTerminalManager"%> +<%@page import="org.posterita.TangoColors"%> +<%@page import="org.posterita.businesslogic.MenuManager"%> +<%@page import="org.posterita.core.Configuration"%> + + + + + <%=appName%> + + + + + + + + + + + + + + + + +
    Please wait...
    + + + + + + + + + + + + + + " styleId="priceListId"/> + + + + + + + + + + + + + +
    +
    + + +
    + <%= orderType %> +
    +
    +
    +
    + : + <%=orgName%> +
    +
    + : + <%=posName%> +
    +
    +
    +
    + : + +
    +
    + : + <%=roleName%> +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + + + + + + +
    + BARCODE: + + + NAME: +
    +
    + DESC: +
    +
    +
    +
    +
    +
    +
    +
    + <%=priceListName%> +
    +
    +
    +
    +
    +
    + <%= ShoppingcartManager.getBarcodecartAsHTML(request)%> +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    + + +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + Barcode + + +
    + Name + + +
    + Description + + +
    + Tax Cat + + +
    + Stock Qty + + +
    + Price List + + +
    + Price Std + + +
    + Price Limit + + +
    + +
    +
    + + Increase item quantity + Decrease item quantity + Remove item +
    +
    +
    + + + + +
    + Do you want to print labels with: +
     Product Name
    +
     Product Description
    +
     Product Prices
    +
    +
    +
    +
    + + + + + +
    + <%=priceListName%> + +
    CHANGE
    +
    +
    +
    +
    +
    +
    +
    + Open Drawer + Clear all items +
    +
    +
    +
    +
    PRINT
    +
    +
    +
    + F1 Barcode | F2 Name | F3 Description | F4 Qty | Ctrl+Up MoveUp | Ctrl+Down MoveDown | Ctrl+Left + Increment | Ctrl-Right Decrement | Ctrl-Backspace Remove | Ctrl-Space Open Drawer | Ctrl-Delete Clear | Ctrl-P + Print Barcode | Ctrl+M Menu +
    +
    +
    + " code="org.posterita.core.PrintOrderApplet.class" width="0" height="0"> +
    + + + + + + + + + + + + + + + + + + + + + diff --git a/posterita/posterita/web/jsp/pos/productDetails.jsp b/posterita/posterita/web/jsp/pos/productDetails.jsp new file mode 100644 index 0000000000..2b6fb1014c --- /dev/null +++ b/posterita/posterita/web/jsp/pos/productDetails.jsp @@ -0,0 +1,74 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.beans.ProductDetailsBean" %> +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + + + + + + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/productDetailsError.jsp b/posterita/posterita/web/jsp/pos/productDetailsError.jsp new file mode 100644 index 0000000000..d824f96b9b --- /dev/null +++ b/posterita/posterita/web/jsp/pos/productDetailsError.jsp @@ -0,0 +1,25 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + + + +
    Could not retrieve product details
    \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/productsUpdated.jsp b/posterita/posterita/web/jsp/pos/productsUpdated.jsp new file mode 100644 index 0000000000..dec301df57 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/productsUpdated.jsp @@ -0,0 +1,71 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.beans.*" %> +<%@ page import="org.posterita.struts.pos.EditBulkProductFromFileAction" %> +<%@ page import="org.compiere.process.DocumentEngine" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> + +<%@ page import="org.compiere.model.MOrder" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.struts.pos.POSOrderAction" %> +<%@ page import="java.util.ArrayList" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + +
    + + + + + +<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/reportCalendar.jsp b/posterita/posterita/web/jsp/pos/reportCalendar.jsp new file mode 100644 index 0000000000..bb21563622 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/reportCalendar.jsp @@ -0,0 +1,156 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.beans.UDIBean" %> +<%@ page import="java.util.*" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/tabTop.jsp" %><%@ include file="/jsp/include/tabBottom.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + <%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + + + + + + + + + +
    + + + + + + + + + +
    + : + + + <%@ include file="/jsp/include/dayList.jsp" %> + + + + <%@ include file="/jsp/include/monthList.jsp" %> + + + + <%@ include file="/jsp/include/yearList.jsp" %> + + + + + + <%@ include file="/jsp/include/hourList.jsp" %> + + h + + <%@ include file="/jsp/include/minuteList.jsp" %> + +
    +
    + + + + + + + + + + +
    + : + + + <%@ include file="/jsp/include/dayList.jsp" %> + + + + <%@ include file="/jsp/include/monthList.jsp" %> + + + + <%@ include file="/jsp/include/yearList.jsp" %> + + + + + + <%@ include file="/jsp/include/hourList.jsp" %> + + h + + <%@ include file="/jsp/include/minuteList.jsp" %> + +
    +
    + + + + + +   +
    + + <%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/reportFilter.jsp b/posterita/posterita/web/jsp/pos/reportFilter.jsp new file mode 100644 index 0000000000..282a501a87 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/reportFilter.jsp @@ -0,0 +1,230 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.beans.*" %> +<%@ page import="org.posterita.struts.pos.POSOrderAction" %> +<%@ page import="org.posterita.businesslogic.performanceanalysis.ReportDateManager" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + + +
    + + + + + + + + + + +
    + +
    +
    + : + +
    +
    + : +
    +
    + + +
    +
    + +
    +
    + Custom + + + + + <%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + +
    + + + + + + + + + +
    + : + + + <%@ include file="/jsp/include/dayList.jsp" %> + + + + <%@ include file="/jsp/include/monthList.jsp" %> + + + + <%@ include file="/jsp/include/yearList.jsp" %> + + + + + + <%@ include file="/jsp/include/hourList.jsp" %> + + h + + <%@ include file="/jsp/include/minuteList.jsp" %> + +
    +
    + + + + + + + + + + +
    + : + + + <%@ include file="/jsp/include/dayList.jsp" %> + + + + <%@ include file="/jsp/include/monthList.jsp" %> + + + + <%@ include file="/jsp/include/yearList.jsp" %> + + + + + + <%@ include file="/jsp/include/hourList.jsp" %> + + h + + <%@ include file="/jsp/include/minuteList.jsp" %> + +
    +
    +
    +
    +
    +
    + + + + +
    + +
    +
    +
    + +<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/retShoppingCart.jsp b/posterita/posterita/web/jsp/pos/retShoppingCart.jsp new file mode 100644 index 0000000000..0f40f17a19 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/retShoppingCart.jsp @@ -0,0 +1,150 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + + + +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.Constants" %> + + +<%@ page import="org.posterita.struts.pos.POSOrderAction" %> +<%@ page import="org.posterita.beans.ProductBean" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.lib.UdiConstants" %> +<%@ page import="org.posterita.struts.pos.POSGoodsAction" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt"%> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + + + + + + + + + + + + +<% + String styleClass = "label"; + if ((count.intValue()%2) != 0) + styleClass = "contentname"; +%> + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + +   + +   + +   +
    + + + + + + + + + + + + + + + + + + + + + "/> + + + + + + + + + "/> + + + + + ">X +
    + + + + + +    
    \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/salesReport.jsp b/posterita/posterita/web/jsp/pos/salesReport.jsp new file mode 100644 index 0000000000..e1f6176a5b --- /dev/null +++ b/posterita/posterita/web/jsp/pos/salesReport.jsp @@ -0,0 +1,76 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> +<% + String isSalesReport = request.getParameter("isSalesReport"); + String pageTitle = "smenu.sales.report"; + String reportDetailsStyle = "display: block"; + + boolean isSalesRPT = Boolean.parseBoolean(isSalesReport); + + if(!(isSalesRPT)) + { + pageTitle = "smenu.purchase.report"; + reportDetailsStyle = "display:none"; + } +%> + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.beans.*" %> +<%@ page import="org.posterita.struts.pos.POSOrderAction" %> +<%@ page import="org.posterita.businesslogic.performanceanalysis.ReportDateManager" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + +
    +
    + + + + + +
    +
    +<%@ include file="/jsp/pos/customReportTable.jsp" %> + +
    +<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/saveVendor.jsp b/posterita/posterita/web/jsp/pos/saveVendor.jsp new file mode 100644 index 0000000000..c50d51b632 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/saveVendor.jsp @@ -0,0 +1,144 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Martine +--%> + + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.beans.UDIBean" %> +<%@ page import="org.posterita.core.MenuItem" %> + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + + + + + + + +
    + + +
    + + + + + + + + + + + + + + + + + +
    + * + + +
    + * + + + + +
    + * + + + + + +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + + + + + + + + + + + + + + +
     
    +
    +
    +
    +   +
    + + +<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/searchCustomer.jsp b/posterita/posterita/web/jsp/pos/searchCustomer.jsp new file mode 100644 index 0000000000..8a7fe6e881 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/searchCustomer.jsp @@ -0,0 +1,98 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + + +<%@ page import="org.posterita.businesslogic.CustomerManager" %> +<%@ page import="org.posterita.core.TmkJSPEnv" %> +<%@ page import="java.util.ArrayList" %> +<%@ page import="org.posterita.beans.CustomerBean" %> +<%@ page import="java.util.Properties" %> +<%@ page import="org.posterita.core.businesslogic.ElementManager" %> +<%@ page import="org.posterita.core.bean.ElementBean" %> +<% + Properties ctx = TmkJSPEnv.getCtx(request); + + String customerName = request.getParameter("customerQuery"); + ElementBean elementBean = null; + elementBean = ElementManager.getMsg(ctx, "not.found"); + + ArrayList customerList = CustomerManager.searchCustomers(ctx,customerName,false); + + CustomerBean bean = null; + + if (customerList == null || customerList.size() == 0) + { + //out.print("
      "); + //out.print("
    • "); + //out.print("
    "); + out.print("
    "); + } + else + { + int size = 15; + size = (size > customerList.size())? customerList.size() : size; + + out.print("
      "); + + for(int i=0;i"); + out.print(name); + out.print(""); + } + + out.print("
    "); + + elementBean = ElementManager.getMsg(ctx, "search.result.displaying"); + String msg = elementBean.getName(); + + out.print("
    "); + + } +%> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/searchPOSGarmentAttributes.jsp b/posterita/posterita/web/jsp/pos/searchPOSGarmentAttributes.jsp new file mode 100644 index 0000000000..542a80aac8 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/searchPOSGarmentAttributes.jsp @@ -0,0 +1,56 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + + + +<%@ page import="org.posterita.businesslogic.POSProductManager" %> +<%@ page import="java.util.ArrayList" %> +<%@ page import="org.posterita.core.businesslogic.ElementManager" %> +<%@ page import="org.posterita.core.bean.ElementBean" %> +<%@ page import="java.util.Properties" %> +<%@ page import="org.posterita.core.TmkJSPEnv" %> +<% + ArrayList results = POSProductManager.searchPOSGarmentAttributes(request); + Properties ctx = TmkJSPEnv.getCtx(request); + int max = 10; + + ElementBean elementBean = null; + elementBean = ElementManager.getMsg(ctx, "not.found"); + + if (results == null || results.size() == 0) + { + out.print(elementBean.getName()); + } + else + { + out.print("
      "); + + max = (max > results.size()) ? results.size() : max; + + for(int i=0;i" + results.get(i) + ""); + } + + out.print("
        "); + } +%> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/searchPOSProducts.jsp b/posterita/posterita/web/jsp/pos/searchPOSProducts.jsp new file mode 100644 index 0000000000..7a50df7677 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/searchPOSProducts.jsp @@ -0,0 +1,299 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.beans.*" %> +<%@ page import="org.posterita.struts.pos.POSProductAction" %> +<%@ page import="org.compiere.process.DocumentEngine" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> + +<%@ page import="org.compiere.model.MOrder" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.struts.pos.POSOrderAction" %> +<%@ page import="java.util.ArrayList" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> + + + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + +
        + + + + +   + + +
        +
        + + + + + + + + + + + + + + + + + + + +
        + + +
        + +<% + String url = "SearchPOSProducts.do"; + String collection = Constants.VIEW_POS_PRODUCTS; +%> + +
        + + + + + + + + + + + + <% + String styleClass = "label"; + if ((count.intValue()%2) != 0) + styleClass = "contentname"; + %> + + + + + + + + + +
         
        width="100px"> + + width="400px"> + + > + + > + +   +
        +<%@ include file="/jsp/include/pager.jsp" %> + + +
        + +<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/searchVendor.jsp b/posterita/posterita/web/jsp/pos/searchVendor.jsp new file mode 100644 index 0000000000..4cc6401b05 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/searchVendor.jsp @@ -0,0 +1,97 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Martine +--%> + + + +<%@ page import="org.posterita.businesslogic.CustomerManager" %> +<%@ page import="org.posterita.core.TmkJSPEnv" %> +<%@ page import="java.util.ArrayList" %> +<%@ page import="org.posterita.beans.CustomerBean" %> +<%@ page import="org.posterita.businesslogic.BPartnerManager" %> +<%@ page import="org.posterita.businesslogic.VendorManager" %> +<%@ page import="org.posterita.core.businesslogic.ElementManager" %> +<%@ page import="org.posterita.core.bean.ElementBean" %> +<% + Properties ctx = TmkJSPEnv.getCtx(request); + String customerName = request.getParameter("customerQuery"); + + ArrayList customerList = VendorManager.searchVendors(TmkJSPEnv.getCtx(request),customerName,true); + CustomerBean bean = null; + + ElementBean elementBean = null; + elementBean = ElementManager.getMsg(ctx, "not.found"); + + if (customerList == null || customerList.size() == 0) + { + out.print("
          "); + out.print("
        • "); + out.print("
        "); + out.print("
        "); + } + else + { + int size = 15; + size = (size > customerList.size())? customerList.size() : size; + + out.print("
          "); + + for(int i=0;i"); + out.print(vendorName); + out.print(""); + } + + out.print("
        "); + + elementBean = ElementManager.getMsg(ctx, "search.result.displaying"); + String msg = elementBean.getName(); + + out.print("
        "); + + } +%> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/settleAPPayment.jsp b/posterita/posterita/web/jsp/pos/settleAPPayment.jsp new file mode 100644 index 0000000000..183919f9b4 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/settleAPPayment.jsp @@ -0,0 +1,592 @@ + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.beans.*" %> +<%@ page import="org.posterita.struts.pos.CreditOrderAction" %> +<%@ page import="org.compiere.process.DocumentEngine" %> +<%@ page import="java.util.Iterator" %> +<%@ page import="java.util.ArrayList" %> +<%@ page import="org.posterita.core.UDIPair" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> + + + + + + + + +
        +
        + +
        +
        + +
        + +
        + +
        + + <%@ include file="/jsp/include/searchVendorPanel.jsp" %> +
        + +
        +
        +
        +
        +
        + + + + + + + + + +
        + UnPaid + + Partially Paid + + Paid + + Over Paid +
        + +<%-- + + + +--%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +<%@ include file="/jsp/include/errors.jsp" %> + +
        + + + + + +
        + +
        + + + + + + + + + + + + + + + + + + + + + + + + + + + <% + String styleClass = ""; + %> + + <% + styleClass = "green"; + %> + + + + <% + styleClass = "red"; + %> + + + + + <% + styleClass = "yellow"; + %> + + + + + + + + <% + styleClass = "blue"; + %> + + + + <% + styleClass = "blue"; + %> + + + + + + + + + + + + + + + + + + + + + + + +
        + Pay + + + + + + + + + + + + + + + + + + + + + + + +   +
        > + + + + + Pay + + + + + > + "> + + + > + "> + + + > + + + > + + + > + + > + + > + + > + + > + + + > + + "> + + + > + + + > + + + + + +
        + + Pay + + + + + + Match + + +
        +
        + +
        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        + + + + + + + + + + + + + + +   +
        + "> + + + + + + + + + + + + + + + + + + +
        +
        + +
        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        + + + + + + + + + + + + + + + + + +
        + + + + + + + + + + + + + + + + + +
        +
        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        + + + + + + + + + + + + + + + +
        + + + + + + + + + + + + + + + +
        +
        +<%@ include file="/jsp/include/posFooter.jsp" %> + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/settlePayment.jsp b/posterita/posterita/web/jsp/pos/settlePayment.jsp new file mode 100644 index 0000000000..3b347f064b --- /dev/null +++ b/posterita/posterita/web/jsp/pos/settlePayment.jsp @@ -0,0 +1,610 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + + + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.beans.*" %> +<%@ page import="org.posterita.struts.pos.CreditOrderAction" %> +<%@ page import="org.compiere.process.DocumentEngine" %> +<%@ page import="java.util.Iterator" %> +<%@ page import="java.util.ArrayList" %> +<%@ page import="org.posterita.core.UDIPair" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> + + + + + + + + +
        +
        + +
        +
        + +
        + +
        + +
        + + <%@ include file="/jsp/include/searchCustomerPanel2.jsp" %> +
        + +
        +
        +
        +
        +
        + + + + + + + + + +
        + UnPaid + + Partially Paid + + Paid + + Over Paid +
        + +<%-- + + + +--%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +<%@ include file="/jsp/include/errors.jsp" %> + +
        + + + + + +
        + +
        + + + + + + + + + + + + + + + + + + + + + + + + + + + <% + String styleClass = ""; + %> + + <% + styleClass = "green"; + %> + + + + <% + styleClass = "red"; + %> + + + + + <% + styleClass = "yellow"; + %> + + + + + + + + <% + styleClass = "blue"; + %> + + + + <% + styleClass = "blue"; + %> + + + + + + + + + + + + + + + + + + + + + + + +
        + Pay + + + + + + + + + + + + + + + + + + + + + + + +   +
        > + + + + + Pay + + + + + > + "> + + + > + "> + + + > + + + > + + + > + + > + + > + + > + + > + + + > + + "> + + + > + + + > + + + + + +
        + + Pay + + + + + + Match + + +
        +
        + +
        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        + + + + + + + + + + + + + + +   +
        + "> + + + + + + + + + + + + + + + + + + +
        +
        + +
        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        + + + + + + + + + + + + + + + + + +
        + + + + + + + + + + + + + + + + + +
        +
        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        + + + + + + + + + + + + + + + +
        + + + + + + + + + + + + + + + +
        +
        +<%@ include file="/jsp/include/posFooter.jsp" %> + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/shoppingCart.jsp b/posterita/posterita/web/jsp/pos/shoppingCart.jsp new file mode 100644 index 0000000000..1f7d1ecc00 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/shoppingCart.jsp @@ -0,0 +1,139 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + + + +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.Constants" %> + + +<%@ page import="org.posterita.struts.pos.POSOrderAction" %> +<%@ page import="org.posterita.beans.ProductBean" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.lib.UdiConstants" %> +<%@ page import="org.posterita.struts.pos.POSGoodsAction" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> + + + + + + + + + + + + + + + + + + + + <% + String styleClass = "label"; + if ((count.intValue()%2) != 0) + styleClass = "contentname"; + %> + + + + + + + + + + + + + + + + + + + + + + + + + + + <%-- + --%> + +
        + + + + + + + + + + +   + +   + +   +
        + + + + + + + + + + + + + + + + +
          + + + + + +    + +
        +
        + + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/stockAdjustments.jsp b/posterita/posterita/web/jsp/pos/stockAdjustments.jsp new file mode 100644 index 0000000000..b3dc1a3ed5 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/stockAdjustments.jsp @@ -0,0 +1,36 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2008 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author sendy +--%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> +<%@page import="org.posterita.Constants"%> + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + <%=stockReportData%> + +<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/terminal.jsp b/posterita/posterita/web/jsp/pos/terminal.jsp new file mode 100644 index 0000000000..1429f361e1 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/terminal.jsp @@ -0,0 +1,421 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2008 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Ashley +--%> + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.beans.*" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + +<%@page import="org.posterita.struts.pos.TerminalAction"%> + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + <% + boolean readonly = new Boolean((String)strReadOnly).booleanValue(); + boolean orgReadOnly = true; + + if (terminalId != null) + { + try + { + orgReadOnly = (Integer.parseInt((String)terminalId) > 0); + } + catch (Exception ex) + {} + } + %> + + + + + + + + + + + + + + + + + +
        + + + + + + + + + + + + + + +
        + * + + +
        + * + + + + +
        + + + + + + + + +
        +
        +
        + + + + + + + + + + + + + + + + + + + + + + + + + + +
        + + + + + + + + + +
        + + + + + + + + + + + +
        + + + + + + + + + + + +
        + + + + + + + + +
        +
        +
        +
        + + + + + + + + + + + + + + + + + +
        + * + + + + + + + + + + + +
        + + + + + + + + + + + + +
        + + + + + + + + + + + + +
        +
        +
        +
        + + + + + + + + + + + +
        + + + + + + + + +   + + + + + + + + + + +
        + + + + + + + + + +   + +
        +
        +
        + + + Copy As + + + + + Edit + + + + + Save + + + + + Cancel + + +
        +
        + +<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/testShoppingCart.jsp b/posterita/posterita/web/jsp/pos/testShoppingCart.jsp new file mode 100644 index 0000000000..bb34ec5920 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/testShoppingCart.jsp @@ -0,0 +1,152 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + + + +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.Constants" %> + + +<%@ page import="org.posterita.struts.pos.POSOrderAction" %> +<%@ page import="org.posterita.beans.ProductBean" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.lib.UdiConstants" %> +<%@ page import="org.posterita.struts.pos.POSGoodsAction" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> + + + + + + + + + + + + + + + + + + + <% + String styleClass = "label"; + if ((count.intValue()%2) != 0) + styleClass = "contentname"; + %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%-- + --%> + +
        + Description + + Quantity + + Price + + VAT + + Total + +   + +   + +   +
        + + + + + + + + + + + + + + + + + + "> + + "> + + "> +
        Grand Total + + + + + + + + +    + +
        +
        + + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/updateCurrency.jsp b/posterita/posterita/web/jsp/pos/updateCurrency.jsp new file mode 100644 index 0000000000..88fb1fafaa --- /dev/null +++ b/posterita/posterita/web/jsp/pos/updateCurrency.jsp @@ -0,0 +1,115 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2008 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Servansingh +--%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> +<%@page import="org.posterita.Constants"%> +<%@page import="org.posterita.beans.CurrencyBean"%> +<%@page import="org.posterita.core.TmkJSPEnv"%> +<%@page import="org.posterita.lib.UdiConstants"%> +<%@page import="org.compiere.util.Env"%> +<%@page import="org.posterita.struts.pos.CurrencyAction"%> +Currency +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + +
        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        + + Previous + + "> + Next + +
        + + + +
        + + + +
        + + + +
        + + + +
        + + + +
        + + + +
        +   +
        +
        +
        + +<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/updatePOSProduct.jsp b/posterita/posterita/web/jsp/pos/updatePOSProduct.jsp new file mode 100644 index 0000000000..d98a1d1c84 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/updatePOSProduct.jsp @@ -0,0 +1,285 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + + + +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.Constants" %> + +<%@ page import="org.compiere.model.MProduct" %> + + +<%@ page import="org.posterita.struts.pos.POSOrderAction" %> +<%@ page import="org.posterita.beans.ProductBean" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.lib.UdiConstants" %> + +<%@ page import="org.posterita.struts.pos.POSProductAction" %> + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + +
        +
        +
        +
        + + + + + + + + + + + + + + + + +
        +
        + + + + + + +
        + + + + + + + + + + + + + +
        + + + +
        + * + + + +
        + * + + +
        +
        + + + <% + ProductBean bean = (ProductBean)ProductForm.getBean(); + if(bean.getImageInfo() != null) + if(bean.getImageInfo().getHasAttachment() != null) + if(bean.getImageInfo().getHasAttachment().booleanValue()){%> + "> + <%}%> + + +   + +
        +
        +
        +
        + + + + + + + + + + + +
        + * + + + + + + +
        +
        +
        +
        + + + + + + + + + + + + + + + + + + + + +
        + * + + + + + + +
        + * + + + + + + +
        + * + + + + + + +
        +
        +
        +
        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        + * + + + + +
        + * + + + +
        +
        + + + +
        + + + +
        + + + + + Select Product Type + + + + + + + + +
        + + + +
        + + + +
        +
        +
        + +   + +
        +
        + + +<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/updatedProduct.jsp b/posterita/posterita/web/jsp/pos/updatedProduct.jsp new file mode 100644 index 0000000000..7a4ff5c8f9 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/updatedProduct.jsp @@ -0,0 +1,136 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + + +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.Constants" %> + + +<%@ page import="org.posterita.struts.pos.POSProductAction" %> +<%@ page import="org.posterita.beans.ProductBean" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.lib.UdiConstants" %> +<%@ page import="org.posterita.struts.pos.POSGoodsAction" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        + + + +
        + + + +
        + + + +
        + + + +
        + + + +
        + + + +
        + + + +
        + + + +
        + + + +
        + + + +
        + +<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/viewAPPaymentAllocation.jsp b/posterita/posterita/web/jsp/pos/viewAPPaymentAllocation.jsp new file mode 100644 index 0000000000..6448bd409d --- /dev/null +++ b/posterita/posterita/web/jsp/pos/viewAPPaymentAllocation.jsp @@ -0,0 +1,153 @@ + +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.beans.BPartnerInfoBean" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.lib.UdiConstants" %> +<%@ page import="org.posterita.struts.pos.CreditOrderAction" %> +<%@ page import="org.posterita.struts.pos.DunningAction" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + + + + + + + + + + +
        + +
        + : + +   + + : + +   + + +   + +
        + +
        + + + + + +<% + String url = "ViewPaymentAllocation.do"; + String collection = Constants.PAYMENT_ALLOCATIONS; +%> + + + + + + + + + + + + + + + + + + <% + String styleClass = "label"; + if ((count.intValue()%2) != 0) + styleClass = "contentname"; + %> + + + + + + + + + + + + + + + + + + + + + + + +
        memo
        > + + "> + + + + > + "> + + + > + "> + + + + > + "> + + + + > + "> + + + > + "> + + + > + + > + + > + + > + +
        +<%@ include file="/jsp/include/pager.jsp" %> +
        +
        +
        +<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/viewAllPOSProducts.jsp b/posterita/posterita/web/jsp/pos/viewAllPOSProducts.jsp new file mode 100644 index 0000000000..e2e5cbb743 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/viewAllPOSProducts.jsp @@ -0,0 +1,503 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.beans.*" %> +<%@ page import="org.posterita.struts.pos.POSProductAction" %> +<%@ page import="org.compiere.process.DocumentEngine" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> + +<%@ page import="org.compiere.model.MOrder" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.struts.pos.POSOrderAction" %> +<%@ page import="java.util.ArrayList" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> + + + + + + + +<%@ include file="/jsp/include/posHeaderAdministration.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        +
        +
        + + + + + + + + + + + +
        + + + + + + + DESC: + + + +   + +
        +
        +
        +
        +
        +
        +
        +
        +
        +
        +
        + + +
        + Are you sure you want to delete the prices for the following products? + + Delete +
        +
        +
        +
        +
        +
        +
        +
        +
        +
        +
        +
        + + + + + + + + + + + + + + + + + + + + + + + + + + + <% + String url = "ViewAllPOSProduct.do"; + String collection = Constants.VIEW_POS_PRODUCTS; + %> + + + + + + <% + String styleClass = "oddRow"; + if ((count.intValue()%2) != 0) + styleClass = "evenRow"; + %> + + + + + + + + + + + + + + + + +
        + + + + + + + + + + + + + + + + + + + +
        + "> + + + + + + + + + + + + + + + + + + + + + + +
        +
        + + + <%@ include file="/jsp/include/pager.jsp" %> + + +
        +
        +
        +
        +
        + + +
        + Stock Qty: +
        +
        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        Sales Figures
        + Period + + Sales + + Total Amt +
        + Today + + + + +
        + Current Week + + + + +
        + Current Month + + + + +
        + 6 Months + + + + +
        + Current Year + + + + +
        +
        +
        +
        + +
        +
        +
        +
        + + + + +
        + No products were found for : +
        +
        +
        + + + + + + + +
        +
        +
        +
        +
        +
        + Clear all items +
        +
        +
        +
        +
        +
        +
        + F1 Barcode | F2 Name | F3 Description | Ctrl+Up MoveUp | Ctrl+Down MoveDown + | Ctrl-N New Product | Ctrl-E Edit Product | Ctrl-I Import Products | Ctrl+M Menu | + Ctrl-D Open Drawer | Ctrl-Delete Clear +
        +
        + + diff --git a/posterita/posterita/web/jsp/pos/viewAllPOSProductsForUpdate.jsp b/posterita/posterita/web/jsp/pos/viewAllPOSProductsForUpdate.jsp new file mode 100644 index 0000000000..915ad89f95 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/viewAllPOSProductsForUpdate.jsp @@ -0,0 +1,281 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.beans.*" %> +<%@ page import="org.posterita.struts.pos.EditBulkProductFromFileAction" %> +<%@ page import="org.compiere.process.DocumentEngine" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> + +<%@ page import="org.compiere.model.MOrder" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.struts.pos.POSOrderAction" %> +<%@ page import="java.util.ArrayList" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> + + + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + + +
        + + +   + +
        +
        + + + + + + + + + + + + + + + + +
        + +
        +
        +
        + + + +
        + + + + + + + + + <% + String styleClass = "label"; + if ((count.intValue()%2) != 0) + styleClass = "contentname"; + %> + + + + + + + + +
         
        width="400px"> + + > + + + > + + + > + +   +
        +
        +
        +
        +<%-- + + + + Create CSV + + +--%> + + + +<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/viewAllPaymentTerm.jsp b/posterita/posterita/web/jsp/pos/viewAllPaymentTerm.jsp new file mode 100644 index 0000000000..56c7ee6161 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/viewAllPaymentTerm.jsp @@ -0,0 +1,123 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + + + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.compiere.model.MOrg" %> +<%@ page import="org.posterita.struts.pos.PaymentTermAction" %> + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + +
        + + Add Payment Term + +
        + + + + + + + + + + + + + + + <% + String styleClass = "label"; + + if ((count.intValue()%2) != 0) + styleClass = "contentname"; + %> + + + + + + + + + + + + + + + + +
         
        + + + + + + + + + + + + + + + + + "> + Edit + +   + + + "> + Deactivate + + + + + "> + Activate + + +
        + + +<%@ include file="/jsp/include/posFooter.jsp" %> + + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/viewAllTax.jsp b/posterita/posterita/web/jsp/pos/viewAllTax.jsp new file mode 100644 index 0000000000..450b732b1f --- /dev/null +++ b/posterita/posterita/web/jsp/pos/viewAllTax.jsp @@ -0,0 +1,109 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.compiere.model.MOrg" %> +<%@ page import="org.posterita.struts.pos.TaxAction" %> + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + +
        + + Add Payment Term + +
        + + + + + + + + + + + + <% + String styleClass = "label"; + + if ((count.intValue()%2) != 0) + styleClass = "contentname"; + %> + + + + + + + + + + + + + +
         
        + + + + + + + + + + + "> + Edit + +   + + + "> + Deactivate + + + + + "> + Activate + + +
        + + +<%@ include file="/jsp/include/posFooter.jsp" %> + + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/viewBPartnerTrxDetails.jsp b/posterita/posterita/web/jsp/pos/viewBPartnerTrxDetails.jsp new file mode 100644 index 0000000000..f91fea8479 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/viewBPartnerTrxDetails.jsp @@ -0,0 +1,183 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + + +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.beans.BPartnerInfoBean" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.lib.UdiConstants" %> +<%@ page import="org.posterita.struts.pos.BpartnerInfoAction" %> +<%@ page import="org.posterita.struts.pos.POSGoodsAction" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + +
        + + "> + + + + + + "> + + + +
        + + + + + + + + + + + + + + + + + + + + + + + + + + +
        + : +
        + : +
        + : +
        + : +
        + Revenue: +
        + : +
        + : +
        +
        +
        + + + + + + + + + + + + + <% + String styleClass = "label"; + if ((count.intValue()%2) != 0) + styleClass = "contentname"; + %> + + + + + + + + + +
        Product Info
        > + + > + + > + +
        + +
        +
        + + + + + + + + + + + + + + <% + String styleClass1 = "label"; + if ((count.intValue()%2) != 0) + styleClass1 = "contentname"; + %> + + + + + + + + +
        Order Info
        > + "> + + + > + + + > + + > + + > + +
        +<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/viewBarcode.jsp b/posterita/posterita/web/jsp/pos/viewBarcode.jsp new file mode 100644 index 0000000000..fdf5a6c890 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/viewBarcode.jsp @@ -0,0 +1,65 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.beans.*" %> +<%@ page import="org.posterita.struts.pos.POSProductAction" %> +<%@ page import="org.compiere.process.DocumentEngine" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> + +<%@ page import="org.compiere.model.MOrder" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.struts.pos.POSOrderAction" %> +<%@ page import="java.util.ArrayList" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> + + + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + diff --git a/posterita/posterita/web/jsp/pos/viewBestSellingItems.jsp b/posterita/posterita/web/jsp/pos/viewBestSellingItems.jsp new file mode 100644 index 0000000000..1ebe7e8a84 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/viewBestSellingItems.jsp @@ -0,0 +1,50 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.beans.*" %> +<%@ page import="org.posterita.struts.pos.POSOrderAction" %> +<%@ page import="org.posterita.businesslogic.performanceanalysis.ReportDateManager" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + +<%@ include file="/jsp/pos/customReportTable.jsp" %> + + +<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/viewBlackListCheques.jsp b/posterita/posterita/web/jsp/pos/viewBlackListCheques.jsp new file mode 100644 index 0000000000..7fe61d4a53 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/viewBlackListCheques.jsp @@ -0,0 +1,59 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Martine +--%> + + +<%@ page import="org.posterita.struts.customer.CustomerAction" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + +
        + test +
        + + + + + + + + + +
        +
        + + + +
        + + + +
        + +<%@ include file="/jsp/include/posFooter.jsp" %> + diff --git a/posterita/posterita/web/jsp/pos/viewCommission.jsp b/posterita/posterita/web/jsp/pos/viewCommission.jsp new file mode 100644 index 0000000000..924b4ff3e1 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/viewCommission.jsp @@ -0,0 +1,128 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + + +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.beans.ProductBean" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.lib.UdiConstants" %> +<%@ page import="org.posterita.struts.pos.CommissionAction" %> + + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + +
        + <%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + + + + + + + + + + + + + + <% + String styleClass = "label"; + if ((count.intValue()%2) != 0) + styleClass = "contentname"; + %> + + + + + + + + + + + + + + + + +
        %
        > + + > + + + "> + + + + > + + + > + + + > + + > + + > + + > + +
        +
        +
        +
        + + +
        + +<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/viewCommissionDetails.jsp b/posterita/posterita/web/jsp/pos/viewCommissionDetails.jsp new file mode 100644 index 0000000000..b89bae9368 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/viewCommissionDetails.jsp @@ -0,0 +1,114 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + + +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.beans.ProductBean" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.lib.UdiConstants" %> +<%@ page import="org.posterita.struts.pos.CommissionAction" %> + + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + +
        + "> + + + +
        + <%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + + + + + + <% + String styleClass = "label"; + if ((count.intValue()%2) != 0) + styleClass = "contentname"; + %> + + + + + + + + + + + + + + + + +
        > + "> + + + > + "> + + + + + > + + > + +
        +
        + +<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/viewCompletePOSOrder.jsp b/posterita/posterita/web/jsp/pos/viewCompletePOSOrder.jsp new file mode 100644 index 0000000000..f1d3cb7ac8 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/viewCompletePOSOrder.jsp @@ -0,0 +1,103 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.compiere.model.MOrder" %> +<%@ page import="org.compiere.model.MInOut" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.struts.pos.POSOrderAction" %> +<%@ page import="org.compiere.process.DocumentEngine" %> +<%@ page import="java.util.ArrayList" %> +<%@ page import="org.compiere.process.DocAction" %> + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + +<%@ include file="/jsp/pos/orderHeader.jsp" %> + +<% + String orderlines = Constants.POS_ORDER_LINES; +%> +<%@ include file="/jsp/pos/completePOSShoppingCart.jsp" %> + +
        +
        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        +
        +<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/viewCompletedCreditOrder.jsp b/posterita/posterita/web/jsp/pos/viewCompletedCreditOrder.jsp new file mode 100644 index 0000000000..ca8fcf9884 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/viewCompletedCreditOrder.jsp @@ -0,0 +1,64 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.compiere.model.MOrder" %> +<%@ page import="org.compiere.model.MInOut" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.struts.pos.POSOrderAction" %> +<%@ page import="org.compiere.process.DocumentEngine" %> +<%@ page import="java.util.ArrayList" %> +<%@ page import="org.compiere.process.DocAction" %> + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + +<%@ include file="/jsp/pos/orderHeader.jsp" %> + +<% String orderlines = Constants.POS_ORDER_LINES; %> +<%@ include file="/jsp/pos/completePOSShoppingCart.jsp" %> + +
        +<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/viewCompletedCustomerReturnOrder.jsp b/posterita/posterita/web/jsp/pos/viewCompletedCustomerReturnOrder.jsp new file mode 100644 index 0000000000..30c0800a3d --- /dev/null +++ b/posterita/posterita/web/jsp/pos/viewCompletedCustomerReturnOrder.jsp @@ -0,0 +1,85 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.compiere.model.MOrder" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="java.util.ArrayList" %> +<%@ page import="org.compiere.process.DocAction" %> + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> + + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + <% + MOrder order = (MOrder) request.getSession().getAttribute(Constants.CUSTOMER_RETURN_ORDER); + %> + + + + +
        + + + + +
        + + + +
        + + <%@ include file="/jsp/pos/orderHeader.jsp" %> + <% String orderlines = Constants.CUSTOMER_RETURN_ORDER_LINES; %> + <%@ include file="/jsp/pos/completePOSShoppingCart.jsp" %> + +
        + + + "/> +   + +
        + +<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/viewCompletedGoodsReceiveNote.jsp b/posterita/posterita/web/jsp/pos/viewCompletedGoodsReceiveNote.jsp new file mode 100644 index 0000000000..7b87a47f16 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/viewCompletedGoodsReceiveNote.jsp @@ -0,0 +1,79 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.compiere.model.MOrder" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="java.util.ArrayList" %> +<%@ page import="org.compiere.process.DocAction" %> + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + +
        + +<%@ include file="/jsp/pos/orderHeader.jsp" %> +<% String orderlines = Constants.GOODS_RECEIVE_NOTE_LINES; %> +<%@ include file="/jsp/pos/completePOSShoppingCart.jsp" %> + + + +<% + MOrder order = (MOrder) request.getSession().getAttribute(Constants.GOODS_RECEIVE_NOTE); +%> + + + + +
        + + + "/> +   + +
        +
        +<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/viewCompletedGoodsReturnNote.jsp b/posterita/posterita/web/jsp/pos/viewCompletedGoodsReturnNote.jsp new file mode 100644 index 0000000000..2bfec57dc4 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/viewCompletedGoodsReturnNote.jsp @@ -0,0 +1,158 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.compiere.model.MOrder" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="java.util.ArrayList" %> +<%@ page import="org.compiere.process.DocAction" %> + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + +<%@ include file="/jsp/pos/orderHeader.jsp" %> + + + + + + + + + + + + + + +<% + String styleClass = "label"; + if ((count.intValue()%2) != 0) + styleClass = "contentname"; +%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <% + MOrder order = (MOrder) request.getSession().getAttribute(Constants.GOODS_RETURN_NOTE); + %> + + + + + +
        Total
        colspan="2"> + + align="center"> + + align="center"> + + > + + + > + + + > + + + > + + +
        + + +   + +   + + + + + + + + +
        + + + "/> +   + +
        + +<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/viewCompletedPOSOrder.jsp b/posterita/posterita/web/jsp/pos/viewCompletedPOSOrder.jsp new file mode 100644 index 0000000000..31c9105838 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/viewCompletedPOSOrder.jsp @@ -0,0 +1,145 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.compiere.model.MOrder" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.struts.pos.POSOrderAction" %> +<%@ page import="java.util.ArrayList" %> + + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> + + + + + +POS Order +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + +<%@ include file="/jsp/pos/orderHeader.jsp" %> + + + + + +
        + + + + + + + + + + + + + + + <% + String styleClass = "label"; + if ((count.intValue()%2) != 0) + styleClass = "contentname"; + %> + + + + + + + + + + + + + + + + + + + + + + + +
        + + + + + + + + + + + + + +
        colspan="2"> align="center"> align="center"> align="right"> align="right"> align="right"> align="right">
        + + +   + +   + + + + + + + + +
        +
        +
        +
        + +
        + +
        + +<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/viewCreditors.jsp b/posterita/posterita/web/jsp/pos/viewCreditors.jsp new file mode 100644 index 0000000000..e645a91410 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/viewCreditors.jsp @@ -0,0 +1,115 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + + +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.beans.BPartnerInfoBean" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.lib.UdiConstants" %> +<%@ page import="org.posterita.struts.pos.BpartnerInfoAction" %> +<%@ page import="org.posterita.struts.pos.DunningAction" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + +

        + +
        + + + + + + + + + + + +<% + String collection = Constants.CREDITORS; + String url = "/jsp/pos/viewCreditors.jsp"; +%> + + + + + <% + String styleClass = "label"; + if ((count.intValue()%2) != 0) + styleClass = "contentname"; + %> + + + + + + + + + + +
        > + "> + + + > + + > + + > + + > + + > + + > + +
        + +<%@ include file="/jsp/include/pager.jsp" %> + +
        + +
        +
        + + + +<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/viewCurrency.jsp b/posterita/posterita/web/jsp/pos/viewCurrency.jsp new file mode 100644 index 0000000000..5b9e31be48 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/viewCurrency.jsp @@ -0,0 +1,78 @@ +<%-- + * Product: Posterita Web-Based POS (an Adempiere Plugin) + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Servansingh +--%> + + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.beans.CurrencyBean" %> +<%@ page import="org.compiere.model.MOrg" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + +<%@ include file="/jsp/include/posHeader.jsp"%> + + + + + + + + + + + + + + + + + + + +
        + + + + + + +
        + +
        + +
        + +
        + +
        +
        + +<%@ include file="/jsp/include/posFooter.jsp" %> + + + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/viewDebtors.jsp b/posterita/posterita/web/jsp/pos/viewDebtors.jsp new file mode 100644 index 0000000000..ea151e869f --- /dev/null +++ b/posterita/posterita/web/jsp/pos/viewDebtors.jsp @@ -0,0 +1,116 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + + +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.beans.BPartnerInfoBean" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.lib.UdiConstants" %> +<%@ page import="org.posterita.struts.pos.BpartnerInfoAction" %> +<%@ page import="org.posterita.struts.pos.DunningAction" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + +

        + +
        + + + + + + + + + + + +<% + String collection = Constants.DEBTORS; + String url = "/jsp/pos/viewDebtors.jsp"; +%> + + + + + <% + String styleClass = "label"; + if ((count.intValue()%2) != 0) + styleClass = "contentname"; + %> + + + + + + + + + + +
        > + + "> + + + > + + > + + > + + > + + > + + > + +
        + +<%@ include file="/jsp/include/pager.jsp" %> + +
        + +
        +
        + + + +<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/viewDocumentHistory.jsp b/posterita/posterita/web/jsp/pos/viewDocumentHistory.jsp new file mode 100644 index 0000000000..7fd468ece7 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/viewDocumentHistory.jsp @@ -0,0 +1,155 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Vishee +--%> + + + + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.order.UDIOrderTypes" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.compiere.model.MOrg" %> + +<%@ page import="java.util.Calendar" %> +<%@ page import="org.posterita.beans.OrderHistoryBean" %> +<%@ page import="java.util.*" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + +<% + String url = "ViewDocumentHistory.do"; + String collection = Constants.DOCUMENT_HISTORY; +%> + +<%@ include file="/jsp/include/posHeader.jsp" %> + + + + + + + + + + + + + + + +
        + + <%@ include file="/jsp/pos/filter.jsp" %> +
        +
        + + + + + + + + + + + + + <% + String styleClass = "label"; + if ((count.intValue()%2) != 0) + styleClass = "contentname"; + %> + + + + + + + + + + + + + + + + + + + + + + +
        + <% + String partnerId= element.getBpartnerId() + ""; + %> + + + "> + + + + + + + "> + + + + + + + + + + "> + + + + "> + + + + "> + + + + "> + Create Shipment + + + "> + + +
        +
        + <%@ include file="/jsp/include/pager.jsp" %> + <%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/viewDocumentPDF.jsp b/posterita/posterita/web/jsp/pos/viewDocumentPDF.jsp new file mode 100644 index 0000000000..9f46aac15f --- /dev/null +++ b/posterita/posterita/web/jsp/pos/viewDocumentPDF.jsp @@ -0,0 +1,46 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + + +<%@ page import="org.posterita.Constants" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> + + + Document PDF + + +

        Document PDF

        + <%@ include file="/jsp/include/errors.jsp" %> + + <% + String strPath = (String)request.getAttribute(Constants.DOCUMENT_PDF); + strPath = "\"" + strPath + "\""; + %> + + + + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/viewDraftedOrder.jsp b/posterita/posterita/web/jsp/pos/viewDraftedOrder.jsp new file mode 100644 index 0000000000..ccb1b95139 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/viewDraftedOrder.jsp @@ -0,0 +1,153 @@ +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> +<% + String path = request.getContextPath(); + String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; + //String appName = (String) request.getSession().getAttribute(Constants.APP_NAME); + Properties ctx = TmkJSPEnv.getCtx(request); + String posName = POSTerminalManager.getTerminalName(ctx); + String orgName = MOrg.get(ctx, Env.getContextAsInt(ctx, UdiConstants.ORG_ID_CTX_PARAM)).getName(); + String roleName = MRole.get(ctx, Env.getContextAsInt(ctx, UdiConstants.AD_ROLE_ID)).getName(); + int m_pricelist_id = POSTerminalManager.getSOPriceListId(ctx); + MPriceList priceList = MPriceList.get(ctx, m_pricelist_id, null); + String priceListName = priceList.getName(); +%> + +<%@page import="java.util.Properties"%> +<%@page import="org.posterita.core.TmkJSPEnv"%> +<%@page import="org.compiere.util.Env"%> +<%@page import="org.posterita.lib.UdiConstants"%> +<%@page import="org.compiere.model.MPriceList"%> +<%@page import="org.compiere.model.MOrg"%> +<%@page import="org.compiere.model.MRole"%> +<%@page import="org.posterita.businesslogic.ShoppingcartManager"%> +<%@page import="org.posterita.util.HtmlOrderPrintFormatter"%> +<%@page import="org.posterita.businesslogic.POSTerminalManager"%> + + + + + + + + + + + + + + + + + + + + + + + + +
        + +
        +
        +
        + <%= ShoppingcartManager.getShoppingCartFromOrder(ctx, Integer.parseInt(orderId), null) %> +
        + +
        + +
        + + <%if(orderType.equalsIgnoreCase("POS Order")){%> +
        NEW ORDER
        + <% }else{ %> +
        NEW ORDER
        + <%}%> +
        REPRINT
        +
        +
        +
        + Ctrl+P Reprint | Ctrl+Enter New Order | Ctrl-Esc Menu
        + + + +
        +
        $0.00
        +
        + +
        + <%=priceListName%> +
        + + +
        + <% + String args = "showFooter=true;lineLength=40;priceWithVat=true;showDiscount=true;showLogo=false;showBarcode=false;"; + + HtmlOrderPrintFormatter formatter = new HtmlOrderPrintFormatter(args); + String data = formatter.format(ctx, Integer.parseInt(orderId), null); + out.print("
        ");
        +			out.print(data);
        +			out.print("
        "); + %> +
        + +
        + +
        + " code="org.posterita.core.PrintOrderApplet.class" width="0" height="0"> +
        + + + diff --git a/posterita/posterita/web/jsp/pos/viewInventoryHistory.jsp b/posterita/posterita/web/jsp/pos/viewInventoryHistory.jsp new file mode 100644 index 0000000000..b1f0173f6c --- /dev/null +++ b/posterita/posterita/web/jsp/pos/viewInventoryHistory.jsp @@ -0,0 +1,239 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.compiere.model.MOrg" %> +<%@ page import="org.compiere.process.DocumentEngine" %> +<%@ page import="org.posterita.struts.pos.InventoryAction" %> +<%@ page import="org.compiere.process.DocAction" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> +<%@ taglib uri="http://displaytag.sf.net" prefix="display" %> + +<%@page import="org.posterita.core.Configuration"%> +<%@page import="org.compiere.util.Env"%> +<%@page import="org.compiere.model.MPriceListVersion"%> +<%@page import="org.posterita.lib.UdiConstants"%> +<%@page import="org.posterita.core.TmkJSPEnv"%> +<%@page import="java.util.Properties"%> +<%@page import="org.posterita.businesslogic.administration.PriceListManager"%> + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> +<% + Integer priceListId = PriceListManager.getDefaultPriceListId(ctx, false); + Configuration configuration = Configuration.getConfiguration(request); + String searchProductBy = configuration.getSearchProductBy(); +%> + + + + + + + + + + + + +
        + + + + + + + +
        +
        + +
        +
        + + + + + + + + + + + + + + + + + + + + + + + + + <%@ include file="/jsp/include/historyMonthYearFilter.jsp"%> + + + + + + +
        + + + + + + + + + +
        +   + + + + + + + + + + + + + + + <%@include file="/jsp/include/paymentRuleFilter.jsp"%> + + +
        +
        +
        + + + + + + + + + + + + +

        + + Merge + +

        +
        +
        +
        +

         

        + +<%@ include file="/jsp/include/posFooter.jsp" %> + + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/viewMaxSoldItems.jsp b/posterita/posterita/web/jsp/pos/viewMaxSoldItems.jsp new file mode 100644 index 0000000000..99e341c8b3 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/viewMaxSoldItems.jsp @@ -0,0 +1,68 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + + +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.beans.ProductBean" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.lib.UdiConstants" %> +<%@ page import="org.posterita.struts.pos.POSReportAction" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/tabTop.jsp" %><%@ include file="/jsp/include/tabBottom.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + +<% + String styleClass = "label"; + if ((count.intValue()%2) != 0) + styleClass = "contentname"; +%> + + + + + +
        > + + > + +
        +
        +<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/viewMinOut.jsp b/posterita/posterita/web/jsp/pos/viewMinOut.jsp new file mode 100644 index 0000000000..7fdaa21e69 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/viewMinOut.jsp @@ -0,0 +1,145 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Vishee +--%> + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.compiere.process.DocumentEngine" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> + + +Shipment + +<%@ include file="/jsp/include/posHeader.jsp" %> + + + + + + + <%@ include file="/jsp/include/errors.jsp" %> + +
        + + + +
        + + <%@ include file="/jsp/pos/webDocumentHeader.jsp" %> + + + + + + + + + + + + + + + +
        + + + + + + + + +
        + Shipment Ref No: +
        + Doc Status: +
        +
        + Tracking No: + + + + + + +
        +
        + + + + + + + + + + + + + + + + +
        NameQty
        + + + +
        +
        + + + + +
        + + + + + + + + + + + + + + + + +
        + + + +
        +
        +
        + +<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/viewMinSoldItems.jsp b/posterita/posterita/web/jsp/pos/viewMinSoldItems.jsp new file mode 100644 index 0000000000..975cd998c3 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/viewMinSoldItems.jsp @@ -0,0 +1,70 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + + +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.beans.ProductBean" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.lib.UdiConstants" %> +<%@ page import="org.posterita.struts.pos.POSReportAction" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/tabTop.jsp" %><%@ include file="/jsp/include/tabBottom.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + +<% + String styleClass = "label"; + if ((count.intValue()%2) != 0) + styleClass = "contentname"; +%> + + + + + +
        nowrap="nowrap"> + + > + +
        +
        + +<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/viewOrder.jsp b/posterita/posterita/web/jsp/pos/viewOrder.jsp new file mode 100644 index 0000000000..580e40d0c5 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/viewOrder.jsp @@ -0,0 +1,317 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.order.UDIOrderTypes" %> +<%@ page import="org.compiere.model.MOrder" %> +<%@ page import="org.compiere.model.MInOut" %> +<%@ page import="org.posterita.businesslogic.CurrencyManager" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> +<%@ page import="org.posterita.beans.WebstoreUserBean" %> + + + + <%@page import="org.posterita.businesslogic.CurrencyManager"%> + + + + + + + + + + + + + + +
        +
        Sales Order
        + + + + + + + +<% + MOrder order = (MOrder) request.getSession().getAttribute(Constants.MORDER); + WebstoreUserBean userbean = (WebstoreUserBean) request.getSession().getAttribute(Constants.WEBSTORE_USER_BEAN); + String isPaid = (String) request.getSession().getAttribute(Constants.IS_PAID); + + + String currSymbole = CurrencyManager.getCurrencySymbol(order.getC_Currency_ID()); + + if (isPaid == null) + isPaid = "N"; +%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        + <%@ include file="/jsp/include/errors.jsp" %> +
        +

        Sales Order

        + +
        +
        + + + + + + +
        + + + + +
        + To: +
        +
        + + + + +
        + From: +
        +
        +
        + + + + + + +
        + + + + + + + + + + + + + + + + +
        +   + +
        + +
        + +
        + +
        +
        + + + + + + + + + + + + + + + +
        + +
        + +
        + +
        + +
        +
        +
        + Ref SO No: +
        + Date Ordered: +
        + Status: +
        + + Is Paid: + +
        + + + + + + + + + + + + <% + String styleClass = "lightColour"; + if ((count.intValue()%2) != 0) + styleClass = "darkColour"; + %> + + + + + + + + + + + + + + + + + + + +
        DescriptionQtyUnit PriceTotal Price
        + + + + + <%=currSymbole%> + + + <%=currSymbole%> + +
        +   + + + + <%=currSymbole%> + + +
        +
        + <%-- + if ((order.getDeliveryViaRule().equals(MInOut.DELIVERYVIARULE_Shipper)) && (isPaid.equals(Constants.NO_CHAR))) + { + + +
        + + + + + + + + + "> + "> + + + + + + + + + + + + + + <%int counter = ((Integer)count).intValue()+1;%> + + " value=""> + " value=""> + " value="Quantity"> + " value=""> + " value="Unit Price"> + " value=""> + + +
        + + } + --%> +
        + + + + <%@ include file="/jsp/include/tshirtFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/viewPOSBPartnerForDunning.jsp b/posterita/posterita/web/jsp/pos/viewPOSBPartnerForDunning.jsp new file mode 100644 index 0000000000..23994da30a --- /dev/null +++ b/posterita/posterita/web/jsp/pos/viewPOSBPartnerForDunning.jsp @@ -0,0 +1,168 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + + +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.beans.BPartnerInfoBean" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.lib.UdiConstants" %> +<%@ page import="org.posterita.struts.pos.BpartnerInfoAction" %> +<%@ page import="org.posterita.struts.pos.DunningAction" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + +
        + + + + + + + + + + +<% + String url = "ViewBPartnersForDunning.do"; + String collection = Constants.DEBTORS; +%> + + + + + <% + String styleClass = "label"; + if ((count.intValue()%2) != 0) + styleClass = "contentname"; + %> + + + + + + + + + + + +
        > + + "> + + + > + + "/> + > + + > + <% + String styleClass1 = "nomalcolor"; + if(element.getCreditUsed().intValue()> element.getCreditLimit().intValue()) + styleClass1= "negativecolor"; + %> +
        + +
        +
        > + <% + String styleClass2 = "nomalcolor"; + if(element.getOpenAmt().intValue()> 0) + styleClass2= "negativecolor"; + %> +
        + +
        +
        > + + +
        + +<%@ include file="/jsp/include/pager.jsp" %> + +
        + +
        +
        + + + + + +
        +
        + + +
        +
        +
        + + Print + +
        +
        + + + +<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/viewPOSBPartnerInfo.jsp b/posterita/posterita/web/jsp/pos/viewPOSBPartnerInfo.jsp new file mode 100644 index 0000000000..4728d1e836 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/viewPOSBPartnerInfo.jsp @@ -0,0 +1,135 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + + + +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.beans.BPartnerInfoBean" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.lib.UdiConstants" %> +<%@ page import="org.posterita.struts.pos.BpartnerInfoAction" %> +<%@ page import="org.posterita.struts.pos.POSGoodsAction" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + +
        :
        +
        +
        +
        + + + + + + + + +
        + + +   + + + + + + +
        +
        + + +<% + String url = "ViewPOSBPartnerInfo.do"; + String collection = Constants.BUSINESSPARTNER; +%> + + + + + + + + + + + + + <% + String styleClass = "label"; + if ((count.intValue()%2) != 0) + styleClass = "contentname"; + %> + + + + + + + + + + + +
        > + + "> + + + + > + + > + + > + + > + + > + + > + +
        +<%@ include file="/jsp/include/pager.jsp" %> +
        +
        +
        + +<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/viewPOSCustomer.jsp b/posterita/posterita/web/jsp/pos/viewPOSCustomer.jsp new file mode 100644 index 0000000000..fd2a33ffdf --- /dev/null +++ b/posterita/posterita/web/jsp/pos/viewPOSCustomer.jsp @@ -0,0 +1,230 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + + +<%@ page import="org.posterita.struts.customer.CustomerAction" %> +<%@ page import="org.compiere.model.MBPartner" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + + + + +
        +
        + + + + + + + + + + + + + + +
        + +
        + +
        + +
        +
        +
        +
        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        + + + +
        + + + + + + + + + +
        + +
        +
        +
        +
        + + + + + + + + + + + + + + + + + + + + +
        + +
        + +
        + +
        + +
        +
        +
        +
        + + + + + + + + + + + + + + + + + +
        + +
        + +
        +
        +
        + + + + + + + +
        + +
        + + + + + + + + +
        + + + + + + + +
        + "> + + +
        +
        + +
        +
        + + ">Edit + Add New + Back +
        + + +<%@ include file="/jsp/include/posFooter.jsp" %> + + + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/viewPOSCustomerCart.jsp b/posterita/posterita/web/jsp/pos/viewPOSCustomerCart.jsp new file mode 100644 index 0000000000..7f0a50947b --- /dev/null +++ b/posterita/posterita/web/jsp/pos/viewPOSCustomerCart.jsp @@ -0,0 +1,193 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + + + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.compiere.model.MOrg" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + +<%@ include file="/jsp/include/posHeader.jsp" %> +
        +<%@ include file="/jsp/include/errors.jsp" %> + + + +
        +
        +
        + +
        +
        + + +
        + + + + + + + + + + + + + +
        +
        +
        + + +
        + + + + + + + + + + + + + <% + String styleClass = "label"; + + if ((count.intValue()%2) != 0) + styleClass = "contentname"; + %> + + + + + + + + + + + + + + + +
         
        + + + + +
        + +
        + + + + + + + + Y + + + N + + + "> +
        +
        +
        +
        +
        PRINT FIDELITY
        +
        +
        +
        +
        + " code="org.posterita.core.PrintOrderApplet.class" width="0" height="0"> +
        + + + + + + + + + + + + + + + + + + + +<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/viewPOSHistory.jsp b/posterita/posterita/web/jsp/pos/viewPOSHistory.jsp new file mode 100644 index 0000000000..5ff192a40b --- /dev/null +++ b/posterita/posterita/web/jsp/pos/viewPOSHistory.jsp @@ -0,0 +1,127 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + + + +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.beans.ProductBean" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.lib.UdiConstants" %> +<%@ page import="org.posterita.struts.pos.POSReportAction" %> +<%@ page import="org.posterita.struts.pos.POSGoodsAction" %> +<%@ page import="org.compiere.process.DocAction" %> +<%@ page import="org.compiere.model.MOrder" %> +<%@ page import="org.posterita.order.UDIOrderTypes" %> +<%@ taglib uri="http://displaytag.sf.net" prefix="display" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + +<% + String url = "ViewPOSHistory.do?orderType=" + orderType; + String collection = Constants.POS_HISTORY; +%> + + + + +
        + <%@ include file="/jsp/include/errors.jsp" %> + + + + + + <%@ include file="/jsp/include/posHistoryFilter2.jsp" %> +
        + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        +
        +<%@ include file="/jsp/include/printOrderApplet2.jsp" %> +<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/viewPOSHistoryForAll.jsp b/posterita/posterita/web/jsp/pos/viewPOSHistoryForAll.jsp new file mode 100644 index 0000000000..3df5980075 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/viewPOSHistoryForAll.jsp @@ -0,0 +1,211 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + + + +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.beans.ProductBean" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.lib.UdiConstants" %> +<%@ page import="org.posterita.struts.pos.POSReportAction" %> +<%@ page import="org.posterita.struts.pos.POSGoodsAction" %> +<%@ page import="org.compiere.process.DocAction" %> +<%@ page import="org.compiere.model.MOrder" %> +<%@ page import="org.posterita.order.UDIOrderTypes" %> + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> + + + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + <% + String url = "ViewPOSHistoryForAll.do"; + String collection = Constants.POS_HISTORY; + %> + + + + +
        + <%@ include file="/jsp/include/errors.jsp" %> + + + + + + <%@ include file="/jsp/include/posHistoryFilter.jsp" %> +
        + + + + + + + + + + + + + + + + <% + String styleClass = "label"; + if ((count.intValue()%2) != 0) + styleClass = "contentname"; + %> + + + + + + + + + + + + +
         
        > + "> + + + + +
        + + +
        +
        + + +
        + +
        +
        + + +
        + +
        +
        + +
        + + +
        + + + +
        + +
        +
        +
        > + + + > + + <% + String partnerId= element.getBpartnerId() + ""; + %> + + + "> + + + + + + + "> + + + + + > + + + + + + + + + + + + + + + + + + Credit + + > + + + > + + + + + + + + + "> + + + + + + + "> + + + + +
        +
        +
        +<%@ include file="/jsp/include/pager.jsp" %> +<%@ include file="/jsp/include/printOrderApplet2.jsp" %> +<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/viewPOSHistory_displaytag.jsp b/posterita/posterita/web/jsp/pos/viewPOSHistory_displaytag.jsp new file mode 100644 index 0000000000..8e96b2697e --- /dev/null +++ b/posterita/posterita/web/jsp/pos/viewPOSHistory_displaytag.jsp @@ -0,0 +1,122 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + + + +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.beans.ProductBean" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.lib.UdiConstants" %> +<%@ page import="org.posterita.struts.pos.POSReportAction" %> +<%@ page import="org.posterita.struts.pos.POSGoodsAction" %> +<%@ page import="org.compiere.process.DocAction" %> +<%@ page import="org.compiere.model.MOrder" %> +<%@ page import="org.posterita.order.UDIOrderTypes" %> +<%@ page import="org.displaytag.decorator.TableDecorator" %> + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> +<%@ taglib uri="http://displaytag.sf.net" prefix="display" %> + +<%@page import="org.posterita.beans.POSHistoryBean"%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + +<% + String url = "ViewPOSHistory.do?orderType=" + orderType; + String collection = Constants.POS_HISTORY; + + Integer display = new Integer("10"); + if (displayCookie.getValue() != null || !displayCookie.getValue().equals("")) + display = new Integer(displayCookie.getValue()); +%> + + + + +
        + <%@ include file="/jsp/include/errors.jsp" %> + + + + + + + <%@ include file="/jsp/include/posHistoryFilter2.jsp" %> +
        + + + + + + + + + + + + + + +
        +
        + +<%@ include file="/jsp/include/printOrderApplet2.jsp" %> +<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/viewPOSInfo.jsp b/posterita/posterita/web/jsp/pos/viewPOSInfo.jsp new file mode 100644 index 0000000000..5b489e4374 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/viewPOSInfo.jsp @@ -0,0 +1,82 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + + + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.beans.*" %> +<%@ page import="org.posterita.struts.pos.POSOrderAction" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + + + <% + String styleClass = "label"; + if ((count.intValue()%2) != 0) + styleClass = "contentname"; + %> + + + + + + + + + +
        + + + + + +
        + + + + + + +
        +<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/viewPOSOrder.jsp b/posterita/posterita/web/jsp/pos/viewPOSOrder.jsp new file mode 100644 index 0000000000..06d6b538bb --- /dev/null +++ b/posterita/posterita/web/jsp/pos/viewPOSOrder.jsp @@ -0,0 +1,223 @@ +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> +<% + String path = request.getContextPath(); + String appName = (String) request.getSession().getAttribute(Constants.APP_NAME); + String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; + Properties ctx = TmkJSPEnv.getCtx(request); + String posName = POSTerminalManager.getTerminalName(ctx); + String orgName = MOrg.get(ctx, Env.getContextAsInt(ctx, UdiConstants.ORG_ID_CTX_PARAM)).getName(); + String roleName = MRole.get(ctx, Env.getContextAsInt(ctx, UdiConstants.AD_ROLE_ID)).getName(); + +%> + +<%@page import="org.posterita.Constants"%> +<%@page import="java.util.Properties"%> +<%@page import="org.posterita.core.TmkJSPEnv"%> +<%@page import="org.compiere.util.Env"%> +<%@page import="org.posterita.lib.UdiConstants"%> +<%@page import="org.compiere.model.MPriceList"%> +<%@page import="org.compiere.model.MOrg"%> +<%@page import="org.compiere.model.MRole"%> +<%@page import="org.posterita.businesslogic.ShoppingcartManager"%> +<%@page import="org.posterita.util.HtmlOrderPrintFormatter"%> +<%@page import="org.compiere.model.MOrder"%> +<%@page import="org.posterita.businesslogic.POSManager"%> +<%@page import="org.posterita.businesslogic.POSTerminalManager"%> +<%@page import="org.compiere.model.MPayment"%> +<%@page import="java.math.BigDecimal"%> +<%@page import="org.compiere.model.I_M_PriceList"%> +<%@page import="org.posterita.order.UDIOrderTypes"%> +<%@page import="org.posterita.TangoColors"%> + + + + + <%=appName%> + + + + + + + + + + + + + + + + +<% +MOrder order = new MOrder(ctx, Integer.valueOf(orderId).intValue(), null); +String orderType = order.getOrderType(); +MPriceList priceList = MPriceList.get(ctx, order.getM_PriceList_ID(), null); +String priceListName = priceList.getName(); +%> + + + + + + + + + + + + + + + + + + + + +
        +
        + + +
        + <%= orderType %> +
        +
        +
        +
        + : + <%=orgName%> +
        +
        + : + <%=posName%> +
        +
        +
        +
        + : + +
        +
        + : + <%=roleName%> +
        +
        +
        +
        +
        +
        +
        +
        +
        + <% String currency = order.getC_Currency().getCurSymbol(); + + String paymentRule = order.getPaymentRule(); + + if(paymentRule.equalsIgnoreCase(MOrder.PAYMENTRULE_Cash)) + { + out.print("Amt Refunded: " + currency + order.getAmountRefunded()); + } + + if(paymentRule.equalsIgnoreCase(MOrder.PAYMENTRULE_CreditCard)) + { + out.print("Card: " + currency + order.getGrandTotal()); + } + + if(paymentRule.equalsIgnoreCase(MOrder.PAYMENTRULE_Check)) + { + out.print("Cheque: " + currency + order.getGrandTotal()); + } + + if(paymentRule.equalsIgnoreCase(UdiConstants.PAYMENTRULE_MIXED)) + { + out.print("Total: " + currency + order.getGrandTotal()); + } + %> +
        +
        +
        +
        +
        +   + +
        +
        + <%=priceListName%> +
        +
        +
        +
        +
        +
        + <%= ShoppingcartManager.getShoppingCartFromOrder(ctx, Integer.valueOf(orderId).intValue(), null) %> +
        +
        +
        +
        +
        + <% + String args = "showFooter=true;lineLength=40;priceWithVat=true;showDiscount=false;showLogo=false;showBarcode=false;"; + + HtmlOrderPrintFormatter formatter = new HtmlOrderPrintFormatter(args); + String data = formatter.format(ctx, Integer.valueOf(orderId).intValue(), null); + out.print("
        ");
        +				out.print(data);
        +				out.print("
        "); + %> +
        +
        +
        + +
        +
        +
        + <%String newOrderAction = "/CreatePOSOrderScreen.do?orderType="+orderType; %> +
        NEW ORDER
        +
        +
        +
        + Ctrl+Space New Order | Ctrl-M Menu
        +
        + <%@ include file="/jsp/include/printOrderApplet2.jsp" %> + + + diff --git a/posterita/posterita/web/jsp/pos/viewPOSProduct.jsp b/posterita/posterita/web/jsp/pos/viewPOSProduct.jsp new file mode 100644 index 0000000000..916051a229 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/viewPOSProduct.jsp @@ -0,0 +1,276 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + + + +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.Constants" %> + +<%@ page import="org.compiere.model.MProduct" %> + + +<%@ page import="org.posterita.struts.pos.POSOrderAction" %> +<%@ page import="org.posterita.beans.ProductBean" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.lib.UdiConstants" %> + +<%@ page import="org.posterita.struts.pos.POSProductAction" %> + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + + + + + + + + + + +
        +
        + + + + + + +
        + + + + + + + + + + + + + + + + + +
        + + + + +   + +   +
        + * + + + +   + +   +
        + * + + +
        +
        + + + <% + ProductBean bean = (ProductBean)POSProductForm.getBean(); + if(bean.getImageInfo() != null) + if(bean.getImageInfo().getHasAttachment() != null) + if(bean.getImageInfo().getHasAttachment().booleanValue()){%> + "> + <%}%> + + +   + +
        +
        +
        +
        + + + + + + + + + + + +
        + * + + + +   + +   +
        +
        +
        +
        + + + + + + + + + + + + + + + + + + + + + +
        + * + + + +   + +   +
        + * + + + +   + +   +
        + * + + + +   + +   +
        +
        +
        +
        + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        + * + + + + +
        + * + + +
        + + + +
        + + + +
        + + + +
        + + + +
        +
        +
        +
        + + +<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/viewPOSProducts.jsp b/posterita/posterita/web/jsp/pos/viewPOSProducts.jsp new file mode 100644 index 0000000000..2a2fb17be3 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/viewPOSProducts.jsp @@ -0,0 +1,71 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + + +<%@ page import="java.util.ArrayList" %> +<%@ page import="java.util.Properties" %> +<%@ page import="org.posterita.core.TmkJSPEnv" %> +<%@ page import="org.posterita.businesslogic.ProductManager" %> +<%@ page import="org.posterita.beans.ProductStatusBean" %> +<% + +String productName = request.getParameter("productName"); +Properties ctx = TmkJSPEnv.getCtx(request); + +ArrayList productList =ProductManager.searchProductsByName(ctx,productName); +ProductStatusBean bean = null; + +if(productList == null || productList.size() == 0) +{ + + //out.print("
          "); + //out.print("
        • "); + //out.print("
        "); + out.print("
        "); +} +else +{ + int size = 15; + + size = (size > productList.size())? productList.size() : size; + + if(size > 0) + { + out.print("
          "); + + for(int i=0;i< size;i++) + { + bean = (ProductStatusBean)productList.get(i); + + out.print("
        • "); + out.print(bean.getProductName()); + out.print("
        • "); + } + + out.print("
        "); + } + + out.print("
        "); + +} +%> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/viewPOSUser.jsp b/posterita/posterita/web/jsp/pos/viewPOSUser.jsp new file mode 100644 index 0000000000..fc33b31f02 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/viewPOSUser.jsp @@ -0,0 +1,201 @@ +<%-- + * Product: Posterita Web-Based POS (an Adempiere Plugin) + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok Pathak +--%> + + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.compiere.model.MOrg" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> + + +<%@ include file="/jsp/include/posHeader.jsp" %> + + + + + + +
        +
        + Contact + + + + + + + + + + + + + + + + + + + + + +
        + + + +
        + + + +
        +   +
        +   +
        +   +
        +
        +
        + +
        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        + + + +
        + + + +
        + + + +
        + + + +
        + + + +
        +
        +
        + + + + + + +
        +
        + + + + + + + + + + +
        + + + +
        + + + +
        +
        +
        + + + + + + + + <%@ include file="/jsp/include/posFooter.jsp" %> + + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/viewPartialPOSOrderHistory.jsp b/posterita/posterita/web/jsp/pos/viewPartialPOSOrderHistory.jsp new file mode 100644 index 0000000000..a7b13a8ed1 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/viewPartialPOSOrderHistory.jsp @@ -0,0 +1,108 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + + + +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.beans.ProductBean" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.lib.UdiConstants" %> +<%@ page import="org.posterita.struts.pos.POSReportAction" %> +<%@ page import="org.posterita.struts.pos.POSGoodsAction" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + +
        + <%@ include file="/jsp/include/errors.jsp" %> + + + + <%@ include file="/jsp/include/historyfilter.jsp" %> + + <% + String url = "ViewPartialPOSOrderHistory.do"; + String collection = Constants.POS_HISTORY; + %> + + + + + + + + + + + + + <% + String styleClass = "label"; + if ((count.intValue()%2) != 0) + styleClass = "contentname"; + %> + + + + + + + + + +
         
        > + "> + + + > + + > + + > + + +
        + <%@ include file="/jsp/include/pager.jsp" %> +
        +
        +
        +
        + +<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/viewPayment.jsp b/posterita/posterita/web/jsp/pos/viewPayment.jsp new file mode 100644 index 0000000000..7b13dc475d --- /dev/null +++ b/posterita/posterita/web/jsp/pos/viewPayment.jsp @@ -0,0 +1,96 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.order.UDIOrderTypes" %> +<%@ page import="org.compiere.model.MPayment" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> + + +Payment + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + +<%-- +@TODO by Alok + +--%> + + + <%@ include file="/jsp/pos/webDocumentHeader.jsp" %> + + + + + + + + + + +
        + + Payment By: +
        +
        + Ref Payment No: +
        + Status: +
        +
        + + + + + + + + + + + +
        Payment DateAmount
        + + + + +
        +
        + + + + <%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/viewPaymentAllocation.jsp b/posterita/posterita/web/jsp/pos/viewPaymentAllocation.jsp new file mode 100644 index 0000000000..57ec786ce8 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/viewPaymentAllocation.jsp @@ -0,0 +1,153 @@ + +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.beans.BPartnerInfoBean" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.lib.UdiConstants" %> +<%@ page import="org.posterita.struts.pos.CreditOrderAction" %> +<%@ page import="org.posterita.struts.pos.DunningAction" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + + + + + + + + + + +
        + +
        + : + +   + + : + +   + + +   + +
        + +
        + + + + + +<% + String url = "ViewPaymentAllocation.do"; + String collection = Constants.PAYMENT_ALLOCATIONS; +%> + + + + + + + + + + + + + + + + + + <% + String styleClass = "label"; + if ((count.intValue()%2) != 0) + styleClass = "contentname"; + %> + + + + + + + + + + + + + + + + + + + + + + + +
        memo
        > + + "> + + + + > + "> + + + > + "> + + + + > + "> + + + + > + "> + + + > + "> + + + > + + > + + > + + > + +
        +<%@ include file="/jsp/include/pager.jsp" %> +
        +
        +
        +<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/viewPaymentDetails.jsp b/posterita/posterita/web/jsp/pos/viewPaymentDetails.jsp new file mode 100644 index 0000000000..00d7b77da2 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/viewPaymentDetails.jsp @@ -0,0 +1,181 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok +--%> + + + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.beans.*" %> +<%@ page import="org.posterita.struts.pos.CreditOrderAction" %> +<%@ page import="org.compiere.process.DocumentEngine" %> +<%@ page import="java.util.Iterator" %> +<%@ page import="java.util.ArrayList" %> +<%@ page import="org.posterita.core.UDIPair" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + +
        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        + + + + + + + . + + + + + + + + +
        + + + "> + + + + + + + + + + + + + + + + +
        + + + "> + + + + + + + + + + + + + + + +
        + Total: + + +
        +
        + +<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/viewPreferences.jsp b/posterita/posterita/web/jsp/pos/viewPreferences.jsp new file mode 100644 index 0000000000..9cc1c948ca --- /dev/null +++ b/posterita/posterita/web/jsp/pos/viewPreferences.jsp @@ -0,0 +1,278 @@ +<%@ page import="org.posterita.util.TmkPrinterConstants" %> +<%-- + * Product: Posterita Web-Based POS (an Adempiere Plugin) + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen Beekoo +--%> + + + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + +<%@ include file="/jsp/include/posHeader.jsp" %> + + + +
        +
        +
        +
        +
        + + + +
        + + + . + +
        +
        + +
        + Minimum characters before searching starts + +
        + +
        +
        + +
        +
        +
        + + : + +
        +
        +
        +
        +
        + + +
        + + + + + + + + + + + + + + +
        +
        + +
        + + + + + + + + + + + + + + + +
        +
        + : + " code="org.posterita.core.PrintOrderApplet.class" width="0" height="0"> + +
        + + +
        +
        +
        +
        + +
        +
        +
        +<%@ include file="/jsp/include/posFooter.jsp" %> + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/viewProductCart.jsp b/posterita/posterita/web/jsp/pos/viewProductCart.jsp new file mode 100644 index 0000000000..bfe9795deb --- /dev/null +++ b/posterita/posterita/web/jsp/pos/viewProductCart.jsp @@ -0,0 +1,134 @@ +<%-- + * Product: Posterita Web-Based POS (an Adempiere Plugin) + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen Beekoo +--%> + + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.beans.*" %> +<%@ page import="org.posterita.struts.pos.POSProductAction" %> +<%@ page import="org.compiere.process.DocumentEngine" %> +<%@ page import="org.compiere.model.MOrder" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.struts.pos.POSOrderAction" %> +<%@ page import="java.util.ArrayList" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> + + + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + +
        +
        +
        + +
        +
        + + +
        + + + + + + + + + + + + + +
        +
        +
        + + + + + + + + + <% + String url = "ViewProductCart.do"; + String collection = Constants.PRODUCT_DETAILS; + %> + + + <% + String styleClass = "label"; + if ((count.intValue()%2) != 0) + styleClass = "contentname"; + %> + + + + + + + + + + + +
         
        > + + > + + > + + > + + > + ">Remove +
        +
        +
        +
        + + + + +
        +<%@ include file="/jsp/include/pager.jsp" %> +
        +
        +<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/viewProductCartForUpdate.jsp b/posterita/posterita/web/jsp/pos/viewProductCartForUpdate.jsp new file mode 100644 index 0000000000..45154bd382 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/viewProductCartForUpdate.jsp @@ -0,0 +1,134 @@ +<%-- + * Product: Posterita Web-Based POS (an Adempiere Plugin) + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen Beekoo +--%> + + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.beans.*" %> +<%@ page import="org.posterita.struts.pos.EditBulkProductFromFileAction" %> +<%@ page import="org.compiere.process.DocumentEngine" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> + +<%@ page import="org.compiere.model.MOrder" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.struts.pos.POSOrderAction" %> +<%@ page import="java.util.ArrayList" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> + + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + +
        +
        +
        + +
        +
        + +
        +
        + + + + + + + + + + + + + +
        +
        +
        + + + + + + + + + <% + String styleClass = "label"; + if ((count.intValue()%2) != 0) + styleClass = "contentname"; + %> + + + + + + + + +
         
        width="400px"> + + > + + + > + + + align="center"> + "> + + +
        +
        + + + + + + + +
        +
        + +<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/viewProductSalesDetails.jsp b/posterita/posterita/web/jsp/pos/viewProductSalesDetails.jsp new file mode 100644 index 0000000000..0ac6695588 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/viewProductSalesDetails.jsp @@ -0,0 +1,154 @@ +<%-- + * Product: Posterita Web-Based POS (an Adempiere Plugin) + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen Beekoo +--%> + + + +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.beans.BPartnerInfoBean" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.lib.UdiConstants" %> +<%@ page import="org.posterita.struts.pos.BpartnerInfoAction" %> +<%@ page import="org.posterita.struts.pos.POSGoodsAction" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + +
        + "> + + +
        + + + + + + + + + + + + + + + +
        + + + + + + + + + +
        +
        +
        + + + + + + + + + + + + + + + + + +
        + : + +
        + : + + + +
        +
        +
        + + + + + + + + + + + + + + <% + String styleClass1 = "label"; + if ((count.intValue()%2) != 0) + styleClass1 = "contentname"; + %> + + + + + + + + + +
        > + "> + + + > + + > + + > + + align="right"> + + align="right"> + + + +
        +<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/viewProductsSalesInfo.jsp b/posterita/posterita/web/jsp/pos/viewProductsSalesInfo.jsp new file mode 100644 index 0000000000..6229b1f32a --- /dev/null +++ b/posterita/posterita/web/jsp/pos/viewProductsSalesInfo.jsp @@ -0,0 +1,127 @@ +<%-- + * Product: Posterita Web-Based POS (an Adempiere Plugin) + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen Beekoo +--%> + + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.beans.*" %> +<%@ page import="org.posterita.struts.pos.POSProductAction" %> +<%@ page import="org.compiere.process.DocumentEngine" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> + +<%@ page import="org.compiere.model.MOrder" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.struts.pos.POSOrderAction" %> +<%@ page import="java.util.ArrayList" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + +
        + + +   + +
        + +
        + + + + + + + + + + + + + <% + String styleClass = "label"; + if ((count.intValue()%2) != 0) + styleClass = "contentname"; + %> + + + + + + + + + + + + + +
        width="400px"> + "> + + + width="100px"> + + width="150px"> + + > + + > + + + > + + + > + +
        +
        + +<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/viewRole.jsp b/posterita/posterita/web/jsp/pos/viewRole.jsp new file mode 100644 index 0000000000..4e22652954 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/viewRole.jsp @@ -0,0 +1,92 @@ +<%-- + * Product: Posterita Web-Based POS (an Adempiere Plugin) + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen Beekoo +--%> + + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.compiere.model.MOrg" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + +<%@ include file="/jsp/include/posHeader.jsp" %> + + + + + + + + + + + + + + + + + + + + + + + + + + +
        :
        :
        :
        :
        :

        + + + + + + + + + + + + + + + + +
        + +
                + +
        +
        +
        + +<%@ include file="/jsp/include/posFooter.jsp" %> + + + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/viewStockEnquiry.jsp b/posterita/posterita/web/jsp/pos/viewStockEnquiry.jsp new file mode 100644 index 0000000000..0f35ad0749 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/viewStockEnquiry.jsp @@ -0,0 +1,73 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Praveen +--%> + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.beans.*" %> +<%@ page import="org.posterita.struts.pos.POSOrderAction" %> +<%@ page import="org.posterita.businesslogic.performanceanalysis.ReportDateManager" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + +
         
        + + + + + + + + + +
        + + + +
        + + + +
        + + + + +
        +   +
        +
        +<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/viewStockMovement.jsp b/posterita/posterita/web/jsp/pos/viewStockMovement.jsp new file mode 100644 index 0000000000..3b3bccfbfc --- /dev/null +++ b/posterita/posterita/web/jsp/pos/viewStockMovement.jsp @@ -0,0 +1,92 @@ +<%-- + * Product: Posterita Web-Based POS (an Adempiere Plugin) + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Alok Pathak +--%> + + + +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.beans.ProductBean" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.lib.UdiConstants" %> +<%@ page import="org.posterita.struts.pos.POSReportAction" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + + + + + +<% + String styleClass = "label"; + if ((count.intValue()%2) != 0) + styleClass = "contentname"; +%> + + + + + + + + + + +
        > + "> + + + > + + > + + > + + > + + > + + > + +
        +
        + +<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/viewStockSalesReport.jsp b/posterita/posterita/web/jsp/pos/viewStockSalesReport.jsp new file mode 100644 index 0000000000..fd34148bea --- /dev/null +++ b/posterita/posterita/web/jsp/pos/viewStockSalesReport.jsp @@ -0,0 +1,112 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2008 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author sendy +--%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> +<%@page import="org.posterita.Constants"%> + +<%@page import="org.posterita.struts.pos.POSReportAction"%> +Stock Sales Report +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + +
        + + + + +
        + +
        + + <%@ include file="/jsp/include/searchProductPanel3.jsp" %> + +
        +
         
        +
        + + +
        +
         
        +
        + + +
        +
         
        +
        + + +
        +
         
        + + + + +
        + + + + + + + +
        + <%@ include file="/jsp/include/startCalendar.jsp" %> +
        + <%@ include file="/jsp/include/endCalendar.jsp" %> +
        +
        +
        + + + + + +
        + +   + + + + +
        +
        + + + + + <%=stockReportData%> + +
        +
        +
        + +<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/viewStockTransfer.jsp b/posterita/posterita/web/jsp/pos/viewStockTransfer.jsp new file mode 100644 index 0000000000..a172a01c74 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/viewStockTransfer.jsp @@ -0,0 +1,223 @@ +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> +<% + String path = request.getContextPath(); + String appName = (String) request.getSession().getAttribute(Constants.APP_NAME); + String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; + Properties ctx = TmkJSPEnv.getCtx(request); + String posName = POSTerminalManager.getTerminalName(ctx); + String orgName = MOrg.get(ctx, Env.getContextAsInt(ctx, UdiConstants.ORG_ID_CTX_PARAM)).getName(); + String roleName = MRole.get(ctx, Env.getContextAsInt(ctx, UdiConstants.AD_ROLE_ID)).getName(); + +%> + +<%@page import="org.posterita.Constants"%> +<%@page import="java.util.Properties"%> +<%@page import="org.posterita.core.TmkJSPEnv"%> +<%@page import="org.compiere.util.Env"%> +<%@page import="org.posterita.lib.UdiConstants"%> +<%@page import="org.compiere.model.MPriceList"%> +<%@page import="org.compiere.model.MOrg"%> +<%@page import="org.compiere.model.MRole"%> +<%@page import="org.posterita.businesslogic.ShoppingcartManager"%> +<%@page import="org.posterita.util.HtmlOrderPrintFormatter"%> +<%@page import="org.compiere.model.MOrder"%> +<%@page import="org.posterita.businesslogic.POSManager"%> +<%@page import="org.posterita.businesslogic.POSTerminalManager"%> +<%@page import="org.compiere.model.MPayment"%> +<%@page import="java.math.BigDecimal"%> +<%@page import="org.compiere.model.I_M_PriceList"%> +<%@page import="org.posterita.order.UDIOrderTypes"%> +<%@page import="org.posterita.TangoColors"%> + + + + + <%=appName%> + + + + + + + + + + + + + + + + +<% +MOrder order = new MOrder(ctx, Integer.valueOf(orderId).intValue(), null); +String orderType = order.getOrderType(); +MPriceList priceList = MPriceList.get(ctx, order.getM_PriceList_ID(), null); +String priceListName = priceList.getName(); +%> + + + + + + + + + + + + + + + + + + + + +
        +
        + + +
        + <%= orderType %> +
        +
        +
        +
        + : + <%=orgName%> +
        +
        + : + <%=posName%> +
        +
        +
        +
        + : + +
        +
        + : + <%=roleName%> +
        +
        +
        +
        +
        +
        +
        +
        +
        + <% String currency = order.getC_Currency().getCurSymbol(); + + String paymentRule = order.getPaymentRule(); + + if(paymentRule.equalsIgnoreCase(MOrder.PAYMENTRULE_Cash)) + { + out.print("Amt Refunded: " + currency + order.getAmountRefunded()); + } + + if(paymentRule.equalsIgnoreCase(MOrder.PAYMENTRULE_CreditCard)) + { + out.print("Card: " + currency + order.getGrandTotal()); + } + + if(paymentRule.equalsIgnoreCase(MOrder.PAYMENTRULE_Check)) + { + out.print("Cheque: " + currency + order.getGrandTotal()); + } + + if(paymentRule.equalsIgnoreCase(UdiConstants.PAYMENTRULE_MIXED)) + { + out.print("Total: " + currency + order.getGrandTotal()); + } + %> +
        +
        +
        +
        +
        +   + +
        +
        + <%=priceListName%> +
        +
        +
        +
        +
        +
        + <%= ShoppingcartManager.getShoppingCartFromOrder(ctx, Integer.valueOf(orderId).intValue(), null) %> +
        +
        +
        +
        +
        + <% + String args = "showFooter=true;lineLength=40;priceWithVat=true;showDiscount=false;showLogo=false;showBarcode=false;"; + + HtmlOrderPrintFormatter formatter = new HtmlOrderPrintFormatter(args); + String data = formatter.format(ctx, Integer.valueOf(orderId).intValue(), null); + out.print("
        ");
        +				out.print(data);
        +				out.print("
        "); + %> +
        +
        +
        + +
        +
        +
        + <%String newOrderAction = "/CreatePOSOrderScreen.do?orderType="+orderType; %> +
        NEW ORDER
        +
        +
        +
        + Ctrl+Space New Order | Ctrl-M Menu
        +
        + <%@ include file="/jsp/include/printOrderApplet2.jsp" %> + + + diff --git a/posterita/posterita/web/jsp/pos/viewVendorDetails.jsp b/posterita/posterita/web/jsp/pos/viewVendorDetails.jsp new file mode 100644 index 0000000000..a6643142e3 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/viewVendorDetails.jsp @@ -0,0 +1,106 @@ +<%-- + * Product: Posterita Web-Based POS (an Adempiere Plugin) + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Martine +--%> + + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.beans.UDIBean" %> +<%@ page import="org.posterita.core.MenuItem" %> + + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> + + +<%@ include file="/jsp/include/posHeader.jsp" %> + + + + + + + + + + + + +
        +
        + + + + + + +
        +
        +
        +
        + + + + + + + + + + + + + + + + + + + +
        +
        +
        +
        + + + + + + + + + + + + + + + + +
         
        +
        +
        + +<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/viewWebstorePayment.jsp b/posterita/posterita/web/jsp/pos/viewWebstorePayment.jsp new file mode 100644 index 0000000000..691c9d68c2 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/viewWebstorePayment.jsp @@ -0,0 +1,121 @@ +<%-- + * Product: Posterita Web-Based POS (an Adempiere Plugin) + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Vishee +--%> + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.WebUserInfo" %> +<%@ page import="org.posterita.order.UDIOrderTypes" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> + + + + + + + + + + + + + + + + + <%@ include file="/jsp/webstore/documentHeader.jsp" %> + + + + + + + + + + + +
        + <%@ include file="/jsp/include/errors.jsp" %> +
        + Doc Status: +
        + + + + + + + + + + + + <% + String styleClass = "lightColour"; + if ((count.intValue()%2) != 0) + styleClass = "darkColour"; + %> + + + + + + + + + + + + + + + + + + + + +
        DescriptionQtyUnit PriceTotal Price
        + + + + + + + +
        +   + + +
        +
        + + + + <%@ include file="/jsp/include/tshirtFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/viewattributevalues.jsp b/posterita/posterita/web/jsp/pos/viewattributevalues.jsp new file mode 100644 index 0000000000..dd7013b2a7 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/viewattributevalues.jsp @@ -0,0 +1,87 @@ + +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Ashley +--%> + + + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.beans.*" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> + + + + + + +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + +
        + + + + <%=element.getName()%> + + + +
        +
        +
        +
        + + + + <% + String style = "label"; + if((count.intValue() % 2) == 0) + style = "contentname"; + %> + + + + + + + +
        + + + + <% + String editLink = "EditPOSAttributeValueAction.do?action=initEditAttributeValue"; + editLink += "&attributeValueId=" + element.getKey() + "&name=" + element.getName()+ "&attributeId="; + %> + +
        +
        + +
        +<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/webDocumentHeader.jsp b/posterita/posterita/web/jsp/pos/webDocumentHeader.jsp new file mode 100644 index 0000000000..e2009fa2d3 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/webDocumentHeader.jsp @@ -0,0 +1,81 @@ +<%-- + * Product: Posterita Web-Based POS (an Adempiere Plugin) + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Vishee +--%> + + + + + + + + + + + +
        + + + + + +
        + + + +
        + +
        + +
        + +
        +
        + + + + + +
        + + + + <% String partnerId = partner.get_ID() + ""; %> + + + + + "> + + + + +
        + +
        + +
        + + +
        + +
        + + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/wstoreeditattribute.jsp b/posterita/posterita/web/jsp/pos/wstoreeditattribute.jsp new file mode 100644 index 0000000000..f99418802d --- /dev/null +++ b/posterita/posterita/web/jsp/pos/wstoreeditattribute.jsp @@ -0,0 +1,72 @@ +<%-- + * Product: Posterita Web-Based POS (an Adempiere Plugin) + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Ashley G Ramdass +--%> + + + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.beans.*" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> + +Edit Attributes +<%@ include file="/jsp/include/posHeader.jsp" %> + + + + + + + + + + +
        + <%@ include file="/jsp/include/errors.jsp" %> +
        + + + + + + + + + + + + + + +
        Old Attribute Value: +
        New Attribute Value: +
        + Save +
        +
        +
        + +<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/wstoreviewattributevalues.jsp b/posterita/posterita/web/jsp/pos/wstoreviewattributevalues.jsp new file mode 100644 index 0000000000..2da0c656d5 --- /dev/null +++ b/posterita/posterita/web/jsp/pos/wstoreviewattributevalues.jsp @@ -0,0 +1,81 @@ +<%-- + * Product: Posterita Web-Based POS (an Adempiere Plugin) + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Ashley G Ramdass +--%> + + + + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.beans.*" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> + +View Attributes +<%@ include file="/jsp/include/posHeader.jsp" %> +<%@ include file="/jsp/include/errors.jsp" %> + + + + + +
        + + + + <%=element.getName()%> + + + +
        +
        +
        +
        + + + + <% + String style = "label"; + if((count.intValue() % 2) == 0) + style = "contentname"; + %> + + + + + + +
        + + + + <% + String editLink = "EditPOSAttributeValueAction.do?action=initEditAttributeValue"; + editLink += "&attributeValueId=" + element.getKey() + "&name=" + element.getName()+ "&attributeId="; + %> + Edit +
        +
        +
        +<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/product/viewProductInfo.jsp b/posterita/posterita/web/jsp/product/viewProductInfo.jsp new file mode 100644 index 0000000000..c8f41d94a3 --- /dev/null +++ b/posterita/posterita/web/jsp/product/viewProductInfo.jsp @@ -0,0 +1,18 @@ +<%@ page language="java"%> +<%@ page import="java.util.Properties" %> +<%@ page import="org.posterita.core.TmkJSPEnv" %> +<%@ page import="org.posterita.core.ImageServer" %> +<%@ page import="org.posterita.businesslogic.ProductManager" %> +<% + Properties ctx = TmkJSPEnv.getCtx(request); + + Integer product_id = new Integer(request.getParameter("productId")); + String size = request.getParameter("size"); + + int attachment_id = ProductManager.getAttachment(ctx,product_id.intValue(), null).get_ID(); + + boolean sent = ImageServer.sendImage(ctx,attachment_id,size,response); + + if(!sent) + ImageServer.sendDefaultImage(response); +%> diff --git a/posterita/posterita/web/jsp/user/createUser.jsp b/posterita/posterita/web/jsp/user/createUser.jsp new file mode 100644 index 0000000000..27cad9e918 --- /dev/null +++ b/posterita/posterita/web/jsp/user/createUser.jsp @@ -0,0 +1,173 @@ +<%-- + * Product: Posterita Web-Based POS (an Adempiere Plugin) + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Vishee +--%> + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.beans.UDIBean" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> + + + + + + + + + + + + + + + + + + + + +
        + <%@ include file="/jsp/include/tabTop.jsp" %><%@ include file="/jsp/include/tabBottom.jsp" %> +
        + <%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        Role + + + +
        +
        + +
        + +
        + +
        + +
        + +
        + + + +
        + +
        + +
        + + + +
        + + + +
        + + + + + +
        + +
        +
        + + + +<%@ include file="/jsp/include/footerTableBottom.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/user/editUser.jsp b/posterita/posterita/web/jsp/user/editUser.jsp new file mode 100644 index 0000000000..eea667066f --- /dev/null +++ b/posterita/posterita/web/jsp/user/editUser.jsp @@ -0,0 +1,174 @@ +<%-- + * Product: Posterita Web-Based POS (an Adempiere Plugin) + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Vishee +--%> + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.posterita.beans.UDIBean" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> + + + + + + + Edit User + + + + + + + + + + + + + +
        + <%@ include file="/jsp/include/tabTop.jsp" %>Edit User<%@ include file="/jsp/include/tabBottom.jsp" %> +
        + <%@ include file="/jsp/include/errors.jsp" %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        Role + + + +
        + +
        + +
        + +
        + +
        + +
        + + +
        + + +
        + +
        + +
        + + + +
        + + + +
        + + + + + +
        + +
        +
        + + + +<%@ include file="/jsp/include/footerTableBottom.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/user/listUsers.jsp b/posterita/posterita/web/jsp/user/listUsers.jsp new file mode 100644 index 0000000000..5f5c0f8ea0 --- /dev/null +++ b/posterita/posterita/web/jsp/user/listUsers.jsp @@ -0,0 +1,103 @@ +<%-- + * Product: Posterita Web-Based POS (an Adempiere Plugin) + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Vishee +--%> + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.compiere.model.MOrg" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> + + + + + + + + + + + + + + +
        + <%@ include file="/jsp/include/tabTop.jsp" %>All Users<%@ include file="/jsp/include/tabBottom.jsp" %> +
        + + + + + + + + + + + + + <% + String styleClass = "label"; + + if ((count.intValue()%2) != 0) + styleClass = "contentname"; + %> + + + + + + + + + + + + + +
        Add Record
        UsernameRoleIs Sale RepresentativeIs Active 
        + + + + + + + + + ">Edit +   + ">View +   + + ">Deactivate + + + ">Activate + +
        +
        + + <%@ include file="/jsp/include/footerTableBottom.jsp" %> + + \ No newline at end of file diff --git a/posterita/posterita/web/jsp/user/registerUser.jsp b/posterita/posterita/web/jsp/user/registerUser.jsp new file mode 100644 index 0000000000..4f9f6ac748 --- /dev/null +++ b/posterita/posterita/web/jsp/user/registerUser.jsp @@ -0,0 +1,153 @@ +<%-- + * Product: Posterita Web-Based POS and Adempiere Plugin + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Servansingh +--%> + + +<%String path = request.getContextPath(); +String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> + +<%@ page import="org.posterita.Constants" %> + +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> + + + + POSterita:. User Registration + + + + + + + +
        + + + + + + + +
        + +
        +
        + User Registration Form +
        + + + + + + + + + +
        + + + <%@ include file="/jsp/include/errors.jsp" %> + +
        +
        + +
        +
        + User Details + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        First Name
        Last Name
        Address
        City
        Country + + + +
        Company
        Industry
        Email
        Remarks
        + + + + + + + +
        +
        +
        +
        + + + + + diff --git a/posterita/posterita/web/jsp/user/userCreated.jsp b/posterita/posterita/web/jsp/user/userCreated.jsp new file mode 100644 index 0000000000..221fb4c608 --- /dev/null +++ b/posterita/posterita/web/jsp/user/userCreated.jsp @@ -0,0 +1,143 @@ +<%-- + * Product: Posterita Web-Based POS (an Adempiere Plugin) + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Vishee +--%> + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.compiere.model.MOrg" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/posterita.tld" prefix="posterita"%> + + + + + + + + + + + + + + + +
        + <%@ include file="/jsp/include/tabTop.jsp" %><%@ include file="/jsp/include/tabBottom.jsp" %> +
        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        + + + +
        + + + +
        + + + +
        + + + +
        + + + +
        + + + +
        + + + +
        + + Yes + + + No + +
        + + Yes + + + No + +
        +
        + +<%@ include file="/jsp/include/footerTableBottom.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/user/viewUser.jsp b/posterita/posterita/web/jsp/user/viewUser.jsp new file mode 100644 index 0000000000..19e1025218 --- /dev/null +++ b/posterita/posterita/web/jsp/user/viewUser.jsp @@ -0,0 +1,153 @@ +<%-- + * Product: Posterita Web-Based POS (an Adempiere Plugin) + * Copyright (C) 2007 Posterita Ltd + * This file is part of POSterita + * + * POSterita is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Vishee +--%> + +<%@ page import="org.posterita.Constants" %> +<%@ page import="org.posterita.user.*" %> +<%@ page import="org.compiere.model.MOrg" %> + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> +<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> + + + + + + + + + + + + + + +
        + <%@ include file="/jsp/include/tabTop.jsp" %><%@ include file="/jsp/include/tabBottom.jsp" %> +
        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        + + + +
        + + + +
        + + + +
        + + + +
        + + + +
        + + + +
        + + + +
        + + + +
        + + + + Yes + + + No + +
        + + + + Yes + + + No + +
        +
        + + + <%@ include file="/jsp/include/footerTableBottom.jsp" %> + + \ No newline at end of file diff --git a/posterita/properties.xml b/posterita/properties.xml new file mode 100644 index 0000000000..be1e2401c9 --- /dev/null +++ b/posterita/properties.xml @@ -0,0 +1,17 @@ + + + + This project file sets all properties needed during build and + installation. This file is imported in all other build.xml + files. This file provides a central place for managing + properties. + + + + + + + + + + diff --git a/utils_dev/build.xml b/utils_dev/build.xml index d8dd8273fb..8c1cb29154 100644 --- a/utils_dev/build.xml +++ b/utils_dev/build.xml @@ -29,7 +29,7 @@ - + @@ -48,7 +48,7 @@ - +