From 34d2c7b1d5cba74517f1fabbe3f304f73811756c Mon Sep 17 00:00:00 2001 From: hodianto Date: Wed, 21 Mar 2018 21:24:24 +0700 Subject: [PATCH] All Comm --- .DS_Store | Bin 10244 -> 10244 bytes andromeida.midsuit.project/.DS_Store | Bin 6148 -> 10244 bytes andromeida.midsuit.project/bin/.DS_Store | Bin 0 -> 8196 bytes .../bin/andromedia/.DS_Store | Bin 0 -> 8196 bytes .../bin/andromedia/midsuit/.DS_Store | Bin 0 -> 8196 bytes andromeida.midsuit.project/src/.DS_Store | Bin 0 -> 8196 bytes .../src/andromedia/.DS_Store | Bin 0 -> 8196 bytes .../src/andromedia/midsuit/.DS_Store | Bin 0 -> 8196 bytes .../midsuit/factory/MID_ValidatorFactory.java | 13 ++ .../midsuit/form/MID_CreateFromOrder.java | 2 +- .../midsuit/form/MID_WCreateFromShipment.java | 2 +- .../midsuit/model/I_zpos_Cashier.java | 168 ++++++++++++++++++ .../midsuit/model/X_zpos_Cashier.java | 156 ++++++++++++++++ .../process/MID_InsertIntoAllTable.java | 51 +++++- .../MID_PaymentAllocateValidator.java | 49 +++++ .../midsuit/validator/MID_RMAValidator.java | 95 +++++----- 16 files changed, 482 insertions(+), 54 deletions(-) create mode 100644 andromeida.midsuit.project/bin/.DS_Store create mode 100644 andromeida.midsuit.project/bin/andromedia/.DS_Store create mode 100644 andromeida.midsuit.project/bin/andromedia/midsuit/.DS_Store create mode 100644 andromeida.midsuit.project/src/.DS_Store create mode 100644 andromeida.midsuit.project/src/andromedia/.DS_Store create mode 100644 andromeida.midsuit.project/src/andromedia/midsuit/.DS_Store create mode 100644 andromeida.midsuit.project/src/andromedia/midsuit/model/I_zpos_Cashier.java create mode 100644 andromeida.midsuit.project/src/andromedia/midsuit/model/X_zpos_Cashier.java create mode 100644 andromeida.midsuit.project/src/andromedia/midsuit/validator/MID_PaymentAllocateValidator.java diff --git a/.DS_Store b/.DS_Store index 1ac9f845ce2ece0eb4d83d5b284e2ac346342e24..16031b22e104f9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.midsuit.project/bin/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..5165528261a231427eaae231cbb9a74af34d1162 GIT binary patch literal 8196 zcmeHMOKcoP5UpA}anHnw+s27Kn~#?`CWbh$8wERmt$$$4L9w#y_!9?bc4v}|n4K{@ zv+E>|kx}4=lE8`Z5eRWX$q6YJgv93nmcju`7M~nAz=b0Mfy4=_d&X8i_5ltMDbrGS zb$3;DcU8ac-kJpf>?#>4fJOjdlm+E$s8}WmzR35aSlClZ6iFYzg#wshfCc(J(osj` zfye`q2Ol6GEJ5I;67!4b%Yxb--|D3?mejvy)yz ziUXzt8kLa;A`jf_0dag(iq;*9+Kacx@3|>&GH1Iv;?LzKZOikM$!{@MQMqb$6=Nz> z*QzHnXWXfbulpshOD`T5twG&ClMCxv*R_}GdhVEIPEGLoZrAa3%Q1^m*)mKL86UPB z!=37KOOD~maWVmeF@-4;ykUBJ_nuT+B01BRnC|FEwk1-@U3+F`6xPs^I@o`*aPIu{ zg_###56r{xih!EC%)Ppjt+rS04s4CRwrJ~ji?%B28m+Hi9hl&CWisK&q;I*7cg!q$ zL??KSM`riuU1zXp3jT23wMzxZo8Yy1-OiV6-8VaJJ7b+Uy%FC$>xr(1)Km*y+Y>12ol1{yq0?@1qw(^slVxCpPnCAbW4 z!uxO?K7^0qOPGV3@DmYXyPe6jgxp5&*L;+z?bn7UdAhU72m+O@NK+~H}Dhu6hFhy@g{za^TFz3 zi>N&ut~Mliiz>^WP(p2ZLSv)Lp*G&rt3Lhzp!WM}v1_$;57n>V(%iapSI2?$(w5$} zhqq%%LMXt9#Lgl%7b03DiRbJ@YIRr+`;2XoQodL_E#~h?s0{YoTV0 zK+ePg(bUJ{B&joAA)E0h)D$C}@>KzMx7w}{l6hso-K*|r1X#XW4s~#&s&XKhi)oaW zxJtLyKL+7@a1B0!F9?3~@D2O`Kfy2XCn8p1EjC~yZp2Nv1-Ij)xC7g8C${4r+=u(| z0QTZj*oXZD!z>QrFpl6D!O)N}w6KUCmat54d=W3=OG|KkmEiaez8j!y34DDa>Oz7a zP-R*0l`}=hcAeA2Uj*)*s!{8{_drFk!bTDQ_pbc?|Gu{)T43aX$OHf016bLU>FFZ< zm2PqoYbPk5q%4wQ`p+bm=ei@DvUHZe2>WPq-4(V(_i9_i>{}2$p|MKT(^!`iu HJ+Q^!JjLUA literal 0 HcmV?d00001 diff --git a/andromeida.midsuit.project/bin/andromedia/.DS_Store b/andromeida.midsuit.project/bin/andromedia/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..dc2bf6f8e5c4fa0838b6f1ddaec4c872d449538e GIT binary patch literal 8196 zcmeHMUu+ab82`R&p|e|{(+aeE1$t5{D2HAfr2NnI+G-mx5bjC~6py{z1vYMX&)dB# zwA9p~ZwAyS@lQ0y7XwcwyciSzJZKYqkfiYs4?gINk4B@3Px{U5wt<$$_@WYal9}Jk zeBU=S-#5RV$=m?|W-3M}Knnmc$^v;k6?aKOF7l!j3wvq_k?a8~V1Zv4_euqOk#^J( zMIeem6oDuLQ3Rq0{2wAfceY4uiF-egMr9O%C<6Co1jPA}pe!&Q;&g!W=%7MA0SLtt zKqjiwJ3!hbLQID^9iTL&F@x6whNc)kF)%PEc|xcYrbC<#Ffa!U%mKrhF?^w*oSp0v zQXMcIU{ppCh$65!0^;+jgE4xy8{pmkes>EbnJJWP%kxvIZ!lIFiRq zAzLq)Ha8R|m3DNi+Hf_9BtH;#?rBoBk)k^`My`0&C!E&OT88l%_OzJzpzisHN~R;` zZf;rI*QRO5M1PNAm09A6KH zs|^8fQDwnbNqnVW)g)h!-HosDzJB$||Aw#Mtq}Xw*z~~aH5=NuZ0qXYo1Wjy1-o}U zizImhc1YIDu|jU)oirpmYw=cf{Ze!uBGQ@XnBYIJo7IRRZHaiC3;HnG+|)tM7}1-F zPeW55iIb+zc#UkvA5%LSF_bS0q}$aU3UQd%2GU*X9!6B<%jHn}T2++;5nN28bi`FU zss1tj-i531A$(56y9r;z_wXb941XYE9X4V!wqPr+!wt9@AI7bi#BI0(cj9i`gL|7%Q6n-yFo7wG8CZTPzPTQEKp@BMJSEcE{94CcDDQZvzw?*8X+z~)g5W( zo0<3C%)B?>&S-1^z)ZzR0W<>uqb!iGq~b0~$VFb1YQmmcLL_?t6Fl$=6JDucFVc=W zq6kD0h$0Y0Ac{Z~f&W7U=*||2EphJ$(x{9g5Jlj=jDR>F;*a=lQpEzeITzrmViwaZu3F{UzgwR$Q$ z=1ydN-LH5Vy?jEnj_CeaA*|_iBT*ucf$1F=@%P>jhu3l5m)kbygP}TCRf^7~?ScX3~qI*Tt zF)U~FIK|8HtuvNcRvIv&As_moX4jaj~?e)ZN4P0e{?#X3`DPoh&*bI;I*a!(0*QrlH+ z(AEp4%?*V~rJY@>HdGBF$p^yDy^X3iTy)3B$rX?KgwtAD%P@YOJuN0aq14!Ciu_mW;J3+YdjX?f<8<(x3p8UhUm@2 zr=h8j#7I+Te3@*<9#d0{7|NFi(jDqfg*eP>1L_NkEvm|a2ri~k+G8r6 zRR5TM@4^-M5I!g3-Gr~eH C=-cf8 literal 0 HcmV?d00001 diff --git a/andromeida.midsuit.project/src/.DS_Store b/andromeida.midsuit.project/src/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..5165528261a231427eaae231cbb9a74af34d1162 GIT binary patch literal 8196 zcmeHMOKcoP5UpA}anHnw+s27Kn~#?`CWbh$8wERmt$$$4L9w#y_!9?bc4v}|n4K{@ zv+E>|kx}4=lE8`Z5eRWX$q6YJgv93nmcju`7M~nAz=b0Mfy4=_d&X8i_5ltMDbrGS zb$3;DcU8ac-kJpf>?#>4fJOjdlm+E$s8}WmzR35aSlClZ6iFYzg#wshfCc(J(osj` zfye`q2Ol6GEJ5I;67!4b%Yxb--|D3?mejvy)yz ziUXzt8kLa;A`jf_0dag(iq;*9+Kacx@3|>&GH1Iv;?LzKZOikM$!{@MQMqb$6=Nz> z*QzHnXWXfbulpshOD`T5twG&ClMCxv*R_}GdhVEIPEGLoZrAa3%Q1^m*)mKL86UPB z!=37KOOD~maWVmeF@-4;ykUBJ_nuT+B01BRnC|FEwk1-@U3+F`6xPs^I@o`*aPIu{ zg_###56r{xih!EC%)Ppjt+rS04s4CRwrJ~ji?%B28m+Hi9hl&CWisK&q;I*7cg!q$ zL??KSM`riuU1zXp3jT23wMzxZo8Yy1-OiV6-8VaJJ7b+Uy%FC$>xr(1)Km*y+Y>12ol1{yq0?@1qw(^slVxCpPnCAbW4 z!uxO?K7^0qOPGV3@DmYXyPe6jgxp5&*L;+z?bn7UdAhU72m+O@NK+~H}Dhu6hFhy@g{za^TFz3 zi>N&ut~Mliiz>^WP(p2ZLSv)Lp*G&rt3Lhzp!WM}v1_$;57n>V(%iapSI2?$(w5$} zhqq%%LMXt9#Lgl%7b03DiRbJ@YIRr+`;2XoQodL_E#~h?s0{YoTV0 zK+ePg(bUJ{B&joAA)E0h)D$C}@>KzMx7w}{l6hso-K*|r1X#XW4s~#&s&XKhi)oaW zxJtLyKL+7@a1B0!F9?3~@D2O`Kfy2XCn8p1EjC~yZp2Nv1-Ij)xC7g8C${4r+=u(| z0QTZj*oXZD!z>QrFpl6D!O)N}w6KUCmat54d=W3=OG|KkmEiaez8j!y34DDa>Oz7a zP-R*0l`}=hcAeA2Uj*)*s!{8{_drFk!bTDQ_pbc?|Gu{)T43aX$OHf016bLU>FFZ< zm2PqoYbPk5q%4wQ`p+bm=ei@DvUHZe2>WPq-4(V(_i9_i>{}2$p|MKT(^!`iu HJ+Q^!JjLUA literal 0 HcmV?d00001 diff --git a/andromeida.midsuit.project/src/andromedia/.DS_Store b/andromeida.midsuit.project/src/andromedia/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..dc2bf6f8e5c4fa0838b6f1ddaec4c872d449538e GIT binary patch literal 8196 zcmeHMUu+ab82`R&p|e|{(+aeE1$t5{D2HAfr2NnI+G-mx5bjC~6py{z1vYMX&)dB# zwA9p~ZwAyS@lQ0y7XwcwyciSzJZKYqkfiYs4?gINk4B@3Px{U5wt<$$_@WYal9}Jk z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m@2 zr=h8j#7I+Te3@*<9#d0{7|NFi(jDqfg*eP>1L_NkEvm|a2ri~k+G8r6 zRR5TM@4^-M5I!g3-Gr~eH C=-cf8 literal 0 HcmV?d00001 diff --git a/andromeida.midsuit.project/src/andromedia/midsuit/factory/MID_ValidatorFactory.java b/andromeida.midsuit.project/src/andromedia/midsuit/factory/MID_ValidatorFactory.java index bb12a14..2fd8ff6 100644 --- a/andromeida.midsuit.project/src/andromedia/midsuit/factory/MID_ValidatorFactory.java +++ b/andromeida.midsuit.project/src/andromedia/midsuit/factory/MID_ValidatorFactory.java @@ -4,12 +4,14 @@ import org.adempiere.base.event.AbstractEventHandler; import org.adempiere.base.event.IEventTopics; import org.adempiere.exceptions.AdempiereException; import org.compiere.model.MOrder; +import org.compiere.model.MPaymentAllocate; import org.compiere.model.MRMA; import org.compiere.model.PO; import org.compiere.util.CLogger; import org.osgi.service.event.Event; import andromedia.midsuit.validator.MID_OrderValidator; +import andromedia.midsuit.validator.MID_PaymentAllocateValidator; import andromedia.midsuit.validator.MID_RMAValidator; public class MID_ValidatorFactory extends AbstractEventHandler { @@ -26,6 +28,9 @@ public class MID_ValidatorFactory extends AbstractEventHandler { msg = MID_OrderValidator.executeEvent(event, getPO(event)); if (getPO(event).get_TableName().equals(MRMA.Table_Name)) msg = MID_RMAValidator.executeEvent(event, getPO(event)); + if(getPO(event).get_TableName().equals(MPaymentAllocate.Table_Name)) + msg = MID_PaymentAllocateValidator.executeEvent(event, getPO(event)); + logEvent(event, getPO(event), msg); } @@ -44,6 +49,14 @@ public class MID_ValidatorFactory extends AbstractEventHandler { //RMA registerTableEvent(IEventTopics.DOC_AFTER_COMPLETE, MRMA.Table_Name); registerTableEvent(IEventTopics.PO_AFTER_NEW, MRMA.Table_Name); + + // MPaymentAllocate + registerTableEvent(IEventTopics.PO_AFTER_CHANGE, MPaymentAllocate.Table_Name); + registerTableEvent(IEventTopics.PO_AFTER_NEW, MPaymentAllocate.Table_Name); + registerTableEvent(IEventTopics.PO_AFTER_DELETE, MPaymentAllocate.Table_Name); + registerTableEvent(IEventTopics.PO_BEFORE_CHANGE, MPaymentAllocate.Table_Name); + registerTableEvent(IEventTopics.PO_BEFORE_NEW, MPaymentAllocate.Table_Name); + } } diff --git a/andromeida.midsuit.project/src/andromedia/midsuit/form/MID_CreateFromOrder.java b/andromeida.midsuit.project/src/andromedia/midsuit/form/MID_CreateFromOrder.java index 220758d..c52ca19 100644 --- a/andromeida.midsuit.project/src/andromedia/midsuit/form/MID_CreateFromOrder.java +++ b/andromeida.midsuit.project/src/andromedia/midsuit/form/MID_CreateFromOrder.java @@ -236,7 +236,7 @@ public class MID_CreateFromOrder extends CreateFrom { pstmt = DB.prepareStatement(sql.toString(), null); pstmt.setInt(++count, AD_Client_ID); // pstmt.setString(++count, DocAction.STATUS_Completed); - pstmt.setInt(++count, M_Warehouse_ID); +// pstmt.setInt(++count, M_Warehouse_ID); //pstmt.setInt(++count, C_BPartner_ID); rs = pstmt.executeQuery(); while (rs.next()) diff --git a/andromeida.midsuit.project/src/andromedia/midsuit/form/MID_WCreateFromShipment.java b/andromeida.midsuit.project/src/andromedia/midsuit/form/MID_WCreateFromShipment.java index 67a2446..f072d41 100644 --- a/andromeida.midsuit.project/src/andromedia/midsuit/form/MID_WCreateFromShipment.java +++ b/andromeida.midsuit.project/src/andromedia/midsuit/form/MID_WCreateFromShipment.java @@ -157,7 +157,7 @@ public class MID_WCreateFromShipment extends CreateFromShipment implements Event boolean isRMAWindow = ((getGridTab().getAD_Window_ID() == WINDOW_RETURNTOVENDOR) || (getGridTab().getAD_Window_ID() == WINDOW_CUSTOMERRETURN)); bPartnerLabel.setText(Msg.getElement(Env.getCtx(), "C_BPartner_ID")); - orderLabel.setText(Msg.getElement(Env.getCtx(), "C_Order_ID", false)); + orderLabel.setText("Order"); invoiceLabel.setText(Msg.getElement(Env.getCtx(), "C_Invoice_ID", false)); rmaLabel.setText(Msg.translate(Env.getCtx(), "M_RMA_ID")); locatorLabel.setText(Msg.translate(Env.getCtx(), "M_Locator_ID")); diff --git a/andromeida.midsuit.project/src/andromedia/midsuit/model/I_zpos_Cashier.java b/andromeida.midsuit.project/src/andromedia/midsuit/model/I_zpos_Cashier.java new file mode 100644 index 0000000..6464dc0 --- /dev/null +++ b/andromeida.midsuit.project/src/andromedia/midsuit/model/I_zpos_Cashier.java @@ -0,0 +1,168 @@ +/****************************************************************************** + * Product: iDempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2012 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 andromedia.midsuit.model; + +import java.math.BigDecimal; +import java.sql.Timestamp; +import org.compiere.model.*; +import org.compiere.util.KeyNamePair; + +/** Generated Interface for zpos_Cashier + * @author iDempiere (generated) + * @version Release 5.1 + */ +@SuppressWarnings("all") +public interface I_zpos_Cashier +{ + + /** TableName=zpos_Cashier */ + public static final String Table_Name = "zpos_Cashier"; + + /** AD_Table_ID=300006 */ + public static final int Table_ID = 300006; + + KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name); + + /** AccessLevel = 3 - Client - Org + */ + BigDecimal accessLevel = BigDecimal.valueOf(3); + + /** Load Meta Data */ + + /** Column name AD_Client_ID */ + public static final String COLUMNNAME_AD_Client_ID = "AD_Client_ID"; + + /** Get Client. + * Client/Tenant for this installation. + */ + public int getAD_Client_ID(); + + /** Column name AD_Org_ID */ + public static final String COLUMNNAME_AD_Org_ID = "AD_Org_ID"; + + /** Set Organization. + * Organizational entity within client + */ + public void setAD_Org_ID (int AD_Org_ID); + + /** Get Organization. + * Organizational entity within client + */ + public int getAD_Org_ID(); + + /** Column name Created */ + public static final String COLUMNNAME_Created = "Created"; + + /** Get Created. + * Date this record was created + */ + public Timestamp getCreated(); + + /** Column name CreatedBy */ + public static final String COLUMNNAME_CreatedBy = "CreatedBy"; + + /** Get Created By. + * User who created this records + */ + public int getCreatedBy(); + + /** 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 IsActive */ + public static final String COLUMNNAME_IsActive = "IsActive"; + + /** Set Active. + * The record is active in the system + */ + public void setIsActive (boolean IsActive); + + /** Get Active. + * The record is active in the system + */ + public boolean isActive(); + + /** 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 Updated */ + public static final String COLUMNNAME_Updated = "Updated"; + + /** Get Updated. + * Date this record was updated + */ + public Timestamp getUpdated(); + + /** Column name UpdatedBy */ + public static final String COLUMNNAME_UpdatedBy = "UpdatedBy"; + + /** Get Updated By. + * User who updated this records + */ + public int getUpdatedBy(); + + /** 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 zpos_Cashier_ID */ + public static final String COLUMNNAME_zpos_Cashier_ID = "zpos_Cashier_ID"; + + /** Set Cashier Machine */ + public void setzpos_Cashier_ID (int zpos_Cashier_ID); + + /** Get Cashier Machine */ + public int getzpos_Cashier_ID(); + + /** Column name zpos_Cashier_UU */ + public static final String COLUMNNAME_zpos_Cashier_UU = "zpos_Cashier_UU"; + + /** Set Cashier Machine UU */ + public void setzpos_Cashier_UU (String zpos_Cashier_UU); + + /** Get Cashier Machine UU */ + public String getzpos_Cashier_UU(); +} diff --git a/andromeida.midsuit.project/src/andromedia/midsuit/model/X_zpos_Cashier.java b/andromeida.midsuit.project/src/andromedia/midsuit/model/X_zpos_Cashier.java new file mode 100644 index 0000000..a4d50b1 --- /dev/null +++ b/andromeida.midsuit.project/src/andromedia/midsuit/model/X_zpos_Cashier.java @@ -0,0 +1,156 @@ +/****************************************************************************** + * Product: iDempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2012 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 andromedia.midsuit.model; + +import java.sql.ResultSet; +import java.util.Properties; +import org.compiere.model.*; + +/** Generated Model for zpos_Cashier + * @author iDempiere (generated) + * @version Release 5.1 - $Id$ */ +public class X_zpos_Cashier extends PO implements I_zpos_Cashier, I_Persistent +{ + + /** + * + */ + private static final long serialVersionUID = 20180321L; + + /** Standard Constructor */ + public X_zpos_Cashier (Properties ctx, int zpos_Cashier_ID, String trxName) + { + super (ctx, zpos_Cashier_ID, trxName); + /** if (zpos_Cashier_ID == 0) + { + } */ + } + + /** Load Constructor */ + public X_zpos_Cashier (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_zpos_Cashier[") + .append(get_ID()).append("]"); + return sb.toString(); + } + + /** Set Description. + @param Description + Optional short description of the record + */ + public void setDescription (String Description) + { + set_Value (COLUMNNAME_Description, Description); + } + + /** Get Description. + @return Optional short description of the record + */ + public String getDescription () + { + return (String)get_Value(COLUMNNAME_Description); + } + + /** Set Name. + @param Name + Alphanumeric identifier of the entity + */ + public void setName (String Name) + { + set_Value (COLUMNNAME_Name, Name); + } + + /** Get Name. + @return Alphanumeric identifier of the entity + */ + public String getName () + { + return (String)get_Value(COLUMNNAME_Name); + } + + /** Set Search Key. + @param Value + Search key for the record in the format required - must be unique + */ + public void setValue (String Value) + { + 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 Cashier Machine. + @param zpos_Cashier_ID Cashier Machine */ + public void setzpos_Cashier_ID (int zpos_Cashier_ID) + { + if (zpos_Cashier_ID < 1) + set_ValueNoCheck (COLUMNNAME_zpos_Cashier_ID, null); + else + set_ValueNoCheck (COLUMNNAME_zpos_Cashier_ID, Integer.valueOf(zpos_Cashier_ID)); + } + + /** Get Cashier Machine. + @return Cashier Machine */ + public int getzpos_Cashier_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_zpos_Cashier_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set Cashier Machine UU. + @param zpos_Cashier_UU Cashier Machine UU */ + public void setzpos_Cashier_UU (String zpos_Cashier_UU) + { + set_ValueNoCheck (COLUMNNAME_zpos_Cashier_UU, zpos_Cashier_UU); + } + + /** Get Cashier Machine UU. + @return Cashier Machine UU */ + public String getzpos_Cashier_UU () + { + return (String)get_Value(COLUMNNAME_zpos_Cashier_UU); + } +} \ No newline at end of file diff --git a/andromeida.midsuit.project/src/andromedia/midsuit/process/MID_InsertIntoAllTable.java b/andromeida.midsuit.project/src/andromedia/midsuit/process/MID_InsertIntoAllTable.java index 8ba449c..b17a6e4 100644 --- a/andromeida.midsuit.project/src/andromedia/midsuit/process/MID_InsertIntoAllTable.java +++ b/andromeida.midsuit.project/src/andromedia/midsuit/process/MID_InsertIntoAllTable.java @@ -15,9 +15,11 @@ import javax.management.MalformedObjectNameException; import javax.swing.JComboBox.KeySelectionManager; import org.adempiere.base.DefaultModelFactory; +import org.adempiere.exceptions.AdempiereException; import org.compiere.model.MEntityType; import org.compiere.model.MTable; import org.compiere.model.PO; +import org.compiere.model.Query; import org.compiere.process.DocAction; import org.compiere.process.DocumentEngine; import org.compiere.process.ProcessInfoParameter; @@ -51,7 +53,6 @@ public class MID_InsertIntoAllTable extends SvrProcess{ @Override protected String doIt() throws Exception { - if(jsonString.length()==0) return "Failed to execute insert"; JSONParser parser = new JSONParser(); JSONObject JSON = (JSONObject) parser.parse(jsonString); if(JSON!=null) { @@ -59,19 +60,47 @@ public class MID_InsertIntoAllTable extends SvrProcess{ tableName = JSON.get("TableName").toString(); JSONObject Data = (JSONObject) JSON.get("Data"); String Mode = JSON.get("Mode").toString(); + String whereClause = JSON.get("WhereClause").toString(); if(Mode.equals("I")) { po = getPO(tableName, 0, get_TrxName()); }else if (Mode.equals("U")) { + if(whereClause.length()>0) { + int[] IDs = new Query(getCtx(), tableName, whereClause,get_TrxName()) + .setOnlyActiveRecords(true) + .getIDs(); + + for(int ID : IDs) { + PO obj = null; + obj = getPO(tableName, ID, get_TrxName()); + Set keySetMass= Data.keySet(); + Iterator keysMass = keySetMass.iterator(); + while(keysMass.hasNext()) { + String columnInsert = keysMass.next().toString(); + obj.set_ValueNoCheck(columnInsert, Data.get(columnInsert).toString()); + } + if(!obj.save()) + throw new AdempiereException("Failed to Save the Data !"); + + } + return "Update Mass Data Success !!"; + }else { int Record_ID = Integer.parseInt(Data.get("Record_ID").toString()); po = getPO(tableName, Record_ID, get_TrxName()); + } } + Set keySet= Data.keySet(); Iterator keys = keySet.iterator(); - while(keys.hasNext()) { - String columnInsert = keys.next().toString(); - po.set_ValueNoCheck(columnInsert, Data.get(columnInsert)); - po.saveEx(); - } + if(whereClause.length()==0) + while(keys.hasNext()) { + String columnInsert = keys.next().toString(); + if(columnInsert.equals("Record_ID")) + continue; + po.set_ValueNoCheck(columnInsert, Data.get(columnInsert).toString()); + if(!po.save()) + throw new AdempiereException("Failed to Save the Data !"); + return String.valueOf(po.get_ID()); + } }else { return "No JSON to be processed !"; } @@ -168,7 +197,7 @@ public class MID_InsertIntoAllTable extends SvrProcess{ } } - + // Adempiere Extension Class clazz = getPOclass("adempiere.model.X_" + tableName, tableName); if (clazz != null) @@ -193,7 +222,13 @@ public class MID_InsertIntoAllTable extends SvrProcess{ s_classCache.put(tableName, clazz); return clazz; } - + + clazz = getPOclass("andromedia.midsuit.model.X_" + tableName, tableName); + if (clazz != null) + { + s_classCache.put(tableName, clazz); + return clazz; + } //Object.class to indicate no PO class for tableName s_classCache.put(tableName, Object.class); return null; diff --git a/andromeida.midsuit.project/src/andromedia/midsuit/validator/MID_PaymentAllocateValidator.java b/andromeida.midsuit.project/src/andromedia/midsuit/validator/MID_PaymentAllocateValidator.java new file mode 100644 index 0000000..ed94bd0 --- /dev/null +++ b/andromeida.midsuit.project/src/andromedia/midsuit/validator/MID_PaymentAllocateValidator.java @@ -0,0 +1,49 @@ +package andromedia.midsuit.validator; + +import java.math.BigDecimal; + +import org.adempiere.base.event.IEventTopics; +import org.adempiere.exceptions.AdempiereException; +import org.compiere.model.MPayment; +import org.compiere.model.MPaymentAllocate; +import org.compiere.model.PO; +import org.compiere.model.Query; +import org.compiere.model.X_C_OrderLandedCostAllocation; +import org.osgi.service.event.Event; + +public class MID_PaymentAllocateValidator { + public static String executeEvent(Event e, PO po) { + MPaymentAllocate pa = (MPaymentAllocate) po; + if (e.getTopic().equals(IEventTopics.PO_AFTER_DELETE) + || (e.getTopic().equals(IEventTopics.PO_AFTER_CHANGE) + && pa.is_ValueChanged(MPaymentAllocate.COLUMNNAME_Amount)) + || e.getTopic().equals((IEventTopics.PO_AFTER_NEW))) { + return afterSave(pa); + } + return ""; + } + + private static String afterSave(MPaymentAllocate po) { + BigDecimal allocatedAmt = new Query(po.getCtx(), po.get_TableName(), "C_Payment_ID =?", po.get_TrxName()) + .setOnlyActiveRecords(true).setParameters(new Object[] { po.getC_Payment_ID() }) + .sum(po.COLUMNNAME_Amount); + + MPayment payForUpdate = (MPayment) po.getC_Payment(); + payForUpdate.set_ValueNoCheck("PayAmt", allocatedAmt); + payForUpdate.saveEx(); + + return ""; + } + + private static String beforeSave(MPaymentAllocate po) { + BigDecimal amount = po.getAmount(); + BigDecimal invAmt = po.getInvoiceAmt(); + + if (amount.doubleValue() > invAmt.doubleValue()) { + throw new AdempiereException("Jumlah yang dibayarkan lebih besar daripada jumlah Invoice"); + } + + return ""; + } + +} diff --git a/andromeida.midsuit.project/src/andromedia/midsuit/validator/MID_RMAValidator.java b/andromeida.midsuit.project/src/andromedia/midsuit/validator/MID_RMAValidator.java index 8f7127e..6dc4d97 100644 --- a/andromeida.midsuit.project/src/andromedia/midsuit/validator/MID_RMAValidator.java +++ b/andromeida.midsuit.project/src/andromedia/midsuit/validator/MID_RMAValidator.java @@ -19,6 +19,7 @@ import org.compiere.model.MRMALine; import org.compiere.model.PO; import org.compiere.model.Query; import org.compiere.model.X_C_DocType; +import org.compiere.model.X_M_InOut; import org.compiere.process.DocAction; import org.osgi.service.event.Event; @@ -39,8 +40,9 @@ public class MID_RMAValidator { ioR.setC_DocType_ID(RMA.getC_DocType().getC_DocTypeShipment_ID()); ioR.setM_RMA_ID(RMA.getM_RMA_ID()); ioR.setC_BPartner_ID(RMA.getC_BPartner_ID()); + ioR.setIsSOTrx(RMA.isSOTrx()); ioR.setC_BPartner_Location_ID(RMA.getInOut().getC_BPartner_Location_ID()); - ioR.setMovementType(ioR.MOVEMENTTYPE_CustomerReturns); + ioR.setMovementType(RMA.isSOTrx() ? X_M_InOut.MOVEMENTTYPE_CustomerReturns : X_M_InOut.MOVEMENTTYPE_VendorReturns); ioR.setM_Warehouse_ID(RMA.getInOut().getM_Warehouse_ID()); ioR.saveEx(); @@ -53,59 +55,64 @@ public class MID_RMAValidator { ioRl.saveEx(); } - ioR.processIt("IP"); + ioR.processIt("CO"); ioR.saveEx(); MInOutConfirm confirm = new Query(RMA.getCtx(), MInOutConfirm.Table_Name, "M_InOut_ID =?", RMA.get_TrxName()) .setParameters(new Object[] { ioR.getM_InOut_ID() }).first(); + if(confirm!=null) { confirm.processIt("CO"); confirm.saveEx(); - - ioR.processIt("CO"); - ioR.saveEx(); + } // Create Invoice MOrder order = (MOrder) RMA.getInOut().getC_Order(); - MInvoice invoice = new MInvoice(order, order.getC_DocType().getC_DocTypeInvoice_ID(), order.getDateOrdered()); - invoice.setPaymentRule(order.getPaymentRule()); - int ARCreditMemo_ID = new Query(RMA.getCtx(), X_C_DocType.Table_Name, "name =?", RMA.get_TrxName()) - .setParameters("AR Credit Memo") - .setOnlyActiveRecords(true) - .firstId(); - invoice.setC_DocTypeTarget_ID(ARCreditMemo_ID); - invoice.setC_PaymentTerm_ID(order.getC_PaymentTerm_ID()); - invoice.setC_Currency_ID(order.getC_Currency_ID()); - invoice.setM_PriceList_ID(order.getM_PriceList_ID()); - invoice.saveEx(); - - MOrderLine[] oLines = order.getLines(); - for (int i = 0; i < oLines.length; i++) { - MOrderLine oLine = oLines[i]; - MInvoiceLine iLine = new MInvoiceLine(invoice); - iLine.setOrderLine(oLine); - iLine.setQtyEntered(oLine.getQtyOrdered()); - iLine.setQtyInvoiced(oLine.getQtyOrdered()); - iLine.saveEx(); + if(order.getInvoices().length>0) { + int ARCreditMemo_ID = new Query(RMA.getCtx(), X_C_DocType.Table_Name, "name =? AND AD_Client_ID =?", RMA.get_TrxName()) + .setParameters(new Object[] {RMA.isSOTrx() ? "AR Credit Memo" : "AP Credit Memo", RMA.getAD_Client_ID()}) + .setOnlyActiveRecords(true) + .firstId(); + MInvoice invoice = new MInvoice(RMA.getCtx(), 0, RMA.get_TrxName()); + invoice.setRMA(RMA); + invoice.setPaymentRule(order.getPaymentRule()); + invoice.setC_DocTypeTarget_ID(ARCreditMemo_ID); + invoice.setC_PaymentTerm_ID(order.getC_PaymentTerm_ID()); + invoice.setIsSOTrx(RMA.isSOTrx()); + invoice.setC_Currency_ID(order.getC_Currency_ID()); + invoice.setM_PriceList_ID(order.getM_PriceList_ID()); + invoice.saveEx(); + + MRMALine[] lines = RMA.getLines(true); + for (int i = 0; i < lines.length; i++) { + MRMALine line = lines[i]; + MInvoiceLine iLine = new MInvoiceLine(invoice); + iLine.setRMALine(line); + iLine.setM_Product_ID(line.getM_Product_ID()); + iLine.setQtyEntered(line.getQty()); + iLine.setQtyInvoiced(line.getQty()); + iLine.saveEx(); + } + + invoice.processIt(DocAction.ACTION_Complete); + invoice.saveEx(); + MInvoice invoiceUsed = new MInvoice(RMA.getCtx (), order.getC_Invoice_ID(), RMA.get_TrxName()); + if(invoiceUsed.getC_Payment_ID()>0) { + MPayment payment = new MPayment(RMA.getCtx(), 0, RMA.get_TrxName()); + + payment.setC_Invoice_ID(invoice.get_ID()); + // payment.setC_Order_ID(invoice.getC_Order_ID()); + payment.setIsReceipt(invoice.isSOTrx()); + payment.setAD_Org_ID(order.getAD_Org_ID()); + payment.setC_DocType_ID(invoice.isSOTrx()); + payment.setC_BPartner_ID(invoice.getC_BPartner_ID()); + payment.setAmount(invoice.getC_Currency_ID(), invoice.getGrandTotal().negate()); + payment.setC_BankAccount_ID(invoiceUsed.getC_Payment().getC_BankAccount_ID()); + payment.saveEx(); + + payment.processIt(DocAction.ACTION_Complete); + payment.saveEx(); + } } - - invoice.processIt(DocAction.ACTION_Complete); - invoice.saveEx(); - - MPayment payment = new MPayment(RMA.getCtx(), 0, RMA.get_TrxName()); - payment.setC_Invoice_ID(invoice.get_ID()); -// payment.setC_Order_ID(invoice.getC_Order_ID()); - payment.setIsReceipt(invoice.isSOTrx()); - payment.setAD_Org_ID(order.getAD_Org_ID()); - payment.setC_DocType_ID(invoice.isSOTrx()); - payment.setC_BPartner_ID(invoice.getC_BPartner_ID()); - payment.setAmount(invoice.getC_Currency_ID(), invoice.getGrandTotal().negate()); - MInvoice invoiceUsed = new MInvoice(RMA.getCtx(), order.getC_Invoice_ID(), RMA.get_TrxName()); - payment.setC_BankAccount_ID(invoiceUsed.getC_Payment().getC_BankAccount_ID()); - payment.saveEx(); - - payment.processIt(DocAction.ACTION_Complete); - payment.saveEx(); - return ""; }