Esempio n. 1
0
        public static string AddShipperToChart(int shipeprId)
        {
            string parentAccountId = "", accountId;

            parentAccountId = ((int)AccountingChartEnum.AccountsRecievable).ToString();
            var carrVm = ShipperHelper.GetShipperInfo(shipeprId);

            string accNameEn = carrVm.ShipperNameEn;
            string accNameAr = string.IsNullOrEmpty(carrVm.ShipperNameAr) ? carrVm.ShipperNameAr : carrVm.ShipperNameEn;

            //Add new accountId to the chart
            accountId = AccountingChartHelper
                        .AddAccountToChart(accNameEn, accNameEn, parentAccountId);

            AccountingChartHelper.AddAccountIdToObj(accountId, "Shipper", shipeprId, "ShipperId");

            return(accountId);
        }
Esempio n. 2
0
        internal static string GetTaxDepositAccountId(byte orderFrom, int?shipperId, int?consigneeId)
        {
            string accountNameEn = "", accountNameAr = "", accountId = "";

            if (orderFrom == 1) //export
            {
                var shipper = ShipperHelper.GetShipperInfo(shipperId.Value);
                accountId = shipper.TaxDepositAccountId;
                if (string.IsNullOrEmpty(accountId))
                {
                    accountNameEn = shipper.ShipperNameEn + " Tax Deposit";
                    accountNameAr = string.IsNullOrEmpty(shipper.ShipperNameAr) ? accountNameEn  : shipper.ShipperNameAr + " ضريبة الخصم ";
                    string parentAccountId = ((int)AccountingChartEnum.TaxDepositDebit).ToString();
                    //Add new accountId to the chart
                    accountId = AccountingChartHelper.AddAccountToChart(accountNameEn, accountNameAr, parentAccountId);
                    //update AccountId column shipper table
                    AccountingChartHelper.AddAccountIdToObj(accountId, "shipper", shipper.ShipperId, "ShipperId", "TaxDepositAccountId");
                }
            }
            else if (orderFrom == 2) //import
            {
                var consignee = ConsigneeHelper.GetConsigneeInfo(consigneeId.Value);
                accountId = consignee.TaxDepositAccountId;
                if (string.IsNullOrEmpty(accountId))
                {
                    accountNameEn = consignee.ConsigneeNameEn + " Tax Deposit";
                    accountNameAr = string.IsNullOrEmpty(consignee.ConsigneeNameAr) ? accountNameEn + " Tax Deposit" : consignee.ConsigneeNameAr + " ضريبة الخصم ";
                    string parentAccountId = ((int)AccountingChartEnum.TaxDepositDebit).ToString();
                    //Add new accountId to the chart
                    accountId = AccountingChartHelper.AddAccountToChart(accountNameEn, accountNameAr, parentAccountId);
                    //update AccountId column shipper table
                    AccountingChartHelper.AddAccountIdToObj(accountId, "consignee", consignee.ConsigneeId, "ConsigneeId", "TaxDepositAccountId");
                }
            }

            return(accountId);
        }