private static DataMatrixModel GetDataMatrix2DBarCodeModel(ConsigmentRequest item, Consignment itemHasConnote)
        {
            var dataMatrixModel = new DataMatrixModel
            {
                versionHeader     = "A1",                                                                                           //01
                connoteNum        = itemHasConnote.ConNote,                                                                         //02
                recipientPostcode = itemHasConnote.Penerima.Address.Postcode,                                                       //03
                countryCode       = itemHasConnote.Penerima.Address.Country,                                                        //04
                productCode       = (itemHasConnote.Produk.IsInternational) ? "80000001" : "80000000",                              //05
                parentConnote     = (itemHasConnote.IsMps) ? itemHasConnote.ConNote : "",                                           //06
                mpsIndicator      = (itemHasConnote.IsMps) ? "02" : "01",                                                           //07
                senderPhoneNum    = itemHasConnote.Pemberi.ContactInformation.ContactNumber,                                        //08
                senderEmail       = itemHasConnote.Pemberi.ContactInformation.Email,                                                //09
                senderRefNo       = item.ReferenceNo,                                                                               //10
                customerAccNum    = (item.Designation == "Contract customer") ? item.UserId : "",                                   //11
                recipientPhoneNum = itemHasConnote.Penerima.ContactInformation.ContactNumber,                                       //12
                recipientEmail    = itemHasConnote.Penerima.ContactInformation.Email,                                               //13
                weight            = itemHasConnote.Produk.Weight.ToString("0.00"),                                                  //14
                dimensionVol      = $"{itemHasConnote.Produk.Length.ToString("0")}" +                                               //15
                                    $"x{itemHasConnote.Produk.Width.ToString("0")}" +
                                    $"x{itemHasConnote.Produk.Height.ToString("0")}",
                codAmount    = itemHasConnote.Produk.Est.CodAmount > 0 ? itemHasConnote.Produk.Est.CodAmount.ToString("0.00") : "",   //16
                ccodAmount   = itemHasConnote.Produk.Est.CcodAmount > 0 ? itemHasConnote.Produk.Est.CcodAmount.ToString("0.00") : "", //17
                valueAdded   = itemHasConnote.Produk.ValueAddedValue.ToString("0"),                                                   //18
                itemCategory = itemHasConnote.Produk.ItemCategory,                                                                    //19
                amountPaid   = item.Payment.TotalPrice.ToString("0"),                                                                 //20
                zone         = (itemHasConnote.Produk.IsInternational) ? "" : "02",                                                   //21
            };

            return(dataMatrixModel);
        }
        private static string GetLabelConnoteZplCode(ConsigmentRequest item, Consignment itemHasConnote)
        {
            DataMatrixModel dataMatrixModel = GetDataMatrix2DBarCodeModel(item, itemHasConnote);

            var dataMatrixCodeThermal = $"{dataMatrixModel.versionHeader}_5e{dataMatrixModel.connoteNum}_5e{dataMatrixModel.recipientPostcode}_5e{dataMatrixModel.countryCode}_5e{dataMatrixModel.productCode}_5e{dataMatrixModel.parentConnote}_5e{dataMatrixModel.mpsIndicator}_5e" +
                                        $"{dataMatrixModel.senderPhoneNum}_5e{dataMatrixModel.senderEmail}_5e{dataMatrixModel.senderRefNo}_5e{dataMatrixModel.customerAccNum}_5e{dataMatrixModel.recipientPhoneNum}_5e{dataMatrixModel.recipientEmail}_5e{dataMatrixModel.weight}_5e{dataMatrixModel.dimensionVol}_5e" +
                                        $"{dataMatrixModel.codAmount}_5e{dataMatrixModel.ccodAmount}_5e{dataMatrixModel.valueAdded}_5e{dataMatrixModel.itemCategory}_5e{dataMatrixModel.amountPaid}_5e{dataMatrixModel.zone}";

            var pemberiAddressLine2      = (!String.IsNullOrEmpty(itemHasConnote.Pemberi.Address.Address4) ? itemHasConnote.Pemberi.Address.Address3 + ", " + itemHasConnote.Pemberi.Address.Address4 : itemHasConnote.Pemberi.Address.Address3);
            var penerimaAddressLine2     = (!String.IsNullOrEmpty(itemHasConnote.Penerima.Address.Address4) ? itemHasConnote.Penerima.Address.Address3 + ", " + itemHasConnote.Penerima.Address.Address4 : itemHasConnote.Penerima.Address.Address3);
            var internationalDescription = (!String.IsNullOrEmpty(itemHasConnote.Produk.CustomDeclaration.ContentDescription2) ? itemHasConnote.Produk.CustomDeclaration.ContentDescription1 + " " + itemHasConnote.Produk.CustomDeclaration.ContentDescription2 + " " + itemHasConnote.Produk.CustomDeclaration.ContentDescription3 : itemHasConnote.Produk.CustomDeclaration.ContentDescription1);
            var connoteDate                  = (item.Payment.IsPickupScheduled ? item.Pickup.DateReady : item.ChangedDate);
            var volumetricWeight             = (itemHasConnote.Produk.Width * itemHasConnote.Produk.Length * itemHasConnote.Produk.Height) / 6000;
            var itemCategory                 = (itemHasConnote.Produk.ItemCategory == "01" ? "DOCUMENT" : "MERCHANDISE");
            var productType                  = (itemHasConnote.Produk.IsInternational ? "INTERNATIONAL" : "DOMESTIC");
            var chargeOnDelivery             = itemHasConnote.Produk.Est.CodAmount > 0 ? ("COD : RM " + itemHasConnote.Produk.Est.CodAmount.ToString("0.00")) : ("CCOD : RM " + itemHasConnote.Produk.Est.CcodAmount.ToString("0.00"));
            var textChargeOnDeliveryCustCopy = (itemHasConnote.Produk.Est.CodAmount > 0 || itemHasConnote.Produk.Est.CcodAmount > 0 ? "JUMLAH " + chargeOnDelivery : "");
            var textChargeOnDeliveryPPLCopy  = (itemHasConnote.Produk.Est.CodAmount > 0 || itemHasConnote.Produk.Est.CcodAmount > 0 ? chargeOnDelivery : "");
            var routingCode                  = itemHasConnote.Produk.IsInternational ? "" : itemHasConnote.Bill.RoutingCode;

            var zplCode = "^XA~TA000~JSN^LT0^MNW^MTT^PON^PMN^LH0,0^JMA^PR5,5~SD15^JUS^LRN^CI0^XZ";

            zplCode += "^XA";
            zplCode += "^MMT";
            zplCode += "^PW812";
            zplCode += "^LL1242";
            zplCode += "^LS0";
            zplCode += "^FT27,644^AQ^FH^FDKEPADA :^FS";
            zplCode += "^FT27,672^AQ^FH^FD" + itemHasConnote.Penerima.ContactPerson.ToUpper() + "^FS";
            zplCode += "^FT27,700^AQ^FH^FD" + itemHasConnote.Penerima.Address.Address1.ToUpper() + "^FS";
            zplCode += "^FS^FT27,728^AQ^FH^FD" + itemHasConnote.Penerima.Address.Address2.ToUpper() + "^FS";
            zplCode += "^FS^FT27,756^AQ^FH^FD" + (!String.IsNullOrEmpty(itemHasConnote.Penerima.Address.Address3) ? itemHasConnote.Penerima.Address.Address3.ToUpper() : "") + "^FS";
            zplCode += "^FS^FT27,784^AQ^FH^FD" + (!String.IsNullOrEmpty(itemHasConnote.Penerima.Address.Address4) ? itemHasConnote.Penerima.Address.Address4.ToUpper() : "") + "^FS";
            zplCode += "^FS^FT27,812^AQ^FH^FD" + itemHasConnote.Penerima.Address.City.ToUpper() + "^FS";
            zplCode += "^FT27,840^AQ^FH^FD" + itemHasConnote.Penerima.Address.State.ToUpper() + "^FS";
            zplCode += "^FT27,868^AQ^FH^FD" + itemHasConnote.Penerima.Address.Postcode + "^FS";
            zplCode += "^FO5,617^GB806,0,1^FS";
            zplCode += "^FO5,923^GB806,0,1^FS";
            zplCode += "^FO7,401^GB794,0,1^FS";
            zplCode += "^FT382,648^AQ^FH^FDRUJ. PENERIMA : " + (!String.IsNullOrEmpty(itemHasConnote.Produk.Est.ReceiverReferenceNo) ? itemHasConnote.Produk.Est.ReceiverReferenceNo.ToUpper() : "") + "^FS";
            zplCode += "^FT558,432^AQ^FH^FD" + item.UserId + "^FS";
            zplCode += "^FT540,963^AU,48,124^FH^FD" + itemHasConnote.Penerima.Address.Postcode + "^FS";
            zplCode += "^FT28,901^AQ^FH^FDTEL : " + itemHasConnote.Penerima.ContactInformation.ContactNumber + "^FS";
            zplCode += "^FT26,954^AQ^FH^FDPOSKOD : ^FS";
            zplCode += "^FT254,901^AQ^FH^FDTEL2 : " + itemHasConnote.Penerima.ContactInformation.AlternativeContactNumber + "^FS";
            zplCode += "^BY2,3,74^FT455,1191^BCN,,Y,N";
            zplCode += "^FD" + itemHasConnote.ConNote.ToUpper() + "^FS";
            zplCode += "^BY2,3,110^FT423,148^BCN,,Y,N";
            zplCode += "^FD" + itemHasConnote.ConNote.ToUpper() + "^FS";
            zplCode += "^FT28,429^AQ^FH^FDDARIPADA :^FS";
            zplCode += "^FT27,208^AQ^FH^FDMAKLUMAT ITEM^FS";
            zplCode += "^FT325,307^AP^FH^FD" + (itemHasConnote.Produk.ValueAddedDeclaredValue != 0 ? "Insurance :      YES" : "") + "^FS^FT500,307^AP^FH^FD" + (itemHasConnote.Produk.ValueAddedDeclaredValue != 0 ? ("Value : RM " + itemHasConnote.Produk.ValueAddedDeclaredValue) : "") + "^FS";
            zplCode += "^FT325,284^AP^FH^FDKeterangan :^FS";
            zplCode += "^FT325,261^AP^FH^FDJenis :^FS";
            zplCode += "^FT421,284^AP^FH^FD" + (itemHasConnote.Produk.IsInternational ? internationalDescription : itemHasConnote.Produk.Description).ToUpper() + "^FS";
            zplCode += "^FT325,238^AP^FH^FDProduk :^FS";
            zplCode += "^FT421,261^AP^FH^FD" + itemCategory + "^FS";
            zplCode += "^FT325,211^AQ^FH^FDRUJ. TRANSAKSI : " + item.ReferenceNo.ToUpper() + "^FS";
            zplCode += "^FT421,236^AP^FH^FDCOURIER CHARGES - " + productType + "^FS";
            zplCode += "^FT27,297^AP^FH^FDVolumetrik :^FS";
            zplCode += "^FT123,297^AP^FH^FD" + volumetricWeight.ToString("0.00") + "KG^FS";
            zplCode += "^FT27,277^AP^FH^FDSebenar :^FS";
            zplCode += "^FT124,279^AP^FH^FD" + itemHasConnote.Bill.ActualWeight.ToString("0.00") + " KG^FS";
            zplCode += "^FT28,259^AP^FH^FDBerat :^FS";
            zplCode += "^FT123,261^AP^FH^FD" + itemHasConnote.Produk.Weight.ToString("0.00") + " KG^FS";
            zplCode += "^FT402,431^AQ^FH^FDAKAUN NO :^FS";
            zplCode += "^FT250,605^AP^FH^FDTEL2 : " + itemHasConnote.Pemberi.ContactInformation.AlternativeContactNumber + "^FS";
            zplCode += "^FT500,605^AP^FH^FDRUJ. PENGIRIM : " + (!String.IsNullOrEmpty(itemHasConnote.Produk.Est.ShipperReferenceNo) ? itemHasConnote.Produk.Est.ShipperReferenceNo.ToUpper() : "") + "^FS";
            zplCode += "^FT25,605^AP^FH^FDTEL : " + itemHasConnote.Pemberi.ContactInformation.ContactNumber + "^FS";
            zplCode += "^FT29,458^AP^FH^FD" + (!String.IsNullOrEmpty(itemHasConnote.Pemberi.CompanyName) ? itemHasConnote.Pemberi.CompanyName.ToUpper() : "") + "^FS";
            zplCode += "^FT29,479^AP^FH^FD" + (itemHasConnote.Pemberi.Address.Address1 + ", " + itemHasConnote.Pemberi.Address.Address2).ToUpper() + "^FS";
            zplCode += "^FT29,500^AP^FH^FD" + (!String.IsNullOrEmpty(pemberiAddressLine2) ? pemberiAddressLine2.ToUpper() : "") + "^FS";
            zplCode += "^FT29,521^AP^FH^FD" + itemHasConnote.Pemberi.Address.City.ToUpper() + "^FS";
            zplCode += "^FT29,542^AP^FH^FD" + itemHasConnote.Pemberi.Address.State.ToUpper() + "^FS";
            zplCode += "^FT29,563^AP^FH^FD" + itemHasConnote.Pemberi.Address.Postcode + "^FS";
            zplCode += "^FT31,1043^AP^FH^FDKepada:^FS";
            zplCode += "^FT31,1064^AP^FH^FD" + (!String.IsNullOrEmpty(itemHasConnote.Penerima.ContactPerson) ? itemHasConnote.Penerima.ContactPerson.ToUpper() : "") + "^FS";
            zplCode += "^FT31,1085^AP^FH^FD" + (itemHasConnote.Penerima.Address.Address1 + ", " + itemHasConnote.Penerima.Address.Address2).ToUpper() + "^FS";
            zplCode += "^FT31,1106^AP^FH^FD" + (!String.IsNullOrEmpty(penerimaAddressLine2) ? penerimaAddressLine2.ToUpper() : "") + "^FS";
            zplCode += "^FT31,1127^AP^FH^FD" + itemHasConnote.Penerima.Address.City.ToUpper() + "^FS";
            zplCode += "^FT31,1148^AP^FH^FD" + itemHasConnote.Penerima.Address.State.ToUpper() + "^FS";
            zplCode += "^FT31,1169^AP^FH^FD" + itemHasConnote.Penerima.Address.Postcode + "^FS";
            zplCode += "^FT309,1169^AP^FH^FD" + (itemHasConnote.Produk.ValueAddedDeclaredValue != 0 ? ("Value : RM " + itemHasConnote.Produk.ValueAddedDeclaredValue) : "") + "^FS^FT168,1169^AP^FH^FD" + (itemHasConnote.Produk.ValueAddedDeclaredValue != 0 ? "Insurance : YES" : "") + "^FS";
            zplCode += "^FT309,1191^AP^FH^FD" + textChargeOnDeliveryPPLCopy + "^FS";
            zplCode += "^FT168,1191^AP^FH^FDTel2 : " + itemHasConnote.Penerima.ContactInformation.AlternativeContactNumber + "^FS";
            zplCode += "^FT33,1191^AP^FH^FDTel : " + itemHasConnote.Penerima.ContactInformation.ContactNumber + "^FS";
            zplCode += "^FT27,240^AP^FH^FDTarikh :^FS";
            zplCode += "^FT121,240^AP^FH^FD" + connoteDate.ToString("d MMMM yyyy") + "^FS";
            zplCode += "^FT180,378^AV^FH^FD" + routingCode + "^FS";
            zplCode += "^FS^FT434,1194^AT^FH^FT392,571^AT^FH^FD" + textChargeOnDeliveryPPLCopy + "^FS";
            zplCode += "^FT262,1040^AQ^FH^FDSalinan Pejabat^FS";
            zplCode += "^FS^FT150,956^AT^FH^FD*" + itemHasConnote.ConNote.ToUpper() + "*^FS";
            zplCode += "^BY128,128^FT620,920^BXN,4,200,0,0,1,~";
            zplCode += "^FH^FD" + dataMatrixCodeThermal + "^FS";
            zplCode += "^PQ1,0,1,Y^XZ";
            return(zplCode);
        }