Changeset View
Changeset View
Standalone View
Standalone View
branches/5.2.x/units/orders/orders_config.php
Show First 20 Lines • Show All 256 Lines • ▼ Show 20 Line(s) | |||||
), | ), | ||||
'TableName' => TABLE_PREFIX . 'Orders', | 'TableName' => TABLE_PREFIX . 'Orders', | ||||
'CalculatedFields' => Array ( | 'CalculatedFields' => Array ( | ||||
'' => Array ( | '' => Array ( | ||||
'CustomerName' => 'IF( ISNULL(u.Username), IF (%1$s.PortalUserId = ' . USER_ROOT . ', "root", IF (%1$s.PortalUserId = ' . USER_GUEST . ', "Guest", "n/a")), CONCAT(u.FirstName," ",u.LastName) )', | 'CustomerName' => 'IF( ISNULL(u.Username), IF (%1$s.PortalUserId = ' . USER_ROOT . ', "root", IF (%1$s.PortalUserId = ' . USER_GUEST . ', "Guest", "n/a")), CONCAT(u.FirstName," ",u.LastName) )', | ||||
'Username' => 'IF( ISNULL(u.Username),"root",IF(u.Username = "", u.Email, u.Username))', | 'Username' => 'IF( ISNULL(u.Username),"root",IF(u.Username = "", u.Email, u.Username))', | ||||
'OrderNumber' => 'CONCAT(LPAD(Number,6,"0"),\'-\',LPAD(SubNumber,3,"0") )', | 'OrderNumber' => 'CONCAT(LPAD(%1$s.Number,6,"0"),\'-\',LPAD(%1$s.SubNumber,3,"0") )', | ||||
'SubtotalWithoutDiscount' => '(SubTotal + DiscountTotal)', | 'SubtotalWithoutDiscount' => '(%1$s.SubTotal + %1$s.DiscountTotal)', | ||||
'SubtotalWithDiscount' => '(SubTotal)', | 'SubtotalWithDiscount' => '(%1$s.SubTotal)', | ||||
'AmountWithoutVAT' => '(SubTotal+IF(ShippingTaxable=1, ShippingCost, 0)+IF(ProcessingTaxable=1, ProcessingFee, 0)-IF(VATIncluded=1,VAT,0))', | 'AmountWithoutVAT' => '(%1$s.SubTotal+IF(%1$s.ShippingTaxable=1, %1$s.ShippingCost, 0)+IF(%1$s.ProcessingTaxable=1, %1$s.ProcessingFee, 0)-IF(%1$s.VATIncluded=1,%1$s.VAT,0))', | ||||
'TotalAmount' => 'SubTotal+ShippingCost+IF(VATIncluded=1,0,VAT)+ProcessingFee+InsuranceFee-GiftCertificateDiscount', | 'TotalAmount' => '%1$s.SubTotal+%1$s.ShippingCost+IF(%1$s.VATIncluded=1,0,%1$s.VAT)+%1$s.ProcessingFee+%1$s.InsuranceFee-%1$s.GiftCertificateDiscount', | ||||
'CouponCode' => 'pc.Code', | 'CouponCode' => 'pc.Code', | ||||
'CouponName' => 'pc.Name', | 'CouponName' => 'pc.Name', | ||||
'AffiliateUser' => 'IF(au.PortalUserId IS NULL, "!la_None!", IF(au.Username = "", au.Email, au.Username))', | 'AffiliateUser' => 'IF(au.PortalUserId IS NULL, "!la_None!", IF(au.Username = "", au.Email, au.Username))', | ||||
'AffiliatePortalUserId' => 'af.PortalUserId', | 'AffiliatePortalUserId' => 'af.PortalUserId', | ||||
'GiftCertificateCode' => 'gc.Code', | 'GiftCertificateCode' => 'gc.Code', | ||||
'GiftCertificateRecipient' => 'gc.Recipient', | 'GiftCertificateRecipient' => 'gc.Recipient', | ||||
'ShippingSubTotal' => '%1$s.ShippingCost + %1$s.InsuranceFee', | 'ShippingSubTotal' => '%1$s.ShippingCost + %1$s.InsuranceFee', | ||||
), | ), | ||||
'myorders' => Array ( | 'myorders' => Array ( | ||||
'OrderNumber' => 'CONCAT(LPAD(Number,6,"0"),\'-\',LPAD(SubNumber,3,"0") )', | 'OrderNumber' => 'CONCAT(LPAD(%1$s.Number,6,"0"),\'-\',LPAD(%1$s.SubNumber,3,"0") )', | ||||
'SubtotalWithoutDiscount' => '(SubTotal + DiscountTotal)', | 'SubtotalWithoutDiscount' => '(%1$s.SubTotal + %1$s.DiscountTotal)', | ||||
'SubtotalWithDiscount' => '(SubTotal)', | 'SubtotalWithDiscount' => '(%1$s.SubTotal)', | ||||
'AmountWithoutVAT' => '(SubTotal+IF(ShippingTaxable=1, ShippingCost, 0)+IF(ProcessingTaxable=1, ProcessingFee, 0)-IF(VATIncluded=1,VAT,0))', | 'AmountWithoutVAT' => '(%1$s.SubTotal+IF(%1$s.ShippingTaxable=1, %1$s.ShippingCost, 0)+IF(%1$s.ProcessingTaxable=1, %1$s.ProcessingFee, 0)-IF(%1$s.VATIncluded=1,%1$s.VAT,0))', | ||||
'TotalAmount' => 'SubTotal+ShippingCost+IF(VATIncluded=1,0,VAT)+ProcessingFee+InsuranceFee-GiftCertificateDiscount', | 'TotalAmount' => '%1$s.SubTotal+%1$s.ShippingCost+IF(%1$s.VATIncluded=1,0,%1$s.VAT)+%1$s.ProcessingFee+%1$s.InsuranceFee-%1$s.GiftCertificateDiscount', | ||||
/*'ItemsCount' => 'COUNT(%1$s.OrderId)',*/ | /*'ItemsCount' => 'COUNT(%1$s.OrderId)',*/ | ||||
'ShippingSubTotal' => '%1$s.ShippingCost + %1$s.InsuranceFee', | 'ShippingSubTotal' => '%1$s.ShippingCost + %1$s.InsuranceFee', | ||||
), | ), | ||||
), | ), | ||||
// %1$s - table name of object | // %1$s - table name of object | ||||
// %2$s - calculated fields | // %2$s - calculated fields | ||||
'ListSQLs' => Array ( | 'ListSQLs' => Array ( | ||||
'' => ' SELECT %1$s.* %2$s | '' => ' SELECT %1$s.* %2$s | ||||
▲ Show 20 Lines • Show All 312 Lines • Show Last 20 Lines |